socket.io-react-hooks-advanced
Version:
A modular and extensible React + Socket.IO hook library designed for real-world applications. Supports namespaced sockets, reconnection strategies, offline queues, latency monitoring, middleware, encryption, and more.
15 lines (14 loc) • 497 B
TypeScript
import { EmitMiddleware, OnMiddleware } from "../context/SocketContext";
type MiddlewareEntry = {
id: string;
emit?: EmitMiddleware;
on?: OnMiddleware;
};
export declare class MiddlewareManager {
private middlewares;
addMiddleware(entry: MiddlewareEntry): string;
removeMiddleware(id: string): void;
runEmit(event: string, data: any, finalEmit: (e: string, d: any) => void): void;
runOn(event: string, data: any, finalHandler: (d: any) => void): void;
}
export {};