export interface CompressionResult { data: ArrayBuffer; algorithm: string | undefined; } /** * Returns the current compression algorithms version string. * This version is bumped whenever the set of tried algorithms changes. */ export declare function getCompressionVersion(): string; /** * Attempts to compress the given data using available compression algorithms, picking the best result. * If any of the provided UTIs indicates the data is already in a compressed format (jpeg, png, zip, ...), * compression is skipped entirely. * * @param data the raw data to compress. * @param utis optional UTIs describing the data format; used to skip compression for already-compressed formats. * @returns the (possibly compressed) data and the algorithm used, or undefined if no compression was applied. */ export declare function compressData(data: ArrayBuffer | Uint8Array, utis?: string[]): Promise; /** * Decompresses data that was compressed using one of the supported algorithms. * * @param data the compressed data. * @param algorithm the compression algorithm that was used (e.g. 'lzma'). If undefined, returns the data as-is. * @returns the decompressed data. * @throws if the algorithm is not supported or decompression fails. */ export declare function decompressData(data: ArrayBuffer | Uint8Array, algorithm: string | undefined): Promise;