import BeforeAdvice from "../../../type/impl/aop/advice/BeforeAdvice" import AfterAdvice from "../../../type/impl/aop/advice/AfterAdvice" import AopAspect from "../../../type/impl/aop/AopAspect" import AopPointcut from "../../../type/impl/aop/AopPointcut" import {ConstructorType} from "../../../type/type" import DecorateRegistCenter from "../../DecorateRegistCenter" export function Aspect(constructor: ConstructorType): void{ DecorateRegistCenter.registAspects(new AopAspect({ cost: constructor })) } export function Pointcut({name = '', execution = ''} = {}): Function{ return function(constructor: ConstructorType): void{ DecorateRegistCenter.registPointcuts(new AopPointcut({ cost: constructor, name, execution })) } } export function Before({name = ''} = {}): Function{ return function(prototype: any, methodName: string, desc: any): void{ DecorateRegistCenter.registAdvices(new BeforeAdvice({ cost: prototype.constructor, value: desc.value, pointcutName: name })) } } export function After({name = ''} = {}): Function{ return function(prototype: any, methodName: string, desc: any): void{ DecorateRegistCenter.registAdvices(new AfterAdvice({ cost: prototype.constructor, value: desc.value, pointcutName: name })) } }