/** * Copyright (c) 2025 Elara AI Pty Ltd * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details. */ /** * What the canvas SAYS (#819) — the text alternative of every element and * colour-only cell, and the live region's announcements. Pure: the renderers * put these strings on `aria-label`s and visually hidden text, and the * canvas's live region reads them out. * * Every mark on a Plan encodes something by shape, position or colour: a run * bar's state is its fill, a heat cell's value its depth, a segment's category * its colour, a chart's shape its values. A screen reader gets none of that, * so each gets words — the element's own label, where it sits on the axis in * words (`scale.instantText` / `scale.bucketText`, never the ruler tick), and * the fact its look encodes. * * The words are the canvas's (#820): every phrase comes from its message * table, and every number and date is in its locale. * * What a paged source reads is the footer's loading line's to say, a polite * live region of its own that speaks once a load (#1398, CL12): the canvas's * live region says no window's landing. * * @packageDocumentation */ import { type ValueTypeOf } from "@elaraai/east"; import { Plan } from "@elaraai/e3-ui/internal"; import type { PlanScale, PlanBucket } from "./scale.js"; import type { PlanEvent, PlanUiState, RowKey } from "./plan-state.js"; import type { PlanWords } from "./words.js"; import type { TickFormatOpt } from "@elaraai/east-ui-components"; import { type ChartKindValue } from "./rows/chart-geometry.js"; type RunValue = ValueTypeOf; type ChipValue = ValueTypeOf; type EventMarkValue = ValueTypeOf; type DecisionValue = ValueTypeOf; type BucketEventValue = ValueTypeOf; type SegmentValue = ValueTypeOf; /** An element's lifecycle state (`EventStateType`). */ export type PlanStateValue = RunValue["state"]; /** * A lifecycle state in words — what a bar's fill, a tile's chip or a card's * outline says by look. * * @param state - The element's state * @param w - The canvas's words * @returns The words — `proposed removal` */ export declare function stateText(state: PlanStateValue, w: PlanWords): string; /** * A status tone as the accessible name of the dot or icon that shows it. * * @param tone - The status tag (`warning`, `danger`, …) * @param w - The canvas's words * @returns `Status: warning` */ export declare function statusText(tone: string, w: PlanWords): string; /** * A run bar's accessible name — its label, its span, its state, and what its * look adds: the quantity caption (#824), the `moved ×k` counter, its * status's words. * * @param run - The run * @param scale - The shared scale * @param w - The canvas's words * @returns `J-4642, Jun 29, 2026 – Jul 27, 2026, actual, 96 k sheets` */ export declare function runName(run: RunValue, scale: PlanScale, w: PlanWords): string; /** * A span row's decision diamond — where it sits, and whether it is applied * (◆) or pending (◇). * * @param dec - The decision mark * @param scale - The shared scale * @param w - The canvas's words * @returns `Decision, Jul 13, 2026, applied` */ export declare function decisionName(dec: DecisionValue, scale: PlanScale, w: PlanWords): string; /** * A bucket tile's accessible name — its label (or `Event` for the resting * ✓ / `plan` chip), its bucket, its lane caption, its state and its status's * words. * * @param ev - The bucket event * @param bucket - The bucket it renders in * @param lane - Its lane's caption, when the lane has one * @param scale - The shared scale * @param w - The canvas's words * @returns `Proof, Week of Jul 6, 2026, AM, proposed` */ export declare function tileName(ev: BucketEventValue, bucket: PlanBucket, lane: string | undefined, scale: PlanScale, w: PlanWords): string; /** * A cards chip's accessible name — its label, the buckets it spans, its state * and its status's words. * * @param chip - The chip * @param scale - The shared scale * @param w - The canvas's words * @returns `CREW A, Jun 29, 2026 – Jul 13, 2026, confirmed` */ export declare function chipName(chip: ChipValue, scale: PlanScale, w: PlanWords): string; /** * An event mark's accessible name — its label, its kind (the glyph's * meaning: ● milestone, ◇/◆ decision, ▲ exception), its instant and its * status's words. * * @param mark - The event mark * @param scale - The shared scale * @param w - The canvas's words * @returns `KICKOFF, milestone, Jun 29, 2026` */ export declare function markName(mark: EventMarkValue, scale: PlanScale, w: PlanWords): string; /** * A heat cell's value in words — the depth its colour encodes. The author's * printed label wins, then the value; a cell with none is `no data` (the 45° * hatch). * * @param value - The cell's value * @param label - The author's printed label * @param warn - Whether the value is at or above the row's warning threshold (the ring) * @param w - The canvas's words * @returns `72` / `no data` / `91, at or above the warning threshold` */ export declare function heatValueText(value: number | undefined, label: string | undefined, warn: boolean, w: PlanWords): string; /** * A weight bar's value in words — the booked fraction its width encodes, and * the pale planned treatment. * * @param fraction - The booked fraction (0–1) * @param planned - Whether the bucket is planned * @param w - The canvas's words * @param format - How the fraction prints — the arm's declared `format` (#824); a percent without one * @returns `60% booked, planned` */ export declare function weightValueText(fraction: number, planned: boolean, w: PlanWords, format?: TickFormatOpt): string; /** * A segment composition in words — each segment's category (its fill) and * its share, the author's in-bar label standing for the share where given. * * @param segments - The cell's segments, in order * @param w - The canvas's words * @param format - How a share prints — the arm's declared `format` (#824); a percent without one * @returns `booked 60%, slack 25%, free 15%` */ export declare function segmentsText(segments: readonly SegmentValue[], w: PlanWords, format?: TickFormatOpt): string; /** * A table cell's parts in words — the numerals it prints, with the muted * em-dash of a missing value said as `no value`. * * @param texts - Each part's printed text, in series order * @param w - The canvas's words * @returns `1,204, 96%` */ export declare function tablePartsText(texts: readonly string[], w: PlanWords): string; /** * A bucket-quantised element's accessible name — the bucket in words, then * what the element says about it. * * @param scale - The shared scale * @param bucket - The element's bucket * @param value - The element's value in words * @param w - The canvas's words * @returns `Week of Jul 6, 2026: 72` */ export declare function cellName(scale: PlanScale, bucket: PlanBucket, value: string, w: PlanWords): string; /** * A chart row's text alternative — its summary as a `role="img"` label: each * data layer's minimum, maximum and last value inside the window, by its * axis's format, and how many of its points breach a declared threshold (the * warn marks say that by colour alone). * * @param kind - The chart row * @param scale - The shared scale * @param w - The canvas's words * @returns `Chart: line min 1.2, max 4.5, last 3.1; columns min 0, max 12, last 7, 2 beyond threshold` */ export declare function chartSummary(kind: ChartKindValue, scale: PlanScale, w: PlanWords): string; /** * What an interaction changed, as the live region says it (#819) — a * selection, a section or chart opening or closing, a row focus coming or * going, a grain change. Judged from the UI state before and after the * interaction, so an event that moved nothing (re-selecting the selected * row, an esc with nothing to clear) says nothing. * * @param e - The interaction * @param before - The UI state before it * @param after - The UI state after it * @param label - A row's name (its gutter label) * @param w - The canvas's words * @returns The announcement, or `undefined` */ export declare function announcementOf(e: PlanEvent, before: PlanUiState, after: PlanUiState, label: (key: RowKey) => string, w: PlanWords): string | undefined; export {}; //# sourceMappingURL=a11y.d.ts.map