/** * Copyright (c) 2025 Elara AI Pty Ltd * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details. */ import { type SheetMachineCtx, type SheetUiState, type Transition } from "./sheet-types.js"; import type { SheetSavedView } from "./values.js"; /** * The views with the active tab's folds persisted; an unsaved narrowing is * discarded on leave (B§8). The same array comes back when nothing changed. * * @param s - The state * @param views - The views * @returns The views, the active one's folds as they stand */ export declare function persistFolds(s: SheetUiState, views: readonly SheetSavedView[]): readonly SheetSavedView[]; /** * The narrowing changed underneath: the range and the proposal pick drop, and the ring returns to the top — a ring not * placed yet stays unplaced, and reports nothing (#1531). */ export declare function narrowed(s: SheetUiState, ctx: SheetMachineCtx): Transition; /** * Pick a tab (`null` = the whole sheet): the leaving tab keeps its folds, the * target's narrowing goes into the slice, its folds come back, and the ring * returns to the top. * * @param s - The state * @param ctx - The context (its `views`, `emptyNarrowing`) * @param id - The view to open, or `null` * @param persist - Whether the leaving tab's folds are written back (the initial open passes `false`) * @returns The transition */ export declare function switchTab(s: SheetUiState, ctx: SheetMachineCtx, id: string | null, persist?: boolean): Transition; /** `+ TAB` — the current narrowing and folds become a view, named from the query. */ export declare function createTab(s: SheetUiState, ctx: SheetMachineCtx): Transition; /** × or a middle click — closing the active tab falls back to the whole sheet. */ export declare function closeTab(s: SheetUiState, ctx: SheetMachineCtx, id: string): Transition; /** ⏎ with a dirty tab: the tab now saves the current narrowing (and the folds as they stand). */ export declare function updateTab(s: SheetUiState, ctx: SheetMachineCtx): Transition; /** esc with a dirty tab: the slice returns to the tab's saved narrowing, the folds to its saved ones. */ export declare function revertTab(s: SheetUiState, ctx: SheetMachineCtx): Transition; /** A double click on a tab opens its name for editing. */ export declare function renameStart(s: SheetUiState, ctx: SheetMachineCtx, id: string): SheetUiState; /** The rename buffer. */ export declare function renameChange(s: SheetUiState, val: string): SheetUiState; /** ⏎ or a blur commits the rename — an empty name keeps the old one. */ export declare function renameCommit(s: SheetUiState, ctx: SheetMachineCtx): Transition; /** esc drops the rename. */ export declare function renameCancel(s: SheetUiState): SheetUiState; /** A tab dropped before the tab at `to`. */ export declare function reorderTab(s: SheetUiState, ctx: SheetMachineCtx, id: string, to: number): Transition; /** The tab rungs of the esc ladder: a dirty tab reverts, a clean tab returns to the sheet; `null` = no tab to act on. */ export declare function escTabs(s: SheetUiState, ctx: SheetMachineCtx): Transition | null; /** * A key in the rail's search box (B§8): ⏎ updates a dirty tab; esc reverts a * dirty tab, returns a clean tab to the sheet, or clears the search on the * whole sheet. Both hand the focus back to the sheet. `null` = not claimed. */ export declare function searchKey(s: SheetUiState, ctx: SheetMachineCtx, key: string): Transition | null; //# sourceMappingURL=sheet-tabs-state.d.ts.map