Interface: IAutomationPlugin<TEventData>
Contract implemented by addons whose manifest type is automation.
Example
class ExampleAddon implements IAutomationPlugin {
async onInit(api: IPluginAPI) {
api.logger.info('Initialized');
}
async onEvent(event: SystemEventContext) {
// Handle subscribed events.
}
}
Type Parameters
TEventData
TEventData = unknown
Methods
onInit()
onInit(
api):Promise<void>
Called once after the host creates the addon script instance.
Parameters
api
Returns
Promise<void>
onEvent()
onEvent(
event):Promise<void>
Called when an event declared in the manifest is delivered.
Parameters
event
SystemEventContext<TEventData>
Returns
Promise<void>
onAction()?
optionalonAction(params,actionId):Promise<void>
Called when the user invokes an action declared in the manifest.
Parameters
params
actionId
string
Returns
Promise<void>