import type { UndoSnapshot } from './types.js'; import type { TimeValue } from '../../core/types/time.js'; import type { SpinButtonHandler } from '../spin-buttons/spin-button-group/types.js'; /** * Normalises a pasted ISO-like string so that downstream parsers can handle it: * - Uppercases the `T` separator and any trailing `z` / `Z` in the timezone. * - When a full ISO datetime has no timezone suffix, interprets it as local time * in the user's configured timezone (per ISO 8601) and converts to UTC. * Non-ISO input is returned unchanged. * @internal */ export declare function normalizeISOInput(input: string): string; /** * Parses a time-only string to a full ISO UTC datetime string anchored at `2000-01-01`. * Accepts: `HH:MM`, `HH:MMZ`, `HH:MM:SS`, `HH:MM:SS.mmm`, with optional `Z` / `±hh:mm` offset. * Returns `null` if the input does not represent a valid time. * @internal */ export declare function parseTimeOnlyToISO(input: string): string | null; /** * Parses a date-only string matched against the strict ISO 8601 date format (`YYYY-MM-DD`). * Returns a full ISO UTC midnight datetime string, or `null` if the input is not a valid date. * @internal */ export declare function parseDateOnlyToISO(input: string, anchor?: 'startOfDay' | 'endOfDay'): string | null; /** * Captures the current state of a DateTimeInput's spinbuttons and expression input. * @internal */ export declare const captureUndoSnapshot: (spinButtonHandlers: Map, expressionRef: HTMLSpanElement | null | undefined, value: TimeValue | null, valueType: "expression" | "iso8601") => UndoSnapshot; type DateFieldType = 'day' | 'month' | 'year'; export type PartialDate = Partial>; /** * Extracts a partial date from an input string using the user's regional date format. * Returns a `PartialDate` with `day`, `month`, and/or `year` fields mapped according * to the locale's field order. Handles incomplete inputs like `"12/"` or `"12.2024"`. * Returns `null` if no date pattern is found. * @internal */ export declare function tryParsePartialDate(input: string): PartialDate | null; type TimeFieldType = 'hour' | 'minute' | 'second' | 'millisecond'; export type PartialTime = Partial> & { dayPeriod?: string; }; /** * Extracts a partial time from an input string using the user's regional time format. * Returns a `PartialTime` with `hour`, `minute`, `second`, `millisecond`, and/or * `dayPeriod` fields. Requires two-digit hours, minutes, and seconds. * For 12-hour locales, optionally matches the locale-specific AM/PM label. * Returns `null` if no time pattern is found. * @internal */ export declare function tryParsePartialTime(input: string): PartialTime | null; export type PartialDateTimeResult = { /** Normalized ISO string that can be applied to spin buttons. */ iso: string; /** * If set, only these spin button parts should be updated (partial result). * When absent the result is complete and can be fed through the existing * paste pipeline (date-only / time-only / full ISO). */ partsToUpdate?: Set; }; /** * Converts partial date and/or time objects into an ISO-compatible string. * * - Complete date + complete time → full ISO datetime (no `partsToUpdate`). * - Complete date only → `"YYYY-MM-DD"` (no `partsToUpdate`). * - Complete time only → `"HH:MM[:SS[.mmm]]"` (no `partsToUpdate`). * - Partial fields → ISO string with defaults filled in, plus a `partsToUpdate` * set that lists only the spin button parts that should actually be applied. * - No fields at all → `null`. * * A date is "complete" when it has `day`, `month`, and `year`. * A time is "complete" when it has `hour` and `minute`. * @internal */ export declare function partialDateTimeToISO(date: PartialDate | null, time: PartialTime | null): PartialDateTimeResult | null; export {};