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

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

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

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

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

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 EditState {
    readonly options: ResolvedEditOptions;
    readonly version: number;
    readonly newRowId: RowId | null;
    readonly active: EditTarget | null;
    readonly status: EditStatus;
    readonly dirtyCellCount: number;
    readonly addedRowIds: readonly RowId[];
    readonly deletedRowIds: readonly RowId[];
    readonly pendingWrites: number;
    readonly lastError: string | null;
    readonly lastBulk: {
        readonly requested: number;
        readonly applied: number;
    } | null;
    readonly canUndo: boolean;
    readonly addedTreePlacements?: Readonly<Record<RowId, AddedTreePlacement>>;
    readonly canRedo: boolean;
    readonly change: EditChange;
}
```

Members (15):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `options` | `readonly options: ResolvedEditOptions;` |  |  |
| `version` | `readonly version: number;` |  |  |
| `newRowId` | `readonly newRowId: RowId \| null;` |  | The always-visible add row (`showNewRow`), or null. It is not in `addedRowIds` and counts as an unsaved change only once it has a changed value; a fresh id follows every save or cancel of it. |
| `active` | `readonly active: EditTarget \| null;` |  |  |
| `status` | `readonly status: EditStatus;` |  |  |
| `dirtyCellCount` | `readonly dirtyCellCount: number;` |  |  |
| `addedRowIds` | `readonly addedRowIds: readonly RowId[];` |  | Added, unsaved rows in display order (identity changes only when the list changes). |
| `deletedRowIds` | `readonly deletedRowIds: readonly RowId[];` |  | Rows marked for deletion in batch mode. |
| `pendingWrites` | `readonly pendingWrites: number;` |  |  |
| `lastError` | `readonly lastError: string \| null;` |  | Message of the last failed write, cleared by the next successful one. |
| `lastBulk` | `readonly lastBulk: {     readonly requested: number;     readonly applied: number; } \| null;` |  | Outcome of the last `edit.setValues` (paste, fill): cells requested and cells that took a value. |
| `canUndo` | `readonly canUndo: boolean;` |  | An `edit.undo` would apply (always false with `undo: false`). |
| `addedTreePlacements` | `readonly addedTreePlacements?: Readonly<Record<RowId, AddedTreePlacement>>;` | optional | Tree mode: where each added row goes (`above` / `below` / `child` of an anchor row); absent when none. |
| `canRedo` | `readonly canRedo: boolean;` |  | An `edit.redo` would apply. |
| `change` | `readonly change: EditChange;` |  |  |
