Prepares the calendar component for month view implementation by introducing a strategy pattern for view management, splitting configuration settings, and consolidating events into a core set. It also removes dead code and enforces type safety, improving overall code quality and maintainability. Addresses critical issues identified in the code review, laying the groundwork for efficient feature addition.
33 lines
No EOL
567 B
TypeScript
33 lines
No EOL
567 B
TypeScript
/**
|
|
* Type definitions for calendar events
|
|
*/
|
|
|
|
export interface AllDayEvent {
|
|
id: string;
|
|
title: string;
|
|
start: Date | string;
|
|
end: Date | string;
|
|
allDay: true;
|
|
color?: string;
|
|
metadata?: {
|
|
color?: string;
|
|
category?: string;
|
|
location?: string;
|
|
};
|
|
}
|
|
|
|
export interface TimeEvent {
|
|
id: string;
|
|
title: string;
|
|
start: Date | string;
|
|
end: Date | string;
|
|
allDay?: false;
|
|
color?: string;
|
|
metadata?: {
|
|
color?: string;
|
|
category?: string;
|
|
location?: string;
|
|
};
|
|
}
|
|
|
|
export type CalendarEventData = AllDayEvent | TimeEvent; |