import { IMethodDecorator, MetadataAdapter, MetadataExtends } from '@ts-ioc/core'; import { AdviceMetadata } from '../metadatas'; /** * advice decorator for method. * * @export * @interface IAdviceDecorator * @extends {IMethodDecorator} * @template T */ export interface IAdviceDecorator extends IMethodDecorator { /** * define advice with params. * * ### Usage * - path or module name, match express. * - `execution(moduelName.*.*(..)) || @annotation(DecortorName) || @within(ClassName)` * - `execution(moduelName.*.*(..)) && @annotation(DecortorName) && @within(ClassName)` * * ``` * @Aspect() * class AspectClass { * @Advice('"execution(moduelName.*.*(..)")') * process(joinPoint: JointPoint){ * } * } * ``` * * - match method with a decorator annotation. * * ``` * @Aspect() * class AspectClass { * @Advice('@annotation(DecoratorName)') * process(joinPoint: JointPoint){ * } * } * ``` * * @param {(string | RegExp)} [pointcut] define advice match express for pointcut. * @param { string } [annotation] annotation name, special annotation metadata for annotation advices. */ (pointcut?: string | RegExp, annotation?: string): MethodDecorator; /** * define advice with metadata map. * @param {T} [metadata] */ (metadata?: T): MethodDecorator; } export declare function createAdviceDecorator(adviceName: string, adapter?: MetadataAdapter, afterPointcutAdapter?: MetadataAdapter, metadataExtends?: MetadataExtends): IAdviceDecorator; /** * aop advice decorator. * * @Advice */ export declare const Advice: IAdviceDecorator;