import { type BoxParser } from './BoxParser';
export type ValidBox<T extends Box> = T & {
    valid: true;
    size: number;
};
export declare const isValid: <T extends Box>(box: T) => box is ValidBox<T>;
/**
 * Generic boxes description
 *
 * aligned(8) class Box (unsigned int(32) boxtype, optional unsigned int(8)[16] extended_type) {
 *    unsigned int(32) size;
 *    unsigned int(32) type = boxtype;
 *    if (size==1) {
 *       unsigned int(64) largesize;
 *    } else if (size==0) {
 *       // boxes extends to end of file
 *    }
 *    if (boxtype==‘uuid’) {
 *       unsigned int(8)[16] usertype = extended_type;
 *    }
 * }
 */
export declare class Box {
    source: DataView;
    boxParser: BoxParser;
    type: string;
    size: number | undefined;
    content: DataView;
    valid: boolean;
    children: Box[];
    /**
     * Next byte in source buffer to be read
     */
    protected cursor: number;
    /**
     * for compatibility with old Box type
     */
    get id(): string;
    constructor(source: DataView, boxParser: BoxParser);
    /**
     * Internal method to scan for children
     */
    protected scanForBoxes(view: DataView): Box[];
    /**
     * Reads given number of bytes from source buffer as a string
     * starting from current cursor position and using provided encoding
     * Moves cursor forward
     */
    protected readString(byteLength: number, encoding?: string): string;
    /**
     * Reads 1 byte from source buffer as an unsigned integer
     * starting from current cursor position
     * Moves cursor forward
     */
    protected readUint8(): number;
    /**
     * Reads 2 bytes from source buffer as an unsigned integer
     * starting from current cursor position
     * Moves cursor forward
     */
    protected readUint16(): number;
    /**
     * Reads 4 bytes from source buffer as an unsigned integer
     * starting from current cursor position
     * Moves cursor forward
     */
    protected readUint32(): number;
    /**
     * Reads 8 bytes from source buffer as an unsigned BigInt
     * starting from current cursor position
     * Moves cursor forward
     */
    protected readUint64(): bigint;
}
