2025-07-24 22:17:38 +02:00
|
|
|
// Calendar type definitions
|
|
|
|
|
|
2025-08-09 00:31:44 +02:00
|
|
|
// Time period view types (how much time to display)
|
|
|
|
|
export type ViewPeriod = 'day' | 'week' | 'month';
|
2025-07-24 22:17:38 +02:00
|
|
|
|
2025-08-09 00:31:44 +02:00
|
|
|
// Calendar mode types (how to organize the data)
|
|
|
|
|
export type CalendarMode = 'date' | 'resource';
|
2025-08-07 00:15:44 +02:00
|
|
|
|
2025-08-20 21:51:49 +02:00
|
|
|
// Type aliases
|
|
|
|
|
export type CalendarView = ViewPeriod;
|
2025-07-24 22:17:38 +02:00
|
|
|
|
|
|
|
|
export type SyncStatus = 'synced' | 'pending' | 'error';
|
|
|
|
|
|
2025-08-07 00:15:44 +02:00
|
|
|
export interface Resource {
|
|
|
|
|
name: string;
|
|
|
|
|
displayName: string;
|
|
|
|
|
avatarUrl: string;
|
|
|
|
|
employeeId: string;
|
|
|
|
|
events: CalendarEvent[];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export interface ResourceCalendarData {
|
|
|
|
|
date: string;
|
|
|
|
|
resources: Resource[];
|
|
|
|
|
}
|
|
|
|
|
|
2025-08-16 00:51:12 +02:00
|
|
|
export interface RenderContext {
|
|
|
|
|
container: HTMLElement;
|
|
|
|
|
startDate: Date;
|
|
|
|
|
endDate: Date;
|
|
|
|
|
}
|
|
|
|
|
|
2025-07-24 22:17:38 +02:00
|
|
|
export interface CalendarEvent {
|
|
|
|
|
id: string;
|
|
|
|
|
title: string;
|
2025-09-09 14:35:21 +02:00
|
|
|
start: Date;
|
|
|
|
|
end: Date;
|
2025-08-09 00:31:44 +02:00
|
|
|
type: string; // Flexible event type - can be any string value
|
2025-07-24 22:17:38 +02:00
|
|
|
allDay: boolean;
|
|
|
|
|
syncStatus: SyncStatus;
|
2025-08-09 00:31:44 +02:00
|
|
|
|
2025-08-07 00:15:44 +02:00
|
|
|
// Resource information (only present in resource calendar mode)
|
2025-08-09 00:31:44 +02:00
|
|
|
resource?: {
|
|
|
|
|
name: string;
|
|
|
|
|
displayName: string;
|
|
|
|
|
employeeId: string;
|
|
|
|
|
};
|
|
|
|
|
|
2025-07-24 22:17:38 +02:00
|
|
|
recurringId?: string;
|
|
|
|
|
metadata?: Record<string, any>;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export interface CalendarConfig {
|
2025-08-05 23:03:08 +02:00
|
|
|
// Scrollbar styling
|
|
|
|
|
scrollbarWidth: number; // Width of scrollbar in pixels
|
|
|
|
|
scrollbarColor: string; // Scrollbar thumb color
|
|
|
|
|
scrollbarTrackColor: string; // Scrollbar track color
|
|
|
|
|
scrollbarHoverColor: string; // Scrollbar thumb hover color
|
|
|
|
|
scrollbarBorderRadius: number; // Border radius for scrollbar thumb
|
|
|
|
|
|
2025-07-24 22:17:38 +02:00
|
|
|
// Interaction settings
|
|
|
|
|
allowDrag: boolean;
|
|
|
|
|
allowResize: boolean;
|
|
|
|
|
allowCreate: boolean;
|
|
|
|
|
|
|
|
|
|
// API settings
|
|
|
|
|
apiEndpoint: string;
|
|
|
|
|
dateFormat: string;
|
|
|
|
|
timeFormat: string;
|
|
|
|
|
|
|
|
|
|
// Feature flags
|
|
|
|
|
enableSearch: boolean;
|
|
|
|
|
enableTouch: boolean;
|
|
|
|
|
|
|
|
|
|
// Event defaults
|
|
|
|
|
defaultEventDuration: number; // Minutes
|
|
|
|
|
minEventDuration: number; // Minutes
|
|
|
|
|
maxEventDuration: number; // Minutes
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export interface EventLogEntry {
|
|
|
|
|
type: string;
|
2025-09-23 20:44:15 +02:00
|
|
|
detail: unknown;
|
2025-07-24 22:17:38 +02:00
|
|
|
timestamp: number;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export interface ListenerEntry {
|
|
|
|
|
eventType: string;
|
|
|
|
|
handler: EventListener;
|
|
|
|
|
options?: AddEventListenerOptions;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export interface IEventBus {
|
|
|
|
|
on(eventType: string, handler: EventListener, options?: AddEventListenerOptions): () => void;
|
|
|
|
|
once(eventType: string, handler: EventListener): () => void;
|
|
|
|
|
off(eventType: string, handler: EventListener): void;
|
2025-09-23 20:44:15 +02:00
|
|
|
emit(eventType: string, detail?: unknown): boolean;
|
2025-07-24 22:17:38 +02:00
|
|
|
getEventLog(eventType?: string): EventLogEntry[];
|
|
|
|
|
setDebug(enabled: boolean): void;
|
2025-10-06 21:55:52 +02:00
|
|
|
}
|