/// <reference types="node" />
import React from 'react';
import { Socket } from 'socket.io-client';
import { EventEmitter } from 'events';
export declare type WebsocketMessage = {
    type: string;
    payload?: any;
};
export declare type SocketProps = {
    url: string;
    roomURL: string;
    peerId: string;
};
export declare type SocketListener = ((message: WebsocketMessage, callback?: (arg?: string) => void) => void) | null;
export declare type ContextObj = {
    socket: Socket;
    sendMessage: (message: WebsocketMessage, callBack?: (message: WebsocketMessage) => void) => Promise<WebsocketMessage>;
    emitter: EventEmitter;
};
export declare const WebSocketContext: React.Context<ContextObj>;
export declare const WebSocketProvider: React.FunctionComponent<SocketProps>;
