forked from joltup/rn-fetch-blob
-
Notifications
You must be signed in to change notification settings - Fork 0
/
types.js
70 lines (64 loc) · 1.64 KB
/
types.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
export type ReactNativeBlobUtilConfig = {
Progress: any,
UploadProgress: any,
fileCache : bool,
transformFile: boolean;
path : string,
appendExt : string,
session : string,
addAndroidDownloads : any,
indicator : bool,
followRedirect : bool,
trusty : bool,
wifiOnly : bool
};
export type ReactNativeBlobUtilNative = {
// API for fetch octet-stream data
fetchBlob : (
options:fetchConfig,
taskId:string,
method:string,
url:string,
headers:any,
body:any,
callback:(err:any, ...data:any) => void
) => void,
// API for fetch form data
fetchBlobForm : (
options:fetchConfig,
taskId:string,
method:string,
url:string,
headers:any,
form:Array<any>,
callback:(err:any, ...data:any) => void
) => void,
// open file stream
readStream : (
path:string,
encode:'utf8' | 'ascii' | 'base64'
) => void,
// get system folders
getEnvironmentDirs : (dirs:any) => void,
// unlink file by path
unlink : (path:string, callback: (err:any) => void) => void,
removeSession : (paths:Array<string>, callback: (err:any) => void) => void,
ls : (path:string, callback: (err:any) => void) => void,
};
export type ReactNativeBlobUtilResponseInfo = {
taskId : string,
state : number,
headers : any,
status : number,
respType : 'text' | 'blob' | '' | 'json',
rnfbEncode : 'path' | 'base64' | 'ascii' | 'utf8'
}
export type ReactNativeBlobUtilStream = {
onData : () => void,
onError : () => void,
onEnd : () => void,
_onData : () => void,
_onEnd : () => void,
_onError : () => void,
}
export type filedescriptor = { path: string, parentFolder: string, mimeType: string }