@tsclean/core
Version:
Plugin for API Rest Full development, based on Clean Architecture, IoC and Dependency Injection.
17 lines • 995 B
TypeScript
import { Observable } from 'rxjs';
import { ApplicationContextInterface, WebSocketAdapter, WsMessageHandler } from '../../contracts';
export interface BaseWsInstance {
on: (event: string, callback: Function) => void;
close: Function;
}
export declare abstract class AbstractWsAdapter<TServer extends BaseWsInstance = any, TClient extends BaseWsInstance = any, TOptions = any> implements WebSocketAdapter<TServer, TClient, TOptions> {
protected readonly httpServer: any;
constructor(appOrHttpServer?: ApplicationContextInterface | any);
bindClientConnect(server: TServer, callback: Function): void;
bindClientDisconnect(client: TClient, callback: Function): void;
close(server: TServer): Promise<void>;
dispose(): Promise<void>;
abstract create(port: number, options?: TOptions): TServer;
abstract bindMessageHandlers(client: TClient, handlers: WsMessageHandler[], transform: (data: any) => Observable<any>): any;
}
//# sourceMappingURL=ws-adapter.d.ts.map