import { ControllerCatalog } from "../controller-catalog.ts" ; import { ControllerClass , ControllerMetadata } from "../controller-metadata.ts" ; import { DiContainer , Reflect , Scope , Type } from "../deps.ts" ; /**
 * Decorator that marks a class as a controller
 */ export function Controller ( metadata ) ; param route export function Controller ( route ) ; export function Controller ( metadataOrRoute ) { return function ( target ) { DiContainer . root ( ) . registerFromMetadata ( target as Type , Reflect . getMetadata ( "design:paramtypes" , target ) , undefined , Scope . Request ) ; ControllerCatalog . registerControllerMetadata ( target as ControllerClass , typeof metadataOrRoute === "string" ? { type : target as Type , route : metadataOrRoute } : metadataOrRoute ) ; } ; }