Types for Typescript

React Lightweight Calendar Types

Table of types in the case of using a component in a typescript application:



AttributeTypeComplex type
dataRecord<string, any>[]-
currentViewCurrentView | stringenum CurrentView { MONTH = 'MONTH', WEEK = 'WEEK', WEEK_TIME = 'WEEK_TIME', DAY = 'DAY', WEEK_IN_PLACE = 'WEEK_IN_PLACE', DAY_IN_PLACE = 'DAY_IN_PLACE'}
currentDatestring | Date-
setCurrentDate(date: string | Date) => void-
activeTimeDateFieldstring-
weekStartsOnWeekStartsOn | numberenum WeekStartsOn { SUNDAY = 0, MONDAY = 1, TUESDAY = 2, WEDNESDAY = 3, THURSDAY = 4, FRIDAY = 5, SATURDAY = 6 }
renderItem(data: Record<string, any>, isHovered: boolean) => JSX.Element-
renderItemText(data: Record<string, any>) => JSX.Element-
renderHeaderItem(data: Record<string, any>, extras: GetHeaderItemInfoFunc) => JSX.Elementinterface GetHeaderItemInfoFunc { gridColumn: string; isFromPrevious?: boolean; isFromNext?: boolean; }
renderHeaderItemText(data: Record<string, any>) => JSX.Element-
disableHoverEffectboolean-
colorDotsColorDot[]-
timeDateFormatTimeFormatinterface TimeFormat { day?: string; hour?: string; monthYear?: string; }
onDayNumberClick(day: string, event: React.MouseEvent<HTMLElement>) => void-
onDayStringClick(day: string | Date, event: React.MouseEvent<HTMLElement>) => void-
onHourClick(value: DateInfo | number, event: React.MouseEvent<HTMLElement>) => voidinterface DateInfo { isCurrentDay: boolean; isCurrentMonth?: boolean; date: string; day: number; month: number; year: number; hour?: number; timeDate: string; timeDateUTC: string; }
onColorDotClick(value: ColorDot, event: React.MouseEvent<HTMLElement>) => void-
onItemClick(item: Record<string, any>, event: React.MouseEvent<HTMLElement>) => void-
onCellClick(value: DateInfo, event: React.MouseEvent<HTMLElement>) => voidinterface DateInfo { isCurrentDay: boolean; isCurrentMonth?: boolean; date: string; day: number; month: number; year: number; hour?: number; timeDate: string; timeDateUTC: string; }
onCellHeaderClick(value: DateInfo, event: React.MouseEvent<HTMLElement>) => voidinterface DateInfo { isCurrentDay: boolean; isCurrentMonth?: boolean; date: string; day: number; month: number; year: number; hour?: number; timeDate: string; timeDateUTC: string; }
cellDisplayModeCellDisplayModeinterface CellDisplayMode { [key: string]: { state: CellDisplayModeState; inactiveCells: string[]; }; }

enum CellDisplayModeState { ALL_COLLAPSED = 'ALL_COLLAPSED', ALL_EXPANDED = 'ALL_EXPANDED', CUSTOM = 'CUSTOM' }