import { Observable } from 'rxjs';
import { ICETrickle } from '../gen/video/sfu/event/events';
import { PeerType } from '../gen/video/sfu/models/models';
/**
 * A buffer for ICE Candidates. Used for ICE Trickle:
 * - https://bloggeek.me/webrtcglossary/trickle-ice/
 *
 * The buffer is generation-aware: each peer connection tells it which ICE
 * generation is current via `updateActiveGeneration` (whenever it applies an
 * offer/answer). Candidate streams then emit only candidates of the active
 * generation, hold candidates of a not-yet-applied (future) generation until
 * it becomes active, and drop candidates of a superseded generation so they
 * are never replayed. Candidates with no detectable generation, or before any
 * generation is set, are emitted as-is (fail open).
 */
export declare class IceTrickleBuffer {
    readonly subscriber: CandidateGenerationBuffer;
    readonly publisher: CandidateGenerationBuffer;
    push: (iceTrickle: ICETrickle) => void;
    /**
     * Declares the ICE generation that is now current for the given peer type,
     * derived from the `ice-ufrag` of the just-applied remote description.
     * Candidates of superseded generations are evicted; candidates of the active
     * generation flow to subscribers.
     */
    updateActiveGeneration: (peerType: PeerType, sdp: string | undefined) => void;
    dispose: () => void;
}
/**
 * Per-peer-connection generation-aware candidate store. Retains trickled
 * candidates and replays the active generation to each new subscriber, then
 * forwards matching live candidates.
 */
declare class CandidateGenerationBuffer {
    private readonly store;
    private readonly live;
    private readonly seenUfrags;
    private activeUfrag;
    readonly candidates: Observable<RTCIceCandidateInit>;
    push: (candidate: RTCIceCandidateInit) => void;
    updateActiveGeneration: (ufrag: string | undefined) => void;
    dispose: () => void;
    /**
     * A candidate belongs to the current generation when its ufrag matches the
     * active one. Fail open when either the candidate's generation or the active
     * generation is unknown, so untagged candidates are never withheld.
     */
    private isCurrent;
}
export {};
