# `MingaEditor.Shell.Traditional.YankFlash`
[🔗](https://github.com/jsmestad/minga/blob/main/lib/minga_editor/shell/traditional/yank_flash.ex#L1)

Pure lifecycle owner for the yank-region flash animation.

# `generation`

```elixir
@type generation() :: non_neg_integer()
```

# `position`

```elixir
@type position() :: {non_neg_integer(), non_neg_integer()}
```

# `range_type`

```elixir
@type range_type() :: :charwise | :linewise
```

# `t`

```elixir
@type t() :: %MingaEditor.Shell.Traditional.YankFlash{
  buf: pid() | nil,
  end_pos: position(),
  generation: generation(),
  max_steps: pos_integer(),
  range_type: range_type(),
  start_pos: position(),
  step: non_neg_integer(),
  timer: reference() | nil
}
```

# `active?`

```elixir
@spec active?(t()) :: boolean()
```

Returns whether a yank flash is active.

# `advance`

```elixir
@spec advance(t(), generation()) :: {:continue, t()} | {:done, t()} | {:stale, t()}
```

Advances a matching generation, rejecting stale timer delivery.

# `cancel`

```elixir
@spec cancel(t()) :: t()
```

Cancels the active yank flash while retaining its generation.

# `color_for_step`

```elixir
@spec color_for_step(t(), non_neg_integer(), non_neg_integer()) :: non_neg_integer()
```

Computes the current animation color.

# `default_flash_bg`

```elixir
@spec default_flash_bg() :: non_neg_integer()
```

Returns the fallback yank flash color.

# `flash_group`

```elixir
@spec flash_group() :: atom()
```

Returns the decoration group owned by the yank flash workflow.

# `highlight_bounds`

```elixir
@spec highlight_bounds(position(), position(), range_type(), non_neg_integer()) ::
  {position(), position()}
```

Computes charwise or linewise highlight bounds from workflow-provided line length.

# `record_timer`

```elixir
@spec record_timer(t(), generation(), reference()) :: t()
```

Records a timer handle only for the current active generation.

# `replace`

```elixir
@spec replace(t(), pid(), position(), position(), range_type()) :: t()
```

Replaces the active yank flash and advances its monotonic generation.

# `step_interval_ms`

```elixir
@spec step_interval_ms() :: pos_integer()
```

Returns the animation interval used by the workflow.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
