/** * Copyright (c) 2025 Elara AI Pty Ltd * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details. */ /** * The library's Backlog (#1389, `Schematic Builder Spec.md` §8, SC4) — pure: * every item kind's rows with no position, each kind's in the Schematic's * order of its kinds, the read's rows with the editing session's drafts in * place, as the canvas draws its rows (`drafted.ts`): * * - **a stored row with no position** is listed, unless a draft holds it — * the draft decides; * - **a drafted row with no position** is listed: one a gesture unplaced, or * one it created unplaced; * - **a drafted row placed, or deleted**, is not; * - **a drafted row the read does not hold** — a source's narrowing hides it — * waits in its session, listed once a read holds it again; a new one is * listed always. * * A kind read whole, or complete through its source, holds its every row with * no position its read holds: those are what the Backlog lists. A kind read by * area (#1393) pages them through its area index instead (`backlog-pages.ts`), * and holds only its window: its drafted rows with no position are listed * here wherever the window is, each told by the row its session began from, as * the Calendar's paged Backlog tells its drafted events — one whose stored row * had a position, which no page lists, while its narrowing holds that row * (`drafts-narrowing.ts`); one whose stored row had none is its page's, its * draft in place. * * @packageDocumentation */ import { type ItemRoles, type SchematicRef } from "./canvas/drawn.js"; import type { SchematicHeldRows, SchematicUnplacedRows } from "./data.js"; import type { SortDrafts } from "./drafted.js"; /** One row the Backlog lists: its kind's slot and its key, its id on the canvas, and its roles. */ export interface BacklogEntry { /** Its kind's slot and its key. */ readonly ref: SchematicRef; /** Its reference, printed: its id on the canvas, and its card's key. */ readonly id: string; /** Its roles, as its kind reads them: its card's label, icon, second line and status. */ readonly roles: ItemRoles; } /** An item kind, as the Backlog reads it: its slot, and whether its rows may have no position. */ export interface BacklogKind { /** Its slot. */ readonly key: string; /** Whether its `x` and `y` are Options: its rows with no position are its backlog. */ readonly backlog: boolean; } /** The item kinds read by area (#1393), as the Backlog lists their drafted rows: by the row each one's session began from. */ export interface BacklogArea { /** The kinds read by area, by slot. */ readonly kinds: ReadonlySet; /** * Whether a kind read by area's narrowing holds a drafted row, by the row its session began from: `false` leaves it * out; `undefined` for one not asked — nothing narrows the kind, or the answer is in flight — which is listed. */ readonly held: (ref: SchematicRef) => boolean | undefined; } /** * The rows the Backlog lists (see the module docs). * * @param kinds - The item kinds, in the Schematic's order * @param unplaced - Each item kind's rows the read holds with no position * @param held - Each kind's rows the read holds * @param drafts - The item kinds' drafts * @param area - The kinds read by area, and whether their narrowing holds a drafted row; none by default * @returns The rows, each kind's in its read's order, then its drafted ones in theirs */ export declare function backlogEntries(kinds: readonly BacklogKind[], unplaced: SchematicUnplacedRows, held: SchematicHeldRows, drafts: SortDrafts, area?: BacklogArea): BacklogEntry[]; //# sourceMappingURL=backlog.d.ts.map