A2UICore.Functions.Basic (A2UICore v0.1.1)

Copy Markdown View Source

Implementations of the basic catalog's functions.

implementations/2 returns %{name => execute} for a protocol version; A2UICore.Catalog.Basic attaches them to the published catalog document. Each execute takes the resolved arguments and the A2UICore.Resolution.DataContext of the call and returns {:ok, value} or {:error, %A2UICore.Error{category: :expression}}.

Version differences follow the reference:

  • v0.9 validators (required, regex, length, numeric, email) return booleans; v1.0 validators return a validation result %{"valid" => boolean} (email adds code, message, severity on failure);
  • v1.0 and/or/not treat a map with a boolean "valid" as true/false by validity; v0.9 treats it as an ordinary object;
  • v1.0 resolves formatString interpolations with @path/@call.

Locale-sensitive formatting goes through A2UICore.Formatter (:formatter option, default A2UICore.Formatter.Default).

Summary

Functions

The function implementations of the basic catalog of version.

Functions

implementations(version, options \\ [])

(since 0.1.0)
@spec implementations(String.t(), keyword()) :: %{
  optional(String.t()) => A2UICore.Catalog.Function.execute()
}

The function implementations of the basic catalog of version.

Options: :formatter — an A2UICore.Formatter module.