react-native-blob-util 0.22.0 → 0.22.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc.js +56 -56
- package/LICENSE +21 -21
- package/Migration.md +41 -41
- package/NuGet.config +11 -11
- package/README.md +1109 -1104
- package/android/gradle.properties +1 -1
- package/android/src/main/AndroidManifest.xml +37 -37
- package/android/src/main/java/com/ReactNativeBlobUtil/ReactNativeBlobUtilConfig.java +57 -57
- package/android/src/main/java/com/ReactNativeBlobUtil/ReactNativeBlobUtilConst.java +20 -20
- package/android/src/main/java/com/ReactNativeBlobUtil/ReactNativeBlobUtilFileTransformer.java +9 -9
- package/android/src/main/java/com/ReactNativeBlobUtil/ReactNativeBlobUtilImpl.java +431 -431
- package/android/src/main/java/com/ReactNativeBlobUtil/ReactNativeBlobUtilProgressConfig.java +39 -39
- package/android/src/main/java/com/ReactNativeBlobUtil/ReactNativeBlobUtilReq.java +1014 -1014
- package/android/src/main/java/com/ReactNativeBlobUtil/Response/ReactNativeBlobUtilDefaultResp.java +98 -98
- package/android/src/main/java/com/ReactNativeBlobUtil/Response/ReactNativeBlobUtilFileResp.java +166 -166
- package/android/src/main/java/com/ReactNativeBlobUtil/Utils/FileDescription.java +19 -19
- package/android/src/main/java/com/ReactNativeBlobUtil/Utils/FileProvider.java +4 -4
- package/android/src/main/java/com/ReactNativeBlobUtil/Utils/MimeType.java +70 -70
- package/android/src/main/java/com/ReactNativeBlobUtil/Utils/PathResolver.java +223 -223
- package/android/src/main/java/com/ReactNativeBlobUtil/Utils/Tls12SocketFactory.java +68 -68
- package/android/src/main/res/values/strings.xml +3 -3
- package/android/src/main/res/xml/provider_paths.xml +12 -12
- package/android.js +58 -58
- package/class/ReactNativeBlobUtilCanceledFetchError.js +9 -9
- package/class/ReactNativeBlobUtilFile.js +5 -5
- package/class/ReactNativeBlobUtilReadStream.js +84 -84
- package/class/ReactNativeBlobUtilSession.js +68 -68
- package/class/ReactNativeBlobUtilWriteStream.js +50 -50
- package/class/StatefulPromise.js +7 -7
- package/codegenSpecs/NativeBlobUtils.js +86 -86
- package/components/Fetch.onPress.js +10 -10
- package/components/Fetch.when.js +15 -15
- package/fetch.js +350 -350
- package/fs.js +480 -480
- package/index.js +64 -64
- package/index.js.flow +192 -192
- package/index.web.js +1 -1
- package/ios/PrivacyInfo.xcprivacy +28 -28
- package/ios/ReactNativeBlobUtil/ReactNativeBlobUtil.h +55 -55
- package/ios/ReactNativeBlobUtil/ReactNativeBlobUtil.mm +992 -992
- package/ios/ReactNativeBlobUtil.xcodeproj/project.pbxproj +405 -405
- package/ios/ReactNativeBlobUtilConst.h +58 -58
- package/ios/ReactNativeBlobUtilConst.mm +47 -47
- package/ios/ReactNativeBlobUtilFS.h +108 -108
- package/ios/ReactNativeBlobUtilFS.mm +1064 -1064
- package/ios/ReactNativeBlobUtilFileTransformer.h +23 -23
- package/ios/ReactNativeBlobUtilFileTransformer.mm +20 -20
- package/ios/ReactNativeBlobUtilNetwork.h +49 -49
- package/ios/ReactNativeBlobUtilNetwork.mm +159 -159
- package/ios/ReactNativeBlobUtilProgress.h +32 -32
- package/ios/ReactNativeBlobUtilProgress.mm +57 -57
- package/ios/ReactNativeBlobUtilReqBuilder.h +37 -37
- package/ios/ReactNativeBlobUtilReqBuilder.mm +292 -292
- package/ios/ReactNativeBlobUtilRequest.h +48 -48
- package/ios/ReactNativeBlobUtilRequest.mm +584 -584
- package/ios.js +61 -61
- package/json-stream.js +42 -42
- package/lib/oboe-browser.js +2703 -2703
- package/mediacollection.js +36 -36
- package/package.json +68 -68
- package/polyfill/Blob.js +362 -362
- package/polyfill/Event.js +11 -11
- package/polyfill/EventTarget.js +78 -78
- package/polyfill/Fetch.js +219 -219
- package/polyfill/File.js +27 -27
- package/polyfill/FileReader.js +91 -91
- package/polyfill/ProgressEvent.js +32 -32
- package/polyfill/XMLHttpRequest.js +466 -466
- package/polyfill/XMLHttpRequestEventTarget.js +126 -126
- package/polyfill/index.js +11 -11
- package/react-native-blob-util.podspec +48 -48
- package/types.js +69 -69
- package/utils/log.js +40 -40
- package/utils/unicode.js +7 -7
- package/utils/uri.js +33 -33
- package/utils/uuid.js +4 -4
- package/windows/ExperimentalFeatures.props +33 -33
- package/windows/README.md +2 -2
- package/windows/ReactNativeBlobUtil/PropertySheet.props +15 -15
- package/windows/ReactNativeBlobUtil/ReactNativeBlobUtil.cpp +1836 -1836
- package/windows/ReactNativeBlobUtil/ReactNativeBlobUtil.def +3 -3
- package/windows/ReactNativeBlobUtil/ReactNativeBlobUtil.h +372 -372
- package/windows/ReactNativeBlobUtil/ReactNativeBlobUtil.vcxproj +139 -139
- package/windows/ReactNativeBlobUtil/ReactNativeBlobUtil.vcxproj.filters +43 -43
- package/windows/ReactNativeBlobUtil/ReactPackageProvider.cpp +20 -20
- package/windows/ReactNativeBlobUtil/ReactPackageProvider.h +24 -24
- package/windows/ReactNativeBlobUtil/ReactPackageProvider.idl +9 -9
- package/windows/ReactNativeBlobUtil/codegen/.clang-format +1 -1
- package/windows/ReactNativeBlobUtil/codegen/NativeBlobUtilsDataTypes.g.h +42 -42
- package/windows/ReactNativeBlobUtil/codegen/NativeBlobUtilsSpec.g.h +353 -353
- package/windows/ReactNativeBlobUtil/packages.config +3 -3
- package/windows/ReactNativeBlobUtil/packages.lock.json +59 -59
- package/windows/ReactNativeBlobUtil/pch.cpp +1 -1
- package/windows/ReactNativeBlobUtil/pch.h +30 -30
- package/windows/ReactNativeBlobUtil/resource.h +5 -5
- package/windows/ReactNativeBlobUtil/targetver.h +8 -8
- package/windows/ReactNativeBlobUtil.sln +43 -43
|
@@ -1,50 +1,50 @@
|
|
|
1
|
-
// Copyright 2016 wkh237@github. All rights reserved.
|
|
2
|
-
// Use of this source code is governed by a MIT-style license that can be
|
|
3
|
-
// found in the LICENSE file.
|
|
4
|
-
|
|
5
|
-
import ReactNativeBlobUtil from '../codegenSpecs/NativeBlobUtils';
|
|
6
|
-
export default class ReactNativeBlobUtilWriteStream {
|
|
7
|
-
|
|
8
|
-
id : string;
|
|
9
|
-
encoding : string;
|
|
10
|
-
append : boolean;
|
|
11
|
-
|
|
12
|
-
constructor(streamId:string, encoding:string, append:boolean) {
|
|
13
|
-
this.id = streamId;
|
|
14
|
-
this.encoding = encoding;
|
|
15
|
-
this.append = append;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
write(data:string): Promise<ReactNativeBlobUtilWriteStream> {
|
|
19
|
-
return new Promise((resolve, reject) => {
|
|
20
|
-
try {
|
|
21
|
-
let method = this.encoding === 'ascii' ? 'writeArrayChunk' : 'writeChunk';
|
|
22
|
-
if (this.encoding.toLocaleLowerCase() === 'ascii' && !Array.isArray(data)) {
|
|
23
|
-
reject(new Error('ascii input data must be an Array'));
|
|
24
|
-
return;
|
|
25
|
-
}
|
|
26
|
-
ReactNativeBlobUtil[method](this.id, data, (error) => {
|
|
27
|
-
if (error)
|
|
28
|
-
reject(new Error(error));
|
|
29
|
-
else
|
|
30
|
-
resolve(this);
|
|
31
|
-
});
|
|
32
|
-
} catch (err) {
|
|
33
|
-
reject(new Error(err));
|
|
34
|
-
}
|
|
35
|
-
});
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
close() {
|
|
39
|
-
return new Promise((resolve, reject) => {
|
|
40
|
-
try {
|
|
41
|
-
ReactNativeBlobUtil.closeStream(this.id, () => {
|
|
42
|
-
resolve();
|
|
43
|
-
});
|
|
44
|
-
} catch (err) {
|
|
45
|
-
reject(new Error(err));
|
|
46
|
-
}
|
|
47
|
-
});
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
}
|
|
1
|
+
// Copyright 2016 wkh237@github. All rights reserved.
|
|
2
|
+
// Use of this source code is governed by a MIT-style license that can be
|
|
3
|
+
// found in the LICENSE file.
|
|
4
|
+
|
|
5
|
+
import ReactNativeBlobUtil from '../codegenSpecs/NativeBlobUtils';
|
|
6
|
+
export default class ReactNativeBlobUtilWriteStream {
|
|
7
|
+
|
|
8
|
+
id : string;
|
|
9
|
+
encoding : string;
|
|
10
|
+
append : boolean;
|
|
11
|
+
|
|
12
|
+
constructor(streamId:string, encoding:string, append:boolean) {
|
|
13
|
+
this.id = streamId;
|
|
14
|
+
this.encoding = encoding;
|
|
15
|
+
this.append = append;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
write(data:string): Promise<ReactNativeBlobUtilWriteStream> {
|
|
19
|
+
return new Promise((resolve, reject) => {
|
|
20
|
+
try {
|
|
21
|
+
let method = this.encoding === 'ascii' ? 'writeArrayChunk' : 'writeChunk';
|
|
22
|
+
if (this.encoding.toLocaleLowerCase() === 'ascii' && !Array.isArray(data)) {
|
|
23
|
+
reject(new Error('ascii input data must be an Array'));
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
ReactNativeBlobUtil[method](this.id, data, (error) => {
|
|
27
|
+
if (error)
|
|
28
|
+
reject(new Error(error));
|
|
29
|
+
else
|
|
30
|
+
resolve(this);
|
|
31
|
+
});
|
|
32
|
+
} catch (err) {
|
|
33
|
+
reject(new Error(err));
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
close() {
|
|
39
|
+
return new Promise((resolve, reject) => {
|
|
40
|
+
try {
|
|
41
|
+
ReactNativeBlobUtil.closeStream(this.id, () => {
|
|
42
|
+
resolve();
|
|
43
|
+
});
|
|
44
|
+
} catch (err) {
|
|
45
|
+
reject(new Error(err));
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
}
|
package/class/StatefulPromise.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
// Copyright 2016 wkh237@github. All rights reserved.
|
|
2
|
-
// Use of this source code is governed by a MIT-style license that can be
|
|
3
|
-
// found in the LICENSE file.
|
|
4
|
-
|
|
5
|
-
export default class StatefulPromise extends Promise {
|
|
6
|
-
|
|
7
|
-
}
|
|
1
|
+
// Copyright 2016 wkh237@github. All rights reserved.
|
|
2
|
+
// Use of this source code is governed by a MIT-style license that can be
|
|
3
|
+
// found in the LICENSE file.
|
|
4
|
+
|
|
5
|
+
export default class StatefulPromise extends Promise {
|
|
6
|
+
|
|
7
|
+
}
|
|
@@ -1,86 +1,86 @@
|
|
|
1
|
-
// @flow
|
|
2
|
-
import type { TurboModule } from 'react-native/Libraries/TurboModule/RCTExport';
|
|
3
|
-
import { TurboModuleRegistry } from 'react-native';
|
|
4
|
-
|
|
5
|
-
export interface Spec extends TurboModule {
|
|
6
|
-
+getConstants: () => {|
|
|
7
|
-
CacheDir: string,
|
|
8
|
-
DocumentDir: string,
|
|
9
|
-
DownloadDir: string,
|
|
10
|
-
LibraryDir: string,
|
|
11
|
-
MainBundleDir: string,
|
|
12
|
-
MovieDir: string,
|
|
13
|
-
MusicDir: string,
|
|
14
|
-
PictureDir: string,
|
|
15
|
-
ApplicationSupportDir: string,
|
|
16
|
-
// Android Only Constants
|
|
17
|
-
RingtoneDir: string,
|
|
18
|
-
SDCardDir: string,
|
|
19
|
-
SDCardApplicationDir: string,
|
|
20
|
-
DCIMDir: string,
|
|
21
|
-
// Android Only Legacy Constants
|
|
22
|
-
LegacyDCIMDir: string,
|
|
23
|
-
LegacyPictureDir: string,
|
|
24
|
-
LegacyMusicDir: string,
|
|
25
|
-
LegacyDownloadDir: string,
|
|
26
|
-
LegacyMovieDir: string,
|
|
27
|
-
LegacyRingtoneDir: string,
|
|
28
|
-
LegacySDCardDir: string,
|
|
29
|
-
|};
|
|
30
|
-
|
|
31
|
-
+fetchBlobForm: (options: Object, taskId: string, method: string, url: string, headers: Object, form: Array<any>, callback: (value: Array<any>) => void) => void;
|
|
32
|
-
+fetchBlob: (options: Object, taskId: string, method: string, url: string, headers: Object, body: string, callback: (value: Array<any>) => void) => void;
|
|
33
|
-
+createFile: (path: string, data: string, encoding: string) => Promise<void>;
|
|
34
|
-
+createFileASCII: (path: string, data: Array<any>) => Promise<void>;
|
|
35
|
-
+pathForAppGroup: (groupName: string) => Promise<string>;
|
|
36
|
-
+syncPathAppGroup: (groupName: string) => string;
|
|
37
|
-
+exists: (path: string, callback: (value: Array<boolean>) => void) => void;
|
|
38
|
-
+writeFile: (path: string, encoding: string, data: string, transformFile: boolean, append: boolean) => Promise<number>;
|
|
39
|
-
+writeFileArray: (path: string, data: Array<any>, append: boolean) => Promise<number>;
|
|
40
|
-
+writeStream: (path: string, withEncoding: string, appendData: boolean, callback: (value: Array<any>) => void) => void;
|
|
41
|
-
+writeArrayChunk: (streamId: string, withArray: Array<any>, callback: (value: Array<any>) => void) => void;
|
|
42
|
-
+writeChunk: (streamId: string, withData: string, callback: (value: Array<any>) => void) => void;
|
|
43
|
-
+closeStream: (streamId: string, callback: (value: Array<any>) => void) => void;
|
|
44
|
-
+unlink: (path: string, callback: (value: Array<any>) => void) => void;
|
|
45
|
-
+removeSession: (paths: Array<any>, callback: (value: Array<any>) => void) => void;
|
|
46
|
-
+ls: (path: string) => Promise<Array<any>>;
|
|
47
|
-
+stat: (target: string, callback: (value: Array<any>) => void) => void;
|
|
48
|
-
+lstat: (path: string, callback: (value: Array<any>) => void) => void;
|
|
49
|
-
+cp: (src: string, dest: string, callback: (value: Array<any>) => void) => void;
|
|
50
|
-
+mv: (path: string, dest: string, callback: (value: Array<any>) => void) => void;
|
|
51
|
-
+mkdir: (path: string) => Promise<boolean>;
|
|
52
|
-
+readFile: (path: string, encoding: string, transformFile: boolean) => Promise<Array<any>>;
|
|
53
|
-
+hash: (path: string, algorithm: string) => Promise<string>;
|
|
54
|
-
+readStream: (path: string, encoding: string, bufferSize: number, tick: number, streamId: string) => void;
|
|
55
|
-
+getEnvironmentDirs: (callback: (value: Array<any>) => void) => void;
|
|
56
|
-
+cancelRequest: (taskId: string, callback: (value: Array<any>) => void) => void;
|
|
57
|
-
+enableProgressReport: (taskId: string, interval: number, count: number) => void;
|
|
58
|
-
+enableUploadProgressReport: (taskId: string, interval: number, count: number) => void;
|
|
59
|
-
+slice: (src: string, dest: string, start: number, end: number) => Promise<string>;
|
|
60
|
-
+presentOptionsMenu: (uri: string, scheme: string) => Promise<Array<any>>;
|
|
61
|
-
+presentOpenInMenu: (uri: string, scheme: string) => Promise<Array<any>>;
|
|
62
|
-
+presentPreview: (uri: string, scheme: string) => Promise<Array<any>>;
|
|
63
|
-
+excludeFromBackupKey: (url: string) => Promise<Array<any>>;
|
|
64
|
-
+df: (callback: (value: Array<any>) => void) => void;
|
|
65
|
-
+emitExpiredEvent: (callback: (value: string) => void) => void; // The callback is not really used here
|
|
66
|
-
// Android Only APIs
|
|
67
|
-
+actionViewIntent: (path: string, mime: string, chooserTitle: string) => Promise<void>;
|
|
68
|
-
+addCompleteDownload: (config: Object) => Promise<void>;
|
|
69
|
-
+copyToInternal: (contentUri: string, destpath: string) => Promise<string>;
|
|
70
|
-
+copyToMediaStore: (filedata: Object, mt: string, path: string) => Promise<string>;
|
|
71
|
-
+createMediaFile: (filedata: Object, mt: string) => Promise<string>;
|
|
72
|
-
+getBlob: (contentUri: string, encoding: string) => Promise<Array<any>>;
|
|
73
|
-
+getContentIntent: (mime: string) => Promise<string>;
|
|
74
|
-
+getSDCardDir: () => Promise<string>;
|
|
75
|
-
+getSDCardApplicationDir: () => Promise<string>;
|
|
76
|
-
+scanFile: (pairs: Array<any>, callback: (value: Array<any>) => void) => void;
|
|
77
|
-
+writeToMediaFile: (fileUri: string, path: string, transformFile: boolean) => Promise<string>;
|
|
78
|
-
|
|
79
|
-
// RCTEventEmitter
|
|
80
|
-
+addListener: (eventName: string) => void;
|
|
81
|
-
+removeListeners: (count: number) => void;
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
export default (TurboModuleRegistry.get<Spec>('ReactNativeBlobUtil'): ?Spec);
|
|
85
|
-
|
|
86
|
-
|
|
1
|
+
// @flow
|
|
2
|
+
import type { TurboModule } from 'react-native/Libraries/TurboModule/RCTExport';
|
|
3
|
+
import { TurboModuleRegistry } from 'react-native';
|
|
4
|
+
|
|
5
|
+
export interface Spec extends TurboModule {
|
|
6
|
+
+getConstants: () => {|
|
|
7
|
+
CacheDir: string,
|
|
8
|
+
DocumentDir: string,
|
|
9
|
+
DownloadDir: string,
|
|
10
|
+
LibraryDir: string,
|
|
11
|
+
MainBundleDir: string,
|
|
12
|
+
MovieDir: string,
|
|
13
|
+
MusicDir: string,
|
|
14
|
+
PictureDir: string,
|
|
15
|
+
ApplicationSupportDir: string,
|
|
16
|
+
// Android Only Constants
|
|
17
|
+
RingtoneDir: string,
|
|
18
|
+
SDCardDir: string,
|
|
19
|
+
SDCardApplicationDir: string,
|
|
20
|
+
DCIMDir: string,
|
|
21
|
+
// Android Only Legacy Constants
|
|
22
|
+
LegacyDCIMDir: string,
|
|
23
|
+
LegacyPictureDir: string,
|
|
24
|
+
LegacyMusicDir: string,
|
|
25
|
+
LegacyDownloadDir: string,
|
|
26
|
+
LegacyMovieDir: string,
|
|
27
|
+
LegacyRingtoneDir: string,
|
|
28
|
+
LegacySDCardDir: string,
|
|
29
|
+
|};
|
|
30
|
+
|
|
31
|
+
+fetchBlobForm: (options: Object, taskId: string, method: string, url: string, headers: Object, form: Array<any>, callback: (value: Array<any>) => void) => void;
|
|
32
|
+
+fetchBlob: (options: Object, taskId: string, method: string, url: string, headers: Object, body: string, callback: (value: Array<any>) => void) => void;
|
|
33
|
+
+createFile: (path: string, data: string, encoding: string) => Promise<void>;
|
|
34
|
+
+createFileASCII: (path: string, data: Array<any>) => Promise<void>;
|
|
35
|
+
+pathForAppGroup: (groupName: string) => Promise<string>;
|
|
36
|
+
+syncPathAppGroup: (groupName: string) => string;
|
|
37
|
+
+exists: (path: string, callback: (value: Array<boolean>) => void) => void;
|
|
38
|
+
+writeFile: (path: string, encoding: string, data: string, transformFile: boolean, append: boolean) => Promise<number>;
|
|
39
|
+
+writeFileArray: (path: string, data: Array<any>, append: boolean) => Promise<number>;
|
|
40
|
+
+writeStream: (path: string, withEncoding: string, appendData: boolean, callback: (value: Array<any>) => void) => void;
|
|
41
|
+
+writeArrayChunk: (streamId: string, withArray: Array<any>, callback: (value: Array<any>) => void) => void;
|
|
42
|
+
+writeChunk: (streamId: string, withData: string, callback: (value: Array<any>) => void) => void;
|
|
43
|
+
+closeStream: (streamId: string, callback: (value: Array<any>) => void) => void;
|
|
44
|
+
+unlink: (path: string, callback: (value: Array<any>) => void) => void;
|
|
45
|
+
+removeSession: (paths: Array<any>, callback: (value: Array<any>) => void) => void;
|
|
46
|
+
+ls: (path: string) => Promise<Array<any>>;
|
|
47
|
+
+stat: (target: string, callback: (value: Array<any>) => void) => void;
|
|
48
|
+
+lstat: (path: string, callback: (value: Array<any>) => void) => void;
|
|
49
|
+
+cp: (src: string, dest: string, callback: (value: Array<any>) => void) => void;
|
|
50
|
+
+mv: (path: string, dest: string, callback: (value: Array<any>) => void) => void;
|
|
51
|
+
+mkdir: (path: string) => Promise<boolean>;
|
|
52
|
+
+readFile: (path: string, encoding: string, transformFile: boolean) => Promise<Array<any>>;
|
|
53
|
+
+hash: (path: string, algorithm: string) => Promise<string>;
|
|
54
|
+
+readStream: (path: string, encoding: string, bufferSize: number, tick: number, streamId: string) => void;
|
|
55
|
+
+getEnvironmentDirs: (callback: (value: Array<any>) => void) => void;
|
|
56
|
+
+cancelRequest: (taskId: string, callback: (value: Array<any>) => void) => void;
|
|
57
|
+
+enableProgressReport: (taskId: string, interval: number, count: number) => void;
|
|
58
|
+
+enableUploadProgressReport: (taskId: string, interval: number, count: number) => void;
|
|
59
|
+
+slice: (src: string, dest: string, start: number, end: number) => Promise<string>;
|
|
60
|
+
+presentOptionsMenu: (uri: string, scheme: string) => Promise<Array<any>>;
|
|
61
|
+
+presentOpenInMenu: (uri: string, scheme: string) => Promise<Array<any>>;
|
|
62
|
+
+presentPreview: (uri: string, scheme: string) => Promise<Array<any>>;
|
|
63
|
+
+excludeFromBackupKey: (url: string) => Promise<Array<any>>;
|
|
64
|
+
+df: (callback: (value: Array<any>) => void) => void;
|
|
65
|
+
+emitExpiredEvent: (callback: (value: string) => void) => void; // The callback is not really used here
|
|
66
|
+
// Android Only APIs
|
|
67
|
+
+actionViewIntent: (path: string, mime: string, chooserTitle: string) => Promise<void>;
|
|
68
|
+
+addCompleteDownload: (config: Object) => Promise<void>;
|
|
69
|
+
+copyToInternal: (contentUri: string, destpath: string) => Promise<string>;
|
|
70
|
+
+copyToMediaStore: (filedata: Object, mt: string, path: string) => Promise<string>;
|
|
71
|
+
+createMediaFile: (filedata: Object, mt: string) => Promise<string>;
|
|
72
|
+
+getBlob: (contentUri: string, encoding: string) => Promise<Array<any>>;
|
|
73
|
+
+getContentIntent: (mime: string) => Promise<string>;
|
|
74
|
+
+getSDCardDir: () => Promise<string>;
|
|
75
|
+
+getSDCardApplicationDir: () => Promise<string>;
|
|
76
|
+
+scanFile: (pairs: Array<any>, callback: (value: Array<any>) => void) => void;
|
|
77
|
+
+writeToMediaFile: (fileUri: string, path: string, transformFile: boolean) => Promise<string>;
|
|
78
|
+
|
|
79
|
+
// RCTEventEmitter
|
|
80
|
+
+addListener: (eventName: string) => void;
|
|
81
|
+
+removeListeners: (count: number) => void;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
export default (TurboModuleRegistry.get<Spec>('ReactNativeBlobUtil'): ?Spec);
|
|
85
|
+
|
|
86
|
+
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
// press button to login
|
|
2
|
-
{/*<Fetch.onPress method="POST"
|
|
3
|
-
url="www.example.com/login"
|
|
4
|
-
body={this.state.body}
|
|
5
|
-
onSuccess={this.onSuccess}
|
|
6
|
-
onError={this.showError}>
|
|
7
|
-
<View>
|
|
8
|
-
<Text>Click to Login</Text>
|
|
9
|
-
</View>
|
|
10
|
-
</LoginAction.onPress>*/}
|
|
1
|
+
// press button to login
|
|
2
|
+
{/*<Fetch.onPress method="POST"
|
|
3
|
+
url="www.example.com/login"
|
|
4
|
+
body={this.state.body}
|
|
5
|
+
onSuccess={this.onSuccess}
|
|
6
|
+
onError={this.showError}>
|
|
7
|
+
<View>
|
|
8
|
+
<Text>Click to Login</Text>
|
|
9
|
+
</View>
|
|
10
|
+
</LoginAction.onPress>*/}
|
package/components/Fetch.when.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
// placeholder
|
|
2
|
-
{/*<Fetch method="GET"
|
|
3
|
-
url={`www.example.com/avatar/${this.state.userId}`}
|
|
4
|
-
onSuccess={(data) => { this.setState({avatar : data.path()}) }}
|
|
5
|
-
onError={this.showError}>
|
|
6
|
-
<Fetch.before>
|
|
7
|
-
<Image souce="images/placeholder.png"/>
|
|
8
|
-
</Fetch.before>
|
|
9
|
-
<Fetch.success>
|
|
10
|
-
<Image souce={this.state.avatar}/>
|
|
11
|
-
</Fetch.success>
|
|
12
|
-
<Fetch.error>
|
|
13
|
-
<Image souce="images/error.png"/>
|
|
14
|
-
</Fetch.error>
|
|
15
|
-
</LoginAction.onPress>*/}
|
|
1
|
+
// placeholder
|
|
2
|
+
{/*<Fetch method="GET"
|
|
3
|
+
url={`www.example.com/avatar/${this.state.userId}`}
|
|
4
|
+
onSuccess={(data) => { this.setState({avatar : data.path()}) }}
|
|
5
|
+
onError={this.showError}>
|
|
6
|
+
<Fetch.before>
|
|
7
|
+
<Image souce="images/placeholder.png"/>
|
|
8
|
+
</Fetch.before>
|
|
9
|
+
<Fetch.success>
|
|
10
|
+
<Image souce={this.state.avatar}/>
|
|
11
|
+
</Fetch.success>
|
|
12
|
+
<Fetch.error>
|
|
13
|
+
<Image souce="images/error.png"/>
|
|
14
|
+
</Fetch.error>
|
|
15
|
+
</LoginAction.onPress>*/}
|