import { FFmpeg } from '../../libs/ffmpeg'; /** * Convenience wrapper around FFmpeg archive operations for creating, reading, and extracting zip-like archives. */ export declare class ZipArchive { private ffmpeg; private archiveId; /** * Creates an archive helper bound to a specific FFmpeg instance. * * @param ffmpeg Optional FFmpeg instance. When omitted, the engine singleton FFmpeg instance is used. */ constructor(ffmpeg?: FFmpeg); /** * Returns the FFmpeg instance used for archive operations. * * @returns The bound FFmpeg instance. */ getFFmpeg(): FFmpeg; /** * Indicates whether an archive is currently open. * * @returns `true` if the archive helper has an active archive handle; otherwise `false`. */ isOpen(): boolean; /** * Creates a new archive file and opens it for subsequent operations. * * @param path Output archive path in the FFmpeg virtual filesystem. * @returns A promise that resolves to `true` if the archive was created successfully. */ create(path: string): Promise; /** * Opens an existing archive file. * * @param path Archive path in the FFmpeg virtual filesystem. * @returns A promise that resolves to `true` if the archive was opened successfully. */ open(path: string): Promise; /** * Flushes pending changes to the currently open archive. * * @returns A promise that resolves to `true` if the archive was saved successfully. */ save(): Promise; /** * Closes an archive handle. * * @param id Archive handle identifier to close. * @returns A promise that resolves to `true` if the archive was closed successfully. */ close(id: number): Promise; /** * Adds a file from the FFmpeg virtual filesystem to the open archive. * * @param path Source file path to add. * @param targetDirectory Optional directory inside the archive where the file should be placed. * @returns A promise that resolves to `true` if the file was added successfully. */ addFile(path: string, targetDirectory?: string): Promise; /** * Extracts all archive contents into the specified directory. * * @param path Destination directory in the FFmpeg virtual filesystem. * @returns A promise that resolves to `true` if extraction completed successfully. */ extractAll(path: string): Promise; /** * Adds an in-memory byte buffer to the open archive. * * @param path Target file path inside the archive. * @param data Byte buffer to write. * @param takeOwnership When `true`, reuses the provided buffer instead of cloning it first. * @returns A promise that resolves to `true` if the data was added successfully. */ addData(path: string, data: Uint8Array, takeOwnership?: boolean): Promise; /** * Reads a single file from the open archive. * * @param path Path of the archived file to read. * @returns A promise that resolves to the file bytes, or `null` if the read fails. */ readFile(path: string): Promise; /** * Adds multiple files from the FFmpeg virtual filesystem to the open archive. * * @param paths Source file paths to add. * @param targetDirectory Optional directory inside the archive where the files should be placed. * @returns A promise that resolves to `true` if the files were added successfully. */ addFiles(paths: string[], targetDirectory?: string): Promise; /** * Lists the files currently stored in the open archive. * * @returns A promise that resolves to the archive file path list. */ listFiles(): Promise; /** * Extracts a single archived file to a destination path. * * @param fromPath File path inside the archive. * @param toPath Destination path in the FFmpeg virtual filesystem. * @returns A promise that resolves to `true` if the file was extracted successfully. */ extractFile(fromPath: string, toPath: string): Promise; /** * Closes the currently open archive if one is active. * * @returns A promise that resolves to the FFmpeg close result, or `undefined` if no archive is open. */ destroy(): Promise; }