Options
All
  • Public
  • Public/Protected
  • All
Menu

Namespace plugins

Namespace for dealing with installed plug-ins. Plug-ins are represented by an plug-in-interface which enables reflection on them.

Plug-in writers can provide APIs to other plug-ins by returning their API public surface from the start-call.

export function start() {
let api = {
sum(a, b) {
return a + b;
},
mul(a, b) {
return a * b;
}
};
// 'export' public api-surface
return api;
}
let mathExt = plugins.getPlugin('genius.math');
let importedApi = mathExt.exports;

console.log(importedApi.mul(42, 1));

Index

Variables

Functions

Variables

all: Plugin<any>[]

All plug-ins currently known to the system.

Functions

  • getPlugin(pluginId: string): Plugin<any> | undefined
  • getPlugin<T>(pluginId: string): Plugin<T> | undefined
  • Get an plug-in by its full identifier in the form of: publisher.name.

    Parameters

    • pluginId: string

      An plug-in identifier.

    Returns Plugin<any> | undefined

    An plug-in or undefined.

  • Get an plug-in its full identifier in the form of: publisher.name.

    Type Parameters

    • T

    Parameters

    • pluginId: string

      An plug-in identifier.

    Returns Plugin<T> | undefined

    An plug-in or undefined.

  • An event which fires when plugins.all changes. This can happen when extensions are installed, uninstalled, enabled or disabled.

    Parameters

    • listener: ((e: void) => any)
        • (e: void): any
        • Parameters

          • e: void

          Returns any

    • Optional thisArgs: any
    • Optional disposables: Disposable[]

    Returns Disposable