/** * Copyright (c) 2025 Elara AI Pty Ltd * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details. */ /** * The Calendar's Backlog a page at a time (#1424), as the Schematic's Backlog * pages its unplaced rows (D51): every backlog kind's events with no start as * one paged list, which the library's Backlog tab draws with the shared * `PagedLibrary`. Nothing it reads is a record whole, nor every unscheduled * event of a kind's narrowing. * * - **The events in hand come first**: those of the kinds whose backlog is read * apart — read whole, or through their backlog index — and, of a kind paged * here, the drafted events with no start that no page lists: one a gesture * returned to the backlog, or one it created there — each told by the row * its editing session began from, so a gesture reads nothing for the list. * - **Then each kind narrowed through its source of the slice**, a page at a * time through the source with its start Unset — its choices but its window, * which a backlog event has none of. Each page's entries carry their rows, so * each event is its kind's projection of its own row, its drafts in place * (the kind's `event` seam, with the row held): one a draft scheduled or * deleted draws as context, faded and never dragged; one a draft only edits, * as drafted, in place. * - **Its count** ({@link CalendarBacklogPages.count}): the events it lists, * each paged kind's an index count — and while a kind's source narrows it, * `N of M`, every unscheduled event its record holds counted beside them, or * on a scoped page every one its scope holds, which is no choice (#1621). The * list counts nothing ({@link CalendarBacklogPages.total}) until every count * is read, so the list and the tab's count swap together. * - **What a card is** ({@link CalendarBacklogPages.served}): each event it has * listed, and not as context, by its card's id — what a drag of it, or its * Schedule, finds it by — and a page's event's row at the revision the page * read it at ({@link CalendarBacklogPages.servedRow}): the original a gesture * placing it rewrites, read by no other request, as the Schematic's are. The * rows its pages listed are kept by the frame ({@link BacklogServed}), across * the lists it makes as the drafts move, and a card is its kind's projection * of its row with the drafts as they stand: a draft of another event — a list * made again before its pages are read — leaves the chosen card what it is, * its Schedule with it. * * The drafts it is given are the shared schedule reader's (`cells.ts`): those * of events a kind's narrowing does not hold left out, so a draft never brings * an event of another narrowing into the list. It has no search of its own, as * the Schematic's paged Backlog has none: the rail's choices narrow it (ruled * 27 Oct 2026). * * Every read is a tracked read of the kinds' sources, so the list's reader runs * again as a page, a count or a row read by its key lands, and as a narrowing * or a revision moves; no step of the dates moves any of it. * * @packageDocumentation */ import { type option } from "@elaraai/east"; import { type LibraryPageSource } from "@elaraai/east-ui-components/internal"; import { type ScheduleEventDraftsValue } from "../shared/schedule/editing.js"; import { type CalendarItem } from "./model.js"; import type { CalendarEventPart } from "./window.js"; /** One event the paged Backlog lists: the event, and whether it draws as context. */ export interface BacklogPageEvent { /** The event, its drafts in place — or, as context, as its record holds it. */ readonly item: CalendarItem; /** Whether it draws as context, faded and never dragged: a draft scheduled or deleted it. */ readonly context: boolean; /** Its row as the record holds it, and the revision its page read it at; `undefined` for an event in hand. */ readonly stored?: { readonly revision: string; readonly row: Uint8Array; } | undefined; } /** What the paged Backlog counts: the events it lists, every unscheduled event, and whether a source's choices narrow the list. */ export interface BacklogPageCount { /** The events it lists. */ readonly shown: number; /** Every unscheduled event the kinds hold, the events in hand among them. */ readonly total: number; /** Whether a source's choices narrow what it lists. */ readonly narrowing: boolean; } /** A page's event the paged Backlog listed, not as context: its kind's slot, its key's text, and its row as its page read it. */ interface ServedRow { readonly kind: string; readonly key: string; /** Its row as the record held it, and the revision its page read it at. */ readonly row: { readonly revision: string; readonly row: Uint8Array; }; } /** * What the paged Backlog's pages have listed (#1424): each event a page listed, and not as context, by its card's id — * its row as its page read it — kept for the narrowing it was listed under. The frame keeps one while it is mounted and * gives it to every list it makes as the drafts move, so what a card is never waits on the new list's pages being read. */ export declare class BacklogServed { private rows; private listing; /** * Starts afresh for another listing: the narrowings the kinds' backlogs are read under. * * @param listing - The listing, as {@link CalendarBacklogPages.query} prints it */ under(listing: string): void; /** * Keeps a page's event, the most recent last: past the most it keeps — far more than the pages around a view hold — * the oldest go. * * @param id - Its card's id: the event's key, as `eventKey` prints it * @param row - Its kind, its key and its row as its page read it */ keep(id: string, row: ServedRow): void; /** * A page's event, by its card's id. * * @param id - Its card's id * @returns Its kind, its key and its row; `undefined` for one no page of this listing has listed, or listed as context */ get(id: string): ServedRow | undefined; } /** * The Calendar's paged Backlog — see the module docs. */ export declare class CalendarBacklogPages implements LibraryPageSource { readonly id: string; private readonly apart; private readonly kinds; private readonly drafts; private readonly original; private readonly servedRows; /** * @param id - The list's id: the Backlog's library, which its cards drag from * @param apart - The events of the kinds whose backlog is read apart, in the kinds' order: in hand * @param kinds - The backlog kinds narrowed through their sources, paged here, in the Calendar's order * @param drafts - Every kind's drafts as the shared reader gives them: those of events a kind's narrowing does not hold left out * @param original - A drafted event's row as its kind's record held it when its session first read it, decoded — the * editing's `held`; `undefined` for an event a gesture made, which no stored row names * @param servedRows - What the pages have listed, the frame's, kept across the lists it makes ({@link BacklogServed}) */ constructor(id: string, apart: readonly CalendarItem[], kinds: readonly CalendarEventPart[], drafts: ScheduleEventDraftsValue, original: (kind: string, id: string) => unknown, servedRows: BacklogServed); /** A kind's drafts. */ private draftsOf; /** * The kinds' revisions, as one: `none` while any is not yet known. * * @returns The revisions */ revision(): option; /** * The narrowings the kinds' backlogs are read under, as one: the list starts its viewport again as one moves. * * @returns The narrowings, printed */ query(): string; /** * The events in hand: the kinds' read apart, then each paged kind's drafted events with no start that its pages do * not list — returned to the backlog, or made there — each told by the row its session began from, so no gesture * reads anything for it. * * @returns The events */ private inHand; /** Each paged kind's count of the events it lists; `undefined` while any is read. */ private listed; /** * How many events it lists — the events in hand, and each paged kind's its source's choices hold — once every count * the tab says is read ({@link CalendarBacklogPages.count}): the list and the tab's count swap together. * * @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 events `[offset, offset + limit)` of the list: the events in hand, then each paged kind's, a page read through * its source with its start Unset, each event its kind's projection of its row with its drafts in place. * * @param offset - The first event * @param limit - How many events * @returns The events; `none` while a count or a page is read */ page(offset: bigint, limit: bigint): option; /** * One kind's events `[offset, offset + limit)`: a page of its backlog, each its projection of its row, its drafts in * place. */ private kindPage; /** * An event the list has served, by its card's id: what a drag of its card, or its Schedule, finds it by — a page's * event as its kind projects the row its page read with the drafts as they stand, whichever list listed it, and an * event in hand as it stands. * * @param id - The card's id: the event's key, as `eventKey` prints it * @returns The event; `undefined` for one it has not listed, or one a draft has scheduled or deleted since: context */ served(id: string): CalendarItem | undefined; /** * The row of an event a page listed, as the record held it at the revision the page read it at (#1424): the * original a gesture placing it rewrites, as the Schematic's Backlog gives its rows (#1393). * * @param kind - The event's kind's slot * @param id - The event's key's text * @returns Its row and that revision; `undefined` for an event no page listed, or one in hand */ servedRow(kind: string, id: string): { readonly revision: string; readonly row: Uint8Array; } | undefined; } export {}; //# sourceMappingURL=backlog-pages.d.ts.map