2025-11-14 23:05:57 +01:00
|
|
|
import { IResource } from './ResourceTypes';
|
|
|
|
|
|
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-14 16:25:03 +01:00
|
|
|
getColumns(): IColumnInfo[];
|
2025-11-13 23:35:29 +01:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Get the type of columns this datasource provides
|
|
|
|
|
*/
|
|
|
|
|
getType(): 'date' | 'resource';
|
|
|
|
|
}
|