# DataGridPersistenceOptions (@salmonui/data-grid/engine)

> The DataGridPersistenceOptions interface of @salmonui/data-grid/engine.

Canonical: https://salmonui.dev/docs/reference/data-grid/engine/DataGridPersistenceOptions

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

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

Entry index: https://salmonui.dev/docs/reference/data-grid/engine (Markdown with every symbol of the entry: https://salmonui.dev/docs/reference/data-grid/engine.md).

## Reference

Kind: interface

```ts
interface DataGridPersistenceOptions extends DataGridStateOptions, DeserializeDataGridStateOptions {
    readonly storage: DataGridStateStorageAdapter;
    readonly key?: string;
    readonly schedule?: (flush: () => void) => void;
    readonly onError?: (error: unknown) => void;
}
```

Members (6):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `storage` | `readonly storage: DataGridStateStorageAdapter;` |  |  |
| `key` | `readonly key?: string;` | optional | Storage key. Default `engine.id`. |
| `schedule` | `readonly schedule?: (flush: () => void) => void;` | optional | Schedules a coalesced save. Default: one microtask. |
| `onError` | `readonly onError?: (error: unknown) => void;` | optional | Load and save failures (storage errors, invalid stored state). |
| `exclude` | `exclude?: readonly DataGridStatePart[];` | optional, inherited | Parts left out of reads and restores. |
| `migrate` | `migrate?: ((state: Record<string, unknown>, version: number) => DataGridState \| null);` | optional, inherited | Upgrades a state of another version; return null to reject it. |
