@fireproof/vendor 1.0.4 → 1.1.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 (302) hide show
  1. package/package.json +4 -97
  2. package/src/@web3-storage/pail/dist/src/batch/index.d.ts +1 -53
  3. package/src/@web3-storage/pail/dist/src/batch/index.d.ts.map +1 -1
  4. package/src/@web3-storage/pail/dist/src/batch/shard.d.ts +1 -1
  5. package/src/@web3-storage/pail/dist/src/batch/shard.d.ts.map +1 -1
  6. package/src/@web3-storage/pail/dist/src/block.d.ts +2 -2
  7. package/src/@web3-storage/pail/dist/src/block.d.ts.map +1 -1
  8. package/src/@web3-storage/pail/dist/src/clock/index.d.ts +2 -2
  9. package/src/@web3-storage/pail/dist/src/clock/index.d.ts.map +1 -1
  10. package/src/@web3-storage/pail/dist/src/crdt/batch/index.d.ts.map +1 -1
  11. package/src/@web3-storage/pail/dist/src/crdt/index.d.ts +2 -2
  12. package/src/@web3-storage/pail/dist/src/crdt/index.d.ts.map +1 -1
  13. package/src/@web3-storage/pail/dist/src/diff.d.ts +3 -3
  14. package/src/@web3-storage/pail/dist/src/diff.d.ts.map +1 -1
  15. package/src/@web3-storage/pail/dist/src/index.d.ts +1 -1
  16. package/src/@web3-storage/pail/dist/src/index.d.ts.map +1 -1
  17. package/src/@web3-storage/pail/dist/src/merge.d.ts.map +1 -1
  18. package/src/@web3-storage/pail/dist/src/shard.d.ts +4 -4
  19. package/src/@web3-storage/pail/dist/src/shard.d.ts.map +1 -1
  20. package/src/@web3-storage/pail/dist/tsconfig.tsbuildinfo +1 -1
  21. package/src/@web3-storage/pail/src/api.ts +1 -1
  22. package/src/@web3-storage/pail/src/clock/index.js +1 -1
  23. package/src/@web3-storage/pail/src/shard.js +1 -1
  24. package/src/@ipld/car/LICENSE +0 -4
  25. package/src/@ipld/car/README.md +0 -1132
  26. package/src/@ipld/car/dist/index.min.js +0 -5
  27. package/src/@ipld/car/dist/src/api.d.ts +0 -72
  28. package/src/@ipld/car/dist/src/api.d.ts.map +0 -1
  29. package/src/@ipld/car/dist/src/buffer-decoder.d.ts +0 -67
  30. package/src/@ipld/car/dist/src/buffer-decoder.d.ts.map +0 -1
  31. package/src/@ipld/car/dist/src/buffer-reader-browser.d.ts +0 -116
  32. package/src/@ipld/car/dist/src/buffer-reader-browser.d.ts.map +0 -1
  33. package/src/@ipld/car/dist/src/buffer-reader.d.ts +0 -31
  34. package/src/@ipld/car/dist/src/buffer-reader.d.ts.map +0 -1
  35. package/src/@ipld/car/dist/src/buffer-writer.d.ts +0 -86
  36. package/src/@ipld/car/dist/src/buffer-writer.d.ts.map +0 -1
  37. package/src/@ipld/car/dist/src/coding.d.ts +0 -49
  38. package/src/@ipld/car/dist/src/coding.d.ts.map +0 -1
  39. package/src/@ipld/car/dist/src/decoder-common.d.ts +0 -43
  40. package/src/@ipld/car/dist/src/decoder-common.d.ts.map +0 -1
  41. package/src/@ipld/car/dist/src/decoder.d.ts +0 -87
  42. package/src/@ipld/car/dist/src/decoder.d.ts.map +0 -1
  43. package/src/@ipld/car/dist/src/encoder.d.ts +0 -17
  44. package/src/@ipld/car/dist/src/encoder.d.ts.map +0 -1
  45. package/src/@ipld/car/dist/src/header-validator.d.ts +0 -5
  46. package/src/@ipld/car/dist/src/header-validator.d.ts.map +0 -1
  47. package/src/@ipld/car/dist/src/index-browser.d.ts +0 -10
  48. package/src/@ipld/car/dist/src/index-browser.d.ts.map +0 -1
  49. package/src/@ipld/car/dist/src/index.d.ts +0 -11
  50. package/src/@ipld/car/dist/src/index.d.ts.map +0 -1
  51. package/src/@ipld/car/dist/src/indexed-reader-browser.d.ts +0 -5
  52. package/src/@ipld/car/dist/src/indexed-reader-browser.d.ts.map +0 -1
  53. package/src/@ipld/car/dist/src/indexed-reader.d.ts +0 -152
  54. package/src/@ipld/car/dist/src/indexed-reader.d.ts.map +0 -1
  55. package/src/@ipld/car/dist/src/indexer.d.ts +0 -95
  56. package/src/@ipld/car/dist/src/indexer.d.ts.map +0 -1
  57. package/src/@ipld/car/dist/src/iterator-channel.d.ts +0 -7
  58. package/src/@ipld/car/dist/src/iterator-channel.d.ts.map +0 -1
  59. package/src/@ipld/car/dist/src/iterator.d.ts +0 -174
  60. package/src/@ipld/car/dist/src/iterator.d.ts.map +0 -1
  61. package/src/@ipld/car/dist/src/promise-fs-opts.d.ts +0 -30
  62. package/src/@ipld/car/dist/src/promise-fs-opts.d.ts.map +0 -1
  63. package/src/@ipld/car/dist/src/reader-browser.d.ts +0 -151
  64. package/src/@ipld/car/dist/src/reader-browser.d.ts.map +0 -1
  65. package/src/@ipld/car/dist/src/reader.d.ts +0 -39
  66. package/src/@ipld/car/dist/src/reader.d.ts.map +0 -1
  67. package/src/@ipld/car/dist/src/writer-browser.d.ts +0 -155
  68. package/src/@ipld/car/dist/src/writer-browser.d.ts.map +0 -1
  69. package/src/@ipld/car/dist/src/writer.d.ts +0 -44
  70. package/src/@ipld/car/dist/src/writer.d.ts.map +0 -1
  71. package/src/@ipld/car/src/api.ts +0 -90
  72. package/src/@ipld/car/src/buffer-decoder.js +0 -213
  73. package/src/@ipld/car/src/buffer-reader-browser.js +0 -144
  74. package/src/@ipld/car/src/buffer-reader.js +0 -51
  75. package/src/@ipld/car/src/buffer-writer.js +0 -286
  76. package/src/@ipld/car/src/coding.ts +0 -68
  77. package/src/@ipld/car/src/decoder-common.js +0 -82
  78. package/src/@ipld/car/src/decoder.js +0 -347
  79. package/src/@ipld/car/src/encoder.js +0 -76
  80. package/src/@ipld/car/src/header-validator.js +0 -214
  81. package/src/@ipld/car/src/header.ipldsch +0 -18
  82. package/src/@ipld/car/src/index-browser.js +0 -18
  83. package/src/@ipld/car/src/index.js +0 -21
  84. package/src/@ipld/car/src/indexed-reader-browser.js +0 -7
  85. package/src/@ipld/car/src/indexed-reader.js +0 -211
  86. package/src/@ipld/car/src/indexer.js +0 -130
  87. package/src/@ipld/car/src/iterator-channel.js +0 -91
  88. package/src/@ipld/car/src/iterator.js +0 -267
  89. package/src/@ipld/car/src/promise-fs-opts.js +0 -42
  90. package/src/@ipld/car/src/reader-browser.js +0 -194
  91. package/src/@ipld/car/src/reader.js +0 -53
  92. package/src/@ipld/car/src/writer-browser.js +0 -250
  93. package/src/@ipld/car/src/writer.js +0 -80
  94. package/src/@ipld/dag-cbor/LICENSE +0 -4
  95. package/src/@ipld/dag-cbor/README.md +0 -80
  96. package/src/@ipld/dag-cbor/dist/index.min.js +0 -3
  97. package/src/@ipld/dag-cbor/dist/src/index.d.ts +0 -67
  98. package/src/@ipld/dag-cbor/dist/src/index.d.ts.map +0 -1
  99. package/src/@ipld/dag-cbor/src/index.js +0 -147
  100. package/src/@ipld/dag-json/LICENSE +0 -4
  101. package/src/@ipld/dag-json/README.md +0 -58
  102. package/src/@ipld/dag-json/dist/index.min.js +0 -3
  103. package/src/@ipld/dag-json/dist/src/index.d.ts +0 -12
  104. package/src/@ipld/dag-json/dist/src/index.d.ts.map +0 -1
  105. package/src/@ipld/dag-json/src/index.js +0 -291
  106. package/src/cborg/.github/dependabot.yml +0 -16
  107. package/src/cborg/.github/workflows/test-and-release.yml +0 -52
  108. package/src/cborg/CHANGELOG.md +0 -513
  109. package/src/cborg/LICENSE +0 -13
  110. package/src/cborg/README.md +0 -515
  111. package/src/cborg/bench/bench.js +0 -117
  112. package/src/cborg/bench/json.js +0 -124
  113. package/src/cborg/bench/package.json +0 -8
  114. package/src/cborg/cborg/bin.js +0 -189
  115. package/src/cborg/cborg/common.js +0 -28
  116. package/src/cborg/cborg/decode.js +0 -211
  117. package/src/cborg/cborg/diagnostic.js +0 -158
  118. package/src/cborg/cborg/diagnostic_test.js +0 -117
  119. package/src/cborg/cborg/encode.js +0 -466
  120. package/src/cborg/cborg/index.js +0 -33
  121. package/src/cborg/cborg/is.js +0 -106
  122. package/src/cborg/cborg/length.js +0 -62
  123. package/src/cborg/example-bytestrings.js +0 -180
  124. package/src/cborg/example-json.js +0 -6
  125. package/src/cborg/example.js +0 -5
  126. package/src/cborg/interface.ts +0 -59
  127. package/src/cborg/json/decode.js +0 -462
  128. package/src/cborg/json/encode.js +0 -302
  129. package/src/cborg/json/json.js +0 -4
  130. package/src/cborg/taglib.js +0 -75
  131. package/src/cborg/test/appendix_a.js +0 -647
  132. package/src/cborg/test/common.js +0 -18
  133. package/src/cborg/test/node-test-bin.js +0 -402
  134. package/src/cborg/test/noop-bin-test.js +0 -3
  135. package/src/cborg/test/test-0uint.js +0 -103
  136. package/src/cborg/test/test-1negint.js +0 -96
  137. package/src/cborg/test/test-2bytes.js +0 -198
  138. package/src/cborg/test/test-3string.js +0 -136
  139. package/src/cborg/test/test-4array.js +0 -93
  140. package/src/cborg/test/test-5map.js +0 -284
  141. package/src/cborg/test/test-6tag.js +0 -84
  142. package/src/cborg/test/test-7float.js +0 -131
  143. package/src/cborg/test/test-bl.js +0 -37
  144. package/src/cborg/test/test-cbor-vectors.js +0 -107
  145. package/src/cborg/test/test-decode-errors.js +0 -65
  146. package/src/cborg/test/test-fuzz.js +0 -42
  147. package/src/cborg/test/test-json.js +0 -219
  148. package/src/cborg/test/test-length.js +0 -65
  149. package/src/cborg/test/test-partial.js +0 -111
  150. package/src/cborg/tsconfig.json +0 -48
  151. package/src/cborg/types/cborg/decode.d.ts +0 -43
  152. package/src/cborg/types/cborg/decode.d.ts.map +0 -1
  153. package/src/cborg/types/cborg/encode.d.ts +0 -51
  154. package/src/cborg/types/cborg/encode.d.ts.map +0 -1
  155. package/src/cborg/types/cborg/index.d.ts +0 -26
  156. package/src/cborg/types/cborg/index.d.ts.map +0 -1
  157. package/src/cborg/types/cborg/is.d.ts +0 -6
  158. package/src/cborg/types/cborg/is.d.ts.map +0 -1
  159. package/src/cborg/types/example.d.ts +0 -2
  160. package/src/cborg/types/example.d.ts.map +0 -1
  161. package/src/cborg/types/interface.d.ts +0 -49
  162. package/src/cborg/types/interface.d.ts.map +0 -1
  163. package/src/cborg/types/json/decode.d.ts +0 -67
  164. package/src/cborg/types/json/decode.d.ts.map +0 -1
  165. package/src/cborg/types/json/encode.d.ts +0 -11
  166. package/src/cborg/types/json/encode.d.ts.map +0 -1
  167. package/src/cborg/types/json/json.d.ts +0 -6
  168. package/src/cborg/types/json/json.d.ts.map +0 -1
  169. package/src/cborg/types/taglib.d.ts +0 -18
  170. package/src/cborg/types/taglib.d.ts.map +0 -1
  171. package/src/cborg/types/tsconfig.tsbuildinfo +0 -1
  172. package/src/cborg/types/utils/0uint.d.ts +0 -102
  173. package/src/cborg/types/utils/0uint.d.ts.map +0 -1
  174. package/src/cborg/types/utils/1negint.d.ts +0 -59
  175. package/src/cborg/types/utils/1negint.d.ts.map +0 -1
  176. package/src/cborg/types/utils/2bytes.d.ts +0 -69
  177. package/src/cborg/types/utils/2bytes.d.ts.map +0 -1
  178. package/src/cborg/types/utils/3string.d.ts +0 -46
  179. package/src/cborg/types/utils/3string.d.ts.map +0 -1
  180. package/src/cborg/types/utils/4array.d.ts +0 -66
  181. package/src/cborg/types/utils/4array.d.ts.map +0 -1
  182. package/src/cborg/types/utils/5map.d.ts +0 -66
  183. package/src/cborg/types/utils/5map.d.ts.map +0 -1
  184. package/src/cborg/types/utils/6tag.d.ts +0 -62
  185. package/src/cborg/types/utils/6tag.d.ts.map +0 -1
  186. package/src/cborg/types/utils/7float.d.ts +0 -60
  187. package/src/cborg/types/utils/7float.d.ts.map +0 -1
  188. package/src/cborg/types/utils/bl.d.ts +0 -26
  189. package/src/cborg/types/utils/bl.d.ts.map +0 -1
  190. package/src/cborg/types/utils/byte-utils.d.ts +0 -53
  191. package/src/cborg/types/utils/byte-utils.d.ts.map +0 -1
  192. package/src/cborg/types/utils/common.d.ts +0 -8
  193. package/src/cborg/types/utils/common.d.ts.map +0 -1
  194. package/src/cborg/types/utils/index.d.ts +0 -13
  195. package/src/cborg/types/utils/index.d.ts.map +0 -1
  196. package/src/cborg/types/utils/jump.d.ts +0 -16
  197. package/src/cborg/types/utils/jump.d.ts.map +0 -1
  198. package/src/cborg/types/utils/token.d.ts +0 -59
  199. package/src/cborg/types/utils/token.d.ts.map +0 -1
  200. package/src/cborg/utils/0uint.js +0 -229
  201. package/src/cborg/utils/1negint.js +0 -111
  202. package/src/cborg/utils/2bytes.js +0 -135
  203. package/src/cborg/utils/3string.js +0 -90
  204. package/src/cborg/utils/4array.js +0 -114
  205. package/src/cborg/utils/5map.js +0 -113
  206. package/src/cborg/utils/6tag.js +0 -81
  207. package/src/cborg/utils/7float.js +0 -310
  208. package/src/cborg/utils/bl.js +0 -124
  209. package/src/cborg/utils/byte-utils.js +0 -417
  210. package/src/cborg/utils/common.js +0 -11
  211. package/src/cborg/utils/index.js +0 -12
  212. package/src/cborg/utils/jump.js +0 -222
  213. package/src/cborg/utils/token.js +0 -76
  214. package/src/ipfs-unixfs-exporter/LICENSE +0 -4
  215. package/src/ipfs-unixfs-exporter/README.md +0 -105
  216. package/src/ipfs-unixfs-exporter/dist/index.min.js +0 -3
  217. package/src/ipfs-unixfs-exporter/dist/src/errors.d.ts +0 -57
  218. package/src/ipfs-unixfs-exporter/dist/src/errors.d.ts.map +0 -1
  219. package/src/ipfs-unixfs-exporter/dist/src/errors.js +0 -73
  220. package/src/ipfs-unixfs-exporter/dist/src/errors.js.map +0 -1
  221. package/src/ipfs-unixfs-exporter/dist/src/index.d.ts +0 -355
  222. package/src/ipfs-unixfs-exporter/dist/src/index.d.ts.map +0 -1
  223. package/src/ipfs-unixfs-exporter/dist/src/index.js +0 -197
  224. package/src/ipfs-unixfs-exporter/dist/src/index.js.map +0 -1
  225. package/src/ipfs-unixfs-exporter/dist/src/resolvers/dag-cbor.d.ts +0 -4
  226. package/src/ipfs-unixfs-exporter/dist/src/resolvers/dag-cbor.d.ts.map +0 -1
  227. package/src/ipfs-unixfs-exporter/dist/src/resolvers/dag-cbor.js +0 -9
  228. package/src/ipfs-unixfs-exporter/dist/src/resolvers/dag-cbor.js.map +0 -1
  229. package/src/ipfs-unixfs-exporter/dist/src/resolvers/dag-json.d.ts +0 -4
  230. package/src/ipfs-unixfs-exporter/dist/src/resolvers/dag-json.d.ts.map +0 -1
  231. package/src/ipfs-unixfs-exporter/dist/src/resolvers/dag-json.js +0 -9
  232. package/src/ipfs-unixfs-exporter/dist/src/resolvers/dag-json.js.map +0 -1
  233. package/src/ipfs-unixfs-exporter/dist/src/resolvers/identity.d.ts +0 -4
  234. package/src/ipfs-unixfs-exporter/dist/src/resolvers/identity.d.ts.map +0 -1
  235. package/src/ipfs-unixfs-exporter/dist/src/resolvers/identity.js +0 -38
  236. package/src/ipfs-unixfs-exporter/dist/src/resolvers/identity.js.map +0 -1
  237. package/src/ipfs-unixfs-exporter/dist/src/resolvers/index.d.ts +0 -4
  238. package/src/ipfs-unixfs-exporter/dist/src/resolvers/index.d.ts.map +0 -1
  239. package/src/ipfs-unixfs-exporter/dist/src/resolvers/index.js +0 -30
  240. package/src/ipfs-unixfs-exporter/dist/src/resolvers/index.js.map +0 -1
  241. package/src/ipfs-unixfs-exporter/dist/src/resolvers/json.d.ts +0 -4
  242. package/src/ipfs-unixfs-exporter/dist/src/resolvers/json.d.ts.map +0 -1
  243. package/src/ipfs-unixfs-exporter/dist/src/resolvers/json.js +0 -9
  244. package/src/ipfs-unixfs-exporter/dist/src/resolvers/json.js.map +0 -1
  245. package/src/ipfs-unixfs-exporter/dist/src/resolvers/raw.d.ts +0 -4
  246. package/src/ipfs-unixfs-exporter/dist/src/resolvers/raw.d.ts.map +0 -1
  247. package/src/ipfs-unixfs-exporter/dist/src/resolvers/raw.js +0 -37
  248. package/src/ipfs-unixfs-exporter/dist/src/resolvers/raw.js.map +0 -1
  249. package/src/ipfs-unixfs-exporter/dist/src/resolvers/unixfs-v1/content/directory.d.ts +0 -4
  250. package/src/ipfs-unixfs-exporter/dist/src/resolvers/unixfs-v1/content/directory.d.ts.map +0 -1
  251. package/src/ipfs-unixfs-exporter/dist/src/resolvers/unixfs-v1/content/directory.js +0 -29
  252. package/src/ipfs-unixfs-exporter/dist/src/resolvers/unixfs-v1/content/directory.js.map +0 -1
  253. package/src/ipfs-unixfs-exporter/dist/src/resolvers/unixfs-v1/content/file.d.ts +0 -4
  254. package/src/ipfs-unixfs-exporter/dist/src/resolvers/unixfs-v1/content/file.d.ts.map +0 -1
  255. package/src/ipfs-unixfs-exporter/dist/src/resolvers/unixfs-v1/content/file.js +0 -153
  256. package/src/ipfs-unixfs-exporter/dist/src/resolvers/unixfs-v1/content/file.js.map +0 -1
  257. package/src/ipfs-unixfs-exporter/dist/src/resolvers/unixfs-v1/content/hamt-sharded-directory.d.ts +0 -4
  258. package/src/ipfs-unixfs-exporter/dist/src/resolvers/unixfs-v1/content/hamt-sharded-directory.d.ts.map +0 -1
  259. package/src/ipfs-unixfs-exporter/dist/src/resolvers/unixfs-v1/content/hamt-sharded-directory.js +0 -59
  260. package/src/ipfs-unixfs-exporter/dist/src/resolvers/unixfs-v1/content/hamt-sharded-directory.js.map +0 -1
  261. package/src/ipfs-unixfs-exporter/dist/src/resolvers/unixfs-v1/content/raw.d.ts +0 -4
  262. package/src/ipfs-unixfs-exporter/dist/src/resolvers/unixfs-v1/content/raw.d.ts.map +0 -1
  263. package/src/ipfs-unixfs-exporter/dist/src/resolvers/unixfs-v1/content/raw.js +0 -25
  264. package/src/ipfs-unixfs-exporter/dist/src/resolvers/unixfs-v1/content/raw.js.map +0 -1
  265. package/src/ipfs-unixfs-exporter/dist/src/resolvers/unixfs-v1/index.d.ts +0 -4
  266. package/src/ipfs-unixfs-exporter/dist/src/resolvers/unixfs-v1/index.d.ts.map +0 -1
  267. package/src/ipfs-unixfs-exporter/dist/src/resolvers/unixfs-v1/index.js +0 -104
  268. package/src/ipfs-unixfs-exporter/dist/src/resolvers/unixfs-v1/index.js.map +0 -1
  269. package/src/ipfs-unixfs-exporter/dist/src/utils/extract-data-from-block.d.ts +0 -3
  270. package/src/ipfs-unixfs-exporter/dist/src/utils/extract-data-from-block.d.ts.map +0 -1
  271. package/src/ipfs-unixfs-exporter/dist/src/utils/extract-data-from-block.js +0 -20
  272. package/src/ipfs-unixfs-exporter/dist/src/utils/extract-data-from-block.js.map +0 -1
  273. package/src/ipfs-unixfs-exporter/dist/src/utils/find-cid-in-shard.d.ts +0 -6
  274. package/src/ipfs-unixfs-exporter/dist/src/utils/find-cid-in-shard.d.ts.map +0 -1
  275. package/src/ipfs-unixfs-exporter/dist/src/utils/find-cid-in-shard.js +0 -116
  276. package/src/ipfs-unixfs-exporter/dist/src/utils/find-cid-in-shard.js.map +0 -1
  277. package/src/ipfs-unixfs-exporter/dist/src/utils/resolve-object-path.d.ts +0 -4
  278. package/src/ipfs-unixfs-exporter/dist/src/utils/resolve-object-path.d.ts.map +0 -1
  279. package/src/ipfs-unixfs-exporter/dist/src/utils/resolve-object-path.js +0 -57
  280. package/src/ipfs-unixfs-exporter/dist/src/utils/resolve-object-path.js.map +0 -1
  281. package/src/ipfs-unixfs-exporter/dist/src/utils/validate-offset-and-length.d.ts +0 -6
  282. package/src/ipfs-unixfs-exporter/dist/src/utils/validate-offset-and-length.d.ts.map +0 -1
  283. package/src/ipfs-unixfs-exporter/dist/src/utils/validate-offset-and-length.js +0 -30
  284. package/src/ipfs-unixfs-exporter/dist/src/utils/validate-offset-and-length.js.map +0 -1
  285. package/src/ipfs-unixfs-exporter/dist/typedoc-urls.json +0 -58
  286. package/src/ipfs-unixfs-exporter/src/errors.ts +0 -87
  287. package/src/ipfs-unixfs-exporter/src/index.ts +0 -498
  288. package/src/ipfs-unixfs-exporter/src/resolvers/dag-cbor.ts +0 -12
  289. package/src/ipfs-unixfs-exporter/src/resolvers/dag-json.ts +0 -12
  290. package/src/ipfs-unixfs-exporter/src/resolvers/identity.ts +0 -49
  291. package/src/ipfs-unixfs-exporter/src/resolvers/index.ts +0 -35
  292. package/src/ipfs-unixfs-exporter/src/resolvers/json.ts +0 -12
  293. package/src/ipfs-unixfs-exporter/src/resolvers/raw.ts +0 -49
  294. package/src/ipfs-unixfs-exporter/src/resolvers/unixfs-v1/content/directory.ts +0 -39
  295. package/src/ipfs-unixfs-exporter/src/resolvers/unixfs-v1/content/file.ts +0 -198
  296. package/src/ipfs-unixfs-exporter/src/resolvers/unixfs-v1/content/hamt-sharded-directory.ts +0 -76
  297. package/src/ipfs-unixfs-exporter/src/resolvers/unixfs-v1/content/raw.ts +0 -37
  298. package/src/ipfs-unixfs-exporter/src/resolvers/unixfs-v1/index.ts +0 -121
  299. package/src/ipfs-unixfs-exporter/src/utils/extract-data-from-block.ts +0 -24
  300. package/src/ipfs-unixfs-exporter/src/utils/find-cid-in-shard.ts +0 -149
  301. package/src/ipfs-unixfs-exporter/src/utils/resolve-object-path.ts +0 -62
  302. package/src/ipfs-unixfs-exporter/src/utils/validate-offset-and-length.ts +0 -38
