import { PeerType, TrackType } from '../../gen/video/sfu/models/models';
import type { ComputedStats, PendingDelta } from './types';
/**
 * StatsTracer is a class that collects and processes WebRTC stats.
 * It is used to track the performance of the WebRTC connection
 * and to provide information about the media streams.
 * It is used by both the Publisher and Subscriber classes.
 *
 * @internal
 */
export declare class StatsTracer {
    private readonly pc;
    private readonly peerType;
    private readonly trackIdToTrackType;
    private readonly driftThresholdMs;
    private readonly maxPendingDeltas;
    private readonly sampleTag;
    private costOverrides?;
    private previousSample;
    private frameTimeHistory;
    private fpsHistory;
    /**
     * The un-acked, delta-compressed samples awaiting delivery confirmation.
     * Each entry's delta is computed against the immediately preceding sample,
     * so the list forms a chain the server applies in order. The delivery
     * baseline advances only when the reporter calls `commitDeltas` after a
     * successful send; until then the chain is re-sent in full.
     */
    private pendingDeltas;
    /**
     * Creates a new StatsTracer instance.
     */
    constructor(pc: RTCPeerConnection, peerType: PeerType, trackIdToTrackType: Map<string, TrackType>, statsTimestampDriftThresholdMs?: number, maxPendingDeltas?: number);
    /**
     * Samples the RTCPeerConnection: returns the current stats report and the
     * derived performance stats, and appends the delta-compressed sample to the
     * un-acked delivery chain (retrieved via `getPendingDeltas`).
     *
     * @internal
     */
    takeSample: () => Promise<ComputedStats>;
    /**
     * Returns a stable copy of the un-acked delta chain to transmit, oldest first.
     *
     * @internal
     */
    getPendingDeltas: () => PendingDelta[];
    /**
     * Advances the delivery baseline by dropping exactly the deltas that were
     * confirmed delivered. Matching is by object identity, so a stale commit
     * that arrives after a re-anchor (which replaced the chain) is a safe no-op.
     *
     * @internal
     */
    commitDeltas: (sent: PendingDelta[]) => void;
    /**
     * Drops the un-acked chain without sending it. Used when delta reporting is
     * disabled so the chain can't grow unbounded.
     *
     * @internal
     */
    clearPendingDeltas: () => void;
    /**
     * Collects encode stats from the RTCPeerConnection.
     */
    private getEncodeStats;
    /**
     * Collects decode stats from the RTCPeerConnection.
     */
    private getDecodeStats;
    /**
     * Applies cost overrides to the performance stats.
     * This is used to override the default encode/decode times with custom values.
     * This is useful for testing and debugging purposes, and it shouldn't be used in production.
     */
    private withOverrides;
    /**
     * Set the encode/decode cost for a specific track type.
     * This is used to override the default encode/decode times with custom values.
     * This is useful for testing and debugging purposes, and it shouldn't be used in production.
     *
     * @internal
     */
    setCost: (cost: number, trackType?: TrackType) => void;
}
