Calendar/src/types/ColumnDataSource.ts

28 lines
825 B
TypeScript
Raw Normal View History

/**
* 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)
data: Date | any; // Date for date-mode, IResource for resource-mode
}
/**
* 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 {
/**
* Get the list of columns to render
* @returns Array of column information
*/
getColumns(): IColumnInfo[];
/**
* Get the type of columns this datasource provides
*/
getType(): 'date' | 'resource';
}