# @salmonui/core/data API reference

> 42 exported symbols of @salmonui/core/data: 7 functions, 22 interfaces and 13 types.

Canonical: https://salmonui.dev/docs/reference/core/data

```ts
import { … } from '@salmonui/core/data';
```

## Functions

### compilePattern

Kind: function

Page: https://salmonui.dev/docs/reference/core/data/compilePattern

```ts
function compilePattern(pattern: string, operator: 'like' | 'wildcard'): RegExp;
```

Compiles `like` (`%` / `*` = any sequence) or `wildcard` (`*` = any sequence, `?` = one character) into an anchored RegExp.

### freezeJsonCopy

Kind: function

Page: https://salmonui.dev/docs/reference/core/data/freezeJsonCopy

```ts
function freezeJsonCopy<T>(value: T): T;
```

Deep copy of a JSON value with every object and array frozen. Drops `undefined` properties.

### isJsonValue

Kind: function

Page: https://salmonui.dev/docs/reference/core/data/isJsonValue

```ts
function isJsonValue(value: unknown): value is Json;
```

True when `value` survives a JSON round trip unchanged: null, booleans,
finite numbers, strings, arrays, and plain objects of those. `undefined` is
allowed only as an object property value (it is dropped by JSON).

### normalizeFilterOperator

Kind: function

Page: https://salmonui.dev/docs/reference/core/data/normalizeFilterOperator

```ts
function normalizeFilterOperator(name: string): FilterOperator | null;
```

Canonical built-in operator for a name (case-insensitive).

### shallowEqual

Kind: function

Page: https://salmonui.dev/docs/reference/core/data/shallowEqual

```ts
function shallowEqual<T>(a: T, b: T): boolean;
```

Shallow equality for selector results: `Object.is`, or same keys/items with `Object.is` values.

### shallowEqualArrays

Kind: function

Page: https://salmonui.dev/docs/reference/core/data/shallowEqualArrays

```ts
function shallowEqualArrays(a: readonly unknown[], b: readonly unknown[]): boolean;
```

### stableStringify

Kind: function

Page: https://salmonui.dev/docs/reference/core/data/stableStringify

```ts
function stableStringify(value: unknown): string;
```

Deterministic JSON: object keys sorted, `undefined` and functions dropped,
array order preserved. Used for query cache keys and serialization.

## Interfaces

### AbortSignalLike

Kind: interface

Page: https://salmonui.dev/docs/reference/core/data/AbortSignalLike

```ts
interface AbortSignalLike {
    readonly aborted: boolean;
    readonly reason?: unknown;
    addEventListener(type: 'abort', listener: () => void): void;
    removeEventListener(type: 'abort', listener: () => void): void;
}
```

Minimal structural view of an `AbortSignal`.

- `@salmonui`

/core neutral subpaths compile
without the DOM lib, so it cannot name the platform type; at runtime the engine passes a
real `AbortSignal` whenever the platform provides `AbortController`.

Members (4):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `aborted` | `readonly aborted: boolean;` |  |  |
| `reason` | `readonly reason?: unknown;` | optional |  |
| `addEventListener` | `addEventListener(type: 'abort', listener: () => void): void;` |  |  |
| `removeEventListener` | `removeEventListener(type: 'abort', listener: () => void): void;` |  |  |

### AggregateDescriptor

Kind: interface

Page: https://salmonui.dev/docs/reference/core/data/AggregateDescriptor

```ts
interface AggregateDescriptor {
    readonly columnId: ColumnId;
    readonly type: AggregateType;
    readonly custom?: {
        custom(rows: readonly unknown[], column: unknown): unknown;
    }['custom'];
    readonly placement: readonly ('footer' | 'groupFooter' | 'groupCaption')[];
    readonly format?: string;
}
```

Members (5):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `columnId` | `readonly columnId: ColumnId;` |  |  |
| `type` | `readonly type: AggregateType;` |  |  |
| `custom` | `readonly custom?: {     custom(rows: readonly unknown[], column: unknown): unknown; }['custom'];` | optional | Local only; never serialized. The Data Grid passes its compiled column. |
| `placement` | `readonly placement: readonly ('footer' \| 'groupFooter' \| 'groupCaption')[];` |  |  |
| `format` | `readonly format?: string;` | optional |  |

