@zip.js/zip.js 2.7.41 → 2.7.42

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
@@ -4,7 +4,7 @@
4
4
  * @see {@link https://wicg.github.io/entries-api/#api-entry|specification}
5
5
  */
6
6
  // deno-lint-ignore no-empty-interface
7
- interface FileSystemEntryLike {}
7
+ interface FileSystemEntryLike { }
8
8
 
9
9
  /**
10
10
  * Represents the `FileSystemHandle` class.
@@ -12,7 +12,7 @@ interface FileSystemEntryLike {}
12
12
  * @see {@link https://fs.spec.whatwg.org/#api-filesystemhandle}
13
13
  */
14
14
  // deno-lint-ignore no-empty-interface
15
- interface FileSystemHandleLike {}
15
+ interface FileSystemHandleLike { }
16
16
 
17
17
  /**
18
18
  * Represents a generic `TransformStream` class.
@@ -268,7 +268,7 @@ declare class ZipInflate extends SyncCodec {
268
268
  /**
269
269
  * Represents a class implementing `CompressionStream` or `DecompressionStream` interfaces.
270
270
  */
271
- declare class CodecStream extends TransformStream {}
271
+ declare class CodecStream extends TransformStream { }
272
272
 
273
273
  /**
274
274
  * Returns the MIME type corresponding to a filename extension.
@@ -361,41 +361,41 @@ export class Reader<Type> implements Initializable, ReadableReader {
361
361
  /**
362
362
  * Represents a {@link Reader} instance used to read data provided as a `string`.
363
363
  */
364
- export class TextReader extends Reader<string> {}
364
+ export class TextReader extends Reader<string> { }
365
365
 
366
366
  /**
367
367
  * Represents a {@link Reader} instance used to read data provided as a `Blob` instance.
368
368
  */
369
- export class BlobReader extends Reader<Blob> {}
369
+ export class BlobReader extends Reader<Blob> { }
370
370
 
371
371
  /**
372
372
  * Represents a {@link Reader} instance used to read data provided as a Data URI `string` encoded in Base64.
373
373
  */
374
- export class Data64URIReader extends Reader<string> {}
374
+ export class Data64URIReader extends Reader<string> { }
375
375
 
376
376
  /**
377
377
  * Represents a {@link Reader} instance used to read data provided as a `Uint8Array` instance.
378
378
  */
379
- export class Uint8ArrayReader extends Reader<Uint8Array> {}
379
+ export class Uint8ArrayReader extends Reader<Uint8Array> { }
380
380
 
381
381
  /**
382
382
  * Represents a {@link Reader} instance used to read data provided as an array of {@link ReadableReader} instances (e.g. split zip files).
383
383
  *
384
384
  * @deprecated Use {@link SplitDataReader} instead.
385
385
  */
386
- export class SplitZipReader extends SplitDataReader {}
386
+ export class SplitZipReader extends SplitDataReader { }
387
387
 
388
388
  /**
389
389
  * Represents a {@link Reader} instance used to read data provided as an array of {@link ReadableReader} instances (e.g. split zip files).
390
390
  */
391
391
  export class SplitDataReader
392
- extends Reader<Reader<unknown>[] | ReadableReader[] | ReadableStream[]> {}
392
+ extends Reader<Reader<unknown>[] | ReadableReader[] | ReadableStream[]> { }
393
393
 
394
394
  /**
395
395
  * Represents a URL stored into a `string`.
396
396
  */
397
397
  // deno-lint-ignore no-empty-interface
398
- interface URLString extends String {}
398
+ interface URLString extends String { }
399
399
 
400
400
  /**
401
401
  * Represents a {@link Reader} instance used to fetch data from a URL.
@@ -591,7 +591,7 @@ export class Data64URIWriter extends Writer<string> {
591
591
  *
592
592
  * @deprecated Use {@link SplitDataWriter} instead.
593
593
  */
594
- export class SplitZipWriter extends SplitDataWriter {}
594
+ export class SplitZipWriter extends SplitDataWriter { }
595
595
 
596
596
  /**
597
597
  * Represents a {@link Writer} instance used to retrieve the written data from a generator of {@link WritableWriter} instances (i.e. split zip files).
@@ -623,7 +623,7 @@ export class SplitDataWriter implements Initializable, WritableWriter {
623
623
  /**
624
624
  * Represents a {@link Writer} instance used to retrieve the written data as a `Uint8Array` instance.
625
625
  */
626
- export class Uint8ArrayWriter extends Writer<Uint8Array> {}
626
+ export class Uint8ArrayWriter extends Writer<Uint8Array> { }
627
627
 
628
628
  /**
629
629
  * Represents an instance used to create an unzipped stream.
@@ -767,7 +767,7 @@ export interface ZipReaderConstructorOptions
767
767
  * Represents the options passed to {@link ZipReader#getEntries} and {@link ZipReader#getEntriesGenerator}.
768
768
  */
769
769
  export interface ZipReaderGetEntriesOptions
770
- extends GetEntriesOptions, EntryOnprogressOptions {}
770
+ extends GetEntriesOptions, EntryOnprogressOptions { }
771
771
 
772
772
  /**
773
773
  * Represents options passed to the constructor of {@link ZipReader}, {@link ZipReader#getEntries} and {@link ZipReader#getEntriesGenerator}.
@@ -781,6 +781,14 @@ export interface GetEntriesOptions {
781
781
  * The encoding of the comment of the entry.
782
782
  */
783
783
  commentEncoding?: string;
784
+ /**
785
+ * Decodes the filename and the comment of the entry.
786
+ *
787
+ * @param value The raw text value.
788
+ * @param encoding The encoding of the text.
789
+ * @returns The decoded text value.
790
+ */
791
+ decodeText?(value: Uint8Array, encoding: string): string
784
792
  }
