/** * Copyright (c) 2025 Elara AI Pty Ltd * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details. */ import { type LinkVocabulary } from "./grammar.js"; import type { SheetLinkValue, SheetMemberValue, SheetRegisterMemberValue } from "../values.js"; import type { SheetWords } from "../words.js"; /** One candidate the strip lists. */ export interface LinkCandidate { /** The text the buffer takes (and the chip's label). */ label: string; /** The register's line beside it. */ meta: string; /** What picking it adds to the half. */ members: SheetMemberValue[]; } /** * The free identified members under a countable: the ones naming it as their * `parent` (a bay's machines), else the ones whose `meta` names it (a family's). */ export declare function membersUnder(parent: SheetRegisterMemberValue, vocab: LinkVocabulary, used: ReadonlySet): SheetRegisterMemberValue[]; /** * The scored candidates for a typed buffer, in the B§4.5 order — their metas * in the sheet's words where they are its own (#861). * * @param query - The typed buffer * @param vocab - The column's vocabulary * @param used - The lower-cased keys the cell already holds * @param w - The sheet's words * @returns The candidates, best first */ export declare function linkCandidates(query: string, vocab: LinkVocabulary, used: ReadonlySet, w: SheetWords): LinkCandidate[]; /** * The armed candidate: the explicit pick, else the top one once something is typed. * * @param query - The typed buffer * @param hi - The explicit pick (`-1` = none) * @param vocab - The column's vocabulary * @param used - The lower-cased keys the cell already holds * @param w - The sheet's words * @returns The candidate, if any */ export declare function linkCandidateAt(query: string, hi: number, vocab: LinkVocabulary, used: ReadonlySet, w: SheetWords): LinkCandidate | undefined; /** The inline ghost — the armed candidate's suffix when it completes the buffer. */ export declare function linkGhost(query: string, cand: LinkCandidate | undefined): string; /** The replacement preview — a real match that is not a prefix (an alias, an attribute, a range). */ export declare function linkResolve(query: string, cand: LinkCandidate | undefined): string; /** * What a buffer resolves to on `,` / ⏎ / a hop / a commit: the armed * candidate when it completes the buffer, else the grammar over the text * (commas split, ranges expand, the counted form counts). */ export declare function resolveBuffer(query: string, cand: LinkCandidate | undefined, vocab: LinkVocabulary): SheetMemberValue[]; /** * The predicted members for one half — the fill's link minus what the cell * already holds; a counted member withdrawn once the half has named members; * never into a locked half; nothing while the buffer is typed. */ export declare function predictedMembers(predicted: SheetLinkValue | undefined, side: 0 | 1, groups: readonly [readonly SheetMemberValue[], readonly SheetMemberValue[]], live: boolean, typed: string, vocab: LinkVocabulary): SheetMemberValue[]; /** * The entry menu of a link half, in the vocabulary's order (the options rule's, * when the row is offered a subset): the countable abstractions (nobody guesses * a code) and each RUN of a ranged kind's consecutive codes as one range * (`R2140-R2145`, #844); the identified codes only when nothing else is * offered. Nothing already used. * * @param vocab - The column's vocabulary * @param used - The lower-cased keys the cell already holds * @param w - The sheet's words (a range's span, #861) * @returns The menu */ export declare function linkEntryCandidates(vocab: LinkVocabulary, used: ReadonlySet, w: SheetWords): LinkCandidate[]; /** * The grammar line the strip states when a half has nothing to offer — the * forms the half takes, in the sheet's words (#861); `TBC` is the grammar's * own token. * * @param vocab - The column's vocabulary * @param w - The sheet's words * @returns The line */ export declare function grammarLine(vocab: LinkVocabulary, w: SheetWords): string; /** * The metas of a candidate list's members, for tests and the strip. * * @param c - The candidate * @param vocab - The column's vocabulary * @param w - The sheet's words * @returns The first meta a member has, or `""` */ export declare function candidateMeta(c: LinkCandidate, vocab: LinkVocabulary, w: SheetWords): string; //# sourceMappingURL=predict.d.ts.map