### ConflictSnapshot

Kind: interface

Page: https://salmonui.dev/docs/reference/core/data/ConflictSnapshot

```ts
interface ConflictSnapshot<Row> {
    readonly rowId: RowId;
    readonly local: Row;
    readonly server: Row;
    readonly base: Row | null;
    readonly cells: readonly {
        readonly columnId: ColumnId;
        readonly local: unknown;
        readonly server: unknown;
    }[];
    readonly version?: string;
}
```

A version conflict reported by a write (structural copy of `@salmonui/data` `ConflictSnapshot`).

Members (6):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `rowId` | `readonly rowId: RowId;` |  |  |
| `local` | `readonly local: Row;` |  |  |
| `server` | `readonly server: Row;` |  |  |
| `base` | `readonly base: Row \| null;` |  |  |
| `cells` | `readonly cells: readonly {     readonly columnId: ColumnId;     readonly local: unknown;     readonly server: unknown; }[];` |  |  |
| `version` | `readonly version?: string;` | optional |  |

### DataQuery

Kind: interface

Page: https://salmonui.dev/docs/reference/core/data/DataQuery

```ts
interface DataQuery {
    readonly search: SearchDescriptor | null;
    readonly filters: readonly FilterEntry[];
    readonly sorting: readonly SortDescriptor[];
    readonly grouping: readonly GroupDescriptor[];
    readonly aggregates: readonly AggregateDescriptor[];
    readonly paging: PagingDescriptor | null;
    readonly expansion: ExpansionDescriptor;
}
```

Members (7):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `search` | `readonly search: SearchDescriptor \| null;` |  |  |
| `filters` | `readonly filters: readonly FilterEntry[];` |  | Top level: conditions on the same column fold by `predicate`; columns and groups are ANDed. |
| `sorting` | `readonly sorting: readonly SortDescriptor[];` |  |  |
| `grouping` | `readonly grouping: readonly GroupDescriptor[];` |  |  |
| `aggregates` | `readonly aggregates: readonly AggregateDescriptor[];` |  |  |
| `paging` | `readonly paging: PagingDescriptor \| null;` |  | null when the paging module is off. |
| `expansion` | `readonly expansion: ExpansionDescriptor;` |  |  |

### DataSource

Kind: interface

Page: https://salmonui.dev/docs/reference/core/data/DataSource

```ts
interface DataSource<Row> {
    readonly mode: DataSourceMode;
    read(request: DataSourceRequest): DataSourceResult<Row> | Promise<DataSourceResult<Row>>;
    write?(request: WriteRequest<Row>): Promise<WriteResult<Row>>;
    subscribe?(listener: (event: DataSourceEvent<Row>) => void): () => void;
    invalidate?(scope?: 'rows' | 'counts' | 'facets' | 'all'): void;
    readonly capabilities?: Partial<DataSourceCapabilities>;
}
```

Members (6):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `mode` | `readonly mode: DataSourceMode;` |  |  |
| `read` | `read(request: DataSourceRequest): DataSourceResult<Row> \| Promise<DataSourceResult<Row>>;` |  |  |
| `write` | `write?(request: WriteRequest<Row>): Promise<WriteResult<Row>>;` | optional |  |
| `subscribe` | `subscribe?(listener: (event: DataSourceEvent<Row>) => void): () => void;` | optional |  |
| `invalidate` | `invalidate?(scope?: 'rows' \| 'counts' \| 'facets' \| 'all'): void;` | optional | Drops cached results; `engine.refresh()` calls it with `'all'` before re-reading. Must not notify. |
| `capabilities` | `readonly capabilities?: Partial<DataSourceCapabilities>;` | optional |  |

### DataSourceCapabilities

Kind: interface

Page: https://salmonui.dev/docs/reference/core/data/DataSourceCapabilities

```ts
interface DataSourceCapabilities {
    readonly facets: boolean;
    readonly lazyGroups: boolean;
    readonly treeChildren: boolean;
    readonly cursor: boolean;
    readonly infinite: boolean;
    readonly lookups: boolean;
    readonly write: boolean;
    readonly exportJobs: boolean;
    readonly reload: boolean;
}
```

