taglib-wasm 1.0.7 → 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 (77) hide show
  1. package/dist/index.browser.js +318 -46
  2. package/dist/index.d.ts +1 -1
  3. package/dist/simple.browser.js +298 -25
  4. package/dist/src/constants/additional-properties.d.ts +242 -0
  5. package/dist/src/constants/additional-properties.d.ts.map +1 -0
  6. package/dist/src/constants/additional-properties.js +204 -0
  7. package/dist/src/constants/general-extended-properties.d.ts +7 -3
  8. package/dist/src/constants/general-extended-properties.d.ts.map +1 -1
  9. package/dist/src/constants/general-extended-properties.js +5 -3
  10. package/dist/src/constants/properties.d.ts +239 -3
  11. package/dist/src/constants/properties.d.ts.map +1 -1
  12. package/dist/src/constants/properties.js +3 -1
  13. package/dist/src/constants/tags.d.ts +20 -21
  14. package/dist/src/constants/tags.d.ts.map +1 -1
  15. package/dist/src/constants/tags.js +20 -21
  16. package/dist/src/deno-compile.js +1 -1
  17. package/dist/src/runtime/module-loader.d.ts.map +1 -1
  18. package/dist/src/runtime/module-loader.js +2 -3
  19. package/dist/src/runtime/unified-loader/module-loading.js +5 -19
  20. package/dist/src/runtime/unified-loader/module-selection.d.ts.map +1 -1
  21. package/dist/src/runtime/unified-loader/module-selection.js +0 -1
  22. package/dist/src/runtime/unified-loader/types.d.ts +1 -3
  23. package/dist/src/runtime/unified-loader/types.d.ts.map +1 -1
  24. package/dist/src/runtime/wasi-adapter/adapter.d.ts +1 -1
  25. package/dist/src/runtime/wasi-adapter/adapter.js +1 -1
  26. package/dist/src/runtime/wasi-adapter/file-handle.d.ts +3 -2
  27. package/dist/src/runtime/wasi-adapter/file-handle.d.ts.map +1 -1
  28. package/dist/src/runtime/wasi-adapter/file-handle.js +27 -11
  29. package/dist/src/runtime/wasi-adapter/wasm-io.d.ts +3 -1
  30. package/dist/src/runtime/wasi-adapter/wasm-io.d.ts.map +1 -1
  31. package/dist/src/runtime/wasi-adapter/wasm-io.js +66 -1
  32. package/dist/src/runtime/wasi-host-loader.d.ts +1 -1
  33. package/dist/src/runtime/wasi-host-loader.js +1 -1
  34. package/dist/src/runtime/wasmer-sdk-loader/types.d.ts +1 -24
  35. package/dist/src/runtime/wasmer-sdk-loader/types.d.ts.map +1 -1
  36. package/dist/src/runtime/wasmer-sdk-loader/types.js +1 -19
  37. package/dist/src/simple/tag-operations.d.ts.map +1 -1
  38. package/dist/src/simple/tag-operations.js +8 -4
  39. package/dist/src/simple/with-audio-file.d.ts +3 -2
  40. package/dist/src/simple/with-audio-file.d.ts.map +1 -1
  41. package/dist/src/simple/with-audio-file.js +11 -4
  42. package/dist/src/taglib/audio-file-impl.d.ts +1 -0
  43. package/dist/src/taglib/audio-file-impl.d.ts.map +1 -1
  44. package/dist/src/taglib/audio-file-impl.js +37 -6
  45. package/dist/src/taglib/taglib-class.d.ts.map +1 -1
  46. package/dist/src/taglib/taglib-class.js +34 -7
  47. package/dist/src/types/config.d.ts +1 -1
  48. package/dist/src/types/metadata-mappings.d.ts.map +1 -1
  49. package/dist/src/types/metadata-mappings.js +20 -1
  50. package/dist/src/types/tags.d.ts +24 -0
  51. package/dist/src/types/tags.d.ts.map +1 -1
  52. package/dist/src/version.d.ts +1 -1
  53. package/dist/src/version.js +1 -1
  54. package/dist/src/wasm.d.ts +3 -0
  55. package/dist/src/wasm.d.ts.map +1 -1
  56. package/dist/taglib-web.wasm +0 -0
  57. package/dist/taglib-wrapper.js +1 -1
  58. package/dist/taglib_wasi.wasm +0 -0
  59. package/package.json +2 -2
  60. package/dist/src/runtime/wasmer-sdk-loader/high-level-api.d.ts +0 -10
  61. package/dist/src/runtime/wasmer-sdk-loader/high-level-api.d.ts.map +0 -1
  62. package/dist/src/runtime/wasmer-sdk-loader/high-level-api.js +0 -83
  63. package/dist/src/runtime/wasmer-sdk-loader/index.d.ts +0 -6
  64. package/dist/src/runtime/wasmer-sdk-loader/index.d.ts.map +0 -1
  65. package/dist/src/runtime/wasmer-sdk-loader/index.js +0 -17
  66. package/dist/src/runtime/wasmer-sdk-loader/initialization.d.ts +0 -16
  67. package/dist/src/runtime/wasmer-sdk-loader/initialization.d.ts.map +0 -1
  68. package/dist/src/runtime/wasmer-sdk-loader/initialization.js +0 -55
  69. package/dist/src/runtime/wasmer-sdk-loader/loader.d.ts +0 -9
  70. package/dist/src/runtime/wasmer-sdk-loader/loader.d.ts.map +0 -1
  71. package/dist/src/runtime/wasmer-sdk-loader/loader.js +0 -47
  72. package/dist/src/runtime/wasmer-sdk-loader/module-creation.d.ts +0 -9
  73. package/dist/src/runtime/wasmer-sdk-loader/module-creation.d.ts.map +0 -1
  74. package/dist/src/runtime/wasmer-sdk-loader/module-creation.js +0 -71
  75. package/dist/src/runtime/wasmer-sdk-loader/wasi-stubs.d.ts +0 -16
  76. package/dist/src/runtime/wasmer-sdk-loader/wasi-stubs.d.ts.map +0 -1
  77. package/dist/src/runtime/wasmer-sdk-loader/wasi-stubs.js +0 -64
