1+ /// <reference types="node" />
12import { Client } from "./index" ;
23import { Range } from "./Range" ;
34interface LargeFileUploadTaskOptions {
@@ -9,21 +10,35 @@ interface LargeFileUploadSession {
910 url : string ;
1011 expiry : Date ;
1112}
13+ interface UploadStatusResponse {
14+ expirationDateTime : string ;
15+ nextExpectedRanges : string [ ] ;
16+ }
17+ interface NodeFile {
18+ name ?: string ;
19+ buffer : Buffer ;
20+ }
21+ interface FileObject {
22+ content : File | ArrayBuffer ;
23+ name : string ;
24+ size : number ;
25+ }
1226export declare class LargeFileUploadTask {
1327 client : Client ;
14- file : File ;
28+ file : FileObject ;
1529 options : LargeFileUploadTaskOptions ;
1630 uploadSession : LargeFileUploadSession ;
1731 nextRange : Range ;
18- constructor ( client : Client , file : File , uploadSession : LargeFileUploadSession , options : LargeFileUploadTaskOptions ) ;
19- static create ( client : Client , file : File | Blob , options : LargeFileUploadTaskOptions ) : Promise < any > ;
32+ constructor ( client : Client , file : FileObject , uploadSession : LargeFileUploadSession , options : LargeFileUploadTaskOptions ) ;
33+ static create ( client : Client , file : Blob | File | NodeFile , options : LargeFileUploadTaskOptions ) : Promise < any > ;
2034 static createUploadSession ( client : Client , requestUrl : string , requestPayload : any ) : Promise < any > ;
21- private parseRange ;
22- private updateTaskStatus ;
35+ static getRandomFileName ( ) : string ;
36+ parseRange ( ranges : string [ ] ) : Range ;
37+ updateTaskStatus ( response : UploadStatusResponse ) : void ;
2338 getNextRange ( ) : Range ;
24- sliceFile ( range : Range ) : Blob ;
39+ sliceFile ( range : Range ) : ArrayBuffer | Blob ;
2540 upload ( ) : Promise < any > ;
26- uploadSlice ( fileSlice : Blob | File , range : Range , totalSize : number ) : Promise < any > ;
41+ uploadSlice ( fileSlice : ArrayBuffer | Blob | File , range : Range , totalSize : number ) : Promise < any > ;
2742 cancel ( ) : Promise < any > ;
2843 getStatus ( ) : Promise < any > ;
2944 resume ( ) : Promise < any > ;
0 commit comments