/** * Archive - File archive handling * * This module provides 100% API compatibility with MicroPDF's archive operations. * Handles ZIP and other archive formats embedded in PDFs. */ /** * Archive format types */ export declare enum ArchiveFormat { Unknown = 0, Zip = 1, /** Alias for Zip */ ZIP = 1, Tar = 2, /** Alias for Tar */ TAR = 2, Directory = 3, /** Alias for Directory */ DIRECTORY = 3 } /** * Archive entry */ export interface ArchiveEntry { name: string; size: number; isDirectory: boolean; } /** * An archive (ZIP, TAR, etc.) */ export declare class Archive { private _ctx?; private _archive?; private _format; private _entries; private _refCount; private _path; constructor(format?: ArchiveFormat | null, _path?: string); /** * @internal Check if FFI bindings are available */ get hasNativeHandle(): boolean; /** * Open archive from file path using FFI * @throws Error when native bindings are not available */ static open(path: string): Archive; /** * Open archive from buffer using FFI * @throws Error when native bindings are not available */ static openWithBuffer(buffer: Uint8Array): Archive; /** * Detect archive format */ private static detectFormat; keep(): this; drop(): void; /** * Clone this archive */ clone(): Archive; /** * Get archive format */ getFormat(): ArchiveFormat; /** * Get archive format name */ getFormatName(): string; /** * Count archive entries */ count(): number; /** * Count archive entries (alias for count) */ countEntries(): number; /** * List entry by index */ listEntry(index: number): string | null; /** * Get all entry names */ entryNames(): string[]; /** * Get all entry names (alias for entryNames) */ getEntryNames(): string[]; /** * Check if entry exists */ hasEntry(name: string): boolean; /** * Get entry size */ entrySize(name: string): number; /** * Get entry size (alias for entrySize) */ getEntrySize(name: string): number; /** * Read entry data */ readEntry(name: string): Uint8Array | null; /** * Add entry to archive */ addEntry(name: string, data: Uint8Array): void; /** * Remove entry from archive */ removeEntry(name: string): boolean; /** * Get all entries */ getEntries(): ArchiveEntry[]; /** * Check if archive is valid */ isValid(): boolean; /** * Iterate over entry names */ [Symbol.iterator](): Generator; /** * For each entry */ forEach(callback: (name: string, data: Uint8Array) => void): void; /** * Extract all entries */ extractAll(): Map; /** * Extract entry by name */ extract(name: string): Uint8Array | null; /** * Extract entries matching pattern */ extractPattern(pattern: string | RegExp): Map; } //# sourceMappingURL=archive.d.ts.map