Extension
An extension’s exported shape: blips (update), tools, or both. Build one with defineExtension.
Properties
Section titled “Properties”tools?
Section titled “tools?”
optionaltools?:Record<string,Tool>
Tools for the notch’s tool tray, keyed by name (the tool’s id becomes
<extensionId>/<name>). Declare each with tool({...}). See “Tools” in the
extension authoring guide.
Methods
Section titled “Methods”onAction()?
Section titled “onAction()?”
optionalonAction(ctx,action):Promise<void>
Runs when a surface invokes one of this extension’s actions.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
ctx |
Context |
action |
ActionEvent |
Returns
Section titled “Returns”Promise<void>
onEvent()?
Section titled “onEvent()?”
optionalonEvent(ctx,event):Promise<void>
Runs when a webhook or a watched file fires. Only called if the manifest declares that trigger.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
ctx |
Context |
event |
HostEvent |
Returns
Section titled “Returns”Promise<void>
update()?
Section titled “update()?”
optionalupdate(ctx):Promise<void|UpdateResult>
Runs on launch, on the manifest’s interval, on a manual run, and after a preferences
change. Optional for an extension that only contributes tools.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
ctx |
Context |
Returns
Section titled “Returns”Promise<void | UpdateResult>