Major refactor into type safe TS
With a risk oof rolling it all back
This commit is contained in:
parent
c08fa02c29
commit
48d1fd681c
19 changed files with 449 additions and 81 deletions
23
src/index.ts
23
src/index.ts
|
|
@ -1,15 +1,16 @@
|
|||
// Main entry point for Calendar Plantempus
|
||||
import { eventBus } from './core/EventBus.js';
|
||||
import { calendarConfig } from './core/CalendarConfig.js';
|
||||
import { CalendarTypeFactory } from './factories/CalendarTypeFactory.js';
|
||||
import { ManagerFactory } from './factories/ManagerFactory.js';
|
||||
import { DateCalculator } from './utils/DateCalculator.js';
|
||||
import { URLManager } from './utils/URLManager.js';
|
||||
import { eventBus } from './core/EventBus';
|
||||
import { calendarConfig } from './core/CalendarConfig';
|
||||
import { CalendarTypeFactory } from './factories/CalendarTypeFactory';
|
||||
import { ManagerFactory } from './factories/ManagerFactory';
|
||||
import { DateCalculator } from './utils/DateCalculator';
|
||||
import { URLManager } from './utils/URLManager';
|
||||
import { CalendarManagers } from './types/ManagerTypes';
|
||||
|
||||
/**
|
||||
* Handle deep linking functionality after managers are initialized
|
||||
*/
|
||||
async function handleDeepLinking(managers: any): Promise<void> {
|
||||
async function handleDeepLinking(managers: CalendarManagers): Promise<void> {
|
||||
try {
|
||||
const urlManager = new URLManager(eventBus);
|
||||
const eventId = urlManager.parseEventIdFromURL();
|
||||
|
|
@ -58,8 +59,12 @@ async function initializeCalendar(): Promise<void> {
|
|||
// Handle deep linking after managers are initialized
|
||||
await handleDeepLinking(managers);
|
||||
|
||||
// Expose to window for debugging
|
||||
(window as any).calendarDebug = {
|
||||
// Expose to window for debugging (with proper typing)
|
||||
(window as Window & {
|
||||
calendarDebug?: {
|
||||
eventBus: typeof eventBus;
|
||||
} & CalendarManagers;
|
||||
}).calendarDebug = {
|
||||
eventBus,
|
||||
...managers
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue