2025-11-14 23:05:57 +01:00
|
|
|
import { IResource } from './ResourceTypes';
|
2025-11-18 22:33:48 +01:00
|
|
|
import { CalendarView } from './CalendarTypes';
|
2025-11-14 23:05:57 +01:00
|
|
|
|
2025-11-14 16:25:03 +01:00
|
|
|
/**
|
|
|
|
|
* Column information container
|
|
|
|
|
* Contains both identifier and actual data for a column
|
|
|
|
|
*/
|
|
|
|
|
export interface IColumnInfo {
|
|
|
|
|
identifier: string; // "2024-11-13" (date mode) or "person-1" (resource mode)
|
2025-11-14 23:05:57 +01:00
|
|
|
data: Date | IResource; // Date for date-mode, IResource for resource-mode
|
2025-11-14 16:25:03 +01:00
|
|
|
}
|
|
|
|
|
|
2025-11-13 23:35:29 +01:00
|
|
|
/**
|
|
|
|
|
* IColumnDataSource - Defines the contract for providing column data
|
|
|
|
|
*
|
|
|
|
|
* This interface abstracts away whether columns represent dates or resources,
|
|
|
|
|
* allowing the calendar to switch between date-based and resource-based views.
|
|
|
|
|
*/
|
|
|
|
|
export interface IColumnDataSource {
|
|
|
|
|
/**
|
2025-11-14 16:25:03 +01:00
|
|
|
* Get the list of columns to render
|
|
|
|
|
* @returns Array of column information
|
2025-11-13 23:35:29 +01:00
|
|
|
*/
|
2025-11-22 19:42:12 +01:00
|
|
|
getColumns(): Promise<IColumnInfo[]>;
|
2025-11-13 23:35:29 +01:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Get the type of columns this datasource provides
|
|
|
|
|
*/
|
|
|
|
|
getType(): 'date' | 'resource';
|
2025-11-18 22:33:48 +01:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Update the current date for column calculations
|
|
|
|
|
* @param date - The new current date
|
|
|
|
|
*/
|
|
|
|
|
setCurrentDate(date: Date): void;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Update the current view (day/week/month)
|
|
|
|
|
* @param view - The new calendar view
|
|
|
|
|
*/
|
|
|
|
|
setCurrentView(view: CalendarView): void;
|
2025-11-13 23:35:29 +01:00
|
|
|
}
|