Skip to main content

Module functions

Module functions 

Source
Expand description

Evaluating dynamic values: data bindings, function calls, and the basic catalog’s functions, with the specification’s coercion rules (“DynamicBoolean and CheckRule Coercion”) and catalog resolution (“Mixable catalogs and component resolution logic”).

A call resolves in its own catalogId, else the scope’s default catalog (the surface’s, or, inside a formatString template, the template’s), else it fails. The function must be declared by that catalog and implemented here; the basic catalog’s functions are implemented natively, whatever catalog declares them. A function that needs a user gesture runs only in a scope that has one, and an agentOnly function never runs on the renderer.

Structs§

Evaluator
Evaluates dynamic values against a set of catalogs.
Scope
Where an expression is evaluated.

Enums§

Effect
Something a function asks the renderer to do (only openUrl, so far).
EvalError
A failure while evaluating, in the specification’s error categories.

Functions§

coerce_bool
The DynamicBoolean coercion: booleans as themselves, a validation result as its valid, "true"/"false" in any case, a nonzero number as true, and everything else (other strings, null, objects, arrays) as false.
validity
A validation result’s valid, if the value is one.

Type Aliases§

LocalFunction
A function the embedder implements for its own catalog, run on the renderer: given the resolved arguments and its context, it returns a value or fails with a message (an EXECUTION_ERROR).