UNPKG

@syncable/core

Version:
20 lines (19 loc) 468 B
import { Nominal } from 'tslang'; export declare type RPCCallId = Nominal<string, 'rpc-call-id'>; export declare type RPCData = RPCRequest | RPCResponse; export interface RPCRequest { type: 'request'; id: RPCCallId; name: string; args: unknown[]; } export interface RPCResponseError { code: string; message: string; } export interface RPCResponse { type: 'response'; id: RPCCallId; return?: unknown; throw?: RPCResponseError; }