UNPKG

mp70-pptx-automizer

Version:
29 lines (28 loc) 1.36 kB
import { JSZipGeneratorOptions } from 'jszip'; /** * Compresses a folder to a zip file. * For Node.js: Compresses a directory to a zip file on disk * For Browser: Use the alternative browser methods below * * Browser alternatives: * - Use `createZipFromBlobs()` if you have file blobs * - Use `createZipFromBase64()` if you have base64 encoded files * * @param {string} srcDir Source directory path * @param {string} destFile Destination zip file path * @param {JSZipGeneratorOptions<'nodebuffer'>} [options] JSZip options * @throws {Error} If called in browser environment */ export declare const compressFolder: (srcDir: string, destFile: string, options?: JSZipGeneratorOptions<'nodebuffer'>) => Promise<void>; /** * Creates a zip file from blobs (works in both Node.js and Browser) * @param {Record<string, Blob>} files Object with filenames as keys and blobs as values * @returns {Promise<Blob>} Zip file as blob */ export declare const createZipFromBlobs: (files: Record<string, Blob>) => Promise<Blob>; /** * Creates a zip file from base64 encoded files (works in both Node.js and Browser) * @param {Record<string, string>} files Object with filenames as keys and base64 strings as values * @returns {Promise<Blob>} Zip file as blob */ export declare const createZipFromBase64: (files: Record<string, string>) => Promise<Blob>;