import type { JoinPoint } from '@midwayjs/core'; import { type Application } from '../types.js'; import type { DecoratorExecutorParamBase, DecoratorHandlerBase } from './custom-decorator.types.js'; import { AopLifeCycle } from './custom-decorator.types.js'; export interface DecoratorHandlerInternal { readonly app: Application; [AopLifeCycle.genExecutorParam](options: DecoratorExecutorParamBase): DecoratorExecutorParamBase | Promise; [AopLifeCycle.before](options: DecoratorExecutorParamBase): void | Promise; [AopLifeCycle.around](options: DecoratorExecutorParamBase): unknown; [AopLifeCycle.afterReturn](options: DecoratorExecutorParamBase): unknown; [AopLifeCycle.afterThrow](options: DecoratorExecutorParamBase): void; [AopLifeCycle.after](options: DecoratorExecutorParamBase): void; } export interface CustomIMethodAspect { before?: (joinPoint: JoinPoint) => unknown; around?: (joinPoint: JoinPoint) => unknown; afterReturn?: (joinPoint: JoinPoint, result: unknown) => unknown; afterThrow?: (joinPoint: JoinPoint, error: Error) => unknown; after?: (joinPoint: JoinPoint, result: unknown, error: Error | undefined) => unknown; } export interface AopDispatchOptions { methodResult?: DecoratorExecutorParamBase['methodResult']; error?: DecoratorExecutorParamBase['error']; } export declare function removeDecoratorExecutorParamCache(src: DecoratorExecutorParamBase['methodArgs']): void; /** * @description decoratorHandlerInstance will be add property `ctx` to itself */ export declare function prepareOptions(aopName: AopLifeCycle, options: DecoratorExecutorParamBase, joinPoint: JoinPoint, decoratorHandlerInstance: DecoratorHandlerBase, extParam: AopDispatchOptions): DecoratorExecutorParamBase | Promise; export declare function processAllErrorAsync(decoratorHandlerInstance: DecoratorHandlerInternal, executorParam: DecoratorExecutorParamBase, error: unknown): Promise; export declare function processAllErrorSync(decoratorHandlerInstance: DecoratorHandlerInternal, executorParam: DecoratorExecutorParamBase, error: unknown): void;