import type { ContextHaving, ContextUsing } from '../../../framework-types/execution-context/Types';
import type { BaseContext } from '../../../framework-types/Types';
import type { PartialRequired } from '../../Types';
import type { AdaptationExportNames } from '../adaptation/Types';
import type { MetricsAtom } from '../core/metrics/MetricsAtom';
import type { createNetworkAtom, NetworkAtom } from '../core/network/NetworkAtom';
import type { StateEffect } from '../core/state/state-effect/StateEffectFactory';
import type { CoreEffects, CoreExportNames } from '../core/Types';
import type { CoreUtils } from '../core/utils/Types';
import type { FetchTask } from './FetchTask';
import type { NetworkTask } from './NetworkTask';
export interface HttpHeaders {
        [fieldName: string]: string;
}
export declare enum HttpRequestType {
    MANIFEST_HLS_MULTIVARIANT = "manifest/hls/multivariant",
    MANIFEST_HLS_VARIANT = "manifest/hls/variant",
    MEDIA_AUDIO = "media/audio",
    MEDIA_VIDEO = "media/video",
    MEDIA_SUBTITLES = "media/subtitles",
    MEDIA_THUMBNAILS = "media/thumbnails",
    MEDIA_SEGMENTINDEX = "media/segmentindex",
    KEY_HLS_AES = "key/hls/aes",
    TIME_SYNC = "time/sync"
}
export declare enum HttpResponseType {
    ARRAYBUFFER = "arraybuffer",
    BLOB = "blob",
    DOCUMENT = "document",
    JSON = "json",
    TEXT = "text"
}
export type HttpRequestBody = ArrayBuffer | ArrayBufferView | Blob | FormData | string | Document | URLSearchParams;
export interface HttpResponseBodyTypeMap {
    [HttpResponseType.ARRAYBUFFER]: ArrayBuffer;
    [HttpResponseType.BLOB]: Blob;
    [HttpResponseType.DOCUMENT]: Document;
    [HttpResponseType.JSON]: Record<string, unknown>;
    [HttpResponseType.TEXT]: string;
}
export declare enum HttpRequestMethod {
    GET = "GET",
    POST = "POST",
    HEAD = "HEAD"
}
export interface HttpTimingInformation {
        sendTimestamp: number;
        openedTimestamp: number;
        headersReceivedTimestamp: number;
        progressTimestamp: number;
        doneTimestamp: number;
}
export interface RequestConfig<T extends HttpResponseType> {
        method: HttpRequestMethod;
        url: string;
        headers: HttpHeaders;
        body: HttpRequestBody | undefined;
        responseType: T;
        credentials: 'omit' | 'same-origin' | 'include';
    numRetries: number;
    retryDelay: number;
    requestTimeout: number;
    disableRetriesForResponseStatus: number[];
}
export interface HttpResponse<T extends HttpResponseType> {
        config: RequestConfig<T>;
        url: string;
        headers: HttpHeaders;
        status: number;
        statusText: string;
        body: HttpResponseBodyTypeMap[T] | undefined;
        length: number;
    timingInformation: HttpTimingInformation;
}
export type BaseRequestConfig<T extends HttpResponseType> = PartialRequired<RequestConfig<T>, 'url' | 'responseType'>;
export type RequestContext<T extends HttpResponseType> = {
    config: RequestConfig<T>;
    networkAtom: NetworkAtom | undefined;
};
export type NetworkDependencies = {
    [CoreExportNames.CoreEffects]: CoreEffects;
    [CoreExportNames.Utils]: CoreUtils;
    [AdaptationExportNames.Metrics]: MetricsAtom;
};
export declare enum NetworkExportNames {
    NetworkAtom = "network-atom",
    NetworkTask = "network-task",
    FetchTask = "fetch-task"
}
export type NetworkExports = {
    [NetworkExportNames.NetworkAtom]: typeof createNetworkAtom;
    [NetworkExportNames.NetworkTask]: typeof NetworkTask;
    [NetworkExportNames.FetchTask]: typeof FetchTask;
};
type BaseExecutionContext = ContextHaving<NetworkDependencies, NetworkExports, BaseContext>;
export type NetworkPackageContext = ContextUsing<[StateEffect], BaseExecutionContext>;
export {};
