Class PluginInvokeSupport
              
                  Implements
              
           
           
           Index
Constructors
Accessors
Methods
Constructors
constructor
- Create PluginInvokeSupport - Parameters- pluginManager: PluginManagerThe plugin manager to associate. 
 - Returns PluginInvokeSupport
- pluginManager: PluginManager
Accessors
isDestroyed 
- get isDestroyed(): booleanReturns whether the associated plugin manager has been destroyed. Returns booleanReturns whether the plugin manager has been destroyed. 
options
- Returns the associated plugin manager options. - Returns PluginManagerOptions- The associated plugin manager options. 
pluginManager 
Methods
destroy
getMethodNames  
- getMethodNames(
 opts?: {
 enabled?: boolean;
 plugins?: string | Iterable<string, any, any>;
 },
 ): string[]Returns method names for a specific plugin, list of plugins, or all plugins. The enabled state can be specified along with sorting methods by plugin name. Parameters- Optionalopts: { enabled?: boolean; plugins?: string | Iterable<string, any, any> }- Options object. If undefined all plugin data is returned. - Optionalenabled?: boolean- If enabled is a boolean it will return plugin methods names given the respective enabled state. 
- Optionalplugins?: string | Iterable<string, any, any>- Plugin name or iterable list of names. 
 
 Returns string[]A list of method names 
hasMethod 
- Checks if the provided method name exists across all plugins or specific plugins if defined. - Parameters- Returns boolean- True method is found.
 
invoke
- invoke(
 opts: {
 args?: any[];
 method: string;
 plugins?: string | Iterable<string, any, any>;
 },
 ): voidThis dispatch method simply invokes any plugin targets for the given method name. Parameters- opts: { args?: any[]; method: string; plugins?: string | Iterable<string, any, any> }Options object. - Optionalargs?: any[]- Method arguments. This array will be spread as multiple arguments. 
- method: string- Method name to invoke. 
- Optionalplugins?: string | Iterable<string, any, any>- Specific plugin name or iterable list of plugin names to invoke. 
 
 Returns void
- opts: { args?: any[]; method: string; plugins?: string | Iterable<string, any, any> }
invokeAsync 
- invokeAsync(
 opts: {
 args?: any[];
 method: string;
 plugins?: string | Iterable<string, any, any>;
 },
 ): Promise<any>This dispatch method is asynchronous and adds any returned results to an array which is resolved via Promise.all Any target invoked may return a Promise or any result. Parameters- opts: { args?: any[]; method: string; plugins?: string | Iterable<string, any, any> }Options object. - Optionalargs?: any[]- Method arguments. This array will be spread as multiple arguments. 
- method: string- Method name to invoke. 
- Optionalplugins?: string | Iterable<string, any, any>- Specific plugin name or iterable list of plugin names to invoke. 
 
 Returns Promise<any>A single result or array of results. 
- opts: { args?: any[]; method: string; plugins?: string | Iterable<string, any, any> }
invokeAsyncEvent  
- invokeAsyncEvent(
 opts: {
 copyProps?: object;
 method: string;
 passthruProps?: object;
 plugins?: string | Iterable<string, any, any>;
 },
 ): Promise<object>This dispatch method synchronously passes to and returns from any invoked targets a PluginEvent. Parameters- opts: {
 copyProps?: object;
 method: string;
 passthruProps?: object;
 plugins?: string | Iterable<string, any, any>;
 }Options object. - OptionalcopyProps?: object- Properties that are copied. 
- method: string- Method name to invoke. 
- OptionalpassthruProps?: object- Properties that are passed through. 
- Optionalplugins?: string | Iterable<string, any, any>- Specific plugin name or iterable list of plugin names to invoke. 
 
 Returns Promise<object>The PluginEvent data. 
- opts: {
invokeSync 
- invokeSync(
 opts: {
 args?: any[];
 method: string;
 plugins?: string | Iterable<string, any, any>;
 },
 ): anyThis dispatch method synchronously passes back a single value or an array with all results returned by any invoked targets. Parameters- opts: { args?: any[]; method: string; plugins?: string | Iterable<string, any, any> }Options object. - Optionalargs?: any[]- Method arguments. This array will be spread as multiple arguments. 
- method: string- Method name to invoke. 
- Optionalplugins?: string | Iterable<string, any, any>- Specific plugin name or iterable list of plugin names to invoke. 
 
 Returns anyA single result or array of results. 
- opts: { args?: any[]; method: string; plugins?: string | Iterable<string, any, any> }
invokeSyncEvent  
- invokeSyncEvent(
 opts: {
 copyProps?: object;
 method: string;
 passthruProps?: object;
 plugins?: string | Iterable<string, any, any>;
 },
 ): objectThis dispatch method synchronously passes to and returns from any invoked targets a PluginEvent. Parameters- opts: {
 copyProps?: object;
 method: string;
 passthruProps?: object;
 plugins?: string | Iterable<string, any, any>;
 }Options object. - OptionalcopyProps?: object- Properties that are copied. 
- method: string- Method name to invoke. 
- OptionalpassthruProps?: object- Properties that are passed through. 
- Optionalplugins?: string | Iterable<string, any, any>- Specific plugin name or iterable list of plugin names to invoke. 
 
 Returns objectThe PluginEvent data. 
- opts: {
setEventbus 
- setEventbus(
 opts: {
 newEventbus: Eventbus;
 newPrepend: string;
 oldEventbus: Eventbus;
 oldPrepend: string;
 },
 ): voidSets the eventbus associated with this plugin manager. If any previous eventbus was associated all plugin manager events will be removed then added to the new eventbus. If there are any existing plugins being managed their events will be removed from the old eventbus and then onPluginLoadwill be called with the new eventbus.ParametersReturns void
setOptions 
- Set optional parameters. - Parameters- options: PluginManagerOptionsDefines optional parameters to set. 
 - Returns void
- options: PluginManagerOptions
PluginInvokeSupport adds direct method invocation support to PluginManager via the eventbus and alternately through a wrapped instance of PluginManager depending on the use case.
There are two types of invocation methods the first spreads an array of arguments to the invoked method. The second constructs a PluginInvokeEvent to pass to the method with a single parameter.
TODO: more info and wiki link
When added to a PluginManager through constructor initialization the following events are registered on the plugin manager eventbus:
plugins:async:invoke- PluginInvokeSupport#invokeAsyncplugins:async:invoke:event- PluginInvokeSupport#invokeAsyncEventplugins:get:method:names- PluginInvokeSupport#getMethodNamesplugins:has:method- PluginInvokeSupport#hasMethodplugins:invoke- PluginInvokeSupport#invokeplugins:sync:invoke- PluginInvokeSupport#invokeSyncplugins:sync:invoke:event- PluginInvokeSupport#invokeSyncEventExample