react-native-blob-util 0.19.1 → 0.19.3

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.
Files changed (93) hide show
  1. package/.eslintrc.js +56 -56
  2. package/LICENSE +21 -21
  3. package/Migration.md +41 -41
  4. package/README.md +1071 -1071
  5. package/android/build.gradle +5 -1
  6. package/android/gradle.properties +1 -1
  7. package/android/proguard-rules.pro +17 -17
  8. package/android/src/main/AndroidManifest.xml +39 -40
  9. package/android/src/main/java/com/ReactNativeBlobUtil/ReactNativeBlobUtilConfig.java +57 -57
  10. package/android/src/main/java/com/ReactNativeBlobUtil/ReactNativeBlobUtilConst.java +20 -20
  11. package/android/src/main/java/com/ReactNativeBlobUtil/ReactNativeBlobUtilFS.java +2 -2
  12. package/android/src/main/java/com/ReactNativeBlobUtil/ReactNativeBlobUtilFileTransformer.java +9 -9
  13. package/android/src/main/java/com/ReactNativeBlobUtil/ReactNativeBlobUtilImpl.java +431 -431
  14. package/android/src/main/java/com/ReactNativeBlobUtil/ReactNativeBlobUtilProgressConfig.java +39 -39
  15. package/android/src/main/java/com/ReactNativeBlobUtil/ReactNativeBlobUtilReq.java +972 -968
  16. package/android/src/main/java/com/ReactNativeBlobUtil/ReactNativeBlobUtilStream.java +3 -2
  17. package/android/src/main/java/com/ReactNativeBlobUtil/Response/ReactNativeBlobUtilDefaultResp.java +98 -98
  18. package/android/src/main/java/com/ReactNativeBlobUtil/Response/ReactNativeBlobUtilFileResp.java +157 -157
  19. package/android/src/main/java/com/ReactNativeBlobUtil/Utils/FileDescription.java +19 -19
  20. package/android/src/main/java/com/ReactNativeBlobUtil/Utils/FileProvider.java +4 -4
  21. package/android/src/main/java/com/ReactNativeBlobUtil/Utils/MimeType.java +70 -70
  22. package/android/src/main/java/com/ReactNativeBlobUtil/Utils/PathResolver.java +223 -223
  23. package/android/src/main/java/com/ReactNativeBlobUtil/Utils/Tls12SocketFactory.java +68 -68
  24. package/android/src/main/res/values/strings.xml +3 -3
  25. package/android/src/main/res/xml/provider_paths.xml +12 -12
  26. package/android/src/newarch/java/com/ReactNativeBlobUtil/ReactNativeBlobUtil.java +1 -1
  27. package/android.js +58 -58
  28. package/class/ReactNativeBlobUtilCanceledFetchError.js +9 -9
  29. package/class/ReactNativeBlobUtilFile.js +5 -5
  30. package/class/ReactNativeBlobUtilReadStream.js +84 -84
  31. package/class/ReactNativeBlobUtilSession.js +68 -68
  32. package/class/ReactNativeBlobUtilWriteStream.js +50 -50
  33. package/class/StatefulPromise.js +7 -7
  34. package/codegenSpecs/NativeBlobUtils.js +86 -82
  35. package/components/Fetch.onPress.js +10 -10
  36. package/components/Fetch.when.js +15 -15
  37. package/fetch.js +344 -344
  38. package/fs.js +480 -480
  39. package/index.d.ts +871 -871
  40. package/index.js +64 -64
  41. package/index.js.flow +191 -191
  42. package/index.web.js +1 -1
  43. package/ios/ReactNativeBlobUtil/ReactNativeBlobUtil.h +55 -55
  44. package/ios/ReactNativeBlobUtil/ReactNativeBlobUtil.mm +993 -993
  45. package/ios/ReactNativeBlobUtil.xcodeproj/project.pbxproj +403 -403
  46. package/ios/ReactNativeBlobUtilConst.h +58 -58
  47. package/ios/ReactNativeBlobUtilConst.mm +47 -47
  48. package/ios/ReactNativeBlobUtilFS.h +108 -108
  49. package/ios/ReactNativeBlobUtilFS.mm +977 -977
  50. package/ios/ReactNativeBlobUtilFileTransformer.h +23 -23
  51. package/ios/ReactNativeBlobUtilFileTransformer.mm +20 -20
  52. package/ios/ReactNativeBlobUtilNetwork.h +49 -49
  53. package/ios/ReactNativeBlobUtilNetwork.mm +159 -159
  54. package/ios/ReactNativeBlobUtilProgress.h +32 -32
  55. package/ios/ReactNativeBlobUtilProgress.mm +57 -57
  56. package/ios/ReactNativeBlobUtilReqBuilder.h +37 -37
  57. package/ios/ReactNativeBlobUtilReqBuilder.mm +292 -292
  58. package/ios/ReactNativeBlobUtilRequest.h +48 -48
  59. package/ios/ReactNativeBlobUtilRequest.mm +535 -535
  60. package/ios.js +61 -61
  61. package/json-stream.js +42 -42
  62. package/lib/oboe-browser.js +2703 -2703
  63. package/mediacollection.js +36 -36
  64. package/package.json +55 -55
  65. package/polyfill/Blob.js +362 -362
  66. package/polyfill/Event.js +11 -11
  67. package/polyfill/EventTarget.js +78 -78
  68. package/polyfill/Fetch.js +219 -219
  69. package/polyfill/File.js +27 -27
  70. package/polyfill/FileReader.js +91 -91
  71. package/polyfill/ProgressEvent.js +32 -32
  72. package/polyfill/XMLHttpRequest.js +466 -466
  73. package/polyfill/XMLHttpRequestEventTarget.js +126 -126
  74. package/polyfill/index.js +11 -11
  75. package/react-native-blob-util.podspec +45 -45
  76. package/types.js +69 -69
  77. package/utils/log.js +40 -40
  78. package/utils/unicode.js +7 -7
  79. package/utils/uri.js +33 -33
  80. package/utils/uuid.js +4 -4
  81. package/windows/README.md +2 -2
  82. package/windows/ReactNativeBlobUtil/PropertySheet.props +15 -15
  83. package/windows/ReactNativeBlobUtil/ReactNativeBlobUtil.cpp +1701 -1693
  84. package/windows/ReactNativeBlobUtil/ReactNativeBlobUtil.def +3 -3
  85. package/windows/ReactNativeBlobUtil/ReactNativeBlobUtil.h +379 -366
  86. package/windows/ReactNativeBlobUtil/ReactNativeBlobUtil.vcxproj +181 -181
  87. package/windows/ReactNativeBlobUtil/ReactNativeBlobUtil.vcxproj.filters +31 -31
  88. package/windows/ReactNativeBlobUtil/ReactPackageProvider.cpp +15 -15
  89. package/windows/ReactNativeBlobUtil/ReactPackageProvider.h +20 -20
  90. package/windows/ReactNativeBlobUtil/ReactPackageProvider.idl +9 -9
  91. package/windows/ReactNativeBlobUtil/packages.config +3 -3
  92. package/windows/ReactNativeBlobUtil/pch.cpp +1 -1
  93. package/windows/ReactNativeBlobUtil/pch.h +3 -3
