import * as v from '../../shared/src/valita.ts';
export declare const downstreamSchema: v.UnionType<[v.TupleType<[v.Type<"connected">, v.ObjectType<{
    wsid: v.Type<string>;
    timestamp: v.Optional<number>;
}, undefined>]>, v.Type<import("./error.ts").ErrorMessage>, v.TupleType<[v.Type<"pong">, v.ObjectType<{}, undefined>]>, v.TupleType<[v.Type<"pokeStart">, v.ObjectType<{
    pokeID: v.Type<string>;
    baseCookie: v.UnionType<[v.Type<string>, v.Type<null>]>;
    schemaVersions: v.Optional<{
        minSupportedVersion: number;
        maxSupportedVersion: number;
    }>;
    timestamp: v.Optional<number>;
}, undefined>]>, v.TupleType<[v.Type<"pokePart">, v.ObjectType<{
    pokeID: v.Type<string>;
    lastMutationIDChanges: v.Optional<Record<string, number>>;
    desiredQueriesPatches: v.Optional<Record<string, ({
        ttl?: number | undefined;
        op: "put";
        hash: string;
    } | {
        op: "del";
        hash: string;
    } | {
        op: "clear";
    })[]>>;
    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<Record<string, import("../../shared/src/json.ts").ReadonlyJSONValue | undefined>>;
    } | {
        merge?: import("../../shared/src/json.ts").ReadonlyJSONObject | undefined;
        constrain?: string[] | undefined;
        op: "update";
        tableName: string;
        id: Readonly<Record<string, string | number | boolean>>;
    } | {
        op: "del";
        tableName: string;
        id: Readonly<Record<string, string | number | boolean>>;
    } | {
        op: "clear";
    })[]>;
    mutationsPatch: v.Optional<({
        op: "put";
        mutation: {
            id: {
                id: number;
                clientID: string;
            };
            result: {
                details?: import("../../shared/src/json.ts").ReadonlyJSONValue | undefined;
                error: "app";
            } | {
                details?: import("../../shared/src/json.ts").ReadonlyJSONValue | undefined;
                error: "oooMutation" | "alreadyProcessed";
            } | {
                data?: import("../../shared/src/json.ts").ReadonlyJSONValue | undefined;
            };
        };
    } | {
        op: "del";
        id: {
            id: number;
            clientID: string;
        };
    })[]>;
}, undefined>]>, v.TupleType<[v.Type<"pokeEnd">, v.ObjectType<{
    pokeID: v.Type<string>;
    cookie: v.Type<string>;
    cancel: v.Optional<boolean>;
}, undefined>]>, v.TupleType<[v.Type<"pull">, v.ObjectType<{
    cookie: v.Type<string>;
    requestID: v.Type<string>;
    lastMutationIDChanges: v.Type<Record<string, number>>;
}, undefined>]>, v.TupleType<[v.Type<"deleteClients">, v.UnionType<[v.ObjectType<Readonly<{
    clientIDs: v.Optional<readonly string[]>;
    clientGroupIDs: v.Optional<readonly string[]>;
}>, undefined>]>]>, v.TupleType<[v.Type<"pushResponse">, v.UnionType<[v.ObjectType<{
    mutations: v.ArrayType<v.ObjectType<{
        id: v.ObjectType<{
            id: v.Type<number>;
            clientID: v.Type<string>;
        }, undefined>;
        result: v.UnionType<[v.ObjectType<{
            data: v.Optional<import("../../shared/src/json.ts").ReadonlyJSONValue>;
        }, undefined>, v.UnionType<[v.ObjectType<{
            error: v.Type<"app">;
            details: v.Optional<import("../../shared/src/json.ts").ReadonlyJSONValue>;
        }, undefined>, v.ObjectType<{
            error: v.Type<"oooMutation" | "alreadyProcessed">;
            details: v.Optional<import("../../shared/src/json.ts").ReadonlyJSONValue>;
        }, undefined>]>]>;
    }, undefined>>;
}, undefined>, v.UnionType<[v.ObjectType<{
    error: v.Type<"unsupportedPushVersion">;
    mutationIDs: v.Optional<{
        id: number;
        clientID: string;
    }[]>;
}, undefined>, v.ObjectType<{
    error: v.Type<"unsupportedSchemaVersion">;
    mutationIDs: v.Optional<{
        id: number;
        clientID: string;
    }[]>;
}, undefined>, v.ObjectType<{
    error: v.Type<"http">;
    status: v.Type<number>;
    details: v.Type<string>;
    mutationIDs: v.Optional<{
        id: number;
        clientID: string;
    }[]>;
}, undefined>, v.ObjectType<{
    error: v.Type<"zeroPusher">;
    details: v.Type<string>;
    mutationIDs: v.Optional<{
        id: number;
        clientID: string;
    }[]>;
}, undefined>]>]>]>, v.TupleType<[v.Type<"inspect">, v.UnionType<[v.ObjectType<Omit<{
    id: v.Type<string>;
}, "op" | "value"> & {
    op: v.Type<"queries">;
    value: v.ArrayType<v.ObjectType<{
        clientID: v.Type<string>;
        queryID: v.Type<string>;
        ast: v.Type<import("./ast.ts").AST | null>;
        name: v.Type<string | null>;
        args: v.Type<readonly import("../../shared/src/json.ts").ReadonlyJSONValue[] | null>;
        got: v.Type<boolean>;
        deleted: v.Type<boolean>;
        ttl: v.Type<number>;
        inactivatedAt: v.Type<number | null>;
        rowCount: v.Type<number>;
        metrics: v.Optional<{
            'query-materialization-server': [number, ...number[]];
            'query-update-server': [number, ...number[]];
        } | null>;
    }, undefined>>;
}, undefined>, v.ObjectType<Omit<{
    id: v.Type<string>;
}, "op" | "value"> & {
    op: v.Type<"metrics">;
    value: v.ObjectType<{
        'query-materialization-server': v.VariadicTupleType<[v.Type<number>], v.Type<number>, []>;
        'query-update-server': v.VariadicTupleType<[v.Type<number>], v.Type<number>, []>;
    }, undefined>;
}, undefined>, v.ObjectType<Omit<{
    id: v.Type<string>;
}, "op" | "value"> & {
    op: v.Type<"version">;
    value: v.Type<string>;
}, undefined>, v.ObjectType<Omit<{
    id: v.Type<string>;
}, "op" | "value"> & {
    op: v.Type<"authenticated">;
    value: v.Type<boolean>;
}, undefined>, v.ObjectType<Omit<{
    id: v.Type<string>;
}, "op" | "value"> & {
    op: v.Type<"analyze-query">;
    value: v.ObjectType<{
        warnings: v.ArrayType<v.Type<string>>;
        syncedRows: v.Optional<Record<string, Readonly<Record<string, import("../../shared/src/json.ts").ReadonlyJSONValue | undefined>>[]>>;
        syncedRowCount: v.Type<number>;
        start: v.Type<number>;
        end: v.Type<number>;
        elapsed: v.Optional<number>;
        afterPermissions: v.Optional<string>;
        vendedRowCounts: v.Optional<Record<string, Record<string, number>>>;
        vendedRows: v.Optional<Record<string, Record<string, Readonly<Record<string, import("../../shared/src/json.ts").ReadonlyJSONValue | undefined>>[]>>>;
        plans: v.Optional<Record<string, string[]>>;
        readRows: v.Optional<Record<string, Record<string, Readonly<Record<string, import("../../shared/src/json.ts").ReadonlyJSONValue | undefined>>[]>>>;
        readRowCountsByQuery: v.Optional<Record<string, Record<string, number>>>;
        readRowCount: v.Optional<number>;
    }, undefined>;
}, undefined>, v.ObjectType<Omit<{
    id: v.Type<string>;
}, "op" | "value"> & {
    op: v.Type<"error">;
    value: v.Type<string>;
}, undefined>]>]>, v.TupleType<[v.Type<"transformError">, v.ArrayType<v.UnionType<[v.ObjectType<{
    error: v.Type<"app">;
    id: v.Type<string>;
    name: v.Type<string>;
    details: v.Type<import("../../shared/src/json.ts").ReadonlyJSONValue>;
}, undefined>, v.ObjectType<{
    error: v.Type<"http">;
    id: v.Type<string>;
    name: v.Type<string>;
    status: v.Type<number>;
    details: v.Type<import("../../shared/src/json.ts").ReadonlyJSONValue>;
}, undefined>, v.ObjectType<{
    error: v.Type<"zero">;
    id: v.Type<string>;
    name: v.Type<string>;
    details: v.Type<import("../../shared/src/json.ts").ReadonlyJSONValue>;
}, undefined>]>>]>]>;
export type Downstream = v.Infer<typeof downstreamSchema>;
//# sourceMappingURL=down.d.ts.map