// === CORE ===

// App
export { CalendarApp } from './core/CalendarApp';
export { CalendarOrchestrator } from './core/CalendarOrchestrator';
export { CalendarEvents } from './core/CalendarEvents';
export type {
  RenderPayload,
  WorkweekChangePayload,
  ViewUpdatePayload
} from './core/CalendarEvents';

// Infrastructure
export { EventBus } from './core/EventBus';
export { DateService } from './core/DateService';
export { ViewTemplate, ViewConfig, GroupingConfig } from './core/ViewConfig';
export { IRenderer, IRenderContext } from './core/IGroupingRenderer';
export { IGroupingStore } from './core/IGroupingStore';
export { BaseGroupingRenderer, IGroupingRendererConfig } from './core/BaseGroupingRenderer';
export { buildPipeline, Pipeline } from './core/RenderBuilder';
export { NavigationAnimator } from './core/NavigationAnimator';
export { ScrollManager } from './core/ScrollManager';
export { HeaderDrawerManager } from './core/HeaderDrawerManager';
export { FilterTemplate } from './core/FilterTemplate';
export { EntityResolver } from './core/EntityResolver';
export type { IEntityResolver } from './core/IEntityResolver';

// Configuration interfaces
export type { ITimeFormatConfig } from './core/ITimeFormatConfig';
export type { IGridConfig } from './core/IGridConfig';

// Core Features
export { DateRenderer } from './features/date';
export { ResourceRenderer } from './features/resource';
export { EventRenderer } from './features/event';
export { eventsOverlap, calculateColumnLayout } from './features/event/EventLayoutEngine';
export type {
  IStackLink,
  IStackedEventLayout,
  IGridGroupLayout,
  IColumnLayout
} from './features/event/EventLayoutTypes';
export { TimeAxisRenderer } from './features/timeaxis/TimeAxisRenderer';
export { HeaderDrawerRenderer, HeaderDrawerLayoutEngine } from './features/headerdrawer';
export { ScheduleRenderer } from './features/schedule';

// Core Storage
export { IndexedDBContext, defaultDBConfig } from './storage/IndexedDBContext';
export type { IDBConfig } from './storage/IndexedDBContext';
export { BaseEntityService } from './storage/BaseEntityService';
export type { IEntityService } from './storage/IEntityService';
export type { IStore } from './storage/IStore';
export { SyncPlugin } from './storage/SyncPlugin';

// Event storage
export { EventService } from './storage/events/EventService';
export { EventStore } from './storage/events/EventStore';
export { EventSerialization } from './storage/events/EventSerialization';

// Resource storage
export { ResourceService } from './storage/resources/ResourceService';
export { ResourceStore } from './storage/resources/ResourceStore';

// Settings storage
export { SettingsService } from './storage/settings/SettingsService';
export { SettingsStore } from './storage/settings/SettingsStore';

// ViewConfig storage
export { ViewConfigService } from './storage/viewconfigs/ViewConfigService';
export { ViewConfigStore } from './storage/viewconfigs/ViewConfigStore';

// Core Managers
export { DragDropManager } from './managers/DragDropManager';
export { EdgeScrollManager } from './managers/EdgeScrollManager';
export { ResizeManager } from './managers/ResizeManager';
export { EventPersistenceManager } from './managers/EventPersistenceManager';

// Position utilities
export {
  calculateEventPosition,
  minutesToPixels,
  pixelsToMinutes,
  snapToGrid
} from './utils/PositionUtils';
export type { EventPosition } from './utils/PositionUtils';

// Types
export type {
  ICalendarEvent,
  IResource,
  IEventBus,
  ISync,
  SyncStatus,
  EntityType,
  CalendarEventType,
  ResourceType,
  ITeam,
  IDepartment,
  IBooking,
  BookingStatus,
  IBookingService,
  ICustomer,
  IDataEntity,
  IEventLogEntry,
  IListenerEntry,
  IEntitySavedPayload,
  IEntityDeletedPayload,
  IEventUpdatedPayload
} from './types/CalendarTypes';

export type {
  TenantSetting,
  IGridSettings,
  IWorkweekPreset
} from './types/SettingsTypes';

export type {
  IScheduleOverride,
  ITimeSlot,
  IWeekSchedule,
  WeekDay
} from './types/ScheduleTypes';

// Drag types
export type {
  IMousePosition,
  IDragStartPayload,
  IDragMovePayload,
  IDragEndPayload,
  IDragCancelPayload,
  IDragColumnChangePayload,
  IDragEnterHeaderPayload,
  IDragMoveHeaderPayload,
  IDragLeaveHeaderPayload
} from './types/DragTypes';

// Resize types
export type {
  IResizeStartPayload,
  IResizeEndPayload
} from './types/ResizeTypes';

// Audit types
export type {
  IAuditEntry,
  IAuditLoggedPayload
} from './types/AuditTypes';

export { SwpEvent } from './types/SwpEvent';

// Core Events constants
export { CoreEvents } from './constants/CoreEvents';

// Repository interface (for custom implementations)
export type { IApiRepository } from './repositories/IApiRepository';

// DI helpers
export {
  createCalendarContainer,
  registerCoreServices,
  defaultTimeFormatConfig,
  defaultGridConfig
} from './CompositionRoot';
export type { ICalendarOptions } from './CompositionRoot';
