forked from wkh237/react-native-fetch-blob
-
Notifications
You must be signed in to change notification settings - Fork 786
/
types.js
64 lines (60 loc) · 1.43 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
type RNFetchBlobConfig = {
fileCache : bool,
path : string,
appendExt : string,
session : string,
addAndroidDownloads : any,
indicator : bool,
followRedirect : bool,
trusty : bool,
wifiOnly : bool
};
type RNFetchBlobNative = {
// 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,
};
type RNFetchBlobResponseInfo = {
taskId : string,
state : number,
headers : any,
status : number,
respType : 'text' | 'blob' | '' | 'json',
rnfbEncode : 'path' | 'base64' | 'ascii' | 'utf8'
}
type RNFetchBlobStream = {
onData : () => void,
onError : () => void,
onEnd : () => void,
_onData : () => void,
_onEnd : () => void,
_onError : () => void,
}