Class JupyterPluginRegistry<T>

Type Parameters

  • T = any

Hierarchy

  • PluginRegistry<T>
    • JupyterPluginRegistry

Constructors

Accessors

  • get application(): T
  • The application object.

    It will be provided as first argument to the plugins activation and deactivation functions.

    It can only be set once.

    By default, it is null.

    Returns T

  • set application(v: T): void
  • Parameters

    • v: T

    Returns void

  • get deferredPlugins(): string[]
  • The list of all the deferred plugins.

    Returns string[]

Methods

  • Activate the plugin with the given ID.

    Parameters

    • id: string

      The ID of the plugin of interest.

    Returns Promise<void>

    A promise which resolves when the plugin is activated or rejects with an error if it cannot be activated.

  • Activate all the deferred plugins.

    Parameters

    • kind: "defer" | "startUp"
    • Optionaloptions: IStartOptions

    Returns Promise<void>

    A promise which will resolve when each plugin is activated or rejects with an error if one cannot be activated.

  • Deactivate the plugin and its downstream dependents if and only if the plugin and its dependents all support deactivate.

    Parameters

    • id: string

      The ID of the plugin of interest.

    Returns Promise<string[]>

    A list of IDs of downstream plugins deactivated with this one.

  • Deregister a plugin with the application.

    Parameters

    • id: string

      The ID of the plugin of interest.

    • Optionalforce: boolean

      Whether to deregister the plugin even if it is active.

    Returns void

  • Get a plugin description.

    Parameters

    • id: string

      The ID of the plugin of interest.

    Returns string

    The plugin description.

  • Test whether a plugin is registered with the application.

    Parameters

    • id: string

      The ID of the plugin of interest.

    Returns boolean

    true if the plugin is registered, false otherwise.

  • Test whether a plugin is activated with the application.

    Parameters

    • id: string

      The ID of the plugin of interest.

    Returns boolean

    true if the plugin is activated, false otherwise.

  • List the IDs of the plugins registered with the application.

    Returns string[]

    A new array of the registered plugin IDs.

  • Register a plugin with the application.

    Parameters

    • plugin: IPlugin<T, any>

      The plugin to register.

      An error will be thrown if a plugin with the same ID is already registered, or if the plugin has a circular dependency.

      If the plugin provides a service which has already been provided by another plugin, the new service will override the old service.

    Returns void

  • Register multiple plugins with the application.

    Parameters

    • plugins: IPlugin<T, any>[]

      The plugins to register.

      This calls registerPlugin() for each of the given plugins.

    Returns void

  • Resolve an optional service of a given type.

    Type Parameters

    • U

    Parameters

    • token: Token<U>

      The token for the service type of interest.

    Returns Promise<null | U>

    A promise which resolves to an instance of the requested service, or null if it cannot be resolved.

    Services are singletons. The same instance will be returned each time a given service token is resolved.

    If the plugin which provides the service has not been activated, resolving the service will automatically activate the plugin.

    User code will not typically call this method directly. Instead, the optional services for the user's plugins will be resolved automatically when the plugin is activated.

  • Resolve a required service of a given type.

    Type Parameters

    • U

    Parameters

    • token: Token<U>

      The token for the service type of interest.

    Returns Promise<U>

    A promise which resolves to an instance of the requested service, or rejects with an error if it cannot be resolved.

    Services are singletons. The same instance will be returned each time a given service token is resolved.

    If the plugin which provides the service has not been activated, resolving the service will automatically activate the plugin.

    User code will not typically call this method directly. Instead, the required services for the user's plugins will be resolved automatically when the plugin is activated.