/** * Copyright (c) 2025 Elara AI Pty Ltd * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details. */ import { type SheetKind } from "./model.js"; import { type WhenLevel } from "./parse/date.js"; import type { LinkVocabulary } from "./link/grammar.js"; import type { LinkHalves } from "./link/sides.js"; import type { LinkGroups } from "./sheet-state.js"; import type { SheetMemberValue } from "./values.js"; type Styles = Record>; /** A focus request — bumped by the machine's `focus.editor` effect. */ export interface EditorFocusRequest { seq: number; selectAll: boolean; } /** The link editor's view. */ export interface LinkEditorView { side: 0 | 1; halves: LinkHalves; groups: LinkGroups; /** The flat chip range under the selection. */ chipSel: { lo: number; hi: number; } | null; /** The predicted members per half (P4). */ predicted: [readonly SheetMemberValue[], readonly SheetMemberValue[]]; vocab: LinkVocabulary | undefined; /** Bumps on a hop — the new half's input takes focus. */ hop: number; /** A `set` column — one half, no arrow. */ single: boolean; } /** One option of a combobox column's menu: a register member, best first — its key, and the words its cell shows. */ export interface EditorOption { key: string; label: string; meta?: string | undefined; tone?: string | undefined; } /** The keys the machine sees from the editor. */ export interface EditorKey { key: string; shift: boolean; meta: boolean; alt: boolean; atEnd: boolean; } export interface SheetEditorProps { styles: Styles; /** The column kind — which field the ring holds. */ kind: SheetKind; value: string; /** A date column's buffer as a date (`undefined` while the buffer is empty or incomplete). */ date: Date | undefined; /** The printable key that opened the editor, if one did — the date field types it into its first segment. */ seed: string | undefined; /** The inline ghost (the top prefix candidate's suffix). */ ghost: string; /** A non-prefix match, previewed as a replacement. */ resolve: string; /** `k/n` over the candidates. */ badge: string; /** The neg ring. */ error: boolean; focus: EditorFocusRequest; ariaLabel: string; /** The link editor, on a link / set column. */ link: LinkEditorView | undefined; /** An enum column's options (the machine's candidates), best first. */ options?: readonly EditorOption[] | undefined; /** The armed option's index (`-1` = none armed). */ highlighted?: number | undefined; /** Browsing: the buffer is a whole option (or empty), so ↑ ↓ step the buffer through the options here instead of the machine's candidates. */ browse?: boolean | undefined; /** A click on an option: the sheet writes its member and moves on. */ onPick?: ((option: EditorOption) => void) | undefined; /** ↑ ↓ while browsing reach an option: the buffer holds its member — the one of two who share its words. */ onBrowse?: ((option: EditorOption) => void) | undefined; /** A date column's level for this row (#844): at `time` the field grows a time box. */ whenLevel?: WhenLevel | undefined; onChange: (val: string) => void; onKey: (e: EditorKey) => boolean; onBlur: () => void; onHalfDown: (side: 0 | 1) => void; } /** * Whether a column's editor is the combobox: its register's members in a menu. * * @param kind - The column kind * @returns Whether it is an enum or a person column */ export declare function isComboboxKind(kind: SheetKind): boolean; /** Renders the overlay editor. */ export declare const SheetEditor: import("react").MemoExoticComponent<({ styles, kind, value, date, seed, ghost, resolve, badge, error, focus, ariaLabel, link, options, highlighted, browse, onPick, onBrowse, whenLevel, onChange, onKey, onBlur, onHalfDown }: SheetEditorProps) => import("react/jsx-runtime").JSX.Element>; export {}; //# sourceMappingURL=Editor.d.ts.map