[tus-js-client] Align definitions with v1.8 (#40629)

* update tus-js-client definition to match 1.8

* Update tus-js-client test

* [tus-js-client]: remove trailing whitespace

* [tus-js-client]: fix test on upload.abort method
This commit is contained in:
Ifedapo .A. Olarewaju
2019-11-25 11:04:29 -08:00
committed by Andrew Casey
parent 19cc557a07
commit 4caef8b719
2 changed files with 11 additions and 2 deletions
+3 -2
View File
@@ -1,4 +1,4 @@
// Type definitions for tus-js-client 1.7
// Type definitions for tus-js-client 1.8
// Project: https://github.com/tus/tus-js-client/
// Definitions by: Kevin Somers-Higgins <https://github.com/kevhiggins>
// Marius Kleidl <https://github.com/Acconut>
@@ -32,8 +32,9 @@ export class Upload {
options: UploadOptions;
url: string | null;
static terminate(url: string, options?: UploadOptions, callback?: (error?: Error) => void): void;
start(): void;
abort(): void;
abort(shouldTerminate?: boolean, callback?: (error?: Error) => void): void;
}
export const isSupported: boolean;
@@ -39,6 +39,10 @@ const upload = new Tus.Upload(file, {
upload.start();
upload.abort();
upload.abort(true);
upload.abort(true, (err?: Error) => {
console.log("Failed because: " + err);
});
const upload2 = new Tus.Upload(file, {
endpoint: ""
@@ -51,3 +55,7 @@ const upload3 = new Tus.Upload(reader, {
endpoint: '',
uploadLengthDeferred: true,
});
Tus.Upload.terminate('https://myurl.com', {
endpoint: ""
});