# `Kinda.CodeGen.DeclarationManifest`
[🔗](https://github.com/beaver-lodge/kinda/blob/main/lib/codegen/declaration_manifest.ex#L1)

A versioned declaration manifest for generated NIFs and types.

A manifest bundles generated NIF declarations (`Kinda.CodeGen.NIFDecl`) and
type declarations (`Kinda.CodeGen.TypeDecl`), optionally keeping the source
signature manifest they were derived from. Manifests are the canonical
machine-readable contract between Kinda's codegen pipeline and downstream
consumers, and can be serialized to and from maps as well as loaded from
`.ex` or `.json` files via `load!/1`.

# `source`

```elixir
@type source() :: t() | map() | Path.t()
```

# `t`

```elixir
@type t() :: %Kinda.CodeGen.DeclarationManifest{
  nif_decls: [Kinda.CodeGen.NIFDecl.t()],
  signature_manifest: map() | nil,
  signature_manifest_version: pos_integer() | nil,
  type_decls: [Kinda.CodeGen.TypeDecl.t()],
  version: pos_integer()
}
```

# `build`

```elixir
@spec build([Kinda.CodeGen.NIFDecl.t()], map() | nil) :: t()
```

# `from_manifest`

```elixir
@spec from_manifest(map()) :: t()
```

# `from_parts`

```elixir
@spec from_parts(
  [Kinda.CodeGen.NIFDecl.t()],
  [Kinda.CodeGen.TypeDecl.t()],
  map() | nil
) :: t()
```

# `load!`

```elixir
@spec load!(source()) :: t()
```

# `merge_nif_decls`

```elixir
@spec merge_nif_decls(t(), [Kinda.CodeGen.NIFDecl.t()]) :: t()
```

# `nif_decls`

```elixir
@spec nif_decls(t()) :: [Kinda.CodeGen.NIFDecl.t()]
```

# `put_nif_decls`

```elixir
@spec put_nif_decls(t(), [Kinda.CodeGen.NIFDecl.t()]) :: t()
```

# `put_signature_manifest`

```elixir
@spec put_signature_manifest(t(), map() | nil) :: t()
```

# `put_type_decls`

```elixir
@spec put_type_decls(t(), [Kinda.CodeGen.TypeDecl.t()]) :: t()
```

# `signature_manifest`

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

# `signature_manifest_version`

```elixir
@spec signature_manifest_version(t()) :: pos_integer() | nil
```

# `to_manifest`

```elixir
@spec to_manifest(t()) :: map()
```

# `type_decls`

```elixir
@spec type_decls(t()) :: [Kinda.CodeGen.TypeDecl.t()]
```

---

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