import type { ReadonlyJSONValue } from '../../../shared/src/json.ts';
import { TDigest } from '../../../shared/src/tdigest.ts';
import type { AST } from '../../../zero-protocol/src/ast.ts';
import type { ServerMetrics as ServerMetricsJSON } from '../../../zero-protocol/src/inspect-down.ts';
import { type MetricMap, type MetricsDelegate } from '../../../zql/src/query/metrics-delegate.ts';
import type { CustomQueryTransformer } from '../custom-queries/transform-query.ts';
import type { ConnectionContext } from '../services/view-syncer/connection-context-manager.ts';
/**
 * Server-side metrics collected for queries during materialization and update.
 * These metrics are reported via the inspector and complement client-side metrics.
 */
export type ServerMetrics = {
    'query-materialization-server': TDigest;
    'query-update-server': TDigest;
};
type ClientGroupID = string;
export declare class InspectorDelegate implements MetricsDelegate {
    #private;
    constructor(customQueryTransformer: CustomQueryTransformer | undefined);
    addMetric<K extends keyof MetricMap>(metric: K, value: number, ...args: MetricMap[K]): void;
    getMetricsJSONForQuery(queryID: string): ServerMetricsJSON | null;
    getMetricsJSON(): {
        'query-materialization-server': [number, ...number[]];
        'query-update-server': [number, ...number[]];
    };
    getASTForQuery(queryID: string): AST | undefined;
    removeQuery(queryID: string): void;
    addQuery(queryID: string, ast: AST): void;
    /**
     * Check if the client is authenticated. We only require authentication once
     * per "worker".
     */
    isAuthenticated(clientGroupID: ClientGroupID): boolean;
    setAuthenticated(clientGroupID: ClientGroupID): void;
    clearAuthenticated(clientGroupID: ClientGroupID): void;
    /**
     * Transforms a single custom query by name and args using the configured
     * CustomQueryTransformer. This is primarily used by the inspector to transform
     * queries for analysis.
     */
    transformCustomQuery(name: string, args: readonly ReadonlyJSONValue[], ctx: ConnectionContext): Promise<AST>;
}
export {};
//# sourceMappingURL=inspector-delegate.d.ts.map