export type AgentSpanAttributeValue = string | number | boolean | string[]; export interface AgentSpan { setAttribute(key: string, value: AgentSpanAttributeValue): void; setAttributes(attributes: Record): void; setStatus(status: { code: number; message?: string; }): void; recordException(exception: { name?: string; message: string; }): void; end(endTime?: unknown): void; } export declare const SPAN_STATUS_OK = 1; export declare const SPAN_STATUS_ERROR = 2; interface AgentTracer { startSpan(name: string, options?: { attributes?: Record; startTime?: unknown; }, context?: unknown): AgentSpan; } interface AgentTraceRuntime { tracer: AgentTracer; context?: { active(): unknown; with(context: unknown, callback: () => T): T; }; trace?: { setSpan(context: unknown, span: AgentSpan): unknown; }; } export type TrackingEventOrigin = "client" | "server"; export interface TrackingEventScope { pending: Set>; } export declare function createTrackingEventScope(): TrackingEventScope; export declare function registerTrackingWork(pending: Promise, scope?: TrackingEventScope): void; export declare function recordTrackingEvent(name: string, properties?: Record, origin?: TrackingEventOrigin): Promise; export declare function queueTrackingEvent(name: string, properties?: Record, origin?: TrackingEventOrigin, scope?: TrackingEventScope): void; export declare function flushTrackingEvents(scope?: TrackingEventScope): Promise; export declare function startAgentSpan(name: string, attributes?: Record, parentSpan?: AgentSpan | null, startTime?: unknown): Promise; export declare function withAgentSpanContext(span: AgentSpan | null, callback: () => T): T; export declare function endAgentSpan(span: AgentSpan | null, result?: { status?: "success" | "error" | "unset"; errorMessage?: string | null; attributes?: Record; endTime?: number; }): void; export declare function __resetAgentTracerCache(): void; export declare function __setAgentTracerForTests(tracer: AgentTracer | null): void; export declare function __setAgentTraceRuntimeForTests(runtime: AgentTraceRuntime | null): void; export {};