import type { Element, Window } from "../ebml.js";
import type { Range } from "../io/source.js";
import type { WindowIndex } from "../io/windows.js";
import { type BlockClause, type FrameClaim, type StoredFrame } from "./block.js";
import type { CuePosition } from "./header.js";
/** Points naming the same cluster in a row share its element, its time and the last window. */
export interface ClusterMemo {
    last: LastCluster | null;
}
/**
 * A block found from its cue alone, with its cluster's head unread.
 *
 * The cluster's body and clock are what the block's position and the cue's time imply.
 */
export interface CuedBlock {
    blockAt: number;
    outer: Element;
    clusterBody: number;
    clusterTicks: number;
    window: Window;
}
interface LastCluster {
    clusterPos: number;
    cluster: Element;
    clusterTicks: number | null;
    window: Window;
}
export declare function readFrame(windows: WindowIndex, point: CuePosition, trackNumber: number, claim: FrameClaim, memo: ClusterMemo): StoredFrame | BlockClause;
export declare function readCuedFrame(windows: WindowIndex, cued: CuedBlock, trackNumber: number, claim: FrameClaim): StoredFrame | BlockClause;
export declare function planBlockRanges(points: readonly CuePosition[], cueAheadBytes: number): Range[];
export declare function planProbes(clusters: Iterable<number>): Range[];
/** Each point's block bytes the windows do not hold, null where they hold them all or the block does not locate. */
export declare function pointShortfalls(windows: WindowIndex, points: readonly CuePosition[]): (Range | null)[];
export declare function cuedShortfall(windows: WindowIndex, { blockAt, outer }: CuedBlock): Range | null;
/** The one block of the track that parses past the cue's position at some cluster-header width. */
export declare function locateByCue(windows: WindowIndex, point: CuePosition, trackNumber: number): CuedBlock | null;
export {};
