An empty backend implementation

Implements

Constructors

Properties

mode: Composed

Protocol mode. Always BackendMode.Composed in this protocol.

Methods

  • Insert a style sheet item whose content comes from the specified path. styleScope is an optional scope identifier. Returns the new style sheet index. If styleScope is not a positive integer, it is treated as empty (globally effective).

    Parameters

    • _path: string
    • Optional _styleScope: number

    Returns number

  • Create a normal node. Composed Mode only.

    Parameters

    • _tagName: string

      The node's own defined name.

    • _stylingName: string

      The alias set when used.

    Returns EmptyComposedBackendElement

  • Create a fragment node. Used to represent a node array for batch insertion and removal.

    Returns EmptyComposedBackendElement

  • Parameters

    • _status: MediaQueryStatus
    • _listener: ((res) => void)
        • (res): void
        • Parameters

          • res: {
                matches: boolean;
            }
            • matches: boolean

          Returns void

    Returns Observer

  • Create a text node. Composed Mode only.

    Parameters

    • _tagName: string

    Returns EmptyComposedBackendElement

  • Destroy this Context instance. glass-easel does not call this directly; other modules should call it.

    Returns void

  • Disable an inserted style sheet.

    Parameters

    • _index: number

    Returns void

  • Get the device pixel ratio of this Context.

    Returns number

  • Get the root node. In Composed Mode, the root node must be a normal node.

    Returns EmptyComposedBackendElement

  • Get the current theme of this Context, typically "light" or "dark".

    Returns string

  • Get the display area height of this Context.

    Returns number

  • Get the display area width of this Context.

    Returns number

  • Set the global event callback. This callback is the only one. Composed Mode only; for Shadow Mode see the other onEvent signature.

    Parameters

    Returns void

  • Register a style sheet. path is the style sheet path, content is the corresponding CSS style sheet in a format the backend can interpret. If the CSS contains @import or similar references, the referenced content may also be registered via another registerStyleSheetContent call, either before or after this one.

    Parameters

    • _path: string
    • _content: unknown

    Returns void

  • Wait for the next render to complete (align with the backend vsync). The backend must ensure the callback is asynchronous. Setting new properties inside the callback should trigger CSS transitions.

    Parameters

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

          • err: null | Error

          Returns void

    Returns void