UNPKG

curated-node

Version:

Not a framework. Not a module. Just a bunch of Node.js packages you most likely familiar with and probably already use, bundled together in a modular fashion.

26 lines (25 loc) 1.1 kB
/// <reference types="node" /> import { Server as SocketIOServer, Socket as SocketIOSocket, ServerOptions as SocketIOServerOptions } from "socket.io"; import { Server as HttpServer } from "http"; import { LogModule, LogModuleConfig } from "../modules/Log"; import { _BaseKernel } from "../_BaseKernel"; import { ExpressKernel } from "./Express"; import { SocketIONamespace } from "../components/SocketIONamespace"; export declare type SocketIOKernelConfig = { id?: string; logger?: LogModuleConfig; httpServerOptions?: { port: number; }; options: Partial<SocketIOServerOptions>; }; export declare class SocketIOKernel extends _BaseKernel<SocketIOKernel, SocketIOKernelConfig> { private _httpServer?; private _io; constructor(config: SocketIOKernelConfig, socketIONamespaces: SocketIONamespace[], expressKernel?: ExpressKernel, logger?: LogModule); use(middleware: (socket: SocketIOSocket, fn: (err?: any) => void) => void): this; boot(): Promise<any>; halt(): Promise<any>; get httpServer(): HttpServer | undefined; get io(): SocketIOServer; }