@x5e/gink
Version:
an eventually consistent database
28 lines (27 loc) • 1.02 kB
TypeScript
/// <reference types="node" />
/// <reference types="node" />
import { Server as HttpServer, ServerResponse, IncomingMessage } from "http";
import { Server as HttpsServer } from "https";
import { request as WebSocketRequest } from "websocket";
import { NumberStr, DirPath, CallBack, FilePath } from "./typedefs";
/**
* Just a utility class to wrap websocket.server.
*/
export declare class Listener {
ready: Promise<any>;
private websocketServer;
readonly httpServer: HttpServer | HttpsServer;
readonly staticContentRoot?: string;
readonly index?: string;
constructor(args: {
requestHandler: (request: WebSocketRequest) => void;
requestListener?: (request: IncomingMessage, response: ServerResponse) => void;
staticContentRoot?: DirPath;
port?: NumberStr;
logger?: CallBack;
sslKeyFilePath?: FilePath;
sslCertFilePath?: FilePath;
index?: string;
});
requestListener(request: IncomingMessage, response: ServerResponse): void;
}