@zip.js/zip.js 2.6.50 → 2.6.51

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.
Files changed (2) hide show
  1. package/index.d.ts +22 -8
  2. package/package.json +1 -1
package/index.d.ts CHANGED
@@ -740,9 +740,9 @@ interface ZipReaderOptions {
740
740
  }
741
741
 
742
742
  /**
743
- * Represents an entry in a zip file (Core API).
743
+ * Represents the metatdata of an entry in a zip file (Core API).
744
744
  */
745
- export interface Entry {
745
+ export interface EntryMetaData {
746
746
  /**
747
747
  * The byte offset of the entry.
748
748
  */
@@ -861,6 +861,20 @@ export interface Entry {
861
861
  getData?<Type>(writer: Writer<Type> | WritableWriter | WritableStream | AsyncGenerator<Writer<unknown> | WritableWriter | WritableStream, boolean>, options?: EntryGetDataOptions): Promise<Type>
862
862
  }
863
863
 
864
+ /**
865
+ * Represents an entry with its data and metadata in a zip file (Core API).
866
+ */
867
+ export interface Entry extends EntryMetaData {
868
+ /**
869
+ * Returns the content of the entry
870
+ *
871
+ * @param writer The {@link Writer} instance used to write the content of the entry.
872
+ * @param options The options.
873
+ * @returns A promise resolving to the type to data associated to `writer`.
874
+ */
875
+ getData<Type>(writer: Writer<Type> | WritableWriter | WritableStream | AsyncGenerator<Writer<unknown> | WritableWriter | WritableStream, boolean>, options?: EntryGetDataOptions): Promise<Type>
876
+ }
877
+
864
878
  /**
865
879
  * Represents the options passed to {@link Entry#getData} and `{@link ZipFileEntry}.get*`.
866
880
  */
@@ -904,9 +918,9 @@ export class ZipWriter<Type> {
904
918
  * @param filename The filename of the entry.
905
919
  * @param reader The {@link Reader} instance used to read the content of the entry.
906
920
  * @param options The options.
907
- * @returns A promise resolving to an {@link Entry} instance.
921
+ * @returns A promise resolving to an {@link EntryMetaData} instance.
908
922
  */
909
- add<ReaderType>(filename: string, reader?: Reader<ReaderType> | ReadableReader | ReadableStream | Reader<unknown>[] | ReadableReader[] | ReadableStream[], options?: ZipWriterAddDataOptions): Promise<Entry>
923
+ add<ReaderType>(filename: string, reader?: Reader<ReaderType> | ReadableReader | ReadableStream | Reader<unknown>[] | ReadableReader[] | ReadableStream[], options?: ZipWriterAddDataOptions): Promise<EntryMetaData>
910
924
  /**
911
925
  * Writes the entries directory, writes the global comment, and returns the content of the zip file
912
926
  *
@@ -1075,7 +1089,7 @@ interface ZipWriterConstructorOptions {
1075
1089
  */
1076
1090
  dataDescriptorSignature?: boolean
1077
1091
  /**
1078
- * `true` to write {@link Entry#externalFileAttribute} in MS-DOS format for folder entries.
1092
+ * `true` to write {@link EntryMetaData#externalFileAttribute} in MS-DOS format for folder entries.
1079
1093
  *
1080
1094
  * @defaultValue true
1081
1095
  */
@@ -1134,7 +1148,7 @@ interface EntryOnprogressOptions {
1134
1148
  * @param entry The entry being read/written.
1135
1149
  * @returns An empty promise or `undefined`.
1136
1150
  */
1137
- onprogress?(progress: number, total: number, entry: Entry): Promise<void> | undefined
1151
+ onprogress?(progress: number, total: number, entry: EntryMetaData): Promise<void> | undefined
1138
1152
  }
1139
1153
 
1140
1154
  /**
@@ -1146,9 +1160,9 @@ declare class ZipEntry {
1146
1160
  */
1147
1161
  name: string
1148
1162
  /**
1149
- * The underlying {@link Entry} instance.
1163
+ * The underlying {@link EntryMetaData} instance.
1150
1164
  */
1151
- data?: Entry
1165
+ data?: EntryMetaData
1152
1166
  /**
1153
1167
  * The ID of the instance.
1154
1168
  */
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "description": "A JavaScript library to zip and unzip files in the browser, Deno and Node.js",
4
4
  "author": "Gildas Lormeau",
5
5
  "license": "BSD-3-Clause",
6
- "version": "2.6.50",
6
+ "version": "2.6.51",
7
7
  "type": "module",
8
8
  "keywords": [
9
9
  "zip",