/** * Copyright (c) 2025 Elara AI Pty Ltd * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details. */ import type { schematicKeys } from "@elaraai/e3-ui/internal"; import { type BuilderFrameDock } from "@elaraai/east-ui-components"; import type { FollowedSources } from "../shared/schedule/follow-sources.js"; import type { BacklogEntry } from "./backlog.js"; import type { BacklogPageCount, SchematicBacklogPages } from "./backlog-pages.js"; import { type DrawnItem, type DrawnZone } from "./canvas/drawn.js"; import type { SchematicLayerValue } from "./canvas/layers.js"; import type { SchematicValue } from "./data.js"; import { type SchematicIndexAreaProps } from "./index-tab.js"; import type { SchematicLayerView } from "./layers-view.js"; import type { SchematicWords } from "./messages.js"; /** The names a Schematic keeps its viewer's state under. */ type SchematicKeys = ReturnType; /** One tab the payload lists, decoded. */ type SchematicTabValue = SchematicValue["library"][number]; /** * A tab's key among the pane's tabs — and, after the Schematic's library id, * its cards' library's: `templates`, `backlog`, `index`, `layers`, or * `tab:`. * * @param tab - The tab * @returns Its key */ export declare function schematicTabKey(tab: SchematicTabValue): string; /** * The library a tab's cards drag from (#1390): the Schematic's library id, and the tab's key. * * @param keys - The Schematic's keys * @param tabKey - The tab's key ({@link schematicTabKey}) * @returns The library's id */ export declare function schematicLibraryId(keys: SchematicKeys, tabKey: string): string; /** What the rail hides of the backlog: whether it narrows an item kind read through its source, and its Clear filters. */ export interface SchematicBacklogNarrowing { /** Whether a choice of the rail narrows an item kind with a backlog. */ readonly narrows: boolean; /** Clears those kinds' sources' choices; `undefined` while none narrows. */ readonly clear: (() => void) | undefined; } /** Props of {@link useSchematicLibrary}. */ export interface SchematicLibraryProps { /** The payload: its library's tabs, its kinds and their templates, its layers. */ readonly value: SchematicValue; /** The zones the canvas draws, the drafts in place and a hidden layer's left out: the Index's. */ readonly zones: readonly DrawnZone[]; /** The items the canvas draws, as its zones are: the Index's. */ readonly items: readonly DrawnItem[]; /** Every item kind's rows with no position, the drafts in place: the Backlog's. */ readonly backlog: readonly BacklogEntry[]; /** What the rail hides of the backlog. */ readonly backlogNarrowing: SchematicBacklogNarrowing; /** * The Backlog beside item kinds read by area (#1393, D51): its one paged list — the rows in hand, then each such kind's * rows with no position, read a page at a time — and what it counts, `undefined` while a count is read; `undefined` * while the Backlog lists only rows in hand. */ readonly backlogPages?: { readonly source: SchematicBacklogPages; readonly count: BacklogPageCount | undefined; } | undefined; /** The item kinds read by area, which the Index reads itself (#1393, D52); `undefined` with none. */ readonly indexArea?: SchematicIndexAreaProps | undefined; /** The layers, with their author defaults. */ readonly layers: readonly SchematicLayerValue[]; /** How many entities each layer holds in the drawing, by its key. */ readonly layerCounts: ReadonlyMap; /** The viewer's layer choices. */ readonly layerView: SchematicLayerView; /** Writes the viewer's layer choices. */ readonly onLayerView: (next: SchematicLayerView) => void; /** The zone the viewport is in, by its id. */ readonly inView: string | undefined; /** What the canvas has selected, by id. */ readonly selected: ReadonlySet; /** Flies to an item or a zone, by its id, and selects it. */ readonly onReveal: (id: string) => void; /** The names the Schematic keeps its viewer's state under. */ readonly keys: SchematicKeys; /** The Schematic's words. */ readonly words: SchematicWords; /** What each source of the rail its tabs follow shows: each templates record's, and each an author's tab names. */ readonly followed: FollowedSources; /** The card each card tab has selected, by the tab's key: the frame's. */ readonly picked: ReadonlyMap; /** A click on a card of a tab, by the tab's key and the card's: it selects the card, or lets the selected one go. */ readonly onPick: (tabKey: string, key: string) => void; /** A card's ⏎ (#1390, SC13): the card, by its library and its key, dropped on the selection or at the view's centre. */ readonly enter?: ((library: string, key: string) => void) | undefined; /** Whether main is below 480px (#1394, D15): no card drags, and a tap on the selected card is its ⏎, whatever the pointer. */ readonly narrow?: boolean | undefined; /** * Why an item kind adds no item (#1549), by its slot: its keys can't be typed, and it builds none — its template cards' * line, which neither drag nor drop. */ readonly off?: ReadonlyMap | undefined; } /** * The library pane, as `BuilderFrame` draws it — see the module docs. * * @param props - The payload, the drawing's zones and items, the backlog and what the rail hides of it, the layers and the viewer's choices, the zone in view, the selection, what a row's click does, the keys, the words and the followed sources * @returns The pane — its tabs the ones `library` lists, each with its count — or `undefined`, no pane, when `library` lists none */ export declare function useSchematicLibrary(props: SchematicLibraryProps): BuilderFrameDock | undefined; /** * The paged Backlog's count (#1393), read where it renders nothing and handed * to the frame only as it moves, as the Calendar's window reader hands its * read: a tracked read in the frame would draw the whole frame again at every * settle. * * @param props - The paged Backlog, the sources of the kinds it reads, and where its count goes * @returns Nothing: the count is handed on */ export declare function SchematicBacklogCountReader({ source, parts, onCount }: { readonly source: SchematicBacklogPages; readonly parts: readonly string[]; readonly onCount: (count: BacklogPageCount | undefined) => void; }): null; export {}; //# sourceMappingURL=library.d.ts.map