/// /// /// import ArchiveJszip from '../helper/archive/archive-jszip'; import { ArchiveParams, AutomizerFile, AutomizerParams } from '../types/types'; import JSZip, { InputType } from 'jszip'; import { XmlDocument } from '../types/xml-types'; import ArchiveFs from '../helper/archive/archive-fs'; export type ArchivedFile = { name: string; relativePath: string; content?: XmlDocument; }; export type ArchiveMode = 'jszip' | 'fs'; export type ArchiveType = ArchiveJszip | ArchiveFs; export type ArchivedFolderCallback = (file: ArchivedFile) => boolean; export type ArchiveInput = InputType; export default interface IArchive { filename: AutomizerFile; params: ArchiveParams; read: (file: string, type: 'string' | 'nodebuffer') => Promise; write: (file: string, data: string | Buffer) => Promise; readXml: (file: string) => Promise; writeXml: (file: string, XmlDocument: XmlDocument) => void; folder: (folder: string) => Promise; fileExists: (file: string) => boolean; extract: (file: string) => Promise; remove: (file: string) => Promise; output: (location: string, params: AutomizerParams) => Promise; getContent?: (params: AutomizerParams) => Promise; getArchive?: (params: AutomizerParams) => Promise; stream?: (params: AutomizerParams, options: JSZip.JSZipGeneratorOptions<'nodebuffer'>) => Promise; getFinalArchive?: () => Promise; }