import type { Element, Window } from "../ebml.js";
import type { Range } from "../io/source.js";
import type { Undo } from "./encoding.js";
/** How a chosen track's frames are undone. */
export interface FrameClaim {
    undo: Undo | null;
}
/** A block's frame, under the TrackNumber its head states. */
export interface BlockFrame {
    trackNumber: number;
    startTicks: number;
    durationTicks: number | null;
    payload: Uint8Array;
}
/** A block's frame as the file stores it, with the undo its track's claim names. */
export interface StoredFrame {
    trackNumber: number;
    startTicks: number;
    durationTicks: number | null;
    stored: Uint8Array;
    undo: Undo | null;
}
interface BlockHead {
    trackNumber: number;
    relTicks: number;
    laced: boolean;
    payloadAt: number;
    payloadSize: number;
}
/** The rule each block refusal names. */
export declare const BLOCK_REFUSAL: {
    readonly notThisTrack: "not-this-track";
    readonly notACluster: "not-a-cluster";
    readonly openCluster: "open-cluster";
    readonly noClusterTime: "no-cluster-time";
    readonly runsPastCluster: "runs-past-cluster";
    readonly notAnElement: "not-an-element";
    readonly notABlock: "not-a-block";
    readonly notFetched: "not-fetched";
    readonly groupChildren: "group-children";
    readonly groupEmpty: "group-empty";
    readonly stranger: "stranger";
    readonly blockHead: "block-head";
    readonly laced: "laced";
    readonly shortHead: "short-head";
    readonly undecodable: "undecodable";
};
export type BlockClause = (typeof BLOCK_REFUSAL)[keyof typeof BLOCK_REFUSAL];
export declare const BLOCK_PROBE_BYTES = 32;
export declare const FRAME_IDS: ReadonlySet<number>;
/**
 * One block element's frame as stored, null for a track `claims` does not hold, or the clause of a rule it breaks.
 *
 * Each range it yields is to be answered with a window that holds it.
 */
export declare function blockSteps(outer: Element, clusterTicks: number, held: Window, claims: ReadonlyMap<number, FrameClaim>): Generator<Range, StoredFrame | null | BlockClause, Window>;
export declare function plainFrame(frame: StoredFrame): BlockFrame;
export declare function undoneFrame(frame: StoredFrame, undo: Undo): Promise<BlockFrame | BlockClause>;
export declare function heldBlockHead(window: Window, outer: Element): BlockHead | null;
export {};
