Theia API Documentation v1.77.0
    Preparing search index...

    Mirrors runtime-added <style> and <link> elements from the main window's <head> into every secondary window, keeps CSSOM insertRule/deleteRule changes in sync, and propagates body class mutations.

    Elements that are already managed by dedicated services are excluded:

    • monaco-colors class stylesheets (managed by MonacoFrontendApplicationContribution)
    • contributedColorTheme ID stylesheets (managed by StylingService)
    • theia-icon-theme class stylesheets (managed by PluginIconThemeService)

    Implements

    Index
    cloneMap: Map<
        HTMLStyleElement
        | HTMLLinkElement,
        Map<Window, HTMLStyleElement | HTMLLinkElement>,
    > = ...

    Maps a main-window element to its clones in each secondary window.

    cssomRules: Map<HTMLStyleElement, { index: number; rule: string }[]> = ...

    Records of CSSOM insertRule calls keyed by the main-window style element.

    mainOriginatedClasses: Map<Window, Set<string>> = ...

    Tracks which classes this mirror has added to each secondary window's body.

    originalDeleteRule: ((index: number) => void) | undefined

    Type Declaration

    • (index: number) => void
        • (index: number): void
        • The CSSStyleSheet method deleteRule() removes a rule from the stylesheet object.

          MDN Reference

          Parameters

          • index: number

          Returns void

    • undefined
    originalInsertRule: ((rule: string, index?: number) => number) | undefined

    Original CSSStyleSheet methods, saved before monkey-patching.

    Type Declaration

    • (rule: string, index?: number) => number
        • (rule: string, index?: number): number
        • The CSSStyleSheet.insertRule() method inserts a new CSS rule into the current style sheet.

          MDN Reference

          Parameters

          • rule: string
          • Optionalindex: number

          Returns number

    • undefined
    pendingRuleSyncs: Set<{ index: number; sheet: CSSStyleSheet }> = ...

    Pending CSSOM rule re-syncs after insertRule (to capture rule.style mutations).

    pendingRuleSyncScheduled: boolean = false
    secondaryWindowService: SecondaryWindowService
    toDispose: DisposableCollection = ...

    Disposable collection for cleanup on stop.

    trackedWindows: Set<Window> = ...

    The set of currently tracked secondary windows.

    EXCLUDED_BODY_CLASSES: Set<string> = ...

    Body classes that represent per-window state and must not be mirrored.