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

Behavior and macros for declaration-driven NIF module generation.

`use Kinda.CodeGen` requires a `codec:` module. Generated public wrappers
call their concrete raw NIF function and pass only its return value to
`codec.normalize/1`.

The default `:combined` surface keeps public wrappers, native stubs, and a
raw proxy module together. Large bindings can compile the `:public` and
`:raw` surfaces in separate modules to remove the proxy layer and let the
compiler process both surfaces independently.

# `declaration_manifest`

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

# `declaration_manifest_source`

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

# `declaration_surfaces`

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

# `nif_decl_input`

```elixir
@type nif_decl_input() ::
  Kinda.CodeGen.NIFDecl.t() | {atom(), integer()} | {atom(), [atom()]}
```

# `signature_manifest`

```elixir
@type signature_manifest() :: map() | nil
```

# `type_decl`

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

# `declaration_manifest`

```elixir
@callback declaration_manifest() :: declaration_manifest_source()
```

# `kinds`
*optional* 

```elixir
@callback kinds() :: [Kinda.CodeGen.KindDecl.t()]
```

# `declaration_manifest`

# `kinds`

# `nif_ast`

# `nif_ast_from_decls`

# `nif_decls`

# `public_nif_ast_from_decls`

Generates public wrappers that call functions in `raw_module` directly.

Kind-scoped declarations are omitted because they are an implementation
detail of resource modules rather than part of the public wrapper surface.

# `raw_module`

# `raw_nif_ast_from_decls`

Generates native stubs without a public proxy layer.

Public declarations use their wrapper name in the raw module. Kind-scoped
declarations retain their fully-qualified function atoms so each resource
kind remains unambiguous.

# `record_types_ast`

# `type_decls`

# `type_decls_ast`

---

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