import * as v from '../../shared/src/valita.ts'; /** * Pokes use a multi-part format. Pokes send entity data to the client and can * be multiple mega-bytes in size. Using a multi-part format allows the server * to avoid having to have the full poke in memory at one time. * * Each poke is assigned a `pokeID`, a unique id (within the context of the * connection) for identifying the poke. All messages for a poke will have the * same `pokeID`. * * A poke begins with a `poke-start` message which contains the `baseCookie` * the poke is updating from and the `cookie` the poke is updating to. * * The poke continues with zero to many `poke-part` messages, each of which * can contain patch parts. These patch parts should be merged in the order * received. * * Finally, the poke ends with a `poke-end` message. The merged `poke-parts` * can now be applied as a whole to update from `baseCookie` to `cookie`. * * Poke messages can be intermingled with other `down` messages, but cannot be * intermingled with poke messages for a different `pokeID`. If this is * observed it is an unexpected error; the client should ignore both pokes, * disconnect, and reconnect. */ export declare const pokeStartBodySchema: v.ObjectType<{ pokeID: v.Type; baseCookie: v.UnionType<[v.Type, v.Type]>; /** * This field is always set if the poke contains a `rowsPatch`. * It may be absent for patches that only update clients and queries. */ schemaVersions: v.Optional<{ minSupportedVersion: number; maxSupportedVersion: number; }>; timestamp: v.Optional; }, undefined>; export declare const pokePartBodySchema: v.ObjectType<{ pokeID: v.Type; lastMutationIDChanges: v.Optional>; desiredQueriesPatches: v.Optional>; gotQueriesPatch: v.Optional<({ ttl?: number | undefined; op: "put"; hash: string; } | { op: "del"; hash: string; } | { op: "clear"; })[]>; rowsPatch: v.Optional<({ op: "put"; tableName: string; value: Readonly>; } | { merge?: import("../../shared/src/json.ts").ReadonlyJSONObject | undefined; constrain?: string[] | undefined; op: "update"; tableName: string; id: Readonly>; } | { op: "del"; tableName: string; id: Readonly>; } | { op: "clear"; })[]>; mutationsPatch: v.Optional<({ op: "put"; mutation: { id: { id: number; clientID: string; }; result: { data?: import("../../shared/src/json.ts").ReadonlyJSONValue | undefined; } | { details?: import("../../shared/src/json.ts").ReadonlyJSONValue | undefined; error: "app"; } | { details?: import("../../shared/src/json.ts").ReadonlyJSONValue | undefined; error: "oooMutation" | "alreadyProcessed"; }; }; } | { op: "del"; id: { id: number; clientID: string; }; })[]>; }, undefined>; export declare const pokeEndBodySchema: v.ObjectType<{ pokeID: v.Type; cookie: v.Type; cancel: v.Optional; }, undefined>; export declare const pokeStartMessageSchema: v.TupleType<[v.Type<"pokeStart">, v.ObjectType<{ pokeID: v.Type; baseCookie: v.UnionType<[v.Type, v.Type]>; /** * This field is always set if the poke contains a `rowsPatch`. * It may be absent for patches that only update clients and queries. */ schemaVersions: v.Optional<{ minSupportedVersion: number; maxSupportedVersion: number; }>; timestamp: v.Optional; }, undefined>]>; export declare const pokePartMessageSchema: v.TupleType<[v.Type<"pokePart">, v.ObjectType<{ pokeID: v.Type; lastMutationIDChanges: v.Optional>; desiredQueriesPatches: v.Optional>; gotQueriesPatch: v.Optional<({ ttl?: number | undefined; op: "put"; hash: string; } | { op: "del"; hash: string; } | { op: "clear"; })[]>; rowsPatch: v.Optional<({ op: "put"; tableName: string; value: Readonly>; } | { merge?: import("../../shared/src/json.ts").ReadonlyJSONObject | undefined; constrain?: string[] | undefined; op: "update"; tableName: string; id: Readonly>; } | { op: "del"; tableName: string; id: Readonly>; } | { op: "clear"; })[]>; mutationsPatch: v.Optional<({ op: "put"; mutation: { id: { id: number; clientID: string; }; result: { data?: import("../../shared/src/json.ts").ReadonlyJSONValue | undefined; } | { details?: import("../../shared/src/json.ts").ReadonlyJSONValue | undefined; error: "app"; } | { details?: import("../../shared/src/json.ts").ReadonlyJSONValue | undefined; error: "oooMutation" | "alreadyProcessed"; }; }; } | { op: "del"; id: { id: number; clientID: string; }; })[]>; }, undefined>]>; export declare const pokeEndMessageSchema: v.TupleType<[v.Type<"pokeEnd">, v.ObjectType<{ pokeID: v.Type; cookie: v.Type; cancel: v.Optional; }, undefined>]>; export type PokeStartBody = v.Infer; export type PokePartBody = v.Infer; export type PokeEndBody = v.Infer; export type PokeStartMessage = v.Infer; export type PokePartMessage = v.Infer; export type PokeEndMessage = v.Infer; //# sourceMappingURL=poke.d.ts.map