A function a catalog declares: its schema plus, when the catalog can evaluate it, an implementation.
:name— the name a call uses (formatString,@index).:schema— the function's definition as the catalog document writes it (a call schema withcall/@callandargs), or, for a function defined in code, possibly just the schema of itsargs.:return_type—"string","number","boolean","object","array","any"or"void", when declared (a top-levelreturnType, or thereturnTypeconstant of a v0.9 call schema);nilmeans"any".:allowed_callers—"rendererOnly","agentOnly"or"rendererOrAgent";nilwhen the catalog omits it, which the protocol defines as"rendererOnly"(v1.0).:requires_user_activation— v1.0.:description— the definition'sdescription.:is_definition— whether:schemais the whole catalog entry;nilinfers it from the schema's shape.:from_document— whether the schema was read from a catalog document (seeA2UICore.Catalog.Component).:execute—nilfor a schema-only function, else a function of(args, context)returning{:ok, value},{:ok, value, effects}or{:error, A2UICore.Error.t()}.argsare already resolved;contextis theA2UICore.Resolution.DataContextof the call.
Summary
Functions
The return type a catalog entry declares, or nil: a top-level
returnType (v1.0 and the v0.9 list form) or the const of the
call's returnType property (the v0.9 map form).
Whether the function's schema is its whole catalog entry rather than
the schema of its args: :is_definition when set, else a call
schema (properties naming call, @call or args) or one that
declares a keyword only entries write (returnType, …).
Builds a function from a catalog document entry (schema is the
function's schema object).
Attaches an implementation.
Types
@type effects() :: [A2UICore.Resolution.DataContext.effect()]
@type execute() :: (map(), A2UICore.Resolution.DataContext.t() | nil -> {:ok, term()} | {:ok, term(), effects()} | {:error, A2UICore.Error.t()})
Functions
The return type a catalog entry declares, or nil: a top-level
returnType (v1.0 and the v0.9 list form) or the const of the
call's returnType property (the v0.9 map form).
Whether the function's schema is its whole catalog entry rather than
the schema of its args: :is_definition when set, else a call
schema (properties naming call, @call or args) or one that
declares a keyword only entries write (returnType, …).
Builds a function from a catalog document entry (schema is the
function's schema object).
Options: :execute, and from_document: true for an entry read from
a document (which is then also a definition).
Attaches an implementation.