UNPKG

@decorators/server

Version:

node decorators - decorators for express library

22 lines (21 loc) 1.09 kB
import * as express from 'express'; import { Server } from '../../core'; import { AdapterRoute, HttpApplicationAdapter, ParameterType } from '../http'; export declare class ExpressAdapter implements HttpApplicationAdapter { app: import("express-serve-static-core").Express; type: string; private server; constructor(app?: import("express-serve-static-core").Express); attachServer(server: Server): void; close(): void; getParam(type: ParameterType, name: string, req: express.Request, res: express.Response): () => any; isHeadersSent(response: express.Response): boolean; listen(): void; render(response: express.Response, template: string, message: object): Promise<string>; reply(response: express.Response, message: unknown, statusCode?: number): express.Response<any>; routes(routes: AdapterRoute[]): void; serveStatic(prefix: string, path: string, options?: unknown): void; set(setting: string, value: unknown): void; setHeader(response: express.Response, name: string, value: string): void; use(...args: any[]): void; }