taglib-wasm 2.3.0 → 2.4.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 (635) hide show
  1. package/LICENSE +2 -2
  2. package/README.md +72 -64
  3. package/dist/_virtual/_@oxc-project_runtime@0.152.0/helpers/esm/assertClassBrand.js +7 -0
  4. package/dist/_virtual/_@oxc-project_runtime@0.152.0/helpers/esm/checkPrivateRedeclaration.js +6 -0
  5. package/dist/_virtual/_@oxc-project_runtime@0.152.0/helpers/esm/classPrivateFieldGet2.js +7 -0
  6. package/dist/_virtual/_@oxc-project_runtime@0.152.0/helpers/esm/classPrivateFieldInitSpec.js +7 -0
  7. package/dist/_virtual/_@oxc-project_runtime@0.152.0/helpers/esm/classPrivateFieldSet2.js +7 -0
  8. package/dist/_virtual/_@oxc-project_runtime@0.152.0/helpers/esm/defineProperty.js +12 -0
  9. package/dist/_virtual/_@oxc-project_runtime@0.152.0/helpers/esm/toPrimitive.js +14 -0
  10. package/dist/_virtual/_@oxc-project_runtime@0.152.0/helpers/esm/toPropertyKey.js +9 -0
  11. package/dist/_virtual/_@oxc-project_runtime@0.152.0/helpers/esm/typeof.js +11 -0
  12. package/dist/_virtual/_@oxc-project_runtime@0.152.0/helpers/esm/usingCtx.js +57 -0
  13. package/dist/_virtual/_rolldown/runtime.js +13 -0
  14. package/dist/bwf/bext.d.ts.map +1 -0
  15. package/dist/bwf/bext.js +119 -0
  16. package/dist/{src/constants → constants}/additional-properties.d.ts.map +1 -1
  17. package/dist/constants/additional-properties.js +270 -0
  18. package/dist/constants/basic-properties.d.ts.map +1 -0
  19. package/dist/constants/basic-properties.js +128 -0
  20. package/dist/constants/complex-properties.d.ts.map +1 -0
  21. package/dist/constants/complex-properties.js +1 -0
  22. package/dist/constants/format-mappings.d.ts.map +1 -0
  23. package/dist/constants/format-mappings.js +58 -0
  24. package/dist/{src/constants → constants}/general-extended-properties.d.ts.map +1 -1
  25. package/dist/constants/general-extended-properties.js +272 -0
  26. package/dist/constants/index.d.ts.map +1 -0
  27. package/dist/constants/index.js +5 -0
  28. package/dist/constants/properties.d.ts +43 -0
  29. package/dist/constants/properties.d.ts.map +1 -0
  30. package/dist/constants/properties.js +105 -0
  31. package/dist/constants/property-types.d.ts.map +1 -0
  32. package/dist/constants/property-types.js +1 -0
  33. package/dist/{src/constants → constants}/specialized-properties.d.ts.map +1 -1
  34. package/dist/constants/specialized-properties.js +335 -0
  35. package/dist/{src/constants → constants}/utilities.d.ts +1 -1
  36. package/dist/constants/utilities.d.ts.map +1 -0
  37. package/dist/constants/utilities.js +50 -0
  38. package/dist/constants.d.ts.map +1 -0
  39. package/dist/constants.js +5 -0
  40. package/dist/{src/deno-compile.d.ts → deno-compile.d.ts} +8 -2
  41. package/dist/deno-compile.d.ts.map +1 -0
  42. package/dist/deno-compile.js +113 -0
  43. package/dist/disc-folder.d.ts +4 -4
  44. package/dist/disc-folder.d.ts.map +1 -1
  45. package/dist/disc-folder.js +596 -544
  46. package/dist/errors/base.d.ts.map +1 -0
  47. package/dist/errors/base.js +66 -0
  48. package/dist/errors/classes.d.ts.map +1 -0
  49. package/dist/errors/classes.js +164 -0
  50. package/dist/errors/guards.d.ts.map +1 -0
  51. package/dist/errors/guards.js +26 -0
  52. package/dist/errors/index.d.ts.map +1 -0
  53. package/dist/errors/index.js +4 -0
  54. package/dist/errors.d.ts.map +1 -0
  55. package/dist/errors.js +5 -0
  56. package/dist/file-utils/copy-and-find.d.ts.map +1 -0
  57. package/dist/file-utils/copy-and-find.js +107 -0
  58. package/dist/file-utils/export-operations.d.ts.map +1 -0
  59. package/dist/file-utils/export-operations.js +84 -0
  60. package/dist/file-utils/import-operations.d.ts.map +1 -0
  61. package/dist/file-utils/import-operations.js +109 -0
  62. package/dist/file-utils/index.d.ts.map +1 -0
  63. package/dist/file-utils/index.js +5 -0
  64. package/dist/file-utils/mime-detection.d.ts.map +1 -0
  65. package/dist/file-utils/mime-detection.js +44 -0
  66. package/dist/folder-api/album-corroborate.d.ts.map +1 -0
  67. package/dist/folder-api/album-corroborate.js +35 -0
  68. package/dist/folder-api/album-discs.d.ts.map +1 -0
  69. package/dist/folder-api/album-discs.js +119 -0
  70. package/dist/folder-api/album-grouping.d.ts.map +1 -0
  71. package/dist/folder-api/album-grouping.js +161 -0
  72. package/dist/folder-api/album-identity.d.ts.map +1 -0
  73. package/dist/folder-api/album-identity.js +165 -0
  74. package/dist/folder-api/album-types.d.ts.map +1 -0
  75. package/dist/folder-api/album-types.js +1 -0
  76. package/dist/folder-api/directory-walker.d.ts.map +1 -0
  77. package/dist/folder-api/directory-walker.js +27 -0
  78. package/dist/folder-api/file-processors.d.ts.map +1 -0
  79. package/dist/folder-api/file-processors.js +52 -0
  80. package/dist/folder-api/folder-disc.d.ts.map +1 -0
  81. package/dist/folder-api/folder-disc.js +166 -0
  82. package/dist/folder-api/folder-operations.d.ts.map +1 -0
  83. package/dist/folder-api/folder-operations.js +69 -0
  84. package/dist/folder-api/index.d.ts.map +1 -0
  85. package/dist/{src/folder-api → folder-api}/index.js +1 -8
  86. package/dist/folder-api/scan-for-albums.d.ts.map +1 -0
  87. package/dist/folder-api/scan-for-albums.js +25 -0
  88. package/dist/folder-api/scan-operations.d.ts.map +1 -0
  89. package/dist/folder-api/scan-operations.js +79 -0
  90. package/dist/folder-api/types.d.ts.map +1 -0
  91. package/dist/folder-api/types.js +21 -0
  92. package/dist/folder.d.ts +1 -1
  93. package/dist/folder.d.ts.map +1 -1
  94. package/dist/folder.js +7 -2
  95. package/dist/global.d.js +1 -0
  96. package/dist/index.browser.d.ts +29 -30
  97. package/dist/index.browser.d.ts.map +1 -1
  98. package/dist/index.browser.js +4106 -4479
  99. package/dist/index.d.ts +26 -26
  100. package/dist/index.d.ts.map +1 -1
  101. package/dist/index.js +40 -185
  102. package/dist/msgpack/decoder.d.ts.map +1 -0
  103. package/dist/msgpack/decoder.js +177 -0
  104. package/dist/msgpack/encoder.d.ts.map +1 -0
  105. package/dist/msgpack/encoder.js +211 -0
  106. package/dist/msgpack/index.d.ts.map +1 -0
  107. package/dist/msgpack/index.js +5 -0
  108. package/dist/{src/msgpack → msgpack}/types.d.ts +1 -1
  109. package/dist/msgpack/types.d.ts.map +1 -0
  110. package/dist/msgpack/types.js +13 -0
  111. package/dist/msgpack/utils.d.ts.map +1 -0
  112. package/dist/msgpack/utils.js +116 -0
  113. package/dist/rating.d.ts +1 -1
  114. package/dist/rating.d.ts.map +1 -1
  115. package/dist/rating.js +2 -2
  116. package/dist/runtime/deno-detect.d.ts +19 -0
  117. package/dist/runtime/deno-detect.d.ts.map +1 -0
  118. package/dist/runtime/deno-detect.js +26 -0
  119. package/dist/{src/runtime → runtime}/detector.d.ts +2 -0
  120. package/dist/runtime/detector.d.ts.map +1 -0
  121. package/dist/runtime/detector.js +173 -0
  122. package/dist/runtime/loader-types.d.ts.map +1 -0
  123. package/dist/runtime/loader-types.js +23 -0
  124. package/dist/runtime/module-loader-browser.d.ts.map +1 -0
  125. package/dist/runtime/module-loader-browser.js +33 -0
  126. package/dist/runtime/module-loader.d.ts.map +1 -0
  127. package/dist/runtime/module-loader.js +119 -0
  128. package/dist/runtime/platform-io.d.ts.map +1 -0
  129. package/dist/runtime/platform-io.js +168 -0
  130. package/dist/runtime/unified-loader/index.d.ts.map +1 -0
  131. package/dist/{src/runtime → runtime}/unified-loader/index.js +1 -7
  132. package/dist/runtime/unified-loader/loader.d.ts.map +1 -0
  133. package/dist/runtime/unified-loader/loader.js +64 -0
  134. package/dist/runtime/unified-loader/module-loading.d.ts.map +1 -0
  135. package/dist/runtime/unified-loader/module-loading.js +90 -0
  136. package/dist/runtime/unified-loader/module-selection.d.ts.map +1 -0
  137. package/dist/runtime/unified-loader/module-selection.js +25 -0
  138. package/dist/runtime/unified-loader/types.d.ts.map +1 -0
  139. package/dist/runtime/unified-loader/types.js +24 -0
  140. package/dist/runtime/wasi-adapter/adapter.d.ts.map +1 -0
  141. package/dist/runtime/wasi-adapter/adapter.js +114 -0
  142. package/dist/runtime/wasi-adapter/audio-properties.d.ts.map +1 -0
  143. package/dist/runtime/wasi-adapter/audio-properties.js +120 -0
  144. package/dist/runtime/wasi-adapter/file-handle.d.ts.map +1 -0
  145. package/dist/runtime/wasi-adapter/file-handle.js +181 -0
  146. package/dist/runtime/wasi-adapter/handle-state.d.ts.map +1 -0
  147. package/dist/runtime/wasi-adapter/handle-state.js +48 -0
  148. package/dist/runtime/wasi-adapter/index.d.ts.map +1 -0
  149. package/dist/{src/runtime → runtime}/wasi-adapter/index.js +1 -3
  150. package/dist/runtime/wasi-adapter/mp4-items.d.ts.map +1 -0
  151. package/dist/runtime/wasi-adapter/mp4-items.js +97 -0
  152. package/dist/runtime/wasi-adapter/path-open.d.ts.map +1 -0
  153. package/dist/runtime/wasi-adapter/path-open.js +101 -0
  154. package/dist/runtime/wasi-adapter/property-surface.d.ts.map +1 -0
  155. package/dist/runtime/wasi-adapter/property-surface.js +96 -0
  156. package/dist/runtime/wasi-adapter/structured-fields.d.ts.map +1 -0
  157. package/dist/runtime/wasi-adapter/structured-fields.js +144 -0
  158. package/dist/runtime/wasi-adapter/tag-keys.d.ts.map +1 -0
  159. package/dist/runtime/wasi-adapter/tag-keys.js +65 -0
  160. package/dist/runtime/wasi-adapter/wasm-io.d.ts.map +1 -0
  161. package/dist/runtime/wasi-adapter/wasm-io.js +154 -0
  162. package/dist/runtime/wasi-fs-deno.d.ts.map +1 -0
  163. package/dist/runtime/wasi-fs-deno.js +25 -0
  164. package/dist/runtime/wasi-fs-node.d.ts.map +1 -0
  165. package/dist/runtime/wasi-fs-node.js +58 -0
  166. package/dist/runtime/wasi-fs-provider.d.ts.map +1 -0
  167. package/dist/runtime/wasi-fs-provider.js +1 -0
  168. package/dist/runtime/wasi-host-loader.d.ts.map +1 -0
  169. package/dist/runtime/wasi-host-loader.js +101 -0
  170. package/dist/runtime/wasi-host.d.ts.map +1 -0
  171. package/dist/runtime/wasi-host.js +199 -0
  172. package/dist/runtime/wasi-memory.d.ts.map +1 -0
  173. package/dist/runtime/wasi-memory.js +179 -0
  174. package/dist/runtime/wasmer-sdk-loader/types.d.ts.map +1 -0
  175. package/dist/runtime/wasmer-sdk-loader/types.js +15 -0
  176. package/dist/simple/batch-operations.d.ts.map +1 -0
  177. package/dist/simple/batch-operations.js +245 -0
  178. package/dist/simple/checksum-operations.d.ts.map +1 -0
  179. package/dist/simple/checksum-operations.js +28 -0
  180. package/dist/simple/config.d.ts.map +1 -0
  181. package/dist/simple/config.js +17 -0
  182. package/dist/simple/index.d.ts.map +1 -0
  183. package/dist/simple/index.js +8 -0
  184. package/dist/simple/picture-operations.d.ts.map +1 -0
  185. package/dist/simple/picture-operations.js +132 -0
  186. package/dist/simple/tag-operations.d.ts.map +1 -0
  187. package/dist/simple/tag-operations.js +125 -0
  188. package/dist/simple/with-audio-file.d.ts.map +1 -0
  189. package/dist/simple/with-audio-file.js +28 -0
  190. package/dist/simple.browser.d.ts +2 -2
  191. package/dist/simple.browser.d.ts.map +1 -1
  192. package/dist/simple.browser.js +3405 -3692
  193. package/dist/simple.d.ts +1 -1
  194. package/dist/simple.d.ts.map +1 -1
  195. package/dist/simple.js +8 -2
  196. package/dist/taglib/audio-file-base.d.ts.map +1 -0
  197. package/dist/taglib/audio-file-base.js +166 -0
  198. package/dist/taglib/audio-file-bwf.d.ts.map +1 -0
  199. package/dist/taglib/audio-file-bwf.js +33 -0
  200. package/dist/taglib/audio-file-checksum.d.ts.map +1 -0
  201. package/dist/taglib/audio-file-checksum.js +90 -0
  202. package/dist/taglib/audio-file-impl.d.ts.map +1 -0
  203. package/dist/taglib/audio-file-impl.js +234 -0
  204. package/dist/taglib/audio-file-interface.d.ts.map +1 -0
  205. package/dist/taglib/audio-file-interface.js +1 -0
  206. package/dist/taglib/auto-dispose.d.ts.map +1 -0
  207. package/dist/taglib/auto-dispose.js +34 -0
  208. package/dist/taglib/embind-adapter.d.ts.map +1 -0
  209. package/dist/taglib/embind-adapter.js +138 -0
  210. package/dist/taglib/extra-state-registry.d.ts.map +1 -0
  211. package/dist/taglib/extra-state-registry.js +72 -0
  212. package/dist/{src/taglib → taglib}/id3v2-frames.d.ts +0 -1
  213. package/dist/taglib/id3v2-frames.d.ts.map +1 -0
  214. package/dist/taglib/id3v2-frames.js +25 -0
  215. package/dist/taglib/index.d.ts.map +1 -0
  216. package/dist/taglib/index.js +7 -0
  217. package/dist/taglib/load-audio-data.d.ts.map +1 -0
  218. package/dist/taglib/load-audio-data.js +54 -0
  219. package/dist/taglib/media-ranges.d.ts.map +1 -0
  220. package/dist/taglib/media-ranges.js +309 -0
  221. package/dist/taglib/metadata-extent.d.ts.map +1 -0
  222. package/dist/taglib/metadata-extent.js +394 -0
  223. package/dist/taglib/mp4-item-names.d.ts.map +1 -0
  224. package/dist/taglib/mp4-item-names.js +14 -0
  225. package/dist/taglib/mutable-tag-impl.d.ts.map +1 -0
  226. package/dist/taglib/mutable-tag-impl.js +81 -0
  227. package/dist/taglib/mutable-tag.d.ts.map +1 -0
  228. package/dist/taglib/mutable-tag.js +1 -0
  229. package/dist/taglib/save-reconstruct.d.ts.map +1 -0
  230. package/dist/taglib/save-reconstruct.js +53 -0
  231. package/dist/taglib/taglib-class.d.ts.map +1 -0
  232. package/dist/taglib/taglib-class.js +146 -0
  233. package/dist/taglib-wasi.wasm +0 -0
  234. package/dist/taglib.d.ts.map +1 -0
  235. package/dist/taglib.js +7 -0
  236. package/dist/{src/types → types}/audio-formats.d.ts +5 -1
  237. package/dist/types/audio-formats.d.ts.map +1 -0
  238. package/dist/types/audio-formats.js +6 -0
  239. package/dist/types/bwf.d.ts.map +1 -0
  240. package/dist/types/bwf.js +1 -0
  241. package/dist/types/chapters.d.ts.map +1 -0
  242. package/dist/types/chapters.js +1 -0
  243. package/dist/types/config.d.ts.map +1 -0
  244. package/dist/types/config.js +1 -0
  245. package/dist/types/format-property-keys.d.ts.map +1 -0
  246. package/dist/types/format-property-keys.js +1 -0
  247. package/dist/types/index.d.ts.map +1 -0
  248. package/dist/types/index.js +9 -0
  249. package/dist/types/metadata-mappings.d.ts.map +1 -0
  250. package/dist/types/metadata-mappings.js +323 -0
  251. package/dist/types/pictures.d.ts.map +1 -0
  252. package/dist/types/pictures.js +79 -0
  253. package/dist/types/tags.d.ts.map +1 -0
  254. package/dist/types/tags.js +1 -0
  255. package/dist/types.d.ts.map +1 -0
  256. package/dist/types.js +5 -0
  257. package/dist/utils/file.d.ts.map +1 -0
  258. package/dist/utils/file.js +43 -0
  259. package/dist/utils/mirror-fields.d.ts.map +1 -0
  260. package/dist/utils/mirror-fields.js +107 -0
  261. package/dist/utils/node-fs.d.ts.map +1 -0
  262. package/dist/utils/node-fs.js +36 -0
  263. package/dist/utils/path.d.ts.map +1 -0
  264. package/dist/utils/path.js +52 -0
  265. package/dist/utils/rating.d.ts.map +1 -0
  266. package/dist/utils/rating.js +150 -0
  267. package/dist/utils/tag-mapping.d.ts.map +1 -0
  268. package/dist/utils/tag-mapping.js +207 -0
  269. package/dist/utils/write.d.ts.map +1 -0
  270. package/dist/utils/write.js +18 -0
  271. package/dist/version.d.ts +2 -0
  272. package/dist/version.d.ts.map +1 -0
  273. package/dist/version.js +4 -0
  274. package/dist/wasm.d.ts.map +1 -0
  275. package/dist/wasm.js +1 -0
  276. package/dist/web-utils/canvas.d.ts.map +1 -0
  277. package/dist/web-utils/canvas.js +97 -0
  278. package/dist/web-utils/data-url.d.ts.map +1 -0
  279. package/dist/web-utils/data-url.js +54 -0
  280. package/dist/web-utils/dom-integration.d.ts.map +1 -0
  281. package/dist/web-utils/dom-integration.js +105 -0
  282. package/dist/web-utils/index.d.ts.map +1 -0
  283. package/dist/web-utils/index.js +4 -0
  284. package/dist/web.browser.d.ts +5 -5
  285. package/dist/web.browser.d.ts.map +1 -1
  286. package/dist/web.browser.js +3169 -3411
  287. package/dist/web.d.ts +1 -1
  288. package/dist/web.d.ts.map +1 -1
  289. package/dist/web.js +5 -2
  290. package/package.json +136 -100
  291. package/dist/src/bwf/bext.d.ts.map +0 -1
  292. package/dist/src/bwf/bext.js +0 -126
  293. package/dist/src/constants/additional-properties.js +0 -204
  294. package/dist/src/constants/basic-properties.d.ts.map +0 -1
  295. package/dist/src/constants/basic-properties.js +0 -89
  296. package/dist/src/constants/complex-properties.d.ts.map +0 -1
  297. package/dist/src/constants/complex-properties.js +0 -0
  298. package/dist/src/constants/format-mappings.d.ts.map +0 -1
  299. package/dist/src/constants/format-mappings.js +0 -54
  300. package/dist/src/constants/general-extended-properties.js +0 -254
  301. package/dist/src/constants/index.d.ts.map +0 -1
  302. package/dist/src/constants/index.js +0 -4
  303. package/dist/src/constants/properties.d.ts +0 -877
  304. package/dist/src/constants/properties.d.ts.map +0 -1
  305. package/dist/src/constants/properties.js +0 -95
  306. package/dist/src/constants/property-types.d.ts.map +0 -1
  307. package/dist/src/constants/property-types.js +0 -0
  308. package/dist/src/constants/specialized-properties.js +0 -223
  309. package/dist/src/constants/utilities.d.ts.map +0 -1
  310. package/dist/src/constants/utilities.js +0 -33
  311. package/dist/src/constants.d.ts.map +0 -1
  312. package/dist/src/constants.js +0 -1
  313. package/dist/src/deno-compile.d.ts.map +0 -1
  314. package/dist/src/deno-compile.js +0 -75
  315. package/dist/src/errors/base.d.ts.map +0 -1
  316. package/dist/src/errors/base.js +0 -49
  317. package/dist/src/errors/classes.d.ts.map +0 -1
  318. package/dist/src/errors/classes.js +0 -170
  319. package/dist/src/errors/guards.d.ts.map +0 -1
  320. package/dist/src/errors/guards.js +0 -39
  321. package/dist/src/errors/index.d.ts.map +0 -1
  322. package/dist/src/errors/index.js +0 -39
  323. package/dist/src/errors.d.ts.map +0 -1
  324. package/dist/src/errors.js +0 -1
  325. package/dist/src/file-utils/copy-and-find.d.ts.map +0 -1
  326. package/dist/src/file-utils/copy-and-find.js +0 -89
  327. package/dist/src/file-utils/export-operations.d.ts.map +0 -1
  328. package/dist/src/file-utils/export-operations.js +0 -40
  329. package/dist/src/file-utils/import-operations.d.ts.map +0 -1
  330. package/dist/src/file-utils/import-operations.js +0 -42
  331. package/dist/src/file-utils/index.d.ts.map +0 -1
  332. package/dist/src/file-utils/index.js +0 -26
  333. package/dist/src/file-utils/mime-detection.d.ts.map +0 -1
  334. package/dist/src/file-utils/mime-detection.js +0 -45
  335. package/dist/src/folder-api/album-corroborate.d.ts.map +0 -1
  336. package/dist/src/folder-api/album-corroborate.js +0 -36
  337. package/dist/src/folder-api/album-discs.d.ts.map +0 -1
  338. package/dist/src/folder-api/album-discs.js +0 -122
  339. package/dist/src/folder-api/album-grouping.d.ts.map +0 -1
  340. package/dist/src/folder-api/album-grouping.js +0 -118
  341. package/dist/src/folder-api/album-identity.d.ts.map +0 -1
  342. package/dist/src/folder-api/album-identity.js +0 -151
  343. package/dist/src/folder-api/album-types.d.ts.map +0 -1
  344. package/dist/src/folder-api/album-types.js +0 -0
  345. package/dist/src/folder-api/directory-walker.d.ts.map +0 -1
  346. package/dist/src/folder-api/directory-walker.js +0 -35
  347. package/dist/src/folder-api/file-processors.d.ts.map +0 -1
  348. package/dist/src/folder-api/file-processors.js +0 -63
  349. package/dist/src/folder-api/folder-disc.d.ts.map +0 -1
  350. package/dist/src/folder-api/folder-disc.js +0 -169
  351. package/dist/src/folder-api/folder-operations.d.ts.map +0 -1
  352. package/dist/src/folder-api/folder-operations.js +0 -54
  353. package/dist/src/folder-api/index.d.ts.map +0 -1
  354. package/dist/src/folder-api/scan-for-albums.d.ts.map +0 -1
  355. package/dist/src/folder-api/scan-for-albums.js +0 -20
  356. package/dist/src/folder-api/scan-operations.d.ts.map +0 -1
  357. package/dist/src/folder-api/scan-operations.js +0 -77
  358. package/dist/src/folder-api/types.d.ts.map +0 -1
  359. package/dist/src/folder-api/types.js +0 -21
  360. package/dist/src/msgpack/decoder.d.ts.map +0 -1
  361. package/dist/src/msgpack/decoder.js +0 -215
  362. package/dist/src/msgpack/encoder.d.ts.map +0 -1
  363. package/dist/src/msgpack/encoder.js +0 -249
  364. package/dist/src/msgpack/index.d.ts.map +0 -1
  365. package/dist/src/msgpack/index.js +0 -56
  366. package/dist/src/msgpack/types.d.ts.map +0 -1
  367. package/dist/src/msgpack/types.js +0 -12
  368. package/dist/src/msgpack/utils.d.ts.map +0 -1
  369. package/dist/src/msgpack/utils.js +0 -134
  370. package/dist/src/runtime/deno-detect.d.ts +0 -8
  371. package/dist/src/runtime/deno-detect.d.ts.map +0 -1
  372. package/dist/src/runtime/deno-detect.js +0 -6
  373. package/dist/src/runtime/detector.d.ts.map +0 -1
  374. package/dist/src/runtime/detector.js +0 -181
  375. package/dist/src/runtime/loader-types.d.ts.map +0 -1
  376. package/dist/src/runtime/loader-types.js +0 -10
  377. package/dist/src/runtime/module-loader-browser.d.ts.map +0 -1
  378. package/dist/src/runtime/module-loader-browser.js +0 -37
  379. package/dist/src/runtime/module-loader.d.ts.map +0 -1
  380. package/dist/src/runtime/module-loader.js +0 -119
  381. package/dist/src/runtime/platform-io.d.ts.map +0 -1
  382. package/dist/src/runtime/platform-io.js +0 -188
  383. package/dist/src/runtime/unified-loader/index.d.ts.map +0 -1
  384. package/dist/src/runtime/unified-loader/loader.d.ts.map +0 -1
  385. package/dist/src/runtime/unified-loader/loader.js +0 -84
  386. package/dist/src/runtime/unified-loader/module-loading.d.ts.map +0 -1
  387. package/dist/src/runtime/unified-loader/module-loading.js +0 -122
  388. package/dist/src/runtime/unified-loader/module-selection.d.ts.map +0 -1
  389. package/dist/src/runtime/unified-loader/module-selection.js +0 -41
  390. package/dist/src/runtime/unified-loader/types.d.ts.map +0 -1
  391. package/dist/src/runtime/unified-loader/types.js +0 -25
  392. package/dist/src/runtime/wasi-adapter/adapter.d.ts.map +0 -1
  393. package/dist/src/runtime/wasi-adapter/adapter.js +0 -130
  394. package/dist/src/runtime/wasi-adapter/audio-properties.d.ts.map +0 -1
  395. package/dist/src/runtime/wasi-adapter/audio-properties.js +0 -102
  396. package/dist/src/runtime/wasi-adapter/file-handle.d.ts.map +0 -1
  397. package/dist/src/runtime/wasi-adapter/file-handle.js +0 -197
  398. package/dist/src/runtime/wasi-adapter/handle-state.d.ts.map +0 -1
  399. package/dist/src/runtime/wasi-adapter/handle-state.js +0 -58
  400. package/dist/src/runtime/wasi-adapter/index.d.ts.map +0 -1
  401. package/dist/src/runtime/wasi-adapter/mp4-items.d.ts.map +0 -1
  402. package/dist/src/runtime/wasi-adapter/mp4-items.js +0 -80
  403. package/dist/src/runtime/wasi-adapter/path-open.d.ts.map +0 -1
  404. package/dist/src/runtime/wasi-adapter/path-open.js +0 -76
  405. package/dist/src/runtime/wasi-adapter/property-surface.d.ts.map +0 -1
  406. package/dist/src/runtime/wasi-adapter/property-surface.js +0 -104
  407. package/dist/src/runtime/wasi-adapter/structured-fields.d.ts.map +0 -1
  408. package/dist/src/runtime/wasi-adapter/structured-fields.js +0 -139
  409. package/dist/src/runtime/wasi-adapter/tag-keys.d.ts.map +0 -1
  410. package/dist/src/runtime/wasi-adapter/tag-keys.js +0 -46
  411. package/dist/src/runtime/wasi-adapter/wasm-io.d.ts.map +0 -1
  412. package/dist/src/runtime/wasi-adapter/wasm-io.js +0 -257
  413. package/dist/src/runtime/wasi-fs-deno.d.ts.map +0 -1
  414. package/dist/src/runtime/wasi-fs-deno.js +0 -26
  415. package/dist/src/runtime/wasi-fs-node.d.ts.map +0 -1
  416. package/dist/src/runtime/wasi-fs-node.js +0 -66
  417. package/dist/src/runtime/wasi-fs-provider.d.ts.map +0 -1
  418. package/dist/src/runtime/wasi-fs-provider.js +0 -0
  419. package/dist/src/runtime/wasi-host-loader.d.ts.map +0 -1
  420. package/dist/src/runtime/wasi-host-loader.js +0 -114
  421. package/dist/src/runtime/wasi-host.d.ts.map +0 -1
  422. package/dist/src/runtime/wasi-host.js +0 -202
  423. package/dist/src/runtime/wasi-memory.d.ts.map +0 -1
  424. package/dist/src/runtime/wasi-memory.js +0 -197
  425. package/dist/src/runtime/wasmer-sdk-loader/types.d.ts.map +0 -1
  426. package/dist/src/runtime/wasmer-sdk-loader/types.js +0 -12
  427. package/dist/src/simple/batch-operations.d.ts.map +0 -1
  428. package/dist/src/simple/batch-operations.js +0 -186
  429. package/dist/src/simple/checksum-operations.d.ts.map +0 -1
  430. package/dist/src/simple/checksum-operations.js +0 -7
  431. package/dist/src/simple/config.d.ts.map +0 -1
  432. package/dist/src/simple/config.js +0 -18
  433. package/dist/src/simple/index.d.ts.map +0 -1
  434. package/dist/src/simple/index.js +0 -60
  435. package/dist/src/simple/picture-operations.d.ts.map +0 -1
  436. package/dist/src/simple/picture-operations.js +0 -68
  437. package/dist/src/simple/tag-operations.d.ts.map +0 -1
  438. package/dist/src/simple/tag-operations.js +0 -90
  439. package/dist/src/simple/with-audio-file.d.ts.map +0 -1
  440. package/dist/src/simple/with-audio-file.js +0 -39
  441. package/dist/src/taglib/audio-file-base.d.ts.map +0 -1
  442. package/dist/src/taglib/audio-file-base.js +0 -187
  443. package/dist/src/taglib/audio-file-bwf.d.ts.map +0 -1
  444. package/dist/src/taglib/audio-file-bwf.js +0 -41
  445. package/dist/src/taglib/audio-file-checksum.d.ts.map +0 -1
  446. package/dist/src/taglib/audio-file-checksum.js +0 -77
  447. package/dist/src/taglib/audio-file-impl.d.ts.map +0 -1
  448. package/dist/src/taglib/audio-file-impl.js +0 -317
  449. package/dist/src/taglib/audio-file-interface.d.ts.map +0 -1
  450. package/dist/src/taglib/audio-file-interface.js +0 -0
  451. package/dist/src/taglib/auto-dispose.d.ts.map +0 -1
  452. package/dist/src/taglib/auto-dispose.js +0 -13
  453. package/dist/src/taglib/embind-adapter.d.ts.map +0 -1
  454. package/dist/src/taglib/embind-adapter.js +0 -141
  455. package/dist/src/taglib/extra-state-registry.d.ts.map +0 -1
  456. package/dist/src/taglib/extra-state-registry.js +0 -78
  457. package/dist/src/taglib/id3v2-frames.d.ts.map +0 -1
  458. package/dist/src/taglib/id3v2-frames.js +0 -42
  459. package/dist/src/taglib/index.d.ts.map +0 -1
  460. package/dist/src/taglib/index.js +0 -41
  461. package/dist/src/taglib/load-audio-data.d.ts.map +0 -1
  462. package/dist/src/taglib/load-audio-data.js +0 -51
  463. package/dist/src/taglib/media-ranges.d.ts.map +0 -1
  464. package/dist/src/taglib/media-ranges.js +0 -192
  465. package/dist/src/taglib/metadata-extent.d.ts.map +0 -1
  466. package/dist/src/taglib/metadata-extent.js +0 -189
  467. package/dist/src/taglib/mp4-item-names.d.ts.map +0 -1
  468. package/dist/src/taglib/mp4-item-names.js +0 -4
  469. package/dist/src/taglib/mutable-tag-impl.d.ts.map +0 -1
  470. package/dist/src/taglib/mutable-tag-impl.js +0 -88
  471. package/dist/src/taglib/mutable-tag.d.ts.map +0 -1
  472. package/dist/src/taglib/mutable-tag.js +0 -0
  473. package/dist/src/taglib/save-reconstruct.d.ts.map +0 -1
  474. package/dist/src/taglib/save-reconstruct.js +0 -43
  475. package/dist/src/taglib/taglib-class.d.ts.map +0 -1
  476. package/dist/src/taglib/taglib-class.js +0 -195
  477. package/dist/src/taglib.d.ts.map +0 -1
  478. package/dist/src/taglib.js +0 -1
  479. package/dist/src/types/audio-formats.d.ts.map +0 -1
  480. package/dist/src/types/audio-formats.js +0 -6
  481. package/dist/src/types/bwf.d.ts.map +0 -1
  482. package/dist/src/types/bwf.js +0 -0
  483. package/dist/src/types/chapters.d.ts.map +0 -1
  484. package/dist/src/types/chapters.js +0 -0
  485. package/dist/src/types/config.d.ts.map +0 -1
  486. package/dist/src/types/config.js +0 -0
  487. package/dist/src/types/format-property-keys.d.ts.map +0 -1
  488. package/dist/src/types/format-property-keys.js +0 -0
  489. package/dist/src/types/index.d.ts.map +0 -1
  490. package/dist/src/types/index.js +0 -8
  491. package/dist/src/types/metadata-mappings.d.ts.map +0 -1
  492. package/dist/src/types/metadata-mappings.js +0 -252
  493. package/dist/src/types/pictures.d.ts.map +0 -1
  494. package/dist/src/types/pictures.js +0 -64
  495. package/dist/src/types/tags.d.ts.map +0 -1
  496. package/dist/src/types/tags.js +0 -0
  497. package/dist/src/types.d.ts.map +0 -1
  498. package/dist/src/types.js +0 -1
  499. package/dist/src/utils/file.d.ts.map +0 -1
  500. package/dist/src/utils/file.js +0 -52
  501. package/dist/src/utils/mirror-fields.d.ts.map +0 -1
  502. package/dist/src/utils/mirror-fields.js +0 -75
  503. package/dist/src/utils/node-fs.d.ts.map +0 -1
  504. package/dist/src/utils/node-fs.js +0 -22
  505. package/dist/src/utils/path.d.ts.map +0 -1
  506. package/dist/src/utils/path.js +0 -36
  507. package/dist/src/utils/rating.d.ts.map +0 -1
  508. package/dist/src/utils/rating.js +0 -73
  509. package/dist/src/utils/tag-mapping.d.ts.map +0 -1
  510. package/dist/src/utils/tag-mapping.js +0 -214
  511. package/dist/src/utils/write.d.ts.map +0 -1
  512. package/dist/src/utils/write.js +0 -17
  513. package/dist/src/version.d.ts +0 -2
  514. package/dist/src/version.d.ts.map +0 -1
  515. package/dist/src/version.js +0 -4
  516. package/dist/src/wasm.d.ts.map +0 -1
  517. package/dist/src/wasm.js +0 -0
  518. package/dist/src/web-utils/canvas.d.ts.map +0 -1
  519. package/dist/src/web-utils/canvas.js +0 -60
  520. package/dist/src/web-utils/data-url.d.ts.map +0 -1
  521. package/dist/src/web-utils/data-url.js +0 -34
  522. package/dist/src/web-utils/dom-integration.d.ts.map +0 -1
  523. package/dist/src/web-utils/dom-integration.js +0 -53
  524. package/dist/src/web-utils/index.d.ts.map +0 -1
  525. package/dist/src/web-utils/index.js +0 -21
  526. /package/dist/{src/bwf → bwf}/bext.d.ts +0 -0
  527. /package/dist/{src/constants → constants}/additional-properties.d.ts +0 -0
  528. /package/dist/{src/constants → constants}/basic-properties.d.ts +0 -0
  529. /package/dist/{src/constants → constants}/complex-properties.d.ts +0 -0
  530. /package/dist/{src/constants → constants}/format-mappings.d.ts +0 -0
  531. /package/dist/{src/constants → constants}/general-extended-properties.d.ts +0 -0
  532. /package/dist/{src/constants → constants}/index.d.ts +0 -0
  533. /package/dist/{src/constants → constants}/property-types.d.ts +0 -0
  534. /package/dist/{src/constants → constants}/specialized-properties.d.ts +0 -0
  535. /package/dist/{src/constants.d.ts → constants.d.ts} +0 -0
  536. /package/dist/{src/errors → errors}/base.d.ts +0 -0
  537. /package/dist/{src/errors → errors}/classes.d.ts +0 -0
  538. /package/dist/{src/errors → errors}/guards.d.ts +0 -0
  539. /package/dist/{src/errors → errors}/index.d.ts +0 -0
  540. /package/dist/{src/errors.d.ts → errors.d.ts} +0 -0
  541. /package/dist/{src/file-utils → file-utils}/copy-and-find.d.ts +0 -0
  542. /package/dist/{src/file-utils → file-utils}/export-operations.d.ts +0 -0
  543. /package/dist/{src/file-utils → file-utils}/import-operations.d.ts +0 -0
  544. /package/dist/{src/file-utils → file-utils}/index.d.ts +0 -0
  545. /package/dist/{src/file-utils → file-utils}/mime-detection.d.ts +0 -0
  546. /package/dist/{src/folder-api → folder-api}/album-corroborate.d.ts +0 -0
  547. /package/dist/{src/folder-api → folder-api}/album-discs.d.ts +0 -0
  548. /package/dist/{src/folder-api → folder-api}/album-grouping.d.ts +0 -0
  549. /package/dist/{src/folder-api → folder-api}/album-identity.d.ts +0 -0
  550. /package/dist/{src/folder-api → folder-api}/album-types.d.ts +0 -0
  551. /package/dist/{src/folder-api → folder-api}/directory-walker.d.ts +0 -0
  552. /package/dist/{src/folder-api → folder-api}/file-processors.d.ts +0 -0
  553. /package/dist/{src/folder-api → folder-api}/folder-disc.d.ts +0 -0
  554. /package/dist/{src/folder-api → folder-api}/folder-operations.d.ts +0 -0
  555. /package/dist/{src/folder-api → folder-api}/index.d.ts +0 -0
  556. /package/dist/{src/folder-api → folder-api}/scan-for-albums.d.ts +0 -0
  557. /package/dist/{src/folder-api → folder-api}/scan-operations.d.ts +0 -0
  558. /package/dist/{src/folder-api → folder-api}/types.d.ts +0 -0
  559. /package/dist/{src/msgpack → msgpack}/decoder.d.ts +0 -0
  560. /package/dist/{src/msgpack → msgpack}/encoder.d.ts +0 -0
  561. /package/dist/{src/msgpack → msgpack}/index.d.ts +0 -0
  562. /package/dist/{src/msgpack → msgpack}/utils.d.ts +0 -0
  563. /package/dist/{src/runtime → runtime}/loader-types.d.ts +0 -0
  564. /package/dist/{src/runtime → runtime}/module-loader-browser.d.ts +0 -0
  565. /package/dist/{src/runtime → runtime}/module-loader.d.ts +0 -0
  566. /package/dist/{src/runtime → runtime}/platform-io.d.ts +0 -0
  567. /package/dist/{src/runtime → runtime}/unified-loader/index.d.ts +0 -0
  568. /package/dist/{src/runtime → runtime}/unified-loader/loader.d.ts +0 -0
  569. /package/dist/{src/runtime → runtime}/unified-loader/module-loading.d.ts +0 -0
  570. /package/dist/{src/runtime → runtime}/unified-loader/module-selection.d.ts +0 -0
  571. /package/dist/{src/runtime → runtime}/unified-loader/types.d.ts +0 -0
  572. /package/dist/{src/runtime → runtime}/wasi-adapter/adapter.d.ts +0 -0
  573. /package/dist/{src/runtime → runtime}/wasi-adapter/audio-properties.d.ts +0 -0
  574. /package/dist/{src/runtime → runtime}/wasi-adapter/file-handle.d.ts +0 -0
  575. /package/dist/{src/runtime → runtime}/wasi-adapter/handle-state.d.ts +0 -0
  576. /package/dist/{src/runtime → runtime}/wasi-adapter/index.d.ts +0 -0
  577. /package/dist/{src/runtime → runtime}/wasi-adapter/mp4-items.d.ts +0 -0
  578. /package/dist/{src/runtime → runtime}/wasi-adapter/path-open.d.ts +0 -0
  579. /package/dist/{src/runtime → runtime}/wasi-adapter/property-surface.d.ts +0 -0
  580. /package/dist/{src/runtime → runtime}/wasi-adapter/structured-fields.d.ts +0 -0
  581. /package/dist/{src/runtime → runtime}/wasi-adapter/tag-keys.d.ts +0 -0
  582. /package/dist/{src/runtime → runtime}/wasi-adapter/wasm-io.d.ts +0 -0
  583. /package/dist/{src/runtime → runtime}/wasi-fs-deno.d.ts +0 -0
  584. /package/dist/{src/runtime → runtime}/wasi-fs-node.d.ts +0 -0
  585. /package/dist/{src/runtime → runtime}/wasi-fs-provider.d.ts +0 -0
  586. /package/dist/{src/runtime → runtime}/wasi-host-loader.d.ts +0 -0
  587. /package/dist/{src/runtime → runtime}/wasi-host.d.ts +0 -0
  588. /package/dist/{src/runtime → runtime}/wasi-memory.d.ts +0 -0
  589. /package/dist/{src/runtime → runtime}/wasmer-sdk-loader/types.d.ts +0 -0
  590. /package/dist/{src/simple → simple}/batch-operations.d.ts +0 -0
  591. /package/dist/{src/simple → simple}/checksum-operations.d.ts +0 -0
  592. /package/dist/{src/simple → simple}/config.d.ts +0 -0
  593. /package/dist/{src/simple → simple}/index.d.ts +0 -0
  594. /package/dist/{src/simple → simple}/picture-operations.d.ts +0 -0
  595. /package/dist/{src/simple → simple}/tag-operations.d.ts +0 -0
  596. /package/dist/{src/simple → simple}/with-audio-file.d.ts +0 -0
  597. /package/dist/{src/taglib → taglib}/audio-file-base.d.ts +0 -0
  598. /package/dist/{src/taglib → taglib}/audio-file-bwf.d.ts +0 -0
  599. /package/dist/{src/taglib → taglib}/audio-file-checksum.d.ts +0 -0
  600. /package/dist/{src/taglib → taglib}/audio-file-impl.d.ts +0 -0
  601. /package/dist/{src/taglib → taglib}/audio-file-interface.d.ts +0 -0
  602. /package/dist/{src/taglib → taglib}/auto-dispose.d.ts +0 -0
  603. /package/dist/{src/taglib → taglib}/embind-adapter.d.ts +0 -0
  604. /package/dist/{src/taglib → taglib}/extra-state-registry.d.ts +0 -0
  605. /package/dist/{src/taglib → taglib}/index.d.ts +0 -0
  606. /package/dist/{src/taglib → taglib}/load-audio-data.d.ts +0 -0
  607. /package/dist/{src/taglib → taglib}/media-ranges.d.ts +0 -0
  608. /package/dist/{src/taglib → taglib}/metadata-extent.d.ts +0 -0
  609. /package/dist/{src/taglib → taglib}/mp4-item-names.d.ts +0 -0
  610. /package/dist/{src/taglib → taglib}/mutable-tag-impl.d.ts +0 -0
  611. /package/dist/{src/taglib → taglib}/mutable-tag.d.ts +0 -0
  612. /package/dist/{src/taglib → taglib}/save-reconstruct.d.ts +0 -0
  613. /package/dist/{src/taglib → taglib}/taglib-class.d.ts +0 -0
  614. /package/dist/{src/taglib.d.ts → taglib.d.ts} +0 -0
  615. /package/dist/{src/types → types}/bwf.d.ts +0 -0
  616. /package/dist/{src/types → types}/chapters.d.ts +0 -0
  617. /package/dist/{src/types → types}/config.d.ts +0 -0
  618. /package/dist/{src/types → types}/format-property-keys.d.ts +0 -0
  619. /package/dist/{src/types → types}/index.d.ts +0 -0
  620. /package/dist/{src/types → types}/metadata-mappings.d.ts +0 -0
  621. /package/dist/{src/types → types}/pictures.d.ts +0 -0
  622. /package/dist/{src/types → types}/tags.d.ts +0 -0
  623. /package/dist/{src/types.d.ts → types.d.ts} +0 -0
  624. /package/dist/{src/utils → utils}/file.d.ts +0 -0
  625. /package/dist/{src/utils → utils}/mirror-fields.d.ts +0 -0
  626. /package/dist/{src/utils → utils}/node-fs.d.ts +0 -0
  627. /package/dist/{src/utils → utils}/path.d.ts +0 -0
  628. /package/dist/{src/utils → utils}/rating.d.ts +0 -0
  629. /package/dist/{src/utils → utils}/tag-mapping.d.ts +0 -0
  630. /package/dist/{src/utils → utils}/write.d.ts +0 -0
  631. /package/dist/{src/wasm.d.ts → wasm.d.ts} +0 -0
  632. /package/dist/{src/web-utils → web-utils}/canvas.d.ts +0 -0
  633. /package/dist/{src/web-utils → web-utils}/data-url.d.ts +0 -0
  634. /package/dist/{src/web-utils → web-utils}/dom-integration.d.ts +0 -0
  635. /package/dist/{src/web-utils → web-utils}/index.d.ts +0 -0
