import { Readable } from "node:stream"; /** * Opened Node attachment path source. * * The opened file handle fixes the source identity at normalization time. Reads * are limited to the stat snapshot and fail if the file becomes shorter. */ export default class AttachmentPathSource { byteSize: number; fileHandle: import("node:fs/promises").FileHandle; filePath: string; /** @type {Set} */ activeStreams: Set; /** @type {Promise | null} */ closePromise: Promise | null; closed: boolean; /** * Creates an opened attachment path source. * @param {object} args - Source args. * @param {number} args.byteSize - Opened-handle stat size. * @param {import("node:fs/promises").FileHandle} args.fileHandle - Open file handle. * @param {string} args.filePath - Validated path used to open the handle. */ constructor({ byteSize, fileHandle, filePath }: { byteSize: number; fileHandle: import("node:fs/promises").FileHandle; filePath: string; }); /** * Creates a bounded, backpressured stream over the opened file snapshot. * @returns {Promise} - Snapshot read stream. */ createReadStream(): Promise; /** * Reads the opened file snapshot into memory for compatibility-only callers. * @returns {Promise} - Exact snapshot bytes. */ readBuffer(): Promise; /** * Closes all active streams and the owned file handle. * @returns {Promise} - Resolves after close. */ close(): Promise; /** * Produces bounded chunks from the opened file handle. * @yields {Buffer} - Snapshot chunks. */ readChunks(): AsyncGenerator, void, unknown>; /** * Asserts that the source remains open. * @returns {void} - Throws if closed. */ assertOpen(): void; /** * Throws a truncation error. * @param {object} args - Args. * @param {number} args.bytesRead - Bytes read before EOF. * @returns {never} - Always throws. */ throwTruncated({ bytesRead }: { bytesRead: number; }): never; } //# sourceMappingURL=attachment-path-source.d.ts.map