# selection.Selection.count

- **Module:** selection
- **Package:** libtmux
- **Language:** TypeScript
- **Kind:** method
- **Source:** https://github.com/libtmux/libtmux-ts/blob/073b9d7dedad900bff6f5ec0ea47794e40225870/packages/libtmux/src/selection.ts#L576
- **Page:** https://libtmux.org/en/ts/latest/reference/selection-selection-count/

```
count(criteria?: WhereOf<Model>): number
```

How many members match `criteria`, or how many there are without it.

## Examples

```ts
snapshot.panes.count(); // every pane
snapshot.panes.count({ currentCommand: "vim" });
```

## Type parameters

- [`Model`](/en/ts/latest/reference/selection-selection/#selection.Selection.type-parameter.Model), declared by [`Selection<Model>`](/en/ts/latest/reference/selection-selection/)

## Parameters

- `criteria?` (`WhereOf<Model>`)
