@zip.js/zip.js 2.8.57 → 2.8.59

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.d.ts CHANGED
@@ -983,7 +983,8 @@ export interface WritableWriter {
983
983
  /**
984
984
  * The number of bytes written into the instance. It is set to 0 before the first write and
985
985
  * updated as the data is written, so a writer needing the value (e.g. to compute the offset of a
986
- * disk) can read it.
986
+ * disk) can read it. A value set before the first write is kept and used as the starting offset
987
+ * instead of being reset to 0.
987
988
  */
988
989
  size?: number;
989
990
  /**
@@ -1280,6 +1281,13 @@ export class ZipReader<Type> {
1280
1281
  /**
1281
1282
  * Creates the instance
1282
1283
  *
1284
+ * @remarks
1285
+ * Reading a zip file requires random access because the central directory located at the end of the
1286
+ * file is read first. A `ReadableStream` instance, or an object providing only a `readable` property
1287
+ * (e.g. a file handle), is therefore buffered entirely in memory when the instance is initialized. To
1288
+ * read a large seekable resource without buffering it, pass a custom {@link Reader} implementation
1289
+ * that reads the requested byte ranges directly.
1290
+ *
1283
1291
  * @param reader The {@link Reader} instance used to read data.
1284
1292
  * @param options The options.
1285
1293
  */
@@ -1333,6 +1341,31 @@ export class ZipReader<Type> {
1333
1341
  * `6 + digitalSignature.length` from it when the record is stored inside the declared range.
1334
1342
  */
1335
1343
  directoryLength?: number;
1344
+ /**
1345
+ * The non-fatal diagnostics deposited while reading the entries, replaced every time
1346
+ * {@link ZipReader#getEntries} or {@link ZipReader#getEntriesGenerator} runs.
1347
+ *
1348
+ * @remarks
1349
+ * A warning reports a characteristic of the zip file observed in data the parse had already read: depositing
1350
+ * one never costs additional I/O, and a well-formed zip file deposits none. Each
1351
+ * {@link ArchiveWarning#reason} value is deposited at most once per call, with
1352
+ * {@link ArchiveWarning#filename} naming the first entry it applies to when it applies to an entry.
1353
+ *
1354
+ * Two kinds of reasons are deposited. Observations are always non-fatal: {@link WARNING_UNSORTED_CENTRAL_DIRECTORY},
1355
+ * {@link WARNING_UNKNOWN_VERSION} (the low byte of the "version needed to extract" field exceeds the highest
1356
+ * known zip specification version; the high byte is ignored because some writers store a host identifier in it),
1357
+ * {@link WARNING_COMPRESSED_PATCHED_DATA} (bit 5 of the general purpose bit flag),
1358
+ * {@link WARNING_MALFORMED_EXTRA_FIELD}, {@link WARNING_UNKNOWN_ZIP64_EXTENSIBLE_DATA} and
1359
+ * {@link WARNING_WRAPPED_ENTRIES_COUNT}. The other reasons are the checks that
1360
+ * `strictness: "strict"` rejects with {@link ERR_AMBIGUOUS_ARCHIVE}: when the effective strictness tolerates
1361
+ * one of them and the evidence is already in hand, the same reason string is deposited as a warning instead —
1362
+ * {@link WARNING_APPENDED_DATA}, {@link WARNING_PREPENDED_DATA}, {@link WARNING_TRAILING_CENTRAL_DIRECTORY_DATA},
1363
+ * {@link WARNING_DUPLICATE_FILENAME} and {@link WARNING_MISMATCHED_ZIP64_END_OF_CENTRAL_DIRECTORY}.
1364
+ *
1365
+ * The warnings related to the local file header of an entry are deposited on
1366
+ * {@link EntryMetaData#warnings} when its data is read, not here.
1367
+ */
1368
+ warnings?: ArchiveWarning[];
1336
1369
  /**
1337
1370
  * Returns all the entries in the zip file
1338
1371
  *
@@ -1361,6 +1394,58 @@ export class ZipReader<Type> {
1361
1394
  close(): Promise<void>;
1362
1395
  }
1363
1396
 
1397
+ /**
1398
+ * Returns `true` if the data looks like a zip file, i.e. if {@link ZipReader#getEntries} called on the same
1399
+ * data with the same options would locate the archive structure instead of throwing
1400
+ * {@link ERR_EOCDR_NOT_FOUND} or the {@link ERR_AMBIGUOUS_ARCHIVE} error caused by appended data.
1401
+ *
1402
+ * @remarks
1403
+ * The probe runs the same search as {@link ZipReader}: it locates the end of central directory record with
1404
+ * the end-anchored backward scan and verifies that a central directory record is stored where it points,
1405
+ * without parsing the entries. `true` therefore means the data is a plausible zip container, not that every
1406
+ * entry can be read: a truncated or otherwise damaged central directory is only detected by calling
1407
+ * {@link ZipReader#getEntries}. Formats built on zip, e.g. office documents or Java archives, return `true`.
1408
+ *
1409
+ * Like the {@link ZipReader} constructor, a `ReadableStream` or an object providing only a `readable`
1410
+ * property is buffered entirely in memory before probing, which defeats the purpose of a cheap probe; prefer
1411
+ * a seekable {@link Reader} input.
1412
+ *
1413
+ * @param reader The {@link Reader} instance used to read data.
1414
+ * @param options The options.
1415
+ * @returns A promise resolving to `true` if the data looks like a zip file.
1416
+ */
1417
+ export function isZipFile(
1418
+ reader:
1419
+ | Reader<unknown>
1420
+ | ReadableReader
1421
+ | ReadableStream
1422
+ | Reader<unknown>[]
1423
+ | ReadableReader[]
1424
+ | ReadableStream[],
1425
+ options?: IsZipFileOptions
1426
+ ): Promise<boolean>;
1427
+
1428
+ /**
1429
+ * Represents the options passed to {@link isZipFile}.
1430
+ */
1431
+ export interface IsZipFileOptions {
1432
+ /**
1433
+ * The tolerance of the probe, with the same semantics and default as
1434
+ * {@link ZipReaderConstructorOptions#strictness}: it selects the default amount of tolerated appended data
1435
+ * (0 for `"strict"`, 65536 bytes for `"balanced"`, unlimited for `"tolerant"`) and `"strict"` also returns
1436
+ * `false` when multiple end of central directory records reach the end of the data.
1437
+ *
1438
+ * @defaultValue "balanced"
1439
+ */
1440
+ strictness?: "strict" | "balanced" | "tolerant";
1441
+ /**
1442
+ * The maximum number of bytes tolerated after the end of central directory record, overriding the default
1443
+ * selected by {@link IsZipFileOptions#strictness}, with the same semantics as
1444
+ * {@link ZipReaderConstructorOptions#maxAppendedDataSize}.
1445
+ */
1446
+ maxAppendedDataSize?: number;
1447
+ }
1448
+
1364
1449
  /**
1365
1450
  * Represents the options passed to the constructor of {@link ZipReader}, and `{@link ZipDirectory}#import*`.
1366
1451
  */
@@ -1957,6 +2042,12 @@ export interface LocalDirectory {
1957
2042
  * The length of the extra field in bytes.
1958
2043
  */
1959
2044
  extraFieldLength: number;
2045
+ /**
2046
+ * The byte offset of the entry data, i.e. {@link EntryMetaData#offset} plus the size of the local file header,
2047
+ * of the filename and of the extra field. It can be used with {@link Reader#createReadable} to read the stored
2048
+ * data directly, e.g. to serve ranged requests into an entry compressed with the `"store"` method.
2049
+ */
2050
+ dataOffset: number;
1960
2051
  /**
1961
2052
  * The extra field (raw).
1962
2053
  */
@@ -2316,9 +2407,6 @@ export interface EntryMetaData {
2316
2407
  * The upper 16-bit portion of {@link EntryMetaData#externalFileAttributes} when it represents Unix mode bits.
2317
2408
  */
2318
2409
  unixExternalUpper?: number;
2319
- /**
2320
- * The number of the disk where the entry data starts.
2321
- */
2322
2410
  /**
2323
2411
  * The internal file attribute (raw).
2324
2412
  * @deprecated Use {@link EntryMetaData#internalFileAttributes} instead.
@@ -2409,7 +2497,35 @@ export interface EntryMetaData {
2409
2497
  * {@link EntryMetaData#uid} and {@link EntryMetaData#gid}, which are read from the central directory.
2410
2498
  */
2411
2499
  localDirectory?: LocalDirectory;
2500
+ /**
2501
+ * The non-fatal diagnostics deposited while reading the entry data, replaced every time the data is read.
2502
+ *
2503
+ * @remarks
2504
+ * The reasons deposited here relate to the local file header: {@link WARNING_MALFORMED_EXTRA_FIELD} when its
2505
+ * extra field data cannot be fully parsed, and — only when {@link ZipReaderOptions#checkLocalDirectory} is
2506
+ * disabled, e.g. with `strictness: "tolerant"` — the local file header mismatches the enabled check rejects
2507
+ * with {@link ERR_AMBIGUOUS_ARCHIVE}: {@link WARNING_MISMATCHED_LOCAL_FILE_HEADER_BIT_FLAG},
2508
+ * {@link WARNING_MISMATCHED_LOCAL_FILE_HEADER_COMPRESSION_METHOD} and
2509
+ * {@link WARNING_MISMATCHED_LOCAL_FILE_HEADER_CRC32_OR_SIZES}. The archive-level warnings are deposited on
2510
+ * {@link ZipReader#warnings} instead.
2511
+ */
2512
+ warnings?: ArchiveWarning[];
2412
2513
  }
2514
+
2515
+ /**
2516
+ * Represents a non-fatal diagnostic deposited on {@link ZipReader#warnings} or {@link EntryMetaData#warnings}.
2517
+ */
2518
+ export interface ArchiveWarning {
2519
+ /**
2520
+ * The reason of the warning, one of the exported `WARNING_*` constants.
2521
+ */
2522
+ reason: string;
2523
+ /**
2524
+ * The filename of the first entry the warning applies to, when it applies to an entry.
2525
+ */
2526
+ filename?: string;
2527
+ }
2528
+
2413
2529
  export interface DirectoryEntry extends EntryMetaData {
2414
2530
  /**
2415
2531
  * `true` if the entry is a directory.
@@ -2561,6 +2677,11 @@ export class ZipWriterStream {
2561
2677
  /**
2562
2678
  * Writes the entries directory, writes the global comment, and returns the content of the zipped file.
2563
2679
  *
2680
+ * @remarks
2681
+ * If an entry could not be written, this method aborts the zipped stream with the error — the
2682
+ * readable side of the stream fails instead of ending — and throws it. The `entryErrors` property
2683
+ * of the thrown error contains the errors of all the failed entries.
2684
+ *
2564
2685
  * @param comment The global comment of the zip file.
2565
2686
  * @param options The options.
2566
2687
  * @returns The content of the zip file.
@@ -2614,13 +2735,45 @@ export class ZipWriter<Type> {
2614
2735
  */
2615
2736
  readonly hasCorruptedEntries?: boolean;
2616
2737
 
2738
+ /**
2739
+ * Adds the entries of an existing zip file into the current zip. This method can be called at any
2740
+ * time, including between calls to {@link ZipWriter#add} and repeatedly to merge several zip files.
2741
+ *
2742
+ * @remarks
2743
+ * The data of the zip file is copied, its central directory is rebuilt and its entries are relocated to
2744
+ * the positions they get in the output. The disks of a split zip file passed as input are therefore unrelated to
2745
+ * the disks of the output, which is a single zip file unless the writer is a split zip file writer. The data of
2746
+ * the entries is copied as-is; in particular, the constraints set by {@link ZipWriterConstructorOptions#usdz}
2747
+ * are not applied to the copied entries.
2748
+ *
2749
+ * Pending {@link ZipWriter#add} calls are completed before the data is copied, and add() calls made
2750
+ * while the copy is in progress are written after it. If an entry of the zip file has the same
2751
+ * filename as an entry of the current zip, the method throws with the `ERR_DUPLICATED_NAME` error
2752
+ * message and leaves the current zip unchanged; call {@link ZipWriter#remove} beforehand to resolve
2753
+ * the conflicts.
2754
+ *
2755
+ * The returned promise can safely be left un-awaited: {@link ZipWriter#close} waits for the copy
2756
+ * and throws its error if it was not caught.
2757
+ *
2758
+ * @param reader The {@link Reader} instance used to read the content of the zip file.
2759
+ * @returns A promise resolving when the zip file has been added.
2760
+ */
2761
+ appendZip<ReaderType>(
2762
+ reader:
2763
+ | Reader<ReaderType>
2764
+ | ReadableReader
2765
+ | ReadableStream
2766
+ | Reader<unknown>[]
2767
+ | ReadableReader[]
2768
+ | ReadableStream[]
2769
+ ): Promise<void>;
2770
+
2617
2771
  /**
2618
2772
  * Adds an existing zip file at the beginning of the current zip. This method
2619
2773
  * cannot be called after the first call to {@link ZipWriter#add}.
2620
2774
  *
2621
- * @remarks The data of the zip file is copied, its central directory is rebuilt and its entries are relocated to
2622
- * the positions they get in the output. The disks of a split zip file passed as input are therefore unrelated to
2623
- * the disks of the output, which is a single zip file unless the writer is a split zip file writer.
2775
+ * @deprecated Use {@link ZipWriter#appendZip} instead, which is equivalent when the zip file is
2776
+ * empty and can also be called after entries have been added.
2624
2777
  *
2625
2778
  * @param reader The {@link Reader} instance used to read the content of the zip file.
2626
2779
  * @returns A promise resolving when the zip file has been added.
@@ -2638,10 +2791,15 @@ export class ZipWriter<Type> {
2638
2791
  /**
2639
2792
  * Adds an entry into the zip file
2640
2793
  *
2794
+ * @remarks
2795
+ * The returned promise can safely be left un-awaited: {@link ZipWriter#close} waits for the entry
2796
+ * and throws its error if it was not caught.
2797
+ *
2641
2798
  * @param filename The filename of the entry. Paths must use forward slashes ("/") as separator,
2642
2799
  * as required by section 4.4.17.1 of the zip specification. The value is stored as-is; in
2643
2800
  * particular, Windows path separators ("\\") are not converted and become part of the filename,
2644
- * which is interpreted inconsistently by zip tools.
2801
+ * which is interpreted inconsistently by zip tools, and leading or trailing whitespace is
2802
+ * preserved, which Windows filesystems cannot represent at the end of a name.
2645
2803
  * @param reader The {@link Reader} instance used to read the content of the entry.
2646
2804
  * @param options The options.
2647
2805
  * @returns A promise resolving to an {@link EntryMetaData} instance.
@@ -2674,6 +2832,14 @@ export class ZipWriter<Type> {
2674
2832
  * The global comment is passed as raw bytes and the comment of an entry
2675
2833
  * ({@link ZipWriterAddDataOptions#comment}) as a string on purpose, see {@link ZipReader#comment}.
2676
2834
  *
2835
+ * If {@link ZipWriter#add} or {@link ZipWriter#appendZip} calls failed and their rejection was
2836
+ * never handled — e.g. the returned promise was not awaited — this method throws the first of
2837
+ * these errors instead of finalizing the zip file. The `entryErrors` property of the thrown error
2838
+ * contains all of them. Errors already caught by the caller do not resurface here, so entries can
2839
+ * still be skipped by awaiting {@link ZipWriter#add} and catching the error. Throwing the errors
2840
+ * counts as reporting them: catching the error of this method and calling it again finalizes the
2841
+ * zip file without the failed entries.
2842
+ *
2677
2843
  * @param comment The global comment of the zip file.
2678
2844
  * @param options The options.
2679
2845
  * @returns The content of the zip file.
@@ -2719,6 +2885,10 @@ export interface ZipWriterAddDataOptions
2719
2885
  * The extra field of the entry written only in the local file header.
2720
2886
  */
2721
2887
  localExtraField?: Map<number, Uint8Array>;
2888
+ /**
2889
+ * The extra field of the entry written only in the central directory record.
2890
+ */
2891
+ centralExtraField?: Map<number, Uint8Array>;
2722
2892
  /**
2723
2893
  * The uncompressed size of the entry. This option is ignored if the {@link ZipWriterConstructorOptions#passThrough} option is not set to `true`.
2724
2894
  */
@@ -2874,6 +3044,17 @@ export interface ZipWriterConstructorOptions extends WorkerConfiguration {
2874
3044
  * @defaultValue The current date.
2875
3045
  */
2876
3046
  lastModDate?: Date;
3047
+ /**
3048
+ * The last modification date, as its raw 32-bit MS-DOS date and time value.
3049
+ *
3050
+ * @remarks
3051
+ * The value is written verbatim into the local and central directory headers and takes precedence over
3052
+ * {@link ZipWriterConstructorOptions#lastModDate}, which still fills the extended timestamp and NTFS extra
3053
+ * fields. The filesystem API sets it when exporting entries with {@link ZipReaderOptions#passThrough} set in
3054
+ * {@link ZipDirectoryEntryExportOptions#readerOptions}, so that the entries copied as-is keep the exact date
3055
+ * and time of the source zip file.
3056
+ */
3057
+ rawLastModDate?: number;
2877
3058
  /**
2878
3059
  * The last access date.
2879
3060
  *
@@ -2920,7 +3101,11 @@ export interface ZipWriterConstructorOptions extends WorkerConfiguration {
2920
3101
  */
2921
3102
  zipCrypto?: boolean;
2922
3103
  /**
2923
- * The "Version" field.
3104
+ * The "Version" field, i.e. the minimum version needed to extract the entry.
3105
+ *
3106
+ * @defaultValue the minimum version required by the features of the entry: 10 for entries stored without
3107
+ * compression or encryption, 20 for deflated, folder or ZipCrypto-encrypted entries, raised to 45 for Zip64
3108
+ * entries and 51 for AES-encrypted entries.
2924
3109
  */
2925
3110
  version?: number;
2926
3111
  /**
@@ -2942,7 +3127,9 @@ export interface ZipWriterConstructorOptions extends WorkerConfiguration {
2942
3127
  * `true` to mark the file names as UTF-8 setting the general purpose bit 11 in the header (see Appendix D -
2943
3128
  * Language Encoding (EFS)), `false` to mark the names as compliant with the original IBM Code Page 437.
2944
3129
  *
2945
- * Note that this does not ensure that the file names are in the correct encoding.
3130
+ * Note that this option only sets the flag, it does not ensure that the file names are in the correct
3131
+ * encoding: when it is set to `false`, the names are still encoded in UTF-8 unless the
3132
+ * {@link ZipWriterConstructorOptions#encodeText} option is also set to encode them in the intended code page.
2946
3133
  *
2947
3134
  * @defaultValue true
2948
3135
  */
@@ -2973,6 +3160,10 @@ export interface ZipWriterConstructorOptions extends WorkerConfiguration {
2973
3160
  * {@link ZipWriterConstructorOptions#msdosAttributesRaw} or {@link ZipWriterConstructorOptions#msdosAttributes}
2974
3161
  * turns it on, overriding an explicit `false`.
2975
3162
  *
3163
+ * MS-DOS era extractors, e.g. PKUNZIP 2.04g, only honor the directory attribute of entries declaring the
3164
+ * MS-DOS platform. Without this option, they extract folder entries as zero-length files, which can then
3165
+ * prevent extracting the files stored below the folders.
3166
+ *
2976
3167
  * @defaultValue false
2977
3168
  */
2978
3169
  msDosCompatible?: boolean;
@@ -3093,6 +3284,11 @@ export interface ZipWriterConstructorOptions extends WorkerConfiguration {
3093
3284
  * {@link ZipWriterAddDataOptions#compressionMethod} options are set explicitly. Setting the
3094
3285
  * {@link ZipWriterConstructorOptions#password} option throws an {@link ERR_UNSUPPORTED_ENCRYPTION_USDZ} error.
3095
3286
  *
3287
+ * These constraints apply to the entries written with {@link ZipWriter#add} only. The entries copied with
3288
+ * {@link ZipWriter#appendZip} keep the layout of the source zip file and are not checked, so appending a
3289
+ * zip file that does not comply with the USDZ specification, or appending it when the size of the output
3290
+ * is not a multiple of 64 bytes, silently produces a non-compliant file.
3291
+ *
3096
3292
  * @defaultValue false
3097
3293
  */
3098
3294
  usdz?: boolean;
@@ -3110,6 +3306,13 @@ export interface ZipWriterConstructorOptions extends WorkerConfiguration {
3110
3306
  * {@link ZipWriterConstructorOptions#encrypted} option is set to `true` to declare that the data is already
3111
3307
  * encrypted. In that case the password encrypts the other entries only, and the data written as-is keeps the
3112
3308
  * password it was encrypted with, which is not verified.
3309
+ *
3310
+ * When the data was encrypted with ZipCrypto, the verification byte stored in the encrypted data depends on
3311
+ * the last modification date of the source entry if the data descriptor is used. The
3312
+ * {@link ZipWriterConstructorOptions#dataDescriptor} and {@link ZipWriterConstructorOptions#rawLastModDate}
3313
+ * values of the source entry must then be forwarded, otherwise reading the copied entry fails with an
3314
+ * {@link ERR_INVALID_PASSWORD} error. The filesystem API forwards them when exporting entries and throws an
3315
+ * {@link ERR_ZIP_CRYPTO_LAST_MOD_DATE} error if the date is overridden.
3113
3316
  */
3114
3317
  passThrough?: boolean;
3115
3318
  /**
@@ -4426,6 +4629,17 @@ export const ERR_INVALID_PASS_THROUGH: string;
4426
4629
  * unknown property of a `readerOptions` object is still ignored, as everywhere else in the API.
4427
4630
  */
4428
4631
  export const ERR_INVALID_READER_OPTIONS: string;
4632
+ /**
4633
+ * Locked last modification date error (thrown by `{@link ZipDirectoryEntry}#export*()` and
4634
+ * {@link ZipDirectoryEntry#getExportedSize} when the date of an entry encrypted with ZipCrypto and exported with
4635
+ * {@link ZipReaderOptions#passThrough} set in {@link ZipDirectoryEntryExportOptions#readerOptions} is changed)
4636
+ *
4637
+ * @remarks The ZipCrypto encryption header embeds a password verification byte derived from the time of the
4638
+ * entry: the encrypted data, copied as-is, only decrypts when the time in the rewritten headers still matches.
4639
+ * The error is thrown when the new date would prevent the entry from being decrypted; changes which keep the
4640
+ * verification byte intact, e.g. a change of the day only, are written normally.
4641
+ */
4642
+ export const ERR_ZIP_CRYPTO_LAST_MOD_DATE: string;
4429
4643
  /**
4430
4644
  * Entry already exists error (thrown by the filesystem API when adding an entry whose filename already exists)
4431
4645
  */
@@ -4456,3 +4670,76 @@ export const ERR_UNSUPPORTED_CRYPTO_API: string;
4456
4670
  * disallowing workers; set `useWebWorkers` to `false` in {@link configure} to work around it)
4457
4671
  */
4458
4672
  export const ERR_WORKER_STARTUP_TIMEOUT: string;
4673
+ /**
4674
+ * Warning reason: the central directory records are not ordered by entry data position (see {@link ZipReader#warnings})
4675
+ */
4676
+ export const WARNING_UNSORTED_CENTRAL_DIRECTORY: string;
4677
+ /**
4678
+ * Warning reason: the low byte of the "version needed to extract" field of an entry exceeds the highest known
4679
+ * zip specification version (see {@link ZipReader#warnings})
4680
+ */
4681
+ export const WARNING_UNKNOWN_VERSION: string;
4682
+ /**
4683
+ * Warning reason: an entry has bit 5 of the general purpose bit flag set, i.e. declares compressed patched data
4684
+ * (see {@link ZipReader#warnings})
4685
+ */
4686
+ export const WARNING_COMPRESSED_PATCHED_DATA: string;
4687
+ /**
4688
+ * Warning reason: the extra field data of a record cannot be fully parsed; the raw bytes stay available in
4689
+ * `rawExtraField` (see {@link ZipReader#warnings} and {@link EntryMetaData#warnings})
4690
+ */
4691
+ export const WARNING_MALFORMED_EXTRA_FIELD: string;
4692
+ /**
4693
+ * Warning reason: the Zip64 end of central directory record carries extensible data the zip file does not use
4694
+ * (see {@link ZipReader#warnings})
4695
+ */
4696
+ export const WARNING_UNKNOWN_ZIP64_EXTENSIBLE_DATA: string;
4697
+ /**
4698
+ * Warning reason: the zip file contains more than 65535 entries without Zip64, recovered from the 16-bit entry
4699
+ * count wrapped modulo 65536 (see {@link ZipReader#warnings})
4700
+ */
4701
+ export const WARNING_WRAPPED_ENTRIES_COUNT: string;
4702
+ /**
4703
+ * Warning reason: data is appended after the end of the zip file (see {@link ZipReader#warnings}); the reason of
4704
+ * {@link ERR_AMBIGUOUS_ARCHIVE} when the appended data exceeds {@link GetEntriesOptions#maxAppendedDataSize}
4705
+ */
4706
+ export const WARNING_APPENDED_DATA: string;
4707
+ /**
4708
+ * Warning reason: data is prepended before the zip file (see {@link ZipReader#warnings}); the reason of
4709
+ * {@link ERR_AMBIGUOUS_ARCHIVE} under `strictness: "strict"`
4710
+ */
4711
+ export const WARNING_PREPENDED_DATA: string;
4712
+ /**
4713
+ * Warning reason: data lies between the end of the central directory records and the end of central directory
4714
+ * record, either inside the declared central directory length or beyond it (see {@link ZipReader#warnings});
4715
+ * the reason of {@link ERR_AMBIGUOUS_ARCHIVE} under `strictness: "strict"`
4716
+ */
4717
+ export const WARNING_TRAILING_CENTRAL_DIRECTORY_DATA: string;
4718
+ /**
4719
+ * Warning reason: several entries share the same filename (see {@link ZipReader#warnings}); the reason of
4720
+ * {@link ERR_AMBIGUOUS_ARCHIVE} under `strictness: "strict"`
4721
+ */
4722
+ export const WARNING_DUPLICATE_FILENAME: string;
4723
+ /**
4724
+ * Warning reason: the end of central directory record and its Zip64 counterpart disagree on a field stored in
4725
+ * both (see {@link ZipReader#warnings}); the reason of {@link ERR_AMBIGUOUS_ARCHIVE} under `strictness: "strict"`
4726
+ */
4727
+ export const WARNING_MISMATCHED_ZIP64_END_OF_CENTRAL_DIRECTORY: string;
4728
+ /**
4729
+ * Warning reason: the general purpose bit flag of the local file header contradicts the central directory
4730
+ * (see {@link EntryMetaData#warnings}); the reason of {@link ERR_AMBIGUOUS_ARCHIVE} when
4731
+ * {@link ZipReaderOptions#checkLocalDirectory} is enabled
4732
+ */
4733
+ export const WARNING_MISMATCHED_LOCAL_FILE_HEADER_BIT_FLAG: string;
4734
+ /**
4735
+ * Warning reason: the compression method of the local file header contradicts the central directory
4736
+ * (see {@link EntryMetaData#warnings}); the reason of {@link ERR_AMBIGUOUS_ARCHIVE} when
4737
+ * {@link ZipReaderOptions#checkLocalDirectory} is enabled
4738
+ */
4739
+ export const WARNING_MISMATCHED_LOCAL_FILE_HEADER_COMPRESSION_METHOD: string;
4740
+ /**
4741
+ * Warning reason: the crc32 or the sizes of the local file header contradict the central directory
4742
+ * (see {@link EntryMetaData#warnings}); the reason of {@link ERR_AMBIGUOUS_ARCHIVE} when
4743
+ * {@link ZipReaderOptions#checkLocalDirectory} is enabled
4744
+ */
4745
+ export const WARNING_MISMATCHED_LOCAL_FILE_HEADER_CRC32_OR_SIZES: string;