@sheetwrite/corefunction
Mount a grid over a validated, non-dirty snapshot. The grid owns and disposes
the hydrated store just like one created through createGrid.
- Package
@sheetwrite/core- Source
packages/core/src/persistence.ts#L46
Declaration
function createGridFromSnapshot( host: HTMLElement, snapshot: unknown, options?: SnapshotGridOptionstype SnapshotGridOptions = Omit<
GridOptions,
"workbook" | "data"
> & { snapshotResourceLimits?: Partial<SnapshotResourceLimits> };type SnapshotGridOptions = Omit<
GridOptions,
"workbook" | "data"
> & { snapshotResourceLimits?: Partial<SnapshotResourceLimits> };type SnapshotGridOptions = Omit<
GridOptions,
"workbook" | "data"
> & {
snapshotResourceLimits?: Partial<SnapshotResourceLimits>;
};Grid creation options accepted when hydrating a validated snapshot.API reference →,): Gridinterface Grid {
readonly store: Store;
readonly actions: GridActions;
getRuntimeResourceSnapshot(
operation: RuntimeResourceOperation,
phase: RuntimeResourcePhase,
runtime?: RuntimeMemoryObservation,
): RuntimeResourceSnapshot;
getCommandState(command: GridCommandName): GridCommandState;
setActiveSheet(id: SheetId): void;
scrollToCell(addr: CellAddress): void;
getCellAtPoint(
clientX: number,
clientY: number,
): CellAddress | null;
// … 120 more lines — see the API reference
}interface Grid {
readonly store: Store;
readonly actions: GridActions;
getRuntimeResourceSnapshot(
operation: RuntimeResourceOperation,
phase: RuntimeResourcePhase,
runtime?: RuntimeMemoryObservation,
): RuntimeResourceSnapshot;
getCommandState(command: GridCommandName): GridCommandState;
setActiveSheet(id: SheetId): void;
scrollToCell(addr: CellAddress): void;
getCellAtPoint(
clientX: number,
clientY: number,
): CellAddress | null;
// … 120 more lines — see the API reference
}interface Grid {
readonly store: Store;
readonly actions: GridActions;
getRuntimeResourceSnapshot(
operation: RuntimeResourceOperation,
phase: RuntimeResourcePhase,
runtime?: RuntimeMemoryObservation,
): RuntimeResourceSnapshot;
getCommandState(
command: GridCommandName,
): GridCommandState;
setActiveSheet(
id: SheetId,
): void;
scrollToCell(
addr: CellAddress,
): void;
getCellAtPoint(
clientX: number,
// … 255 more lines — see the API reference
}Imperative grid handle for document commands, events, rendering, and teardown.API reference →