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

> The applySelectionDelta function of @salmonui/data-grid/engine/tree: Applies a selection change to the counts in place: every ancestor of a changed row moves by one. O(changed × depth).

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

```ts
import { applySelectionDelta } 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: function

```ts
function applySelectionDelta(layout: TreeLayout, counts: Int32Array, added: Iterable<number>, removed: Iterable<number>): void;
```

Applies a selection change to the counts in place: every ancestor of a changed row moves by one. O(changed × depth).
