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

> The TreeMethods type of @salmonui/data-grid/engine/tree.

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

```ts
import type { TreeMethods } 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: type

```ts
type TreeMethods<Row> = {
    getTreeRow(ctx: ModuleContext<Row>, rowId: RowId): TreeRowInfo | null;
    getChildRows(ctx: ModuleContext<Row>, rowId: RowId | null): readonly Row[];
    getChildRowIds(ctx: ModuleContext<Row>, rowId: RowId | null): readonly RowId[];
    isExpanded(ctx: ModuleContext<Row>, rowId: RowId): boolean;
    getLoadStatus(ctx: ModuleContext<Row>, rowId: RowId): TreeLoadStatus;
    checkState(ctx: ModuleContext<Row>, rowId: RowId): TreeCheckState;
    getChildSummary(ctx: ModuleContext<Row>, rowId: RowId): AggregateValues | null;
    canIndent(ctx: ModuleContext<Row>, rowIds: readonly RowId[]): boolean;
    canOutdent(ctx: ModuleContext<Row>, rowIds: readonly RowId[]): boolean;
    getExpansion(ctx: ModuleContext<Row>): {
        readonly expandedRows: Readonly<Record<RowId, boolean>>;
        readonly defaultExpanded: boolean | number;
    };
    getInfo(ctx: ModuleContext<Row>): TreeInfo;
};
```

Members (11):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `getTreeRow` | `getTreeRow(ctx: ModuleContext<Row>, rowId: RowId): TreeRowInfo \| null;` |  | Row info for the renderer and `getRowInfo()`; null for unknown rows. |
| `getChildRows` | `getChildRows(ctx: ModuleContext<Row>, rowId: RowId \| null): readonly Row[];` |  | Kept children of a row in view order (null: the roots). |
| `getChildRowIds` | `getChildRowIds(ctx: ModuleContext<Row>, rowId: RowId \| null): readonly RowId[];` |  |  |
| `isExpanded` | `isExpanded(ctx: ModuleContext<Row>, rowId: RowId): boolean;` |  |  |
| `getLoadStatus` | `getLoadStatus(ctx: ModuleContext<Row>, rowId: RowId): TreeLoadStatus;` |  |  |
| `checkState` | `checkState(ctx: ModuleContext<Row>, rowId: RowId): TreeCheckState;` |  | Checkbox tri-state derived from selected descendants (`aria-checked="mixed"`). |
| `getChildSummary` | `getChildSummary(ctx: ModuleContext<Row>, rowId: RowId): AggregateValues \| null;` |  | Child summary values of a parent (over its kept descendants), or null without aggregates. |
| `canIndent` | `canIndent(ctx: ModuleContext<Row>, rowIds: readonly RowId[]): boolean;` |  | Can `tree.indent` / `tree.outdent` move these rows (toolbar disabled state)? |
| `canOutdent` | `canOutdent(ctx: ModuleContext<Row>, rowIds: readonly RowId[]): boolean;` |  |  |
| `getExpansion` | `getExpansion(ctx: ModuleContext<Row>): {     readonly expandedRows: Readonly<Record<RowId, boolean>>;     readonly defaultExpanded: boolean \| number; };` |  | Persistable expansion (`getState().tree`). |
| `getInfo` | `getInfo(ctx: ModuleContext<Row>): TreeInfo;` |  |  |
