/// import * as Service from '../Service'; import * as NodeHttp from 'http'; import * as Express from 'express'; import * as BodyParser from 'body-parser'; import * as cors from 'cors'; export interface Cases { [eventType: string]: [number, string]; } export interface Request extends NodeHttp.ClientRequest { url: string; method: string; query: T; headers: { [name: string]: string; }; body: T; remoteAddress: string; } export interface Response extends NodeHttp.ServerResponse { } export interface props extends Service.props { HTTP: { port: number; ip?: string; cors?: cors.CorsOptions; bodyParser?: { json?: BodyParser.OptionsJson; urlencoded?: BodyParser.OptionsUrlencoded; raw?: BodyParser.OptionsText; }; headers?: { [name: string]: string; }; }; } export declare class HTTPService extends Service.Service { protected config: props['HTTP']; protected express: Express.Express; protected server: NodeHttp.Server; protected headers: { [name: string]: string; }; constructor(props: props); start(): Promise; protected handleHttpRequest(req: Request, res: Response): any; protected respond(res: Response, code: number, data?: any, options?: any): void; protected extractRemoteAddress(req: any): any; }