import { PublishOption, TrackInfo, TrackType } from '../gen/video/sfu/models/models';
import { BasePeerConnection } from './BasePeerConnection';
import type { BasePeerConnectionOpts, TrackPublishOptions } from './types';
/**
 * The `Publisher` is responsible for publishing/unpublishing media streams to/from the SFU
 *
 * @internal
 */
export declare class Publisher extends BasePeerConnection {
    private readonly transceiverCache;
    private readonly clonedTracks;
    private publishOptions;
    private readonly selfSubEnabled;
    /**
     * Constructs a new `Publisher` instance.
     */
    constructor(baseOptions: BasePeerConnectionOpts, publishOptions: PublishOption[], opts?: {
        selfSubEnabled?: boolean;
    });
    /**
     * Disposes this Publisher instance.
     */
    dispose(): Promise<void>;
    /**
     * Starts publishing the given track of the given media stream.
     *
     * Consecutive calls to this method will replace the stream.
     * The previous stream will be stopped.
     *
     * @param track the track to publish.
     * @param trackType the track type to publish.
     * @param options the publish options to use.
     */
    publish: (track: MediaStreamTrack, trackType: TrackType, options?: TrackPublishOptions) => Promise<void>;
    /**
     * Adds a new transceiver carrying the given track to the peer connection.
     */
    private addTransceiver;
    /**
     * Updates the transceiver with the given track and track type.
     */
    private updateTransceiver;
    /**
     * Updates the publish options for the given track type.
     */
    private updateAudioPublishOptions;
    /**
     * Synchronizes the current Publisher state with the provided publish options.
     */
    private syncPublishOptions;
    /**
     * Returns true if the given track type is currently being published to the SFU.
     *
     * @param trackType the track type to check. If omitted, checks if any track is being published.
     */
    isPublishing: (trackType?: TrackType) => boolean;
    /**
     * Re-arms the encoder for the given track type by detaching and
     * reattaching the currently published track on each matching sender.
     *
     * Workaround for a WebKit / iOS Safari quirk: after a system audio
     * session interruption (Siri, PSTN call), the `RTCRtpSender` encoder
     * can stop producing RTP packets even though the underlying
     * `MediaStreamTrack` is `live` and `track.muted === false`.
     * `replaceTrack(null)` followed by `replaceTrack(track)` resets the
     * sender's encoder pipeline without renegotiation, restoring packet
     * flow with the same SSRC.
     *
     * No-op when nothing is published for the given track type.
     *
     * @param trackType the track type to refresh.
     */
    refreshTrack: (trackType: TrackType) => Promise<void>;
    /**
     * Stops the cloned track that is being published to the SFU.
     */
    stopTracks: (...trackTypes: TrackType[]) => Promise<void>;
    /**
     * Stops all the cloned tracks that are being published to the SFU.
     */
    stopAllTracks: () => Promise<void>;
    private changePublishQuality;
    /**
     * Restarts the ICE connection and renegotiates with the SFU.
     */
    restartIce: () => Promise<void>;
    /**
     * Initiates a new offer/answer exchange with the currently connected SFU.
     *
     * @param options the optional offer options to use.
     */
    private negotiate;
    /**
     * Returns a list of tracks that are currently being published.
     */
    getPublishedTracks: () => MediaStreamTrack[];
    /**
     * Returns a list of tracks that are currently being published.
     * @param sdp an optional SDP to extract the `mid` from.
     */
    getAnnouncedTracks: (sdp: string | undefined) => TrackInfo[];
    /**
     * Returns a list of tracks that are currently being published.
     * This method shall be used for the reconnection flow.
     * There we shouldn't announce the tracks that have been stopped due to a codec switch.
     */
    getAnnouncedTracksForReconnect: () => TrackInfo[];
    /**
     * Converts the given transceiver to a `TrackInfo` object.
     */
    private toTrackInfo;
    private cloneTrack;
    private stopTrack;
    /**
     * Silences a Firefox sender on the wire during unpublish.
     *
     * Firefox keeps emitting RTP after track.stop(), but the right lever
     * differs by track type:
     *   - audio: `replaceTrack(null)` is the only reliable silencer;
     *     `setParameters({encodings:[...active:false]})` does NOT stop
     *     the Opus encoder.
     *   - video: `setParameters({encodings:[...active:false]})` pauses
     *     the encoder; `replaceTrack(null)` does NOT reliably stop the
     *     video encoder. The prior active=true configuration is captured
     *     onto `bundle.videoSender` so `updateTransceiver` can restore
     *     it on the next publish.
     *
     * No-op on non-Firefox browsers and during teardown.
     */
    private silenceSenderOnFirefox;
    private disableAllEncodings;
}
