Skip to content

Commit 74a3fdc

Browse files
authored
Docs fixes for penumbra.saveZip() (#160)
1 parent e90976c commit 74a3fdc

File tree

6 files changed

+20
-14
lines changed

6 files changed

+20
-14
lines changed

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -235,12 +235,12 @@ interface PenumbraZipWriter extends EventTarget {
235235
}
236236

237237
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;
244244
};
245245
```
246246

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@transcend-io/penumbra",
3-
"version": "4.17.1",
3+
"version": "4.17.2",
44
"description": "Crypto streams for the browser.",
55
"main": "build/penumbra.js",
66
"types": "ts-build/src/index.d.ts",

src/API.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ const DEFAULT_MIME_TYPE = 'application/octet-stream';
143143
const MAX_ALLOWED_SIZE_MAIN_THREAD = 16 * 1024 * 1024; // 16 MiB
144144

145145
/**
146-
* Zip files retrieved by Penumbra
146+
* Save a zip containing files retrieved by Penumbra
147147
*
148148
* @param options - ZipOptions
149149
* @returns PenumbraZipWriter class instance

src/types.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -127,11 +127,11 @@ export type ProgressEmit = CustomEvent<ProgressDetails>;
127127
* Zip progress event details
128128
*/
129129
export type ZipProgressDetails = {
130-
/** Percentage completed */
130+
/** Percentage completed. `null` indicates indetermination */
131131
percent: number | null;
132-
/** Total items written */
132+
/** The number of bytes or items written so far */
133133
written: number;
134-
/** Total number of expected items to write */
134+
/** The total number of bytes or items to write. `null` indicates indetermination */
135135
size: number | null;
136136
};
137137

src/utils/emitZipProgress.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ import { PenumbraEvent } from '../event';
55
/**
66
* An event emitter for PenumbraZipWriter progress
77
* @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
1010
* @returns
1111
*/
1212
export default function emitZipProgress(

src/zip.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,13 @@ const sumWrites = async (writes: Promise<number>[]): Promise<number> => {
2828
);
2929
};
3030

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+
*/
3238
export class PenumbraZipWriter extends EventTarget {
3339
/** Conflux zip writer instance */
3440
private conflux: Writer = new Writer();

0 commit comments

Comments
 (0)