export interface TryCatchFinallyContext any = (this: any, ...args: any[]) => any> { func: TFunc; funcArgs: Parameters; funcThis: ThisParameterType; result?: ReturnType | Awaited>; error?: unknown; stage: 'try' | 'success' | 'catch' | 'finally'; } export interface TryCatchFinallyHook = TryCatchFinallyContext<(...args: any[]) => any>> { onTry?(ctx: TContext): void | (() => void); onSuccess?(ctx: TContext): void | (() => void); onCatch?(ctx: TContext): void | (() => void); onFinally?(ctx: TContext): void | (() => void); getPriority?(ctx: TContext): number | void; } export type FuncFromTryCatchFinallyContext> = TWrapContext extends TryCatchFinallyContext ? TFunc : never; export declare const DefaultHookPriority = 0; export declare function wrapTryCatchFinallyPromisable any, TContext extends TryCatchFinallyContext = TryCatchFinallyContext, THooks extends TryCatchFinallyHook[] = TryCatchFinallyHook[]>(func: TFunc, getHooks: (ctx: TContext) => THooks, onHookError?: (e: unknown) => unknown | undefined): TFunc; export type Awaited = T extends null | undefined ? T : T extends object & { then(onfulfilled: infer F, ...args: infer _): any; } ? F extends (value: infer V, ...args: infer _) => any ? Awaited : never : T;