///
import React from 'react';
import type { IncomingMessage } from 'http';
import ws from 'ws';
import type { ServerOptions } from 'ws';
export interface Hooks {
onListening?(this: any): void;
onConnection?(this: any, socket: any, request: IncomingMessage): void;
onClose?(this: any): void;
onError?(this: any, error: Error): void;
onHeaders?(this: any, headers: string[], request: IncomingMessage): void;
}
declare function useWss({ host, port, ...options }?: ServerOptions): {
connect: (opts?: Hooks) => void;
sendMessage: (msg: Record) => Promise;
wss: React.MutableRefObject>;
};
export default useWss;