@oslokommune/punkt-elements
Version:
Komponentbiblioteket til Punkt, et designsystem laget av Oslo Origo
42 lines (41 loc) • 973 B
TypeScript
/**
* calendar.ts
*
* Type definitions for the calendar component.
* Used by both Elements and React calendar implementations
* and by the shared calendar helper functions.
*/
export interface IDateConstraints {
earliest: string | null;
latest: string | null;
excludedates: Date[];
excludeweekdays: string[];
}
export interface ICalendarGridDimensions {
firstDayOfMonth: Date;
lastDayOfMonth: Date;
startingDay: number;
numDays: number;
numRows: number;
numDaysPrevMonth: number;
initialWeek: number;
}
export interface IGridCellPosition {
rowIndex: number;
colIndex: number;
}
export type TDateRangeMap = {
[key: string]: boolean;
};
export interface ISelectionState {
selected: string[];
_selected: Date[];
inRange: TDateRangeMap;
}
export interface ISelectionOptions {
multiple: boolean;
maxMultiple: number;
range: boolean;
excludedates: Date[];
excludeweekdays: string[];
}