/** * Copyright (c) 2025 Elara AI Pty Ltd * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details. */ import { type ValueTypeOf } from "@elaraai/east"; import { type DatasetKeyQuery, type RecordSliceBindType } from "@elaraai/east-ui/internal"; import { type KeySearchSource } from "@elaraai/east-ui-components"; import { type RowHidden, type SourceHidden } from "../shared/schedule/hidden.js"; import { type KindKeys } from "../shared/schedule/kind-keys.js"; import type { RowCodec } from "../shared/schedule/records.js"; import type { FlowchartWords } from "./messages.js"; import type { FlowchartStateRoles } from "./model.js"; /** A record Slice's part: the states' source of the rail. */ type RecordPart = ValueTypeOf; /** One state as Find seeks it among those the canvas draws: its key, its label, and whether it draws as context. */ export interface FindableState { /** Its key. */ readonly key: string; /** Its card's name; `undefined` for none. */ readonly label: string | undefined; /** Whether the narrowing leaves it out, drawn as context (`"dim"`). */ readonly dimmed: boolean; } /** One state Find found. */ export interface FoundState { /** Its key. */ readonly key: string; /** Its card's name — the drafts in place, where the canvas draws it; `undefined` for none. */ readonly label: string | undefined; /** * What leaves it out on the rail — the states' source, and which of its choices e3 has said do (the shared hidden * pick) — which a pick of it clears; `undefined` while the narrowing holds it. */ readonly hidden: readonly RowHidden[] | undefined; } /** * How a found state reads in Find's list: its key, its label where it is not its key, and — where the narrowing leaves * it out — which of the rail's choices do (`hiddenLine`), or, under `"dim"`, which dim it. * * @param found - The state * @param words - The Flowchart's words * @param dim - Whether the narrowing draws what it leaves out as context (`"dim"`), rather than hiding it * @returns Its line */ export declare function foundLine(found: FoundState, words: FlowchartWords, dim: boolean): string; /** * The drawn states a query finds, in East's order of their keys at the states' key type (see the module docs): those its * key finds — a key's start, a quoted key, a range, as the server finds a key (`findKeyInline`) — but those `listed` says * the record's matches hold; and, for bare text, those whose label holds it, in any case. * * @param states - The states the canvas draws, in any order * @param query - The query the box parsed * @param locale - The app's locale, which a label and the text are compared in * @param listed - Whether the record's matches list a state its key finds: one the states' read holds, where the record is * sought through e3; none where it is not * @param keys - The states' keys (#1549): each key's text read back once at their key type, and their order; String's by default * @returns The states found, in key order */ export declare function drawnMatches(states: readonly FindableState[], query: DatasetKeyQuery, locale: string, listed: (key: string) => boolean, keys?: KindKeys): FindableState[]; /** Props of {@link useFlowchartFind}. */ export interface FlowchartFindProps { /** The states' source of the rail, whose record they are sought in through e3; `undefined` for states read whole. */ readonly part: RecordPart | undefined; /** A stored state's roles, from its bytes and its key: the states' `read`. */ readonly read: (bytes: Uint8Array, key: string) => FlowchartStateRoles; /** The states' rows, as bytes and back. */ readonly codec: RowCodec; /** The states' keys (#1549): the key type the box parses typed text at, each key's text, and their order. */ readonly keys: KindKeys; /** The states the canvas draws, the drafts in place — as themselves or as context — never a ghost. */ readonly drawn: readonly FindableState[]; /** The states the read holds, by key: a drawn state of one is listed among the record's matches, found by its key. */ readonly stored: ReadonlyMap; /** The states' hidden pick (`hidden-pick.tsx`' `HideSources`); `undefined` for states read whole. */ readonly pick: SourceHidden | undefined; /** Whether the narrowing draws what it leaves out as context (`"dim"`): a line names the choices that dim a state. */ readonly dim: boolean; /** The Flowchart's words. */ readonly words: FlowchartWords; /** Told the state a pick lands on. */ readonly onPick: (found: FoundState) => void; } /** * Find state's source, for the shared key search's toolbar item (see the module docs). * * @param props - The states' source, their read, their keys, the drawn states, the hidden pick, whether the narrowing dims, * the words and the pick * @returns The source; `undefined` with no state to seek — none drawn, and none sought through e3 */ export declare function useFlowchartFind({ part, read, codec, keys, drawn, stored, pick, dim, words, onPick }: FlowchartFindProps): KeySearchSource | undefined; export {}; //# sourceMappingURL=find.d.ts.map