UNPKG

call-hooks

Version:

Function for adding before/after/call/arguments/result hooks to another function.

12 lines (11 loc) 332 B
type Args = any[]; type Result = any; type This = any; type Hooks = { args?: (args: Args) => Args; before?: (args: Args) => void; call?: (args: Args) => Result; result?: (args: Args, result: Result) => Result; after?: (args: Args, result: Result | unknown) => void; }; export type { Args, Result, This, Hooks };