UNPKG

@cloudpss/ubrpc

Version:

Rpc server/client build on websocket and ubjson.

24 lines 958 B
import { RpcSocket } from './socket.js'; import type { RpcMetadata } from './types/payload.js'; import type { RpcObject } from './types/utils.js'; /** 由 WS Client 建立的 RPC 连接 */ export declare class RpcClientSocket<TRemote extends object, TLocal extends object> extends RpcSocket<TRemote, TLocal> { /** 建立连接使用的 WebSocket 实现 */ static WebSocket: { new (url: string | URL, protocols?: string | string[]): WebSocket; prototype: WebSocket; readonly CONNECTING: 0; readonly OPEN: 1; readonly CLOSING: 2; readonly CLOSED: 3; }; constructor(url: string | URL, metadata?: RpcMetadata, local?: RpcObject<TLocal>); readonly url: string; /** @inheritdoc */ protected authSocket(): Promise<RpcMetadata>; /** @inheritdoc */ protected onClose(ev: CloseEvent): void; /** 建立连接 */ protected connect(): void; } //# sourceMappingURL=client.d.ts.map