# `Plushie.Event.BuiltinSpecs`
[🔗](https://github.com/plushie-ui/plushie-elixir/blob/v0.7.2/lib/plushie/event/builtin_specs.ex#L1)

Canonical event specs for all built-in widget event types.

Each spec describes what data the event carries and where it goes:

- `%{carrier: :none}` - no payload (just id/scope)
- `%{carrier: :value, type: type}` - scalar in `WidgetEvent.value`
- `%{carrier: :value, fields: [field: type]}` - map in `WidgetEvent.value`

Type identifiers are either built-in atoms (`:float`, `:string`,
`:boolean`, `:any`) or modules implementing `Plushie.Type`.

Used by the canvas widget emit path and the protocol decoder to route
event data into the correct WidgetEvent fields with proper parsing.

# `field_type`

```elixir
@type field_type() :: :float | :string | :boolean | :any | module()
```

Event field type identifier.

Built-in atomic types or a module implementing `Plushie.Type`.

# `t`

```elixir
@type t() :: %{
  :carrier =&gt; :none | :value,
  optional(:doc) =&gt; String.t(),
  optional(:type) =&gt; field_type(),
  optional(:fields) =&gt; [{atom(), field_type()}],
  optional(:required) =&gt; [atom()]
}
```

Event spec describing the payload shape.

- `:none` - no payload
- `:value` - scalar value, stored in `WidgetEvent.value`
- `:value` with `:fields` - structured map, stored in `WidgetEvent.value` with atom keys

# `all`

```elixir
@spec all() :: %{required(atom()) =&gt; t()}
```

Returns all built-in event specs as a map.

# `spec`

```elixir
@spec spec(name :: atom()) :: t() | nil
```

Returns the event spec for a built-in event type, or nil.

---

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