/** * Copyright (c) 2025 Elara AI Pty Ltd * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details. */ import type { flowchartKeys } from "@elaraai/e3-ui/internal"; import { type BuilderFrameDock } from "@elaraai/east-ui-components"; import type { FollowedSources } from "../shared/schedule/follow-sources.js"; import type { FlowchartMessages, FlowchartWords } from "./messages.js"; import type { FlowchartValue } from "./model.js"; /** The names a Flowchart keeps its viewer's state under. */ type FlowchartKeys = ReturnType; /** One tab the payload lists, decoded. */ export type FlowchartTabValue = FlowchartValue["library"][number]; /** The kinds whose cards a tab of their own lists. */ export type FlowchartCardKind = "states" | "transitions" | "lanes"; /** What a kind whose cards a tab lists carries of them: its icon, its cards, and the source they follow. */ type CardKindValue = Pick; /** * A tab's key among the pane's tabs — and, after the Flowchart's library id, * its cards' library's: `states`, `transitions`, `lanes`, or `tab:`. * * @param tab - The tab * @returns Its key */ export declare function flowchartTabKey(tab: FlowchartTabValue): string; /** * The library a tab's cards drag from — the libraries the canvas takes drops * from. * * @param keys - The Flowchart's keys * @param tabKey - The tab's key ({@link flowchartTabKey}) * @returns The library's id */ export declare function flowchartLibraryId(keys: FlowchartKeys, tabKey: string): string; /** * A kind whose cards a tab lists, as the payload carries it. * * @param value - The payload * @param kind - The kind * @returns Its icon, its cards and their source; `undefined` for a kind the Flowchart is not given */ export declare function cardKindOf(value: FlowchartValue, kind: FlowchartCardKind): CardKindValue | undefined; /** * The source of the rail a tab follows: a kind's tab its cards', an author's * tab its own — each when it names one. * * @param value - The payload * @param tab - The tab * @returns The source's name; `undefined` for a tab that follows none */ export declare function flowchartTabSource(value: FlowchartValue, tab: FlowchartTabValue): string | undefined; /** * A tab's name: an author's tab's own; a kind's tab its author's, or the * Flowchart's words for it — `Steps`, `Transitions`, `Lanes`. * * @param tab - The tab * @param m - The Flowchart's messages * @returns The name its tab shows */ export declare function flowchartTabName(tab: FlowchartTabValue, m: FlowchartMessages): string; /** Props of {@link useFlowchartLibrary}. */ export interface FlowchartLibraryProps { /** The payload: its library's tabs, and its kinds and their cards. */ readonly value: FlowchartValue; /** The names the Flowchart keeps its viewer's state under. */ readonly keys: FlowchartKeys; /** The Flowchart's words. */ readonly words: FlowchartWords; /** A card's ⏎: the card, by its library and its key, dropped on the canvas's selection. */ readonly enter?: ((library: string, key: string) => void) | undefined; /** What each source the library's tabs follow shows, by the source's name. */ readonly followed: FollowedSources; /** Whether main is below 480px: no card drags, and a tap on the selected card is its ⏎, whatever the pointer. */ readonly narrow?: boolean | undefined; /** Why the states or the lanes add no row (#1549): their keys can't be typed, and they build none — their cards' line. */ readonly off?: { readonly states?: string | undefined; readonly lanes?: string | undefined; } | undefined; } /** * The library pane, as `BuilderFrame` draws it — see the module docs. * * @param props - The payload, the Flowchart's keys, its words, a card's ⏎, the followed sources, whether main is narrow and * why a kind adds no row * @returns The pane — its tabs the ones `library` lists, each with its count; 272px wide; its collapsed state kept per viewer — or `undefined`, no pane, when `library` lists none */ export declare function useFlowchartLibrary({ value, keys, words, enter, followed, narrow, off }: FlowchartLibraryProps): BuilderFrameDock | undefined; export {}; //# sourceMappingURL=library.d.ts.map