Skip to main content
Version: 1.x

PluginCommon

PluginCommon​

Base class for CommandKit plugins.

Signature
class PluginCommon<T extends PluginOptions = PluginOptions, C extends CommonPluginRuntime = CommonPluginRuntime> {
public abstract readonly type: PluginType;
public readonly id = randomUUID();
public readonly loadedAt = Date.now();
public abstract readonly name: string;
constructor(options: T)
activate(ctx: C) => Promise<void>;
deactivate(ctx: C) => Promise<void>;
}

type​

property

The type of the plugin, either Compiler or Runtime.

id​

property

Unique identifier for the plugin instance.

loadedAt​

property

The time when the plugin was loaded, in milliseconds since the Unix epoch.

name​

property
string

The name of the plugin.

constructor​

method
(options: T) => PluginCommon

Creates a new instance of the plugin.

activate​

method
(ctx: C) => Promise<void>

Called when this plugin is activated

deactivate​

method
(ctx: C) => Promise<void>

Called when this plugin is deactivated