taglib-wasm 1.0.8 → 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 (52) hide show
  1. package/dist/index.browser.js +61 -8
  2. package/dist/simple.browser.js +61 -8
  3. package/dist/src/deno-compile.js +1 -1
  4. package/dist/src/runtime/module-loader.d.ts.map +1 -1
  5. package/dist/src/runtime/module-loader.js +2 -3
  6. package/dist/src/runtime/unified-loader/module-loading.js +5 -19
  7. package/dist/src/runtime/unified-loader/module-selection.d.ts.map +1 -1
  8. package/dist/src/runtime/unified-loader/module-selection.js +0 -1
  9. package/dist/src/runtime/unified-loader/types.d.ts +1 -3
  10. package/dist/src/runtime/unified-loader/types.d.ts.map +1 -1
  11. package/dist/src/runtime/wasi-adapter/adapter.d.ts +1 -1
  12. package/dist/src/runtime/wasi-adapter/adapter.js +1 -1
  13. package/dist/src/runtime/wasi-adapter/file-handle.d.ts +3 -2
  14. package/dist/src/runtime/wasi-adapter/file-handle.d.ts.map +1 -1
  15. package/dist/src/runtime/wasi-adapter/file-handle.js +27 -11
  16. package/dist/src/runtime/wasi-adapter/wasm-io.d.ts +3 -1
  17. package/dist/src/runtime/wasi-adapter/wasm-io.d.ts.map +1 -1
  18. package/dist/src/runtime/wasi-adapter/wasm-io.js +66 -1
  19. package/dist/src/runtime/wasi-host-loader.d.ts +1 -1
  20. package/dist/src/runtime/wasi-host-loader.js +1 -1
  21. package/dist/src/runtime/wasmer-sdk-loader/types.d.ts +1 -24
  22. package/dist/src/runtime/wasmer-sdk-loader/types.d.ts.map +1 -1
  23. package/dist/src/runtime/wasmer-sdk-loader/types.js +1 -19
  24. package/dist/src/taglib/audio-file-impl.d.ts +1 -0
  25. package/dist/src/taglib/audio-file-impl.d.ts.map +1 -1
  26. package/dist/src/taglib/audio-file-impl.js +37 -6
  27. package/dist/src/taglib/taglib-class.d.ts.map +1 -1
  28. package/dist/src/taglib/taglib-class.js +26 -0
  29. package/dist/src/version.d.ts +1 -1
  30. package/dist/src/version.js +1 -1
  31. package/dist/src/wasm.d.ts +3 -0
  32. package/dist/src/wasm.d.ts.map +1 -1
  33. package/dist/taglib_wasi.wasm +0 -0
  34. package/package.json +2 -2
  35. package/dist/src/runtime/wasmer-sdk-loader/high-level-api.d.ts +0 -10
  36. package/dist/src/runtime/wasmer-sdk-loader/high-level-api.d.ts.map +0 -1
  37. package/dist/src/runtime/wasmer-sdk-loader/high-level-api.js +0 -83
  38. package/dist/src/runtime/wasmer-sdk-loader/index.d.ts +0 -6
  39. package/dist/src/runtime/wasmer-sdk-loader/index.d.ts.map +0 -1
  40. package/dist/src/runtime/wasmer-sdk-loader/index.js +0 -17
  41. package/dist/src/runtime/wasmer-sdk-loader/initialization.d.ts +0 -16
  42. package/dist/src/runtime/wasmer-sdk-loader/initialization.d.ts.map +0 -1
  43. package/dist/src/runtime/wasmer-sdk-loader/initialization.js +0 -55
  44. package/dist/src/runtime/wasmer-sdk-loader/loader.d.ts +0 -9
  45. package/dist/src/runtime/wasmer-sdk-loader/loader.d.ts.map +0 -1
  46. package/dist/src/runtime/wasmer-sdk-loader/loader.js +0 -47
  47. package/dist/src/runtime/wasmer-sdk-loader/module-creation.d.ts +0 -9
  48. package/dist/src/runtime/wasmer-sdk-loader/module-creation.d.ts.map +0 -1
  49. package/dist/src/runtime/wasmer-sdk-loader/module-creation.js +0 -71
  50. package/dist/src/runtime/wasmer-sdk-loader/wasi-stubs.d.ts +0 -16
  51. package/dist/src/runtime/wasmer-sdk-loader/wasi-stubs.d.ts.map +0 -1
  52. package/dist/src/runtime/wasmer-sdk-loader/wasi-stubs.js +0 -64
@@ -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
- };