21 lines
500 B
TypeScript
21 lines
500 B
TypeScript
import { RPCError } from './RPCError';
|
|
|
|
export interface RPCClientCodec {
|
|
request(method: string, args: any[], id: number): any;
|
|
response(res: any): RPCClientResponseCodec;
|
|
}
|
|
|
|
export interface RPCClientResponseCodec {
|
|
id(): number | undefined;
|
|
error(): RPCError | undefined;
|
|
result(): any | undefined;
|
|
|
|
isNotification(): boolean;
|
|
notification(): RPCClientNotificationCodec | undefined;
|
|
}
|
|
|
|
export interface RPCClientNotificationCodec {
|
|
method(): string;
|
|
params(): any | undefined;
|
|
}
|