Skip to content

RpcSchema.ts

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



Annotation that marks interruptions that originate from an RPC client abort.

Signature

declare class ClientAbort

Source

Since v4.0.0

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>

Source

Since v4.0.0

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
}

Source

Since v4.0.0

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>

Source

Since v4.0.0