import { ICalendarApp, CalendarType, TNode, SidebarHeaderSlotArgs, CreateCalendarDialogProps, Event, CalendarPlugin } from '@dayflow/core'; export { SidebarHeaderSlotArgs } from '@dayflow/core'; interface CalendarSidebarRenderProps { app: ICalendarApp; calendars: CalendarType[]; toggleCalendarVisibility: (calendarId: string, visible: boolean) => void; toggleAll: (visible: boolean) => void; isCollapsed: boolean; setCollapsed: (collapsed: boolean) => void; showEventDots?: boolean; renderCalendarContextMenu?: (calendar: CalendarType, onClose: () => void) => TNode; renderSidebarHeader?: (args: SidebarHeaderSlotArgs) => TNode; createCalendarMode?: 'inline' | 'modal'; renderCreateCalendarDialog?: (props: CreateCalendarDialogProps) => TNode; editingCalendarId?: string | null; setEditingCalendarId?: (id: string | null) => void; onCreateCalendar?: (source?: string) => void; onSubscribeCalendar?: (calendar: CalendarType, events: Event[]) => Promise; onLoadSubscription?: (calendar: CalendarType) => Promise; onReorder?: (calendars: CalendarType[]) => void | Promise; groups?: string[]; onGroupCreate?: (groupName: string) => void | Promise; onGroupRename?: (previousName: string, nextName: string, calendars: CalendarType[]) => void | Promise; onGroupDelete?: (groupName: string, calendars: CalendarType[]) => void | Promise; onGroupReorder?: (groups: string[]) => void | Promise; componentsOrder?: ('calendarList' | 'miniCalendar')[]; groupStatus?: Record; } interface SidebarPluginConfig { width?: number | string; miniWidth?: string; initialCollapsed?: boolean; showEventDots?: boolean; createCalendarMode?: 'inline' | 'modal'; render?: (props: CalendarSidebarRenderProps) => TNode; renderCalendarContextMenu?: (calendar: CalendarType, onClose: () => void) => TNode; renderSidebarHeader?: (args: SidebarHeaderSlotArgs) => TNode; renderCreateCalendarDialog?: (props: CreateCalendarDialogProps) => TNode; onSubscribeCalendar?: (calendar: CalendarType, events: Event[]) => Promise; onLoadSubscription?: (calendar: CalendarType) => Promise; onReorder?: (calendars: CalendarType[]) => void | Promise; groups?: string[]; onGroupCreate?: (groupName: string) => void | Promise; onGroupRename?: (previousName: string, nextName: string, calendars: CalendarType[]) => void | Promise; onGroupDelete?: (groupName: string, calendars: CalendarType[]) => void | Promise; onGroupReorder?: (groups: string[]) => void | Promise; componentsOrder?: ('calendarList' | 'miniCalendar')[]; groupStatus?: Record; } /** * Programmatic API returned by `app.getPlugin('sidebar')`. * * @example * const sidebar = app.getPlugin('sidebar'); * sidebar?.collapse(); */ interface SidebarService { /** Collapse the sidebar. No-ops if the sidebar has not yet rendered. */ collapse: () => void; /** Expand the sidebar. No-ops if the sidebar has not yet rendered. */ expand: () => void; /** Set collapsed state explicitly. */ setCollapsed: (collapsed: boolean) => void; /** Returns the current collapsed state. */ isCollapsed: () => boolean; } declare function createSidebarPlugin(config?: SidebarPluginConfig): CalendarPlugin; export { createSidebarPlugin }; export type { CalendarSidebarRenderProps, SidebarPluginConfig, SidebarService };