import 'reflect-metadata' ; import { metadataOfHost , metadataOfPropHost } from '../core' ; export returns { ( target : Object , propertyKey : string , parameterIndex ? : number ) => void } export function Host ( ) { return function ( target , propertyKey , parameterIndex ? ) { if ( ! parameterIndex && parameterIndex !== 0 ) { const metadata = Reflect . getMetadata ( metadataOfPropHost , target . constructor ) || [ ] ; metadata . push ( propertyKey ) ; Reflect . defineMetadata ( metadataOfPropHost , metadata , target . constructor ) ; } else { const metadata = Reflect . getMetadata ( metadataOfHost , target ) || [ ] ; metadata . push ( parameterIndex ) ; Reflect . defineMetadata ( metadataOfHost , metadata , target ) ; } } ; }