import * as v from '../../shared/src/valita.ts';
declare const serverMetricsSchema: 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>;
export type ServerMetrics = v.Infer<typeof serverMetricsSchema>;
declare const inspectQueryRowSchema: 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>;
export type InspectQueryRow = v.Infer<typeof inspectQueryRowSchema>;
export declare const inspectQueriesDownSchema: v.ObjectType<Omit<{
    id: v.Type<string>;
}, "value" | "op"> & {
    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>;
export type InspectQueriesDown = v.Infer<typeof inspectQueriesDownSchema>;
export declare const inspectMetricsDownSchema: v.ObjectType<Omit<{
    id: v.Type<string>;
}, "value" | "op"> & {
    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>;
export type InspectMetricsDown = v.Infer<typeof inspectMetricsDownSchema>;
export declare const inspectVersionDownSchema: v.ObjectType<Omit<{
    id: v.Type<string>;
}, "value" | "op"> & {
    op: v.Type<"version">;
    value: v.Type<string>;
}, undefined>;
export declare const inspectAuthenticatedDownSchema: v.ObjectType<Omit<{
    id: v.Type<string>;
}, "value" | "op"> & {
    op: v.Type<"authenticated">;
    value: v.Type<boolean>;
}, undefined>;
export type InspectAuthenticatedDown = v.Infer<typeof inspectAuthenticatedDownSchema>;
export declare const inspectAnalyzeQueryDownSchema: v.ObjectType<Omit<{
    id: v.Type<string>;
}, "value" | "op"> & {
    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>>[]>>>;
        sqlitePlans: 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>;
        dbScansByQuery: v.Optional<Record<string, Record<string, number>>>;
        joinPlans: v.Optional<({
            type: "attempt-start";
            attemptNumber: number;
            totalAttempts: number;
        } | {
            type: "connection-costs";
            attemptNumber: number;
            costs: {
                connection: string;
                cost: number;
                costEstimate: {
                    limit?: number | undefined;
                    startupCost: number;
                    scanEst: number;
                    cost: number;
                    returnedRows: number;
                    selectivity: number;
                };
                pinned: boolean;
                constraints: Record<string, Record<string, unknown> | null>;
                constraintCosts: Record<string, {
                    limit?: number | undefined;
                    startupCost: number;
                    scanEst: number;
                    cost: number;
                    returnedRows: number;
                    selectivity: number;
                }>;
            }[];
        } | {
            type: "connection-selected";
            attemptNumber: number;
            connection: string;
            cost: number;
            isRoot: boolean;
        } | {
            type: "constraints-propagated";
            attemptNumber: number;
            connectionConstraints: {
                connection: string;
                constraints: Record<string, Record<string, unknown> | null>;
                constraintCosts: Record<string, {
                    limit?: number | undefined;
                    startupCost: number;
                    scanEst: number;
                    cost: number;
                    returnedRows: number;
                    selectivity: number;
                }>;
            }[];
        } | {
            type: "plan-complete";
            attemptNumber: number;
            totalCost: number;
            flipPattern: number;
            joinStates: {
                join: string;
                type: "semi" | "flipped" | "unflippable";
            }[];
        } | {
            type: "plan-failed";
            attemptNumber: number;
            reason: string;
        } | {
            type: "best-plan-selected";
            bestAttemptNumber: number;
            totalCost: number;
            flipPattern: number;
            joinStates: {
                join: string;
                type: "semi" | "flipped" | "unflippable";
            }[];
        } | {
            attemptNumber?: number | undefined;
            filters?: import("./ast.ts").Condition | undefined;
            ordering?: readonly (readonly [string, "desc" | "asc"])[] | undefined;
            joinType?: "semi" | "flipped" | "unflippable" | undefined;
            type: "node-cost";
            nodeType: "join" | "connection" | "fan-out" | "fan-in" | "terminus";
            node: string;
            branchPattern: number[];
            downstreamChildSelectivity: number;
            costEstimate: {
                limit?: number | undefined;
                startupCost: number;
                scanEst: number;
                cost: number;
                returnedRows: number;
                selectivity: number;
            };
        } | {
            attemptNumber?: number | undefined;
            constraint?: Record<string, unknown> | null | undefined;
            type: "node-constraint";
            nodeType: "join" | "connection" | "fan-out" | "fan-in" | "terminus";
            node: string;
            branchPattern: number[];
            from: string;
        })[]>;
    }, undefined>;
}, undefined>;
export type InspectAnalyzeQueryDown = v.Infer<typeof inspectAnalyzeQueryDownSchema>;
export declare const inspectErrorDownSchema: v.ObjectType<Omit<{
    id: v.Type<string>;
}, "value" | "op"> & {
    op: v.Type<"error">;
    value: v.Type<string>;
}, undefined>;
export type InspectErrorDown = v.Infer<typeof inspectErrorDownSchema>;
export declare const inspectDownBodySchema: v.UnionType<[v.ObjectType<Omit<{
    id: v.Type<string>;
}, "value" | "op"> & {
    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>;
}, "value" | "op"> & {
    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>;
}, "value" | "op"> & {
    op: v.Type<"version">;
    value: v.Type<string>;
}, undefined>, v.ObjectType<Omit<{
    id: v.Type<string>;
}, "value" | "op"> & {
    op: v.Type<"authenticated">;
    value: v.Type<boolean>;
}, undefined>, v.ObjectType<Omit<{
    id: v.Type<string>;
}, "value" | "op"> & {
    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>>[]>>>;
        sqlitePlans: 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>;
        dbScansByQuery: v.Optional<Record<string, Record<string, number>>>;
        joinPlans: v.Optional<({
            type: "attempt-start";
            attemptNumber: number;
            totalAttempts: number;
        } | {
            type: "connection-costs";
            attemptNumber: number;
            costs: {
                connection: string;
                cost: number;
                costEstimate: {
                    limit?: number | undefined;
                    startupCost: number;
                    scanEst: number;
                    cost: number;
                    returnedRows: number;
                    selectivity: number;
                };
                pinned: boolean;
                constraints: Record<string, Record<string, unknown> | null>;
                constraintCosts: Record<string, {
                    limit?: number | undefined;
                    startupCost: number;
                    scanEst: number;
                    cost: number;
                    returnedRows: number;
                    selectivity: number;
                }>;
            }[];
        } | {
            type: "connection-selected";
            attemptNumber: number;
            connection: string;
            cost: number;
            isRoot: boolean;
        } | {
            type: "constraints-propagated";
            attemptNumber: number;
            connectionConstraints: {
                connection: string;
                constraints: Record<string, Record<string, unknown> | null>;
                constraintCosts: Record<string, {
                    limit?: number | undefined;
                    startupCost: number;
                    scanEst: number;
                    cost: number;
                    returnedRows: number;
                    selectivity: number;
                }>;
            }[];
        } | {
            type: "plan-complete";
            attemptNumber: number;
            totalCost: number;
            flipPattern: number;
            joinStates: {
                join: string;
                type: "semi" | "flipped" | "unflippable";
            }[];
        } | {
            type: "plan-failed";
            attemptNumber: number;
            reason: string;
        } | {
            type: "best-plan-selected";
            bestAttemptNumber: number;
            totalCost: number;
            flipPattern: number;
            joinStates: {
                join: string;
                type: "semi" | "flipped" | "unflippable";
            }[];
        } | {
            attemptNumber?: number | undefined;
            filters?: import("./ast.ts").Condition | undefined;
            ordering?: readonly (readonly [string, "desc" | "asc"])[] | undefined;
            joinType?: "semi" | "flipped" | "unflippable" | undefined;
            type: "node-cost";
            nodeType: "join" | "connection" | "fan-out" | "fan-in" | "terminus";
            node: string;
            branchPattern: number[];
            downstreamChildSelectivity: number;
            costEstimate: {
                limit?: number | undefined;
                startupCost: number;
                scanEst: number;
                cost: number;
                returnedRows: number;
                selectivity: number;
            };
        } | {
            attemptNumber?: number | undefined;
            constraint?: Record<string, unknown> | null | undefined;
            type: "node-constraint";
            nodeType: "join" | "connection" | "fan-out" | "fan-in" | "terminus";
            node: string;
            branchPattern: number[];
            from: string;
        })[]>;
    }, undefined>;
}, undefined>, v.ObjectType<Omit<{
    id: v.Type<string>;
}, "value" | "op"> & {
    op: v.Type<"error">;
    value: v.Type<string>;
}, undefined>]>;
export declare const inspectDownMessageSchema: v.TupleType<[v.Type<"inspect">, v.UnionType<[v.ObjectType<Omit<{
    id: v.Type<string>;
}, "value" | "op"> & {
    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>;
}, "value" | "op"> & {
    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>;
}, "value" | "op"> & {
    op: v.Type<"version">;
    value: v.Type<string>;
}, undefined>, v.ObjectType<Omit<{
    id: v.Type<string>;
}, "value" | "op"> & {
    op: v.Type<"authenticated">;
    value: v.Type<boolean>;
}, undefined>, v.ObjectType<Omit<{
    id: v.Type<string>;
}, "value" | "op"> & {
    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>>[]>>>;
        sqlitePlans: 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>;
        dbScansByQuery: v.Optional<Record<string, Record<string, number>>>;
        joinPlans: v.Optional<({
            type: "attempt-start";
            attemptNumber: number;
            totalAttempts: number;
        } | {
            type: "connection-costs";
            attemptNumber: number;
            costs: {
                connection: string;
                cost: number;
                costEstimate: {
                    limit?: number | undefined;
                    startupCost: number;
                    scanEst: number;
                    cost: number;
                    returnedRows: number;
                    selectivity: number;
                };
                pinned: boolean;
                constraints: Record<string, Record<string, unknown> | null>;
                constraintCosts: Record<string, {
                    limit?: number | undefined;
                    startupCost: number;
                    scanEst: number;
                    cost: number;
                    returnedRows: number;
                    selectivity: number;
                }>;
            }[];
        } | {
            type: "connection-selected";
            attemptNumber: number;
            connection: string;
            cost: number;
            isRoot: boolean;
        } | {
            type: "constraints-propagated";
            attemptNumber: number;
            connectionConstraints: {
                connection: string;
                constraints: Record<string, Record<string, unknown> | null>;
                constraintCosts: Record<string, {
                    limit?: number | undefined;
                    startupCost: number;
                    scanEst: number;
                    cost: number;
                    returnedRows: number;
                    selectivity: number;
                }>;
            }[];
        } | {
            type: "plan-complete";
            attemptNumber: number;
            totalCost: number;
            flipPattern: number;
            joinStates: {
                join: string;
                type: "semi" | "flipped" | "unflippable";
            }[];
        } | {
            type: "plan-failed";
            attemptNumber: number;
            reason: string;
        } | {
            type: "best-plan-selected";
            bestAttemptNumber: number;
            totalCost: number;
            flipPattern: number;
            joinStates: {
                join: string;
                type: "semi" | "flipped" | "unflippable";
            }[];
        } | {
            attemptNumber?: number | undefined;
            filters?: import("./ast.ts").Condition | undefined;
            ordering?: readonly (readonly [string, "desc" | "asc"])[] | undefined;
            joinType?: "semi" | "flipped" | "unflippable" | undefined;
            type: "node-cost";
            nodeType: "join" | "connection" | "fan-out" | "fan-in" | "terminus";
            node: string;
            branchPattern: number[];
            downstreamChildSelectivity: number;
            costEstimate: {
                limit?: number | undefined;
                startupCost: number;
                scanEst: number;
                cost: number;
                returnedRows: number;
                selectivity: number;
            };
        } | {
            attemptNumber?: number | undefined;
            constraint?: Record<string, unknown> | null | undefined;
            type: "node-constraint";
            nodeType: "join" | "connection" | "fan-out" | "fan-in" | "terminus";
            node: string;
            branchPattern: number[];
            from: string;
        })[]>;
    }, undefined>;
}, undefined>, v.ObjectType<Omit<{
    id: v.Type<string>;
}, "value" | "op"> & {
    op: v.Type<"error">;
    value: v.Type<string>;
}, undefined>]>]>;
export type InspectDownMessage = v.Infer<typeof inspectDownMessageSchema>;
export type InspectDownBody = v.Infer<typeof inspectDownBodySchema>;
export {};
//# sourceMappingURL=inspect-down.d.ts.map