package/LICENSE CHANGED
@@ -41,8 +41,8 @@ The WebAssembly binaries are subject to LGPL requirements. This means:
41
41
 
42
42
  To rebuild the WebAssembly binaries with a modified TagLib:
43
43
  1. Modify the TagLib source in lib/taglib/
44
- 2. Run: npm run build:wasm (builds both backends; requires the
45
- Emscripten SDK and WASI SDK 34 — see CONTRIBUTING.md)
44
+ 2. Run: pnpm run build:wasm (builds both backends; requires the
45
+ Emscripten SDK and WASI SDK 34 — see .github/CONTRIBUTING.md)
46
46
  3. The new binaries will be in build/taglib-web.wasm and
47
47
  build/taglib-wasi.wasm
48
48
 
package/README.md CHANGED
@@ -59,8 +59,12 @@ npm install taglib-wasm
59
59
 
60
60
  ### Deno
61
61
 
62
+ Deno installs from JSR or from npm:
63
+
62
64
  ```typescript
63
- import { TagLib } from "@charlesw/taglib-wasm";
65
+ import { TagLib } from "jsr:@charlesw/taglib-wasm"; // JSR
66
+ // or
67
+ import { TagLib } from "npm:taglib-wasm"; // npm
64
68
  ```
65
69
 
