# `Dala.Spark.DslVerifier`
[🔗](https://github.com/manhvu/dala/blob/main/lib/dala/spark/dsl_verifier.ex#L1)

Comprehensive DSL verification for Dala screen modules.

Validates user-defined screens against the component registry and
reports warnings/errors for:
- Unknown component types
- Invalid prop names
- Missing required props
- Event handler props that are not atoms
- Invalid attribute types
- Missing handle_event/3 for declared event handlers
- Children placed inside leaf components
- Invalid variant values
- Deprecated prop usage

# `warning`

```elixir
@type warning() :: %{
  type: :error | :warning | :info,
  module: atom(),
  line: non_neg_integer(),
  message: String.t()
}
```

# `closest_match`

```elixir
@spec closest_match(atom(), [atom()]) :: atom() | nil
```

Suggest the closest valid prop for a mistyped key, or nil when nothing is
close enough. Shared by the runtime verifier and the DSL's parse-time
prop validation.

# `defined_handlers`

```elixir
@spec defined_handlers(module()) :: [atom()]
```

Event names handled by `handle_event/3` clauses in `module`.

Reads the module's compiled debug_info, so it works for fully-compiled
modules (runtime verification, `mix dala.verify`). Returns `[]` when the
beam or debug info is unavailable — e.g. from inside the compile hook,
where only missing-handler checks are possible.

# `format_report`

```elixir
@spec format_report([warning()]) :: String.t()
```

Format a list of warnings into a human-readable report.

# `handler_warnings`

```elixir
@spec handler_warnings(module()) :: [warning()]
```

Missing / unused `handle_event` warnings for a compiled module.

Used by the `@after_verify` hook so a typo'd `on_tap` surfaces during
`mix compile` instead of as a runtime crash or a manual `mix dala.verify`.
Returns [] when the module or its beam is unavailable.

# `print_warnings`

```elixir
@spec print_warnings([warning()]) :: :ok
```

Print warnings to the Mix shell with appropriate coloring.

# `verify_from_raw`

```elixir
@spec verify_from_raw(module(), [map()], [map()], [map()]) :: [warning()]
```

Verify DSL from raw entity/attribute/handler data (used by compile-time hook).

# `verify_module`

```elixir
@spec verify_module(module()) :: [warning()]
```

Verify a single screen module's DSL definition.

Returns a list of warnings/errors found.

---

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