/// import { Provider } from 'injection-js'; import * as express from 'express'; import * as http from 'http'; export interface OnSanityCheck { /** * Perform a sanity check to see that this service would be healthy, if started. */ altOnSanityCheck(): Promise; } export interface OnInit { altOnInit(): any; } export interface ApplicationOptions { /** * Enable verbose console logging for Alterior */ verbose?: boolean; /** * Turn off all console output */ silent?: boolean; /** * Hide exception information from 500 responses (should be set for production). * Defaults to off (ie, exception information is included) */ hideExceptions?: boolean; /** * Port to serve HTTP on. Defaults to 3000. */ port?: number; /** * Start listening automatically. */ autostart?: boolean; /** * Dependency injection providers. If a promise is passed into this, * it will be resolved into a provider before the application is booted. */ providers?: (Provider | Promise)[]; /** * Global and mounted middleware. Middleware included here will be * applied to all routes unless you specify it as an array which contains * a mountpoint string and the middleware function itself (ie ['/files', fileUpload]) */ middleware?: (Function | [string, Function])[]; /** * Explicitly-defined controllers. Not needed unless autoregisterControllers is turned off. */ controllers?: Function[]; /** * If true, all classes with @Controller() annotation are included automatically. */ autoRegisterControllers?: boolean; } export declare function AppOptions(appOptions?: ApplicationOptions): (target: any) => void; /** * Represents a complete application instance, aggregating the application class instance, * the Express application, and the node HTTP server object. * This class can be extended and provided via dependency injection. */ export declare class ApplicationInstance { constructor(); app: any; express: express.Application; http: http.Server; configuredPort: number; /** * Bind the application class instance, the express application, and the http server * objects onto this ApplicationInstance. */ bind(app: any, express: express.Application, port: number): void; start(): http.Server; /** * Whether we are stopped (true) or not (false) */ readonly stopped: boolean; private _stopped; /** * Stop listening for new connections on HTTP */ stop(): void; /** * Shut down */ shutdown(): void; }