react-native-buffered-blob 1.0.0

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/android/AGENTS.md +74 -0
  2. package/android/build.gradle +34 -0
  3. package/android/src/main/AndroidManifest.xml +4 -0
  4. package/android/src/main/java/com/bufferedblob/BufferedBlobModule.kt +274 -0
  5. package/android/src/main/java/com/bufferedblob/BufferedBlobPackage.kt +32 -0
  6. package/android/src/main/java/com/bufferedblob/HandleRegistry.kt +84 -0
  7. package/android/src/main/java/com/bufferedblob/StreamingBridge.kt +211 -0
  8. package/cpp/AGENTS.md +71 -0
  9. package/cpp/AndroidPlatformBridge.cpp +437 -0
  10. package/cpp/AndroidPlatformBridge.h +79 -0
  11. package/cpp/BufferedBlobStreamingHostObject.cpp +344 -0
  12. package/cpp/BufferedBlobStreamingHostObject.h +118 -0
  13. package/cpp/CMakeLists.txt +49 -0
  14. package/cpp/jni_onload.cpp +32 -0
  15. package/ios/AGENTS.md +76 -0
  16. package/ios/BufferedBlobModule.h +44 -0
  17. package/ios/BufferedBlobModule.m +433 -0
  18. package/ios/BufferedBlobModule.mm +192 -0
  19. package/ios/BufferedBlobStreamingBridge.h +21 -0
  20. package/ios/BufferedBlobStreamingBridge.mm +442 -0
  21. package/ios/HandleRegistry.h +29 -0
  22. package/ios/HandleRegistry.m +67 -0
  23. package/ios/HandleTypes.h +83 -0
  24. package/ios/HandleTypes.m +333 -0
  25. package/lib/module/AGENTS.md +70 -0
  26. package/lib/module/NativeBufferedBlob.js +5 -0
  27. package/lib/module/NativeBufferedBlob.js.map +1 -0
  28. package/lib/module/api/AGENTS.md +62 -0
  29. package/lib/module/api/download.js +40 -0
  30. package/lib/module/api/download.js.map +1 -0
  31. package/lib/module/api/fileOps.js +70 -0
  32. package/lib/module/api/fileOps.js.map +1 -0
  33. package/lib/module/api/hash.js +13 -0
  34. package/lib/module/api/hash.js.map +1 -0
  35. package/lib/module/api/readFile.js +23 -0
  36. package/lib/module/api/readFile.js.map +1 -0
  37. package/lib/module/api/writeFile.js +18 -0
  38. package/lib/module/api/writeFile.js.map +1 -0
  39. package/lib/module/errors.js +45 -0
  40. package/lib/module/errors.js.map +1 -0
  41. package/lib/module/index.js +25 -0
  42. package/lib/module/index.js.map +1 -0
  43. package/lib/module/module.js +19 -0
  44. package/lib/module/module.js.map +1 -0
  45. package/lib/module/package.json +1 -0
  46. package/lib/module/paths.js +32 -0
  47. package/lib/module/paths.js.map +1 -0
  48. package/lib/module/types.js +15 -0
  49. package/lib/module/types.js.map +1 -0
  50. package/lib/module/wrappers.js +107 -0
  51. package/lib/module/wrappers.js.map +1 -0
  52. package/lib/typescript/package.json +1 -0
  53. package/lib/typescript/src/NativeBufferedBlob.d.ts +37 -0
  54. package/lib/typescript/src/NativeBufferedBlob.d.ts.map +1 -0
  55. package/lib/typescript/src/api/download.d.ts +13 -0
  56. package/lib/typescript/src/api/download.d.ts.map +1 -0
  57. package/lib/typescript/src/api/fileOps.d.ts +9 -0
  58. package/lib/typescript/src/api/fileOps.d.ts.map +1 -0
  59. package/lib/typescript/src/api/hash.d.ts +3 -0
  60. package/lib/typescript/src/api/hash.d.ts.map +1 -0
  61. package/lib/typescript/src/api/readFile.d.ts +3 -0
  62. package/lib/typescript/src/api/readFile.d.ts.map +1 -0
  63. package/lib/typescript/src/api/writeFile.d.ts +3 -0
  64. package/lib/typescript/src/api/writeFile.d.ts.map +1 -0
  65. package/lib/typescript/src/errors.d.ts +25 -0
  66. package/lib/typescript/src/errors.d.ts.map +1 -0
  67. package/lib/typescript/src/index.d.ts +11 -0
  68. package/lib/typescript/src/index.d.ts.map +1 -0
  69. package/lib/typescript/src/module.d.ts +23 -0
  70. package/lib/typescript/src/module.d.ts.map +1 -0
  71. package/lib/typescript/src/paths.d.ts +11 -0
  72. package/lib/typescript/src/paths.d.ts.map +1 -0
  73. package/lib/typescript/src/types.d.ts +37 -0
  74. package/lib/typescript/src/types.d.ts.map +1 -0
  75. package/lib/typescript/src/wrappers.d.ts +14 -0
  76. package/lib/typescript/src/wrappers.d.ts.map +1 -0
  77. package/package.json +114 -0
  78. package/react-native-buffered-blob.podspec +37 -0
  79. package/react-native.config.js +10 -0
  80. package/src/AGENTS.md +70 -0
  81. package/src/NativeBufferedBlob.ts +54 -0
  82. package/src/api/AGENTS.md +62 -0
  83. package/src/api/download.ts +46 -0
  84. package/src/api/fileOps.ts +83 -0
  85. package/src/api/hash.ts +14 -0
  86. package/src/api/readFile.ts +37 -0
  87. package/src/api/writeFile.ts +24 -0
  88. package/src/errors.ts +50 -0
  89. package/src/index.ts +28 -0
  90. package/src/module.ts +48 -0
  91. package/src/paths.ts +35 -0
  92. package/src/types.ts +42 -0
  93. package/src/wrappers.ts +123 -0
