/** * Copyright (c) 2025 Elara AI Pty Ltd * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details. */ import { type CandidateContext } from "./candidates.js"; import { type SheetColumnMeta } from "./model.js"; import type { LinkCandidate } from "./link/predict.js"; import { type WhenLevel } from "./parse/date.js"; import type { EditBuffer } from "./sheet-types.js"; import type { SheetCellValue, SheetMemberValue } from "./values.js"; import { type SheetWords } from "./words.js"; type Styles = Record>; /** What a strip chip does when clicked. */ export type StripAction = /** A candidate — its member replaces the buffer, in the words it shows. */ { kind: "candidate"; label: string; key: string; i: number; } /** A link chip — adds members to the active half. */ | { kind: "members"; label: string; members: SheetMemberValue[]; } /** A pending fill — takes it. */ | { kind: "fill"; key: string; } /** The `+n rows` chip — takes every suggestion. */ | { kind: "rows"; }; /** One strip chip. */ export interface StripChip { key: string; label: string; /** Armed (brand tint). */ on: boolean; /** A preview-only entry — not an action. */ flat: boolean; /** Pending — an async provider in flight. */ pending?: boolean; title: string; /** What a click does. */ action?: StripAction | undefined; } /** The strip model. */ export interface StripModel { on: boolean; label: string; chips: StripChip[]; meta: string; keys: string; } /** What the strip reads beside the edit buffer. */ export interface StripInput { /** The sheet's words — the strip speaks them (#861), and a number reads and previews in the viewer's language, as the cells print (#852). */ words: SheetWords; edit: EditBuffer | null; meta: SheetColumnMeta | undefined; candidates: CandidateContext | undefined; today: Date; /** The base column's date for a date column with `base`. */ baseDate: Date | undefined; /** The unit for a quantity column (from the driver). */ unit: string | undefined; /** A custom kind's parse of the buffer, for its preview. */ customPreview: SheetCellValue | null | undefined; /** The link editor's facts, on a link / set column. */ link?: StripLinkInput | undefined; /** The pending suggestions, when no editor is open (B§9's sixth state). */ suggested?: StripSuggestInput | undefined; /** A date column's level for the edited row (#844). */ whenLevel?: WhenLevel | undefined; /** The ring's cell's detail, when no editor is open and nothing is suggested. */ detail?: StripDetailInput | undefined; } /** What the strip shows of a resting cell's detail: the column, the detail's parts, its meta, the keys. */ export interface StripDetailInput { label: string; chips: readonly string[]; meta: string; keys: string; } /** What the link strip states read (B§9). */ export interface StripLinkInput { side: 0 | 1; /** The candidates for the buffer, members already in the cell excluded. */ candidates: LinkCandidate[]; /** The armed candidate. */ armed: LinkCandidate | undefined; /** The entry menu — the countable abstractions. */ entry: LinkCandidate[]; /** The predicted members of the active half, with an enumerate alternative and their provenance. */ predicted: readonly SheetMemberValue[]; enumerate: LinkCandidate | undefined; predictedMeta: string; /** The arity meta while the arity half is edited. */ arity: string; /** The grammar in one line. */ grammar: string; } /** The pending suggestions the strip states when no editor is open. */ export interface StripSuggestInput { /** The pending fills in column order — the header, the value's text, the provenance; the next target armed. */ fills: readonly { key: string; header: string; text: string; meta: string; armed: boolean; }[]; /** Proposed rows pending. */ rows: number; /** The first proposal's provenance. */ rowsMeta: string; /** Providers still in flight, by header. */ pending: readonly { key: string; header: string; }[]; } /** The strip for the current state (pure). */ export declare function buildStrip(input: StripInput): StripModel; export interface SheetStripProps { styles: Styles; model: StripModel; onAction: (action: StripAction) => void; } /** Renders the docked strip — the chips of the current page, the pager when there is more than one. */ export declare const SheetStrip: import("react").MemoExoticComponent<({ styles, model, onAction }: SheetStripProps) => import("react/jsx-runtime").JSX.Element | null>; export {}; //# sourceMappingURL=Strip.d.ts.map