import { HttpConnectionType, VideoCodec } from '../../../player/types';
import { LiveStreamStatus } from './types';
import { CommonInit, Manifest, Representation, StreamKind, TextRepresentation } from '../../../providers/utils/parsers/types';
import StateMachine from '../../../utils/StateMachine/StateMachine';
import type ThroughputEstimator from '../../../utils/ThroughputEstimator';
import { ITuningConfig } from '../../../utils/tuningConfig';
import { IError, ISubject, ITracer, IValueSubject, Milliseconds, Subject } from '@vkontakte/videoplayer-shared';
export declare enum State {
    NONE = "none",
    MANIFEST_READY = "manifest_ready",
    REPRESENTATIOS_READY = "representations_ready",
    RUNNING = "running"
}
export interface Params {
    throughputEstimator: ThroughputEstimator;
    tuning: ITuningConfig;
    compatibilityMode?: boolean;
    forceVideoCodec?: VideoCodec;
    tracer: ITracer;
}
export declare class Player {
    private element;
    private manifestUrlString;
    private source;
    private manifest;
    private tuning;
    private tracer;
    private forceVideoCodec?;
    private videoBufferManager;
    private audioBufferManager;
    private bufferManagers;
    private liveTextManager;
    private throughputEstimator;
    private subscription;
    private subscriptionRemovable;
    private representationSubscription;
    private fetcher;
    state$: StateMachine<State>;
    currentVideoRepresentation$: IValueSubject<Representation['id'] | undefined>;
    currentVideoRepresentationInit$: IValueSubject<CommonInit | undefined>;
    currentAudioRepresentation$: IValueSubject<Representation['id'] | undefined>;
    currentVideoSegmentLength$: IValueSubject<number>;
    currentAudioSegmentLength$: IValueSubject<number>;
    error$: ISubject<IError>;
    manifestRequested: ISubject<void>;
    manifestReceived: ISubject<void>;
    firstBytesRequested: ISubject<void>;
    firstBytesReceived: ISubject<void>;
    lastConnectionType$: IValueSubject<HttpConnectionType | undefined>;
    lastConnectionReused$: IValueSubject<boolean | undefined>;
    lastRequestFirstBytes$: IValueSubject<Milliseconds | undefined>;
    currentLiveTextRepresentation$: IValueSubject<TextRepresentation | null>;
    private timeoutSourceOpenId;
    isLive$: IValueSubject<boolean>;
    isActiveLive$: IValueSubject<boolean>;
    isLowLatency$: IValueSubject<boolean>;
    liveDuration$: IValueSubject<Milliseconds>;
    liveSeekableDuration$: IValueSubject<Milliseconds>;
    liveAvailabilityStartTime$: IValueSubject<Milliseconds>;
    liveStreamStatus$: IValueSubject<LiveStreamStatus | undefined>;
    bufferLength$: IValueSubject<Milliseconds>;
    liveLatency$: IValueSubject<Milliseconds | undefined>;
    liveLoadBufferLength$: IValueSubject<Milliseconds>;
    livePositionFromPlayer$: IValueSubject<number>;
    currentStallDuration$: IValueSubject<Milliseconds>;
    videoLastDataObtainedTimestamp$: IValueSubject<Milliseconds>;
    fetcherRecoverableError$: Subject<IError>;
    fetcherError$: Subject<IError>;
    private liveStreamEndTimestamp;
    private liveBuffer;
    private isUpdatingLive;
    private isJumpGapAfterSeekLive;
    private forceEnded$;
    private gapWatchdogActive;
    private gapWatchdogSubscription;
    private stallWatchdogSubscription;
    private livePauseWatchdogSubscription;
    private destroyController;
    constructor(params: Params);
    initManifest: (param_0: HTMLVideoElement, param_1: string, param_2: number) => Promise<void | undefined>;
    updateManifest: () => Promise<Manifest | null | undefined>;
    setSmartRepresentationSwitch(state: boolean): void;
    seekLive(nextOffset: Milliseconds): Promise<void>;
    initRepresentations: (param_0: string, param_1: string | undefined, param_2: import("../../../player/types").URLSource | undefined) => Promise<void | undefined>;
    initBuffer(): void;
    switchRepresentation(kind: StreamKind, id: Representation['id'], dropBuffer?: boolean): Promise<void>;
    seek(requestedPosition: Milliseconds, forcePrecise: boolean): Promise<void>;
    warmUpMediaSourceIfNeeded(position?: Milliseconds | undefined): void;
    get isStreamEnded(): boolean;
    stop(): void;
    setBufferTarget(time: Milliseconds): void;
    getStreams(): Manifest['streams'] | undefined;
    getCodecs(): Manifest['codecs'] | undefined;
    setPreloadOnly(preloadOnly: boolean): void;
    destroy(): void;
    private initTracerSubscription;
    private isManualDecreasePlaybackInLive;
    private normolizeLiveOffset;
    private tick;
    private updateLive;
    private jumpGap;
    /**
     * Возвращает duration в милисекундах.
     */
    calculateDurationFromSegments(): number;
}
