/** * Copyright (c) 2025 Elara AI Pty Ltd * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details. */ import { type BatchReadiness, type EditIssue } from "@elaraai/east-ui-components"; import { type SheetGeometry } from "./model.js"; import { type SheetPersisted } from "./persisted.js"; import { type OptimiseCounts, type OptimiseMissing, type OptimiseRefused, type OptimiseRowRead, type OptimiseWaiting } from "../shared/func/use-optimise.js"; import { type SheetOptimiseRequest, type SheetOptimiseResult, type SheetOptimised } from "./optimise.js"; import { type LocalLayer } from "./use-editing.js"; import { type DraftPresentation } from "./draft-state.js"; import type { EntryVersion } from "./transactions.js"; import type { SheetRowValue, SheetRootValue } from "./values.js"; import type { SheetHost, SheetRowChanges } from "./parts.js"; import type { SheetDecode } from "./use-decode.js"; /** * Holds the rows the sheet draws and the session that edits them (see the module docs). * * @param value - The Sheet root value * @param storageKey - Storage key prefix for persisting component state * @param host - What the frame hands the parts * @param sheetDecode - The decoded columns, layout, callbacks, narrowing and row source * @returns The store, the lens, the paging, the session, the drafts and the rows */ export declare function useSheetSession(value: SheetRootValue, storageKey: string, host: SheetHost, sheetDecode: SheetDecode): { readiness: BatchReadiness; rows: SheetRowValue[]; sourceRows: readonly SheetRowValue[]; storedBreaches: readonly EditIssue[]; barClosedAt: { id: string; key: string; } | undefined; canEdit: boolean; changesOf: (id: string, row: SheetRowValue) => SheetRowChanges | undefined; childField: string | undefined; dispatchStore: import("react").ActionDispatch<[a: import("./sheet-state.js").SheetAction]>; draftOf: (id: string, child?: string) => DraftPresentation; draftType: import("@elaraai/east").EastType; draftVersion: number; drafts: Map>; editingState: import("./use-editing.js").SheetEditingResult; exhausted: boolean; foldedOf: (row: SheetRowValue) => boolean; folds: ReadonlyMap; geometry: SheetGeometry; gestureCount: import("react").RefObject; keyHeld: boolean; landRef: import("react").RefObject<(result: SheetOptimiseResult, request: SheetOptimiseRequest, run: number, read: OptimiseRowRead) => OptimiseCounts | OptimiseRefused | OptimiseMissing | OptimiseWaiting | undefined>; landing: import("@elaraai/east-ui-components").Landing; landingRoot: import("react").RefObject; landingStyles: import("@elaraai/east-ui-components").LandingStyles; layer: LocalLayer; layerRef: import("react").RefObject; lens: import("./use-lens.js").RecordLens; lensDrawn: boolean; locked: boolean; mintAmong: (taken: Set) => string; mintLineId: () => string; optimiseTypes: import("./optimise.js").SheetOptimiseTypes; optimiseWhole: boolean; optimised: SheetOptimised | undefined; pagesReady: boolean; pagesStandIn: boolean; paging: import("./paging.js").SheetPaging; persist: (next: SheetPersisted) => void; persistedRef: import("react").RefObject; recordGesture: (events: readonly import("./values.js").SheetEditValue[], placements?: ReadonlyMap, originOverride?: import("@elaraai/east-ui-components").Origin, draftEdits?: ReadonlyMap, seeds?: import("./use-editing.js").SheetSeeds, label?: string, joins?: string, held?: ReadonlyMap) => boolean; restored: SheetPersisted; rowsOffset: number; rowsQuery: string; run: import("../shared/func/use-optimise.js").OptimiseRun; runLayout: { positions: number[]; failures: import("./model.js").PlacedFailure[]; segments: import("./model.js").RowSegment[]; }; session: import("./transactions.js").SheetTransactions; setBarClosedAt: import("react").Dispatch>; setLayer: (fn: (prev: LocalLayer) => LocalLayer) => void; setOptimised: import("react").Dispatch>; standingIn: boolean; store: import("./sheet-state.js").SheetStore; subRowsOpenOf: (lineKey: string) => boolean | undefined; takenKeys: () => Set; total: number | undefined; totalRevision: string | undefined; ui: import("./sheet-types.js").SheetUiState; }; /** What {@link useSheetSession} gives the parts after it. */ export type SheetSession = ReturnType; //# sourceMappingURL=use-session.d.ts.map