@@ -1,71 +0,0 @@
1
- import { heapViews } from "../wasi-memory.js";
2
- import { validateWasiExports } from "./wasi-stubs.js";
3
- function createMemoryUtils(memory) {
4
- const views = heapViews(memory);
5
- return {
6
- readCString: (ptr) => {
7
- if (!ptr) return "";
8
- let end = ptr;
9
- while (views.u8[end] !== 0) end++;
10
- return new TextDecoder().decode(views.u8.slice(ptr, end));
11
- },
12
- writeCString: (str, ptr) => {
13
- const bytes = new TextEncoder().encode(str);
14
- views.u8.set(bytes, ptr);
15
- views.u8[ptr + bytes.length] = 0;
16
- }
17
- };
18
- }
19
- function createWasiModule(instance, debug) {
20
- const exports = instance.exports;
21
- validateWasiExports(exports);
22
- const memory = exports.memory;
23
- const memUtils = createMemoryUtils(memory);
24
- if (debug) {
25
- console.log(
26
- "[WasmerSDK] WASI module loaded with exports:",
27
- Object.keys(exports)
28
- );
29
- }
30
- return createWasiInterface(exports, memory, memUtils);
31
- }
32
- function createWasiInterface(exports, memory, memUtils) {
33
- return {
34
- // Core metadata
35
- tl_version: () => {
36
- const ptr = exports.tl_version();
37
- return memUtils.readCString(ptr);
38
- },
39
- tl_api_version: () => {
40
- return exports.tl_api_version ? exports.tl_api_version() : 100;
41
- },
42
- // Memory management
43
- malloc: (size) => exports.tl_malloc(size),
44
- free: (ptr) => exports.tl_free(ptr),
45
- // MessagePack API
46
- tl_read_tags: (pathPtr, bufPtr, len, outSizePtr) => exports.tl_read_tags(
47
- pathPtr,
48
- bufPtr,
49
- len,
50
- outSizePtr
51
- ),
52
- tl_write_tags: (pathPtr, bufPtr, len, tagsPtr, tagsSize, outBufPtr, outSizePtr) => exports.tl_write_tags(
53
- pathPtr,
54
- bufPtr,
55
- len,
56
- tagsPtr,
57
- tagsSize,
58
- outBufPtr,
59
- outSizePtr
60
- ),
61
- // Error handling
62
- tl_get_last_error: () => exports.tl_get_last_error(),
63
- tl_get_last_error_code: () => exports.tl_get_last_error_code(),
64
- tl_clear_error: () => exports.tl_clear_error(),
65
- // Memory access
66
- memory
67
- };
68
- }
69
- export {
70
- createWasiModule
71
- };
@@ -1,16 +0,0 @@
1
- /**
2
- * @fileoverview WASI P1 stubs and export validation for buffer-only mode
3
- */
4
- /**
5
- * Instantiate WASI module with stub imports (no filesystem access)
6
- */
7
- export declare function instantiateWasi(wasmModule: WebAssembly.Module, _config: {
8
- env: Record<string, string>;
9
- args: string[];
10
- mount: Record<string, unknown>;
11
- }): Promise<WebAssembly.Instance>;
12
- /**
13
- * Validate required WASI exports are present
14
- */
15
- export declare function validateWasiExports(exports: WebAssembly.Exports): void;
16
- //# sourceMappingURL=wasi-stubs.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"wasi-stubs.d.ts","sourceRoot":"","sources":["../../../../src/runtime/wasmer-sdk-loader/wasi-stubs.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH;;GAEG;AACH,wBAAsB,eAAe,CACnC,UAAU,EAAE,WAAW,CAAC,MAAM,EAC9B,OAAO,EAAE;IACP,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC5B,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAChC,GACA,OAAO,CAAC,WAAW,CAAC,QAAQ,CAAC,CAwD/B;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,WAAW,CAAC,OAAO,GAAG,IAAI,CAkBtE"}
@@ -1,64 +0,0 @@
1
- import { WasmerLoadError } from "./types.js";
2
- async function instantiateWasi(wasmModule, _config) {
3
- const EBADF = 8;
4
- const importObject = {
5
- wasi_snapshot_preview1: {
6
- // (i32, i32, i32, i32) -> i32
7
- fd_write: (_fd, _iovs, _len, _nw) => 0,
8
- // (i32, i32, i32, i32) -> i32
9
- fd_read: (_fd, _iovs, _len, _nr) => EBADF,
10
- // (i32) -> i32
11
- fd_close: (_fd) => 0,
12
- // (i32, i64, i32, i32) -> i32
13
- fd_seek: (_fd, _off, _whence, _new) => EBADF,
14
- // (i32, i32) -> i32
15
- fd_fdstat_get: (_fd, _buf) => EBADF,
16
- // (i32, i32) -> i32
17
- fd_fdstat_set_flags: (_fd, _flags) => EBADF,
18
- // (i32, i64) -> i32
19
- fd_filestat_set_size: (_fd, _size) => EBADF,
20
- // (i32, i32) -> i32
21
- fd_prestat_get: (_fd, _buf) => EBADF,
22
- // (i32, i32, i32) -> i32
23
- fd_prestat_dir_name: (_fd, _path, _len) => EBADF,
24
- // (i32, i32, i32, i32, i32, i64, i64, i32, i32) -> i32
25
- path_open: (_fd, _df, _p, _pl, _of, _rbBase, _rbInherit, _ff, _ofd) => 76,
26
- // ENOTCAPABLE
27
- // (i32, i32) -> i32
28
- args_get: (_argv, _buf) => 0,
29
- // (i32, i32) -> i32
30
- args_sizes_get: (_argc, _bufsz) => 0,
31
- // (i32) -> nil
32
- proc_exit: (_code) => {
33
- }
34
- },
35
- env: {}
36
- };
37
- const instance = await WebAssembly.instantiate(wasmModule, importObject);
38
- if (instance.exports._initialize) {
39
- instance.exports._initialize();
40
- }
41
- return instance;
42
- }
43
- function validateWasiExports(exports) {
44
- const requiredExports = [
45
- "memory",
46
- "tl_malloc",
47
- "tl_free",
48
- "tl_version",
49
- "tl_read_tags",
50
- "tl_write_tags",
51
- "tl_get_last_error"
52
- ];
53
- for (const name of requiredExports) {
54
- if (!(name in exports)) {
55
- throw new WasmerLoadError(
56
- `WASI module missing required export: ${name}`
57
- );
58
- }
59
- }
60
- }
61
- export {
62
- instantiateWasi,
63
- validateWasiExports
64
- };