/// /// declare namespace FxOrmHook { interface HookActionNextFunction { (this: TTHIS, err?: Error|null): any } interface HookActionCallback { (this: TTHIS, next?: HookActionNextFunction): any (this: TTHIS, arg1?: TPAYLOAD, next?: HookActionNextFunction): any } interface HookResultCallback { (this: TTHIS, success?: boolean): any (this: TTHIS, arg1?: TPAYLOAD, success?: boolean): any } interface HookTrigger{ (self: CTX_SELF, cur: FxOrmNS.Arraible, _?: RESULT_TYPE, ...args: any): void } interface HookWait{ (self: CTX_SELF, cur: FxOrmNS.Arraible>, next: FxOrmNS.GenericCallback, opts?: Fibjs.AnyObject): void } interface HookPatchOptions { /** * @default false * 'prepend': prepend old oldhook to new hook * 'append': append old oldhook to new hook * undefined: overwrite oldhook */ oldhook?: 'prepend' | 'append' | 'initial' | 'overwrite' | undefined } interface HookChannel { (name: string, handler: FTYPE): HookChannelResults (handler: FTYPE): HookChannelResults (name?: string): HookChannelResults } type HookTuple = [FTYPE, (fn: FTYPE, ...args: any) => any] interface HookChannelResults extends HookTuple { run: (...args: any) => any set: (fn: Function, ...args: any) => any } }