/** * Copyright (c) 2025 Elara AI Pty Ltd * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details. * * The sources of a Plan's one `Slice.bindRecords` (#1344), place by place: * the `rows` source gives the canvas its rows, paged from it; a source named * after an event kind narrows that kind's events and its backlog, its reads * the kind's own; a resource kind's narrows that kind's rows and Choosers — a * paged kind's gives it its windows, its narrowing's rows; and a templates * list's and an author's tab's narrow those cards. Every source holding a * `range` of the axis's arm holds the window with the others, but the * canvas's rows' — the `rows` source and each resource kind's — which the * dates on screen never narrow. * * @packageDocumentation */ import { type ValueTypeOf } from "@elaraai/east"; import type { PlanPayloadType } from "@elaraai/e3-ui/internal"; import type { RecordSliceBindType, RecordSlicesChromeType } from "@elaraai/east-ui/internal"; import type { PlanAxisKind } from "../instant.js"; import type { PlanRootValue } from "../model.js"; /** One record Slice's controls: a source's part of the slice. */ export type PlanSourcePart = ValueTypeOf; /** The rail's chrome, as the canvas's root carries it. */ export type PlanSlicesChrome = ValueTypeOf; /** One event kind, as the Plan's payload carries it. */ type PlanEventKindValue = ValueTypeOf["events"][number]; /** An event kind narrowed through its source of the slice: the kind, and its part. */ export interface PlanEventPart { /** The event kind. */ readonly kind: PlanEventKindValue; /** Its source's part of the slice: the Slice its reads, its counts and its Save notice go through. */ readonly part: PlanSourcePart; } /** The source of a Plan's slice that gives the canvas its rows. */ export declare const ROWS_SOURCE = "rows"; /** * The rail's chrome, when the Plan has a slice. * * @param value - The canvas's root * @returns Its chrome; `undefined` with no slice */ export declare function planSlices(value: PlanRootValue): PlanSlicesChrome | undefined; /** * One source's part of the slice, by its name. * * @param chrome - The rail's chrome; `undefined` with no slice * @param source - The source's name (`rows`, an event kind's slot) * @returns Its part; `undefined` when the slice has no source of that name */ export declare function planPart(chrome: PlanSlicesChrome | undefined, source: string): PlanSourcePart | undefined; /** * The event kinds narrowed through their sources: each kind the slice names a * source after, in the kinds' order. * * @param chrome - The rail's chrome; `undefined` with no slice * @param kinds - The Plan's event kinds * @returns Each such kind and its part */ export declare function planEventParts(chrome: PlanSlicesChrome | undefined, kinds: readonly PlanEventKindValue[]): PlanEventPart[]; /** The sources whose ranges never hold the window while a canvas names no others: its `rows` source. */ export declare const PLAN_ROW_SOURCES: readonly string[]; /** * The sources whose ranges never hold the window (#1344): the canvas's rows — * the `rows` source's, and each resource kind's — which the dates on screen * never narrow, so a pan, a step, the brush or a key reads no row again. A * date field there is a field of the rail the viewer sets. * * @param resources - The Plan's resource kinds * @returns Their sources' names, the `rows` source's first */ export declare function planRowSources(resources: readonly PlanResourceKindValue[]): readonly string[]; /** * The sources holding the window: each part whose range field speaks the * axis's arm, in the slice's order — the first leads — but the canvas's * rows', whose ranges never hold it. * * @param chrome - The rail's chrome; `undefined` with no slice * @param axis - The axis kind * @param rows - The sources whose ranges never hold the window ({@link planRowSources}); the `rows` source alone when omitted * @returns Each such source's name and part */ export declare function planWindowParts(chrome: PlanSlicesChrome | undefined, axis: PlanAxisKind, rows?: readonly string[]): { readonly source: string; readonly part: PlanSourcePart; }[]; /** One resource kind, as the Plan's payload carries it. */ type PlanResourceKindValue = ValueTypeOf["resources"][number]; /** One of the library's tabs, as the Plan's payload carries it. */ type PlanLibraryTabValue = ValueTypeOf["library"][number]; /** * The sources the Plan's frame follows itself, beside the `rows` source and * the event kinds', which the canvas reads through their parts: each resource * kind's the slice holds, whose shown keys narrow its rows and its Choosers — * but a paged kind's, whose windows are its narrowing's rows themselves * (#1344), so the frame reads none of its keys; each templates list's, whose * keys narrow the Events tab; and each an author's tab names — each once, in * that order. * * @param value - The Plan's payload * @returns The sources' names */ export declare function planFollowedSources(value: ValueTypeOf): string[]; /** * What the rail counts each source in, and heads it with folded, where the * source has no label of its own: the canvas's rows, an event kind's events * (`print job events`), a kind's templates, a resource kind's name, a tab's — * each as running text writes it, the first that names a source keeping it. * * @param kinds - The Plan's event kinds * @param resources - Its resource kinds * @param tabs - Its library's tabs * @param locale - The app's locale * @returns Each source's noun, by its name */ export declare function planNouns(kinds: readonly PlanEventKindValue[], resources: readonly PlanResourceKindValue[], tabs: readonly PlanLibraryTabValue[], locale: string): Record; export {}; //# sourceMappingURL=sources.d.ts.map