Repository navigation
Expand file tree
/
Copy pathtypes.js
More file actions
121 lines (113 loc) · 3.23 KB
/
Copy pathtypes.js
File metadata and controls
121 lines (113 loc) · 3.23 KB
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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
// The Flow types index.js exports for Flow-typed apps. index.d.ts is what
// TypeScript reads; tests/unit/flowTypes.test.js checks that the types the two
// share have the same shape, so a change to one has to be made in both.
import type ReactNativeBlobUtilReadStream from './class/ReactNativeBlobUtilReadStream';
/** The DownloadManager options of `config({android: {downloadManager}})`. */
export type AddAndroidDownloads = {
useDownloadManager?: boolean,
title?: string,
description?: string,
path?: string,
mime?: string,
mediaScannable?: boolean,
storeInDownloads?: boolean,
notification?: boolean,
storeLocal?: boolean,
};
/** Options for `config()`. */
export type ReactNativeBlobUtilConfig = {
fileCache?: boolean,
appendExt?: string,
path?: string,
key?: string,
session?: string,
overwrite?: boolean,
timeout?: number,
followRedirect?: boolean,
transform?: boolean,
/** @deprecated use `transform` */
transformFile?: boolean,
trusty?: boolean,
customCACerts?: Array<string>,
pinnedHosts?: Array<string>,
trustSystemCerts?: boolean,
auto?: boolean,
binaryContentTypes?: Array<string>,
android?: {
downloadManager?: AddAndroidDownloads,
wifiOnly?: boolean,
targetHostIp?: string,
},
ios?: {
backgroundTask?: boolean,
},
/** @deprecated use `android.wifiOnly` */
wifiOnly?: boolean,
/** @deprecated use `android.targetHostIp` */
targetHostIp?: string,
/** @deprecated use `android.downloadManager` */
addAndroidDownloads?: AddAndroidDownloads,
/** @deprecated use `ios.backgroundTask` */
IOSBackgroundTask?: boolean,
};
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: string,
headers: {[name: string]: string},
status: number,
/** Every URL a redirect went through. */
redirects?: Array<string>,
respType: 'text' | 'blob' | '' | 'json',
rnfbEncode: 'path' | 'base64' | 'utf8',
timeout?: boolean,
};
/** @deprecated use ReactNativeBlobUtilReadStream */
export type ReactNativeBlobUtilStream = ReactNativeBlobUtilReadStream;
/** A file in the Android MediaStore. */
export type filedescriptor = {
name: string,
parentFolder?: string,
mime?: string,
/** @deprecated use `mime` */
mimeType?: string,
};
export type ReactNativeBlobUtilStat = {
filename: string,
path: string,
size: number,
type: 'file' | 'directory' | 'asset',
lastModified: number,
};