import type { ByteRange } from '../../../stream-data-structure/segment/SegmentAtom';
import type { HlsParsingError, MissingM3uTagError } from './Errors';
interface StartTagAttributes {
    timeOffset: number;
    precise: boolean;
}
export interface CueTag {
    attributes?: string[];
    type: Uppercase<TagType.CueOut> | Uppercase<TagType.CueIn> | Uppercase<TagType.CueOutCont>;
}
export interface Scte35TagAttributes {
    CUE: string;
    DURATION?: number;
    ELAPSED?: number;
    ID?: number;
    TIME?: number;
    TYPE?: number;
}
export interface Scte35 {
    attributes?: Scte35TagAttributes;
    type: MetadataType.SCTE;
}
export declare enum HlsEncryptionMethod {
    NONE = "NONE",
    AES_128 = "AES-128",
    SAMPLE_AES = "SAMPLE-AES"
}
export interface SegmentEncryptionInfo {
    uri: string;
    method: string;
    iv?: ArrayBuffer;
    keyformat?: string;
    keyformatversions?: string;
    buffer?: ArrayBuffer;
    keyid?: string;
}
export type DateRangeMetadata = {
    id: string;
    class?: string;
    startDate: string;
    endDate?: string;
    duration?: number;
    plannedDuration?: number;
    scte35Cmd?: string;
    scte35Out?: string;
    scte35In?: string;
    endOnNext?: boolean;
    clientAttributes: {
        [name: string]: unknown;
    };
    type: MetadataType.DATERANGE;
} & Record<string, unknown>;
export interface Initialization {
    url: string;
    byteRange?: ByteRange;
    key?: SegmentEncryptionInfo;
}
export interface CustomTag {
    attributes: string;
    type: MetadataType.CUSTOM;
}
export type SegmentMetadata = CueTag | Scte35 | DateRangeMetadata | CustomTag;
export interface SegmentEntry {
    uri: string;
    keys: SegmentEncryptionInfo[];
    key: SegmentEncryptionInfo;
    duration: number;
    discontinuity: boolean;
    discontinuitySequenceNumber: number;
    dateTime: Date;
    dateRange: DateRangeMetadata[];
    cueTag: CueTag;
    scte35: Scte35[];
    metadata: SegmentMetadata[];
    customTags?: CustomTag[];
    byterange?: {
        offset?: number;
        length: number;
    };
    init: Initialization;
    startTime: number;
}
interface Playlist {
    version: number;
    allowCache: boolean;
    independentSegments?: boolean;
    hasM3u: boolean;
}
export type RenditionType = 'AUDIO' | 'VIDEO' | 'SUBTITLES' | 'CLOSED-CAPTIONS';
export interface RenditionAttributes {
    TYPE: RenditionType;
    URI?: string;
    'GROUP-ID': string;
    NAME: string;
    LANGUAGE?: string;
    'ASSOC-LANGUAGE'?: string;
    DEFAULT?: 'YES' | 'NO';
    AUTOSELECT?: 'YES' | 'NO';
    FORCED?: 'YES' | 'NO';
    'INSTREAM-ID'?: string;
    CHARACTERISTICS?: string;
    CHANNELS?: string;
    BANDWIDTH?: number;
    CODECS?: string;
}
export type RenditionAttributesWithUri = RenditionAttributes & {
    URI: string;
};
export interface VariantAttributes {
    BANDWIDTH: number;
    'AVERAGE-BANDWIDTH'?: number;
    'PROGRAM-ID'?: number;
    CODECS?: string;
    RESOLUTION?: {
        width: number;
        height: number;
    };
    'FRAME-RATE'?: string;
    AUDIO?: string;
    VIDEO?: string;
    SUBTITLES?: string;
    'CLOSED-CAPTIONS'?: string;
}
export interface Variant {
    uri: string;
    attributes: VariantAttributes;
}
export interface MapInformation {
    URI?: string;
    BYTERANGE?: string;
}
export interface MultivariantPlaylist extends Playlist {
    media: {
        attributes: RenditionAttributes;
    }[];
    playlists: Variant[];
    tags: HlsTag[];
    start?: StartTagAttributes;
}
export interface MediaPlaylist extends Playlist {
    requestTimestamp: number;
    discontinuitySequence: number;
    discontinuityStarts: number[];
    endList: boolean;
    mediaSequence: number;
    segments: SegmentEntry[];
    targetDuration: number;
    start?: StartTagAttributes;
    startTime: number;
    playlistType: 'VOD' | 'EVENT';
    totalDuration: number;
        map?: MapInformation;
}
export type HlsManifest = MultivariantPlaylist | MediaPlaylist;
export declare enum MetadataType {
        CUETAG = "CUETAG",
        DATERANGE = "DATERANGE",
        CUSTOM = "CUSTOM",
        SCTE = "SCTE",
        ID3 = "ID3",
        EMSG = "EMSG"
}
export interface HlsTag {
        name: string;
        attributes?: {
        [key: string]: unknown;
    };
        value?: string;
}
export declare enum TagType {
    M3u = "m3u",
    AllowCache = "allow-cache",
    ByteRange = "byterange",
    EndList = "endlist",
    Inf = "inf",
    Key = "key",
    MediaSequence = "media-sequence",
    DiscontinuitySequence = "discontinuity-sequence",
    PlaylistType = "playlist-type",
    StreamInf = "stream-inf",
    IframeStreamInf = "i-frame-stream-inf",
    Media = "media",
    Start = "start",
    Discontinuity = "discontinuity",
    DateTime = "date-time",
    TargetDuration = "targetduration",
    Map = "map",
    IndependentSegments = "independent-segments",
    SessionData = "session-data",
    SessionKey = "session-key",
    CueOut = "cue-out",
    CueOutCont = "cue-out-cont",
    CueIn = "cue-in",
    Scte35 = "scte35",
    DateRange = "daterange",
    Version = "version",
    Uri = "uri",
    Unknown = "unknown"
}
export declare enum PlaylistType {
    Vod = "VOD",
    Event = "EVENT"
}
export type BaseTag<T extends TagType> = {
    tagType: T;
};
export type TagWithData<T extends TagType> = {
    data: string;
} & BaseTag<T>;
export type TagWithAttributes<T extends TagType> = {
    attributes: Record<string, string>;
} & BaseTag<T>;
export type TagWithDuration<T extends TagType> = {
    duration?: number;
} & BaseTag<T>;
export type TagWithNumber<T extends TagType> = {
    number?: number;
} & BaseTag<T>;
export type ExtInfTag = {
    title?: string;
} & TagWithDuration<TagType.Inf>;
export type VersionTag = {
    version?: number;
} & BaseTag<TagType.Version>;
export type PlaylistTypeTag = {
    playlistType: PlaylistType;
} & BaseTag<TagType.PlaylistType>;
export type ByteRangeTag = {
    length?: number;
    offset?: number;
} & BaseTag<TagType.ByteRange>;
export type AllowCacheTag = {
    allowed?: boolean;
} & BaseTag<TagType.AllowCache>;
export type DateTimeTag = {
    dateTime?: Date;
} & BaseTag<TagType.DateTime>;
export type UriTag = {
    uri?: string;
} & BaseTag<TagType.Uri>;
export type M3uTag = BaseTag<TagType.M3u>;
export type IndependentSegmentTag = BaseTag<TagType.IndependentSegments>;
export type MediaTag = TagWithAttributes<TagType.Media>;
export type TargetDurationTag = TagWithDuration<TagType.TargetDuration>;
export type StartTag = TagWithAttributes<TagType.Start>;
export type MediaSequenceTag = TagWithNumber<TagType.MediaSequence>;
export type DiscontinuitySequenceTag = TagWithNumber<TagType.DiscontinuitySequence>;
export type SessionDataTag = TagWithAttributes<TagType.SessionData>;
export type SessionKeyTag = TagWithAttributes<TagType.SessionKey>;
export type StreamInfTag = TagWithAttributes<TagType.StreamInf>;
export type IframeStreamInfTag = TagWithAttributes<TagType.IframeStreamInf>;
export type EndListTag = BaseTag<TagType.EndList>;
export type DiscontinuityTag = BaseTag<TagType.Discontinuity>;
export type KeyTag = TagWithAttributes<TagType.Key>;
export type MapTag = TagWithAttributes<TagType.Map>;
export type CueOutContTag = TagWithData<TagType.CueOutCont>;
export type CueOutTag = TagWithData<TagType.CueOut>;
export type CueInTag = TagWithData<TagType.CueIn>;
export type Scte35Tag = TagWithData<TagType.Scte35>;
export type DateRangeTag = TagWithData<TagType.DateRange>;
export type UnknownTag = TagWithData<TagType.Unknown>;
export type Tag = ExtInfTag | VersionTag | PlaylistTypeTag | ByteRangeTag | AllowCacheTag | DateTimeTag | M3uTag | IndependentSegmentTag | MediaTag | TargetDurationTag | StartTag | MediaSequenceTag | DiscontinuitySequenceTag | SessionDataTag | SessionKeyTag | StreamInfTag | IframeStreamInfTag | EndListTag | DiscontinuityTag | KeyTag | MapTag | CueOutContTag | CueOutTag | CueInTag | Scte35Tag | DateRangeTag | UnknownTag | UriTag;
export type HlsErrors = {
    MissingM3uTagError: typeof MissingM3uTagError;
    HlsParsingError: typeof HlsParsingError;
};
export declare enum HlsParsingExportNames {
    ParsingTask = "hls-parsing-task",
    ParsingFunctions = "hls-parsing-functions",
    Errors = "hls-parsing-errors"
}
export {};
