/**
* The value coercions the built-in editors share.
*
* Editors sit at the boundary between the application's data — which holds
* whatever the API it came from happened to send: a `Date`, an ISO string, an
* epoch number, `"true"`, `"1"` — and the DOM, which speaks only strings and a
* handful of rigid input formats. Every editor needs the same handful of
* translations across that boundary, so they live here once rather than being
* re-derived (and subtly diverging) in six files.
*
* ### Why the date helpers are UTC
* `` and `` carry no time zone.
* Reading one back through the local calendar (`new Date(2024, 2, 15)`) and then
* serialising with `toISOString()` shifts the day for every user west of
* Greenwich, so a cell showing `15 Mar` commits as `14 Mar` in New York. Both
* directions therefore pin to UTC: what the user sees in the field is exactly
* the calendar date that round-trips back out of {@link fromDateInputValue}.
*
* @packageDocumentation
*/
/** The value `` shows when a cell holds no colour. */
export declare const DEFAULT_COLOUR = "#000000";
/**
* Interprets any of the shapes a "boolean" column actually stores.
*
* A checkbox column is routinely fed `1`, `"true"`, `"Y"` or `"yes"` by a
* back end that has no boolean type, and an editor that used a bare `!!value`
* would render `"false"` as checked — the string is truthy. Recognising the
* textual negatives explicitly is the only way that column behaves.
*/
export declare function toBoolean(value: unknown): boolean;
/**
* Parses whatever a date-like column stores into a `Date`, or `null` when the
* value is absent or unparseable.
*
* A bare `yyyy-MM-dd` string is read as UTC midnight — see the module note.
* Anything the platform cannot parse yields `null` rather than an `Invalid
* Date`, so no caller has to remember to test `isNaN` on the result.
*/
export declare function toDate(value: unknown): Date | null;
/** Formats a cell value as the `yyyy-MM-dd` text `` requires. */
export declare function toDateInputValue(value: unknown): string;
/**
* Formats a cell value as the `yyyy-MM-ddTHH:mm` text
* `` requires — an ISO string minus its seconds
* and zone suffix.
*/
export declare function toDatetimeInputValue(value: unknown): string;
/**
* Formats a cell value as the `HH:mm` text `` requires.
*
* A time column commonly stores clock text already, which is passed through
* untouched; a `Date` or timestamp is read for its UTC clock reading, matching
* the date helpers.
*/
export declare function toTimeInputValue(value: unknown): string;
/** Converts `yyyy-MM-dd` back to a full ISO string, or `null` for an empty field. */
export declare function fromDateInputValue(text: string): string | null;
/** Converts `yyyy-MM-ddTHH:mm` back to a full ISO string, or `null` when empty. */
export declare function fromDatetimeInputValue(text: string): string | null;
/** Constrains `value` to `[min, max]`, ignoring a bound that was not supplied. */
export declare function clamp(value: number, min?: number, max?: number): number;
/**
* Rounds to `precision` decimal places.
*
* Goes through `toFixed` rather than `Math.round(v * 10 ** p) / 10 ** p` because
* the latter reintroduces the binary-float error it is meant to remove
* (`1.005` at two places). The extra `Number()` strips the trailing zeros
* `toFixed` adds, which would otherwise turn a number into a string.
*/
export declare function roundTo(value: number, precision?: number): number;
/**
* Normalises colour text to the `#rrggbb` form `` accepts,
* or `null` when the text is not a hex colour.
*
* The shorthand `#abc` is expanded rather than rejected: users type it, and the
* native colour input silently ignores anything it does not recognise, which
* would leave the swatch and the text field disagreeing.
*/
export declare function normalizeHex(text: string): string | null;
//# sourceMappingURL=coercion.d.ts.map