/** * Copyright (c) 2025 Elara AI Pty Ltd * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details. */ /** * The cells of the kinds only a Record draws (`Record - DX Proposal.md` * C1–C10), each from its row's cells and its column's payload, its look a * data attribute on the record recipe's slots: * * - **title** (C1) — the title, its neutral initials before it with `avatar`; * - **person** (C2) — the member's initials and label, or a dashed ring and the * words for no one; * - **boolean** (C3) — a checkbox; * - **cycle** and **toggle** (C4–C6) — a chip as wide as its column's widest * label, a scale's member up the heat ramp and any other in its tone's * wash; or the mark look, a scale's pips — a toggle's one — or a valence's * dot and word; * - **age** (C7) — whole units to the Record's clock, a dot once it is stale; * - **audit** (C8, C9) — the date, and in blame mode the verb and who; while * the row's drafts change its fields, PENDING and how many; * - **an absent value** (C10) — in the column's words, else a dash. * * A row the record does not hold yet has no age and no audit to show. Every * other kind draws as the Sheet's cell content draws it (C11). * * @packageDocumentation */ import type { ReactNode } from "react"; import { type SlotStyles } from "@elaraai/east-ui-components/internal"; import type { SheetRowChanges } from "../sheet/index.js"; import { type SheetColumnIndex, type SheetColumnMeta, type SheetRegisterIndex } from "../sheet/model.js"; import type { SheetCellValue, SheetRowValue } from "../sheet/values.js"; import type { SheetWords } from "../sheet/words.js"; /** What a cell of a Record's own kind draws, and what it says on hover. */ export interface RecordCellView { /** What the cell holds. */ content: ReactNode; /** Its hover; `undefined` where it says nothing beyond its value. */ title: string | undefined; } /** What a cell of a Record's own kind is drawn from. */ export interface RecordCellInput { /** The record recipe's slot styles. */ styles: SlotStyles; /** The cell's column. */ meta: SheetColumnMeta; /** The cell's row: its key, and the rule cells an audit reads. */ row: SheetRowValue; /** The cell. */ cell: SheetCellValue | undefined; /** The registers, by name. */ registers: SheetRegisterIndex; /** What the row's drafts changed; `undefined` for a row no gesture has touched. */ changes: SheetRowChanges | undefined; /** The Record's now: what an age counts to. */ now: Date; /** The Sheet's words: the counts in the viewer's language. */ words: SheetWords; /** A cycle's or a toggle's chip's least width in characters: its column's widest label. */ chip: number | undefined; } /** * A scale's member's look (C5): the first empty, the rest up the heat ramp * to its fourth step, evenly — of three members, the second's the second step * and the third's the fourth. The footer's legend draws its chips so (FT2). * * @param at - The member's place in the register; `-1` for a key no member has * @param n - How many members the register has * @returns The look */ export declare function heatOf(at: number, n: number): string; /** * Each cycle's and toggle's chip's least width in characters, by column key * (C4): its widest label, one width a column, so its states line up. * * @param columns - The columns drawn * @param registers - The registers * @returns The widths */ export declare function chipWidths(columns: SheetColumnIndex, registers: SheetRegisterIndex): ReadonlyMap; /** * A cell of one of the kinds only a Record draws — see the module docs. * * @param input - The cell, its row and its column, and what they are read against * @returns What the cell draws and says on hover; `undefined` for a Sheet kind, which the Sheet's cell content draws */ export declare function recordCell(input: RecordCellInput): RecordCellView | undefined; //# sourceMappingURL=cells.d.ts.map