/** * An error generated within this library */ export interface FlateError extends Error { /** * The code associated with this error */ code: number; } /** * Information about a file to be extracted from a ZIP archive */ export interface UnzipFileInfo { /** * The name of the file */ name: string; /** * The compressed size of the file */ size: number; /** * The original size of the file */ originalSize: number; /** * The compression format for the data stream. This number is determined by * the spec in PKZIP's APPNOTE.txt, section 4.4.5. For example, 0 = no * compression, 8 = deflate, 14 = LZMA. If the filter function returns true * but this value is not 8, the unzip function will throw. */ compression: number; /** * @since v1.2.9 * @date 2022/5/19 */ comment?: string; } /** * A filter for files to be extracted during the unzipping process * @param file The info for the current file being processed * @returns Whether or not to extract the current file */ export type UnzipFileFilter = (file: UnzipFileInfo) => boolean; /** * Options for expanding a ZIP archive */ export interface UnzipOptions { /** * A filter function to extract only certain files from a ZIP archive */ filter?: UnzipFileFilter; } /** * An unzipped archive. The full path of each file is used as the key, * and the file is the value */ export interface Unzipped { [path: string]: { data: Uint8Array; comment?: string; }; } /** * Synchronously decompresses a ZIP archive. Prefer using `unzip` for better * performance with more than one file. * * NOTE: Added comment extraction feature (by jeffy-g * * @param {Uint8Array} data The raw compressed ZIP file * @param {UnzipOptions} [opts] The ZIP extraction options * @returns {Unzipped} The decompressed files */ export declare function unzipSync(data: Uint8Array, opts?: UnzipOptions): Unzipped;