66
70
  ### Bun
@@ -93,11 +97,11 @@ file:
93
97
 
94
98
  ```typescript
95
99
  // 1. Prepare your build by copying the WASM file
96
- import { prepareWasmForEmbedding } from "@charlesw/taglib-wasm";
100
+ import { prepareWasmForEmbedding } from "npm:taglib-wasm";
97
101
  await prepareWasmForEmbedding("./taglib-web.wasm");
98
102
 
99
103
  // 2. In your application, use the helper for automatic handling
100
- import { initializeForDenoCompile } from "@charlesw/taglib-wasm";
104
+ import { initializeForDenoCompile } from "npm:taglib-wasm";
101
105
  const taglib = await initializeForDenoCompile();
102
106
 
103
107
  // 3. Compile with the embedded WASM
@@ -132,8 +136,9 @@ path or URL instead — use `wasmUrl` with it.
132
136
 
133
137
  ## Quick Start
134
138
 
135
- > **Import paths:** Deno uses `@charlesw/taglib-wasm`, npm uses `taglib-wasm`.
136
- > Examples below use npm paths — substitute accordingly.
139
+ > **Import paths:** all runtimes use the npm package `taglib-wasm`; Deno can
140
+ > also install from JSR (`jsr:@charlesw/taglib-wasm`). Both are published for
141
+ > every release.
137
142
 
138
143
  ### Simple API
139
144
 
@@ -463,7 +468,7 @@ Supported formats:
463
468
  - [Broadcast Metadata (BWF bext / iXML)](https://charleswiltgen.github.io/TagLib-Wasm/guide/broadcast-metadata.html)
464
469
  - [Cloudflare Workers](https://charleswiltgen.github.io/TagLib-Wasm/advanced/cloudflare-workers.html)
465
470
  - [Error Handling](https://charleswiltgen.github.io/TagLib-Wasm/concepts/error-handling.html)
466
- - [Contributing](CONTRIBUTING.md)
471
+ - [Contributing](.github/CONTRIBUTING.md)
467
472
  - [AI Agent Documentation](AGENTS.md)
468
473
 
469
474
  ## Supported Formats
@@ -563,38 +568,41 @@ Partial loading (`{ partial: true }`) works on both paths; see the
563
568
  ### Bundle Size and Tree-Shaking
564
569
 
565
570
  Importing the barrel (`taglib-wasm`) does **not** pull in the Folder or Web API:
566
- every bundler tested here tree-shakes to leaf granularity. Measured on
567
- taglib-wasm 2.2.3 installed from a packed tarball (`npm pack` →
568
- `npm install <tarball>`), minified ES2022 ESM bundles on Node 24.21.0. Figures
569
- are minified JavaScript bytes — the ~700 KB Wasm binary is loaded at runtime and
570
- is not part of the bundle in any scenario below. The `./web` figures further down
571
- were re-measured with the same invocations after that subpath gained a `browser`
572
- condition.
571
+ every bundler tested here tree-shakes to leaf granularity. Measured from a packed
572
+ tarball of this repository's build (`npm pack` → `npm install <tarball>`),
573
+ minified ES2022 ESM bundles on Node 24.21.0 with esbuild 0.28.2, rollup 4.63.3,
574
+ vite 8.3.0 and webpack 5.111.1. Figures are minified JavaScript bytes — the
575
+ ~700 KB Wasm binary is loaded at runtime and is not part of the bundle in any
576
+ scenario below.
573
577
 
574
578
  Each row is a one-file app whose whole body is that import plus the call the row
575
579
  names, keeping the imported function reachable (`globalThis.__app = { … }`).
576
- Exact invocations, so the table can be reproduced:
580
+ Where a build splits its output into several files, the figure is the total of
581
+ every JavaScript chunk it emits. Exact invocations, so the table can be
582
+ reproduced:
577
583
 
578
584
  - **esbuild 0.28.2** — `esbuild <app> --bundle --minify --format=esm
