# `ZenWebsocket.Client.Frames`
[🔗](https://github.com/ZenHive/zen_websocket/blob/v0.8.0/lib/zen_websocket/client/frames.ex#L1)

Inbound WebSocket frame routing for `ZenWebsocket.Client`.

# `handle_ws`

```elixir
@spec handle_ws(map(), pid(), reference(), term()) ::
  {:noreply, map()} | {:stop, term(), map()}
```

Routes a Gun WebSocket frame: heartbeat tracking, control-frame decode, then data dispatch.

# `maybe_restore_subscriptions`

```elixir
@spec maybe_restore_subscriptions(map()) :: map()
```

Restores subscriptions after reconnection if configured.

# `route_data_frame`

```elixir
@spec route_data_frame(term(), map()) :: map()
```

Routes data frames to heartbeat, subscription, JSON-RPC, or the user handler.

# `send_text`

```elixir
@spec send_text(map(), pid(), reference(), binary(), GenServer.from()) ::
  {:noreply, map()} | {:reply, term(), map()}
```

Sends a text frame, correlating JSON-RPC requests that carry an id.

---

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