/** * Copyright (c) 2025 Elara AI Pty Ltd * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details. */ /** * The saved views' narrowing (#1345): every source's narrowing of the sheet's * one `Slice.bindRecords`, by the source's name — read off the rail, written * back to it as a view opens, compared, cleared and described through East's * own types. * * @packageDocumentation */ import { type ValueTypeOf } from "@elaraai/east"; import { type RecordSlicesChromeType } from "@elaraai/east-ui/internal"; import type { SheetNarrowing, SheetSavedView } from "./values.js"; /** The rail's chrome, as the root carries it. */ type Chrome = ValueTypeOf; /** * The rail's narrowing now: each source's state, by its name. * * @param chrome - The sheet's rail * @returns Every source's narrowing */ export declare function narrowingOf(chrome: Chrome): SheetNarrowing; /** * Writes a narrowing back to the rail, source by source: a source the * narrowing does not hold opens with nothing chosen, as a preset clears a * source it does not name. * * @param chrome - The sheet's rail * @param narrowing - The narrowing to write — a view's, or the whole sheet's */ export declare function writeNarrowing(chrome: Chrome, narrowing: SheetNarrowing): void; /** Whether two narrowings hold the same choices, through East's equality, by source. */ export declare function narrowingEqual(a: SheetNarrowing, b: SheetNarrowing): boolean; /** Value equality keeps optimistic tab changes when the host decodes a fresh payload. */ export declare function sheetViewsEqual(a: readonly SheetSavedView[], b: readonly SheetSavedView[]): boolean; /** The All tab clears every source's choices but keeps their presentation. */ export declare function clearNarrowing(state: SheetNarrowing): SheetNarrowing; /** Search text for a new tab's default name: each source's prefix searches. Exact typed choices are not search text. */ export declare function narrowingQuery(state: SheetNarrowing): string; /** Escape clears every search, each source keeping its other choices and its presentation. */ export declare function clearSearch(state: SheetNarrowing): SheetNarrowing; /** A view's scope as the existing tab description names it. */ export declare function narrowingScope(state: SheetNarrowing): "query" | "range" | "filter" | "none"; /** * Writes the saved views back to the host's bind handle. * * @param views - The views, as the sheet holds them now * @param write - The views' write-back, if the host keeps them */ export declare function writeSheetViews(views: readonly SheetSavedView[], write: ((views: SheetSavedView[]) => unknown) | undefined): void; export {}; //# sourceMappingURL=view-state.d.ts.map