# TreeViewModel (@salmonui/data-grid/engine/tree)

> The TreeViewModel interface of @salmonui/data-grid/engine/tree: The tree view's per-model data (shared by its paged views).

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

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

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

## Reference

Kind: interface

```ts
interface TreeViewModel {
    readonly structure: TreeStructure;
    readonly expanded: Uint8Array;
    readonly match: Uint8Array | null;
    readonly lazy: Uint8Array | null;
    readonly ranges: TreeRanges;
    readonly pageBy: 'all' | 'root';
}
```

The tree view's per-model data (shared by its paged views).

Members (6):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `structure` | `readonly structure: TreeStructure;` |  |  |
| `expanded` | `readonly expanded: Uint8Array;` |  | By source index: 1 when the row is expanded. |
| `match` | `readonly match: Uint8Array \| null;` |  | By source index: 1 when the row matches the query (null: every kept row matches). Kept rows that do not match are context rows. |
| `lazy` | `readonly lazy: Uint8Array \| null;` |  | By source index: 1 when the row has children that are not loaded (lazy), or null. |
| `ranges` | `readonly ranges: TreeRanges;` |  |  |
| `pageBy` | `readonly pageBy: 'all' \| 'root';` |  | `root`: the page stage pages root rows. The unpaged view then reports the root count as `dataCount` (the page stage's unit); its paged windows report their data rows. |
