UNPKG

@nestjs/websockets

Version:

WebSockets for NestJS: gateways with message handlers, guards, pipes and interceptors, on Socket.IO or ws.

32 lines (31 loc) • 1.74 kB
import type { InjectionToken } from '@nestjs/common'; import type { Injectable, NestApplicationContextOptions } from '@nestjs/common/internal'; import type { ApplicationConfig, NestContainer, GraphInspector } from '@nestjs/core'; import { type InstanceWrapper } from '@nestjs/core/internal'; export declare class SocketModule<THttpServer = any, TAppOptions extends NestApplicationContextOptions = NestApplicationContextOptions> { private readonly socketsContainer; private applicationConfig; private webSocketsController; private adapterInitPromise; private httpServer; private appOptions; private injector; private isAcceptingClients; register(container: NestContainer, applicationConfig: ApplicationConfig, graphInspector: GraphInspector, appOptions: TAppOptions, httpServer?: THttpServer): Promise<void[][]>; connectAllGateways(providers: Map<InjectionToken, InstanceWrapper<Injectable>>, moduleName: string): Promise<void[]>; connectGatewayToServer(wrapper: InstanceWrapper<Injectable>, moduleName: string): Promise<void>; /** * Makes the gateways turn away the clients that connect to them, until * "acceptClients()" is called. The servers of the gateways are created, and * those with their own port are listening, as soon as the gateways are * registered. The application calls this before it registers them, and * "acceptClients()" once its lifecycle hooks ("onModuleInit", * "onApplicationBootstrap") have completed, so that no client is served by * providers that are not initialized yet. */ rejectClients(): void; acceptClients(): void; close(): Promise<any>; private initializeAdapter; private getContextCreator; }