RpcSchema.ts
RpcSchema.ts overview
Section titled “RpcSchema.ts overview”RPC schema markers and interruption annotations.
This module contains the small pieces of schema metadata that the RPC declaration, client, server, cluster, and reactivity layers share. It marks streamed responses and annotates interruptions that came from a remote client closing or cancelling a request.
Since v4.0.0
Exports Grouped by Category
Section titled “Exports Grouped by Category”Cause annotations
Section titled “Cause annotations”ClientAbort (class)
Section titled “ClientAbort (class)”Annotation that marks interruptions that originate from an RPC client abort.
Signature
declare class ClientAbortSince v4.0.0
streams
Section titled “streams”Stream
Section titled “Stream”Creates an RPC stream schema from a stream element success schema and stream error schema.
Signature
declare const Stream: <A extends Schema.Constraint, E extends Schema.Constraint>(success: A, error: E) => Stream<A, E>Since v4.0.0
Stream (interface)
Section titled “Stream (interface)”A schema marker for RPC streaming responses, storing the success element schema and stream error schema used for encoding and decoding stream chunks.
Signature
export interface Stream<A extends Schema.Constraint, E extends Schema.Constraint> extends Schema.BottomLazy< SchemaAST.Declaration, Stream<A, E>> { readonly Type: Stream_.Stream<A["Type"], E["Type"]> readonly Encoded: Stream_.Stream<A["Encoded"], E["Encoded"]> readonly DecodingServices: A["DecodingServices"] | E["DecodingServices"] readonly EncodingServices: A["EncodingServices"] | E["EncodingServices"] readonly Rebuild: Stream<A, E> readonly "~type.make.in": Stream_.Stream<A["Type"], E["Type"]> readonly "~type.make": Stream_.Stream<A["Type"], E["Type"]> readonly Iso: Stream_.Stream<A["Type"], E["Type"]> readonly [StreamSchemaTypeId]: typeof StreamSchemaTypeId readonly success: A readonly error: E}Since v4.0.0
isStreamSchema
Section titled “isStreamSchema”Returns true when a schema is an RPC stream schema created by
RpcSchema.Stream.
Signature
declare const isStreamSchema: (schema: Schema.Constraint) => schema is Stream<Schema.Top, Schema.Top>Since v4.0.0