/** * The canvas list as the structure it already has. * * A canvas is named by where it sits — the catalog, then the section, then the * lane — and that name was the only place the structure appeared. Twenty-seven * screen canvases then read as twenty-seven strings that happen to share * prefixes, and a reader looking for one lane scans the same words four times * before reaching the part that differs. * * The grouping is taken from the frames rather than from the names: a frame * knows its section and its lane, so nothing here parses a label to find out * what belongs to what. */ export interface CanvasTreeLeaf { /** Canvas to switch to. */ canvas: string; /** What distinguishes this canvas inside its section — the lane. */ label: string; /** Frames the canvas draws right now. */ frames: number; /** * Frames the lane holds, including the ones a screen-state control is * currently hiding. Counting only the declaration made the list disagree * with the canvas beside it — five on the row, three on screen — and * counting only what is drawn would hide that the lane has more to show. */ declared: number; /** * Inventory items represented by a catalog canvas. Catalog pages are sheets, * so their page count is usually not the number a reader is looking for. */ items?: number; /** True only when the canvas was produced from a non-screen import collection. */ catalog?: true; } export interface CanvasTreeGroup { section: string; canvases: readonly CanvasTreeLeaf[]; frames: number; declared: number; /** * True when the section is one canvas, so the group has nothing to open: a * disclosure over a single child asks for a click that reveals what the row * already said. */ single: boolean; } export interface CanvasTree { /** Canvases outside any section — the catalogs, listed as they are. */ loose: readonly CanvasTreeLeaf[]; groups: readonly CanvasTreeGroup[]; } /** * Pages available in the current runtime, including state variants held behind * a screen-state control. The Pages badge names frames, not the smaller number * of canvases used to arrange them. */ export declare function countCanvasTreePages(tree: CanvasTree): number; interface CanvasTreePage { canvas?: string; section?: string; importKind?: string; assetIds?: readonly string[]; } /** Whether a frame is one the canvas draws in its current state. */ export type CanvasTreeVisibility = (page: never) => boolean; /** * Groups canvases by the section their frames belong to, keeping the order the * canvas list already resolved — that order carries the host's declared * section ranking, which a regrouping here would quietly discard. */ export declare function buildCanvasTree(pages: readonly TPage[], canvasNames: readonly string[], isShown?: (page: TPage) => boolean, exists?: (page: TPage) => boolean): CanvasTree; export {};