import { Proxy , Service } from "../decorators" ; import { ContainerMetadata } from "../metadata" ; import { Context , EventRequest , EventResult , HttpRequest , HttpResponse , RemoteRequest } from "../types" ; export type ObjectType < T > = { new ( ) : T ; } | Function ; export type Constructor < T > = T & { new ( ) : T ; } ; export interface HttpHandler { ( ctx , req ) : Promise < HttpResponse > ; } export interface RemoteHandler { ( ctx , req ) : Promise < any > ; } export interface EventHandler { ( ctx , req ) : Promise < any > ; } export enum ContainerState { Pending = - 1 , Ready = 0 , Reserved = 1 , Busy = 2 } export interface Container { state : ContainerState ; metadata : ContainerMetadata ; register ( resource , name ? ) : this ; register ( service ) : this ; register ( proxy ) : this ; register ( type , ... args ) : this ; publish ( service , ... args ) : this ; publish ( service ) : this ; prepare ( ) : Container ; httpRequest ( req ) : Promise < HttpResponse > ; remoteRequest ( req ) : Promise < any > ; eventRequest ( req ) : Promise < EventResult > ; }