@tsclean/core
Version:
Plugin for API Rest Full development, based on Clean Architecture, IoC and Dependency Injection.
30 lines • 1.58 kB
TypeScript
import * as http from 'http';
import { Observable } from 'rxjs';
import { ApplicationContextInterface } from '../contracts';
import { Logger } from '../services';
import { AbstractWsAdapter, MessageMappingProperties } from '../websockets';
type WsServerRegistryEntry = any[];
/**
* @publicApi
*/
export declare class WsAdapter extends AbstractWsAdapter {
protected readonly logger: Logger;
protected readonly httpServersRegistry: Map<number, any>;
protected readonly wsServersRegistry: Map<number, WsServerRegistryEntry>;
constructor(appOrHttpServer?: ApplicationContextInterface | any);
create(port: number, options?: Record<string, any> & {
namespace?: string;
server?: any;
path?: string;
}): any;
bindMessageHandlers(client: any, handlers: MessageMappingProperties[], transform: (data: any) => Observable<any>): void;
bindMessageHandler(buffer: any, handlersMap: Map<string, MessageMappingProperties>, transform: (data: any) => Observable<any>): Observable<any>;
bindErrorHandler(server: any): any;
bindClientDisconnect(client: any, callback: Function): void;
close(server: any): Promise<void>;
dispose(): Promise<void>;
protected ensureHttpServerExists(port: number, httpServer?: http.Server<typeof http.IncomingMessage, typeof http.ServerResponse>): http.Server<typeof http.IncomingMessage, typeof http.ServerResponse>;
protected addWsServerToRegistry<T extends Record<'path', string> = any>(wsServer: T, port: number, path: string): void;
}
export {};
//# sourceMappingURL=ws-adapter.d.ts.map