579
- --target=es2022 --platform=browser --external:module` for the browser column;
580
- the same with `--platform=node` and no `--external` for the Node column.
581
- (`--external` takes a colon, not `=`.)
585
+ --target=es2022 --platform=browser --external:node:module` for the browser
586
+ column; the same with `--platform=node` and no `--external` for the Node
587
+ column. The `--external` matches the dynamic `import("node:module")` in
588
+ `dist/taglib-wrapper.js`. (`--external` takes a colon, not `=`.)
582
589
  - **rollup 4.63.3** — `input: <app>`, plugins `@rollup/plugin-node-resolve`
583
590
  (`{ browser: true, exportConditions: ["browser", "default"] }` for the browser
584
591
  column, default options for the Node column) and `@rollup/plugin-terser`,
585
592
  output `{ format: "esm", inlineDynamicImports: true }`.
586
593
  - **vite 8.3.0** — a real app build: `index.html` plus a
587
594
  `<script type="module">` pointing at the entry, `build.minify: "esbuild"`,
588
- `target: "es2022"`. Vite builds for the browser.
595
+ `target: "es2022"`. Vite builds for the browser; the figures below that name
596
+ the `node` condition instead add `resolve.conditions: ["node"]`.
589
597
  - **webpack 5.111.1** — `mode: "production"`, `target: "web"`,
