import type { PartialRequired } from '../../../Types';
import type { MediaType, SubtitleFormatType } from '../../core/Constants';
import type { ArrayAtom } from '../../core/state/ArrayStateAtom';
import type { CodecMapAtom } from '../../core/state/codec-map/CodecMapAtom';
import type { PrimitiveAtom } from '../../core/state/PrimitiveAtom';
import type { StateAtom } from '../../core/state/Types';
import type { DataOrSelfInitSegmentAtom } from '../segment/SegmentAtom';
import type { SelectionGroupAtom } from '../selection-group/SelectionGroupAtom';
import type { StreamDataStructureContext } from '../Types';
export interface TimeRange {
    start: number;
    end: number;
}
type BaseTrack = {
    id: string;
    type: MediaType;
    timeRange: TimeRange;
    segments: ArrayAtom<DataOrSelfInitSegmentAtom>;
    sequenceNumber: number;
    selectionGroup: SelectionGroupAtom;
};
type MediaTrack = BaseTrack & {
    bitrate: number;
    codecs: CodecMapAtom;
};
type LanguageTrack = BaseTrack & {
    language: string;
    label?: string;
};
type VideoTrack = MediaTrack & {
    uri: string;
    resolution: {
        width: number;
        height: number;
    };
    mediaType: MediaType.Video;
};
type AudioTrack = MediaTrack & LanguageTrack & {
    uri?: string;
    type: MediaType.Audio;
};
type MuxedTrack = Omit<AudioTrack, 'type'> & Omit<VideoTrack, 'type'> & {
    type: MediaType.Muxed;
};
type SubtitleTrack = LanguageTrack & {
    type: MediaType.Subtitle;
    uri?: string;
    formatType: PrimitiveAtom<SubtitleFormatType>;
    external: boolean;
    fragmented: boolean;
};
type UnknownTrack = {
    type: MediaType.Unknown;
} & BaseTrack;
type Track = AudioTrack | VideoTrack | MuxedTrack | SubtitleTrack | UnknownTrack;
export type AudioTrackAtom = StateAtom<AudioTrack, ReturnType<typeof getAudioTrackModifiers>>;
export type VideoTrackAtom = StateAtom<VideoTrack, ReturnType<typeof getMediaTrackModifiers>>;
export type MuxedTrackAtom = StateAtom<MuxedTrack, ReturnType<typeof getMediaTrackModifiers>>;
export type MediaTrackAtom = AudioTrackAtom | VideoTrackAtom | MuxedTrackAtom;
export type SubtitleTrackAtom = StateAtom<SubtitleTrack, ReturnType<typeof getBaseModifiers>>;
export type UnknownTrackAtom = StateAtom<UnknownTrack, ReturnType<typeof getBaseModifiers>>;
export type TrackAtom = AudioTrackAtom | VideoTrackAtom | MuxedTrackAtom | SubtitleTrackAtom | UnknownTrackAtom;
declare function getBaseModifiers(context: StreamDataStructureContext): {
    setSegments: (track: Track, segments: ArrayAtom<DataOrSelfInitSegmentAtom>) => boolean;
    setSequenceNumber: (track: Track, sequenceNumber: number) => boolean;
    setSelectionGroup: (track: VideoTrack | AudioTrack | MuxedTrack | UnknownTrack | SubtitleTrack, selectionGroup: SelectionGroupAtom) => boolean;
};
declare function getMediaTrackModifiers(context: StreamDataStructureContext): {
    setBitrate: (track: MediaTrack, bitrate: number) => boolean;
    setSegments: (track: Track, segments: ArrayAtom<DataOrSelfInitSegmentAtom>) => boolean;
    setSequenceNumber: (track: Track, sequenceNumber: number) => boolean;
    setSelectionGroup: (track: AudioTrack | VideoTrack | MuxedTrack | SubtitleTrack | UnknownTrack, selectionGroup: SelectionGroupAtom) => boolean;
};
declare function getAudioTrackModifiers(context: StreamDataStructureContext): {
    setLanguage: (track: LanguageTrack, language: string) => boolean;
    setLabel: (track: LanguageTrack, label: string) => boolean;
    setBitrate: (track: MediaTrack, bitrate: number) => boolean;
    setSegments: (track: Track, segments: ArrayAtom<DataOrSelfInitSegmentAtom>) => boolean;
    setSequenceNumber: (track: Track, sequenceNumber: number) => boolean;
    setSelectionGroup: (track: AudioTrack | VideoTrack | MuxedTrack | SubtitleTrack | UnknownTrack, selectionGroup: SelectionGroupAtom) => boolean;
};
type RequiredBaseTrackKeys = 'id';
export declare const createAudioTrackAtom: (context: StreamDataStructureContext, initialValue: PartialRequired<Omit<AudioTrack, 'timeRange'>, RequiredBaseTrackKeys | 'language' | 'bitrate' | 'codecs' | 'uri'>) => AudioTrackAtom;
export declare const createVideoTrackAtom: (context: StreamDataStructureContext, initialValue: PartialRequired<Omit<VideoTrack, 'timeRange'>, RequiredBaseTrackKeys | 'resolution' | 'bitrate' | 'codecs' | 'uri'>) => VideoTrackAtom;
export declare const createMuxedTrackAtom: (context: StreamDataStructureContext, initialValue: PartialRequired<Omit<MuxedTrack, 'timeRange'>, RequiredBaseTrackKeys | 'language' | 'resolution' | 'bitrate' | 'codecs' | 'uri'>) => MuxedTrackAtom;
export declare const createSubtitleTrackAtom: (context: StreamDataStructureContext, initialValue: PartialRequired<Omit<SubtitleTrack, 'timeRange' | 'formatType'>, RequiredBaseTrackKeys | 'language'>) => SubtitleTrackAtom;
export declare const createUnknownTrackAtom: (context: StreamDataStructureContext, initialValue: PartialRequired<Omit<UnknownTrack, 'timeRange'>, RequiredBaseTrackKeys>) => UnknownTrackAtom;
export {};
