File tree Expand file tree Collapse file tree 6 files changed +20
-14
lines changed Expand file tree Collapse file tree 6 files changed +20
-14
lines changed Original file line number Diff line number Diff line change @@ -235,12 +235,12 @@ interface PenumbraZipWriter extends EventTarget {
235
235
}
236
236
237
237
type ZipProgressDetails = {
238
- /** Percentage completed */
239
- percent: number ;
240
- /** Total bytes read */
241
- totalBytesRead : number ;
242
- /** Total number of bytes to read */
243
- contentLength : number ;
238
+ /** Percentage completed. `null` indicates indetermination */
239
+ percent: number | null ;
240
+ /** The number of bytes or items written so far */
241
+ written : number ;
242
+ /** The total number of bytes or items to write. `null` indicates indetermination */
243
+ size : number | null ;
244
244
};
245
245
```
246
246
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " @transcend-io/penumbra" ,
3
- "version" : " 4.17.1 " ,
3
+ "version" : " 4.17.2 " ,
4
4
"description" : " Crypto streams for the browser." ,
5
5
"main" : " build/penumbra.js" ,
6
6
"types" : " ts-build/src/index.d.ts" ,
Original file line number Diff line number Diff line change @@ -143,7 +143,7 @@ const DEFAULT_MIME_TYPE = 'application/octet-stream';
143
143
const MAX_ALLOWED_SIZE_MAIN_THREAD = 16 * 1024 * 1024 ; // 16 MiB
144
144
145
145
/**
146
- * Zip files retrieved by Penumbra
146
+ * Save a zip containing files retrieved by Penumbra
147
147
*
148
148
* @param options - ZipOptions
149
149
* @returns PenumbraZipWriter class instance
Original file line number Diff line number Diff line change @@ -127,11 +127,11 @@ export type ProgressEmit = CustomEvent<ProgressDetails>;
127
127
* Zip progress event details
128
128
*/
129
129
export type ZipProgressDetails = {
130
- /** Percentage completed */
130
+ /** Percentage completed. `null` indicates indetermination */
131
131
percent : number | null ;
132
- /** Total items written */
132
+ /** The number of bytes or items written so far */
133
133
written : number ;
134
- /** Total number of expected items to write */
134
+ /** The total number of bytes or items to write. `null` indicates indetermination */
135
135
size : number | null ;
136
136
} ;
137
137
Original file line number Diff line number Diff line change @@ -5,8 +5,8 @@ import { PenumbraEvent } from '../event';
5
5
/**
6
6
* An event emitter for PenumbraZipWriter progress
7
7
* @param writer - PenumbraZipWriter instance
8
- * @param totalBytesRead - The number of bytes or items written so far
9
- * @param contentLength - The total number of bytes or items to write
8
+ * @param written - The number of bytes or items written so far
9
+ * @param size - The total number of bytes or items to write
10
10
* @returns
11
11
*/
12
12
export default function emitZipProgress (
Original file line number Diff line number Diff line change @@ -28,7 +28,13 @@ const sumWrites = async (writes: Promise<number>[]): Promise<number> => {
28
28
) ;
29
29
} ;
30
30
31
- /** Wrapped WritableStream for state keeping with StreamSaver */
31
+ /**
32
+ * Save a zip containing files retrieved by Penumbra
33
+ *
34
+ * @example new PenumbraZipWriter(options)
35
+ * @param options - ZipOptions
36
+ * @returns PenumbraZipWriter class instance
37
+ */
32
38
export class PenumbraZipWriter extends EventTarget {
33
39
/** Conflux zip writer instance */
34
40
private conflux : Writer = new Writer ( ) ;
You can’t perform that action at this time.
0 commit comments