Class XMLUIParser

An XML UI parser.

Unlike BaseXMLUIParser:

  • All default widgets are pre-registered
  • <layer> elements are treated as LayerInit parameters ("layer" parameter mode)
  • Attribute values starting with a backslash are always treated as strings, with the backslash removed
  • Attribute values starting with a dollar sign are always treated as variables
  • Attribute values starting with an at sign are always treated as JSON-encoded values
  • Attributes with the lazy-widgets:options namespace will be added to an options object and passed to a widget factory
  • Attributes with the lazy-widgets:on namespace will add event listeners to a widget
  • Similarly, attributes with the lazy-widgets:once namespace will add event listeners to a widget, but with once set to true
  • A lot of built-in validators are pre-registered

Hierarchy (view full)

Constructors

Methods

  • Find the next unset parameter of a given mode.

    Parameters

    • paramConfig: WidgetXMLInputConfig

      The input mapping of the widget being built

    • parametersSet: boolean[]

      A list containing which of the parameters in the input mapping are already set

    • mode: string

      The parameter mode to find

    Returns number

    Returns the index of the next unset parameter of the wanted mode. If none are found, -1 is returned.

  • Parse a value in an attribute. The value will be deserialized according to its prefix. If there is no prefix, the value is treated as a string.

    Parameters

    • rawValue: string

      The value in the attribute, with the prefix included

    • context: XMLUIParserContext

      The current parser context, which will be passed to a deserializer if the value is prefixed with a registered deserializer prefix

    Returns unknown

  • Parse a element. Expected to contain at least one widget element, and can contain