590
598
  `externals: { module: "module" }`. `target: "web"` alone fails on the
591
- `import("module")` inside `dist/taglib-wrapper.js`.
599
+ `import("node:module")` inside `dist/taglib-wrapper.js`.
592
600
 
593
601
  | Consumer app | esbuild (browser)¹ | rollup (browser)¹ | vite (app) | webpack (web)² | esbuild (Node)³ | rollup (Node)³ |
594
602
  | ------------------------------------- | ------------------ | ----------------- | ---------- | -------------- | --------------- | -------------- |
595
- | `taglib-wasm` — `TagLib.initialize()` | 81,991 | 78,374 | 84,802 | 57,141 | 145,056 | 134,312 |
596
- | `taglib-wasm/simple` — `getTagLib()` | 81,279 | 78,495 | 84,094 | 57,260 | 146,047 | 134,713 |
597
- | `taglib-wasm/folder` — `scanFolder`⁴ | — | 138,075⁴ | 146,094⁴ | — | 149,396 | 138,075 |
603
+ | `taglib-wasm` — `TagLib.initialize()` | 79,826 | 77,058 | 82,778 | 80,736 | 143,600 | 133,060 |
604
+ | `taglib-wasm/simple` — `getTagLib()` | 79,548 | 77,316 | 82,512 | 81,554 | 144,602 | 133,431 |
605
+ | `taglib-wasm/folder` — `scanFolder`⁴ | — | 136,822⁴ | 145,895⁴ | — | 147,942 | 136,822 |
598
606
 
