UNPKG

@itwin/core-frontend

Version:
44 lines 1.75 kB
/** @packageDocumentation * @module Extensions */ import type { ExtensionProvider } from "./Extension"; /** The Extension Admin controls the list of currently loaded Extensions. * * @alpha */ export declare class ExtensionAdmin { /** Defines the set of extensions that are currently known and can be invoked during activation events. */ private _extensions; private _hosts; /** Fired when an Extension has been added or removed. * @internal */ onStartup: () => Promise<void>; constructor(); /** * Adds an extension. * The manifest will be fetched and the extension will be activated on an activation event. * @param provider * @alpha */ addExtension(provider: ExtensionProvider): Promise<void>; /** * Adds a list of extensions * @param providers * @alpha */ addExtensions(providers: ExtensionProvider[]): Promise<void[]>; /** * Registers a hostname for an extension. * Once a hostname has been registered, only remote extensions from registered hosts are permitted to be added. * @param hostUrl (string) Accepts both URLs and hostnames (e.g., http://localhost:3000, yourdomain.com, https://www.yourdomain.com, etc.). */ registerHost(hostUrl: string): void; /** Returns the hostname of an input string. Throws an error if input is not a valid hostname (or URL). */ private getHostName; /** Loops over all enabled Extensions and triggers each one if the provided event is defined. */ private activateExtensionEvents; /** Executes the extension. Catches and logs any errors (so that an extension will not crash the main application). */ private _execute; } //# sourceMappingURL=ExtensionAdmin.d.ts.map