import type { ReadableStream as NodeWebRS } from 'node:stream/web'; import type { FileCollection } from '../FileCollection.ts'; import type { Options } from '../Options.ts'; import type { ToIumIndex } from './versions/index.ts'; export interface ExtraFileContentInput { /** * Primitives from file reading libraries */ buffer: Uint8Array | ArrayBufferLike | Blob; /** * From file reading stream api */ stream: ReadableStream | NodeWebRS; /** * Raw text content (no binary string encoding nor base64) */ text: string; } export type ExtraFileContent = ExtraFileContentInput[keyof ExtraFileContentInput]; export interface ToIumOptionsExtraFile { relativePath: string; data: ExtraFileContent; options?: Options; uuid?: string; } export interface ToIumOptions { /** * If true, the data of the files will always be included in the zip. * @default true */ includeData?: boolean; /** * The mimetype of the zip file. * It's put in the zip as the first entry, * not compressed in the zip to be able to fast check it with signature and minimal parsing. * @default 'application/x-ium+zip' */ mimetype?: string; getExtraFiles?: (index: ToIumIndex, fileCollection: FileCollection) => Iterable; } /** * This method will zip a file collection and return the zip as an ArrayBuffer * @param fileCollection - The file collection to zip * @param options - Options for the zip process * @returns Zip as an Uint8Array */ export declare function toIum(fileCollection: FileCollection, options?: ToIumOptions): Promise>; export declare const UNSUPPORTED_EXTRA_FILE_CONTENT_ERROR = "Unsupported file content type.\nIf you passed a Node.js Stream convert it to Web Stream."; //# sourceMappingURL=to_ium.d.ts.map