Element interface for Composed Mode. Represents a node in the backend node tree.

interface Element {
    __wxElement?: glassEasel.Element;
    addClass(elementClass, styleScope?): void;
    appendChild(child): void;
    associateValue(v): void;
    createIntersectionObserver?(relativeElement, relativeElementMargin, thresholds, listener): Observer;
    createResizeObserver?(mode, listener): Observer;
    getAllComputedStyles?(cb): void;
    getBoundingClientRect?(cb): void;
    getBoxModel?(cb): void;
    getContext?(cb): void;
    getInheritedRules?(cb): void;
    getMatchedRules?(cb): void;
    getPartialComputedStyles?(properties, cb): void;
    getPartialPseudoComputedStyles?(pseudoType, properties, cb): void;
    getPseudoComputedStyles?(pseudoType, cb): void;
    getPseudoMatchedRules?(pseudoType, cb): void;
    getPseudoTypes?(cb): void;
    getScrollOffset?(cb): void;
    insertBefore(child, before, index?): void;
    manipulateNativeNode?(action, args, cb): void;
    release(): void;
    removeAttribute(name): void;
    removeChild(child, index?): void;
    removeClass(elementClass, styleScope?): void;
    replaceChild(child, oldChild, index?): void;
    setAttribute(name, value): void;
    setId(id): void;
    setListenerStats(type, capture, mutLevel): void;
    setModelBindingStat(attributeName, listener): void;
    setScrollPosition?(scrollLeft, scrollTop, duration): void;
    setStyle(styleText): void;
    setStyleScope(styleScope, extraStyleScope?, hostStyleScope?): void;
    setText(content): void;
    spliceAppend(list): void;
    spliceBefore(before, deleteCount, list): void;
    spliceRemove(before, deleteCount): void;
    triggerNativeEvent?(type, detail): void;
}

Hierarchy

Properties

__wxElement?: glassEasel.Element

Internal reference to the glass-easel element.

