import { getDependencyByIndex } from './decorators' ; import { Ctor } from './dependencyItem' ; import { LookUp } from './types' ; function changeLookup ( target , index , lookUp ) { const descriptor = getDependencyByIndex ( target , index ) ; descriptor . lookUp = lookUp ; } function lookupDecoratorFactoryProducer ( lookUp ) { return function DecoratorFactory < T > ( this ) { if ( this instanceof DecoratorFactory ) { return this ; } return function ( target , _key , index ) { changeLookup ( target , index , lookUp ) ; } ; } as any ; } interface SkipSelfDecorator { ( ) : any ; new ( ) : SkipSelfDecorator ; } /**
 * when resolving this dependency, skip the current injector
 */ export const SkipSelf = lookupDecoratorFactoryProducer ( LookUp . SKIP_SELF ) ; interface SelfDecorator { ( ) : any ; new ( ) : SelfDecorator ; } /**
 * when resolving this dependency, only search the current injector
 */ export const Self = lookupDecoratorFactoryProducer ( LookUp . SELF ) ;