599
607
  ¹ the `browser` `exports` condition. ² `target: "web"`. ³ the Node `exports`
600
608
  condition. ⁴ Node-only entry — see below.
@@ -603,28 +611,29 @@ condition. ⁴ Node-only entry — see below.
603
611
  because `scanFolder` and friends read and write a filesystem, so a
604
612
  browser-targeted build resolves the Node-oriented graph and fails: esbuild
605
613
  `--platform=browser` reports `Could not resolve "node:fs/promises"`, and webpack
606
- `target: "web"` fails with four errors (`./taglib-web.wasm`, `node:fs`,
607
- `node:fs/promises`, `node:buffer`). That outcome is the design: a build error
608
- beats a stub that throws on the first call in production. If the same cells were
609
- reachable they would come from shimming Node builtins into a bundle that cannot
610
- work — which is exactly what vite and rollup did before the condition was
611
- declared. `./rating` and `./disc-folder` are pure JavaScript and build for
612
- either target. In a browser, scan on a server and post the result; the pure
614
+ `target: "web"` fails with three errors (`node:buffer`, `node:fs/promises`,
615
+ `node:fs`). That outcome is the design: a build error beats a stub that throws
616
+ on the first call in production. If the same cells were reachable they would
617
+ come from shimming Node builtins into a bundle that cannot work — which is
618
+ exactly what vite and rollup did before the condition was declared. `./rating`
619
+ and `./disc-folder` are pure JavaScript and build for either target. In a
620
+ browser, scan on a server and post the result; the pure
613
621
  `groupAlbums` / `discFolderInfo` half is exported from `taglib-wasm` and
614
622
  `taglib-wasm/disc-folder` and runs anywhere.
615
623
 
616
624
  **`./web` builds for the browser.** It declares a `browser` condition, so a
617
625
  browser-targeted build resolves an Emscripten-only build of that entry and pulls
618
626
  **`taglib-web.wasm` alone** — measured with the vite invocation above on
619
- `pictureToDataURL` from `taglib-wasm/web`: one 703,477-byte Wasm asset where the
620
- Node-oriented graph emitted both `taglib-web.wasm` and `taglib-wasi.wasm`
621
- (1.4 MB of assets for a call that needs neither engine), and a 6,289-byte
622
- JavaScript bundle where the shimmed Node graph produced 17,461 bytes. Note the
623
- browser build is a pre-bundled file like `index.browser.js`, so it does not
624
- tree-shake to a leaf the way the Node files do: the same call costs 80,959 bytes
625
- in the browser column against 205 bytes on Node, and importing any pure helper
626
- from the barrel costs ~82 KB there too. That granularity is a property of the
627
- pre-bundled browser entries, not of this subpath.
627
+ `pictureToDataURL` from `taglib-wasm/web`: one 703,477-byte Wasm asset, where
628
+ the vite build on the `node` condition instead emits both `taglib-web.wasm` and
629
+ `taglib-wasi.wasm` (1,458,150 bytes of assets for a call that needs neither
630
+ engine). The browser build is a pre-bundled file like `index.browser.js`, so it
631
+ barely tree-shakes: that call is 81,006 bytes in the vite app build and 78,528
632
+ under the esbuild browser column, against 205 bytes under esbuild's Node column —
633
+ and importing any pure helper from the barrel costs ~80 KB there too. Rollup is
634
+ the exception: it shakes the pre-bundled file down to 745 bytes, though still
635
+ not to the 210-byte leaf its Node column reaches. That granularity is a property
636
+ of the pre-bundled browser entries, not of this subpath.
628
637
 
629
638
  **TypeScript resolves the same condition.** A browser consumer gets the matching
630
639
  type surface only if TypeScript is told about it — in `tsconfig.json`:
@@ -648,8 +657,8 @@ instead of a bundler error — and importing `bwf`, `groupAlbums`,
648
657
  mismatch is what produced the original silent failure.
649
658
 
650
659
  **Bundler interop.** `dist/taglib-wrapper.js` — the Emscripten glue — contains a
651
- dynamic `import("module")`, and browser targets have no such builtin, so the two
652
- targets need one line each: esbuild `--external:module`, webpack
660
+ dynamic `import("node:module")`, and browser targets have no such builtin, so the
661
+ two targets need one line each: esbuild `--external:node:module`, webpack
653
662
  `externals: { module: "module" }` (webpack `target: "web"` alone fails on it).
654
663
  Rollup needs nothing extra; vite externalizes it for the browser with a warning.
655
664
  The `browser` condition itself is resolved by default by esbuild
@@ -658,42 +667,41 @@ The `browser` condition itself is resolved by default by esbuild
658
667
 
659
668
  **The barrel is not a tax.** Adding an API to an import that already loads the
660
669
  engine costs only that API. Against the `taglib-wasm` row above (esbuild, Node
661
- column): adding `scanFolder` costs **4,377 bytes** and adding
670
+ column): adding `scanFolder` costs **4,376 bytes** and adding
662
671
  `pictureToDataURL` costs **187 bytes**, because neither drags in the rest of the
663
672
  Folder or Web module tree.
664
673
 
665
- **The browser barrel's residue.** The browser entry is a pre-bundled file, and
666
- aligning its export surface with the Node barrel's added the pure
667
- `bwf` / `groupAlbums` / `discFolderInfo` exports to it. A browser consumer that
668
- imports none of them pays **350 bytes** more than before (measured on
669
- `import { TagLib }`, one toolchain and one snapshot, pre- and post-change
670
- entries): **56 bytes** for the `bwf` namespace object's top-level export table
671
- and **294 bytes** for the `discFolderInfo`/`groupAlbums` re-export entries —
672
- neither is droppable when unused. Nothing else moved: `isDenoCompiled`, a plain
673
- function, shakes away completely, the Folder and Web APIs are still reached only
674
- when imported, and the Node entries are unchanged.
674
+ **The browser barrel's export list is already paid for.** The browser entry is a
675
+ pre-bundled file, so a consumer of the barrel downloads the whole file whatever
676
+ it imports; adding the pure `bwf` / `groupAlbums` / `discFolderInfo` exports to
677
+ that file's export list therefore costs nothing measurable. Bundling
678
+ `import { TagLib }` against the entry with and without those three export names
679
+ gives identical bytes under esbuild (79,826) and rollup (77,058) and 12 bytes
680
+ more under vite (82,764 → 82,776). Nothing else moved: the Folder and Web APIs
681
+ are still reached only when imported, and the Node entries are unchanged.
675
682
 
