UNPKG

@d3vtool/ex-frame

Version:

This library enhances Express.js by providing a more organized structure for web API projects, along with improved control and error handling capabilities.

23 lines (22 loc) 1.04 kB
import { type Express } from "express"; import * as http from "node:http"; import { TConstructor } from "./ex-http-methods"; export type ExFrameDI = { transient: Record<string, TConstructor>; scoped: Record<string, TConstructor>; singleton: Record<string, any>; }; export declare class ExFrame { #private; constructor(expressApp: Express); addTransient(service: TConstructor): void; addScoped(service: TConstructor): void; addSingleton(service: TConstructor): void; controller(controller: TConstructor): void; listen(port: number, hostname: string, backlog: number, callback?: (error?: Error) => void): http.Server; listen(port: number, hostname: string, callback?: (error?: Error) => void): http.Server; listen(port: number, callback?: (error?: Error) => void): http.Server; listen(callback?: (error?: Error) => void): http.Server; listen(path: string, callback?: (error?: Error) => void): http.Server; listen(handle: any, listeningListener?: (error?: Error) => void): http.Server; }