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"
endWhen 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").
Summary
Functions
Returns the Lua-facing type name for the given module.
Callbacks
@callback type_name() :: String.t()