import type { Window } from "../ebml.js";
import { type Inflate, type Source } from "../io/source.js";
import type { Attachment, ContainerInfo, RefusalCode, TrackFlags, TrackTag } from "../vocabulary.js";
import { type Segment } from "./chain.js";
import { type ContentEncoding } from "./encoding.js";
export interface TrackEntry {
    index: number;
    number: number;
    uid: string | null;
    typeCode: number;
    codecId: string;
    codecPrivate: Uint8Array | null;
    language: string | null;
    languageIetf: string | null;
    name: string | null;
    flags: TrackFlags;
    codecDelayNs: number;
    /** null when the track states ContentEncodings that do not parse. */
    encodings: ContentEncoding[] | null;
}
export interface CuePosition {
    clusterPos: number;
    relPos: number;
    ticks: number | null;
}
/** Each track's cue points, by TrackNumber. */
export type CueIndex = Map<number, CuePosition[]>;
/** A Segment whose head, Tracks and Tags are read. */
export interface OpenedSegment {
    source: Source;
    segment: Segment;
    head: Window;
    /** Where each top-level element starts, as the head and its SeekHeads state. */
    offsets: Map<number, number>;
    trackEntries: TrackEntry[];
    /** The tags each track states, by TrackUID. */
    trackTags: Map<string, TrackTag[]>;
}
export declare function openSegment(source: Source, signal: AbortSignal | undefined, inflate: Inflate): Promise<OpenedSegment | RefusalCode>;
export declare function readInfo(opened: OpenedSegment, signal: AbortSignal | undefined): Promise<ContainerInfo>;
export declare function readFirstClusterTicks(opened: OpenedSegment, signal: AbortSignal | undefined): Promise<number | null>;
export declare function readCues(opened: OpenedSegment, signal: AbortSignal | undefined): Promise<CueIndex>;
/** What each attached file states of itself, its bytes left where they are. */
export declare function readAttachments(opened: OpenedSegment, signal: AbortSignal | undefined): Promise<Attachment[]>;
