import { JsonRpcProvider } from '@polkadot-api/json-rpc-provider'; export { JsonRpcProvider } from '@polkadot-api/json-rpc-provider'; import { InnerJsonRpcProvider } from '@polkadot-api/json-rpc-provider-proxy'; export { InnerJsonRpcProvider } from '@polkadot-api/json-rpc-provider-proxy'; declare enum WsEvent { CONNECTING = "CONNECTING", CONNECTED = "CONNECTED", ERROR = "ERROR", CLOSE = "CLOSE" } type WsConnecting = { type: WsEvent.CONNECTING; uri: string; }; type WsConnected = { type: WsEvent.CONNECTED; uri: string; }; type WsError = { type: WsEvent.ERROR; event: any; }; type WsClose = { type: WsEvent.CLOSE; event: any; }; type StatusChange = WsConnecting | WsConnected | WsError | WsClose; type WsJsonRpcProvider = JsonRpcProvider & { switch: (uri?: string) => void; getStatus: () => StatusChange; }; declare enum SocketEvents { CONNECTING = "CONNECTING", CONNECTED = "CONNECTED", TIMEOUT = "TIMEOUT", STALE = "STALE", ERROR = "ERROR", CLOSE = "CLOSE", DISCONNECT = "DISCONNECT", IN = "IN", OUT = "OUT" } type SocketLoggerEvent = { type: SocketEvents.CONNECTING; url: string; } | { type: SocketEvents.CONNECTED; } | { type: SocketEvents.DISCONNECT; } | { type: SocketEvents.ERROR; error: any; } | { type: SocketEvents.CLOSE; } | { type: SocketEvents.STALE; } | { type: SocketEvents.TIMEOUT; } | { type: SocketEvents.IN; msg: string; } | { type: SocketEvents.OUT; msg: string; }; type SocketLoggerFn = (event: SocketLoggerEvent) => void; type WebSocketClass = typeof WebSocket; type Middleware = (base: InnerJsonRpcProvider) => InnerJsonRpcProvider; declare const getWsProvider: (endpoints: string | Array, config?: Partial<{ onStatusChanged: (status: StatusChange) => void; timeout: number; heartbeatTimeout: number; websocketClass: WebSocketClass; middleware: Middleware; logger: SocketLoggerFn; }>) => WsJsonRpcProvider; export { SocketEvents, WsEvent, getWsProvider }; export type { Middleware, SocketLoggerFn, StatusChange, WebSocketClass, WsClose, WsConnected, WsConnecting, WsError, WsJsonRpcProvider };