# `MingaEditor.State.Frontend`
[🔗](https://github.com/jsmestad/minga/blob/main/lib/minga_editor/state/frontend.ex#L1)

Per-editor frontend connection and capability state.

The value owns frontend identity, rendering policy, connection handles,
terminal dimensions, capability negotiation, pressure reporting, and input
correlation. Renderer-owned state lives in `MingaEditor.State.Render`.

# `backend`

```elixir
@type backend() :: :tui | :gui | :native_gui | :headless
```

# `rendering_policy`

```elixir
@type rendering_policy() :: :enabled | :disabled
```

# `t`

```elixir
@type t() :: %MingaEditor.State.Frontend{
  backend: backend(),
  capabilities: MingaEditor.Frontend.Capabilities.t(),
  last_input_seq: non_neg_integer(),
  port_manager: GenServer.server() | nil,
  rendering: rendering_policy(),
  resource_pressure: MingaEditor.State.ResourcePressure.t(),
  terminal_viewport: MingaEditor.Viewport.t()
}
```

# `accept_capabilities`

```elixir
@spec accept_capabilities(t(), MingaEditor.Frontend.Capabilities.t()) :: t()
```

Accepts frontend capability negotiation.

# `correlate_input`

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

Correlates the next committed frame with the latest frontend input.

# `new`

```elixir
@spec new(keyword()) :: t()
```

Builds frontend state from editor startup options.

# `rendering_enabled?`

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

Returns whether this editor emits rendered frames.

# `report_resource_pressure`

```elixir
@spec report_resource_pressure(
  t(),
  boolean(),
  MingaEditor.State.ResourcePressure.thermal_state()
) ::
  t()
```

Records the frontend's current resource-pressure report.

# `resize_terminal`

```elixir
@spec resize_terminal(t(), MingaEditor.Viewport.t()) :: t()
```

Records the terminal viewport reported by the active frontend.

---

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