1 | import { INestApplicationContext, WebSocketAdapter } from '@nestjs/common';
|
2 | import { WsMessageHandler } from '@nestjs/common/interfaces';
|
3 | import { Observable } from 'rxjs';
|
4 | export interface BaseWsInstance {
|
5 | on: (event: string, callback: Function) => void;
|
6 | close: Function;
|
7 | }
|
8 | export declare abstract class AbstractWsAdapter<TServer extends BaseWsInstance = any, TClient extends BaseWsInstance = any, TOptions = any> implements WebSocketAdapter<TServer, TClient, TOptions> {
|
9 | protected readonly httpServer: any;
|
10 | private _forceCloseConnections;
|
11 | set forceCloseConnections(value: boolean);
|
12 | get forceCloseConnections(): boolean;
|
13 | constructor(appOrHttpServer?: INestApplicationContext | any);
|
14 | bindClientConnect(server: TServer, callback: Function): void;
|
15 | bindClientDisconnect(client: TClient, callback: Function): void;
|
16 | close(server: TServer): Promise<void>;
|
17 | dispose(): Promise<void>;
|
18 | abstract create(port: number, options?: TOptions): TServer;
|
19 | abstract bindMessageHandlers(client: TClient, handlers: WsMessageHandler[], transform: (data: any) => Observable<any>): any;
|
20 | }
|