# LibTmux.Selection

- **Module:** LibTmux
- **Package:** LibTmux
- **Language:** Julia
- **Kind:** struct
- **Source:** https://github.com/libtmux/libtmux-julia/blob/f3da513be1225d36d5854cd8db5972c01857578e/src/model.jl#L157
- **Bases:** [`AbstractArray`](https://docs.julialang.org/en/v1/base/arrays/#Core.AbstractArray)`{T, 1}`
- **Page:** https://libtmux.org/en/julia/latest/reference/libtmux-selection/

```
LibTmux.Selection{T}(
    items::AbstractVector{T},
    snapshot::Union{Nothing, LibTmux.Snapshot}
) where T

LibTmux.Selection(items::AbstractVector{T}; snapshot) where T
```

Read-only, ordered membership copied from `items`. Filtering preserves its element type, order, duplicates and snapshot provenance. A small selection may retain its entire snapshot. `collect`, `map` and `similar` return ordinary mutable arrays. Elements supplied by callers are not recursively frozen.

```julia
Selection(items; snapshot=nothing)
```

## Methods

### `Selection` (overload 1)

```julia
LibTmux.Selection{T}(
    items::AbstractVector{T},
    snapshot::Union{Nothing, LibTmux.Snapshot}
) where T
```

[Source](https://github.com/libtmux/libtmux-julia/blob/f3da513be1225d36d5854cd8db5972c01857578e/src/model.jl#L169).

### `LibTmux.Selection(items::AbstractVector{T}; snapshot) where T`

[Source](https://github.com/libtmux/libtmux-julia/blob/f3da513be1225d36d5854cd8db5972c01857578e/src/model.jl#L182).

## Parameters

- `items` (`AbstractArray{T, 1}`)
- `snapshot` (`Union{Nothing, LibTmux.Snapshot}`) (for `Selection(items, snapshot) [overload 1]`)
- `snapshot` (`Union{Nothing, Snapshot}`) (for `Selection(items, snapshot) [overload 2]`)
  Default: `nothing`.

## Members

### Other members

- `_items` (property)
- `_snapshot` (property)