Members (9):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `facets` | `readonly facets: boolean;` |  |  |
| `lazyGroups` | `readonly lazyGroups: boolean;` |  |  |
| `treeChildren` | `readonly treeChildren: boolean;` |  |  |
| `cursor` | `readonly cursor: boolean;` |  |  |
| `infinite` | `readonly infinite: boolean;` |  |  |
| `lookups` | `readonly lookups: boolean;` |  |  |
| `write` | `readonly write: boolean;` |  |  |
| `exportJobs` | `readonly exportJobs: boolean;` |  |  |
| `reload` | `readonly reload: boolean;` |  |  |

### DataSourceFacetRequest

Kind: interface

Page: https://salmonui.dev/docs/reference/core/data/DataSourceFacetRequest

```ts
interface DataSourceFacetRequest {
    readonly columnId: ColumnId;
    readonly search?: string;
    readonly limit?: number;
}
```

Members (3):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `columnId` | `readonly columnId: ColumnId;` |  |  |
| `search` | `readonly search?: string;` | optional | Case-insensitive substring of the label. |
| `limit` | `readonly limit?: number;` | optional | Entries at most (checklist page); `complete: false` when more exist. |

### DataSourceFacetResult

Kind: interface

Page: https://salmonui.dev/docs/reference/core/data/DataSourceFacetResult

```ts
interface DataSourceFacetResult {
    readonly columnId: ColumnId;
    readonly entries: readonly {
        readonly key: string;
        readonly label: string;
        readonly count: number;
    }[];
    readonly complete: boolean;
}
```

Members (3):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `columnId` | `readonly columnId: ColumnId;` |  |  |
| `entries` | `readonly entries: readonly {     readonly key: string;     readonly label: string;     readonly count: number; }[];` |  | `key`: the server's value key (`BLANK_FACET_KEY` for blanks); `label`: display text. Sorted by label. |
| `complete` | `readonly complete: boolean;` |  | False when `limit` truncated the list. |

### DataSourceRequest

Kind: interface

Page: https://salmonui.dev/docs/reference/core/data/DataSourceRequest

```ts
interface DataSourceRequest {
    readonly version: number;
    readonly query: DataQuery;
    readonly range?: {
        readonly start: number;
        readonly end: number;
    };
    readonly cursor?: string | null;
    readonly groupPath?: readonly GroupPathSegment[];
    readonly parentRowId?: RowId | null;
    readonly facet?: DataSourceFacetRequest;
    readonly signal: AbortSignalLike;
}
```

Members (8):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `version` | `readonly version: number;` |  |  |
| `query` | `readonly query: DataQuery;` |  |  |
| `range` | `readonly range?: {     readonly start: number;     readonly end: number; };` | optional |  |
| `cursor` | `readonly cursor?: string \| null;` | optional |  |
| `groupPath` | `readonly groupPath?: readonly GroupPathSegment[];` | optional | Lazy group load: `[]` loads the root group level; a non-empty path loads that group's children. Absent for plain reads. |
| `parentRowId` | `readonly parentRowId?: RowId \| null;` | optional | Tree read (tree mode over a remote source, `createRemoteTree`): `null` reads the root level, a row id reads that row's children. Sources answer with `TreeRowEnvelope`-shaped items (`{ kind: 'tree', row, parentId, hasChildren, childCount?, depth?, children? }`). Absent for plain reads. |
| `facet` | `readonly facet?: DataSourceFacetRequest;` | optional | Facet read: distinct values of a column with counts over the rows passing search and every other column's filter, for remote checklist and Excel filters. Sources answer with `facet`. |
| `signal` | `readonly signal: AbortSignalLike;` |  |  |

### DataSourceResult

Kind: interface

Page: https://salmonui.dev/docs/reference/core/data/DataSourceResult

```ts
interface DataSourceResult<Row> {
    readonly version: number;
    readonly rows: readonly Row[];
    readonly totalRowCount?: number;
    readonly performed?: readonly PerformedStage[];
    readonly aggregates?: AggregateValues;
    readonly pageInfo?: {
        readonly hasNextPage?: boolean;
        readonly hasPreviousPage?: boolean;
        readonly endCursor?: string | null;
    };
    readonly rowOffset?: number;
    readonly facet?: DataSourceFacetResult;
}
```

