/// import { EventEmitter } from "events"; import { IncomingMessage } from "./incoming-message"; import { ServerResponse } from "./server-response"; export declare class Server extends EventEmitter { listening: boolean; /** * @description * Emulates node js http server in the browser. * See: https://nodejs.org/api/http.html#http_class_http_server * * @param onRequest An optional function called on each request. */ constructor(onRequest?: (this: Server, req: IncomingMessage, res: ServerResponse) => any); /** * @description * Starts a server and sets listening to true. * Adapters will hook into this to startup routers on individual platforms. * * @param onListening An optional function called once the server has started. */ listen(...args: any[]): this; /** * @description * Closes the server and destroys all event listeners. * * @param onClode An option function called once the server stops. */ close(onClose?: (this: Server) => void): this; /** * @description * This is a noop in the browser. */ unref(): Server; /** * @description * This is a noop in the browser. */ address(): void; }