# `Kinda.Declaration`
[🔗](https://github.com/beaver-lodge/kinda/blob/main/lib/kinda/declaration.ex#L1)

Canonical downstream entry point for Kinda's formalized declaration contract.

Consumer repos should prefer this module over reaching directly into
`Kinda.CodeGen.*` when they need to:

- load a generator's declaration source
- resolve generator output into declaration surfaces
- inspect generated NIF and type declarations

The underlying IR still lives in `Kinda.CodeGen.DeclarationSurfaces`, but
this facade is the intended stable binding/declaration surface for
downstreams.

That boundary is intentionally independent from downstream DSL naming.
Repos such as Beaver can rename or consolidate their public IR, dialect,
rewrite, and pass surfaces, including deleting old public shims outright,
without pulling declaration resolution back out of `kinda`.

# `manifest`

```elixir
@type manifest() :: Kinda.CodeGen.DeclarationManifest.t()
```

# `nif_decl`

```elixir
@type nif_decl() :: Kinda.CodeGen.NIFDecl.t()
```

# `source`

```elixir
@type source() :: Kinda.CodeGen.DeclarationManifest.source()
```

# `surfaces`

```elixir
@type surfaces() :: Kinda.CodeGen.DeclarationSurfaces.t()
```

# `type_decl`

```elixir
@type type_decl() :: Kinda.CodeGen.TypeDecl.t()
```

# `declaration_manifest`

```elixir
@spec declaration_manifest(surfaces()) :: manifest()
```

# `from_generator`

```elixir
@spec from_generator(module(), module()) :: surfaces()
```

# `from_parts`

```elixir
@spec from_parts(
  Kinda.CodeGen.DeclarationSurfaces.source_declaration_manifest(),
  manifest()
) ::
  surfaces()
```

# `load_source`

```elixir
@spec load_source(module()) ::
  Kinda.CodeGen.DeclarationSurfaces.source_declaration_manifest()
```

# `nif_decls`

```elixir
@spec nif_decls(surfaces()) :: [nif_decl()]
```

# `signature_manifest`

```elixir
@spec signature_manifest(surfaces()) :: map() | nil
```

# `source_declaration_manifest`

```elixir
@spec source_declaration_manifest(surfaces()) ::
  Kinda.CodeGen.DeclarationSurfaces.source_declaration_manifest()
```

# `type_decls`

```elixir
@spec type_decls(surfaces()) :: [type_decl()]
```

---

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