Members (8):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `version` | `readonly version: number;` |  |  |
| `rows` | `readonly rows: readonly Row[];` |  | Plain rows; group envelopes for lazy group loads. |
| `totalRowCount` | `readonly totalRowCount?: number;` | optional |  |
| `performed` | `readonly performed?: readonly PerformedStage[];` | optional |  |
| `aggregates` | `readonly aggregates?: AggregateValues;` | optional | Totals over every matching row (remote aggregates). |
| `pageInfo` | `readonly pageInfo?: {     readonly hasNextPage?: boolean;     readonly hasPreviousPage?: boolean;     readonly endCursor?: string \| null; };` | optional |  |
| `rowOffset` | `readonly rowOffset?: number;` | optional | Row index of `rows[0]` for a `range` read (block sources after evicting leading blocks); default `range.start`, or 0 for `capabilities.infinite` sources. |
| `facet` | `readonly facet?: DataSourceFacetResult;` | optional | Answer to a `facet` request. |

### ExpansionDescriptor

Kind: interface

Page: https://salmonui.dev/docs/reference/core/data/ExpansionDescriptor

```ts
interface ExpansionDescriptor {
    readonly groups: Readonly<Record<string, boolean>>;
    readonly tree: Readonly<Record<RowId, boolean>>;
    readonly detail: Readonly<Record<RowId, boolean>>;
    readonly defaultGroupExpanded: boolean;
}
```

Members (4):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `groups` | `readonly groups: Readonly<Record<string, boolean>>;` |  |  |
| `tree` | `readonly tree: Readonly<Record<RowId, boolean>>;` |  |  |
| `detail` | `readonly detail: Readonly<Record<RowId, boolean>>;` |  |  |
| `defaultGroupExpanded` | `readonly defaultGroupExpanded: boolean;` |  |  |

### FilterDescriptor

Kind: interface

Page: https://salmonui.dev/docs/reference/core/data/FilterDescriptor

```ts
interface FilterDescriptor {
    readonly kind?: 'condition';
    readonly columnId: ColumnId;
    readonly operator: FilterOperator | (string & {});
    readonly value: Json;
    readonly predicate: 'and' | 'or';
    readonly matchCase?: boolean;
    readonly ignoreAccent?: boolean;
    readonly source: FilterSource;
}
```

Members (8):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `kind` | `readonly kind?: 'condition';` | optional |  |
| `columnId` | `readonly columnId: ColumnId;` |  |  |
| `operator` | `readonly operator: FilterOperator \| (string & {});` |  | A built-in operator or the name of a custom operator registered with `createFilterModule({ operators })`. |
| `value` | `readonly value: Json;` |  | `between`: `[from, to]` (inclusive). `in` / `notIn`: an array. Dates: ISO strings or epoch milliseconds. |
| `predicate` | `readonly predicate: 'and' \| 'or';` |  | Combination with the previous condition on the same column at the top level; ignored inside a group. |
| `matchCase` | `readonly matchCase?: boolean;` | optional |  |
| `ignoreAccent` | `readonly ignoreAccent?: boolean;` | optional |  |
| `source` | `readonly source: FilterSource;` |  |  |

### FilterGroupDescriptor

Kind: interface

Page: https://salmonui.dev/docs/reference/core/data/FilterGroupDescriptor

```ts
interface FilterGroupDescriptor {
    readonly kind: 'group';
    readonly predicate: 'and' | 'or';
    readonly not?: boolean;
    readonly filters: readonly FilterEntry[];
    readonly source?: FilterSource;
}
```

Nested AND/OR group: `predicate` combines its members (`{ predicate: 'or',
filters: [A, B] }` is A OR B); member
predicates are ignored. A top-level group is ANDed with the other
top-level entries; a nested group is one member of its parent.

Members (5):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `kind` | `readonly kind: 'group';` |  |  |
| `predicate` | `readonly predicate: 'and' \| 'or';` |  |  |
| `not` | `readonly not?: boolean;` | optional | Negates the combined group: NOT (A AND B). |
| `filters` | `readonly filters: readonly FilterEntry[];` |  |  |
| `source` | `readonly source?: FilterSource;` | optional |  |

