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

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

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

```ts
import type { DataGridPersistence } 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 DataGridPersistence {
    readonly key: string;
    readonly initialState: DataGridState;
    load(): Promise<RestoreResult | null>;
    save(): Promise<void>;
    reset(): Promise<RestoreResult>;
    restore(state: DataGridState): RestoreResult;
    clear(): Promise<void>;
    dispose(): void;
}
```

Members (8):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `key` | `readonly key: string;` |  |  |
| `initialState` | `readonly initialState: DataGridState;` |  | State captured when the binding was created (what `reset()` restores). |
| `load` | `load(): Promise<RestoreResult \| null>;` |  | Loads and restores the stored state; null when nothing is stored or it is invalid. |
| `save` | `save(): Promise<void>;` |  | Saves now (skipped when unchanged since the last save or load). |
| `reset` | `reset(): Promise<RestoreResult>;` |  | Restores `initialState` and removes the stored entry. |
| `restore` | `restore(state: DataGridState): RestoreResult;` |  | Restores a state now without saving it (the stored entry is unchanged until the next tracked change). |
| `clear` | `clear(): Promise<void>;` |  | Removes the stored entry. |
| `dispose` | `dispose(): void;` |  |  |
