/** * Copyright (c) 2025 Elara AI Pty Ltd * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details. */ /** * The Backlog of the item kinds read by area (#1393, `Schematic Builder * Spec.md` §8, D51): every item kind's rows with no position as one paged * list, which the library's Backlog tab draws with the shared `PagedLibrary`. * * - **The rows in hand come first**: those of the kinds read whole or complete, * and the drafted rows with no position — a row a gesture unplaced, or one it * created (`backlog.ts`). * - **Then each kind read by area's**, a page at a time through its source's * area index's unplaced clause (`schematicUnplacedPlan`, §11.4): the * narrowing's choices that index leads taken in the read, the rest asked of * each page's rows in one `within` (D28). A row they leave out draws as * context — faded, and never dragged — as does a stored row a draft has * placed or deleted, drawn as drafted; a row a draft only edits draws as * drafted, in place. * - **Its count** ({@link SchematicBacklogPages.count}): the rows it lists, and * — while a narrowing an area index leads narrows them — `N of M`, every row * with no position the kinds hold. * - **What a card drops** ({@link SchematicBacklogPages.card}): each row it has * listed and not as context, placed where it lands — its row, as its page * read it at its revision, the original a gesture rewrites (the frame's * `KindRows`, which the lists share), so a drop records at once. * * Nothing it reads is the record whole: the counts are two index counts a kind, * and each page one read of the index's entries, which carry their rows (D29). * * @packageDocumentation */ import { type ValueTypeOf, type option } from "@elaraai/east"; import { type RecordSliceBindType } from "@elaraai/east-ui/internal"; import { type SchematicAreaIndexes } from "@elaraai/e3-ui/internal"; import { type LibraryPageSource } from "@elaraai/east-ui-components/internal"; import type { BacklogEntry } from "./backlog.js"; import { type ItemRoles } from "./canvas/drawn.js"; import type { SchematicValue } from "./data.js"; import type { SortDrafts } from "./drafted.js"; import type { SchematicDropCard } from "./drop.js"; import { type KindRows } from "./kind-rows.js"; /** A kind's source of the slice. */ type Part = ValueTypeOf; /** An item kind, decoded. */ type ItemKind = SchematicValue["items"][number]; /** An item kind read by area that has a backlog: the kind, its source of the slice and its area indexes. */ export interface BacklogAreaKind { /** The kind: its `x` and `y` are Options. */ readonly kind: ItemKind; /** Its source of the slice. */ readonly part: Part; /** Its area indexes. */ readonly areas: SchematicAreaIndexes; } /** One row the paged Backlog lists: its entry, and whether it draws as context. */ export interface BacklogPageRow { /** Its kind's slot and key, its id and its roles — a drafted row's as drafted. */ readonly entry: BacklogEntry; /** Whether it draws as context, faded and never dragged: the narrowing leaves it out, or a draft placed or deleted it. */ readonly context: boolean; } /** What the paged Backlog counts: the rows it lists, every row with no position, and whether a narrowing narrows the list. */ export interface BacklogPageCount { /** The rows it lists. */ readonly shown: number; /** Every row with no position the kinds hold, the rows in hand among them. */ readonly total: number; /** Whether a narrowing an area index leads narrows what it lists. */ readonly narrowing: boolean; } /** * The paged Backlog's rows and counts — see the module docs. Every read is a * tracked read of the kinds' sources, so the list's reader runs again as a * page, a count or an answer lands, and as a narrowing or a revision moves. */ export declare class SchematicBacklogPages implements LibraryPageSource { readonly id: string; private readonly fresh; private readonly kinds; private readonly drafts; private readonly rows; /** Each kind's plan, for the narrowing it was made for. */ private readonly plans; /** What each row listed and not as context drops, by its id: kept for the narrowing it was listed under. */ private served; private servedFor; /** * @param id - The list's id: the Backlog's library, which its cards drag from * @param fresh - The rows in hand: the kinds read whole or complete, and the drafted rows with no position, each kind's in its order * @param kinds - The item kinds read by area that have a backlog, in the Schematic's order * @param drafts - The item kinds' drafts * @param rows - The kinds' rows as their `rowsOf` makes them, kept across lists: what a gesture on a row a page read rewrites */ constructor(id: string, fresh: readonly BacklogEntry[], kinds: readonly BacklogAreaKind[], drafts: SortDrafts, rows: KindRows); /** A kind's plan for its narrowing as it stands, made once a narrowing. */ private planOf; /** * The kinds' revisions, as one: `none` while any is not yet known. * * @returns The revisions */ revision(): option; /** * The narrowings the kinds' rows are read under, as one: the list starts its viewport again as it moves. * * @returns The narrowings, printed */ query(): string; /** Each kind's count of the rows it lists; `undefined` while any is read. */ private listed; /** * How many rows it lists: the rows in hand, and each kind's its narrowing's led choices hold. * * @returns The count; `none` while any is read */ total(): option; /** * What the Backlog tab counts (see {@link BacklogPageCount}). * * @returns The count; `undefined` while any count is read */ count(): BacklogPageCount | undefined; /** * The rows `[offset, offset + limit)` of the list: the rows in hand, then each kind's, a page read through its * area index's unplaced clause, its narrowing's other choices asked of the page's rows. * * @param offset - The first row * @param limit - How many rows * @returns The rows; `none` while a count, a page or an answer is read */ page(offset: bigint, limit: bigint): option; /** One kind's rows `[offset, offset + limit)`: a page of its unplaced clause, its drafts in place and its narrowing's other choices asked. */ private kindPage; /** * What a card of the list drops, by its id: a row it has listed, and not as context — placed where it lands. * * @param id - The card's id * @returns What it drops, or `undefined` for a row it lists in hand, as context, or not at all */ card(id: string): SchematicDropCard | undefined; } export {}; //# sourceMappingURL=backlog-pages.d.ts.map