import { z } from "zod"; import type { JsonObject, JsonValue } from "../json.js"; import type { JsonText } from "../payload/json-text.js"; declare const socketTagsSchema: z.ZodArray; declare const socketConnectionSchema: z.ZodObject<{ id: z.ZodString; metadata: z.ZodType>; tags: z.ZodArray; }, z.core.$strip>; declare const socketEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{ type: z.ZodLiteral<"connect">; connection: z.ZodObject<{ id: z.ZodString; metadata: z.ZodType>; tags: z.ZodArray; }, z.core.$strip>; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"message">; connection_id: z.ZodString; message: z.ZodDiscriminatedUnion<[z.ZodObject<{ type: z.ZodLiteral<"text">; data: z.ZodString; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"binary">; data: z.ZodString; }, z.core.$strip>], "type">; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"disconnect">; connection: z.ZodObject<{ id: z.ZodString; metadata: z.ZodType>; tags: z.ZodArray; }, z.core.$strip>; code: z.ZodNumber; reason: z.ZodString; was_clean: z.ZodBoolean; }, z.core.$strip>], "type">; type SocketConnection = z.infer; /** `Text` is how the text of a message is held: a string, or in an actor host the UTF-8 it was encoded to. */ type SocketMessage = { readonly type: "text"; readonly data: Text; } | { readonly type: "binary"; readonly data: string; }; type SocketQuery = { readonly tag?: string; readonly countOnly?: boolean; }; type SocketLookup = readonly SocketConnection[] | number; type SocketSource = (query?: SocketQuery) => Promise; type SocketEffect = { readonly type: "set_auto_response"; readonly request: string | null; readonly response: string | null; } | { readonly type: "state_snapshot"; readonly connection_id: string; readonly state: JsonObject; readonly version?: number; } | { readonly type: "state_update"; readonly changes: JsonObject; readonly removed: readonly string[]; readonly except_connection_ids?: readonly string[]; readonly version?: number; } | { readonly type: "send"; readonly connection_id: string; readonly message: SocketMessage; } | { readonly type: "broadcast"; readonly message: SocketMessage; readonly except_connection_ids: readonly string[]; readonly tags: readonly string[]; readonly tag_match?: "all" | "any"; } | { readonly type: "close" | "reject"; readonly connection_id: string; readonly code: number; readonly reason: string; } | { readonly type: "set_metadata"; readonly connection_id: string; readonly metadata: JsonValue; } | { readonly type: "set_tags"; readonly connection_id: string; readonly tags: readonly string[]; }; /** An effect as an actor host holds it, from the actor's call until the Rust host has it. */ type HostSocketEffect = SocketEffect; export { socketConnectionSchema, socketEventSchema, socketTagsSchema }; export type { HostSocketEffect, SocketConnection, SocketEffect, SocketMessage }; export type { SocketQuery, SocketLookup, SocketSource }; //# sourceMappingURL=socketProtocol.d.ts.map