UNPKG

@fullcalendar/common

Version:
1,437 lines (1,375 loc) 107 kB
import { Ref, ComponentChildren, createElement, Context, RefObject, ComponentType, VNode, Component, VUIEvent } from './vdom'; export * from './vdom'; export { VUIEvent } from './vdom'; declare type DurationInput = DurationObjectInput | string | number; interface DurationObjectInput { years?: number; year?: number; months?: number; month?: number; weeks?: number; week?: number; days?: number; day?: number; hours?: number; hour?: number; minutes?: number; minute?: number; seconds?: number; second?: number; milliseconds?: number; millisecond?: number; ms?: number; } interface Duration { years: number; months: number; days: number; milliseconds: number; specifiedWeeks?: boolean; } declare function createDuration(input: DurationInput, unit?: string): Duration | null; declare function asCleanDays(dur: Duration): number; declare function addDurations(d0: Duration, d1: Duration): { years: number; months: number; days: number; milliseconds: number; }; declare function multiplyDuration(d: Duration, n: number): { years: number; months: number; days: number; milliseconds: number; }; declare function asRoughMinutes(dur: Duration): number; declare function asRoughSeconds(dur: Duration): number; declare function asRoughMs(dur: Duration): number; declare function wholeDivideDurations(numerator: Duration, denominator: Duration): number; declare function greatestDurationDenominator(dur: Duration): { unit: string; value: number; }; declare type ClassNamesInput = string | string[]; declare function parseClassNames(raw: ClassNamesInput): string[]; declare type DateMarker = Date; declare function addWeeks(m: DateMarker, n: number): Date; declare function addDays(m: DateMarker, n: number): Date; declare function addMs(m: DateMarker, n: number): Date; declare function diffWeeks(m0: any, m1: any): number; declare function diffDays(m0: any, m1: any): number; declare function diffDayAndTime(m0: DateMarker, m1: DateMarker): Duration; declare function diffWholeWeeks(m0: DateMarker, m1: DateMarker): number; declare function diffWholeDays(m0: DateMarker, m1: DateMarker): number; declare function startOfDay(m: DateMarker): DateMarker; declare function isValidDate(m: DateMarker): boolean; interface CalendarSystem { getMarkerYear(d: DateMarker): number; getMarkerMonth(d: DateMarker): number; getMarkerDay(d: DateMarker): number; arrayToMarker(arr: number[]): DateMarker; markerToArray(d: DateMarker): number[]; } interface ZonedMarker { marker: DateMarker; timeZoneOffset: number; } interface ExpandedZonedMarker extends ZonedMarker { array: number[]; year: number; month: number; day: number; hour: number; minute: number; second: number; millisecond: number; } interface VerboseFormattingArg { date: ExpandedZonedMarker; start: ExpandedZonedMarker; end?: ExpandedZonedMarker; timeZone: string; localeCodes: string[]; defaultSeparator: string; } declare type CmdFormatterFunc = (cmd: string, arg: VerboseFormattingArg) => string; interface DateFormattingContext { timeZone: string; locale: Locale; calendarSystem: CalendarSystem; computeWeekNumber: (d: DateMarker) => number; weekText: string; weekTextLong: string; cmdFormatter?: CmdFormatterFunc; defaultSeparator: string; } interface DateFormatter { format(date: ZonedMarker, context: DateFormattingContext): string; formatRange(start: ZonedMarker, end: ZonedMarker, context: DateFormattingContext, betterDefaultSeparator?: string): string; } interface NativeFormatterOptions extends Intl.DateTimeFormatOptions { week?: 'long' | 'short' | 'narrow' | 'numeric'; meridiem?: 'lowercase' | 'short' | 'narrow' | boolean; omitZeroMinute?: boolean; omitCommas?: boolean; separator?: string; } declare type FuncFormatterFunc = (arg: VerboseFormattingArg) => string; declare type FormatterInput = NativeFormatterOptions | string | FuncFormatterFunc; declare function createFormatter(input: FormatterInput): DateFormatter; declare function guid(): string; declare function disableCursor(): void; declare function enableCursor(): void; declare function preventSelection(el: HTMLElement): void; declare function allowSelection(el: HTMLElement): void; declare function preventContextMenu(el: HTMLElement): void; declare function allowContextMenu(el: HTMLElement): void; interface OrderSpec<Subject> { field?: string; order?: number; func?: FieldSpecInputFunc<Subject>; } declare type FieldSpecInput<Subject> = string | string[] | FieldSpecInputFunc<Subject> | FieldSpecInputFunc<Subject>[]; declare type FieldSpecInputFunc<Subject> = (a: Subject, b: Subject) => number; declare function parseFieldSpecs<Subject>(input: FieldSpecInput<Subject>): OrderSpec<Subject>[]; declare function compareByFieldSpecs<Subject>(obj0: Subject, obj1: Subject, fieldSpecs: OrderSpec<Subject>[]): number; declare function compareByFieldSpec<Subject>(obj0: Subject, obj1: Subject, fieldSpec: OrderSpec<Subject>): number; declare function flexibleCompare(a: any, b: any): number; declare function padStart(val: any, len: any): string; declare function compareNumbers(a: any, b: any): number; declare function isInt(n: any): boolean; declare function computeSmallestCellWidth(cellEl: HTMLElement): number; interface DateRangeInput { start?: DateInput; end?: DateInput; } interface OpenDateRange { start: DateMarker | null; end: DateMarker | null; } interface DateRange { start: DateMarker; end: DateMarker; } declare function intersectRanges(range0: OpenDateRange, range1: OpenDateRange): OpenDateRange; declare function rangesEqual(range0: OpenDateRange, range1: OpenDateRange): boolean; declare function rangesIntersect(range0: OpenDateRange, range1: OpenDateRange): boolean; declare function rangeContainsRange(outerRange: OpenDateRange, innerRange: OpenDateRange): boolean; declare function rangeContainsMarker(range: OpenDateRange, date: DateMarker | number): boolean; interface PointerDragEvent { origEvent: UIEvent; isTouch: boolean; subjectEl: EventTarget; pageX: number; pageY: number; deltaX: number; deltaY: number; } interface EventInteractionState { affectedEvents: EventStore; mutatedEvents: EventStore; isEvent: boolean; } declare type Action = { type: 'NOTHING'; } | { type: 'SET_OPTION'; optionName: string; rawOptionValue: any; } | { type: 'PREV'; } | { type: 'NEXT'; } | { type: 'CHANGE_DATE'; dateMarker: DateMarker; } | { type: 'CHANGE_VIEW_TYPE'; viewType: string; dateMarker?: DateMarker; } | { type: 'SELECT_DATES'; selection: DateSpan; } | { type: 'UNSELECT_DATES'; } | { type: 'SELECT_EVENT'; eventInstanceId: string; } | { type: 'UNSELECT_EVENT'; } | { type: 'SET_EVENT_DRAG'; state: EventInteractionState; } | { type: 'UNSET_EVENT_DRAG'; } | { type: 'SET_EVENT_RESIZE'; state: EventInteractionState; } | { type: 'UNSET_EVENT_RESIZE'; } | { type: 'ADD_EVENT_SOURCES'; sources: EventSource<any>[]; } | { type: 'REMOVE_EVENT_SOURCE'; sourceId: string; } | { type: 'REMOVE_ALL_EVENT_SOURCES'; } | { type: 'FETCH_EVENT_SOURCES'; sourceIds?: string[]; isRefetch?: boolean; } | { type: 'RECEIVE_EVENTS'; sourceId: string; fetchId: string; fetchRange: DateRange | null; rawEvents: EventInput[]; } | { type: 'RECEIVE_EVENT_ERROR'; sourceId: string; fetchId: string; fetchRange: DateRange | null; error: EventSourceError; } | { type: 'ADD_EVENTS'; eventStore: EventStore; } | { type: 'RESET_EVENTS'; eventStore: EventStore; } | { type: 'MERGE_EVENTS'; eventStore: EventStore; } | { type: 'REMOVE_EVENTS'; eventStore: EventStore; } | { type: 'REMOVE_ALL_EVENTS'; }; interface EventMutation { datesDelta?: Duration; startDelta?: Duration; endDelta?: Duration; standardProps?: any; extendedProps?: any; } declare function applyMutationToEventStore(eventStore: EventStore, eventConfigBase: EventUiHash, mutation: EventMutation, context: CalendarContext): EventStore; declare type eventDefMutationApplier = (eventDef: EventDef, mutation: EventMutation, context: CalendarContext) => void; interface DateProfile { currentRange: DateRange; currentRangeUnit: string; isRangeAllDay: boolean; validRange: OpenDateRange; activeRange: DateRange | null; renderRange: DateRange; slotMinTime: Duration; slotMaxTime: Duration; isValid: boolean; dateIncrement: Duration; } interface DateProfileGeneratorProps extends DateProfileOptions { dateProfileGeneratorClass: DateProfileGeneratorClass; duration: Duration; durationUnit: string; usesMinMaxTime: boolean; dateEnv: DateEnv; calendarApi: CalendarApi; } interface DateProfileOptions { slotMinTime: Duration; slotMaxTime: Duration; showNonCurrentDates?: boolean; dayCount?: number; dateAlignment?: string; dateIncrement?: Duration; hiddenDays?: number[]; weekends?: boolean; nowInput?: DateInput | (() => DateInput); validRangeInput?: DateRangeInput | ((this: CalendarApi, nowDate: Date) => DateRangeInput); visibleRangeInput?: DateRangeInput | ((this: CalendarApi, nowDate: Date) => DateRangeInput); monthMode?: boolean; fixedWeekCount?: boolean; } declare type DateProfileGeneratorClass = { new (props: DateProfileGeneratorProps): DateProfileGenerator; }; declare class DateProfileGenerator { protected props: DateProfileGeneratorProps; nowDate: DateMarker; isHiddenDayHash: boolean[]; constructor(props: DateProfileGeneratorProps); buildPrev(currentDateProfile: DateProfile, currentDate: DateMarker, forceToValid?: boolean): DateProfile; buildNext(currentDateProfile: DateProfile, currentDate: DateMarker, forceToValid?: boolean): DateProfile; build(currentDate: DateMarker, direction?: any, forceToValid?: boolean): DateProfile; buildValidRange(): OpenDateRange; buildCurrentRangeInfo(date: DateMarker, direction: any): { duration: any; unit: any; range: any; }; getFallbackDuration(): Duration; adjustActiveRange(range: DateRange): { start: Date; end: Date; }; buildRangeFromDuration(date: DateMarker, direction: any, duration: Duration, unit: any): any; buildRangeFromDayCount(date: DateMarker, direction: any, dayCount: any): { start: Date; end: Date; }; buildCustomVisibleRange(date: DateMarker): DateRange; buildRenderRange(currentRange: DateRange, currentRangeUnit: any, isRangeAllDay: any): DateRange; buildDateIncrement(fallback: any): Duration; refineRange(rangeInput: DateRangeInput | undefined): DateRange | null; initHiddenDays(): void; trimHiddenDays(range: DateRange): DateRange | null; isHiddenDay(day: any): boolean; skipHiddenDays(date: DateMarker, inc?: number, isExclusive?: boolean): Date; } interface ViewProps { dateProfile: DateProfile; businessHours: EventStore; eventStore: EventStore; eventUiBases: EventUiHash; dateSelection: DateSpan | null; eventSelection: string; eventDrag: EventInteractionState | null; eventResize: EventInteractionState | null; isHeightAuto: boolean; forPrint: boolean; } declare function sliceEvents(props: ViewProps & { dateProfile: DateProfile; nextDayThreshold: Duration; }, allDay?: boolean): EventRenderRange[]; declare type MountArg<ContentArg> = ContentArg & { el: HTMLElement; }; declare type DidMountHandler<TheMountArg extends { el: HTMLElement; }> = (mountArg: TheMountArg) => void; declare type WillUnmountHandler<TheMountArg extends { el: HTMLElement; }> = (mountArg: TheMountArg) => void; interface RenderHookProps<ContentArg> { hookProps: ContentArg; classNames: ClassNamesGenerator<ContentArg>; content: CustomContentGenerator<ContentArg>; defaultContent?: DefaultContentGenerator<ContentArg>; didMount: DidMountHandler<MountArg<ContentArg>>; willUnmount: WillUnmountHandler<MountArg<ContentArg>>; children: RenderHookPropsChildren; elRef?: Ref<any>; } declare type RenderHookPropsChildren = (rootElRef: Ref<any>, classNames: string[], innerElRef: Ref<any>, innerContent: ComponentChildren) => ComponentChildren; interface ContentTypeHandlers { [contentKey: string]: () => ({ render: (el: HTMLElement, contentVal: any) => void; destroy?: () => void; }); } declare class RenderHook<HookProps> extends BaseComponent<RenderHookProps<HookProps>> { private rootElRef; render(): createElement.JSX.Element; handleRootEl: (el: HTMLElement | null) => void; } interface ObjCustomContent { html: string; domNodes: any[]; [custom: string]: any; } declare type CustomContent = ComponentChildren | ObjCustomContent; declare type CustomContentGenerator<HookProps> = CustomContent | ((hookProps: HookProps) => CustomContent); declare type DefaultContentGenerator<HookProps> = (hookProps: HookProps) => ComponentChildren; declare const CustomContentRenderContext: Context<number>; interface ContentHookProps<HookProps> { hookProps: HookProps; content: CustomContentGenerator<HookProps>; defaultContent?: DefaultContentGenerator<HookProps>; children: ( innerElRef: Ref<any>, innerContent: ComponentChildren) => ComponentChildren; backupElRef?: RefObject<any>; } declare function ContentHook<HookProps>(props: ContentHookProps<HookProps>): createElement.JSX.Element; interface MountHookProps<ContentArg> { hookProps: ContentArg; didMount: DidMountHandler<MountArg<ContentArg>>; willUnmount: WillUnmountHandler<MountArg<ContentArg>>; children: (rootElRef: Ref<any>) => ComponentChildren; elRef?: Ref<any>; } declare class MountHook<ContentArg> extends BaseComponent<MountHookProps<ContentArg>> { rootEl: HTMLElement; render(): ComponentChildren; componentDidMount(): void; componentWillUnmount(): void; private handleRootEl; } declare function buildClassNameNormalizer<HookProps>(): (generator: ClassNamesGenerator<HookProps>, hookProps: HookProps) => string[]; declare type ClassNamesGenerator<HookProps> = ClassNamesInput | ((hookProps: HookProps) => ClassNamesInput); declare type ViewComponentType = ComponentType<ViewProps>; declare type ViewConfigInput = ViewComponentType | ViewOptions; declare type ViewConfigInputHash = { [viewType: string]: ViewConfigInput; }; interface SpecificViewContentArg extends ViewProps { nextDayThreshold: Duration; } declare type SpecificViewMountArg = MountArg<SpecificViewContentArg>; interface ViewSpec { type: string; component: ViewComponentType; duration: Duration; durationUnit: string; singleUnit: string; optionDefaults: ViewOptions; optionOverrides: ViewOptions; buttonTextOverride: string; buttonTextDefault: string; buttonTitleOverride: string | ((...args: any[]) => string); buttonTitleDefault: string | ((...args: any[]) => string); } declare type ViewSpecHash = { [viewType: string]: ViewSpec; }; interface HandlerFuncTypeHash { [eventName: string]: (...args: any[]) => any; } declare class Emitter<HandlerFuncs extends HandlerFuncTypeHash> { private handlers; private options; private thisContext; setThisContext(thisContext: any): void; setOptions(options: Partial<HandlerFuncs>): void; on<Prop extends keyof HandlerFuncs>(type: Prop, handler: HandlerFuncs[Prop]): void; off<Prop extends keyof HandlerFuncs>(type: Prop, handler?: HandlerFuncs[Prop]): void; trigger<Prop extends keyof HandlerFuncs>(type: Prop, ...args: Parameters<HandlerFuncs[Prop]>): void; hasHandlers(type: keyof HandlerFuncs): boolean; } declare class Theme { classes: any; iconClasses: any; rtlIconClasses: any; baseIconClass: string; iconOverrideOption: any; iconOverrideCustomButtonOption: any; iconOverridePrefix: string; constructor(calendarOptions: CalendarOptionsRefined); setIconOverride(iconOverrideHash: any): void; applyIconOverridePrefix(className: any): any; getClass(key: any): any; getIconClass(buttonName: any, isRtl?: boolean): string; getCustomButtonIconClass(customButtonProps: any): string; } declare type ThemeClass = { new (calendarOptions: any): Theme; }; interface CalendarDataManagerState { dynamicOptionOverrides: CalendarOptions; currentViewType: string; currentDate: DateMarker; dateProfile: DateProfile; businessHours: EventStore; eventSources: EventSourceHash; eventUiBases: EventUiHash; eventStore: EventStore; renderableEventStore: EventStore; dateSelection: DateSpan | null; eventSelection: string; eventDrag: EventInteractionState | null; eventResize: EventInteractionState | null; selectionConfig: EventUi; } interface CalendarOptionsData { localeDefaults: CalendarOptions; calendarOptions: CalendarOptionsRefined; toolbarConfig: any; availableRawLocales: any; dateEnv: DateEnv; theme: Theme; pluginHooks: PluginHooks; viewSpecs: ViewSpecHash; } interface CalendarCurrentViewData { viewSpec: ViewSpec; options: ViewOptionsRefined; viewApi: ViewApi; dateProfileGenerator: DateProfileGenerator; } declare type CalendarDataBase = CalendarOptionsData & CalendarCurrentViewData & CalendarDataManagerState; interface CalendarData extends CalendarDataBase { viewTitle: string; calendarApi: CalendarApi; dispatch: (action: Action) => void; emitter: Emitter<CalendarListeners>; getCurrentData(): CalendarData; } declare class ViewApi { type: string; private getCurrentData; private dateEnv; constructor(type: string, getCurrentData: () => CalendarData, dateEnv: DateEnv); get calendar(): CalendarApi; get title(): string; get activeStart(): Date; get activeEnd(): Date; get currentStart(): Date; get currentEnd(): Date; getOption(name: string): unknown; } interface DateSelectionApi extends DateSpanApi { jsEvent: UIEvent; view: ViewApi; } declare type DatePointTransform = (dateSpan: DateSpan, context: CalendarContext) => any; declare type DateSpanTransform = (dateSpan: DateSpan, context: CalendarContext) => any; declare type CalendarInteraction = { destroy: () => void; }; declare type CalendarInteractionClass = { new (context: CalendarContext): CalendarInteraction; }; declare type OptionChangeHandler = (propValue: any, context: CalendarContext) => void; declare type OptionChangeHandlerMap = { [propName: string]: OptionChangeHandler; }; interface DateSelectArg extends DateSpanApi { jsEvent: MouseEvent | null; view: ViewApi; } declare function triggerDateSelect(selection: DateSpan, pev: PointerDragEvent | null, context: CalendarContext & { viewApi?: ViewApi; }): void; interface DateUnselectArg { jsEvent: MouseEvent; view: ViewApi; } declare function getDefaultEventEnd(allDay: boolean, marker: DateMarker, context: CalendarContext): DateMarker; interface Point { left: number; top: number; } interface Rect { left: number; right: number; top: number; bottom: number; } declare function pointInsideRect(point: Point, rect: Rect): boolean; declare function intersectRects(rect1: Rect, rect2: Rect): Rect | false; declare function translateRect(rect: Rect, deltaX: number, deltaY: number): Rect; declare function constrainPoint(point: Point, rect: Rect): Point; declare function getRectCenter(rect: Rect): Point; declare function diffPoints(point1: Point, point2: Point): Point; interface Hit { componentId?: string; context?: ViewContext; dateProfile: DateProfile; dateSpan: DateSpan; dayEl: HTMLElement; rect: Rect; layer: number; largeUnit?: string; } declare abstract class Interaction { component: DateComponent<any>; isHitComboAllowed: ((hit0: Hit, hit1: Hit) => boolean) | null; constructor(settings: InteractionSettings); destroy(): void; } declare type InteractionClass = { new (settings: InteractionSettings): Interaction; }; interface InteractionSettingsInput { el: HTMLElement; useEventCenter?: boolean; isHitComboAllowed?: (hit0: Hit, hit1: Hit) => boolean; } interface InteractionSettings { component: DateComponent<any>; el: HTMLElement; useEventCenter: boolean; isHitComboAllowed: ((hit0: Hit, hit1: Hit) => boolean) | null; } declare type InteractionSettingsStore = { [componenUid: string]: InteractionSettings; }; declare function interactionSettingsToStore(settings: InteractionSettings): { [x: string]: InteractionSettings; }; declare const interactionSettingsStore: InteractionSettingsStore; declare class DelayedRunner { private drainedOption?; private isRunning; private isDirty; private pauseDepths; private timeoutId; constructor(drainedOption?: () => void); request(delay?: number): void; pause(scope?: string): void; resume(scope?: string, force?: boolean): void; isPaused(): number; tryDrain(): void; clear(): void; private clearTimeout; protected drained(): void; } interface CalendarContentProps extends CalendarData { forPrint: boolean; isHeightAuto: boolean; } declare class CalendarContent extends PureComponent<CalendarContentProps> { private buildViewContext; private buildViewPropTransformers; private buildToolbarProps; private headerRef; private footerRef; private interactionsStore; private calendarInteractions; state: { viewLabelId: string; }; render(): createElement.JSX.Element; componentDidMount(): void; componentDidUpdate(prevProps: CalendarContentProps): void; componentWillUnmount(): void; buildAppendContent(): VNode; renderView(props: CalendarContentProps): createElement.JSX.Element; registerInteractiveComponent: (component: DateComponent<any>, settingsInput: InteractionSettingsInput) => void; unregisterInteractiveComponent: (component: DateComponent<any>) => void; resizeRunner: DelayedRunner; handleWindowResize: (ev: UIEvent) => void; } declare type eventDragMutationMassager = (mutation: EventMutation, hit0: Hit, hit1: Hit) => void; declare type EventDropTransformers = (mutation: EventMutation, context: CalendarContext) => Dictionary; declare type eventIsDraggableTransformer = (val: boolean, eventDef: EventDef, eventUi: EventUi, context: CalendarContext) => boolean; declare type dateSelectionJoinTransformer = (hit0: Hit, hit1: Hit) => any; declare const DRAG_META_REFINERS: { startTime: typeof createDuration; duration: typeof createDuration; create: BooleanConstructor; sourceId: StringConstructor; }; declare type DragMetaInput = RawOptionsFromRefiners<typeof DRAG_META_REFINERS> & { [otherProp: string]: any; }; interface DragMeta { startTime: Duration | null; duration: Duration | null; create: boolean; sourceId: string; leftoverProps: Dictionary; } declare function parseDragMeta(raw: DragMetaInput): DragMeta; declare type ExternalDefTransform = (dateSpan: DateSpan, dragMeta: DragMeta) => any; declare type EventSourceFunc = (arg: { start: Date; end: Date; startStr: string; endStr: string; timeZone: string; }, successCallback: (events: EventInput[]) => void, failureCallback: (error: EventSourceError) => void) => (void | PromiseLike<EventInput[]>); declare const JSON_FEED_EVENT_SOURCE_REFINERS: { method: StringConstructor; extraParams: Identity<Dictionary | (() => Dictionary)>; startParam: StringConstructor; endParam: StringConstructor; timeZoneParam: StringConstructor; }; declare const EVENT_SOURCE_REFINERS: { id: StringConstructor; defaultAllDay: BooleanConstructor; url: StringConstructor; format: StringConstructor; events: Identity<EventInput[] | EventSourceFunc>; eventDataTransform: Identity<EventInputTransformer>; success: Identity<EventSourceSuccessResponseHandler>; failure: Identity<EventSourceErrorResponseHandler>; }; declare type BuiltInEventSourceRefiners = typeof EVENT_SOURCE_REFINERS & typeof JSON_FEED_EVENT_SOURCE_REFINERS; interface EventSourceRefiners extends BuiltInEventSourceRefiners { } declare type EventSourceInputObject = EventUiInput & RawOptionsFromRefiners<Required<EventSourceRefiners>>; declare type EventSourceInput = EventSourceInputObject | EventInput[] | EventSourceFunc | string; declare type EventSourceRefined = EventUiRefined & RefinedOptionsFromRefiners<Required<EventSourceRefiners>>; interface EventSourceDef<Meta> { ignoreRange?: boolean; parseMeta: (refined: EventSourceRefined) => Meta | null; fetch: EventSourceFetcher<Meta>; } interface ParsedRecurring<RecurringData> { typeData: RecurringData; allDayGuess: boolean | null; duration: Duration | null; } interface RecurringType<RecurringData> { parse: (refined: EventRefined, dateEnv: DateEnv) => ParsedRecurring<RecurringData> | null; expand: (typeData: any, framingRange: DateRange, dateEnv: DateEnv) => DateMarker[]; } declare abstract class NamedTimeZoneImpl { timeZoneName: string; constructor(timeZoneName: string); abstract offsetForArray(a: number[]): number; abstract timestampToArray(ms: number): number[]; } declare type NamedTimeZoneImplClass = { new (timeZoneName: string): NamedTimeZoneImpl; }; declare abstract class ElementDragging { emitter: Emitter<any>; constructor(el: HTMLElement, selector?: string); destroy(): void; abstract setIgnoreMove(bool: boolean): void; setMirrorIsVisible(bool: boolean): void; setMirrorNeedsRevert(bool: boolean): void; setAutoScrollEnabled(bool: boolean): void; } declare type ElementDraggingClass = { new (el: HTMLElement, selector?: string): ElementDragging; }; declare type CssDimValue = string | number; interface ColProps { width?: CssDimValue; minWidth?: CssDimValue; span?: number; } interface SectionConfig { outerContent?: VNode; type: 'body' | 'header' | 'footer'; className?: string; maxHeight?: number; liquid?: boolean; expandRows?: boolean; syncRowHeights?: boolean; isSticky?: boolean; } declare type ChunkConfigContent = (contentProps: ChunkContentCallbackArgs) => VNode; declare type ChunkConfigRowContent = VNode | ChunkConfigContent; interface ChunkConfig { outerContent?: VNode; content?: ChunkConfigContent; rowContent?: ChunkConfigRowContent; scrollerElRef?: Ref<HTMLDivElement>; elRef?: Ref<HTMLTableCellElement>; tableClassName?: string; } interface ChunkContentCallbackArgs { tableColGroupNode: VNode; tableMinWidth: CssDimValue; clientWidth: number | null; clientHeight: number | null; expandRows: boolean; syncRowHeights: boolean; rowSyncHeights: number[]; reportRowHeightChange: (rowEl: HTMLElement, isStable: boolean) => void; } declare function computeShrinkWidth(chunkEls: HTMLElement[]): number; interface ScrollerLike { needsYScrolling(): boolean; needsXScrolling(): boolean; } declare function getSectionHasLiquidHeight(props: { liquid: boolean; }, sectionConfig: SectionConfig): boolean; declare function getAllowYScrolling(props: { liquid: boolean; }, sectionConfig: SectionConfig): boolean; declare function renderChunkContent(sectionConfig: SectionConfig, chunkConfig: ChunkConfig, arg: ChunkContentCallbackArgs, isHeader: boolean): VNode; declare function isColPropsEqual(cols0: ColProps[], cols1: ColProps[]): boolean; declare function renderMicroColGroup(cols: ColProps[], shrinkWidth?: number): VNode; declare function sanitizeShrinkWidth(shrinkWidth?: number): number; declare function hasShrinkWidth(cols: ColProps[]): boolean; declare function getScrollGridClassNames(liquid: boolean, context: ViewContext): any[]; declare function getSectionClassNames(sectionConfig: SectionConfig, wholeTableVGrow: boolean): string[]; declare function renderScrollShim(arg: ChunkContentCallbackArgs): createElement.JSX.Element; declare function getStickyHeaderDates(options: BaseOptionsRefined): boolean; declare function getStickyFooterScrollbar(options: BaseOptionsRefined): boolean; interface ScrollGridProps { colGroups?: ColGroupConfig[]; sections: ScrollGridSectionConfig[]; liquid: boolean; collapsibleWidth: boolean; elRef?: Ref<any>; } interface ScrollGridSectionConfig extends SectionConfig { key: string; chunks?: ScrollGridChunkConfig[]; } interface ScrollGridChunkConfig extends ChunkConfig { key: string; } interface ColGroupConfig { width?: CssDimValue; cols: ColProps[]; } declare type ScrollGridImpl = { new (props: ScrollGridProps, context: ViewContext): Component<ScrollGridProps>; }; interface PluginDefInput { deps?: PluginDef[]; reducers?: ReducerFunc[]; isLoadingFuncs?: ((state: Dictionary) => boolean)[]; contextInit?: (context: CalendarContext) => void; eventRefiners?: GenericRefiners; eventDefMemberAdders?: EventDefMemberAdder[]; eventSourceRefiners?: GenericRefiners; isDraggableTransformers?: eventIsDraggableTransformer[]; eventDragMutationMassagers?: eventDragMutationMassager[]; eventDefMutationAppliers?: eventDefMutationApplier[]; dateSelectionTransformers?: dateSelectionJoinTransformer[]; datePointTransforms?: DatePointTransform[]; dateSpanTransforms?: DateSpanTransform[]; views?: ViewConfigInputHash; viewPropsTransformers?: ViewPropsTransformerClass[]; isPropsValid?: isPropsValidTester; externalDefTransforms?: ExternalDefTransform[]; viewContainerAppends?: ViewContainerAppend[]; eventDropTransformers?: EventDropTransformers[]; componentInteractions?: InteractionClass[]; calendarInteractions?: CalendarInteractionClass[]; themeClasses?: { [themeSystemName: string]: ThemeClass; }; eventSourceDefs?: EventSourceDef<any>[]; cmdFormatter?: CmdFormatterFunc; recurringTypes?: RecurringType<any>[]; namedTimeZonedImpl?: NamedTimeZoneImplClass; initialView?: string; elementDraggingImpl?: ElementDraggingClass; optionChangeHandlers?: OptionChangeHandlerMap; scrollGridImpl?: ScrollGridImpl; contentTypeHandlers?: ContentTypeHandlers; listenerRefiners?: GenericListenerRefiners; optionRefiners?: GenericRefiners; propSetHandlers?: { [propName: string]: (val: any, context: CalendarData) => void; }; } interface PluginHooks { reducers: ReducerFunc[]; isLoadingFuncs: ((state: Dictionary) => boolean)[]; contextInit: ((context: CalendarContext) => void)[]; eventRefiners: GenericRefiners; eventDefMemberAdders: EventDefMemberAdder[]; eventSourceRefiners: GenericRefiners; isDraggableTransformers: eventIsDraggableTransformer[]; eventDragMutationMassagers: eventDragMutationMassager[]; eventDefMutationAppliers: eventDefMutationApplier[]; dateSelectionTransformers: dateSelectionJoinTransformer[]; datePointTransforms: DatePointTransform[]; dateSpanTransforms: DateSpanTransform[]; views: ViewConfigInputHash; viewPropsTransformers: ViewPropsTransformerClass[]; isPropsValid: isPropsValidTester | null; externalDefTransforms: ExternalDefTransform[]; viewContainerAppends: ViewContainerAppend[]; eventDropTransformers: EventDropTransformers[]; componentInteractions: InteractionClass[]; calendarInteractions: CalendarInteractionClass[]; themeClasses: { [themeSystemName: string]: ThemeClass; }; eventSourceDefs: EventSourceDef<any>[]; cmdFormatter?: CmdFormatterFunc; recurringTypes: RecurringType<any>[]; namedTimeZonedImpl?: NamedTimeZoneImplClass; initialView: string; elementDraggingImpl?: ElementDraggingClass; optionChangeHandlers: OptionChangeHandlerMap; scrollGridImpl: ScrollGridImpl | null; contentTypeHandlers: ContentTypeHandlers; listenerRefiners: GenericListenerRefiners; optionRefiners: GenericRefiners; propSetHandlers: { [propName: string]: (val: any, context: CalendarData) => void; }; } interface PluginDef extends PluginHooks { id: string; deps: PluginDef[]; } declare type ViewPropsTransformerClass = new () => ViewPropsTransformer; interface ViewPropsTransformer { transform(viewProps: ViewProps, calendarProps: CalendarContentProps): any; } declare type ViewContainerAppend = (context: CalendarContext) => ComponentChildren; interface CalendarDataManagerProps { optionOverrides: CalendarOptions; calendarApi: CalendarApi; onAction?: (action: Action) => void; onData?: (data: CalendarData) => void; } declare type ReducerFunc = ( currentState: Dictionary | null, action: Action | null, context: CalendarContext & CalendarDataManagerState) => Dictionary; declare class CalendarDataManager { private computeOptionsData; private computeCurrentViewData; private organizeRawLocales; private buildLocale; private buildPluginHooks; private buildDateEnv; private buildTheme; private parseToolbars; private buildViewSpecs; private buildDateProfileGenerator; private buildViewApi; private buildViewUiProps; private buildEventUiBySource; private buildEventUiBases; private parseContextBusinessHours; private buildTitle; emitter: Emitter<Required<RefinedOptionsFromRefiners<Required<CalendarListenerRefiners>>>>; private actionRunner; private props; private state; private data; currentCalendarOptionsInput: CalendarOptions; private currentCalendarOptionsRefined; private currentViewOptionsInput; private currentViewOptionsRefined; currentCalendarOptionsRefiners: any; constructor(props: CalendarDataManagerProps); getCurrentData: () => CalendarData; dispatch: (action: Action) => void; resetOptions(optionOverrides: CalendarOptions, append?: boolean): void; _handleAction(action: Action): void; updateData(): void; _computeOptionsData(optionOverrides: CalendarOptions, dynamicOptionOverrides: CalendarOptions, calendarApi: CalendarApi): CalendarOptionsData; processRawCalendarOptions(optionOverrides: CalendarOptions, dynamicOptionOverrides: CalendarOptions): { rawOptions: CalendarOptions; refinedOptions: CalendarOptionsRefined; pluginHooks: PluginHooks; availableLocaleData: RawLocaleInfo; localeDefaults: CalendarOptionsRefined; extra: {}; }; _computeCurrentViewData(viewType: string, optionsData: CalendarOptionsData, optionOverrides: CalendarOptions, dynamicOptionOverrides: CalendarOptions): CalendarCurrentViewData; processRawViewOptions(viewSpec: ViewSpec, pluginHooks: PluginHooks, localeDefaults: CalendarOptions, optionOverrides: CalendarOptions, dynamicOptionOverrides: CalendarOptions): { rawOptions: ViewOptions; refinedOptions: ViewOptionsRefined; extra: {}; }; } declare class CalendarApi { currentDataManager?: CalendarDataManager; getCurrentData(): CalendarData; dispatch(action: Action): void; get view(): ViewApi; batchRendering(callback: () => void): void; updateSize(): void; setOption<OptionName extends keyof CalendarOptions>(name: OptionName, val: CalendarOptions[OptionName]): void; getOption<OptionName extends keyof CalendarOptions>(name: OptionName): CalendarOptions[OptionName]; getAvailableLocaleCodes(): string[]; on<ListenerName extends keyof CalendarListeners>(handlerName: ListenerName, handler: CalendarListeners[ListenerName]): void; off<ListenerName extends keyof CalendarListeners>(handlerName: ListenerName, handler: CalendarListeners[ListenerName]): void; trigger<ListenerName extends keyof CalendarListeners>(handlerName: ListenerName, ...args: Parameters<CalendarListeners[ListenerName]>): void; changeView(viewType: string, dateOrRange?: DateRangeInput | DateInput): void; zoomTo(dateMarker: DateMarker, viewType?: string): void; private getUnitViewSpec; prev(): void; next(): void; prevYear(): void; nextYear(): void; today(): void; gotoDate(zonedDateInput: any): void; incrementDate(deltaInput: any): void; getDate(): Date; formatDate(d: DateInput, formatter: any): string; formatRange(d0: DateInput, d1: DateInput, settings: any): string; formatIso(d: DateInput, omitTime?: boolean): string; select(dateOrObj: DateInput | any, endDate?: DateInput): void; unselect(pev?: PointerDragEvent): void; addEvent(eventInput: EventInput, sourceInput?: EventSourceApi | string | boolean): EventApi | null; private triggerEventAdd; getEventById(id: string): EventApi | null; getEvents(): EventApi[]; removeAllEvents(): void; getEventSources(): EventSourceApi[]; getEventSourceById(id: string): EventSourceApi | null; addEventSource(sourceInput: EventSourceInput): EventSourceApi; removeAllEventSources(): void; refetchEvents(): void; scrollToTime(timeInput: DurationInput): void; } interface ScrollRequest { time?: Duration; [otherProp: string]: any; } declare type ScrollRequestHandler = (request: ScrollRequest) => boolean; declare class ScrollResponder { private execFunc; private emitter; private scrollTime; private scrollTimeReset; queuedRequest: ScrollRequest; constructor(execFunc: ScrollRequestHandler, emitter: Emitter<CalendarListeners>, scrollTime: Duration, scrollTimeReset: boolean); detach(): void; update(isDatesNew: boolean): void; private fireInitialScroll; private handleScrollRequest; private drain; } declare const ViewContextType: Context<any>; declare type ResizeHandler = (force: boolean) => void; interface ViewContext extends CalendarContext { options: ViewOptionsRefined; theme: Theme; isRtl: boolean; dateProfileGenerator: DateProfileGenerator; viewSpec: ViewSpec; viewApi: ViewApi; addResizeHandler: (handler: ResizeHandler) => void; removeResizeHandler: (handler: ResizeHandler) => void; createScrollResponder: (execFunc: ScrollRequestHandler) => ScrollResponder; registerInteractiveComponent: (component: DateComponent<any>, settingsInput: InteractionSettingsInput) => void; unregisterInteractiveComponent: (component: DateComponent<any>) => void; } declare function filterHash(hash: any, func: any): {}; declare function mapHash<InputItem, OutputItem>(hash: { [key: string]: InputItem; }, func: (input: InputItem, key: string) => OutputItem): { [key: string]: OutputItem; }; declare function buildHashFromArray<Item, ItemRes>(a: Item[], func: (item: Item, index: number) => [string, ItemRes]): { [key: string]: ItemRes; }; declare function isPropsEqual(obj0: any, obj1: any): boolean; declare function getUnequalProps(obj0: any, obj1: any): string[]; declare type EqualityFunc<T> = (a: T, b: T) => boolean; declare type EqualityThing<T> = EqualityFunc<T> | true; declare type EqualityFuncs<ObjType> = { [K in keyof ObjType]?: EqualityThing<ObjType[K]>; }; declare function compareObjs(oldProps: any, newProps: any, equalityFuncs?: EqualityFuncs<any>): boolean; declare function collectFromHash<Item>(hash: { [key: string]: Item; }, startIndex?: number, endIndex?: number, step?: number): Item[]; declare abstract class PureComponent<Props = Dictionary, State = Dictionary> extends Component<Props, State> { static addPropsEquality: typeof addPropsEquality; static addStateEquality: typeof addStateEquality; static contextType: any; context: ViewContext; propEquality: EqualityFuncs<Props>; stateEquality: EqualityFuncs<State>; debug: boolean; shouldComponentUpdate(nextProps: Props, nextState: State): boolean; safeSetState(newState: Partial<State>): void; } declare abstract class BaseComponent<Props = Dictionary, State = Dictionary> extends PureComponent<Props, State> { static contextType: any; context: ViewContext; } declare function addPropsEquality(this: { prototype: { propEquality: any; }; }, propEquality: any): void; declare function addStateEquality(this: { prototype: { stateEquality: any; }; }, stateEquality: any): void; declare function setRef<RefType>(ref: Ref<RefType> | void, current: RefType): void; interface EventInstance { instanceId: string; defId: string; range: DateRange; forcedStartTzo: number | null; forcedEndTzo: number | null; } declare type EventInstanceHash = { [instanceId: string]: EventInstance; }; declare function createEventInstance(defId: string, range: DateRange, forcedStartTzo?: number, forcedEndTzo?: number): EventInstance; interface Seg { component?: DateComponent<any, any>; isStart: boolean; isEnd: boolean; eventRange?: EventRenderRange; [otherProp: string]: any; el?: never; } interface EventSegUiInteractionState { affectedInstances: EventInstanceHash; segs: Seg[]; isEvent: boolean; } declare abstract class DateComponent<Props = Dictionary, State = Dictionary> extends BaseComponent<Props, State> { uid: string; prepareHits(): void; queryHit(positionLeft: number, positionTop: number, elWidth: number, elHeight: number): Hit | null; isValidSegDownEl(el: HTMLElement): boolean; isValidDateDownEl(el: HTMLElement): boolean; } declare class EventApi { _context: CalendarContext; _def: EventDef; _instance: EventInstance | null; constructor(context: CalendarContext, def: EventDef, instance?: EventInstance); setProp(name: string, val: any): void; setExtendedProp(name: string, val: any): void; setStart(startInput: DateInput, options?: { granularity?: string; maintainDuration?: boolean; }): void; setEnd(endInput: DateInput | null, options?: { granularity?: string; }): void; setDates(startInput: DateInput, endInput: DateInput | null, options?: { allDay?: boolean; granularity?: string; }): void; moveStart(deltaInput: DurationInput): void; moveEnd(deltaInput: DurationInput): void; moveDates(deltaInput: DurationInput): void; setAllDay(allDay: boolean, options?: { maintainDuration?: boolean; }): void; formatRange(formatInput: FormatterInput): string; mutate(mutation: EventMutation): void; remove(): void; get source(): EventSourceApi | null; get start(): Date | null; get end(): Date | null; get startStr(): string; get endStr(): string; get id(): string; get groupId(): string; get allDay(): boolean; get title(): string; get url(): string; get display(): string; get startEditable(): boolean; get durationEditable(): boolean; get constraint(): string | EventStore; get overlap(): boolean; get allow(): AllowFunc; get backgroundColor(): string; get borderColor(): string; get textColor(): string; get classNames(): string[]; get extendedProps(): Dictionary; toPlainObject(settings?: { collapseExtendedProps?: boolean; collapseColor?: boolean; }): Dictionary; toJSON(): Dictionary; } declare function buildEventApis(eventStore: EventStore, context: CalendarContext, excludeInstance?: EventInstance): EventApi[]; interface EventRenderRange extends EventTuple { ui: EventUi; range: DateRange; isStart: boolean; isEnd: boolean; } declare function sliceEventStore(eventStore: EventStore, eventUiBases: EventUiHash, framingRange: DateRange, nextDayThreshold?: Duration): { bg: EventRenderRange[]; fg: EventRenderRange[]; }; declare function hasBgRendering(def: EventDef): boolean; declare function setElSeg(el: HTMLElement, seg: Seg): void; declare function getElSeg(el: HTMLElement): Seg | null; declare function sortEventSegs(segs: any, eventOrderSpecs: OrderSpec<EventApi>[]): Seg[]; declare function buildSegCompareObj(seg: Seg): { id: string; start: number; end: number; duration: number; allDay: number; _seg: Seg; defId: string; sourceId: string; publicId: string; groupId: string; hasEnd: boolean; recurringDef: { typeId: number; typeData: any; duration: Duration; }; title: string; url: string; ui: EventUi; interactive?: boolean; extendedProps: Dictionary; }; interface EventContentArg { event: EventApi; timeText: string; backgroundColor: string; borderColor: string; textColor: string; isDraggable: boolean; isStartResizable: boolean; isEndResizable: boolean; isMirror: boolean; isStart: boolean; isEnd: boolean; isPast: boolean; isFuture: boolean; isToday: boolean; isSelected: boolean; isDragging: boolean; isResizing: boolean; view: ViewApi; } declare type EventMountArg = MountArg<EventContentArg>; declare function computeSegDraggable(seg: Seg, context: ViewContext): boolean; declare function computeSegStartResizable(seg: Seg, context: ViewContext): boolean; declare function computeSegEndResizable(seg: Seg, context: ViewContext): boolean; declare function buildSegTimeText(seg: Seg, timeFormat: DateFormatter, context: ViewContext, defaultDisplayEventTime?: boolean, defaultDisplayEventEnd?: boolean, startOverride?: DateMarker, endOverride?: DateMarker): string; declare function getSegMeta(seg: Seg, todayRange: DateRange, nowDate?: DateMarker): { isPast: boolean; isFuture: boolean; isToday: boolean; }; declare function getEventClassNames(props: EventContentArg): string[]; declare function buildEventRangeKey(eventRange: EventRenderRange): string; declare function getSegAnchorAttrs(seg: Seg, context: ViewContext): { tabIndex: number; onKeyDown(ev: KeyboardEvent): void; } | { href: string; } | { href?: undefined; }; interface OpenDateSpanInput { start?: DateInput; end?: DateInput; allDay?: boolean; [otherProp: string]: any; } interface DateSpanInput extends OpenDateSpanInput { start: DateInput; end: DateInput; } interface OpenDateSpan { range: OpenDateRange; allDay: boolean; [otherProp: string]: any; } interface DateSpan extends OpenDateSpan { range: DateRange; } interface RangeApi { start: Date; end: Date; startStr: string; endStr: string; } interface DateSpanApi extends RangeApi { allDay: boolean; } interface RangeApiWithTimeZone extends RangeApi { timeZone: string; } interface DatePointApi { date: Date; dateStr: string; allDay: boolean; } declare function isDateSpansEqual(span0: DateSpan, span1: DateSpan): boolean; declare type BusinessHoursInput = boolean | EventInput | EventInput[]; declare function parseBusinessHours(input: BusinessHoursInput, context: CalendarContext): EventStore; interface NowIndicatorRootProps { isAxis: boolean; date: DateMarker; children: RenderHookPropsChildren; } interface NowIndicatorContentArg { isAxis: boolean; date: Date; view: ViewApi; } declare type NowIndicatorMountArg = MountArg<NowIndicatorContentArg>; declare const NowIndicatorRoot: (props: NowIndicatorRootProps) => createElement.JSX.Element; interface WeekNumberRootProps { date: DateMarker; defaultFormat: DateFormatter; children: RenderHookPropsChildren; } interface WeekNumberContentArg { num: number; text: string; date: Date; } declare type WeekNumberMountArg = MountArg<WeekNumberContentArg>; declare const WeekNumberRoot: (props: WeekNumberRootProps) => createElement.JSX.Element; declare type MoreLinkChildren = (rootElRef: Ref<any>, classNames: string[], innerElRef: Ref<any>, innerContent: ComponentChildren, handleClick: (ev: MouseEvent) => void, title: string, isExpanded: boolean, popoverId: string) => ComponentChildren; interface MoreLinkRootProps { dateProfile: DateProfile; todayRange: DateRange; allDayDate: DateMarker | null; moreCnt: number; allSegs: Seg[]; hiddenSegs: Seg[]; extraDateSpan?: Dictionary; alignmentElRef: RefObject<HTMLElement>; alignGridTop?: boolean; topAlignmentElRef?: RefObject<HTMLElement>; defaultContent?: (hookProps: MoreLinkContentArg) => ComponentChildren; popoverContent: () => VNode; children: MoreLinkChildren; } interface MoreLinkContentArg { num: number; text: string; shortText: string; view: ViewApi; } declare type MoreLinkMountArg = MountArg<MoreLinkContentArg>; interface MoreLinkRootState { isPopoverOpen: boolean; popoverId: string; } declare class MoreLinkRoot extends BaseComponent<MoreLinkRootProps, MoreLinkRootState> { private linkElRef; private parentEl; state: { isPopoverOpen: boolean; popoverId: string; }; render(): createElement.JSX.Element; componentDidMount(): void; componentDidUpdate(): void; updateParentEl(): void; handleClick: (ev: MouseEvent) => void; handlePopoverClose: () => void; } declare function computeEarliestSegStart(segs: Seg[]): DateMarker; interface EventSegment { event: EventApi; start: Date; end: Date; isStart: boolean; isEnd: boolean; } declare type MoreLinkAction = MoreLinkSimpleAction | MoreLinkHandler; declare type MoreLinkSimpleAction = 'popover' | 'week' | 'day' | 'timeGridWeek' | 'timeGridDay' | string; interface MoreLinkArg { date: Date; allDay: boolean; allSegs: EventSegment[]; hiddenSegs: EventSegment[]; jsEvent: VUIEvent; view: ViewApi; } declare type MoreLinkHandler = (arg: MoreLinkArg) => MoreLinkSimpleAction | void; interface DateMeta { dow: number; isDisabled: boolean; isOther: boolean; isToday: boolean; isPast: boolean; isFuture: boolean; } declare