export type DatePickerFormat = "date" | "datetime" | "date_range" | "datetime_range"; export interface DateParts { y: number; mo: number; d: number; h: number; mi: number; } export declare function isRangeFormat(format: DatePickerFormat): boolean; export declare function hasTimeFormat(format: DatePickerFormat): boolean; export declare const pad: (n: number) => string; export declare function parsePart(input: string): DateParts | null; export declare function partsToIso(p: DateParts, hasTime: boolean): string; export declare function isoToDate(iso: string): Date | null; export declare function dateToParts(d: Date): DateParts; /** Parse a typed value back to a canonical ISO string. Returns "" when blank, null when unparseable. */ export declare function parseText(text: string, hasTime: boolean): string | null; export declare function timeText(iso: string): string; export declare function splitTime(time: string): { h: number; mi: number; }; /** Combine a picked calendar date with the time carried by a previous value. */ export declare function withCalendarDate(date: Date, prevIso: string, hasTime: boolean): string; /** Combine a picked "HH:mm" time with the date carried by a previous value (today if none). */ export declare function withTimeOfDay(prevIso: string, time: string): string; /** The current date as a canonical value string. */ export declare function nowIso(hasTime: boolean): string; /** Whether a value carries a time component (canonical datetime uses a "T" separator). */ export declare function isoHasTime(iso: string | null | undefined): boolean; /** The value with any time component dropped (date-only). Empty when unparseable. */ export declare function dropTime(iso: string): string; /** What committing a self-committing date field's session should do. */ export type DateCommit = { kind: "save"; value: string; } | { kind: "clear"; } | { kind: "none"; } | { kind: "invalid"; }; /** * Resolve a date field's commit (blur / Enter / calendar close). * `draft` is the last COMPLETE value the session produced ("" when emptied); * `incomplete` is true while the segments hold a partial entry (a typed day * with no year). Partial input never commits and never wipes the stored value — * the caller shows the error affordance and keeps the entry ("invalid"). An * emptied draft clears only when the field is `clearable`; otherwise it reverts * silently, matching the calendar's own Clear on a date the record requires. */ export declare function resolveDateCommit(opts: { draft: string; value: string | null; incomplete: boolean; clearable: boolean; }): DateCommit; /** * Parse a loosely-typed time string into a canonical "HH:mm" string. * Returns null when the input is not a valid time. */ export declare function parseTimeString(input: string): string | null;