Skip to content

HookCallback

type HookCallback<T> = (event) => void | Promise<void>;

Defined in: src/hooks/types.ts:20

Type for callback functions that handle hookable events. Callbacks can be synchronous or asynchronous.

| Type Parameter | | -------------------------------------------------- | | T extends HookableEvent |

| Parameter | Type | | --------- | ---- | | event | T |

void | Promise<void>

const callback: HookCallback<BeforeInvocationEvent> = (event) => {
console.log('Agent invocation started')
}