import { BindingRegistry } from "./binding-registry" ; import { Callsite } from "./our-callsite" ; import { StepBinding , StepBindingFlags } from "./step-binding" ; param tag export function before ( tag ? ) { const callsite = Callsite . capture ( ) ; return < T > ( target , propertyKey , descriptor ) => { const stepBinding = { stepPattern : "" , bindingType : StepBindingFlags . before , targetPrototype : target , targetPropertyKey : propertyKey , argsLength : target [ propertyKey ] . length , callsite : callsite } ; if ( tag ) { stepBinding . tag = tag [ 0 ] === "@" ? tag : `@${ tag }` ; } BindingRegistry . instance . registerStepBinding ( stepBinding ) ; return descriptor ; } ; } param tag export function after ( tag ? ) { const callsite = Callsite . capture ( ) ; return < T > ( target , propertyKey , descriptor ) => { const stepBinding = { stepPattern : "" , bindingType : StepBindingFlags . after , targetPrototype : target , targetPropertyKey : propertyKey , argsLength : target [ propertyKey ] . length , callsite : callsite } ; if ( tag ) { stepBinding . tag = tag [ 0 ] === "@" ? tag : `@${ tag }` ; } BindingRegistry . instance . registerStepBinding ( stepBinding ) ; return descriptor ; } ; }