@@ -1,91 +1,91 @@
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 EventTarget from './EventTarget';
6
- import Blob from './Blob';
7
- import Log from '../utils/log.js';
8
-
9
- const log = new Log('FileReader');
10
-
11
- log.level(3);
12
-
13
- export default class FileReader extends EventTarget {
14
-
15
- static get EMPTY() {
16
- return 0;
17
- }
18
-
19
- static get LOADING() {
20
- return 1;
21
- }
22
-
23
- static get DONE() {
24
- return 2;
25
- }
26
-
27
- // properties
28
- _readState: number = 0;
29
- _result: any;
30
- _error: any;
31
-
32
- get isRNFBPolyFill() {
33
- return true;
34
- }
35
-
36
- // event handlers
37
- onloadstart: (e: Event) => void;
38
- onprogress: (e: Event) => void;
39
- onload: (e: Event) => void;
40
- onabort: (e: Event) => void;
41
- onerror: (e: Event) => void;
42
- onloadend: (e: Event) => void;
43
-
44
- constructor() {
45
- super();
46
- log.verbose('file reader const');
47
- this._result = null;
48
- }
49
-
50
- abort() {
51
- log.verbose('abort');
52
- }
53
-
54
- readAsArrayBuffer(b: Blob) {
55
- log.verbose('readAsArrayBuffer', b);
56
- }
57
-
58
- readAsBinaryString(b: Blob) {
59
- log.verbose('readAsBinaryString', b);
60
- }
61
-
62
- readAsText(b: Blob, label: ?string) {
63
- log.verbose('readAsText', b, label);
64
- }
65
-
66
- readAsDataURL(b: Blob) {
67
- log.verbose('readAsDataURL', b);
68
- }
69
-
70
- dispatchEvent(event, e) {
71
- log.verbose('dispatch event', event, e);
72
- super.dispatchEvent(event, e);
73
- if (typeof this[`on${event}`] === 'function') {
74
- this[`on${event}`](e);
75
- }
76
- }
77
-
78
- // private methods
79
-
80
- // getters and setters
81
-
82
- get readyState() {
83
- return this._readyState;
84
- }
85
-
86
- get result() {
87
- return this._result;
88
- }
89
-
90
-
91
- }
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 EventTarget from './EventTarget';
6
+ import Blob from './Blob';
7
+ import Log from '../utils/log.js';
8
+
9
+ const log = new Log('FileReader');
10
+
11
+ log.level(3);
12
+
13
+ export default class FileReader extends EventTarget {
14
+
15
+ static get EMPTY() {
16
+ return 0;
17
+ }
18
+
19
+ static get LOADING() {
20
+ return 1;
21
+ }
22
+
23
+ static get DONE() {
24
+ return 2;
25
+ }
26
+
27
+ // properties
28
+ _readState: number = 0;
29
+ _result: any;
30
+ _error: any;
31
+
32
+ get isRNFBPolyFill() {
33
+ return true;
34
+ }
35
+
36
+ // event handlers
37
+ onloadstart: (e: Event) => void;
38
+ onprogress: (e: Event) => void;
39
+ onload: (e: Event) => void;
40
+ onabort: (e: Event) => void;
41
+ onerror: (e: Event) => void;
42
+ onloadend: (e: Event) => void;
43
+
44
+ constructor() {
45
+ super();
46
+ log.verbose('file reader const');
47
+ this._result = null;
48
+ }
49
+
50
+ abort() {
51
+ log.verbose('abort');
52
+ }
53
+
54
+ readAsArrayBuffer(b: Blob) {
55
+ log.verbose('readAsArrayBuffer', b);
56
+ }
57
+
58
+ readAsBinaryString(b: Blob) {
59
+ log.verbose('readAsBinaryString', b);
60
+ }
61
+
62
+ readAsText(b: Blob, label: ?string) {
63
+ log.verbose('readAsText', b, label);
64
+ }
65
+
66
+ readAsDataURL(b: Blob) {
67
+ log.verbose('readAsDataURL', b);
68
+ }
69
+
70
+ dispatchEvent(event, e) {
71
+ log.verbose('dispatch event', event, e);
72
+ super.dispatchEvent(event, e);
73
+ if (typeof this[`on${event}`] === 'function') {
74
+ this[`on${event}`](e);
75
+ }
76
+ }
77
+
78
+ // private methods
79
+
80
+ // getters and setters
81
+
82
+ get readyState() {
83
+ return this._readyState;
84
+ }
85
+
86
+ get result() {
87
+ return this._result;
88
+ }
89
+
90
+
91
+ }
@@ -1,32 +1,32 @@
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 Event from './Event';
6
-
7
- export default class ProgressEvent extends Event {
8
-
9
- _lengthComputable: boolean = false;
10
- _loaded: number = -1;
11
- _total: numver = -1;
12
-
13
- constructor(lengthComputable, loaded, total) {
14
- super();
15
- this._lengthComputable = lengthComputable;
16
- this._loaded = loaded;
17
- this._total = total;
18
- }
19
-
20
- get lengthComputable() {
21
- return this._lengthComputable;
22
- }
23
-
24
- get loaded() {
25
- return this._loaded;
26
- }
27
-
28
- get total() {
29
- return this._total;
30
- }
31
-
32
- }
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 Event from './Event';
6
+
7
+ export default class ProgressEvent extends Event {
8
+
9
+ _lengthComputable: boolean = false;
10
+ _loaded: number = -1;
11
+ _total: numver = -1;
12
+
13
+ constructor(lengthComputable, loaded, total) {
14
+ super();
15
+ this._lengthComputable = lengthComputable;
16
+ this._loaded = loaded;
17
+ this._total = total;
18
+ }
19
+
20
+ get lengthComputable() {
21
+ return this._lengthComputable;
22
+ }
23
+
24
+ get loaded() {
25
+ return this._loaded;
26
+ }
27
+
28
+ get total() {
29
+ return this._total;
30
+ }
31
+
32
+ }