import type { MeasureResult, ScanContext, ScanMetrics, Timer } from "./types.js"; /** * Starts a high-resolution timer using `performance.now()`. */ export declare function startTimer(): Timer; /** * Measures the execution time of a synchronous function. */ export declare function measure(fn: () => T): MeasureResult; /** * Measures the execution time of an asynchronous function. */ export declare function measureAsync(fn: () => Promise): Promise>; /** * Creates an empty or pre-populated `ScanMetrics` container. */ export declare function createScanMetrics(initial?: Partial): ScanMetrics; /** * Runs an asynchronous task within an `AsyncLocalStorage` scan context. */ export declare function runWithContext(context: ScanContext, fn: () => Promise | T): Promise; /** * Returns the currently active `ScanContext`, or `undefined` if none is active. */ export declare function getScanContext(): ScanContext | undefined; /** * Helper to record telemetry mutations on the currently active scan context. */ export declare function recordScanMetric(updater: (metrics: ScanMetrics) => void): void; /** * Internal WeakMap cache to eliminate allocations for repeated option objects on hot paths. */ export declare const internalOptionsCache: WeakMap;