import { RpcProcedure, RpcProcedurePayload, RpcProcedureResult } from './RpcProcedure'; interface RpcMessage { rpc: true; type: TType; procedure: TProcedure; id: number; payload: TPayload; source?: string; } interface RpcRemoteError { message: string; stack?: string; } declare type RpcCall = RpcMessage<'call', TProcedure, RpcProcedurePayload>; declare type RpcReturn = RpcMessage<'return', TProcedure, RpcProcedureResult>; declare type RpcThrow = RpcMessage<'throw', TProcedure, RpcRemoteError>; declare function createRpcMessage(procedure: TProcedure, id: number, type: TType, payload: TPayload, source?: string): RpcMessage; declare function createRpcCall(procedure: TProcedure, index: number, payload: RpcProcedurePayload): RpcCall; declare function createRpcReturn(procedure: TProcedure, index: number, payload: RpcProcedureResult): RpcReturn; declare function createRpcThrow(procedure: TProcedure, index: number, payload: RpcRemoteError): RpcThrow; declare function isRpcMessage(candidate: unknown): candidate is RpcMessage; declare function isRpcCallMessage(candidate: unknown): candidate is RpcCall; declare function isRpcReturnMessage(candidate: unknown): candidate is RpcReturn; declare function isRpcThrowMessage(candidate: unknown): candidate is RpcThrow; declare function getRpcMessageKey(message: RpcMessage): string; export { RpcMessage, RpcCall, RpcReturn, RpcThrow, createRpcMessage, createRpcCall, createRpcReturn, createRpcThrow, isRpcMessage, isRpcCallMessage, isRpcReturnMessage, isRpcThrowMessage, getRpcMessageKey, };