import { type DateLike } from './datetime/date-core'; export type DateTimeValue = Date | string | number | null; export type DropDownDisplayMode = 'both' | 'calendar' | 'time'; export type DateTimeTab = 'date' | 'time'; /** Reactive inputs are getters; callbacks are closures. */ export type DateTimePickerConfig = { value: () => DateTimeValue; onChange?: (value: Date | null) => void; /** Fired when the value is finalized (Enter, blur, or a single-date pick). */ onCommit?: (value: Date | null) => void; /** Fired on Escape / dismiss without committing. */ onCancel?: () => void; formatString?: () => string; min?: () => DateLike | null; max?: () => DateLike | null; nullable?: () => boolean; locale?: () => string; dropDownDisplayMode?: () => DropDownDisplayMode; spinButtons?: () => boolean; stepMinutes?: () => number; disabled?: () => boolean; readonly?: () => boolean; /** Accessible label for the open-picker toggle (localizable). */ toggleLabel?: () => string | undefined; /** Accessible label for the clear button (localizable). */ clearLabel?: () => string | undefined; id?: () => string | undefined; invalid?: () => boolean; required?: () => boolean; error?: () => string | undefined; hint?: () => string | undefined; ariaLabel?: () => string | undefined; }; export declare function createDateTimePicker(config: DateTimePickerConfig): { readonly current: Date | null; text: string; readonly open: boolean; readonly tab: DateTimeTab; readonly isInteractive: boolean; readonly showDateTab: boolean; readonly showTimeTab: boolean; commit: (next: Date | null) => void; commitFromText: () => void; bump: (deltaMin: number) => void; onCalendarChange: (dates: Date[]) => void; onTimeChange: (t: Date) => void; openPanel: () => void; closePanel: () => void; toggle: () => void; setTab: (t: DateTimeTab) => void; onInputKeydown: (e: KeyboardEvent) => void; /** The text field: masked value round-trips through the token engine. Spread * alongside `bind:value={dtp.text}`. */ inputProps(): { onblur: () => void; onkeydown: (e: KeyboardEvent) => void; 'aria-invalid': "true" | undefined; 'aria-required': "true" | undefined; 'aria-describedby': string | undefined; 'aria-label': string | undefined; id: string | undefined; type: "text"; disabled: boolean; readonly: boolean; }; /** The calendar-toggle button. */ toggleProps(): { type: "button"; 'aria-label': string; 'aria-haspopup': "dialog"; 'aria-expanded': boolean; disabled: boolean; tabindex: number; onclick: () => void; }; /** The inline clear (x) button (nullable values). */ clearProps(): { type: "button"; 'aria-label': string; onclick: () => void; }; /** A spin (increment/decrement) button that steps by `stepMinutes`. */ spinProps(dir: 1 | -1): { type: "button"; tabindex: number; 'aria-label': string; disabled: boolean; onclick: () => void; }; /** A DATE / TIME tab button. */ tabProps(which: DateTimeTab): { type: "button"; role: "tab"; 'aria-selected': boolean; onclick: () => void; }; }; export type DateTimePicker = ReturnType;