@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) • 797 B
TypeScript
import { CustomTransportStrategy, Server } from '@nestjs/microservices';
import { Socket } from 'socket.io-client';
import { Logger } from '@nestjs/common';
/**
* SocketIoClientStrategy is a custom transport strategy that allows
* a Socket.IO client to communicate with the server. It extends the Server class
* and implements the CustomTransportStrategy interface.
*/
export declare class SocketIoClientStrategy extends Server implements CustomTransportStrategy {
private readonly client;
protected readonly logger: Logger;
constructor(client: Socket, logger: Logger);
/**
* This method is triggered when you run "app.listen()".
*/
listen(callback: () => void): void;
/**
* This method is triggered on application shutdown.
*/
close(): void;
}