An empty backend implementation

Implements

Constructors

Properties

mode: Shadow

Protocol mode. Always BackendMode.Shadow 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 fragment node. Used to represent a node array for batch insertion and removal.

    Returns EmptyBackendElement

  • 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 Shadow Mode, the root node must be a component root node.

    Returns EmptyBackendShadowRootContext

  • 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. Shadow Mode only; for Composed Mode see the other onEvent signature.

    Parameters

    • _createEvent: ((type, detail, options) => Event<unknown>)

      Creates an event object from the given type, detail, and options.

        • (type, detail, options): Event<unknown>
        • Parameters

          Returns Event<unknown>

    • _listener: ((event, currentTarget, mark, target, isCapture) => EventBubbleStatus)

      Called when an event occurs.

    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