676
683
  **Entry-point choice is not a size lever.** `taglib-wasm` and
677
- `taglib-wasm/simple` differ by less than 1 KB in either direction — in a browser
678
- bundle `simple` is 712 bytes _smaller_, on Node 991 bytes _larger_, because
684
+ `taglib-wasm/simple` differ by about a kilobyte either way — in a browser bundle
685
+ `simple` is 278 bytes _smaller_, on Node 1,002 bytes _larger_, because
679
686
  `getTagLib()` reaches the full `TagLib` class through a dynamic import. Pick by
680
687
  API surface. The lever that does matter is the `browser` export condition: a
681
- browser-targeted bundle is ~82 KB where a Node-targeted one is ~145 KB.
688
+ browser-targeted bundle is ~80 KB where a Node-targeted one is ~144 KB.
682
689
 
683
690
  **`"sideEffects": false`** is set in `package.json`, so a bundler may drop any
684
691
  module whose exports go unused. Before that field, importers of the sub-entries
685
692
  paid ~17 KB for property-metadata tables that were kept only because module-level
686
693
  table building looked impure; those bundles are now a few hundred bytes or less.
687
- Measured with esbuild `--platform=node`, rollup with default `node-resolve`
688
- options, and vite's app build — the combination under which all four apps build
694
+ Measured on the **`node` condition** — esbuild `--platform=node`, rollup with
695
+ default `node-resolve` options, and vite's app build with
696
+ `resolve.conditions: ["node"]` — the combination under which all four apps build
689
697
  under every bundler:
690
698
 
691
- | Consumer app | esbuild off → on | rollup off → on | vite off → on |
692
- | -------------------------------------------------------------- | ----------------- | ----------------- | --------------- |
693
- | `import "taglib-wasm/web"` (uses nothing) | 17,198 → 21 | 16,329 → 21 | 17,348 → 731 |
694
- | `import "taglib-wasm/folder"` (uses nothing) | 17,430 → 21 | 16,380 → 21 | 17,689 → 731 |
695
- | `pictureToDataURL` from `taglib-wasm/web` | 17,361 → 184 | 16,497 → 189 | 17,519 → 902 |
696
- | `import { TagLib } from "taglib-wasm"`, referenced by `typeof` | 145,596 → 145,030 | 134,337 → 134,286 | 84,278 → 84,278 |
699
+ | Consumer app | esbuild off → on | rollup off → on | vite off → on |
700
+ | -------------------------------------------------------------- | ----------------- | ----------------- | ----------------- |
701
+ | `import "taglib-wasm/web"` (uses nothing) | 17,224 → 0 | 16,428 → 1 | 17,328 → 711 |
702
+ | `import "taglib-wasm/folder"` (uses nothing) | 17,428 → 0 | 16,479 → 1 | 17,669 → 711 |
703
+ | `pictureToDataURL` from `taglib-wasm/web` | 17,428 → 205 | 16,637 → 210 | 17,540 → 923 |
704
+ | `import { TagLib } from "taglib-wasm"`, referenced by `typeof` | 144,582 → 143,579 | 133,090 → 133,039 | 141,847 → 141,456 |
697
705
 
698
706
  ## Runtime Compatibility
699
707
 
@@ -703,7 +711,7 @@ under every bundler:
703
711
  | ---------------------- | ------- | ------------------------- | -------------------------------------------------------------------------------------------------- |
704
712
  | **Node.js** | Full | `npm install taglib-wasm` | TypeScript via tsx |
705
713
  | **Deno** | Full | `npm:taglib-wasm` | Native TypeScript |
706
- | **Bun** | Partial | `bun add taglib-wasm` | Import + init verified; full test suite is Deno-only |
714
+ | **Bun** | Partial | `bun add taglib-wasm` | Import + init verified; covered by `pnpm run test:bun` and the cross-runtime smoke |
707
715
  | **Browser** | Full | Via bundler | Full API support |
708
716
  | **Cloudflare Workers** | Full | `npm install taglib-wasm` | Buffer-based (Emscripten); no filesystem. See [Workers guide](docs/advanced/cloudflare-workers.md) |
709
717
  | **Electron** | Node.js | `npm install taglib-wasm` | Main process; renderer via IPC |
@@ -720,7 +728,7 @@ under every bundler:
720
728
 
721
729
  ## Contributing
722
730
 
723
- Contributions are welcome! Please read our [Contributing Guide](CONTRIBUTING.md)
731
+ Contributions are welcome! Please read our [Contributing Guide](.github/CONTRIBUTING.md)
724
732
  for details on our code of conduct and the process for submitting pull requests.
725
733
 
726
734
  ## License
