/** * Copyright (c) 2025 Elara AI Pty Ltd * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details. */ /** * What the state machine may ask of the sheet as it stands (`SheetMachineCtx`), its dispatch, and what it hears of the * sheet moving under it: the rows changing, the narrowing changing, the view the sheet opens on, and the folds it keeps. * * @packageDocumentation */ import { type RefObject } from "react"; import type { RowsViewport } from "@elaraai/east-ui-components/internal"; import type { SheetEvent, SheetMachineCtx } from "./sheet-state.js"; import type { SheetNarrowing, SheetRootValue, SheetRowValue } from "./values.js"; import type { SheetDecode } from "./use-decode.js"; import type { SheetSession } from "./use-session.js"; import type { SheetBody } from "./use-body.js"; import { type RowSlot } from "./items.js"; /** * Builds the machine's view of the sheet and follows the sheet as it moves (see the module docs). * * @param value - The Sheet root value * @param sheetDecode - The decoded columns, layout, callbacks, narrowing and row source * @param sheetSession - The store, the lens, the paging, the session and the rows * @param sheetBody - The body, the row space and the cells at each place * @returns The machine's context, its dispatch and the refs it is read through */ export declare function useSheetMachine(value: SheetRootValue, sheetDecode: SheetDecode, sheetSession: SheetSession, sheetBody: SheetBody): { emptyNarrowing: SheetNarrowing | undefined; expectedNarrowing: RefObject; seenRows: RefObject<{ source: readonly SheetRowValue[]; slots: (RowSlot | undefined)[]; }>; clearJump: () => void; ctx: SheetMachineCtx; ctxRef: RefObject; dirty: boolean; dispatch: (e: SheetEvent) => void; jumpTo: (element: number, hold?: boolean) => void; jumpToElement: (element: number, hold?: boolean) => void; keyIsText: boolean; lensJumpTo: (position: number) => void; rowSpaceSlots: (RowSlot | undefined)[]; uiRef: RefObject; viewportRef: RefObject; }; /** What {@link useSheetMachine} gives the parts after it. */ export type SheetMachine = ReturnType; //# sourceMappingURL=use-machine.d.ts.map