Trilium Frontend API
    Preparing search index...

    Interface CustomElementRegistry

    The CustomElementRegistry interface provides methods for registering custom elements and querying registered elements. To get an instance of it, use the window.customElements property.

    MDN Reference

    interface CustomElementRegistry {
        define(
            name: string,
            constructor: CustomElementConstructor,
            options?: ElementDefinitionOptions,
        ): void;
        get(name: string): CustomElementConstructor;
        getName(constructor: CustomElementConstructor): string;
        initialize(root: Node): void;
        upgrade(root: Node): void;
        whenDefined(name: string): Promise<CustomElementConstructor>;
    }
    Index

    Methods

    • Parameters

      Returns void

    • The upgrade() method of the CustomElementRegistry interface upgrades all shadow-containing custom elements in a Node subtree, even before they are connected to the main document.

      MDN Reference

      Parameters

      Returns void

    • The whenDefined() method of the CustomElementRegistry interface returns a Promise that resolves when the named element is defined.

      MDN Reference

      Parameters

      • name: string

      Returns Promise<CustomElementConstructor>