import type { ReplicacheImpl } from '../../../../replicache/src/replicache-impl.ts'; import type { ReadonlyJSONValue } from '../../../../shared/src/json.ts'; import { type ReadonlyTDigest } from '../../../../shared/src/tdigest.ts'; import * as valita from '../../../../shared/src/valita.ts'; import type { AST } from '../../../../zero-protocol/src/ast.ts'; import type { Row } from '../../../../zero-protocol/src/data.ts'; import { type InspectDownBody, type ServerMetrics as ServerMetricsJSON } from '../../../../zero-protocol/src/inspect-down.ts'; import type { InspectUpBody } from '../../../../zero-protocol/src/inspect-up.ts'; import type { ClientMetricMap, ServerMetricMap } from '../../../../zql/src/query/metrics-delegate.ts'; import type { MutatorDefs } from '../replicache-types.ts'; import { Client } from './client.ts'; import { type Lazy } from './inspector.ts'; import { Query } from './query.ts'; export type GetWebSocket = () => Promise; export type Metrics = { readonly [K in keyof (ClientMetricMap & ServerMetricMap)]: ReadonlyTDigest; }; type DistributiveOmit = T extends object ? Omit : never; export declare function rpc(socket: WebSocket, arg: DistributiveOmit, downSchema: valita.Type): Promise; export declare function mergeMetrics(clientMetrics: ClientMetrics | undefined, serverMetrics: ServerMetricsJSON | null | undefined): ClientMetrics & ServerMetrics; export declare function inspectorMetrics(delegate: ExtendedInspectorDelegate): Promise; export declare function inspectorClients(delegate: ExtendedInspectorDelegate): Promise; export declare function inspectorClientsWithQueries(delegate: ExtendedInspectorDelegate): Promise; export declare function clientGroupClients(delegate: ExtendedInspectorDelegate, clientGroupID: Promise | string): Promise; export declare function clientGroupClientsWithQueries(delegate: ExtendedInspectorDelegate, clientGroupID: Promise | string): Promise; export declare function clientGroupQueries(delegate: ExtendedInspectorDelegate): Promise; export declare function clientMap(delegate: ExtendedInspectorDelegate, clientID: string): Promise>; export declare function clientRows(delegate: ExtendedInspectorDelegate, clientID: string, tableName: string): Promise; export declare function serverVersion(delegate: ExtendedInspectorDelegate): Promise; export declare function clientQueries(delegate: ExtendedInspectorDelegate, clientID: string): Promise; export interface InspectorDelegate { getQueryMetrics(hash: string): ClientMetrics | undefined; getAST(queryID: string): AST | undefined; readonly metrics: ClientMetrics; } export interface ExtendedInspectorDelegate extends InspectorDelegate { readonly rep: Rep; readonly getSocket: () => Promise; lazy: Promise; } export type Rep = ReplicacheImpl; export type ClientMetrics = { readonly [K in keyof ClientMetricMap]: ReadonlyTDigest; }; export type ServerMetrics = { readonly [K in keyof ServerMetricMap]: ReadonlyTDigest; }; export {}; //# sourceMappingURL=lazy-inspector.d.ts.map