build: update webpack / TS build deps (#24460)

* build: update webpack / TS build deps

* chore: fix JS inferred types
This commit is contained in:
Samuel Attard 2020-07-09 01:05:16 -07:00 committed by GitHub
parent ad16e6c647
commit 8d25847318
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 329 additions and 276 deletions

View file

@ -453,12 +453,17 @@ function doubleToString (num) {
.join(''); // join the bytes in holy matrimony as a string
}
function WhammyVideo (speed, quality) { // a more abstract-ish API
function WhammyVideo (speed, quality = 0.8) { // a more abstract-ish API
this.frames = [];
this.duration = 1000 / speed;
this.quality = quality || 0.8;
this.quality = quality;
}
/**
*
* @param {string} frame
* @param {number} [duration]
*/
WhammyVideo.prototype.add = function (frame, duration) {
if (typeof duration !== 'undefined' && this.duration) throw new Error("you can't pass a duration if the fps is set");
if (typeof duration === 'undefined' && !this.duration) throw new Error("if you don't have the fps set, you need to have durations here.");