# `Macaw.Component.Announcement`
[🔗](https://github.com/dcoai/macaw_component/blob/v0.1.3/lib/macaw/component/announcement.ex#L1)

An announcement request (spec/01 §1.6): `%{name, text, politeness}`, for a name the
component declares in `announces`. Components never render a live region; the announcer
is the host's.

    iex> {:ok, d} = Macaw.Component.Declarations.new([announces: ["matches"]], nil)
    iex> Macaw.Component.Announcement.new(d, name: "matches", text: "12 projects match")
    {:ok, %{name: "matches", text: "12 projects match", politeness: :polite}}

# `t`

```elixir
@type t() :: %{name: String.t(), text: String.t(), politeness: :polite | :assertive}
```

# `new`

```elixir
@spec new(Macaw.Component.Declarations.t(), keyword() | map()) ::
  {:ok, t()} | {:error, [Macaw.Component.fault(), ...]}
```

A request from attributes (a keyword list or a map): `name`, `text`, and `politeness`,
`:polite` by default. Every fault at once: an undeclared name is `{:undeclared, name}`,
empty text `:empty`, a politeness other than the two `{:politeness, value}`.

---

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