import type { PartialRequired } from '../../../Types';
import type { DataStreamAtom } from '../../core/state/data-stream/DataStreamAtom';
import type { MapStateAtom } from '../../core/state/MapStateAtom';
import type { StateAtom } from '../../core/state/Types';
import type { SelectionGroupAtom } from '../selection-group/SelectionGroupAtom';
import type { TimeRange, TrackAtom } from '../track/TrackAtom';
import type { StreamDataStructureContext } from '../Types';
import type { SegmentTimingAtom } from './SegmentTimingAtom';
export type Metadata = Record<string, any>;
export type DataSegmentAtom = StateAtom<DataSegment, typeof BaseSegmentModifiers & {
    setInitSegment: typeof setInitSegment;
}>;
export type InitSegmentAtom = StateAtom<InitSegment, typeof BaseSegmentModifiers>;
export type SelfInitSegmentAtom = StateAtom<SelfInitializingSegment, typeof BaseSegmentModifiers>;
export interface ByteRange {
    start: number;
    end: number;
}
interface BaseSegment {
    url: string;
    byteRange: ByteRange | undefined;
    data: DataStreamAtom<Uint8Array>;
    metadata: MapStateAtom<string, unknown>;
    track: TrackAtom;
    selectionGroup: SelectionGroupAtom;
}
export declare enum SegmentType {
    Initialization = "initialization",
    SelfInitializing = "self-initializing",
    Data = "data"
}
interface SelfInitializingSegment extends BaseSegment {
    type: SegmentType.SelfInitializing;
    segmentTiming: SegmentTimingAtom;
}
interface DataSegment extends BaseSegment {
    type: SegmentType.Data;
    initSegment: InitSegmentAtom;
    segmentTiming: SegmentTimingAtom;
}
interface InitSegment extends BaseSegment {
    type: SegmentType.Initialization;
}
type Segment = InitSegment | DataSegment | SelfInitializingSegment;
export type DataOrSelfInitSegmentAtom = DataSegmentAtom | SelfInitSegmentAtom;
export type SegmentAtom = InitSegmentAtom | DataSegmentAtom | SelfInitSegmentAtom;
declare const setInitSegment: (data: DataSegment, initSegment: InitSegmentAtom) => boolean;
declare const BaseSegmentModifiers: {
    setSelectionGroup: (segment: Segment, selectionGroup: SelectionGroupAtom) => boolean;
};
export declare const createDataSegmentAtom: (context: StreamDataStructureContext, initialData: PartialRequired<DataSegment, 'url' | 'initSegment' | 'segmentTiming' | 'track'>) => StateAtom<DataSegment, {
    setInitSegment: (data: DataSegment, initSegment: InitSegmentAtom) => boolean;
    setSelectionGroup: (segment: Segment, selectionGroup: SelectionGroupAtom) => boolean;
}>;
export declare const createInitSegmentAtom: (context: StreamDataStructureContext, initialData: PartialRequired<InitSegment, 'url' | 'track'>) => StateAtom<InitSegment, {
    setSelectionGroup: (segment: Segment, selectionGroup: SelectionGroupAtom) => boolean;
}>;
export declare const createSelfInitSegmentAtom: (context: StreamDataStructureContext, initialData: PartialRequired<SelfInitializingSegment, 'url' | 'segmentTiming' | 'track'>) => StateAtom<SelfInitializingSegment, {
    setSelectionGroup: (segment: Segment, selectionGroup: SelectionGroupAtom) => boolean;
}>;
export declare function getReadableSegmentName(segment: SegmentAtom, pathLength?: number): string;
export declare function getTimeRange(segment: DataOrSelfInitSegmentAtom): TimeRange;
export declare function getGapToNextSegment(segment: DataOrSelfInitSegmentAtom, nextSegment: DataOrSelfInitSegmentAtom | undefined): {
    start: number;
    end: number;
} | undefined;
export {};
