import { ControllerCatalog } from "../controller-catalog.ts" ; import { ControllerClass } from "../controller-metadata.ts" ; import { Reflect , Type } from "../deps.ts" ; import { ValueProviderCatalog } from "../value-provider-catalog.ts" ; import { ValueProvider } from "../value-provider.ts" ; param valueProvider see ValueProvider export function createParameterDecorator ( valueProvider ? , name ? ) { return function ( target , propertyKey , parameterIndex ) { const parameterType = Reflect . getMetadata ( "design:paramtypes" , target , propertyKey ) ?. [ parameterIndex ] as Type ; ControllerCatalog . registerParameterMetadata ( target . constructor as ControllerClass , propertyKey . toString ( ) , { index : parameterIndex , name , type : parameterType } ) ; if ( valueProvider ) { ValueProviderCatalog . registerValueProvider ( target . constructor as ControllerClass , propertyKey . toString ( ) , parameterIndex , valueProvider ) ; } } ; }