@x5e/gink
Version:
an eventually consistent database
25 lines (24 loc) • 824 B
TypeScript
import { connection as WebSocketConnection } from "websocket";
import { Database } from "./Database";
import { Store } from "./Store";
import { CallBack, NumberStr, FilePath, DirPath, AuthFunction } from "./typedefs";
/**
* A server that connects all inbound websocket connections to a single database instance.
*/
export declare class SimpleServer extends Database {
private listener;
readonly authFunc: AuthFunction;
connections: Map<number, WebSocketConnection>;
constructor(store: Store, args: {
port?: NumberStr;
sslKeyFilePath?: FilePath;
sslCertFilePath?: FilePath;
staticContentRoot?: DirPath;
logger?: CallBack;
identity?: string;
authFunc?: AuthFunction;
});
private onRequest;
private onMessage;
private requestListener;
}