import { type ExportResult } from '@opentelemetry/core';
import { OTLPMetricExporter } from '@opentelemetry/exporter-metrics-otlp-proto';
import { OTLPTraceExporter } from '@opentelemetry/exporter-trace-otlp-proto';
import type { ResourceMetrics } from '@opentelemetry/sdk-metrics';
import type { ReadableSpan } from '@opentelemetry/sdk-trace-base';
/**
 * Session-scoped latch that stops Cloud uploads after the project reports data recording is
 * disabled.
 */
declare class UploadGate {
    private isDisabled;
    private currentGeneration;
    /** Re-enables uploads and invalidates responses from the previous session. */
    reset(): void;
    /** Whether Cloud uploads are disabled for the current session. */
    get disabled(): boolean;
    /** Current session generation used to isolate in-flight responses across resets. */
    get generation(): number;
    /**
     * Disables uploads for the matching session generation and emits the session warning once.
     *
     * @param generation - Generation that received the disabled response.
     */
    disable(generation?: number): void;
    /** Returns whether an HTTP response is the known project-recording-disabled rejection. */
    isDisabledResponse(statusCode: number, body: Uint8Array | ArrayBuffer | string): boolean;
}
/** Shared upload gate for LiveKit Cloud telemetry and recording transports. */
export declare const uploadGate: UploadGate;
/**
 * Sends a Fetch request through the upload gate and converts the known disabled response to
 * synthetic success.
 */
export declare function fetchWithUploadGate(input: RequestInfo | URL, init?: RequestInit): Promise<Response>;
/**
 * OTLP trace exporter that applies the shared upload gate without modifying process-wide HTTP
 * functions.
 */
export declare class UploadGateTraceExporter extends OTLPTraceExporter {
    /** Exports spans, converting the known disabled response to synthetic success. */
    export(items: ReadableSpan[], resultCallback: (result: ExportResult) => void): void;
}
/** OTLP metric exporter that shares the recording-disabled upload gate. */
export declare class UploadGateMetricExporter extends OTLPMetricExporter {
    export(items: ResourceMetrics, resultCallback: (result: ExportResult) => void): void;
}
export {};
//# sourceMappingURL=upload_gate.d.ts.map