import EbmlElement from "./ebmlElement"; import EbmlParserOptions from "./ebmlParserOptions"; import { File } from "../file"; import { IDisposable } from "../interfaces"; export default class EbmlParser implements IDisposable { private readonly _file; private readonly _maxOffset; private _currentElement; private _dataOffset; private _dataSize; private _headerSize; private _id; private _options; /** * Absolute position within the file where the reader is currently pointing. This will always * be the *next* element to read. * @private */ private _offset; /** * Constructs and initializes a new instance using a file and optionally a position within the * file where the parser should begin reading. If the parser should process a subset of the * file, `length` can be provided. * @param file EBML file to process * @param offset Position in the file to begin parsing * @param maxOffset Maximum position in the file to read up to * @param options Optional options for reading the EBML file */ constructor(file: File, offset: number, maxOffset: number, options?: EbmlParserOptions); get currentElement(): EbmlElement; static getAllElements(parser: EbmlParser): Map; static processElements(parser: EbmlParser, actionMap: Map void>): void; dispose(): void; /** * Reads the next element in the file at the current level. * @returns `true` if an element was successfully read. `false` otherwise. */ read(): boolean; setOptions(maxIdLength: number | undefined, maxSizeLength: number | undefined): void; private static lastSevenBitsTruthy; private renderVariableInteger; private readElementId; private readVariableInteger; private readVariableIntegerBytes; }