import { type Granularity } from './date-segments.cjs'; /** Anything a date-shaped member accepts: the native object, or its ISO-8601 wire form. */ export type DateInput = Date | string; /** A date range, structurally identical to Calendar's own `DateRange`. */ export interface DateRangeLike { start: Date; end: Date | null; } /** What {@link toCalendarValue} produces — the `Date`-shaped selection every framework emits. */ export type DateValue = Date | Date[] | DateRangeLike | null; /** How many dates a selection holds, deciding how a wire string widens. */ export type SelectionModeLike = 'single' | 'multiple' | 'range'; /** @internal Puts {@link toDate}'s malformed-input warning back to "not yet warned". */ export declare function resetMalformedDateWarning(): void; /** * Reads a consumer-supplied value into a local `Date` or `null`, parsing strings field-by-field (never via `new Date(string)`, which reads `YYYY-MM-DD` as UTC) and warning in dev on invalid shapes. * * @param input a `Date`, an ISO-8601 string, or `null`/`undefined` * @param source the property it arrived on, named in the warning * @returns the local calendar date, or `null` when unreadable */ export declare function toDate(input: DateInput | null | undefined, source?: string): Date | null; /** * The canonical ISO-8601 string for a date — what to persist and what `
` submits — using local wall-clock fields, not `toISOString`, which would shift dates across the date line. * * @param date the local date to render * @param granularity how much of the time of day to include * @returns `YYYY-MM-DD`, or `YYYY-MM-DDTHH:mm[:ss]` past `day` */ export declare function toISODateValue(date: Date, granularity?: Granularity): string; /** * Reads any authored selection shape into the canonical `DateValue`; the wire string is self-describing except for a single-date `multiple` selection, widened via `mode`. * * @param input the authored selection, in any accepted form * @param mode how many dates the selection holds * @param source the property it arrived on, named in the warning */ export declare function toCalendarValue(input: DateInput | ReadonlyArray | { start: DateInput; end?: DateInput | null | undefined; } | null | undefined, mode: SelectionModeLike, source?: string): DateValue | undefined; /** * The canonical wire string for a selection — what `value` takes as an * attribute and what consumers persist. * * @param value a selection in the `Date` shape * @returns the string, or `null` when nothing is selected */ export declare function toCalendarString(value: DateValue | undefined): string | null; /** * Reads a time of day from a 24-hour string or a `Date`'s local wall-clock time, discarding the date part since time of day is not an instant. * * @param input a `HH:mm[:ss]` string, a `Date`, or `null`/`undefined` * @param source the property it arrived on, named in the warning * @returns the 24-hour string, or `null` when unreadable */ export declare function toTimeValue(input: Date | string | null | undefined, source?: string): string | null;