A lightweight JSON RPC client & server
A light implementation of JSON RPC 2.0
See the introduction at Github
Function | Description |
---|---|
AsyncCall(thisSideImplementation, options) | Create a RPC server & client. |
AsyncGeneratorCall(thisSideImplementation, options) | The async generator version of the AsyncCall |
batch(asyncCallInstance) | Wrap the AsyncCall instance to use batch call. |
JSONEncoder({ keepUndefined, replacer, reviver, space, }) | Create a encoder by JSON.parse/stringify |
JSONSerialization(replacerAndReceiver, space, undefinedKeepingBehavior) | Create a serialization by JSON.parse/stringify |
notify(instanceOrFnOnInstance) | Wrap the AsyncCall instance to send notification. |
Interface | Description |
---|---|
AbortSignalLike | AbortSignal |
AsyncCallLogLevel | Log options |
AsyncCallOptions | Options for AsyncCall() |
AsyncCallStrictJSONRPC | Strict options |
AsyncCallStrictOptions | Strict options |
CallbackBasedChannel | This interface represents a “callback” model. |
ClientEncoding | Encoder of the client. |
ConsoleInterface | The minimal Console interface that AsyncCall needs. |
ErrorResponse | JSON-RPC ErrorResponse object. |
ErrorResponseDetail | The “error” record on the JSON-RPC ErrorResponse object. |
EventBasedChannel | This interface represents a “on message” - “send response” model. |
IsomorphicEncoder | Encoder that work for both server and client. |
IsomorphicEncoderFull | Encoder that work for both server and client. |
JSONEncoderOptions | Options of JSONEncoder() |
Request | JSON-RPC Request object. |
Serialization | Serialize and deserialize of the JSON-RPC payload |
ServerEncoding | Encoder of the server. |
SuccessResponse | JSON-RPC SuccessResponse object. |
Namespace | Description |
---|---|
JSONEncoder |
Variable | Description |
---|---|
NoSerialization | Serialization implementation that do nothing |
Type Alias | Description |
---|---|
AsyncGeneratorVersionOf | Make all generator in the type T becomes AsyncGenerator |
AsyncVersionOf | Make all functions in T becomes an async function and filter non-Functions out. |
ErrorMapFunction | |
ID | ID of a JSON-RPC request/response. |
Requests | A request object or an array of request objects. |
Response | A JSON-RPC response object |
Responses | A response object or an array of response objects. |