/** * Copyright (c) 2025 Elara AI Pty Ltd * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details. */ import { type SheetBodyItem, type SheetColumnIndex, type SheetColumnMeta, type SheetRegisterIndex } from "./model.js"; import { type LinkVocabulary } from "./link/grammar.js"; import { type SidesDecl } from "./link/sides.js"; import { type CheckDecl } from "./link/checks.js"; import type { LinkCellContext } from "./cells/Cell.js"; import type { LinkEditCtx } from "./sheet-types.js"; import type { ShownDrafts } from "./shown-drafts.js"; import type { SheetArityValue, SheetDriverValue, SheetLinkValue, SheetRowValue } from "./values.js"; import type { SheetWords } from "./words.js"; /** One link column's decoded declaration. */ export interface LinkColumn { vocab: LinkVocabulary; sides: SidesDecl | undefined; checks: readonly CheckDecl[]; /** The arity rule on the wire — the half it counts and the bridged rule. */ arity: SheetArityValue | undefined; } export interface UseSheetLinksArgs { /** Each drafted entry's draft, and each one a Save landed that the rows have still to read. */ drafts: Map; /** Each row's own draft, for a row those hold none of (#1599): what its checks read it over. */ shown: ShownDrafts; columns: SheetColumnIndex; registers: SheetRegisterIndex; driver: SheetDriverValue | undefined; driverColumn: string | undefined; body: readonly SheetBodyItem[]; rowAt: (r: number) => SheetBodyItem | undefined; /** The copilot's pending fill for a link cell — what the editor predicts from (`undefined` = none). */ predictedLink: (r: number, key: string) => SheetLinkValue | undefined; /** The member keys a row is OFFERED on a link column — its `options` rule (`undefined` = the whole register). */ allowedFor?: ((r: number, meta: SheetColumnMeta) => ReadonlySet | undefined) | undefined; /** The sheet's words (#861): the candidates' metas and the `exists` flag speak them. */ words: SheetWords; } export interface SheetLinks { linkVocabularies: ReadonlyMap; linkColumns: ReadonlyMap; /** The row's driver member's name — `undefined` when the row names none (the words then say "this row", #861). */ driverName: (row: SheetRowValue | undefined) => string | undefined; linkCellCtx: (row: SheetRowValue | undefined, meta: SheetColumnMeta) => LinkCellContext | undefined; linkCtxFor: (r: number, c: number) => LinkEditCtx | undefined; } /** The link columns' vocabularies, halves, checks and editor contexts. */ export declare function useSheetLinks({ drafts, shown, columns, registers, driver, driverColumn, body, rowAt, predictedLink, allowedFor, words }: UseSheetLinksArgs): SheetLinks; //# sourceMappingURL=use-links.d.ts.map