/** * @since 1.0.0 */ import * as Rpc from "@effect/rpc/Rpc"; import type { NonEmptyReadonlyArray } from "effect/Array"; import * as Context from "effect/Context"; import * as Effect from "effect/Effect"; import type * as Option from "effect/Option"; import * as Schema from "effect/Schema"; import { MalformedMessage } from "./ClusterError.js"; import type { OutgoingRequest } from "./Message.js"; import { Snowflake } from "./Snowflake.js"; /** * @since 1.0.0 * @category type ids */ export declare const TypeId: unique symbol; /** * @since 1.0.0 * @category type ids */ export type TypeId = typeof TypeId; /** * @since 1.0.0 * @category guards */ export declare const isReply: (u: unknown) => u is Reply; /** * @since 1.0.0 * @category models */ export type Reply = WithExit | Chunk; declare const ReplyWithContext_base: new = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => Readonly & { readonly _tag: "ReplyWithContext"; }; /** * @since 1.0.0 * @category models */ export declare class ReplyWithContext extends ReplyWithContext_base<{ readonly reply: Reply; readonly context: Context.Context>; readonly rpc: R; }> { /** * @since 1.0.0 */ static fromDefect(options: { readonly id: Snowflake; readonly requestId: Snowflake; readonly defect: unknown; }): ReplyWithContext; /** * @since 1.0.0 */ static interrupt(options: { readonly id: Snowflake; readonly requestId: Snowflake; }): ReplyWithContext; } /** * @since 1.0.0 * @category models */ export type ReplyEncoded = WithExitEncoded | ChunkEncoded; /** * @since 1.0.0 * @category models */ export interface WithExitEncoded { readonly _tag: "WithExit"; readonly requestId: string; readonly id: string; readonly exit: Rpc.ExitEncoded; } /** * @since 1.0.0 * @category models */ export interface ChunkEncoded { readonly _tag: "Chunk"; readonly requestId: string; readonly id: string; readonly sequence: number; readonly values: NonEmptyReadonlyArray>; } /** * @since 1.0.0 * @category schemas */ export declare const Reply: (rpc: R) => Schema.Schema, ReplyEncoded, Rpc.Context>; /** * @since 1.0.0 * @category schemas */ export declare const Encoded: Schema.Union<[Schema.Struct<{ _tag: Schema.Literal<["WithExit"]>; requestId: typeof Schema.String; id: typeof Schema.String; exit: typeof Schema.Unknown; }>, Schema.Struct<{ _tag: Schema.Literal<["Chunk"]>; requestId: typeof Schema.String; id: typeof Schema.String; sequence: typeof Schema.Number; values: Schema.Array$; }>]>; declare const Chunk_base: new = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => Readonly & { readonly _tag: "Chunk"; }; /** * @since 1.0.0 * @category models */ export declare class Chunk extends Chunk_base<{ readonly requestId: Snowflake; readonly id: Snowflake; readonly sequence: number; readonly values: NonEmptyReadonlyArray>; }> { /** * @since 1.0.0 */ readonly [TypeId]: symbol; /** * @since 1.0.0 */ static emptyFrom(requestId: Snowflake): Chunk; /** * @since 1.0.0 */ static readonly schemaFromSelf: Schema.Schema>; /** * @since 1.0.0 */ static schema(rpc: R): Schema.Schema, ChunkEncoded, Rpc.Context>; /** * @since 1.0.0 */ withRequestId(requestId: Snowflake): Chunk; } declare const WithExit_base: new = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => Readonly & { readonly _tag: "WithExit"; }; /** * @since 1.0.0 * @category models */ export declare class WithExit extends WithExit_base<{ readonly requestId: Snowflake; readonly id: Snowflake; readonly exit: Rpc.Exit; }> { /** * @since 1.0.0 */ readonly [TypeId]: symbol; /** * @since 1.0.0 */ static schema(rpc: R): Schema.Schema, WithExitEncoded, Rpc.Context>; /** * @since 1.0.0 */ withRequestId(requestId: Snowflake): WithExit; } /** * @since 1.0.0 * @category serialization / deserialization */ export declare const serialize: (self: ReplyWithContext) => Effect.Effect, MalformedMessage>; /** * @since 1.0.0 * @category serialization / deserialization */ export declare const serializeLastReceived: (self: OutgoingRequest) => Effect.Effect>, MalformedMessage>; export {}; //# sourceMappingURL=Reply.d.ts.map