Functions
getPlugin
- getPlugin(pluginId: string): Plugin<any> | undefined
- getPlugin<T>(pluginId: string): Plugin<T> | undefined
-
Parameters
Returns Plugin<any>
|
undefined
An plug-in or undefined
.
-
Type parameters
Parameters
Returns Plugin<T>
|
undefined
An plug-in or undefined
.
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));