mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-04 06:47:03 +00:00
[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:
committed by
Andrew Casey
parent
19cc557a07
commit
4caef8b719
Vendored
+3
-2
@@ -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: ""
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user