@@ -0,0 +1,45 @@
1
+ "use strict";
2
+
3
+ export let ErrorCode = /*#__PURE__*/function (ErrorCode) {
4
+ ErrorCode["FILE_NOT_FOUND"] = "FILE_NOT_FOUND";
5
+ ErrorCode["PERMISSION_DENIED"] = "PERMISSION_DENIED";
6
+ ErrorCode["FILE_ALREADY_EXISTS"] = "FILE_ALREADY_EXISTS";
7
+ ErrorCode["NOT_A_FILE"] = "NOT_A_FILE";
8
+ ErrorCode["NOT_A_DIRECTORY"] = "NOT_A_DIRECTORY";
9
+ ErrorCode["DIRECTORY_NOT_EMPTY"] = "DIRECTORY_NOT_EMPTY";
10
+ ErrorCode["IO_ERROR"] = "IO_ERROR";
11
+ ErrorCode["INVALID_ARGUMENT"] = "INVALID_ARGUMENT";
12
+ ErrorCode["DOWNLOAD_FAILED"] = "DOWNLOAD_FAILED";
13
+ ErrorCode["DOWNLOAD_CANCELLED"] = "DOWNLOAD_CANCELLED";
14
+ ErrorCode["READER_CLOSED"] = "READER_CLOSED";
15
+ ErrorCode["WRITER_CLOSED"] = "WRITER_CLOSED";
16
+ ErrorCode["UNKNOWN"] = "UNKNOWN";
17
+ return ErrorCode;
18
+ }({});
19
+ export class BlobError extends Error {
20
+ constructor(code, message, path) {
21
+ super(message);
22
+ this.name = 'BlobError';
23
+ this.code = code;
24
+ this.path = path;
25
+ Object.setPrototypeOf(this, BlobError.prototype);
26
+ }
27
+ }
28
+
29
+ /**
30
+ * Parse native error with format "[ERROR_CODE] message" into BlobError.
31
+ */
32
+ export function wrapError(e, path) {
33
+ if (e instanceof BlobError) {
34
+ return e;
35
+ }
36
+ const message = e instanceof Error ? e.message : String(e);
37
+ const match = /^\[([A-Z_]+)\]\s*(.*)$/.exec(message);
38
+ if (match) {
39
+ const [, code, msg] = match;
40
+ const errorCode = Object.values(ErrorCode).includes(code) ? code : ErrorCode.UNKNOWN;
41
+ return new BlobError(errorCode, msg || message, path);
42
+ }
43
+ return new BlobError(ErrorCode.UNKNOWN, message, path);
44
+ }
45
+ //# sourceMappingURL=errors.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["ErrorCode","BlobError","Error","constructor","code","message","path","name","Object","setPrototypeOf","prototype","wrapError","e","String","match","exec","msg","errorCode","values","includes","UNKNOWN"],"sourceRoot":"../../src","sources":["errors.ts"],"mappings":";;AAAA,WAAYA,SAAS,0BAATA,SAAS;EAATA,SAAS;EAATA,SAAS;EAATA,SAAS;EAATA,SAAS;EAATA,SAAS;EAATA,SAAS;EAATA,SAAS;EAATA,SAAS;EAATA,SAAS;EAATA,SAAS;EAATA,SAAS;EAATA,SAAS;EAATA,SAAS;EAAA,OAATA,SAAS;AAAA;AAgBrB,OAAO,MAAMC,SAAS,SAASC,KAAK,CAAC;EAInCC,WAAWA,CAACC,IAAe,EAAEC,OAAe,EAAEC,IAAa,EAAE;IAC3D,KAAK,CAACD,OAAO,CAAC;IACd,IAAI,CAACE,IAAI,GAAG,WAAW;IACvB,IAAI,CAACH,IAAI,GAAGA,IAAI;IAChB,IAAI,CAACE,IAAI,GAAGA,IAAI;IAChBE,MAAM,CAACC,cAAc,CAAC,IAAI,EAAER,SAAS,CAACS,SAAS,CAAC;EAClD;AACF;;AAEA;AACA;AACA;AACA,OAAO,SAASC,SAASA,CAACC,CAAU,EAAEN,IAAa,EAAa;EAC9D,IAAIM,CAAC,YAAYX,SAAS,EAAE;IAC1B,OAAOW,CAAC;EACV;EAEA,MAAMP,OAAO,GAAGO,CAAC,YAAYV,KAAK,GAAGU,CAAC,CAACP,OAAO,GAAGQ,MAAM,CAACD,CAAC,CAAC;EAC1D,MAAME,KAAK,GAAG,wBAAwB,CAACC,IAAI,CAACV,OAAO,CAAC;EAEpD,IAAIS,KAAK,EAAE;IACT,MAAM,GAAGV,IAAI,EAAEY,GAAG,CAAC,GAAGF,KAAK;IAC3B,MAAMG,SAAS,GAAGT,MAAM,CAACU,MAAM,CAAClB,SAAS,CAAC,CAACmB,QAAQ,CAACf,IAAiB,CAAC,GACjEA,IAAI,GACLJ,SAAS,CAACoB,OAAO;IACrB,OAAO,IAAInB,SAAS,CAACgB,SAAS,EAAED,GAAG,IAAIX,OAAO,EAAEC,IAAI,CAAC;EACvD;EAEA,OAAO,IAAIL,SAAS,CAACD,SAAS,CAACoB,OAAO,EAAEf,OAAO,EAAEC,IAAI,CAAC;AACxD","ignoreList":[]}
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+
3
+ // Errors
4
+ export { ErrorCode, BlobError, wrapError } from "./errors.js";
5
+
6
+ // Paths
7
+ export { Dirs, join, dirname, basename, extname } from "./paths.js";
8
+
9
+ // Types
10
+
11
+ export { HashAlgorithm, FileType } from "./types.js";
12
+
13
+ // API - Streaming
14
+ export { createReader } from "./api/readFile.js";
15
+ export { createWriter } from "./api/writeFile.js";
16
+
17
+ // API - File Operations
18
+ export { exists, stat, unlink, mkdir, ls, cp, mv } from "./api/fileOps.js";
19
+
20
+ // API - Hashing
21
+ export { hashFile } from "./api/hash.js";
22
+
23
+ // API - Download
24
+ export { download } from "./api/download.js";
25
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["ErrorCode","BlobError","wrapError","Dirs","join","dirname","basename","extname","HashAlgorithm","FileType","createReader","createWriter","exists","stat","unlink","mkdir","ls","cp","mv","hashFile","download"],"sourceRoot":"../../src","sources":["index.ts"],"mappings":";;AAAA;AACA,SAASA,SAAS,EAAEC,SAAS,EAAEC,SAAS,QAAQ,aAAU;;AAE1D;AACA,SAASC,IAAI,EAAEC,IAAI,EAAEC,OAAO,EAAEC,QAAQ,EAAEC,OAAO,QAAQ,YAAS;;AAEhE;;AAOA,SAASC,aAAa,EAAEC,QAAQ,QAAQ,YAAS;;AAEjD;AACA,SAASC,YAAY,QAAQ,mBAAgB;AAC7C,SAASC,YAAY,QAAQ,oBAAiB;;AAE9C;AACA,SAASC,MAAM,EAAEC,IAAI,EAAEC,MAAM,EAAEC,KAAK,EAAEC,EAAE,EAAEC,EAAE,EAAEC,EAAE,QAAQ,kBAAe;;AAEvE;AACA,SAASC,QAAQ,QAAQ,eAAY;;AAErC;AACA,SAASC,QAAQ,QAAQ,mBAAgB","ignoreList":[]}
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+
3
+ import NativeModule from "./NativeBufferedBlob.js";
4
+
5
+ // Install JSI HostObject on first import
6
+ const installed = NativeModule.install();
7
+ if (!installed) {
8
+ throw new Error('[BufferedBlob] Failed to install JSI streaming bridge. Ensure the native module is linked.');
9
+ }
10
+ // Access the JSI HostObject installed by native
11
+ function getStreamingProxy() {
12
+ const proxy = globalThis.__BufferedBlobStreaming;
13
+ if (!proxy) {
14
+ throw new Error('[BufferedBlob] Streaming proxy not available. Make sure install() was called.');
15
+ }
16
+ return proxy;
17
+ }
18
+ export { NativeModule, getStreamingProxy };
19
+ //# sourceMappingURL=module.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["NativeModule","installed","install","Error","getStreamingProxy","proxy","globalThis","__BufferedBlobStreaming"],"sourceRoot":"../../src","sources":["module.ts"],"mappings":";;AAAA,OAAOA,YAAY,MAAM,yBAAsB;;AAE/C;AACA,MAAMC,SAAS,GAAGD,YAAY,CAACE,OAAO,CAAC,CAAC;AACxC,IAAI,CAACD,SAAS,EAAE;EACd,MAAM,IAAIE,KAAK,CACb,4FACF,CAAC;AACH;AA4BA;AACA,SAASC,iBAAiBA,CAAA,EAAmB;EAC3C,MAAMC,KAAK,GAAGC,UAAU,CAACC,uBAAuB;EAChD,IAAI,CAACF,KAAK,EAAE;IACV,MAAM,IAAIF,KAAK,CACb,+EACF,CAAC;EACH;EACA,OAAOE,KAAK;AACd;AAEA,SAASL,YAAY,EAAEI,iBAAiB","ignoreList":[]}
@@ -0,0 +1 @@
1
+ {"type":"module"}
@@ -0,0 +1,32 @@
1
+ "use strict";
2
+
3
+ import { NativeModule } from "./module.js";
4
+ const constants = NativeModule.getConstants();
5
+ export const Dirs = Object.freeze({
6
+ document: constants.documentDir,
7
+ cache: constants.cacheDir,
8
+ temp: constants.tempDir,
9
+ download: constants.downloadDir
10
+ });
11
+ export function join(...parts) {
12
+ const result = parts.filter(Boolean).join('/').replace(/\/+/g, '/');
13
+ return result.length > 1 ? result.replace(/\/$/, '') : result;
14
+ }
15
+ export function dirname(path) {
16
+ const idx = path.lastIndexOf('/');
17
+ return idx === -1 ? '.' : path.substring(0, idx);
18
+ }
19
+ export function basename(path, ext) {
20
+ const idx = path.lastIndexOf('/');
21
+ const name = idx === -1 ? path : path.substring(idx + 1);
22
+ if (ext && name.endsWith(ext)) {
23
+ return name.substring(0, name.length - ext.length);
24
+ }
25
+ return name;
26
+ }
27
+ export function extname(path) {
28
+ const name = basename(path);
29
+ const idx = name.lastIndexOf('.');
30
+ return idx <= 0 ? '' : name.substring(idx);
31
+ }
32
+ //# sourceMappingURL=paths.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["NativeModule","constants","getConstants","Dirs","Object","freeze","document","documentDir","cache","cacheDir","temp","tempDir","download","downloadDir","join","parts","result","filter","Boolean","replace","length","dirname","path","idx","lastIndexOf","substring","basename","ext","name","endsWith","extname"],"sourceRoot":"../../src","sources":["paths.ts"],"mappings":";;AAAA,SAASA,YAAY,QAAQ,aAAU;AAEvC,MAAMC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AAI;AACb;AAEA,OAAO,SAASE,OAAOA,CAACR,IAAY,EAAU;EAC5C,MAAMM,IAAI,GAAGF,QAAQ,CAACJ,IAAI,CAAC;EAC3B,MAAMC,GAAG,GAAGK,IAAI,CAACJ,WAAW,CAAC,GAAG,CAAC;EACjC,OAAOD,GAAG,IAAI,CAAC,GAAG,EAAE,GAAGK,IAAI,CAACH,SAAS,CAACF,GAAG,CAAC;AAC5C","ignoreList":[]}
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+
3
+ // NOTE: Enums changed from numeric (Nitro) to string (Turbo Module compatibility)
4
+ export let HashAlgorithm = /*#__PURE__*/function (HashAlgorithm) {
5
+ HashAlgorithm["SHA256"] = "sha256";
6
+ HashAlgorithm["MD5"] = "md5";
7
+ return HashAlgorithm;
8
+ }({});
9
+ export let FileType = /*#__PURE__*/function (FileType) {
10
+ FileType["FILE"] = "file";
11
+ FileType["DIRECTORY"] = "directory";
12
+ FileType["UNKNOWN"] = "unknown";
13
+ return FileType;
14
+ }({});
15
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["HashAlgorithm","FileType"],"sourceRoot":"../../src","sources":["types.ts"],"mappings":";;AAAA;AACA,WAAYA,aAAa,0BAAbA,aAAa;EAAbA,aAAa;EAAbA,aAAa;EAAA,OAAbA,aAAa;AAAA;AAKzB,WAAYC,QAAQ,0BAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAAA,OAARA,QAAQ;AAAA","ignoreList":[]}
@@ -0,0 +1,107 @@
1
+ "use strict";
2
+
3
+ import { BlobError, ErrorCode } from "./errors.js";
4
+
5
+ /**
6
+ * Wraps a native reader handle with explicit getter delegation.
7
+ * IMPORTANT: Does NOT use spread operator on HostObject (getters would be lost).
8
+ * Instead, proxies each property access through getReaderInfo().
9
+ */
10
+ export function wrapReader(handleId, streaming) {
11
+ let closed = false;
12
+ return {
13
+ get handleId() {
14
+ return handleId;
15
+ },
16
+ get fileSize() {
17
+ return streaming.getReaderInfo(handleId).fileSize;
18
+ },
19
+ get bytesRead() {
20
+ return streaming.getReaderInfo(handleId).bytesRead;
21
+ },
22
+ get isEOF() {
23
+ return streaming.getReaderInfo(handleId).isEOF;
24
+ },
25
+ readNextChunk() {
26
+ if (closed) {
27
+ throw new BlobError(ErrorCode.READER_CLOSED, 'Reader is already closed');
28
+ }
29
+ return streaming.readNextChunk(handleId);
30
+ },
31
+ close() {
32
+ if (!closed) {
33
+ closed = true;
34
+ streaming.close(handleId);
35
+ }
36
+ },
37
+ [Symbol.dispose]() {
38
+ if (!closed) {
39
+ closed = true;
40
+ streaming.close(handleId);
41
+ }
42
+ }
43
+ };
44
+ }
45
+
46
+ /**
47
+ * Wraps a native writer handle with explicit getter delegation.
48
+ * IMPORTANT: Does NOT use spread operator on HostObject (getters would be lost).
49
+ */
50
+ export function wrapWriter(handleId, streaming) {
51
+ let closed = false;
52
+ return {
53
+ get handleId() {
54
+ return handleId;
55
+ },
56
+ get bytesWritten() {
57
+ return streaming.getWriterInfo(handleId).bytesWritten;
58
+ },
59
+ /**
60
+ * Write data to the file.
61
+ *
62
+ * **Backpressure warning:** Each call queues data to the native write
63
+ * pipeline. You MUST await each write() call before issuing the next
64
+ * one. Failing to await writes can cause unbounded memory growth as
65
+ * ArrayBuffer copies accumulate in the native queue.
66
+ *
67
+ * @example
68
+ * ```ts
69
+ * // Correct - sequential writes with await
70
+ * for (const chunk of chunks) {
71
+ * await writer.write(chunk);
72
+ * }
73
+ *
74
+ * // WRONG - parallel writes without backpressure
75
+ * chunks.forEach(chunk => writer.write(chunk)); // Do NOT do this
76
+ * ```
77
+ *
78
+ * @param data - The ArrayBuffer to write
79
+ * @returns Promise resolving to the number of bytes written
80
+ */
81
+ write(data) {
82
+ if (closed) {
83
+ throw new BlobError(ErrorCode.WRITER_CLOSED, 'Writer is already closed');
84
+ }
85
+ return streaming.write(handleId, data);
86
+ },
87
+ flush() {
88
+ if (closed) {
89
+ throw new BlobError(ErrorCode.WRITER_CLOSED, 'Writer is already closed');
90
+ }
91
+ return streaming.flush(handleId);
92
+ },
93
+ close() {
94
+ if (!closed) {
95
+ closed = true;
96
+ streaming.close(handleId);
97
+ }
98
+ },
99
+ [Symbol.dispose]() {
100
+ if (!closed) {
101
+ closed = true;
102
+ streaming.close(handleId);
103
+ }
104
+ }
105
+ };
106
+ }
107
+ //# sourceMappingURL=wrappers.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["BlobError","ErrorCode","wrapReader","handleId","streaming","closed","fileSize","getReaderInfo","bytesRead","isEOF","readNextChunk","READER_CLOSED","close","Symbol","dispose","wrapWriter","bytesWritten","getWriterInfo","write","data","WRITER_CLOSED","flush"],"sourceRoot":"../../src","sources":["wrappers.ts"],"mappings":";;AAEA,SAASA,SAAS,EAAEC,SAAS,QAAQ,aAAU;;AAE/C;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,UAAUA,CACxBC,QAAgB,EAChBC,SAAyB,EACb;EACZ,IAAIC,MAAM,GAAG,KAAK;EAElB,OAAO;IACL,IAAIF,QAAQA,CAAA,EAAG;MACb,OAAOA,QAAQ;IACjB,CAAC;IACD,IAAIG,QAAQA,CAAA,EAAG;MACb,OAAOF,SAAS,CAACG,aAAa,CAACJ,QAAQ,CAAC,CAACG,QAAQ;IACnD,CAAC;IACD,IAAIE,SAASA,CAAA,EAAG;MACd,OAAOJ,SAAS,CAACG,aAAa,CAACJ,QAAQ,CAAC,CAACK,SAAS;IACpD,CAAC;IACD,IAAIC,KAAKA,CAAA,EAAG;MACV,OAAOL,SAAS,CAACG,aAAa,CAACJ,QAAQ,CAAC,CAACM,KAAK;IAChD,CAAC;IACDC,aAAaA,CAAA,EAAG;MACd,IAAIL,MAAM,EAAE;QACV,MAAM,IAAIL,SAAS,CACjBC,SAAS,CAACU,aAAa,EACvB,0BACF,CAAC;MACH;MACA,OAAOP,SAAS,CAACM,aAAa,CAACP,QAAQ,CAAC;IAC1C,CAAC;IACDS,KAAKA,CAA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,MAAM,CAACC,OAAO,IAAI;MACjB,IAAI,CAACT,MAAM,EAAE;QACXA,MAAM,GAAG,IAAI;QACbD,SAAS,CAACQ,KAAK,CAACT,QAAQ,CAAC;MAC3B;IACF;EACF,CAAC;AACH","ignoreList":[]}
@@ -0,0 +1 @@
1
+ {"type":"module"}
@@ -0,0 +1,37 @@
1
+ import type { TurboModule } from 'react-native';
2
+ export interface Spec extends TurboModule {
3
+ install(): boolean;
4
+ openRead(path: string, bufferSize: number): number;
5
+ openWrite(path: string, append: boolean): number;
6
+ createDownload(url: string, destPath: string, headers: Object): number;
7
+ closeHandle(handleId: number): void;
8
+ exists(path: string): Promise<boolean>;
9
+ stat(path: string): Promise<{
10
+ path: string;
11
+ name: string;
12
+ size: number;
13
+ type: string;
14
+ lastModified: number;
15
+ }>;
16
+ unlink(path: string): Promise<void>;
17
+ mkdir(path: string): Promise<void>;
18
+ ls(path: string): Promise<Array<{
19
+ path: string;
20
+ name: string;
21
+ size: number;
22
+ type: string;
23
+ lastModified: number;
24
+ }>>;
25
+ cp(srcPath: string, destPath: string): Promise<void>;
26
+ mv(srcPath: string, destPath: string): Promise<void>;
27
+ hashFile(path: string, algorithm: string): Promise<string>;
28
+ getConstants(): {
29
+ documentDir: string;
30
+ cacheDir: string;
31
+ tempDir: string;
32
+ downloadDir: string;
33
+ };
34
+ }
35
+ declare const _default: Spec;
36
+ export default _default;
37
+ //# sourceMappingURL=NativeBufferedBlob.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NativeBufferedBlob.d.ts","sourceRoot":"","sources":["../../../src/NativeBufferedBlob.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAGhD,MAAM,WAAW,IAAK,SAAQ,WAAW;IAEvC,OAAO,IAAI,OAAO,CAAC;IAKnB,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,MAAM,CAAC;IACnD,SAAS,CAAC,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ACpB,QAAQ,EAAE,MAAM,CAAC;QACjB,OAAO,EAAE,MAAM,CAAC;QAChB,WAAW,EAAE,MAAM,CAAC;KACrB,CAAC;CACH;;AAED,wBAAsE"}
@@ -0,0 +1,13 @@
1
+ import type { DownloadProgress } from '../types';
2
+ export interface DownloadOptions {
3
+ url: string;
4
+ destPath: string;
5
+ headers?: Record<string, string>;
6
+ onProgress?: (progress: DownloadProgress) => void;
7
+ }
8
+ export interface DownloadHandle {
9
+ promise: Promise<void>;
10
+ cancel: () => void;
11
+ }
12
+ export declare function download(options: DownloadOptions): DownloadHandle;
13
+ //# sourceMappingURL=download.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"download.d.ts","sourceRoot":"","sources":["../../../../src/api/download.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAEjD,MAAM,WAAW,eAAe;IAC9B,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACjC,UAAU,CAAC,EAAE,CAAC,QAAQ,EAAE,gBAAgB,KAAK,IAAI,CAAC;CACnD;AAED,MAAM,WAAW,cAAc;IAC7B,OAAO,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC;IACvB,MAAM,EAAE,MAAM,IAAI,CAAC;CACpB;AAED,wBAAgB,QAAQ,CAAC,OAAO,EAAE,eAAe,GAAG,cAAc,CA6BjE"}
@@ -0,0 +1,9 @@
1
+ import type { FileInfo } from '../types';
2
+ export declare function exists(path: string): Promise<boolean>;
3
+ export declare function stat(path: string): Promise<FileInfo>;
4
+ export declare function unlink(path: string): Promise<void>;
5
+ export declare function mkdir(path: string): Promise<void>;
6
+ export declare function ls(path: string): Promise<FileInfo[]>;
7
+ export declare function cp(srcPath: string, destPath: string): Promise<void>;
8
+ export declare function mv(srcPath: string, destPath: string): Promise<void>;
9
+ //# sourceMappingURL=fileOps.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fileOps.d.ts","sourceRoot":"","sources":["../../../../src/api/fileOps.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAwBzC,wBAAsB,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAM3D;AAED,wBAAsB,IAAI,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,CAAC,CAO1D;AAED,wBAAsB,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAMxD;AAED,wBAAsB,KAAK,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAMvD;AAED,wBAAsB,EAAE,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,EAAE,CAAC,CAO1D;AAED,wBAAsB,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAMzE;AAED,wBAAsB,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAMzE"}
@@ -0,0 +1,3 @@
1
+ import { HashAlgorithm } from '../types';
2
+ export declare function hashFile(path: string, algorithm?: HashAlgorithm): Promise<string>;
3
+ //# sourceMappingURL=hash.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hash.d.ts","sourceRoot":"","sources":["../../../../src/api/hash.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC,wBAAsB,QAAQ,CAC5B,IAAI,EAAE,MAAM,EACZ,SAAS,GAAE,aAAoC,GAC9C,OAAO,CAAC,MAAM,CAAC,CAMjB"}
@@ -0,0 +1,3 @@
1
+ import type { BlobReader } from '../types';
2
+ export declare function createReader(path: string, bufferSize?: number): BlobReader;
3
+ //# sourceMappingURL=readFile.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"readFile.d.ts","sourceRoot":"","sources":["../../../../src/api/readFile.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAI3C,wBAAgB,YAAY,CAC1B,IAAI,EAAE,MAAM,EACZ,UAAU,GAAE,MAA4B,GACvC,UAAU,CA0BZ"}
@@ -0,0 +1,3 @@
1
+ import type { BlobWriter } from '../types';
2
+ export declare function createWriter(path: string, append?: boolean): BlobWriter;
3
+ //# sourceMappingURL=writeFile.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"writeFile.d.ts","sourceRoot":"","sources":["../../../../src/api/writeFile.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAE3C,wBAAgB,YAAY,CAC1B,IAAI,EAAE,MAAM,EACZ,MAAM,GAAE,OAAe,GACtB,UAAU,CAeZ"}
@@ -0,0 +1,25 @@
1
+ export declare enum ErrorCode {
2
+ FILE_NOT_FOUND = "FILE_NOT_FOUND",
3
+ PERMISSION_DENIED = "PERMISSION_DENIED",
4
+ FILE_ALREADY_EXISTS = "FILE_ALREADY_EXISTS",
5
+ NOT_A_FILE = "NOT_A_FILE",
6
+ NOT_A_DIRECTORY = "NOT_A_DIRECTORY",
7
+ DIRECTORY_NOT_EMPTY = "DIRECTORY_NOT_EMPTY",
8
+ IO_ERROR = "IO_ERROR",
9
+ INVALID_ARGUMENT = "INVALID_ARGUMENT",
10
+ DOWNLOAD_FAILED = "DOWNLOAD_FAILED",
11
+ DOWNLOAD_CANCELLED = "DOWNLOAD_CANCELLED",
12
+ READER_CLOSED = "READER_CLOSED",
13
+ WRITER_CLOSED = "WRITER_CLOSED",
14
+ UNKNOWN = "UNKNOWN"
15
+ }
16
+ export declare class BlobError extends Error {
17
+ readonly code: ErrorCode;
18
+ readonly path?: string;
19
+ constructor(code: ErrorCode, message: string, path?: string);
20
+ }
21
+ /**
22
+ * Parse native error with format "[ERROR_CODE] message" into BlobError.
23
+ */
24
+ export declare function wrapError(e: unknown, path?: string): BlobError;
25
+ //# sourceMappingURL=errors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../src/errors.ts"],"names":[],"mappings":"AAAA,oBAAY,SAAS;IACnB,cAAc,mBAAmB;IACjC,iBAAiB,sBAAsB;IACvC,mBAAmB,wBAAwB;IAC3C,UAAU,eAAe;IACzB,eAAe,oBAAoB;IACnC,mBAAmB,wBAAwB;IAC3C,QAAQ,aAAa;IACrB,gBAAgB,qBAAqB;IACrC,eAAe,oBAAoB;IACnC,kBAAkB,uBAAuB;IACzC,aAAa,kBAAkB;IAC/B,aAAa,kBAAkB;IAC/B,OAAO,YAAY;CACpB;AAED,qBAAa,SAAU,SAAQ,KAAK;IAClC,SAAgB,IAAI,EAAE,SAAS,CAAC;IAChC,SAAgB,IAAI,CAAC,EAAE,MAAM,CAAC;gBAElB,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM;CAO5D;AAED;;GAEG;AACH,wBAAgB,SAAS,CAAC,CAAC,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAiB9D"}
@@ -0,0 +1,11 @@
1
+ export { ErrorCode, BlobError, wrapError } from './errors';
2
+ export { Dirs, join, dirname, basename, extname } from './paths';
3
+ export type { FileInfo, DownloadProgress, BlobReader, BlobWriter, } from './types';
4
+ export { HashAlgorithm, FileType } from './types';
5
+ export { createReader } from './api/readFile';
6
+ export { createWriter } from './api/writeFile';
7
+ export { exists, stat, unlink, mkdir, ls, cp, mv } from './api/fileOps';
8
+ export { hashFile } from './api/hash';
9
+ export { download } from './api/download';
10
+ export type { DownloadOptions, DownloadHandle } from './api/download';
11
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAG3D,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAGjE,YAAY,EACV,QAAQ,EACR,gBAAgB,EAChB,UAAU,EACV,UAAU,GACX,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAGlD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAG/C,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,MAAM,eAAe,CAAC;AAGxE,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAGtC,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,YAAY,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC"}
@@ -0,0 +1,23 @@
1
+ import NativeModule from './NativeBufferedBlob';
2
+ export interface StreamingProxy {
3
+ readNextChunk(handleId: number): Promise<ArrayBuffer | null>;
4
+ write(handleId: number, data: ArrayBuffer): Promise<number>;
5
+ flush(handleId: number): Promise<void>;
6
+ close(handleId: number): void;
7
+ startDownload(handleId: number, onProgress: (bytesDownloaded: number, totalBytes: number, progress: number) => void): Promise<void>;
8
+ cancelDownload(handleId: number): void;
9
+ getReaderInfo(handleId: number): {
10
+ fileSize: number;
11
+ bytesRead: number;
12
+ isEOF: boolean;
13
+ };
14
+ getWriterInfo(handleId: number): {
15
+ bytesWritten: number;
16
+ };
17
+ }
18
+ declare global {
19
+ var __BufferedBlobStreaming: StreamingProxy | undefined;
20
+ }
21
+ declare function getStreamingProxy(): StreamingProxy;
22
+ export { NativeModule, getStreamingProxy };
23
+ //# sourceMappingURL=module.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../../../src/module.ts"],"names":[],"mappings":"AAAA,OAAO,YAAY,MAAM,sBAAsB,CAAC;AAUhD,MAAM,WAAW,cAAc;IAC7B,aAAa,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,GAAG,IAAI,CAAC,CAAC;IAC7D,KAAK,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,WAAW,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAC5D,KAAK,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACvC,KAAK,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,aAAa,CACX,QAAQ,EAAE,MAAM,EAChB,UAAU,EAAE,CACV,eAAe,EAAE,MAAM,EACvB,UAAU,EAAE,MAAM,EAClB,QAAQ,EAAE,MAAM,KACb,IAAI,GACR,OAAO,CAAC,IAAI,CAAC,CAAC;IACjB,cAAc,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACvC,aAAa,CAAC,QAAQ,EAAE,MAAM,GAAG;QAC/B,QAAQ,EAAE,MAAM,CAAC;QACjB,SAAS,EAAE,MAAM,CAAC;QAClB,KAAK,EAAE,OAAO,CAAC;KAChB,CAAC;IACF,aAAa,CAAC,QAAQ,EAAE,MAAM,GAAG;QAAE,YAAY,EAAE,MAAM,CAAA;KAAE,CAAC;CAC3D;AAED,OAAO,CAAC,MAAM,CAAC;IACb,IAAI,uBAAuB,EAAE,cAAc,GAAG,SAAS,CAAC;CACzD;AAGD,iBAAS,iBAAiB,IAAI,cAAc,CAQ3C;AAED,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,CAAC"}
@@ -0,0 +1,11 @@
1
+ export declare const Dirs: Readonly<{
2
+ document: string;
3
+ cache: string;
4
+ temp: string;
5
+ download: string;
6
+ }>;
7
+ export declare function join(...parts: string[]): string;
8
+ export declare function dirname(path: string): string;
9
+ export declare function basename(path: string, ext?: string): string;
10
+ export declare function extname(path: string): string;
11
+ //# sourceMappingURL=paths.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"paths.d.ts","sourceRoot":"","sources":["../../../src/paths.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,IAAI;;;;;EAKf,CAAC;AAEH,wBAAgB,IAAI,CAAC,GAAG,KAAK,EAAE,MAAM,EAAE,GAAG,MAAM,CAG/C;AAED,wBAAgB,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAG5C;AAED,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,MAAM,GAAG,MAAM,CAO3D;AAED,wBAAgB,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAI5C"}
@@ -0,0 +1,37 @@
1
+ export declare enum HashAlgorithm {
2
+ SHA256 = "sha256",
3
+ MD5 = "md5"
4
+ }
5
+ export declare enum FileType {
6
+ FILE = "file",
7
+ DIRECTORY = "directory",
8
+ UNKNOWN = "unknown"
9
+ }
10
+ export interface FileInfo {
11
+ path: string;
12
+ name: string;
13
+ size: number;
14
+ type: FileType;
15
+ lastModified: number;
16
+ }
17
+ export interface DownloadProgress {
18
+ bytesDownloaded: number;
19
+ totalBytes: number;
20
+ progress: number;
21
+ }
22
+ export interface BlobReader extends Disposable {
23
+ readonly handleId: number;
24
+ readonly fileSize: number;
25
+ readonly bytesRead: number;
26
+ readonly isEOF: boolean;
27
+ readNextChunk(): Promise<ArrayBuffer | null>;
28
+ close(): void;
29
+ }
30
+ export interface BlobWriter extends Disposable {
31
+ readonly handleId: number;
32
+ readonly bytesWritten: number;
33
+ write(data: ArrayBuffer): Promise<number>;
34
+ flush(): Promise<void>;
35
+ close(): void;
36
+ }
37
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/types.ts"],"names":[],"mappings":"AACA,oBAAY,aAAa;IACvB,MAAM,WAAW;IACjB,GAAG,QAAQ;CACZ;AAED,oBAAY,QAAQ;IAClB,IAAI,SAAS;IACb,SAAS,cAAc;IACvB,OAAO,YAAY;CACpB;AAED,MAAM,WAAW,QAAQ;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,QAAQ,CAAC;IACf,YAAY,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,gBAAgB;IAC/B,eAAe,EAAE,MAAM,CAAC;IACxB,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,UAAW,SAAQ,UAAU;IAC5C,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;IACxB,aAAa,IAAI,OAAO,CAAC,WAAW,GAAG,IAAI,CAAC,CAAC;IAC7C,KAAK,IAAI,IAAI,CAAC;CACf;AAED,MAAM,WAAW,UAAW,SAAQ,UAAU;IAC5C,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,KAAK,CAAC,IAAI,EAAE,WAAW,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAC1C,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IACvB,KAAK,IAAI,IAAI,CAAC;CACf"}
@@ -0,0 +1,14 @@
1
+ import type { StreamingProxy } from './module';
2
+ import type { BlobReader, BlobWriter } from './types';
3
+ /**
4
+ * Wraps a native reader handle with explicit getter delegation.
5
+ * IMPORTANT: Does NOT use spread operator on HostObject (getters would be lost).
6
+ * Instead, proxies each property access through getReaderInfo().
7
+ */
8
+ export declare function wrapReader(handleId: number, streaming: StreamingProxy): BlobReader;
9
+ /**
10
+ * Wraps a native writer handle with explicit getter delegation.
11
+ * IMPORTANT: Does NOT use spread operator on HostObject (getters would be lost).
12
+ */
13
+ export declare function wrapWriter(handleId: number, streaming: StreamingProxy): BlobWriter;
14
+ //# sourceMappingURL=wrappers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"wrappers.d.ts","sourceRoot":"","sources":["../../../src/wrappers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAC/C,OAAO,KAAK,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAGtD;;;;GAIG;AACH,wBAAgB,UAAU,CACxB,QAAQ,EAAE,MAAM,EAChB,SAAS,EAAE,cAAc,GACxB,UAAU,CAsCZ;AAED;;;GAGG;AACH,wBAAgB,UAAU,CACxB,QAAQ,EAAE,MAAM,EAChB,SAAS,EAAE,cAAc,GACxB,UAAU,CA+DZ"}