Expand description
formatString’s template language: literal text with ${...}
interpolations, each a literal, a data binding, or a function call.
The grammar is the one every A2UI SDK parses (the specification’s “The
formatString function” and the shared suite core/expressions.yaml):
\${is a literal${; an unclosed${is an error.- Inside
${...}: a nested${...}, a quoted string ('...'or"...", with\n,\t,\r, and\xfor any otherx), a number ([+-]?(digits[.digits]|.digits)([eE][+-]?digits)?, finite),true,false,null(which reads as""), a path (characters that areXID_Continue,/,., or-; relative unless it starts with/), or a call: a name then(name: value, ...), the arguments themselves expressions.@-names (@index) must be calls. - At most
MAX_DEPTHlevels of nesting,MAX_TEMPLATE_LENGTHUTF-16 units (as JavaScript counts them), andMAX_PARTSparts, so every SDK accepts and refuses the same templates.
Structs§
- Expression
Error - A template that does not parse.
Enums§
- Part
- One piece of a parsed template.
Constants§
- MAX_
DEPTH - The deepest nesting of interpolations and call arguments.
- MAX_
PARTS - The most parts one template may produce.
- MAX_
TEMPLATE_ LENGTH - The longest template, in UTF-16 code units.
Functions§
- number_
value - A float as JSON, the way JavaScript would print it: a whole number within
i64is an integer (and-0is0), anything else a float. - parse
- Parse a template into its parts. Adjacent text stays one literal; empty literals are dropped.