### GroupDescriptor

Kind: interface

Page: https://salmonui.dev/docs/reference/core/data/GroupDescriptor

```ts
interface GroupDescriptor {
    readonly columnId: ColumnId;
    readonly format?: string;
    readonly direction?: 'asc' | 'desc';
}
```

Members (3):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `columnId` | `readonly columnId: ColumnId;` |  |  |
| `format` | `readonly format?: string;` | optional | Group-by-format: a number or date format (`N0`, `yMMM`) whose formatted value is the group key. |
| `direction` | `readonly direction?: 'asc' \| 'desc';` | optional | Group order when the sort list has no descriptor for the column. Default `asc`. |

### GroupPathSegment

Kind: interface

Page: https://salmonui.dev/docs/reference/core/data/GroupPathSegment

```ts
interface GroupPathSegment {
    readonly columnId: ColumnId;
    readonly key: Json;
}
```

One level of a group path: the grouped column and the group key (JSON form of the value).

Members (2):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `columnId` | `readonly columnId: ColumnId;` |  |  |
| `key` | `readonly key: Json;` |  |  |

### GroupedRowEnvelope

Kind: interface

Page: https://salmonui.dev/docs/reference/core/data/GroupedRowEnvelope

```ts
interface GroupedRowEnvelope<Row> {
    readonly kind: 'group';
    readonly key: Json;
    readonly columnId: ColumnId;
    readonly groupPath: readonly GroupPathSegment[];
    readonly count: number;
    readonly aggregates?: AggregateValues;
    readonly items?: readonly (Row | GroupedRowEnvelope<Row>)[];
}
```

Group envelope of a lazy group load (`DataSourceRequest.groupPath`).

Members (7):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `kind` | `readonly kind: 'group';` |  |  |
| `key` | `readonly key: Json;` |  |  |
| `columnId` | `readonly columnId: ColumnId;` |  |  |
| `groupPath` | `readonly groupPath: readonly GroupPathSegment[];` |  |  |
| `count` | `readonly count: number;` |  | Total descendants (data rows), not loaded descendants. |
| `aggregates` | `readonly aggregates?: AggregateValues;` | optional |  |
| `items` | `readonly items?: readonly (Row \| GroupedRowEnvelope<Row>)[];` | optional | Omitted for lazy groups. |

### PagingDescriptor

Kind: interface

Page: https://salmonui.dev/docs/reference/core/data/PagingDescriptor

```ts
interface PagingDescriptor {
    readonly page: number;
    readonly pageSize: number;
}
```

Members (2):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `page` | `readonly page: number;` |  |  |
| `pageSize` | `readonly pageSize: number;` |  |  |

### RowPlacement

Kind: interface

Page: https://salmonui.dev/docs/reference/core/data/RowPlacement

```ts
interface RowPlacement {
    readonly rowIds: readonly RowId[];
    readonly targetRowId: RowId | null;
    readonly position: 'before' | 'after';
    readonly parentId?: RowId | null;
}
```

Moves `rowIds` (in this order) next to `targetRowId`; a null target means the start (`before`) or the end (`after`).

Members (4):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `rowIds` | `readonly rowIds: readonly RowId[];` |  |  |
| `targetRowId` | `readonly targetRowId: RowId \| null;` |  |  |
| `position` | `readonly position: 'before' \| 'after';` |  |  |
| `parentId` | `readonly parentId?: RowId \| null;` | optional | Tree mode: the new parent of the moved rows (null: roots; absent outside tree mode). `targetRowId` / `position` stay a placement in the source array; the moved rows' subtrees travel with them, and flat (`parentIdField`) data also lists the rows whose parent changes in `changed`. |

### SearchDescriptor

Kind: interface

Page: https://salmonui.dev/docs/reference/core/data/SearchDescriptor

```ts
interface SearchDescriptor {
    readonly text: string;
    readonly columnIds: readonly ColumnId[] | 'all';
    readonly operator: SearchOperator;
    readonly ignoreCase: boolean;
    readonly ignoreAccent: boolean;
}
```

