import { EndpointConfig } from "../core/mod.ts" ; import { Reflect } from '../../third_party/Reflect.ts' ; import { ENDPOINT_CONFIG_KEY } from "./metadata_keys.ts" ; import { Constructor } from "../util/types.ts" ; export function Endpoint ( config ) ; export function Endpoint ( config ) ; export function Endpoint ( config ) { return ( ... args ) => { if ( args . length === 1 ) { const target = args [ 0 ] ; Reflect . defineMetadata ( ENDPOINT_CONFIG_KEY , config , target ) ; } if ( args . length > 1 ) { const des = args [ 2 ] ; Reflect . defineMetadata ( ENDPOINT_CONFIG_KEY , config , des . value ) ; } } ; }