import { IDirective } from '../types' ; import { injected , providersFormater , TProviders } from '@indiv/di' ; export type TDirectiveOptions = { selector : string ; providers ? : TProviders ; } ; param { TComponentOptions } options returns { ( _constructor : Function ) => void } export function Directive ( options ) { return function ( _constructor ) : void { injected ( _constructor ) ; ( _constructor as any ) . isSingletonMode = false ; ( _constructor as any ) . nvType = 'nvDirective' ; ( _constructor as any ) . selector = options . selector ; const vm = _constructor . prototype ; if ( options . providers ) vm . $privateProviders = providersFormater ( options . providers ) ; vm . $declarationMap = new Map ( ) ; } ; }