mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-11-29 17:51:46 +00:00
[tus-js-client] Align definitions with v1.7 (#38891)
This commit is contained in:
committed by
Armando Aguirre
parent
c3651a22cc
commit
28a2a403ca
Vendored
+5
-3
@@ -1,8 +1,9 @@
|
||||
// Type definitions for tus-js-client 1.5
|
||||
// Type definitions for tus-js-client 1.7
|
||||
// Project: https://github.com/tus/tus-js-client/
|
||||
// Definitions by: Kevin Somers-Higgins <https://github.com/kevhiggins>
|
||||
// Marius Kleidl <https://github.com/Acconut>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 3.2
|
||||
|
||||
export interface UploadOptions {
|
||||
endpoint: string;
|
||||
@@ -21,12 +22,13 @@ export interface UploadOptions {
|
||||
overridePatchMethod?: boolean;
|
||||
retryDelays?: number[];
|
||||
removeFingerprintOnSuccess?: boolean;
|
||||
uploadLengthDeferred?: boolean;
|
||||
}
|
||||
|
||||
export class Upload {
|
||||
constructor(file: File | Blob, options: UploadOptions);
|
||||
constructor(file: File | Blob | Pick<ReadableStreamDefaultReader, "read">, options: UploadOptions);
|
||||
|
||||
file: File | Blob;
|
||||
file: File | Blob | Pick<ReadableStreamDefaultReader, "read">;
|
||||
options: UploadOptions;
|
||||
url: string | null;
|
||||
|
||||
|
||||
@@ -43,3 +43,11 @@ upload.abort();
|
||||
const upload2 = new Tus.Upload(file, {
|
||||
endpoint: ""
|
||||
});
|
||||
|
||||
const reader = {
|
||||
read: () => Promise.resolve({ done: true, value: '' }),
|
||||
};
|
||||
const upload3 = new Tus.Upload(reader, {
|
||||
endpoint: '',
|
||||
uploadLengthDeferred: true,
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user