import { ITuningConfig } from '../utils/tuningConfig';
import { ILogger, ISubject, IValueSubject, Milliseconds, Seconds, IRange, IError, QualityLimits, IWarning, IComponentLogger, ITracer, IRectangle } from '@vkontakte/videoplayer-shared';
import { IChromecastInitializer } from '../providers/ChromecastProvider/ChromecastInitializer/types';
import { HttpConnectionType, IAudioStream, IAudioTrack, ICueSettings, ISources, IVideoStream, SeekState } from '../player/types';
import { IExternalTextTrack, IInternalTextTrack, ITextTrack, IVideoTrack, IVolumeState, PlaybackState, PlaybackRate } from '../player/types';
import { IStateMachine } from '../utils/StateMachine/types';
import ThroughputEstimator from '../utils/ThroughputEstimator';
import { Scene3D } from '../utils/3d/Scene3D';
import { Vector2D } from '../utils/3d/types';
export interface IProvider {
    scene3D?: Scene3D;
    destroy(): void;
}
export interface IProviderDependencies {
    dependencies: {
        throughputEstimator: ThroughputEstimator;
        chromecastInitializer: IChromecastInitializer;
        logger: ILogger;
        tracer: ITracer;
        abrLogger: IComponentLogger;
    };
}
export interface IProviderParams<TSourceType> extends IProviderDependencies {
    container: HTMLElement;
    source: TSourceType;
    desiredState: IDesiredState;
    output: IProviderOutput;
    tuning: ITuningConfig;
    panelSize?: IRectangle;
}
export interface IDesiredState {
    playbackState: IStateMachine<PlaybackState>;
    seekState: IStateMachine<SeekState>;
    volume: IStateMachine<IVolumeState>;
    playbackRate: IStateMachine<PlaybackRate>;
    isLooped: IStateMachine<boolean>;
    isLowLatency: IStateMachine<boolean>;
    videoStream: IStateMachine<IVideoStream | undefined>;
    videoTrack: IStateMachine<IVideoTrack | undefined>;
    audioStream: IStateMachine<IAudioStream | undefined>;
    autoVideoTrackSwitching: IStateMachine<boolean>;
    autoVideoTrackLimits: IStateMachine<QualityLimits>;
    externalTextTracks: IStateMachine<IExternalTextTrack[]>;
    internalTextTracks: IStateMachine<IInternalTextTrack[]>;
    currentTextTrack: IStateMachine<ITextTrack['id'] | undefined>;
    textTrackCuesSettings: IStateMachine<ICueSettings>;
    cameraOrientation: IStateMachine<Vector2D>;
}
export interface IProviderOutput {
    position$: IValueSubject<Seconds>;
    duration$: IValueSubject<Seconds>;
    volume$: IValueSubject<IVolumeState>;
    currentVideoSegmentLength$: IValueSubject<number>;
    currentAudioSegmentLength$: IValueSubject<number>;
    availableVideoStreams$: IValueSubject<IVideoStream[]>;
    currentVideoStream$: IValueSubject<IVideoStream | undefined>;
    availableVideoTracks$: IValueSubject<IVideoTrack[]>;
    currentVideoTrack$: IValueSubject<IVideoTrack | undefined>;
    availableAudioStreams$: IValueSubject<IAudioStream[]>;
    currentAudioStream$: IValueSubject<IAudioStream | undefined>;
    availableAudioTracks$: IValueSubject<IAudioTrack[]>;
    availableTextTracks$: IValueSubject<ITextTrack[]>;
    currentTextTrack$: IValueSubject<ITextTrack['id'] | undefined>;
    isAudioAvailable$: IValueSubject<boolean>;
    autoVideoTrackLimits$: IValueSubject<QualityLimits | undefined>;
    autoVideoTrackLimitingAvailable$: IValueSubject<boolean>;
    canChangePlaybackSpeed$: IValueSubject<boolean | undefined>;
    currentBuffer$: IValueSubject<IRange<Seconds> | undefined>;
    isBuffering$: IValueSubject<boolean>;
    isLive$: IValueSubject<boolean | undefined>;
    isLiveEnded$: IValueSubject<boolean | null>;
    isLowLatency$: IValueSubject<boolean | undefined>;
    liveTime$: IValueSubject<Milliseconds | undefined>;
    liveBufferTime$: IValueSubject<Milliseconds | undefined>;
    liveLatency$: IValueSubject<Milliseconds | undefined>;
    hostname$: IValueSubject<string | undefined>;
    httpConnectionType$: IValueSubject<HttpConnectionType | undefined>;
    httpConnectionReused$: IValueSubject<boolean | undefined>;
    element$: IValueSubject<HTMLVideoElement | undefined>;
    elementVisible$: IValueSubject<boolean>;
    availableSources$: IValueSubject<ISources | undefined>;
    willSeekEvent$: ISubject<void>;
    seekedEvent$: ISubject<void>;
    error$: ISubject<IError>;
    fetcherRecoverableError$: ISubject<IError>;
    fetcherError$: ISubject<IError>;
    warning$: ISubject<IWarning>;
    endedEvent$: ISubject<void>;
    loopedEvent$: ISubject<Seconds>;
    firstBytesEvent$: ISubject<Milliseconds | void>;
    loadedMetadataEvent$: ISubject<void>;
    firstFrameEvent$: ISubject<void>;
    soundProhibitedEvent$: ISubject<void>;
    canplay$: ISubject<void>;
    severeStallOccurred$: ISubject<boolean>;
    is3DVideo$: ISubject<boolean>;
    inPiP$: IValueSubject<boolean>;
    inFullscreen$: IValueSubject<boolean>;
    playbackState$: IValueSubject<PlaybackState | string>;
    getCurrentTime$: IValueSubject<(() => number) | null>;
}
