@rxap/nest-socket-io-client
Version:
This package provides a NestJS module for integrating a Socket.IO client. It offers a client proxy service and a provider for managing the Socket.IO client connection, allowing NestJS applications to easily interact with Socket.IO servers.
22 lines (21 loc) • 722 B
TypeScript
import { ClientProxy, ReadPacket, WritePacket } from '@nestjs/microservices';
export declare class SocketIoClientProxyService extends ClientProxy {
private readonly logger;
private readonly client;
connect(): Promise<any>;
close(): Promise<void>;
/**
* this method use when you use SocketIoClientProxyService.emit
* @param packet
* @returns
*/
dispatchEvent(packet: ReadPacket): Promise<any>;
/**
* this method will be call when use SocketIoClientProxyService.send
* can be use to implement request-response
* @param packet
* @param callback
* @returns
*/
publish(packet: ReadPacket, callback: (packet: WritePacket) => void): () => void;
}