Major refactor into type safe TS

With a risk oof rolling it all back
This commit is contained in:
Janus C. H. Knudsen 2025-09-23 20:44:15 +02:00
parent c08fa02c29
commit 48d1fd681c
19 changed files with 449 additions and 81 deletions

View file

@ -8,6 +8,7 @@ import { ViewManager } from '../managers/ViewManager';
import { CalendarManager } from '../managers/CalendarManager';
import { DragDropManager } from '../managers/DragDropManager';
import { AllDayManager } from '../managers/AllDayManager';
import { CalendarManagers } from '../types/ManagerTypes';
/**
* Factory for creating and managing calendar managers with proper dependency injection
@ -27,17 +28,7 @@ export class ManagerFactory {
/**
* Create all managers with proper dependency injection
*/
public createManagers(eventBus: IEventBus): {
eventManager: EventManager;
eventRenderer: EventRenderingService;
gridManager: GridManager;
scrollManager: ScrollManager;
navigationManager: NavigationManager;
viewManager: ViewManager;
calendarManager: CalendarManager;
dragDropManager: DragDropManager;
allDayManager: AllDayManager;
} {
public createManagers(eventBus: IEventBus): CalendarManagers {
// Create managers in dependency order
const eventManager = new EventManager(eventBus);
@ -75,13 +66,10 @@ export class ManagerFactory {
/**
* Initialize all managers in the correct order
*/
public async initializeManagers(managers: {
calendarManager: CalendarManager;
[key: string]: any;
}): Promise<void> {
public async initializeManagers(managers: CalendarManagers): Promise<void> {
try {
await managers.calendarManager.initialize();
await managers.calendarManager.initialize?.();
} catch (error) {
throw error;
}