Members (5):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `text` | `readonly text: string;` |  |  |
| `columnIds` | `readonly columnIds: readonly ColumnId[] \| 'all';` |  |  |
| `operator` | `readonly operator: SearchOperator;` |  |  |
| `ignoreCase` | `readonly ignoreCase: boolean;` |  |  |
| `ignoreAccent` | `readonly ignoreAccent: boolean;` |  |  |

### SortDescriptor

Kind: interface

Page: https://salmonui.dev/docs/reference/core/data/SortDescriptor

```ts
interface SortDescriptor {
    readonly columnId: ColumnId;
    readonly direction: 'asc' | 'desc';
}
```

Members (2):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `columnId` | `readonly columnId: ColumnId;` |  |  |
| `direction` | `readonly direction: 'asc' \| 'desc';` |  |  |

### WriteRequest

Kind: interface

Page: https://salmonui.dev/docs/reference/core/data/WriteRequest

```ts
interface WriteRequest<Row> {
    readonly version: number;
    readonly added: readonly {
        readonly tempId: RowId;
        readonly row: Row;
        readonly parentId?: RowId | null;
    }[];
    readonly changed: readonly {
        readonly rowId: RowId;
        readonly row: Row;
        readonly previous: Row;
        readonly changedColumnIds: readonly ColumnId[];
    }[];
    readonly deleted: readonly {
        readonly rowId: RowId;
        readonly row: Row;
    }[];
    readonly mode: 'row' | 'dialog' | 'batch' | 'cell';
    readonly signal: AbortSignalLike;
    readonly moved?: RowPlacement;
}
```

Members (7):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `version` | `readonly version: number;` |  |  |
| `added` | `readonly added: readonly {     readonly tempId: RowId;     readonly row: Row;     readonly parentId?: RowId \| null; }[];` |  | `parentId` (tree mode): the parent the added row joins (null: a root); its `parentIdField` value is already set for flat data. |
| `changed` | `readonly changed: readonly {     readonly rowId: RowId;     readonly row: Row;     readonly previous: Row;     readonly changedColumnIds: readonly ColumnId[]; }[];` |  |  |
| `deleted` | `readonly deleted: readonly {     readonly rowId: RowId;     readonly row: Row; }[];` |  |  |
| `mode` | `readonly mode: 'row' \| 'dialog' \| 'batch' \| 'cell';` |  |  |
| `signal` | `readonly signal: AbortSignalLike;` |  |  |
| `moved` | `readonly moved?: RowPlacement;` | optional | Row reorder placement hint (row drag and drop): local sources move the rows in their array. |

### WriteResult

Kind: interface

Page: https://salmonui.dev/docs/reference/core/data/WriteResult

```ts
interface WriteResult<Row> {
    readonly version: number;
    readonly status: 'applied' | 'partial' | 'rejected';
    readonly added?: readonly {
        readonly tempId: RowId;
        readonly row: Row;
    }[];
    readonly changed?: readonly {
        readonly rowId: RowId;
        readonly row: Row;
    }[];
    readonly deleted?: readonly RowId[];
    readonly rowErrors?: Readonly<Record<RowId, readonly string[]>>;
    readonly cellErrors?: Readonly<Record<string, readonly string[]>>;
    readonly conflicts?: readonly ConflictSnapshot<Row>[];
    readonly totalRowCount?: number;
}
```

Members (9):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `version` | `readonly version: number;` |  |  |
| `status` | `readonly status: 'applied' \| 'partial' \| 'rejected';` |  |  |
| `added` | `readonly added?: readonly {     readonly tempId: RowId;     readonly row: Row; }[];` | optional |  |
| `changed` | `readonly changed?: readonly {     readonly rowId: RowId;     readonly row: Row; }[];` | optional |  |
| `deleted` | `readonly deleted?: readonly RowId[];` | optional |  |
| `rowErrors` | `readonly rowErrors?: Readonly<Record<RowId, readonly string[]>>;` | optional |  |
| `cellErrors` | `readonly cellErrors?: Readonly<Record<string, readonly string[]>>;` | optional | Cell errors keyed `${rowId}:${columnId}` (server field errors). |
| `conflicts` | `readonly conflicts?: readonly ConflictSnapshot<Row>[];` | optional | Version conflicts; the rows stay dirty. |
| `totalRowCount` | `readonly totalRowCount?: number;` | optional |  |

