File size: 2,241 Bytes
31e8457 e391660 31e8457 e391660 31e8457 e391660 31e8457 e391660 31e8457 e391660 31e8457 e391660 31e8457 e391660 31e8457 e391660 31e8457 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 | /**
* 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 4.0.0
*/
import * as Cause from "../../Cause.ts";
import * as Context from "../../Context.ts";
import * as Schema from "../../Schema.ts";
import type * as SchemaAST from "../../SchemaAST.ts";
import * as Stream_ from "../../Stream.ts";
declare const StreamSchemaTypeId = "~effect/rpc/RpcSchema/StreamSchema";
/**
* Returns `true` when a schema is an RPC stream schema created by
* `RpcSchema.Stream`.
*
* @category streams
* @since 4.0.0
*/
export declare function isStreamSchema(schema: Schema.Top): schema is Stream<Schema.Top, Schema.Top>;
/**
* A schema marker for RPC streaming responses, storing the success element
* schema and stream error schema used for encoding and decoding stream chunks.
*
* @category streams
* @since 4.0.0
*/
export interface Stream<A extends Schema.Top, E extends Schema.Top> extends Schema.Bottom<Stream_.Stream<A["Type"], E["Type"]>, Stream_.Stream<A["Encoded"], E["Encoded"]>, A["DecodingServices"] | E["DecodingServices"], A["EncodingServices"] | E["EncodingServices"], SchemaAST.Declaration, Stream<A, E>> {
readonly "Rebuild": Stream<A, E>;
readonly [StreamSchemaTypeId]: typeof StreamSchemaTypeId;
readonly success: A;
readonly error: E;
}
/**
* Creates an RPC stream schema from a stream element success schema and stream
* error schema.
*
* @category streams
* @since 4.0.0
*/
export declare function Stream<A extends Schema.Top, E extends Schema.Top>(success: A, error: E): Stream<A, E>;
declare const ClientAbort_base: Context.ServiceClass<ClientAbort, "effect/rpc/RpcSchema/ClientAbort", true>;
/**
* Annotation that marks interruptions that originate from an RPC client
* abort.
*
* @category Cause annotations
* @since 4.0.0
*/
export declare class ClientAbort extends ClientAbort_base {
static annotation: Context.Context<Cause.StackTrace | ClientAbort>;
}
export {};
//# sourceMappingURL=RpcSchema.d.ts.map |