import { Archive, Entry, IEntryInfo } from '../archive.ts'; import { PathType } from '../types.ts'; export interface IZipEntryExtraField { /** * Field ID. */ id: number; /** * Field data. */ data: Buffer; } export interface IEntryInfoZip extends IEntryInfo { /** * @inheritdoc */ archive: ArchiveZip; /** * @inheritdoc */ size: number; /** * @inheritdoc */ sizeComp: number; /** * @inheritdoc */ uid?: null; /** * @inheritdoc */ gid?: null; /** * @inheritdoc */ uname?: null; /** * @inheritdoc */ gname?: null; /** * @inheritdoc */ atime?: null; /** * @inheritdoc */ mtime: Date; /** * Entry CRC32. */ crc32: number; /** * Entry compression method. */ compressionMethod: number; /** * Entry is compressed flag. */ isCompressed: boolean; /** * Entry is encrypted flag. */ isEncrypted: boolean; /** * Entry version made by. */ versionMadeBy: number; /** * Entry version needed to extract. */ versionNeededToExtract: number; /** * Entry general purpose bit flags. */ generalPurposeBitFlag: number; /** * Entry internal file attributes. */ internalFileAttributes: number; /** * Entry external file attributes. */ externalFileAttributes: number; /** * Entry comment. */ comment: string; /** * Entry extra fields. */ extraFields: IZipEntryExtraField[]; /** * @inheritdoc */ readRsrc?: null; } /** * EntryZip object. */ export declare class EntryZip extends Entry { /** * @inheritdoc */ readonly archive: ArchiveZip; /** * @inheritdoc */ readonly size: number; /** * @inheritdoc */ readonly sizeComp: number; /** * @inheritdoc */ readonly uid: null; /** * @inheritdoc */ readonly gid: null; /** * @inheritdoc */ readonly uname: null; /** * @inheritdoc */ readonly gname: null; /** * @inheritdoc */ readonly atime: null; /** * @inheritdoc */ readonly mtime: Date; /** * Entry CRC32. */ readonly crc32: number; /** * Entry compression method. */ readonly compressionMethod: number; /** * Entry is compressed flag. */ readonly isCompressed: boolean; /** * Entry is encrypted flag. */ readonly isEncrypted: boolean; /** * Entry version made by. */ readonly versionMadeBy: number; /** * Entry version needed to extract. */ readonly versionNeededToExtract: number; /** * Entry general purpose bit flags. */ readonly generalPurposeBitFlag: number; /** * Entry internal file attributes. */ readonly internalFileAttributes: number; /** * Entry external file attributes. */ readonly externalFileAttributes: number; /** * Entry comment. */ readonly comment: string; /** * Entry extra fields. */ readonly extraFields: IZipEntryExtraField[]; /** * @inheritdoc */ protected readonly _readRsrc: null; /** * EntryZip constructor. * * @param info Info object. */ constructor(info: Readonly); } /** * ArchiveZip object. */ export declare class ArchiveZip extends Archive { /** * @inheritdoc */ static readonly FILE_EXTENSIONS: readonly string[] | null; /** * @inheritdoc */ readonly Entry: typeof EntryZip; /** * ArchiveZip constructor. * * @param path File path. */ constructor(path: string); /** * @inheritdoc */ read(itter: (entry: EntryZip) => Promise): Promise; /** * @inheritdoc */ protected _read(itter: (entry: EntryZip) => Promise): Promise; /** * Get Unix bits from the ZIP file external file attributes. * * @param attrs Attributes value. * @returns Unix bits or null. */ static efaToUnix(attrs: number): number; /** * Get stat mode value from ZIP file external file attributes, if present. * * @param attrs Attributes value. * @returns Stat mode or null. */ static efaToUnixMode(attrs: number): number | null; /** * Get path type from attributes and path value from ZIP file entry. * * @param attrs Attributes value. * @param path Entry path. * @returns Path type. */ static efaOrPathToPathType(attrs: number, path: string): PathType.DIRECTORY | PathType.FILE | PathType.SYMLINK | null; /** * Check if path is a Mac resource fork related path. * * @param path Zip path. * @returns Boolean value. */ static pathIsMacResource(path: string): boolean; }