## Types

### AggregateType

Kind: type

Page: https://salmonui.dev/docs/reference/core/data/AggregateType

```ts
type AggregateType = 'sum' | 'average' | 'min' | 'max' | 'count' | 'trueCount' | 'falseCount' | 'custom';
```

### AggregateValues

Kind: type

Page: https://salmonui.dev/docs/reference/core/data/AggregateValues

```ts
type AggregateValues = Readonly<Record<ColumnId, Readonly<Record<string, unknown>>>>;
```

Aggregate values by column and aggregate type (`{ n0: { sum: 12, average: 3 } }`).

### ColumnId

Kind: type

Page: https://salmonui.dev/docs/reference/core/data/ColumnId

```ts
type ColumnId = string;
```

### DataSourceEvent

Kind: type

Page: https://salmonui.dev/docs/reference/core/data/DataSourceEvent

```ts
type DataSourceEvent<Row> = {
    readonly type: 'reset';
    readonly rows: readonly Row[];
    readonly totalRowCount?: number;
} | {
    readonly type: 'patch';
    readonly rows: readonly Row[];
    readonly updated: readonly RowId[];
    readonly added: readonly RowId[];
    readonly removed: readonly RowId[];
    readonly totalRowCount?: number;
};
```

Change notification from a data source. `rows` is always the complete new
row array; the id lists let the engine update incrementally.

### DataSourceMode

Kind: type

Page: https://salmonui.dev/docs/reference/core/data/DataSourceMode

```ts
type DataSourceMode = 'local' | 'remote' | 'live';
```

### FilterEntry

Kind: type

Page: https://salmonui.dev/docs/reference/core/data/FilterEntry

```ts
type FilterEntry = FilterDescriptor | FilterGroupDescriptor;
```

### FilterOperator

Kind: type

Page: https://salmonui.dev/docs/reference/core/data/FilterOperator

```ts
type FilterOperator = 'equal' | 'notEqual' | 'contains' | 'doesNotContain' | 'startsWith' | 'doesNotStartWith' | 'endsWith' | 'doesNotEndWith' | 'isEmpty' | 'isNotEmpty' | 'isNull' | 'isNotNull' | 'greaterThan' | 'greaterThanOrEqual' | 'lessThan' | 'lessThanOrEqual' | 'between' | 'in' | 'notIn' | 'like' | 'wildcard';
```

Built-in filter operators. `like` treats `%` and `*` as "any sequence";
`wildcard` treats `*` as "any sequence" and `?` as "one character". Both
match the whole value. Lowercase names (`startswith`,
`doesnotcontain`, `greaterthanorequal`, ...) are accepted by the filter
commands and normalized to these names.

### FilterSource

Kind: type

Page: https://salmonui.dev/docs/reference/core/data/FilterSource

```ts
type FilterSource = 'bar' | 'menu' | 'checkbox' | 'excel' | 'api';
```

### Json

Kind: type

Page: https://salmonui.dev/docs/reference/core/data/Json

```ts
type Json = null | boolean | number | string | readonly Json[] | {
    readonly [key: string]: Json;
};
```

### JsonObject

Kind: type

Page: https://salmonui.dev/docs/reference/core/data/JsonObject

```ts
type JsonObject = {
    readonly [key: string]: Json;
};
```

### PerformedStage

Kind: type

Page: https://salmonui.dev/docs/reference/core/data/PerformedStage

```ts
type PerformedStage = 'search' | 'filter' | 'sort' | 'group' | 'aggregate' | 'page';
```

Stages a remote source may declare as already performed.

### RowId

Kind: type

Page: https://salmonui.dev/docs/reference/core/data/RowId

```ts
type RowId = string;
```

### SearchOperator

Kind: type

Page: https://salmonui.dev/docs/reference/core/data/SearchOperator

```ts
type SearchOperator = 'contains' | 'startsWith' | 'endsWith' | 'equal' | 'notEqual' | 'wildcard' | 'like';
```

`wildcard`: `*` any sequence, `?` one character; `like`: `%` (or `*`) any sequence. Both match the whole value.
