/** * Copyright (c) 2025 Elara AI Pty Ltd * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details. * * What a sheet persists under its `storageKey` (#857) — what the viewer * arranged: the folds, and where a bounded frame's scroll rests. Never the * ring, nor the narrowing (the slice owns it). The Plan's rule (#813). * * @packageDocumentation */ /** Where a bounded sheet's scroll rests (#857) — an item, never pixels. */ export interface SheetAnchor { /** The first body item showing under the header — its key among the virtual rows (`row:…`, `group:…`, `sub:…`). */ key: string; /** How many px of it are scrolled past. */ offset: number; /** Its body index — the clamped fallback when the key is gone. */ index: number; /** On a paged sheet, the source element the item belongs to (a row; a line's or a sub row's group) — over an unloaded band, the element the band draws there — where a remount that has not loaded it yet looks for it. */ element: number | null; } /** What a sheet persists under its `storageKey` (#857). */ export interface SheetPersisted { /** The tab the folds were left on (`null` = the whole sheet): they come back only when the sheet opens there. */ view: string | null; /** The fold overrides there — a group's or a line's id → folded (a line's `false`: its sub rows open). */ folds: Array<[string, boolean]>; /** Where a bounded frame's scroll rests, once the viewer has scrolled it. */ anchor: SheetAnchor | null; } /** Nothing persisted yet. */ export declare const NOT_PERSISTED: SheetPersisted; /** * The persisted state, read defensively: storage outlives versions and anyone * can write it, so each part is taken only in the shape this version writes * and dropped otherwise — never trusted into the reducer. * * @param stored - Whatever the storage holds under the sheet's key * @returns The parts this version can use */ export declare function persistedOf(stored: unknown): SheetPersisted; /** * Whether the persisted folds are these — the same tab, the same overrides in * the same order. No folds are no folds on any tab, so a sheet no one has * folded never records the tab it opens on. * * @param p - What storage holds * @param view - The tab the folds are on * @param folds - The fold overrides * @returns Whether writing them would change nothing */ export declare function sameFolds(p: SheetPersisted, view: string | null, folds: ReadonlyMap): boolean; /** Two anchors are the same — `x` may be absent. */ export declare function sameAnchor(x: SheetAnchor | null, y: SheetAnchor): boolean; //# sourceMappingURL=persisted.d.ts.map