/** * 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 { PickBindType } from "@elaraai/east-ui"; import type { planKeys } from "@elaraai/e3-ui/internal"; import type { PlanToolsChrome } from "../links/connect.js"; import { type BuilderFrameDock } from "@elaraai/east-ui-components"; import type { BacklogNarrowing } from "../../shared/schedule/backlog.js"; import type { FollowedSources } from "../../shared/schedule/follow-sources.js"; import type { PlanCanvasInspect } from "../root/inspect.js"; import type { PlanEventPart } from "../root/sources.js"; import type { PlanWords } from "../words.js"; import type { PlanBacklogEntry } from "./counts.js"; import type { PlanValue } from "./index.js"; /** The names a Plan keeps its viewer's state under. */ type PlanKeys = ReturnType; /** An author's tab, decoded. */ type PlanAuthorTabValue = Extract["value"]; /** A pick, decoded: the canvas's own over `data`'s series, and the Series tab's. */ export type PlanPickValue = ValueTypeOf; /** Props of {@link usePlanLibrary}. */ export interface PlanLibraryProps { /** The library's tabs, as the payload lists them. */ library: PlanValue["library"]; /** The event kinds: their templates and their backlogs. */ kinds: PlanValue["events"]; /** * The tools' chrome (#1541, U10), while a link kind is editable: the Events tab lists each such kind's templates * under its name, and a click holds one — a link Connect draws takes its values. `undefined`, none is listed. */ tools?: PlanToolsChrome | undefined; /** The series the event kinds land on (#1541): what a template's card names its kind's series by. */ landings: PlanValue["landings"]; /** What the canvas reads of its rows (#1199, #1541): a backlog card names its resource by its landing row, else by its row read by its key. */ inspect?: PlanCanvasInspect | undefined; /** The canvas's own pick over `data`'s series, when they are picked. */ pick: PlanPickValue | undefined; /** The names the Plan keeps its viewer's state under. */ keys: PlanKeys; /** The ids this viewer hides. */ hidden: readonly string[]; /** Replaces the ids this viewer hides. */ onHidden: (next: readonly string[]) => void; /** The moment the backlog's weeks are counted from: the axis's now, or the clock's. */ now: Date; /** The Plan's words. */ words: PlanWords; /** Whether a row of the canvas takes a card from an author's tab (#1259): its cards drag then. */ takesCards: boolean; /** Every kind's unscheduled events, in the kinds' order, read with the drafts in place (#1196): the counts' read's (`counts.ts`). */ unscheduled?: readonly PlanBacklogEntry[] | undefined; /** Whether the canvas draws an event kind's row to drop a template or a backlog event on (#1196): their cards drag then. */ takesEvents?: boolean | undefined; /** The event kinds with an event on the canvas (#1196): an author's tab whose patch lands on one lets its cards drag. */ patchKinds?: ReadonlySet | undefined; /** The sources of the slice the tabs follow (#1344): each templates list's, and each an author's tab names. */ followed?: FollowedSources | undefined; /** What the rail hides of the backlog (#1344): the Backlog tab's `N of M`, and its Clear filters. */ backlogNarrowing?: BacklogNarrowing | undefined; /** Whether the backlog's cards and count stand in for a read in flight (#1398, CL8): its pane busy, and retained. */ backlogRetained?: boolean | undefined; /** Whether a run of the optimiser moved an event into or out of the backlog (#1409): the Backlog tab's count flashes as it lands. */ backlogFlash?: boolean | undefined; } /** * The library a Plan's templates drag from — the Events tab's (#1196). * * @param keys - The Plan's keys * @returns The library's id */ export declare function eventsLibrary(keys: PlanKeys): string; /** * The library a Plan's backlog drags from — the Backlog tab's (#1196). * * @param keys - The Plan's keys * @returns The library's id */ export declare function backlogLibrary(keys: PlanKeys): string; /** * The library an author's tab's cards drag from (#1196). * * @param keys - The Plan's keys * @param tab - The author's tab * @returns The library's id */ export declare function tabLibrary(keys: PlanKeys, tab: PlanAuthorTabValue): string; /** * The library pane, as `BuilderFrame` draws it — see the module docs. * * @param props - The library's tabs, the event kinds and the series they land on, a resource's row on the canvas, the canvas's pick, the Plan's keys, the viewer's hidden set and its setter, the backlog's now, the words, whether a row takes an author's card, the kinds' unscheduled events, whether the canvas takes the event kinds' cards, the kinds with an event on it, what each source the tabs follow shows, what the rail hides of the backlog, and whether the backlog stands in for a read in flight * @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 usePlanLibrary({ library, kinds, tools, landings, inspect, pick, keys, hidden, onHidden, now, words, takesCards, unscheduled: read, takesEvents, patchKinds, followed, backlogNarrowing, backlogRetained, backlogFlash, }: PlanLibraryProps): BuilderFrameDock | undefined; export {}; //# sourceMappingURL=library.d.ts.map