import { DebounceType } from '../types';
import type { TrackSubscriptionDetails } from '../gen/video/sfu/signal_rpc/signal';
import { VideoDimension } from '../gen/video/sfu/models/models';
import { CallState } from '../store';
import type { StreamSfuClient } from '../StreamSfuClient';
import { Tracer } from '../stats';
/**
 * Per-participant (or global) video-subscription override.
 *
 * - `{ enabled: true, dimension }`: request video at a specific
 *   resolution. If set globally, applies to every remote participant
 *   that doesn't have a per-session override.
 * - `{ enabled: false }`: unsubscribe from video entirely. The SFU
 *   sends nothing; bandwidth is saved.
 */
export type VideoTrackSubscriptionOverride = {
    enabled: true;
    dimension: VideoDimension;
} | {
    enabled: false;
};
/** Symbol key for the "applies to all participants" override slot. */
declare const globalOverrideKey: unique symbol;
/**
 * Map of per-session overrides plus one optional global override under
 * the `globalOverrideKey` symbol slot.
 */
export interface VideoTrackSubscriptionOverrides {
    [sessionId: string]: VideoTrackSubscriptionOverride | undefined;
    [globalOverrideKey]?: VideoTrackSubscriptionOverride;
}
/**
 * Owns the SFU-side video-subscription machinery for a `Call`:
 *
 * - Holds the per-session / global override state in a
 *   `BehaviorSubject<VideoTrackSubscriptionOverrides>`.
 * - Derives the SFU subscription list from `CallState` participants +
 *   current overrides via the `subscriptions` getter.
 * - Debounces and pushes the list to the SFU through
 *   `sfuClient.updateSubscriptions`.
 * - Exposes `incomingVideoSettings$`: a consumer-friendly projection of
 *   the override state for React hooks.
 *
 * Owned by `DynascaleManager` as `readonly trackSubscriptionManager`.
 * `DynascaleManager.bindVideoElement` triggers `apply()` on every
 * dimension / visibility change.
 */
export declare class TrackSubscriptionManager {
    private logger;
    private callState;
    private tracer;
    private sfuClient;
    private pendingUpdate;
    private overridesSubject;
    overrides$: import("rxjs").Observable<VideoTrackSubscriptionOverrides>;
    /**
     * Consumer-friendly projection of the override state. Used by the
     * `useIncomingVideoSettings()` React hook.
     */
    incomingVideoSettings$: import("rxjs").Observable<{
        enabled: boolean;
        preferredResolution: VideoDimension | undefined;
        participants: {
            [k: string]: {
                enabled: boolean;
                preferredResolution: VideoDimension | undefined;
            };
        };
        isParticipantVideoEnabled: (sessionId: string) => boolean;
    }>;
    /**
     * Constructs new TrackSubscriptionManager instance.
     *
     * @param callState the call state.
     * @param tracer the tracer to use.
     */
    constructor(callState: CallState, tracer: Tracer);
    /**
     * Sets the SFU client used by `apply()` to push subscription updates.
     * Called by the owner on call join; cleared on leave.
     */
    setSfuClient: (sfuClient: StreamSfuClient | undefined) => void;
    /**
     * Cancels any pending debounced subscription push. Idempotent.
     */
    dispose: () => void;
    /**
     * The current SFU subscription list, computed from `CallState`
     * participants and the override state. Used by:
     *
     * - `apply()` to push to the SFU each time the set changes.
     * - `Call.getReconnectDetails` to include the subscription list in
     *   the reconnect payload.
     */
    get subscriptions(): TrackSubscriptionDetails[];
    get overrides(): VideoTrackSubscriptionOverrides;
    /**
     * Sets video-subscription overrides. Called by
     * `Call.setIncomingVideoEnabled` and
     * `Call.setPreferredIncomingVideoResolution`.
     *
     * - `sessionIds` omitted → applies `override` globally (or clears the
     *   global override if `override` is `undefined`).
     * - `sessionIds` provided → applies `override` to each listed session.
     */
    setOverrides: (override: VideoTrackSubscriptionOverride | undefined, sessionIds?: string[]) => VideoTrackSubscriptionOverrides;
    /**
     * Pushes `subscriptions` to the SFU. Debounced by `debounceType`
     * (SLOW by default). Multiple rapid calls coalesce into one RPC.
     * Passing `0` fires synchronously.
     */
    apply: (debounceType?: DebounceType) => void;
}
export {};