Methods

  • Add a class to this node. If styleScope is not a non-negative integer, it is treated as empty. When matching style rules using this class, the style sheet's scope identifier must be empty or equal to this styleScope. Not called on text nodes.

    Parameters

    • elementClass: string
    • Optional styleScope: number

    Returns void

  • Append a child node. The inserted child is guaranteed to have no parent.

    Returns void

  • Notify that node-related information has been created and set an associated value. Called exactly once on each created node (except text nodes, which are not called).

    Parameters

    Returns void

  • Parameters

    • relativeElement: null | glassEasel.composedBackend.Element
    • relativeElementMargin: string
    • thresholds: number[]
    • listener: ((res) => void)
        • (res): void
        • Parameters

          • res: IntersectionStatus

          Returns void

    Returns Observer

  • Parameters

    • mode: ResizeObserverMode
    • listener: ((res) => void)
        • (res): void
        • Parameters

          • res: ResizeStatus

          Returns void

    Returns Observer

  • Parameters

    • cb: ((res) => void)
        • (res): void
        • Parameters

          • res: GetAllComputedStylesResponses

          Returns void

    Returns void

  • Parameters

    Returns void

  • Parameters

    • cb: ((res) => void)
        • (res): void
        • Parameters

          • res: unknown

          Returns void

    Returns void

  • Parameters

    • cb: ((res) => void)
        • (res): void
        • Parameters

          • res: GetInheritedRulesResponses

          Returns void

    Returns void

  • Parameters

    • cb: ((res) => void)
        • (res): void
        • Parameters

          • res: GetMatchedRulesResponses

          Returns void

    Returns void

  • Parameters

    • properties: string[]
    • cb: ((res) => void)
        • (res): void
        • Parameters

          • res: GetAllComputedStylesResponses

          Returns void

    Returns void

  • Parameters

    • pseudoType: string
    • properties: string[]
    • cb: ((res) => void)
        • (res): void
        • Parameters

          • res: GetAllComputedStylesResponses

          Returns void

    Returns void

  • Parameters

    • pseudoType: string
    • cb: ((res) => void)
        • (res): void
        • Parameters

          • res: GetAllComputedStylesResponses

          Returns void

    Returns void

  • Parameters

    • pseudoType: string
    • cb: ((res) => void)
        • (res): void
        • Parameters

          • res: GetMatchedRulesResponses

          Returns void

    Returns void

  • Parameters

    • cb: ((res) => void)
        • (res): void
        • Parameters

          • res: string[]

          Returns void

    Returns void

  • Parameters

    Returns void

  • Insert a child node. Behavior varies by parameters:

    • Without before and index: equivalent to append.
    • With before or index: insert before that position.
    • With both before and index: index must equal before's position in the child list. If index is not a non-negative integer, it is treated as undefined. The inserted child is guaranteed to have no parent.

    Parameters

    Returns void

  • Parameters

    • action: string
    • args: unknown
    • cb: ((res) => void)
        • (res): void
        • Parameters

          • res: unknown

          Returns void

    Returns void

  • Release this node.

    Returns void

  • Remove an attribute from this node. Not called on text nodes.

    Parameters

    • name: string

    Returns void

  • Remove a child node. The removed child may be reused later. If index is provided, it must equal the child's position in the child list. If index is not a non-negative integer, it is treated as undefined.

    Parameters

    Returns void

  • Remove the specified class (if both name and styleScope match). If styleScope is not a non-negative integer, it is treated as empty. Not called on text nodes.

    Parameters

    • elementClass: string
    • Optional styleScope: number

    Returns void

  • Replace a child node. Behavior varies by parameters:

    • Without oldChild and index: equivalent to append.
    • With oldChild or index: replace that child.
    • With both oldChild and index: index must equal oldChild's position in the child list. If index is not a non-negative integer, it is treated as undefined. The inserted child is guaranteed to have no parent.

    Parameters

    Returns void

  • Set an attribute on this node. value can be any type. Not called on text nodes.

    Parameters

    • name: string
    • value: unknown

    Returns void

  • Set the node ID.

    Parameters

    • id: string

    Returns void

  • Sync event listener settings on this node. type is the event name; capture indicates whether this is a capture listener; mutLevel indicates the event response type:

    • MutLevel.None: normal response.
    • MutLevel.Mut: mutual-exclusive response; only the first mutual-exclusive listener is executed in a single event bubble round.
    • MutLevel.Final: final response; stops event bubbling and prevents default behavior. Not called on text nodes.

    Parameters

    Returns void

  • Sync data binding settings on this node. attributeName is the field name; listener is the data binding update callback. Only called on normal nodes.

    Parameters

    • attributeName: string
    • listener: null | ((newValue) => void)

    Returns void

  • Parameters

    • scrollLeft: number
    • scrollTop: number
    • duration: number

    Returns void

  • Set the style of this node. Not called on text nodes.

    Parameters

    • styleText: string

    Returns void

  • Set the scope identifiers of this node. Set at most once per node. If styleScope is not a positive integer, it is treated as empty. When matching style rules using selectors other than class (e.g. tag name or ID selectors), the style sheet's scope identifier must be empty or equal to this node's scope identifier. Composed Mode only.

    Parameters

    • styleScope: number
    • Optional extraStyleScope: number
    • Optional hostStyleScope: number

    Returns void

  • Set the text content. Only called on text nodes.

    Parameters

    • content: string

    Returns void

  • Append all nodes contained in list. list must be a fragment node; it should be cleared but may be reused. All inserted nodes are guaranteed to have no parent.

    Returns void

  • Remove deleteCount nodes starting from before, then insert all nodes from list at that position. list must be a fragment node; it should be cleared but may be reused. All inserted nodes are guaranteed to have no parent.

    Parameters

    Returns void

  • Remove deleteCount nodes starting from before.

    Parameters

    Returns void

  • Parameters

    • type: string
    • detail: unknown

    Returns void