import { InstanceMethodPointcut, InstancePropertyPointcut, Pointcut, StaticMethodPointcut, StaticPropertyPointcut } from './metadata'; import { ArgumentTypes, ReturnType } from './utils'; /** * A joinpoint who invokes the advice and can be restored to the origin method. */ export interface Joinpoint extends Function { (...args: any[]): any; restore(): void; } /** * Abstract base class for all joinpoint contexts */ export declare abstract class AbstractJoinpointContext = Pointcut> { protected readonly context: CONTEXT; protected readonly property: string; protected readonly pointcut: P; constructor(context: CONTEXT, property: string, pointcut: P); /** * Returns the invoking context, usually `this`. */ getContext(): CONTEXT; /** * Returns the method or property name */ getProperty(): string; /** * Returns the pointcut annotation */ getPointcut(): P; } /** * Joinpoint context for method advices */ export declare class JoinpointContext, RESULT = ReturnType> extends AbstractJoinpointContext | StaticMethodPointcut> { protected args: ARGS; protected readonly target?: Function; protected result?: RESULT; constructor(args: ARGS, context: CONTEXT, property: string, pointcut: InstanceMethodPointcut | StaticMethodPointcut, target?: Function); /** * Returns all arguments */ getArguments(): ARGS; /** * Returns the argument at index `index` */ getArgument(index: 0): ARGS[0] | undefined; getArgument(index: 1): ARGS[1] | undefined; getArgument(index: 2): ARGS[2] | undefined; getArgument(index: 3): ARGS[3] | undefined; getArgument(index: 4): ARGS[4] | undefined; getArgument(index: 5): ARGS[5] | undefined; getArgument(index: 6): ARGS[6] | undefined; getArgument(index: 7): ARGS[7] | undefined; getArgument(index: 8): ARGS[8] | undefined; getArgument(index: 9): ARGS[9] | undefined; getArgument(index: number): any | undefined; getArgument(index: Index): ARGS[Index] | undefined; /** * Set a specific argument */ setArgument(index: Index, arg: ARGS[Index]): this; /** * Returns the method result */ getResult(): RESULT | undefined; /** * Set/overwrites the method result */ setResult(result: RESULT): this; /** * Invoke the origin method, only applicable on `Around` advices */ proceed(): any; } export declare abstract class PropertyJoinpointContext extends AbstractJoinpointContext | StaticPropertyPointcut> { } /** * Joinpoint context for getter advices */ export declare class GetterJoinpointContext extends PropertyJoinpointContext { protected readonly getter: Function; constructor(context: any, property: string, pointcut: InstancePropertyPointcut | StaticPropertyPointcut, getter: Function); /** * Returns the value of the origin getter */ getValue(): T; } /** * Joinpoint context for setter advices */ export declare class SetterJoinpointContext extends PropertyJoinpointContext { protected readonly setter: Function; protected readonly argument: T; constructor(context: any, property: string, pointcut: InstancePropertyPointcut | StaticPropertyPointcut, setter: Function, argument: T); /** * Set the value by calling the origin setter */ setValue(value: T): void; /** * Returns the setter argument value */ getArgument(): T; /** * Calls origin setter with argument */ proceed(): T; } export declare class AopManager { /** * Install all advices of the given aspects */ install(aspects: any[]): void; protected installMethodAdvices(aspect: any, adviceName: string, annotation: InstanceMethodPointcut): void; protected installStaticMethodAdvices(aspect: any, adviceName: string, annotation: StaticMethodPointcut): void; protected installPropertyAdvices(aspect: any, adviceName: string, annotation: InstancePropertyPointcut): void; protected installStaticPropertyAdvices(aspect: any, adviceName: string, annotation: StaticPropertyPointcut): void; }