import * as rpc from "vscode-jsonrpc/node"; import { Cursor } from "../../tree"; export declare function setCacheSizeProvider(provider: () => { local: number; remote: number; refs: number; }): void; /** * Extracts the sourcePath from a tree object, either directly from a SourceFile * or by finding the nearest SourceFile via a cursor. * * @param tree The tree object to extract sourcePath from * @param cursor Optional cursor to find the nearest SourceFile * @returns The sourcePath or empty string if not found */ export declare function extractSourcePath(tree: any, cursor?: Cursor): string; /** * Initializes the metrics CSV file with a header if it doesn't already exist or is empty. * If the file already contains the correct header, this function is a no-op. * * @param metricsCsv The path to the CSV file for recording metrics * @param logger Optional logger for warnings */ export declare function initializeMetricsCsv(metricsCsv?: string, logger?: rpc.Logger): void; /** * Wraps an RPC request handler to record performance metrics to a CSV file. * * @param requestType The request type name (e.g., "Visit", "GetObject") * @param metricsCsv Optional path to the CSV file for recording metrics * @param handlerFactory A function that creates the handler with a mutable context for setting the target * @returns A request handler compatible with rpc.MessageConnection#onRequest */ export declare function withMetrics(requestType: string, metricsCsv: string | undefined, handlerFactory: (context: { target: string; }) => (request: P) => Promise): (request: P) => Promise; /** * Wraps an RPC request handler without parameters (RequestType0) to record performance metrics. * * @param requestType The request type name (e.g., "GetLanguages", "GetRecipes") * @param metricsCsv Optional path to the CSV file for recording metrics * @param handlerFactory A function that creates the handler with a mutable context for setting the target * @returns A request handler compatible with rpc.MessageConnection#onRequest */ export declare function withMetrics0(requestType: string, metricsCsv: string | undefined, handlerFactory: (context: { target: string; }) => () => Promise): (token: any) => Promise; //# sourceMappingURL=metrics.d.ts.map