@@ -1,151 +0,0 @@
1
- /**
2
- * @private
3
- * @param {BytesReader} reader
4
- * @returns {Promise<CarReader>}
5
- */
6
- export function decodeReaderComplete(reader: BytesReader): Promise<CarReader>;
7
- /**
8
- * @typedef {import('multiformats').CID} CID
9
- * @typedef {import('./api').Block} Block
10
- * @typedef {import('./api').CarReader} CarReaderIface
11
- * @typedef {import('./coding').BytesReader} BytesReader
12
- * @typedef {import('./coding').CarHeader} CarHeader
13
- * @typedef {import('./coding').CarV2Header} CarV2Header
14
- */
15
- /**
16
- * Provides blockstore-like access to a CAR.
17
- *
18
- * Implements the `RootsReader` interface:
19
- * {@link CarReader.getRoots `getRoots()`}. And the `BlockReader` interface:
20
- * {@link CarReader.get `get()`}, {@link CarReader.has `has()`},
21
- * {@link CarReader.blocks `blocks()`} (defined as a `BlockIterator`) and
22
- * {@link CarReader.cids `cids()`} (defined as a `CIDIterator`).
23
- *
24
- * Load this class with either `import { CarReader } from '@ipld/car/reader'`
25
- * (`const { CarReader } = require('@ipld/car/reader')`). Or
26
- * `import { CarReader } from '@ipld/car'` (`const { CarReader } = require('@ipld/car')`).
27
- * The former will likely result in smaller bundle sizes where this is
28
- * important.
29
- *
30
- * @name CarReader
31
- * @class
32
- * @implements {CarReaderIface}
33
- * @property {number} version The version number of the CAR referenced by this
34
- * reader (should be `1` or `2`).
35
- */
36
- export class CarReader implements CarReaderIface {
37
- /**
38
- * Instantiate a {@link CarReader} from a `Uint8Array` blob. This performs a
39
- * decode fully in memory and maintains the decoded state in memory for full
40
- * access to the data via the `CarReader` API.
41
- *
42
- * @async
43
- * @static
44
- * @memberof CarReader
45
- * @param {Uint8Array} bytes
46
- * @returns {Promise<CarReader>}
47
- */
48
- static fromBytes(bytes: Uint8Array): Promise<CarReader>;
49
- /**
50
- * Instantiate a {@link CarReader} from a `AsyncIterable<Uint8Array>`, such as
51
- * a [modern Node.js stream](https://nodejs.org/api/stream.html#stream_streams_compatibility_with_async_generators_and_async_iterators).
52
- * This performs a decode fully in memory and maintains the decoded state in
53
- * memory for full access to the data via the `CarReader` API.
54
- *
55
- * Care should be taken for large archives; this API may not be appropriate
56
- * where memory is a concern or the archive is potentially larger than the
57
- * amount of memory that the runtime can handle.
58
- *
59
- * @async
60
- * @static
61
- * @memberof CarReader
62
- * @param {AsyncIterable<Uint8Array>} asyncIterable
63
- * @returns {Promise<CarReader>}
64
- */
65
- static fromIterable(asyncIterable: AsyncIterable<Uint8Array>): Promise<CarReader>;
66
- /**
67
- * @constructs CarReader
68
- * @param {CarHeader|CarV2Header} header
69
- * @param {Block[]} blocks
70
- */
71
- constructor(header: CarHeader | CarV2Header, blocks: Block[]);
72
- _header: import("./coding").CarHeader | import("./coding").CarV2Header;
73
- _blocks: import("./api").Block[];
74
- _keys: string[];
75
- /**
76
- * @property
77
- * @memberof CarReader
78
- * @instance
79
- */
80
- get version(): 1 | 2;
81
- /**
82
- * Get the list of roots defined by the CAR referenced by this reader. May be
83
- * zero or more `CID`s.
84
- *
85
- * @function
86
- * @memberof CarReader
87
- * @instance
88
- * @async
89
- * @returns {Promise<CID[]>}
90
- */
91
- getRoots(): Promise<CID[]>;
92
- /**
93
- * Check whether a given `CID` exists within the CAR referenced by this
94
- * reader.
95
- *
96
- * @function
97
- * @memberof CarReader
98
- * @instance
99
- * @async
100
- * @param {CID} key
101
- * @returns {Promise<boolean>}
102
- */
103
- has(key: CID): Promise<boolean>;
104
- /**
105
- * Fetch a `Block` (a `{ cid:CID, bytes:Uint8Array }` pair) from the CAR
106
- * referenced by this reader matching the provided `CID`. In the case where
107
- * the provided `CID` doesn't exist within the CAR, `undefined` will be
108
- * returned.
109
- *
110
- * @function
111
- * @memberof CarReader
112
- * @instance
113
- * @async
114
- * @param {CID} key
115
- * @returns {Promise<Block | undefined>}
116
- */
117
- get(key: CID): Promise<Block | undefined>;
118
- /**
119
- * Returns a `BlockIterator` (`AsyncIterable<Block>`) that iterates over all
120
- * of the `Block`s (`{ cid:CID, bytes:Uint8Array }` pairs) contained within
121
- * the CAR referenced by this reader.
122
- *
123
- * @function
124
- * @memberof CarReader
125
- * @instance
126
- * @async
127
- * @generator
128
- * @returns {AsyncGenerator<Block>}
129
- */
130
- blocks(): AsyncGenerator<Block>;
131
- /**
132
- * Returns a `CIDIterator` (`AsyncIterable<CID>`) that iterates over all of
133
- * the `CID`s contained within the CAR referenced by this reader.
134
- *
135
- * @function
136
- * @memberof CarReader
137
- * @instance
138
- * @async
139
- * @generator
140
- * @returns {AsyncGenerator<CID>}
141
- */
142
- cids(): AsyncGenerator<CID>;
143
- }
144
- export const __browser: true;
145
- export type CID = import('multiformats').CID;
146
- export type Block = import('./api').Block;
147
- export type CarReaderIface = import('./api').CarReader;
148
- export type BytesReader = import('./coding').BytesReader;
149
- export type CarHeader = import('./coding').CarHeader;
150
- export type CarV2Header = import('./coding').CarV2Header;
151
- //# sourceMappingURL=reader-browser.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"reader-browser.d.ts","sourceRoot":"","sources":["../../src/reader-browser.js"],"names":[],"mappings":"AAiLA;;;;GAIG;AACH,6CAHW,WAAW,GACT,QAAQ,SAAS,CAAC,CAW9B;AA7LD;;;;;;;GAOG;AAEH;;;;;;;;;;;;;;;;;;;;GAoBG;AACH;IAuGE;;;;;;;;;;OAUG;IACH,wBAHW,UAAU,GACR,QAAQ,SAAS,CAAC,CAO9B;IAED;;;;;;;;;;;;;;;OAeG;IACH,mCAHW,cAAc,UAAU,CAAC,GACvB,QAAQ,SAAS,CAAC,CAO9B;IA7ID;;;;OAIG;IACH,oBAHW,SAAS,GAAC,WAAW,UACrB,KAAK,EAAE,EAMjB;IAHC,uEAAqB;IACrB,iCAAqB;IACrB,gBAAgD;IAGlD;;;;OAIG;IACH,qBAEC;IAED;;;;;;;;;OASG;IACH,YAFa,QAAQ,GAAG,EAAE,CAAC,CAI1B;IAED;;;;;;;;;;OAUG;IACH,SAHW,GAAG,GACD,QAAQ,OAAO,CAAC,CAI5B;IAED;;;;;;;;;;;;OAYG;IACH,SAHW,GAAG,GACD,QAAQ,KAAK,GAAG,SAAS,CAAC,CAKtC;IAED;;;;;;;;;;;OAWG;IACH,UAFa,eAAe,KAAK,CAAC,CAMjC;IAED;;;;;;;;;;OAUG;IACH,QAFa,eAAe,GAAG,CAAC,CAM/B;CA0CF;AAkBD,6BAA6B;kBA9LhB,OAAO,cAAc,EAAE,GAAG;oBAC1B,OAAO,OAAO,EAAE,KAAK;6BACrB,OAAO,OAAO,EAAE,SAAS;0BACzB,OAAO,UAAU,EAAE,WAAW;wBAC9B,OAAO,UAAU,EAAE,SAAS;0BAC5B,OAAO,UAAU,EAAE,WAAW"}
@@ -1,39 +0,0 @@
1
- /**
2
- * @typedef {import('./api').Block} Block
3
- * @typedef {import('./api').BlockIndex} BlockIndex
4
- * @typedef {import('./api').CarReader} CarReaderIface
5
- */
6
- /**
7
- * @class
8
- * @implements {CarReaderIface}
9
- */
10
- export class CarReader extends BrowserCarReader implements CarReaderIface {
11
- /**
12
- * Reads a block directly from a file descriptor for an open CAR file. This
13
- * function is **only available in Node.js** and not a browser environment.
14
- *
15
- * This function can be used in connection with {@link CarIndexer} which emits
16
- * the `BlockIndex` objects that are required by this function.
17
- *
18
- * The user is responsible for opening and closing the file used in this call.
19
- *
20
- * @async
21
- * @static
22
- * @memberof CarReader
23
- * @param {fs.promises.FileHandle | number} fd - A file descriptor from the
24
- * Node.js `fs` module. Either an integer, from `fs.open()` or a `FileHandle`
25
- * from `fs.promises.open()`.
26
- * @param {BlockIndex} blockIndex - An index pointing to the location of the
27
- * Block required. This `BlockIndex` should take the form:
28
- * `{cid:CID, blockLength:number, blockOffset:number}`.
29
- * @returns {Promise<Block>} A `{ cid:CID, bytes:Uint8Array }` pair.
30
- */
31
- static readRaw(fd: fs.promises.FileHandle | number, blockIndex: BlockIndex): Promise<Block>;
32
- }
33
- export const __browser: false;
34
- export type Block = import('./api').Block;
35
- export type BlockIndex = import('./api').BlockIndex;
36
- export type CarReaderIface = import('./api').CarReader;
37
- import { CarReader as BrowserCarReader } from './reader-browser.js';
38
- import { fs } from './promise-fs-opts.js';
39
- //# sourceMappingURL=reader.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"reader.d.ts","sourceRoot":"","sources":["../../src/reader.js"],"names":[],"mappings":"AAGA;;;;GAIG;AAEH;;;GAGG;AACH;IACE;;;;;;;;;;;;;;;;;;;OAmBG;IACH,mBARW,GAAG,QAAQ,CAAC,UAAU,GAAG,MAAM,cAG/B,UAAU,GAGR,QAAQ,KAAK,CAAC,CAiB1B;CACF;AAED,8BAA4B;oBAhDf,OAAO,OAAO,EAAE,KAAK;yBACrB,OAAO,OAAO,EAAE,UAAU;6BAC1B,OAAO,OAAO,EAAE,SAAS;8CALQ,qBAAqB;mBADxC,sBAAsB"}
@@ -1,155 +0,0 @@
1
- /**
2
- * @typedef {import('./api').Block} Block
3
- * @typedef {import('./api').BlockWriter} BlockWriter
4
- * @typedef {import('./api').WriterChannel} WriterChannel
5
- * @typedef {import('./coding').CarEncoder} CarEncoder
6
- * @typedef {import('./coding').IteratorChannel<Uint8Array>} IteratorChannel
7
- */
8
- /**
9
- * Provides a writer interface for the creation of CAR files.
10
- *
11
- * Creation of a `CarWriter` involves the instatiation of an input / output pair
12
- * in the form of a `WriterChannel`, which is a
13
- * `{ writer:CarWriter, out:AsyncIterable<Uint8Array> }` pair. These two
14
- * components form what can be thought of as a stream-like interface. The
15
- * `writer` component (an instantiated `CarWriter`), has methods to
16
- * {@link CarWriter.put `put()`} new blocks and {@link CarWriter.put `close()`}
17
- * the writing operation (finalising the CAR archive). The `out` component is
18
- * an `AsyncIterable` that yields the bytes of the archive. This can be
19
- * redirected to a file or other sink. In Node.js, you can use the
20
- * [`Readable.from()`](https://nodejs.org/api/stream.html#stream_stream_readable_from_iterable_options)
21
- * API to convert this to a standard Node.js stream, or it can be directly fed
22
- * to a
23
- * [`stream.pipeline()`](https://nodejs.org/api/stream.html#stream_stream_pipeline_source_transforms_destination_callback).
24
- *
25
- * The channel will provide a form of backpressure. The `Promise` from a
26
- * `write()` won't resolve until the resulting data is drained from the `out`
27
- * iterable.
28
- *
29
- * It is also possible to ignore the `Promise` from `write()` calls and allow
30
- * the generated data to queue in memory. This should be avoided for large CAR
31
- * archives of course due to the memory costs and potential for memory overflow.
32
- *
33
- * Load this class with either
34
- * `import { CarWriter } from '@ipld/car/writer'`
35
- * (`const { CarWriter } = require('@ipld/car/writer')`). Or
36
- * `import { CarWriter } from '@ipld/car'`
37
- * (`const { CarWriter } = require('@ipld/car')`). The former will likely
38
- * result in smaller bundle sizes where this is important.
39
- *
40
- * @name CarWriter
41
- * @class
42
- * @implements {BlockWriter}
43
- */
44
- export class CarWriter implements BlockWriter {
45
- /**
46
- * Create a new CAR writer "channel" which consists of a
47
- * `{ writer:CarWriter, out:AsyncIterable<Uint8Array> }` pair.
48
- *
49
- * @async
50
- * @static
51
- * @memberof CarWriter
52
- * @param {CID[] | CID | void} roots
53
- * @returns {WriterChannel} The channel takes the form of
54
- * `{ writer:CarWriter, out:AsyncIterable<Uint8Array> }`.
55
- */
56
- static create(roots: CID[] | CID | void): WriterChannel;
57
- /**
58
- * Create a new CAR appender "channel" which consists of a
59
- * `{ writer:CarWriter, out:AsyncIterable<Uint8Array> }` pair.
60
- * This appender does not consider roots and does not produce a CAR header.
61
- * It is designed to append blocks to an _existing_ CAR archive. It is
62
- * expected that `out` will be concatenated onto the end of an existing
63
- * archive that already has a properly formatted header.
64
- *
65
- * @async
66
- * @static
67
- * @memberof CarWriter
68
- * @returns {WriterChannel} The channel takes the form of
69
- * `{ writer:CarWriter, out:AsyncIterable<Uint8Array> }`.
70
- */
71
- static createAppender(): WriterChannel;
72
- /**
73
- * Update the list of roots in the header of an existing CAR as represented
74
- * in a Uint8Array.
75
- *
76
- * This operation is an _overwrite_, the total length of the CAR will not be
77
- * modified. A rejection will occur if the new header will not be the same
78
- * length as the existing header, in which case the CAR will not be modified.
79
- * It is the responsibility of the user to ensure that the roots being
80
- * replaced encode as the same length as the new roots.
81
- *
82
- * The byte array passed in an argument will be modified and also returned
83
- * upon successful modification.
84
- *
85
- * @async
86
- * @static
87
- * @memberof CarWriter
88
- * @param {Uint8Array} bytes
89
- * @param {CID[]} roots - A new list of roots to replace the existing list in
90
- * the CAR header. The new header must take up the same number of bytes as the
91
- * existing header, so the roots should collectively be the same byte length
92
- * as the existing roots.
93
- * @returns {Promise<Uint8Array>}
94
- */
95
- static updateRootsInBytes(bytes: Uint8Array, roots: CID[]): Promise<Uint8Array>;
96
- /**
97
- * @param {CID[]} roots
98
- * @param {CarEncoder} encoder
99
- */
100
- constructor(roots: CID[], encoder: CarEncoder);
101
- _encoder: import("./coding").CarEncoder;
102
- /** @type {Promise<void>} */
103
- _mutex: Promise<void>;
104
- _ended: boolean;
105
- /**
106
- * Write a `Block` (a `{ cid:CID, bytes:Uint8Array }` pair) to the archive.
107
- *
108
- * @function
109
- * @memberof CarWriter
110
- * @instance
111
- * @async
112
- * @param {Block} block - A `{ cid:CID, bytes:Uint8Array }` pair.
113
- * @returns {Promise<void>} The returned promise will only resolve once the
114
- * bytes this block generates are written to the `out` iterable.
115
- */
116
- put(block: Block): Promise<void>;
117
- /**
118
- * Finalise the CAR archive and signal that the `out` iterable should end once
119
- * any remaining bytes are written.
120
- *
121
- * @function
122
- * @memberof CarWriter
123
- * @instance
124
- * @async
125
- * @returns {Promise<void>}
126
- */
127
- close(): Promise<void>;
128
- /**
129
- * Returns the version number of the CAR file being written
130
- *
131
- * @returns {number}
132
- */
133
- version(): number;
134
- }
135
- /**
136
- * @class
137
- * @implements {AsyncIterable<Uint8Array>}
138
- */
139
- export class CarWriterOut implements AsyncIterable<Uint8Array> {
140
- /**
141
- * @param {AsyncIterator<Uint8Array>} iterator
142
- */
143
- constructor(iterator: AsyncIterator<Uint8Array>);
144
- _iterator: AsyncIterator<Uint8Array, any, undefined>;
145
- _iterating: boolean | undefined;
146
- [Symbol.asyncIterator](): AsyncIterator<Uint8Array, any, undefined>;
147
- }
148
- export const __browser: true;
149
- export type Block = import('./api').Block;
150
- export type BlockWriter = import('./api').BlockWriter;
151
- export type WriterChannel = import('./api').WriterChannel;
152
- export type CarEncoder = import('./coding').CarEncoder;
153
- export type IteratorChannel = import('./coding').IteratorChannel<Uint8Array>;
154
- import { CID } from 'multiformats/cid';
155
- //# sourceMappingURL=writer-browser.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"writer-browser.d.ts","sourceRoot":"","sources":["../../src/writer-browser.js"],"names":[],"mappings":"AAKA;;;;;;GAMG;AAEH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AACH;IAkEE;;;;;;;;;;OAUG;IACH,qBAJW,GAAG,EAAE,GAAG,GAAG,GAAG,IAAI,GAChB,aAAa,CASzB;IAED;;;;;;;;;;;;;OAaG;IACH,yBAHa,aAAa,CASzB;IAED;;;;;;;;;;;;;;;;;;;;;;OAsBG;IACH,iCAPW,UAAU,SACV,GAAG,EAAE,GAIH,QAAQ,UAAU,CAAC,CAW/B;IA1ID;;;OAGG;IACH,mBAHW,GAAG,EAAE,WACL,UAAU,EAOpB;IAJC,wCAAuB;IACvB,4BAA4B;IAC5B,QADW,QAAQ,IAAI,CAAC,CACa;IACrC,gBAAmB;IAGrB;;;;;;;;;;OAUG;IACH,WAJW,KAAK,GACH,QAAQ,IAAI,CAAC,CAgBzB;IAED;;;;;;;;;OASG;IACH,SAFa,QAAQ,IAAI,CAAC,CASzB;IAED;;;;OAIG;IACH,WAFa,MAAM,CAIlB;CA4EF;AAED;;;GAGG;AACH,mDAF8B,UAAU;IAGtC;;OAEG;IACH,sBAFW,cAAc,UAAU,CAAC,EAInC;IADC,qDAAyB;IAOzB,gCAAsB;IAJxB,oEAMC;CACF;AAuCD,6BAA6B;oBAnPhB,OAAO,OAAO,EAAE,KAAK;0BACrB,OAAO,OAAO,EAAE,WAAW;4BAC3B,OAAO,OAAO,EAAE,aAAa;yBAC7B,OAAO,UAAU,EAAE,UAAU;8BAC7B,OAAO,UAAU,EAAE,eAAe,CAAC,UAAU,CAAC;oBAVvC,kBAAkB"}
@@ -1,44 +0,0 @@
1
- /**
2
- * @typedef {import('multiformats/cid').CID} CID
3
- * @typedef {import('./api').BlockWriter} BlockWriter
4
- */
5
- /**
6
- * @class
7
- * @implements {BlockWriter}
8
- */
9
- export class CarWriter extends BrowserCarWriter implements BlockWriter {
10
- /**
11
- * Update the list of roots in the header of an existing CAR file. The first
12
- * argument must be a file descriptor for CAR file that is open in read and
13
- * write mode (not append), e.g. `fs.open` or `fs.promises.open` with `'r+'`
14
- * mode.
15
- *
16
- * This operation is an _overwrite_, the total length of the CAR will not be
17
- * modified. A rejection will occur if the new header will not be the same
18
- * length as the existing header, in which case the CAR will not be modified.
19
- * It is the responsibility of the user to ensure that the roots being
20
- * replaced encode as the same length as the new roots.
21
- *
22
- * This function is **only available in Node.js** and not a browser
23
- * environment.
24
- *
25
- * @async
26
- * @static
27
- * @memberof CarWriter
28
- * @param {fs.promises.FileHandle | number} fd - A file descriptor from the
29
- * Node.js `fs` module. Either an integer, from `fs.open()` or a `FileHandle`
30
- * from `fs.promises.open()`.
31
- * @param {CID[]} roots - A new list of roots to replace the existing list in
32
- * the CAR header. The new header must take up the same number of bytes as the
33
- * existing header, so the roots should collectively be the same byte length
34
- * as the existing roots.
35
- * @returns {Promise<void>}
36
- */
37
- static updateRootsInFile(fd: fs.promises.FileHandle | number, roots: CID[]): Promise<void>;
38
- }
39
- export const __browser: false;
40
- export type CID = import('multiformats/cid').CID;
41
- export type BlockWriter = import('./api').BlockWriter;
42
- import { CarWriter as BrowserCarWriter } from './writer-browser.js';
43
- import { fs } from './promise-fs-opts.js';
44
- //# sourceMappingURL=writer.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"writer.d.ts","sourceRoot":"","sources":["../../src/writer.js"],"names":[],"mappings":"AAKA;;;GAGG;AAEH;;;GAGG;AACH;IACE;;;;;;;;;;;;;;;;;;;;;;;;;;OA0BG;IACH,6BATW,GAAG,QAAQ,CAAC,UAAU,GAAG,MAAM,SAG/B,GAAG,EAAE,GAIH,QAAQ,IAAI,CAAC,CAoCzB;CACF;AAED,8BAA4B;kBAzEf,OAAO,kBAAkB,EAAE,GAAG;0BAC9B,OAAO,OAAO,EAAE,WAAW;8CAJM,qBAAqB;mBAD/B,sBAAsB"}
@@ -1,90 +0,0 @@
1
- import type { CID } from 'multiformats/cid'
2
-
3
- /**
4
- * Literally any `Iterable` (async or regular).
5
- */
6
- export type AwaitIterable<T> = Iterable<T> | AsyncIterable<T>
7
-
8
- export type { CID }
9
- /* Generic types for interfacing with block storage */
10
-
11
- export interface Block {
12
- cid: CID
13
- bytes: Uint8Array
14
- }
15
-
16
- export interface BlockHeader {
17
- cid: CID
18
- length: number
19
- blockLength: number
20
- }
21
-
22
- export interface BlockIndex extends BlockHeader {
23
- offset: number
24
- blockOffset: number
25
- }
26
-
27
- export interface RootsReader {
28
- version: number
29
- getRoots(): Promise<CID[]>
30
- }
31
-
32
- export interface RootsBufferReader {
33
- version: number
34
- getRoots(): CID[]
35
- }
36
-
37
- export interface BlockIterator extends AsyncIterable<Block> {}
38
-
39
- export interface CIDIterator extends AsyncIterable<CID> {}
40
-
41
- export interface BlockReader {
42
- has(key: CID): Promise<boolean>
43
- get(key: CID): Promise<Block | undefined>
44
- blocks(): BlockIterator
45
- cids(): CIDIterator
46
- }
47
-
48
- export interface BlockBufferReader {
49
- has(key: CID): boolean
50
- get(key: CID): Block | undefined
51
- blocks(): Iterable<Block>
52
- cids(): Iterable<CID>
53
- }
54
-
55
- export interface BlockWriter {
56
- put(block: Block): Promise<void>
57
- close(): Promise<void>
58
- version(): number
59
- }
60
-
61
- export interface CarBufferWriter {
62
- addRoot(root: CID, options?: { resize?: boolean }): CarBufferWriter
63
- write(block: Block): CarBufferWriter
64
- close(options?: { resize?: boolean }): Uint8Array
65
- }
66
-
67
- export interface CarBufferWriterOptions {
68
- roots?: CID[] // defaults to []
69
- byteOffset?: number // defaults to 0
70
- byteLength?: number // defaults to buffer.byteLength
71
-
72
- headerSize?: number // defaults to size needed for provided roots
73
- }
74
-
75
- export interface WriterChannel {
76
- writer: BlockWriter
77
- out: AsyncIterable<Uint8Array>
78
- }
79
-
80
- export interface CarReader extends BlockReader, RootsReader {}
81
- export interface CarBufferReader extends BlockBufferReader, RootsBufferReader {}
82
-
83
- /* Specific implementations for CAR block storage */
84
-
85
- /*
86
- export interface CarBlockIterator extends BlockIterator, RootsReader {}
87
- export interface CarCIDIterator extends CIDIterator, RootsReader {}
88
- export interface CarIndexer extends AsyncIterable<BlockIndex>, RootsReader {}
89
- export interface CarWriter extends BlockWriter {}
90
- */