View as Markdown

API reference: @salmonui/data-grid/engine

DataGridPersistenceOptionsinterface

import type { DataGridPersistenceOptions } from '@salmonui/data-grid/engine';

Also exported from @salmonui/data-grid/engine/persistence.

interface DataGridPersistenceOptions extends DataGridStateOptions, DeserializeDataGridStateOptions {
    readonly storage: DataGridStateStorageAdapter;
    readonly key?: string;
    readonly schedule?: (flush: () => void) => void;
    readonly onError?: (error: unknown) => void;
}
DataGridPersistenceOptions members (6, 2 inherited)
NameSignatureDescription
storagereadonly storage: DataGridStateStorageAdapter;
keyoptionalreadonly key?: string;

Storage key. Default engine.id.

scheduleoptionalreadonly schedule?: (flush: () => void) => void;

Schedules a coalesced save. Default: one microtask.

onErroroptionalreadonly onError?: (error: unknown) => void;

Load and save failures (storage errors, invalid stored state).

excludeoptionalinheritedexclude?: readonly DataGridStatePart[];

Parts left out of reads and restores.

migrateoptionalinheritedmigrate?: ((state: Record<string, unknown>, version: number) => DataGridState | null);

Upgrades a state of another version; return null to reject it.