import { HttpConnectionType, HttpConnectionMetrics, HttpDownloadMetrics } from '../../../player/types';
import type ThroughputEstimator from '../../../utils/ThroughputEstimator';
import { Byte, IError, IRange, ISubject, ITracer, IValueSubject, Milliseconds } from '@vkontakte/videoplayer-shared';
import { CommonInit, GenericContainerParser, Segment, SegmentReference } from '../../../providers/utils/parsers/types';
declare global {
    interface Navigator {
        connection: {
            effectiveType: string;
            downlink: number;
            rtt: number;
        };
    }
}
export declare enum RangeMethod {
    HEADER = 0,
    PARAM = 1
}
export interface IParams {
    throughputEstimator?: ThroughputEstimator;
    requestQuic: boolean;
    compatibilityMode?: boolean;
    tracer: ITracer;
    useEnableSubtitlesParam?: boolean;
}
export type Priority = 'high' | 'low' | 'auto';
export interface FetchParamsWithUrl extends FetchParams {
    url: string;
}
export interface FetchParams {
    range?: IRange<Byte>;
    rangeMethod?: RangeMethod;
    onProgress?: (dataView: DataView, loaded: number) => void;
    onProgressTasks?: Promise<void>[];
    signal?: AbortSignal;
    priority?: Priority;
    measureThroughput?: boolean;
    isLowLatency?: boolean;
    bufferOptimisation?: boolean;
}
export type RepresentationFetchResult<T extends Segment> = {
    initMetadata: CommonInit | null;
    initDataView: DataView;
    segments: T[];
};
export declare class Fetcher {
    private throughputEstimator;
    private requestQuic;
    private tracer;
    manifestRequested: ISubject<void>;
    manifestReceived: ISubject<void>;
    firstBytesRequested: ISubject<void>;
    firstBytesReceived: ISubject<void>;
    lastConnectionType$: IValueSubject<HttpConnectionType | undefined>;
    lastConnectionReused$: IValueSubject<boolean | undefined>;
    lastRequestFirstBytes$: IValueSubject<Milliseconds | undefined>;
    lastConnectionMetrics$: IValueSubject<HttpConnectionMetrics | undefined>;
    lastDownloadMetrics$: IValueSubject<HttpDownloadMetrics | undefined>;
    recoverableError$: ISubject<IError>;
    error$: ISubject<IError>;
    private abortAllController;
    private subscription;
    private compatibilityMode;
    private useEnableSubtitlesParam;
    private performanceObserver;
    private pendingConnectionMetrics;
    constructor({ throughputEstimator, requestQuic, tracer, compatibilityMode, useEnableSubtitlesParam }: IParams);
    private onHeadersReceived;
    private setupPerformanceObserver;
    private processResourceTiming;
    private estimateNetworkType;
    private extractConnectionMetrics;
    private findMatchingRequest;
    private trackRequestStart;
    fetchManifest: (param_0: string) => Promise<string | null | undefined>;
    fetch: (param_0: string, param_1: FetchParams) => Promise<ArrayBuffer | null | undefined>;
    fetchRepresentation<T extends Segment>(segmentReference: SegmentReference, parser: GenericContainerParser<unknown>, priority?: Priority): Promise<RepresentationFetchResult<T> | null | undefined>;
    destroy(): void;
    private fetchByteRangeRepresentation;
    private fetchTemplateRepresentation;
    private doFetch;
}
