Initial commit: Calendar Plantempus project setup with TypeScript, ASP.NET Core, and event-driven architecture
This commit is contained in:
commit
f06c02121c
38 changed files with 8233 additions and 0 deletions
103
src/types/CalendarTypes.ts
Normal file
103
src/types/CalendarTypes.ts
Normal file
|
|
@ -0,0 +1,103 @@
|
|||
// Calendar type definitions
|
||||
|
||||
export type ViewType = 'day' | 'week' | 'month';
|
||||
export type CalendarView = ViewType; // Alias for compatibility
|
||||
|
||||
export type EventType = 'meeting' | 'meal' | 'work' | 'milestone';
|
||||
|
||||
export type SyncStatus = 'synced' | 'pending' | 'error';
|
||||
|
||||
export interface CalendarEvent {
|
||||
id: string;
|
||||
title: string;
|
||||
start: string; // ISO 8601
|
||||
end: string; // ISO 8601
|
||||
type: EventType;
|
||||
allDay: boolean;
|
||||
syncStatus: SyncStatus;
|
||||
recurringId?: string;
|
||||
resources?: string[];
|
||||
metadata?: Record<string, any>;
|
||||
}
|
||||
|
||||
export interface CalendarConfig {
|
||||
// View settings
|
||||
view: ViewType;
|
||||
weekDays: number; // 4-7 days for week view
|
||||
firstDayOfWeek: number; // 0 = Sunday, 1 = Monday
|
||||
|
||||
// Time settings
|
||||
dayStartHour: number; // Calendar starts at hour
|
||||
dayEndHour: number; // Calendar ends at hour
|
||||
workStartHour: number; // Work hours start
|
||||
workEndHour: number; // Work hours end
|
||||
snapInterval: number; // Minutes: 5, 10, 15, 30, 60
|
||||
|
||||
// Display settings
|
||||
hourHeight: number; // Pixels per hour
|
||||
showCurrentTime: boolean;
|
||||
showWorkHours: boolean;
|
||||
|
||||
// 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;
|
||||
detail: any;
|
||||
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;
|
||||
emit(eventType: string, detail?: any): boolean;
|
||||
getEventLog(eventType?: string): EventLogEntry[];
|
||||
setDebug(enabled: boolean): void;
|
||||
destroy(): void;
|
||||
}
|
||||
|
||||
export interface GridPosition {
|
||||
minutes: number;
|
||||
time: string;
|
||||
y: number;
|
||||
}
|
||||
|
||||
export interface Period {
|
||||
start: string;
|
||||
end: string;
|
||||
view: ViewType;
|
||||
}
|
||||
|
||||
export interface EventData {
|
||||
events: CalendarEvent[];
|
||||
meta: {
|
||||
start: string;
|
||||
end: string;
|
||||
view: ViewType;
|
||||
total: number;
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue