@zip.js/zip.js 2.6.54 → 2.6.55
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/dist/zip-fs-full.js +2 -2
- package/dist/zip-fs-full.min.js +1 -1
- package/dist/zip-fs.js +2 -2
- package/dist/zip-fs.min.js +1 -1
- package/index.cjs +2 -2
- package/index.d.ts +27 -8
- package/lib/core/zip-fs-core.js +2 -2
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -587,7 +587,7 @@ export class SplitDataWriter implements Initializable, WritableWriter {
|
|
|
587
587
|
/**
|
|
588
588
|
* Creates the {@link SplitDataWriter} instance
|
|
589
589
|
*
|
|
590
|
-
* @param writerGenerator
|
|
590
|
+
* @param writerGenerator A generator of Writer isntances.
|
|
591
591
|
* @param maxSize The maximum size of the data written into {@link Writer} instances (default: 4GB).
|
|
592
592
|
*/
|
|
593
593
|
constructor(writerGenerator: AsyncGenerator<Writer<unknown> | WritableWriter | WritableStream, boolean>, maxSize?: number)
|
|
@@ -1206,11 +1206,11 @@ export class ZipFileEntry<ReaderType, WriterType> extends ZipEntry {
|
|
|
1206
1206
|
/**
|
|
1207
1207
|
* The {@link Reader} instance used to read the content of the entry.
|
|
1208
1208
|
*/
|
|
1209
|
-
reader: Reader<ReaderType> | ReadableReader
|
|
1209
|
+
reader: Reader<ReaderType> | ReadableReader | ReadableStream | Reader<unknown>[] | ReadableReader[] | ReadableStream[]
|
|
1210
1210
|
/**
|
|
1211
1211
|
* The {@link Writer} instance used to write the content of the entry.
|
|
1212
1212
|
*/
|
|
1213
|
-
writer: Writer<WriterType> | WritableWriter
|
|
1213
|
+
writer: Writer<WriterType> | WritableWriter | WritableStream | AsyncGenerator<Writer<unknown> | WritableWriter | WritableStream>
|
|
1214
1214
|
/**
|
|
1215
1215
|
* Retrieves the text content of the entry as a `string`
|
|
1216
1216
|
*
|
|
@@ -1257,7 +1257,7 @@ export class ZipFileEntry<ReaderType, WriterType> extends ZipEntry {
|
|
|
1257
1257
|
* @param options The options.
|
|
1258
1258
|
* @returns A promise resolving to data associated to the {@link Writer} instance.
|
|
1259
1259
|
*/
|
|
1260
|
-
getData(writer: Writer<
|
|
1260
|
+
getData(writer: Writer<unknown> | WritableWriter | WritableStream | AsyncGenerator<Writer<unknown> | WritableWriter | WritableStream>, options?: EntryGetDataOptions): Promise<unknown>
|
|
1261
1261
|
/**
|
|
1262
1262
|
* Replaces the content of the entry with a `Blob` instance
|
|
1263
1263
|
*
|
|
@@ -1404,34 +1404,49 @@ export class ZipDirectoryEntry extends ZipEntry {
|
|
|
1404
1404
|
*/
|
|
1405
1405
|
importReadable(readable: ReadableStream, options?: ZipReaderConstructorOptions): Promise<void>
|
|
1406
1406
|
/**
|
|
1407
|
-
*
|
|
1407
|
+
* Extracts a zip file provided via a custom {@link Reader} instance into the entry
|
|
1408
|
+
*
|
|
1409
|
+
* @param reader The {@link Reader} instance.
|
|
1410
|
+
* @param options The options.
|
|
1411
|
+
*/
|
|
1412
|
+
importZip(reader: Reader<unknown> | ReadableReader | ReadableStream | Reader<unknown>[] | ReadableReader[] | ReadableStream[], options?: ZipReaderConstructorOptions): Promise<void>
|
|
1413
|
+
/**
|
|
1414
|
+
* Returns a `Blob` instance containing a zip file of the entry and its descendants
|
|
1408
1415
|
*
|
|
1409
1416
|
* @param options The options.
|
|
1410
1417
|
* @returns A promise resolving to the `Blob` instance.
|
|
1411
1418
|
*/
|
|
1412
1419
|
exportBlob(options?: ZipDirectoryEntryExportOptions): Promise<Blob>
|
|
1413
1420
|
/**
|
|
1414
|
-
* Returns a Data URI `string` encoded in Base64 containing a zip file of the entry and its descendants
|
|
1421
|
+
* Returns a Data URI `string` encoded in Base64 containing a zip file of the entry and its descendants
|
|
1415
1422
|
*
|
|
1416
1423
|
* @param options The options.
|
|
1417
1424
|
* @returns A promise resolving to the Data URI `string` encoded in Base64.
|
|
1418
1425
|
*/
|
|
1419
1426
|
exportData64URI(options?: ZipDirectoryEntryExportOptions): Promise<string>
|
|
1420
1427
|
/**
|
|
1421
|
-
* Returns a `Uint8Array` instance containing a zip file of the entry and its descendants
|
|
1428
|
+
* Returns a `Uint8Array` instance containing a zip file of the entry and its descendants
|
|
1422
1429
|
*
|
|
1423
1430
|
* @param options The options.
|
|
1424
1431
|
* @returns A promise resolving to the `Uint8Array` instance.
|
|
1425
1432
|
*/
|
|
1426
1433
|
exportUint8Array(options?: ZipDirectoryEntryExportOptions): Promise<Uint8Array>
|
|
1427
1434
|
/**
|
|
1428
|
-
* Creates a zip file via a `WritableStream` instance containing the entry and its descendants
|
|
1435
|
+
* Creates a zip file via a `WritableStream` instance containing the entry and its descendants
|
|
1429
1436
|
*
|
|
1430
1437
|
* @param writable The `WritableStream` instance.
|
|
1431
1438
|
* @param options The options.
|
|
1432
1439
|
* @returns A promise resolving to the `Uint8Array` instance.
|
|
1433
1440
|
*/
|
|
1434
1441
|
exportWritable(writable?: WritableStream, options?: ZipDirectoryEntryExportOptions): Promise<WritableStream>
|
|
1442
|
+
/**
|
|
1443
|
+
* Creates a zip file via a custom {@link Writer} instance containing the entry and its descendants
|
|
1444
|
+
*
|
|
1445
|
+
* @param writer The {@link Writer} instance.
|
|
1446
|
+
* @param options The options.
|
|
1447
|
+
* @returns A promise resolving to the data.
|
|
1448
|
+
*/
|
|
1449
|
+
exportZip(writer: Writer<unknown> | WritableWriter | WritableStream | AsyncGenerator<Writer<unknown> | WritableWriter | WritableStream>, options?: ZipDirectoryEntryExportOptions): Promise<unknown>
|
|
1435
1450
|
}
|
|
1436
1451
|
|
|
1437
1452
|
/**
|
|
@@ -1447,6 +1462,10 @@ interface ZipDirectoryEntryExportOptions extends ZipWriterConstructorOptions, En
|
|
|
1447
1462
|
* `true` to use filenames relative to the entry instead of full filenames.
|
|
1448
1463
|
*/
|
|
1449
1464
|
relativePath?: boolean
|
|
1465
|
+
/**
|
|
1466
|
+
* The MIME type of the exported data when relevant.
|
|
1467
|
+
*/
|
|
1468
|
+
mimeType: string
|
|
1450
1469
|
}
|
|
1451
1470
|
|
|
1452
1471
|
/**
|
package/lib/core/zip-fs-core.js
CHANGED
|
@@ -285,11 +285,11 @@ class ZipDirectoryEntry extends ZipEntry {
|
|
|
285
285
|
}
|
|
286
286
|
|
|
287
287
|
exportBlob(options = {}) {
|
|
288
|
-
return this.exportZip(new BlobWriter("application/zip"), options);
|
|
288
|
+
return this.exportZip(new BlobWriter(options.mimeType || "application/zip"), options);
|
|
289
289
|
}
|
|
290
290
|
|
|
291
291
|
exportData64URI(options = {}) {
|
|
292
|
-
return this.exportZip(new Data64URIWriter("application/zip"), options);
|
|
292
|
+
return this.exportZip(new Data64URIWriter(options.mimeType || "application/zip"), options);
|
|
293
293
|
}
|
|
294
294
|
|
|
295
295
|
exportUint8Array(options = {}) {
|
package/package.json
CHANGED