# `AshLua.Type`
[🔗](https://github.com/ash-project/ash_lua/blob/v0.1.0/lib/ash_lua/type.ex#L5)

Extends an Ash type with Lua-facing metadata.

Add `use AshLua.Type` to a custom type module (typically alongside
`use Ash.Type` or `use Ash.Type.NewType`) and implement `type_name/0` to
control the name surfaced in generated documentation (`AshLua.Docs`) for
that type.

    defmodule MyApp.Slug do
      use Ash.Type.NewType, subtype_of: :string
      use AshLua.Type

      @impl AshLua.Type
      def type_name, do: "slug"
    end

When a module does not implement `type_name/0`, the default name is derived
from the module itself: the last module segment, with `Ash.Type.` prefixed
modules underscored (`Ash.Type.UUID` → `"uuid"`, `Ash.Type.Boolean` →
`"boolean"`).

# `type_name`
*optional* 

```elixir
@callback type_name() :: String.t()
```

# `type_name`

```elixir
@spec type_name(module()) :: String.t()
```

Returns the Lua-facing type name for the given module.

Uses the module's `type_name/0` callback when defined, otherwise derives
a name from the module itself.

---

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