import { Ref, PropType } from 'vue'; import { createNativeLocaleFormatterUTC, validateNumber, type Timestamp } from '@timestamp-js/core'; import { type CalendarScopeData } from '../utils/calendarSystem'; import { type CommonProps } from './useCommon'; import { type ColumnProps } from './useColumn'; import { type CellWidthProps } from './useCellWidth'; import { type TimesProps } from './useTimes'; import { type MaxDaysProps } from './useMaxDays'; import { type NavigationProps } from './useKeyboard'; import { type CalendarDaysProps, type Scope, type ScopeForSlot } from './useCalendarDays'; export type { Scope, ScopeForSlot } from './useCalendarDays'; export interface Resource { [key: string]: any; } export interface ScopeForSlotX extends CalendarScopeData { /** Timestamp represented by the slot. */ timestamp: Timestamp; /** Helper that returns the horizontal start position for a time. */ timeStartPosX: (_time: string, _clamp?: boolean) => number | false; /** Helper that returns the horizontal width for a duration. */ timeDurationWidth: (_minutes: number) => number; /** Zero-based rendered interval index. */ index?: number; /** Whether the timestamp is outside the active month. */ outside?: boolean; /** Whether the slot content is disabled. */ disabled?: boolean; } export interface IntervalProps extends CommonProps, ColumnProps, CellWidthProps, MaxDaysProps, TimesProps, NavigationProps { view: 'day' | 'week' | 'month' | 'month-interval'; shortIntervalLabel?: boolean; intervalHeight: number | string; intervalMinutes: number | string; intervalStart: number | string; intervalCount: number | string; intervalStyle?: (_scope: Scope) => any; intervalClass?: (_scope: Scope) => string; weekdayStyle?: (_scope: Scope) => any; weekdayClass?: (_scope: Scope) => string; showIntervalLabel?: (_timestamp: Timestamp) => any; hour24Format?: boolean; timeClicksClamped?: boolean; dateHeader: 'stacked' | 'inline' | 'inverted'; } export declare const useIntervalProps: { /** * Calendar interval view mode. * * @category display */ readonly view: { readonly type: PropType; readonly validator: (v: string) => boolean; readonly default: "day"; }; /** * Uses shortened interval labels where possible. * * @category display */ readonly shortIntervalLabel: BooleanConstructor; /** * Height in pixels or CSS units for each time interval. * * @category layout */ readonly intervalHeight: { readonly type: PropType; readonly default: 40; readonly validator: typeof validateNumber; }; /** * Number of minutes represented by each interval. * * @category layout */ readonly intervalMinutes: { readonly type: PropType; readonly default: 60; readonly validator: typeof validateNumber; }; /** * Starting interval hour. * * @category layout */ readonly intervalStart: { readonly type: PropType; readonly default: 0; readonly validator: typeof validateNumber; }; /** * Number of intervals rendered in the day. * * @category layout */ readonly intervalCount: { readonly type: PropType; readonly default: 24; readonly validator: typeof validateNumber; }; /** * Function that returns inline styles for interval cells. * * @category style */ readonly intervalStyle: { readonly type: PropType; readonly default: null; }; /** * Function that returns CSS classes for interval cells. * * @category style */ readonly intervalClass: { readonly type: PropType; readonly default: null; }; /** * Function that returns inline styles for weekday header cells. * * @category style */ readonly weekdayStyle: { readonly type: PropType; readonly default: null; }; /** * Function that returns CSS classes for weekday header cells. * * @category style */ readonly weekdayClass: { readonly type: PropType; readonly default: null; }; /** * Function that controls whether an interval label is shown. * * @category display */ readonly showIntervalLabel: { readonly type: PropType; readonly default: null; }; /** * Uses 24-hour time labels. * * @category display */ readonly hour24Format: BooleanConstructor; /** * Clamps time click calculations to interval boundaries. * * @category behavior */ readonly timeClicksClamped: BooleanConstructor; /** * Header layout used for date labels. * * @category display */ readonly dateHeader: { readonly type: PropType; readonly default: "stacked"; readonly validator: (v: string) => boolean; }; }; export interface SchedulerProps { view: 'day' | 'week' | 'month' | 'month-interval'; modelResources?: Resource[]; resourceKey: string; resourceLabel: string; resourceHeight: number | string; resourceMinHeight: number | string; resourceStyle?: (_scope: Scope) => any; resourceClass?: (_scope: Scope) => string; weekdayStyle?: (_scope: Scope) => any; weekdayClass?: (_scope: Scope) => string; dayStyle?: (_scope: Scope) => any; dayClass?: (_scope: Scope) => string; dateHeader: 'stacked' | 'inline' | 'inverted'; } export declare const useSchedulerProps: { /** * Scheduler view mode. * * @category display */ readonly view: { readonly type: PropType; readonly validator: (v: string) => boolean; readonly default: "day"; }; /** * Resources rendered by the scheduler. * * @category model */ readonly modelResources: { readonly type: PropType; }; /** * Resource field used as the unique key. * * @category model */ readonly resourceKey: { readonly type: PropType; readonly default: "id"; }; /** * Resource field used as the display label. * * @category model */ readonly resourceLabel: { readonly type: PropType; readonly default: "label"; }; /** * Height in pixels or CSS units for each resource row. * * @category layout */ readonly resourceHeight: { readonly type: PropType; readonly default: 0; readonly validator: typeof validateNumber; }; /** * Minimum height in pixels or CSS units for each resource row. * * @category layout */ readonly resourceMinHeight: { readonly type: PropType; readonly default: 70; readonly validator: typeof validateNumber; }; /** * Function that returns inline styles for resource rows. * * @category style */ readonly resourceStyle: { readonly type: PropType; readonly default: null; }; /** * Function that returns CSS classes for resource rows. * * @category style */ readonly resourceClass: { readonly type: PropType; readonly default: null; }; /** * Function that returns inline styles for weekday header cells. * * @category style */ readonly weekdayStyle: { readonly type: PropType; readonly default: null; }; /** * Function that returns CSS classes for weekday header cells. * * @category style */ readonly weekdayClass: { readonly type: PropType; readonly default: null; }; /** * Function that returns inline styles for day cells. * * @category style */ readonly dayStyle: { readonly type: PropType; readonly default: null; }; /** * Function that returns CSS classes for day cells. * * @category style */ readonly dayClass: { readonly type: PropType; readonly default: null; }; /** * Header layout used for date labels. * * @category display */ readonly dateHeader: { readonly type: PropType; readonly default: "stacked"; readonly validator: (v: string) => boolean; }; }; export interface AgendaProps { view: 'day' | 'week' | 'month' | 'month-interval'; leftColumnOptions?: any[]; rightColumnOptions?: any[]; columnOptionsId?: string; columnOptionsLabel?: string; weekdayStyle?: (_scope: Scope) => any; weekdayClass?: (_scope: Scope) => string; dayStyle?: (_scope: Scope) => any; dayClass?: (_scope: Scope) => string; dateHeader: 'stacked' | 'inline' | 'inverted'; dayHeight: number | string; dayMinHeight: number | string; } export declare const useAgendaProps: { /** * Agenda view mode. * * @category display */ readonly view: { readonly type: PropType; readonly validator: (v: string) => boolean; readonly default: "day"; }; /** * Column definitions rendered before the day columns. * * @category layout */ readonly leftColumnOptions: { readonly type: PropType; }; /** * Column definitions rendered after the day columns. * * @category layout */ readonly rightColumnOptions: { readonly type: PropType; }; /** * Field name used as each agenda column id. * * @category layout */ readonly columnOptionsId: { readonly type: PropType; }; /** * Field name used as each agenda column label. * * @category layout */ readonly columnOptionsLabel: { readonly type: PropType; }; /** * Function that returns inline styles for weekday header cells. * * @category style */ readonly weekdayStyle: { readonly type: PropType; readonly default: null; }; /** * Function that returns CSS classes for weekday header cells. * * @category style */ readonly weekdayClass: { readonly type: PropType; readonly default: null; }; /** * Function that returns inline styles for day cells. * * @category style */ readonly dayStyle: { readonly type: PropType; readonly default: null; }; /** * Function that returns CSS classes for day cells. * * @category style */ readonly dayClass: { readonly type: PropType; readonly default: null; }; /** * Header layout used for date labels. * * @category display */ readonly dateHeader: { readonly type: PropType; readonly default: "stacked"; readonly validator: (v: string) => boolean; }; /** * Height in pixels or CSS units for each agenda day row. * * @category layout */ readonly dayHeight: { readonly type: PropType; readonly default: 0; readonly validator: typeof validateNumber; }; /** * Minimum height in pixels or CSS units for each agenda day row. * * @category layout */ readonly dayMinHeight: { readonly type: PropType; readonly default: 40; readonly validator: typeof validateNumber; }; }; export interface ResourceProps extends IntervalProps { modelResources?: Resource[]; resourceKey: string; resourceLabel: string; resourceHeight: number | string; resourceMinHeight: number | string; resourceStyle?: (_scope: any) => any; resourceClass?: (_scope: any) => string; cellWidth: number | string; intervalHeaderHeight: number | string; noSticky?: boolean; } export declare const useResourceProps: { /** * Resources rendered by the resource view. * * @category model */ readonly modelResources: { readonly type: PropType; }; /** * Resource field used as the unique key. * * @category model */ readonly resourceKey: { readonly type: PropType; readonly default: "id"; }; /** * Resource field used as the display label. * * @category model */ readonly resourceLabel: { readonly type: PropType; readonly default: "label"; }; /** * Height in pixels or CSS units for each resource row. * * @category layout */ readonly resourceHeight: { readonly type: PropType; readonly default: 0; readonly validator: typeof validateNumber; }; /** * Minimum height in pixels or CSS units for each resource row. * * @category layout */ readonly resourceMinHeight: { readonly type: PropType; readonly default: 70; readonly validator: typeof validateNumber; }; /** * Function that returns inline styles for resource rows. * * @category style */ readonly resourceStyle: { readonly type: PropType; readonly default: null; }; /** * Function that returns CSS classes for resource rows. * * @category style */ readonly resourceClass: { readonly type: PropType; readonly default: null; }; /** * Width in pixels or CSS units for each interval cell. * * @category layout */ readonly cellWidth: { readonly type: PropType; readonly default: 100; }; /** * Height in pixels or CSS units for the interval header. * * @category layout */ readonly intervalHeaderHeight: { readonly type: PropType; readonly default: 20; readonly validator: typeof validateNumber; }; /** * Disables sticky resource headers and columns. * * @category behavior */ readonly noSticky: PropType; }; export interface UseIntervalReturn { parsedIntervalStart: Ref; parsedIntervalMinutes: Ref; parsedIntervalCount: Ref; parsedIntervalHeight: Ref; parsedCellWidth: Ref; parsedStartMinute: Ref; bodyHeight: Ref; bodyWidth: Ref; parsedWeekStart: Ref; parsedWeekEnd: Ref; days: Ref; intervals: Ref; intervalFormatter: Ref<(_tms: Timestamp, _short: boolean) => string>; ariaDateTimeFormatter: Ref>; arrayHasDateTime: (_arr: string[], _timestamp: Timestamp) => boolean; checkIntervals: (_arr: string[], _timestamp: Timestamp) => { firstDay: boolean; betweenDays: boolean; lastDay: boolean; }; getIntervalClasses: (_interval: Timestamp, _selectedDays?: string[], _startEndDays?: string[]) => Record; getResourceClasses: (_interval: Timestamp, _selectedDays: string[], _startEndDays: string[]) => string[]; showIntervalLabelDefault: (_interval: Timestamp) => boolean; showResourceLabelDefault: (_resource: any) => void; styleDefault: ({ scope }: { scope: any; }) => {}; getTimestampAtEventInterval: (_e: MouseEvent & TouchEvent, _day: Timestamp, _clamp?: boolean, _now?: Timestamp) => Timestamp; getTimestampAtEvent: (_e: MouseEvent & TouchEvent, _day: Timestamp, _clamp?: boolean, _now?: Timestamp) => Timestamp; getTimestampAtEventX: (_e: MouseEvent & TouchEvent, _day: Timestamp, _clamp?: boolean, _now?: Timestamp) => Timestamp; getScopeForSlot: (_day: Timestamp, _columnIndex: number) => ScopeForSlot; getScopeForSlotX: (_day: Timestamp, _columnIndex: number) => ScopeForSlotX; scrollToTime: (_time: string, _duration?: number) => boolean; scrollToTimeX: (_time: string, _duration?: number) => boolean; timeDurationHeight: (_minutes: number) => number; timeDurationWidth: (_minutes: number) => number; heightToMinutes: (_height: number) => number; widthToMinutes: (_width: number) => number; timeStartPos: (_time: string, _clamp?: boolean) => number | false; timeStartPosX: (_time: string, _clamp?: boolean) => number | false; } interface UseIntervalProps extends CalendarDaysProps { intervalHeight?: number | string; intervalMinutes?: number | string; intervalStart?: number | string; intervalCount?: number | string; hour24Format?: boolean; } export default function useInterval(props: UseIntervalProps, { times, scrollArea, parsedStart, parsedEnd, activeDate, maxDays, size, headerColumnRef, }: { times: { now: Timestamp; today: Timestamp; }; scrollArea: Ref; parsedStart: Ref; parsedEnd: Ref; activeDate?: Ref; maxDays: Ref; size: { width: number; height: number; }; headerColumnRef: Ref; }): UseIntervalReturn;