# SavedViewsOptions (@salmonui/data/views)

> The SavedViewsOptions interface of @salmonui/data/views.

Canonical: https://salmonui.dev/docs/reference/data/views/SavedViewsOptions

```ts
import type { SavedViewsOptions } from '@salmonui/data/views';
```

Also exported from `@salmonui/data`.

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

## Reference

Kind: interface

```ts
interface SavedViewsOptions<State extends DataGridState = DataGridState> {
    readonly gridId: string;
    readonly prefix?: string;
    readonly now?: () => number;
    readonly createId?: () => string;
    readonly migrate?: (record: Readonly<Record<string, unknown>>, schemaVersion: number) => SavedView<State> | null;
}
```

Members (5):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `gridId` | `readonly gridId: string;` |  | The grid whose views these are (`DataGrid` `id`). |
| `prefix` | `readonly prefix?: string;` | optional | Storage key prefix. Default `salmonui:grid-views:`. |
| `now` | `readonly now?: () => number;` | optional | Clock in epoch milliseconds. Default `Date.now`. |
| `createId` | `readonly createId?: () => string;` | optional | Id for a new view. Default `crypto.randomUUID()` when available, else a time-based counter. |
| `migrate` | `readonly migrate?: (record: Readonly<Record<string, unknown>>, schemaVersion: number) => SavedView<State> \| null;` | optional | Upgrades a stored record of an older (or unknown) record schema, or whose grid state needs upgrading; return null to drop it. Records of the current schema are passed through unchanged without calling it. |
