Skip to main content

Call Signature

Build a single hook registration entry. Plumbed into a session’s runtimeConfig.hooks at create time and dispatched through the control channel.

Type Parameters

Event

Event extends HookEventName

Parameters

event

Event

callback

HookCallback<Event>

Returns

Partial<HookRegistration>

Call Signature

Build a single hook registration entry. Plumbed into a session’s runtimeConfig.hooks at create time and dispatched through the control channel.

Type Parameters

Event

Event extends HookEventName

Parameters

event

Event

callback

HookCallback<Event>

options

Omit<HookEntry<Event>, "callback" | "matcher">

Returns

Partial<HookRegistration>

Call Signature

Build a single hook registration entry. Plumbed into a session’s runtimeConfig.hooks at create time and dispatched through the control channel.

Type Parameters

Event

Event extends HookEventName

Parameters

event

Event

matcher

string | RegExp

callback

HookCallback<Event>

options?

Omit<HookEntry<Event>, "callback" | "matcher">

Returns

Partial<HookRegistration>