HookCallback
type HookCallback<T> = (event) => void | Promise<void>;Defined in: src/hooks/types.ts:21
Type for callback functions that handle hook events. Callbacks can be synchronous or asynchronous.
Type Parameters
Section titled “Type Parameters”| Type Parameter |
|---|
T extends HookEvent |
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
event | T |
Returns
Section titled “Returns”void | Promise<void>
Example
Section titled “Example”const callback: HookCallback<BeforeInvocationEvent> = (event) => { console.log('Agent invocation started')}