import { ByteVector } from "../byteVector"; import { File } from "../file"; import { ILazy } from "../interfaces"; /** * Specifies the contents of a FLAC block. */ export declare enum FlacBlockType { /** * Block contains stream information. */ StreamInfo = 0, /** * Block contains padding. */ Padding = 1, /** * Block contains application data. */ Application = 2, /** * Block contains a seek table. */ SeekTable = 3, /** * Block contains a Xiph comment. */ XiphComment = 4, /** * Block contains a cue sheet. */ CueSheet = 5, /** * Block contains a picture. */ Picture = 6 } /** * Represents a FLAC metadata block */ export declare class FlacBlock implements ILazy { /** * Length of a FLAC block header in bytes. */ static readonly HEADER_SIZE = 4; private _blockStart; private _data; private _dataSize; private _file; private _isLastBlock; private _type; private constructor(); /** * Constructs and initializes a new instance, lazily, by reading it from a file. * @param file File from which to read the current instance * @param position Offset into the file where the block begins */ static fromFile(file: File, position: number): FlacBlock; /** * Constructs and initializes a new instance using the type of the block and the data * contained in the block. * @param type Type of the block to construct * @param data Data the block will contain */ static fromData(type: FlacBlockType, data: ByteVector): FlacBlock; /** * Offset into the file where the block begins. This is `undefined` if the instance is * constructed directly from data. */ get blockStart(): number; /** @internal */ set blockStart(value: number); /** * Gets the data contained in the current instance. */ get data(): ByteVector; /** * Gets the size of the data contained in the current instance. */ get dataSize(): number; /** * Gets whether the block represented by the current instance is the last metadata block * in the FLAC stream. * @returns * `true` if the block represented by the current instance was the last one to appear * in the file and is followed immediately by the audio data, or `false` if another block * appears after the current one or the block was not read from disk. */ get isLastBlock(): boolean; /** @inheritDoc */ get isLoaded(): boolean; /** * Gets the total size of the block as it appears on disk. This equals the size of the data * plus the size of the header. */ get totalSize(): number; /** * Gets the type of data contained in the current instance. */ get type(): FlacBlockType; /** @inheritDoc */ load(): void; /** * Renders the current instance as a raw FLAC metadata block. * @param isLastBlock Whether or not the block should be marked as the last metadata block. */ render(isLastBlock: boolean): ByteVector; }