Type aliases
HandlerMap
Handler
Map<A>: ReadonlyMap<string, Tuple<A, any>>
Type parameters
IsNever
IsNever<A>: [A] extends [never] ? true : false
Type parameters
JsonRpcError
JsonRpcError<Code, ErrorData>: IsNever<ErrorData> extends true ? { code: Code; message: string } : { code: Code; data: ErrorData; message: string }
Type parameters
-
Code: number
-
ErrorData: Json
JsonRpcFailedResponse
Json
RpcFailedResponse<Code, ErrorData>: { error: JsonRpcError<Code, ErrorData>; id: Id; jsonrpc: "2.0" }
Type parameters
-
Code: number
-
ErrorData: Json
Type declaration
-
Readonly error: JsonRpcError<Code, ErrorData>
-
Readonly id: Id
-
Readonly jsonrpc: "2.0"
JsonRpcNotification
JsonRpcNotification<Method, Params>: IsNever<Params> extends true ? { jsonrpc: "2.0"; method: Method } : { jsonrpc: "2.0"; method: Method; params: Params }
Type parameters
JsonRpcRequest
Json
RpcRequest<Method, Params>: IsNever<Params> extends true ? { id: Id; jsonrpc: "2.0"; method: Method } : { id: Id; jsonrpc: "2.0"; method: Method; params: Params }
Type parameters
JsonRpcResponse
Type parameters
-
-
Code: number
-
ErrorData: Json
JsonRpcSuccessfulResponse
Json
RpcSuccessfulResponse<Result>: { id: Id; jsonrpc: "2.0"; result: Result }
Type parameters
Type declaration
-
Readonly id: Id
-
Readonly jsonrpc: "2.0"
-
Readonly result: Result
NotificationHandler
NotificationHandler<E, A>: (notification: A) => HookEffects<E, void>
Type parameters
Type declaration
-
- (notification: A): HookEffects<E, void>
-
Parameters
Returns HookEffects<E, void>
RequestHandler
RequestHandler<E, A, B>: (notification: A) => HookEffects<E, B>
Type parameters
Type declaration
-
- (notification: A): HookEffects<E, B>
-
Parameters
Returns HookEffects<E, B>
SendRequest
Send
Request<E>: <A, B>(request: A, direction: MessageDirection) => Effects<E, B>
Type parameters
Type declaration
-
-
Type parameters
Parameters
Returns Effects<E, B>
ServerChannel
Type parameters
@typed/json-rpc
A relative work-in-progress compared to the rest of the libraries in Typed, but is an attempt to abstract the building of JSON-RPC servers and client connects using @typed/effects, @typed/hooks, and the ecosystem.