import { File } from "../file.js"; import { Tag } from "../tag.js"; import { ReadStyle } from "../toolkit/types.js"; import type { IOStream } from "../toolkit/ioStream.js"; import { DsfProperties } from "./dsfProperties.js"; /** * DSD Stream File (DSF) format handler. * * A DSF file consists of four sequential chunks: DSD, fmt, data, and an * optional metadata (ID3v2) chunk. This is *not* a RIFF-style container — * chunks appear in a fixed order. * * Only an ID3v2 tag is supported (no ID3v1, no APE). */ export declare class DsfFile extends File { /** The ID3v2 tag, or `null` if not yet loaded. */ private _tag; /** Parsed audio properties from the "fmt " chunk. */ private _properties; /** Total file size in bytes as recorded in the DSD chunk header. */ private _fileSize; /** File offset of the ID3v2 metadata chunk, or 0 if absent. */ private _metadataOffset; /** * Private constructor — use {@link DsfFile.open} to create instances. * @param stream The underlying I/O stream. */ private constructor(); /** * Opens a DSF file and parses its metadata. * @param stream The I/O stream to read from. * @param readProperties Whether to parse audio properties (default `true`). * @param readStyle Accuracy / speed trade-off for property reading. * @returns A fully initialised {@link DsfFile} instance. */ static open(stream: IOStream, readProperties?: boolean, readStyle?: ReadStyle): Promise; /** Quick-check whether `stream` looks like a valid DSF file. */ static isSupported(stream: IOStream): Promise; /** * Returns the ID3v2 tag for this file, or `null` if none exists. * @returns The {@link Id3v2Tag} or `null`. */ tag(): Tag | null; /** * Returns the parsed audio properties, or `null` if properties were not read. * @returns The {@link DsfProperties} or `null`. */ audioProperties(): DsfProperties | null; /** * Writes all pending tag changes back to the underlying stream. * @returns `true` on success, `false` if the file is read-only or has no tag. */ save(): Promise; /** * Reads and validates the DSF chunk structure from the stream, then populates * audio properties and the ID3v2 tag. * @param readProperties Whether to parse the "fmt " chunk as audio properties. * @param readStyle Accuracy / speed trade-off hint. */ private read; } //# sourceMappingURL=dsfFile.d.ts.map