@@ -0,0 +1,7 @@
1
+ //#region \0@oxc-project+runtime@0.152.0/helpers/esm/assertClassBrand.js
2
+ function _assertClassBrand(e, t, n) {
3
+ if ("function" == typeof e ? e === t : e.has(t)) return arguments.length < 3 ? t : n;
4
+ throw new TypeError("Private element is not present on this object");
5
+ }
6
+ //#endregion
7
+ export { _assertClassBrand as default };
@@ -0,0 +1,6 @@
1
+ //#region \0@oxc-project+runtime@0.152.0/helpers/esm/checkPrivateRedeclaration.js
2
+ function _checkPrivateRedeclaration(e, t) {
3
+ if (t.has(e)) throw new TypeError("Cannot initialize the same private elements twice on an object");
4
+ }
5
+ //#endregion
6
+ export { _checkPrivateRedeclaration as default };
@@ -0,0 +1,7 @@
1
+ import _assertClassBrand from "./assertClassBrand.js";
2
+ //#region \0@oxc-project+runtime@0.152.0/helpers/esm/classPrivateFieldGet2.js
3
+ function _classPrivateFieldGet2(s, a) {
4
+ return s.get(_assertClassBrand(s, a));
5
+ }
6
+ //#endregion
7
+ export { _classPrivateFieldGet2 as default };
@@ -0,0 +1,7 @@
1
+ import _checkPrivateRedeclaration from "./checkPrivateRedeclaration.js";
2
+ //#region \0@oxc-project+runtime@0.152.0/helpers/esm/classPrivateFieldInitSpec.js
3
+ function _classPrivateFieldInitSpec(e, t, a) {
4
+ _checkPrivateRedeclaration(e, t), t.set(e, a);
5
+ }
6
+ //#endregion
7
+ export { _classPrivateFieldInitSpec as default };
@@ -0,0 +1,7 @@
1
+ import _assertClassBrand from "./assertClassBrand.js";
2
+ //#region \0@oxc-project+runtime@0.152.0/helpers/esm/classPrivateFieldSet2.js
3
+ function _classPrivateFieldSet2(s, a, r) {
4
+ return s.set(_assertClassBrand(s, a), r), r;
5
+ }
6
+ //#endregion
7
+ export { _classPrivateFieldSet2 as default };
@@ -0,0 +1,12 @@
1
+ import toPropertyKey from "./toPropertyKey.js";
2
+ //#region \0@oxc-project+runtime@0.152.0/helpers/esm/defineProperty.js
3
+ function _defineProperty(e, r, t) {
4
+ return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
5
+ value: t,
6
+ enumerable: !0,
7
+ configurable: !0,
8
+ writable: !0
9
+ }) : e[r] = t, e;
10
+ }
11
+ //#endregion
12
+ export { _defineProperty as default };
@@ -0,0 +1,14 @@
1
+ import _typeof from "./typeof.js";
2
+ //#region \0@oxc-project+runtime@0.152.0/helpers/esm/toPrimitive.js
3
+ function toPrimitive(t, r) {
4
+ if ("object" != _typeof(t) || !t) return t;
5
+ var e = t[Symbol.toPrimitive];
6
+ if (void 0 !== e) {
7
+ var i = e.call(t, r || "default");
8
+ if ("object" != _typeof(i)) return i;
9
+ throw new TypeError("@@toPrimitive must return a primitive value.");
10
+ }
11
+ return ("string" === r ? String : Number)(t);
12
+ }
13
+ //#endregion
14
+ export { toPrimitive as default };
@@ -0,0 +1,9 @@
1
+ import _typeof from "./typeof.js";
2
+ import toPrimitive from "./toPrimitive.js";
3
+ //#region \0@oxc-project+runtime@0.152.0/helpers/esm/toPropertyKey.js
4
+ function toPropertyKey(t) {
5
+ var i = toPrimitive(t, "string");
6
+ return "symbol" == _typeof(i) ? i : i + "";
7
+ }
8
+ //#endregion
9
+ export { toPropertyKey as default };
@@ -0,0 +1,11 @@
1
+ //#region \0@oxc-project+runtime@0.152.0/helpers/esm/typeof.js
2
+ function _typeof(o) {
3
+ "@babel/helpers - typeof";
4
+ return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
5
+ return typeof o;
6
+ } : function(o) {
7
+ return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
8
+ }, _typeof(o);
9
+ }
10
+ //#endregion
11
+ export { _typeof as default };
@@ -0,0 +1,57 @@
1
+ //#region \0@oxc-project+runtime@0.152.0/helpers/esm/usingCtx.js
2
+ function _usingCtx() {
3
+ var r = "function" == typeof SuppressedError ? SuppressedError : function(r, e) {
4
+ var n = Error();
5
+ return n.name = "SuppressedError", n.error = r, n.suppressed = e, n;
6
+ }, e = {}, n = [];
7
+ function using(r, e) {
8
+ if (null != e) {
9
+ if (Object(e) !== e) throw new TypeError("using declarations can only be used with objects, functions, null, or undefined.");
10
+ if (r) var o = e[Symbol.asyncDispose || Symbol["for"]("Symbol.asyncDispose")];
11
+ if (void 0 === o && (o = e[Symbol.dispose || Symbol["for"]("Symbol.dispose")], r)) var t = o;
12
+ if ("function" != typeof o) throw new TypeError("Object is not disposable.");
13
+ t && (o = function o() {
14
+ try {
15
+ t.call(e);
16
+ } catch (r) {
17
+ return Promise.reject(r);
18
+ }
19
+ }), n.push({
20
+ v: e,
21
+ d: o,
22
+ a: r
23
+ });
24
+ } else r && n.push({
25
+ d: e,
26
+ a: r
27
+ });
28
+ return e;
29
+ }
30
+ return {
31
+ e,
32
+ u: using.bind(null, !1),
33
+ a: using.bind(null, !0),
34
+ d: function d() {
35
+ var o, t = this.e, s = 0;
36
+ function next() {
37
+ for (; o = n.pop();) try {
38
+ if (!o.a && 1 === s) return s = 0, n.push(o), Promise.resolve().then(next);
39
+ if (o.d) {
40
+ var r = o.d.call(o.v);
41
+ if (o.a) return s |= 2, Promise.resolve(r).then(next, err);
42
+ } else s |= 1;
43
+ } catch (r) {
44
+ return err(r);
45
+ }
46
+ if (1 === s) return t !== e ? Promise.reject(t) : Promise.resolve();
47
+ if (t !== e) throw t;
48
+ }
49
+ function err(n) {
50
+ return t = t !== e ? new r(n, t) : n, next();
51
+ }
52
+ return next();
53
+ }
54
+ };
55
+ }
56
+ //#endregion
57
+ export { _usingCtx as default };
@@ -0,0 +1,13 @@
1
+ //#region \0rolldown/runtime.js
2
+ var __defProp = Object.defineProperty;
3
+ var __exportAll = (all, no_symbols) => {
4
+ let target = {};
5
+ for (var name in all) __defProp(target, name, {
6
+ get: all[name],
7
+ enumerable: true
8
+ });
9
+ if (!no_symbols) __defProp(target, Symbol.toStringTag, { value: "Module" });
10
+ return target;
11
+ };
12
+ //#endregion
13
+ export { __exportAll };
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bext.d.ts","sourceRoot":"","sources":["../../src/bwf/bext.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,iBAAiB,CAAC;AA6D/D;;;;;GAKG;AACH,wBAAgB,UAAU,CACxB,KAAK,EAAE,UAAU,GAChB,uBAAuB,GAAG,SAAS,CAyCrC;AAED;;;;;;;GAOG;AACH,wBAAgB,UAAU,CAAC,CAAC,EAAE,uBAAuB,GAAG,UAAU,CAmDjE"}
@@ -0,0 +1,119 @@
1
+ import { __exportAll } from "../_virtual/_rolldown/runtime.js";
2
+ //#region src/bwf/bext.ts
3
+ var bext_exports = /* @__PURE__ */ __exportAll({
4
+ decodeBext: () => decodeBext,
5
+ encodeBext: () => encodeBext
6
+ });
7
+ const FIXED_PREFIX_LEN = 602;
8
+ const VERSION_OFFSET = 346;
9
+ const UMID_OFFSET = 348;
10
+ const UMID_LEN = 64;
11
+ const LOUDNESS_OFFSET = 412;
12
+ const LOUDNESS_UNSET = 32767;
13
+ function readFixedString(bytes, offset, len) {
14
+ let end = offset;
15
+ const max = Math.min(offset + len, bytes.length);
16
+ while (end < max && bytes[end] !== 0) end++;
17
+ let s = "";
18
+ for (let i = offset; i < end; i++) s += String.fromCharCode(bytes[i]);
19
+ return s;
20
+ }
21
+ function writeFixedString(bytes, offset, len, value) {
22
+ for (let i = 0; i < len; i++) bytes[offset + i] = i < value.length ? value.charCodeAt(i) & 255 : 0;
23
+ }
24
+ function clampInt16(n) {
25
+ return Math.max(-32768, Math.min(32767, Math.round(n)));
26
+ }
27
+ function loudnessRaw(v) {
28
+ return v === void 0 ? LOUDNESS_UNSET : clampInt16(v * 100);
29
+ }
30
+ function loudnessFromRaw(raw) {
31
+ return raw === LOUDNESS_UNSET ? void 0 : raw / 100;
32
+ }
33
+ function bytesToHex(bytes) {
34
+ let s = "";
35
+ for (const b of bytes) s += b.toString(16).padStart(2, "0");
36
+ return s;
37
+ }
38
+ function hexToBytes(hex, outLen) {
39
+ const clean = hex.replace(/[^0-9a-fA-F]/g, "");
40
+ const out = new Uint8Array(outLen);
41
+ for (let i = 0; i + 1 < clean.length + 1 && i / 2 < outLen; i += 2) {
42
+ const pair = clean.slice(i, i + 2);
43
+ if (pair.length === 2) out[i / 2] = parseInt(pair, 16);
44
+ }
45
+ return out;
46
+ }
47
+ /**
48
+ * Parse a raw `bext` chunk. Returns `undefined` only if `bytes` is shorter than
49
+ * 348 (cannot even read the `Version` field). Optional fields are populated per
50
+ * the chunk's declared version and the available length, so compact/legacy v0
51
+ * chunks parse into a partial struct.
52
+ */
53
+ function decodeBext(bytes) {
54
+ if (bytes.length < 348) return void 0;
55
+ const dv = new DataView(bytes.buffer, bytes.byteOffset, bytes.byteLength);
56
+ const timeRefLow = dv.getUint32(338, true);
57
+ const timeRefHigh = dv.getUint32(342, true);
58
+ const version = dv.getUint16(VERSION_OFFSET, true);
59
+ const result = {
60
+ description: readFixedString(bytes, 0, 256),
61
+ originator: readFixedString(bytes, 256, 32),
62
+ originatorReference: readFixedString(bytes, 288, 32),
63
+ originationDate: readFixedString(bytes, 320, 10),
64
+ originationTime: readFixedString(bytes, 330, 8),
65
+ timeReferenceSamples: BigInt(timeRefHigh) << 32n | BigInt(timeRefLow),
66
+ version,
67
+ codingHistory: bytes.length > FIXED_PREFIX_LEN ? readFixedString(bytes, FIXED_PREFIX_LEN, bytes.length - FIXED_PREFIX_LEN) : ""
68
+ };
69
+ if (version >= 1 && bytes.length >= 412) result.umid = bytesToHex(bytes.subarray(UMID_OFFSET, 412));
70
+ if (version >= 2 && bytes.length >= 422) {
71
+ const lv = loudnessFromRaw(dv.getInt16(LOUDNESS_OFFSET, true));
72
+ const lr = loudnessFromRaw(dv.getInt16(414, true));
73
+ const mtp = loudnessFromRaw(dv.getInt16(416, true));
74
+ const mml = loudnessFromRaw(dv.getInt16(418, true));
75
+ const msl = loudnessFromRaw(dv.getInt16(420, true));
76
+ if (lv !== void 0) result.loudnessValueDb = lv;
77
+ if (lr !== void 0) result.loudnessRangeDb = lr;
78
+ if (mtp !== void 0) result.maxTruePeakLevelDbtp = mtp;
79
+ if (mml !== void 0) result.maxMomentaryLoudnessDb = mml;
80
+ if (msl !== void 0) result.maxShortTermLoudnessDb = msl;
81
+ }
82
+ return result;
83
+ }
84
+ /**
85
+ * Serialize a `bext` chunk. The result is always `602 + codingHistory.length`
86
+ * bytes. `version` defaults to 2 when any loudness field is present (else 1 if
87
+ * `umid` is set, else 0). Over-long string fields are truncated to their widths;
88
+ * loudness values are clamped to the Int16 range after ×100, with `undefined`
89
+ * written as the EBU `0x7FFF` "not set" sentinel; UMID is written only for
90
+ * version ≥ 1.
91
+ */
92
+ function encodeBext(b) {
93
+ const codingHistory = b.codingHistory ?? "";
94
+ const bytes = new Uint8Array(FIXED_PREFIX_LEN + codingHistory.length);
95
+ const dv = new DataView(bytes.buffer);
96
+ const hasLoudness = b.loudnessValueDb !== void 0 || b.loudnessRangeDb !== void 0 || b.maxTruePeakLevelDbtp !== void 0 || b.maxMomentaryLoudnessDb !== void 0 || b.maxShortTermLoudnessDb !== void 0;
97
+ const version = Number.isInteger(b.version) ? b.version : hasLoudness ? 2 : b.umid ? 1 : 0;
98
+ writeFixedString(bytes, 0, 256, b.description ?? "");
99
+ writeFixedString(bytes, 256, 32, b.originator ?? "");
100
+ writeFixedString(bytes, 288, 32, b.originatorReference ?? "");
101
+ writeFixedString(bytes, 320, 10, b.originationDate ?? "");
102
+ writeFixedString(bytes, 330, 8, b.originationTime ?? "");
103
+ const tr = b.timeReferenceSamples ?? 0n;
104
+ dv.setUint32(338, Number(tr & 4294967295n), true);
105
+ dv.setUint32(342, Number(tr >> 32n & 4294967295n), true);
106
+ dv.setUint16(VERSION_OFFSET, version, true);
107
+ if (version >= 1 && b.umid) bytes.set(hexToBytes(b.umid, UMID_LEN), UMID_OFFSET);
108
+ if (version >= 2) {
109
+ dv.setInt16(LOUDNESS_OFFSET, loudnessRaw(b.loudnessValueDb), true);
110
+ dv.setInt16(414, loudnessRaw(b.loudnessRangeDb), true);
111
+ dv.setInt16(416, loudnessRaw(b.maxTruePeakLevelDbtp), true);
112
+ dv.setInt16(418, loudnessRaw(b.maxMomentaryLoudnessDb), true);
113
+ dv.setInt16(420, loudnessRaw(b.maxShortTermLoudnessDb), true);
114
+ }
115
+ writeFixedString(bytes, FIXED_PREFIX_LEN, codingHistory.length, codingHistory);
116
+ return bytes;
117
+ }
118
+ //#endregion
119
+ export { bext_exports, decodeBext, encodeBext };
@@ -1 +1 @@
1
- {"version":3,"file":"additional-properties.d.ts","sourceRoot":"","sources":["../../../src/constants/additional-properties.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwMxB,CAAC"}
1
+ {"version":3,"file":"additional-properties.d.ts","sourceRoot":"","sources":["../../src/constants/additional-properties.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwMxB,CAAC"}