785
793
 
786
794
  /**
@@ -984,13 +992,13 @@ export interface Entry extends EntryMetaData {
984
992
  * Represents the options passed to {@link Entry#getData} and `{@link ZipFileEntry}.get*`.
985
993
  */
986
994
  export interface EntryGetDataOptions
987
- extends EntryDataOnprogressOptions, ZipReaderOptions, WorkerConfiguration {}
995
+ extends EntryDataOnprogressOptions, ZipReaderOptions, WorkerConfiguration { }
988
996
 
989
997
  /**
990
998
  * Represents the options passed to {@link Entry#getData} and `{@link ZipFileEntry}.get*`.
991
999
  */
992
1000
  export interface EntryGetDataCheckPasswordOptions
993
- extends EntryGetDataOptions, ZipReaderCheckPasswordOptions {}
1001
+ extends EntryGetDataOptions, ZipReaderCheckPasswordOptions { }
994
1002
 
995
1003
  /**
996
1004
  * Represents an instance used to create a zipped stream.
@@ -1153,9 +1161,9 @@ export class ZipWriter<Type> {
1153
1161
  */
1154
1162
  export interface ZipWriterAddDataOptions
1155
1163
  extends
1156
- ZipWriterConstructorOptions,
1157
- EntryDataOnprogressOptions,
1158
- WorkerConfiguration {
1164
+ ZipWriterConstructorOptions,
1165
+ EntryDataOnprogressOptions,
1166
+ WorkerConfiguration {
1159
1167
  /**
1160
1168
  * `true` if the entry is a directory.
1161
1169
  *
@@ -1343,6 +1351,13 @@ export interface ZipWriterConstructorOptions {
1343
1351
  * @defaultValue false
1344
1352
  */
1345
1353
  usdz?: boolean;
1354
+ /**
1355
+ * Encode the filename and the comment of the entry.
1356
+ *
1357
+ * @param text The text to encode.
1358
+ * @returns The encoded text.
1359
+ */
1360
+ encodeText?(text: string): Uint8Array
1346
1361
  }
1347
1362
 
1348
1363
  /**
@@ -1835,7 +1850,7 @@ export class ZipDirectoryEntry extends ZipEntry {
1835
1850
  * Represents the options passed to {@link ZipDirectoryEntry#importHttpContent}.
1836
1851
  */
1837
1852
  export interface ZipDirectoryEntryImportHttpOptions
1838
- extends ZipReaderConstructorOptions, HttpOptions {}
1853
+ extends ZipReaderConstructorOptions, HttpOptions { }
1839
1854
 
1840
1855
  /**
1841
1856
  * Represents the options passed to `{@link ZipDirectoryEntry}#export*()`.