/** * Copyright (c) 2025 Elara AI Pty Ltd * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details. */ /** * The Plan's instant vocabulary, decoded (#631) — the one place the three * axis arms (`time` / `number` / `ordinal`) are read as NUMBERS for ordering * and grouping, or built as real East values. Everything geometric goes * through the scale (`scale.ts`); these helpers are what the scale, the * renderer-side derivations (`model.ts`) and the DnD slot encoding share. * * @packageDocumentation */ import { type ValueTypeOf } from "@elaraai/east"; import { Plan } from "@elaraai/e3-ui/internal"; /** One decoded instant — `{ time | number | ordinal }` (derived from the East type, never mirrored). */ export type PlanInstantValue = ValueTypeOf; /** Whether two instants are alike — the same arm and the same East value. */ export declare const equalInstants: (a: PlanInstantValue, b: PlanInstantValue) => boolean; /** The axis kinds — the arms of {@link PlanInstantValue}. */ export type PlanAxisKind = PlanInstantValue["type"]; /** A `time` instant — a REAL East variant value (`variant`, never a `{ type, value }` literal). */ export declare function timeInstant(d: Date): PlanInstantValue; /** A `number` instant. */ export declare function numberInstant(n: number): PlanInstantValue; /** An `ordinal` instant. */ export declare function ordinalInstant(s: string): PlanInstantValue; /** * The instant as a comparable number ON ITS OWN ARM — epoch ms for `time`, * the value for `number`, the declared INDEX for `ordinal` (`NaN` when the * value is not in the declared list, or no list is given). Comparing two * instants of different arms is meaningless; callers hold the arm against * the axis first. * * @param t - The instant * @param ordinal - The ordinal axis's value → index map, when known * @returns The comparable number, or `NaN` */ export declare function instantOrder(t: PlanInstantValue, ordinal?: ReadonlyMap): number; /** * A stable identity for grouping cells by instant — its arm and its value as * East prints it (`time:2026-01-05T00:00:00.000`, `number:3.0`, * `ordinal:P1`): two instants that name the same bucket share a key. * * @param t - The instant * @returns The grouping key */ export declare function instantKey(t: PlanInstantValue): string; /** * The instant a {@link instantKey} names — its inverse, read with East's * parsers, so an element can carry its instant in a DOM attribute and the * canvas read it back (#816: a cell's `data-cell`). * * @param key - A key `instantKey` produced * @returns The instant, or `undefined` for a string no instant produces */ export declare function instantOfKey(key: string): PlanInstantValue | undefined; //# sourceMappingURL=instant.d.ts.map