mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-05-30 01:47:21 +08:00
33 lines
1021 B
TypeScript
33 lines
1021 B
TypeScript
// Type definitions for tus-js-client 1.4
|
|
// Project: https://github.com/tus/tus-js-client/
|
|
// Definitions by: Kevin Somers-Higgins <https://github.com/kevhiggins>
|
|
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
|
|
|
export interface UploadOptions {
|
|
endpoint: string;
|
|
fingerprint?: string;
|
|
resume?: boolean;
|
|
onProgress?: ((bytesSent: number, bytesTotal: number) => void) | null;
|
|
onChunkComplete?: ((chunkSize: number, bytesAccepted: number, bytesTotal: number) => void) | null;
|
|
onSuccess?: (() => void) | null;
|
|
onError?: ((error: Error) => void) | null;
|
|
headers?: { [key: string]: string };
|
|
chunkSize?: number;
|
|
withCredentials?: boolean;
|
|
uploadUrl?: string | null;
|
|
uploadSize?: number | null;
|
|
overridePatchMethod?: boolean;
|
|
retryDelays?: number[];
|
|
}
|
|
|
|
export class Upload {
|
|
constructor(file: File | Blob, options: UploadOptions);
|
|
|
|
file: File | Blob;
|
|
options: UploadOptions;
|
|
url: string | null;
|
|
|
|
start(): void;
|
|
abort(): void;
|
|
}
|