Type Alias: HookableEvents<T>
ts
type HookableEvents<T> = {
[K in keyof T]: T[K] extends (args: infer P) => boolean | void
? [callbackArgs: [...P], cleanupCallbackArgs: [error: Error | null, ...P]]
: never;
};Converts emit validators/functions into hookable events with cleanup support. Each event gets a tuple of [callbackArgs, cleanupCallbackArgs] to support hook lifecycle.
Type Parameters
| Type Parameter | Description |
|---|---|
T extends | EmitValidators | EmitFunctions<EmitValidators> | The emit validators or functions type |