Skip to content

Commit fc0381b

Browse files
committed
Update Typescript type definitions
1 parent a6b32c2 commit fc0381b

File tree

9 files changed

+16
-38
lines changed

9 files changed

+16
-38
lines changed

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747
"scripts": {
4848
"build-webpshim": "cd build; make",
4949
"coverage": "./node_modules/.bin/c8 npm test",
50-
"test": "./node_modules/.bin/mocha tests/*.spec.js"
50+
"test": "./node_modules/.bin/mocha tests/*.spec.js",
51+
"update-types": "tsc"
5152
}
5253
}

types/archive/archive.d.ts.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

types/archive/decompress-internal.d.ts

Lines changed: 2 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,11 @@ export namespace UnarchiveEventType {
2020
/**
2121
* An unarchive event.
2222
*/
23-
export class UnarchiveEvent {
23+
export class UnarchiveEvent extends Event {
2424
/**
2525
* @param {string} type The event type.
2626
*/
2727
constructor(type: string);
28-
/**
29-
* The event type.
30-
* @type {string}
31-
*/
32-
type: string;
3328
}
3429
/**
3530
* Updates all Archiver listeners that an append has occurred.
@@ -118,11 +113,8 @@ export class UnarchiveExtractEvent extends UnarchiveEvent {
118113
}
119114
/**
120115
* Base class for all Unarchivers.
121-
* TODO: When EventTarget constructors are broadly supported, make this extend
122-
* EventTarget and remove event listener code.
123-
* https://caniuse.com/#feat=mdn-api_eventtarget_eventtarget
124116
*/
125-
export class Unarchiver {
117+
export class Unarchiver extends EventTarget {
126118
/**
127119
* @param {ArrayBuffer} arrayBuffer The Array Buffer. Note that this ArrayBuffer must not be
128120
* referenced once it is sent to the Unarchiver, since it is marked as Transferable and sent
@@ -158,12 +150,6 @@ export class Unarchiver {
158150
* @type {boolean}
159151
*/
160152
debugMode_: boolean;
161-
/**
162-
* A map from event type to an array of listeners.
163-
* @private
164-
* @type {Map.<string, Array>}
165-
*/
166-
private listeners_;
167153
/**
168154
* Private web worker initialized during start().
169155
* @private
@@ -182,20 +168,6 @@ export class Unarchiver {
182168
* @protected.
183169
*/
184170
protected getScriptFileName(): string;
185-
/**
186-
* Adds an event listener for UnarchiveEvents.
187-
*
188-
* @param {string} Event type.
189-
* @param {function} An event handler function.
190-
*/
191-
addEventListener(type: any, listener: any): void;
192-
/**
193-
* Removes an event listener.
194-
*
195-
* @param {string} Event type.
196-
* @param {EventListener|function} An event listener or handler function.
197-
*/
198-
removeEventListener(type: any, listener: any): void;
199171
/**
200172
* Create an UnarchiveEvent out of the object sent back from the Worker.
201173
* @param {Object} obj

types/archive/decompress-internal.d.ts.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

types/codecs/codecs.d.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@
1717
* @property {string} r_frame_rate Like "60000/1001"
1818
*/
1919
/**
20-
* @typedef ProbeFormat ffprobe -show_format -print_format json. Only the fields we care about.
20+
* @typedef ProbeFormat Only the fields we care about from the following command:
21+
* ffprobe -show_format -show_streams -v quiet -print_format json -i file.mp4
2122
* @property {string} filename
2223
* @property {string} format_name
2324
* @property {string} duration Number of seconds, as a string like "473.506367".
@@ -69,7 +70,8 @@ export type ProbeStream = {
6970
r_frame_rate: string;
7071
};
7172
/**
72-
* ffprobe -show_format -print_format json. Only the fields we care about.
73+
* Only the fields we care about from the following command:
74+
* ffprobe -show_format -show_streams -v quiet -print_format json -i file.mp4
7375
*/
7476
export type ProbeFormat = {
7577
filename: string;

types/codecs/codecs.d.ts.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

types/file/sniffer.d.ts.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

types/io/bitstream.d.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,12 @@ export const BitStream: {
2727
peekBits: (n: number, opt_movePointers: any) => number;
2828
/**
2929
* Returns how many bites have been read in the stream since the beginning of time.
30+
* @returns {number}
3031
*/
3132
getNumBitsRead(): number;
3233
/**
3334
* Returns how many bits are currently in the stream left to be read.
35+
* @returns {number}
3436
*/
3537
getNumBitsLeft(): number;
3638
/**
@@ -60,6 +62,7 @@ export const BitStream: {
6062
* Bit at (bytePtr,bitPtr) has the highest position in returning data.
6163
* Taken from getbits.hpp in unrar.
6264
* TODO: Move this out of BitStream and into unrar.
65+
* @returns {number}
6366
*/
6467
getBits(): number;
6568
/**

types/io/bitstream.d.ts.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)