Skip to main content
Version: Next

CommandKitPluginRuntime

CommandKitPluginRuntime

Represents the runtime environment for CommandKit plugins.

Signature
class CommandKitPluginRuntime {
constructor(commandkit: CommandKit)
getPlugins() => ;
getPlugin(pluginName: string) => RuntimePlugin | null;
get(plugin: T) => InstanceType<T> | null;
softRegisterPlugin(plugin: RuntimePlugin) => ;
registerPlugin(plugin: RuntimePlugin) => ;
unregisterPlugin(plugin: RuntimePlugin) => ;
unregisterAllPlugins() => ;
capture() => ;
execute(f: AsyncFunction<[CommandKitPluginRuntime, RuntimePlugin], R | undefined>) => ;
}

constructor

method
(commandkit: CommandKit) => CommandKitPluginRuntime

Creates a new instance of CommandKitPluginRuntime.

getPlugins

method
() =>

Returns the plugins registered in this runtime.

getPlugin

method
(pluginName: string) => RuntimePlugin | null

Checks if there are no plugins registered in this runtime.

get

method
(plugin: T) => InstanceType<T> | null

Fetches the given plugin

softRegisterPlugin

method
(plugin: RuntimePlugin) =>

Soft registers a plugin in the runtime.

registerPlugin

method
(plugin: RuntimePlugin) =>

Registers a plugin in the runtime.

unregisterPlugin

method
(plugin: RuntimePlugin) =>

Unregisters a plugin from the runtime.

unregisterAllPlugins

method
() =>

Unregisters all plugins from the runtime.

capture

method
() =>

Signals the runtime to allow the current plugin take ownership of the execution context.

execute

method

Executes a function for each plugin in the runtime.