@componentor/quickjs-wasmfs-release-sync 0.31.0 → 0.31.2

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.
@@ -1,5 +1,8 @@
1
1
  // Generated from ../../templates/emscripten-module.SYNC.d.ts - WasmFS variant with OPFS support
2
- import type { EmscriptenModuleLoader, QuickJSEmscriptenModule } from "@jitl/quickjs-ffi-types"
2
+ import type {
3
+ EmscriptenModuleLoader,
4
+ QuickJSEmscriptenModule,
5
+ } from "@componentor/quickjs-ffi-types"
3
6
  /**
4
7
  * Emscripten module built from the unmodified [`quickjs/quickjs.h`](../quickjs/quickjs.h)
5
8
  * and our FFI support functions [c/interface.c](../c/interface.c).
@@ -7,74 +7,75 @@ function(moduleArg = {}) {
7
7
  var moduleRtn;
8
8
 
9
9
  var aa="function"==typeof Object.defineProperties?Object.defineProperty:function(a,b,c){if(a==Array.prototype||a==Object.prototype)return a;a[b]=c.value;return a};function ba(a){a=["object"==typeof globalThis&&globalThis,a,"object"==typeof window&&window,"object"==typeof self&&self,"object"==typeof global&&global];for(var b=0;b<a.length;++b){var c=a[b];if(c&&c.Math==Math)return c}throw Error("Cannot find global object");}var ca=ba(this);
10
- function d(a,b){if(b)a:{var c=ca;a=a.split(".");for(var e=0;e<a.length-1;e++){var f=a[e];if(!(f in c))break a;c=c[f]}a=a[a.length-1];e=c[a];b=b(e);b!=e&&null!=b&&aa(c,a,{configurable:!0,writable:!0,value:b})}}function da(a){a=Math.trunc(a)||0;0>a&&(a+=this.length);if(!(0>a||a>=this.length))return this[a]}d("Array.prototype.at",function(a){return a?a:da});function g(a){return a?a:da}d("Int8Array.prototype.at",g);d("Uint8Array.prototype.at",g);d("Uint8ClampedArray.prototype.at",g);
11
- d("Int16Array.prototype.at",g);d("Uint16Array.prototype.at",g);d("Int32Array.prototype.at",g);d("Uint32Array.prototype.at",g);d("Float32Array.prototype.at",g);d("Float64Array.prototype.at",g);d("String.prototype.at",function(a){return a?a:da});var l=moduleArg,ea,fa,ha=new Promise((a,b)=>{ea=a;fa=b}),ia="object"==typeof window,ja="function"==typeof importScripts;function ka(a){a={log:a||function(){}};for(const b of ka.uc)b(a);return l.quickJSEmscriptenExtensions=a}ka.uc=[];
12
- l.quickjsEmscriptenInit=ka;ka.uc.push(a=>{a.getWasmMemory=function(){return n}});
13
- l.mountOPFS=async function(a="/opfs"){if(!navigator.storage||!navigator.storage.getDirectory)throw Error("OPFS is not supported in this browser");const b=await navigator.storage.getDirectory();try{l.FS.xc(a)}catch(c){"EEXIST"!==c.code&&console.warn("[WasmFS] Mount point creation warning:",c)}if("function"===typeof l.wasmfsOPFSGetOrCreateDir)await l.wasmfsOPFSGetOrCreateDir(b,a);else if(l.FS&&l.FS.tc&&l.FS.tc.Ac)l.FS.Hc(l.FS.tc.Ac,{root:b},a);else throw Error("WasmFS OPFS backend not available. Ensure -lopfs.js is in build flags.");
10
+ function e(a,b){if(b)a:{var c=ca;a=a.split(".");for(var d=0;d<a.length-1;d++){var f=a[d];if(!(f in c))break a;c=c[f]}a=a[a.length-1];d=c[a];b=b(d);b!=d&&null!=b&&aa(c,a,{configurable:!0,writable:!0,value:b})}}function da(a){a=Math.trunc(a)||0;0>a&&(a+=this.length);if(!(0>a||a>=this.length))return this[a]}e("Array.prototype.at",function(a){return a?a:da});function g(a){return a?a:da}e("Int8Array.prototype.at",g);e("Uint8Array.prototype.at",g);e("Uint8ClampedArray.prototype.at",g);
11
+ e("Int16Array.prototype.at",g);e("Uint16Array.prototype.at",g);e("Int32Array.prototype.at",g);e("Uint32Array.prototype.at",g);e("Float32Array.prototype.at",g);e("Float64Array.prototype.at",g);e("String.prototype.at",function(a){return a?a:da});var m=moduleArg,ea,fa,ha=new Promise((a,b)=>{ea=a;fa=b}),ia="object"==typeof window,ja="function"==typeof importScripts;function ka(a){a={log:a||function(){}};for(const b of ka.uc)b(a);return m.quickJSEmscriptenExtensions=a}ka.uc=[];
12
+ m.quickjsEmscriptenInit=ka;ka.uc.push(a=>{a.getWasmMemory=function(){return p}});
13
+ m.mountOPFS=async function(a="/opfs"){if(!navigator.storage||!navigator.storage.getDirectory)throw Error("OPFS is not supported in this browser");const b=await navigator.storage.getDirectory();try{m.FS.xc(a)}catch(c){"EEXIST"!==c.code&&console.warn("[WasmFS] Mount point creation warning:",c)}if("function"===typeof m.wasmfsOPFSGetOrCreateDir)await m.wasmfsOPFSGetOrCreateDir(b,a);else if(m.FS&&m.FS.tc&&m.FS.tc.Ac)m.FS.Hc(m.FS.tc.Ac,{root:b},a);else throw Error("WasmFS OPFS backend not available. Ensure -lopfs.js is in build flags.");
14
14
  console.log("[WasmFS] OPFS mounted at",a);return a};
15
- l.watchFiles=function(a,b,c=100){const e=new Map;for(const h of a)try{const k=l.FS.stat(h);e.set(h,k.kc.getTime())}catch(k){e.set(h,0)}const f=setInterval(()=>{for(const h of a)try{const k=l.FS.stat(h).kc.getTime(),m=e.get(h);k!==m&&(e.set(h,k),0!==m&&b(h,"change"))}catch(k){0!==e.get(h)&&(e.set(h,0),b(h,"delete"))}},c);return{close:function(){clearInterval(f)},addPath:function(h){if(!a.includes(h)){a.push(h);try{const k=l.FS.stat(h);e.set(h,k.kc.getTime())}catch(k){e.set(h,0)}}},wd:function(h){const k=
16
- a.indexOf(h);-1!==k&&(a.splice(k,1),e.delete(h))}}};
17
- l.watchDirectory=function(a,b,c=100){function e(m){const u=[];try{var p=l.FS.Kc(m);for(const x of p)if("."!==x&&".."!==x){p=m+"/"+x;try{const I=l.FS.stat(p);I.isDirectory()?u.push(...e(p)):u.push({path:p,kc:I.kc.getTime()})}catch(I){}}}catch(x){}return u}const f=new Map,h=e(a);for(const m of h)f.set(m.path,m.kc);const k=setInterval(()=>{var m=e(a);const u=new Set;for(const p of m)u.add(p.path),m=f.get(p.path),void 0===m?(f.set(p.path,p.kc),b(p.path,"add")):p.kc!==m&&(f.set(p.path,p.kc),b(p.path,"change"));
18
- for(const [p]of f)u.has(p)||(f.delete(p),b(p,"delete"))},c);return{close:function(){clearInterval(k)}}};l.readFileString=function(a){a=la(a);return(new TextDecoder).decode(a)};l.writeFileString=function(a,b){b=(new TextEncoder).encode(b);l.FS.Pc(a,b)};l.syncOPFS=async function(){if(l.FS&&l.FS.Mc)return new Promise((a,b)=>{l.FS.Mc(!1,c=>{c?b(c):a()})})};var ma=Object.assign({},l),na="./this.program",q="",oa,pa;
15
+ m.watchFiles=function(a,b,c=100){const d=new Map;for(const h of a)try{const k=m.FS.stat(h);d.set(h,k.kc.getTime())}catch(k){d.set(h,0)}const f=setInterval(()=>{for(const h of a)try{const k=m.FS.stat(h).kc.getTime(),l=d.get(h);k!==l&&(d.set(h,k),0!==l&&b(h,"change"))}catch(k){0!==d.get(h)&&(d.set(h,0),b(h,"delete"))}},c);return{close:function(){clearInterval(f)},addPath:function(h){if(!a.includes(h)){a.push(h);try{const k=m.FS.stat(h);d.set(h,k.kc.getTime())}catch(k){d.set(h,0)}}},wd:function(h){const k=
16
+ a.indexOf(h);-1!==k&&(a.splice(k,1),d.delete(h))}}};
17
+ m.watchDirectory=function(a,b,c=100){function d(l){const t=[];try{var n=m.FS.Kc(l);for(const v of n)if("."!==v&&".."!==v){n=l+"/"+v;try{const I=m.FS.stat(n);I.isDirectory()?t.push(...d(n)):t.push({path:n,kc:I.kc.getTime()})}catch(I){}}}catch(v){}return t}const f=new Map,h=d(a);for(const l of h)f.set(l.path,l.kc);const k=setInterval(()=>{var l=d(a);const t=new Set;for(const n of l)t.add(n.path),l=f.get(n.path),void 0===l?(f.set(n.path,n.kc),b(n.path,"add")):n.kc!==l&&(f.set(n.path,n.kc),b(n.path,"change"));
18
+ for(const [n]of f)t.has(n)||(f.delete(n),b(n,"delete"))},c);return{close:function(){clearInterval(k)}}};m.readFileString=function(a){a=la(a);return(new TextDecoder).decode(a)};m.writeFileString=function(a,b){b=(new TextEncoder).encode(b);m.FS.Pc(a,b)};m.syncOPFS=async function(){if(m.FS&&m.FS.Mc)return new Promise((a,b)=>{m.FS.Mc(!1,c=>{c?b(c):a()})})};var ma=Object.assign({},m),na="./this.program",q="",oa,pa;
19
19
  if(ia||ja)ja?q=self.location.href:"undefined"!=typeof document&&document.currentScript&&(q=document.currentScript.src),_scriptName&&(q=_scriptName),q.startsWith("blob:")?q="":q=q.substr(0,q.replace(/[?#].*/,"").lastIndexOf("/")+1),ja&&(pa=a=>{var b=new XMLHttpRequest;b.open("GET",a,!1);b.responseType="arraybuffer";b.send(null);return new Uint8Array(b.response)}),oa=a=>fetch(a,{credentials:"same-origin"}).then(b=>b.ok?b.arrayBuffer():Promise.reject(Error(b.status+" : "+b.url)));
20
- var qa=l.print||console.log.bind(console),r=l.printErr||console.error.bind(console);Object.assign(l,ma);ma=null;l.thisProgram&&(na=l.thisProgram);var ra=l.wasmBinary,n,sa=!1,ta,t,v,w,y;function ua(){var a=n.buffer;l.HEAP8=t=new Int8Array(a);l.HEAP16=new Int16Array(a);l.HEAPU8=v=new Uint8Array(a);l.HEAPU16=new Uint16Array(a);l.HEAP32=w=new Int32Array(a);l.HEAPU32=y=new Uint32Array(a);l.HEAPF32=new Float32Array(a);l.HEAPF64=new Float64Array(a)}
21
- l.wasmMemory?n=l.wasmMemory:n=new WebAssembly.Memory({initial:(l.INITIAL_MEMORY||16777216)/65536,maximum:32768});ua();var va=[],wa=[],xa=[];function ya(){var a=l.preRun.shift();va.unshift(a)}var z=0,za=null,A=null;function Aa(){z++;l.monitorRunDependencies?.(z)}function B(){z--;l.monitorRunDependencies?.(z);if(0==z&&(null!==za&&(clearInterval(za),za=null),A)){var a=A;A=null;a()}}
22
- function C(a){l.onAbort?.(a);a="Aborted("+a+")";r(a);sa=!0;ta=1;a=new WebAssembly.RuntimeError(a+". Build with -sASSERTIONS for more info.");fa(a);throw a;}var Ba=a=>a.startsWith("data:application/octet-stream;base64,"),Ca;function Ea(a){if(a==Ca&&ra)return new Uint8Array(ra);if(pa)return pa(a);throw"both async and sync fetching of the wasm failed";}function Fa(a){return ra?Promise.resolve().then(()=>Ea(a)):oa(a).then(b=>new Uint8Array(b),()=>Ea(a))}
23
- function Ga(a,b,c){return Fa(a).then(e=>WebAssembly.instantiate(e,b)).then(c,e=>{r(`failed to asynchronously prepare wasm: ${e}`);C(e)})}function Ha(a,b){var c=Ca;return ra||"function"!=typeof WebAssembly.instantiateStreaming||Ba(c)||"function"!=typeof fetch?Ga(c,a,b):fetch(c,{credentials:"same-origin"}).then(e=>WebAssembly.instantiateStreaming(e,a).then(b,function(f){r(`wasm streaming compile failed: ${f}`);r("falling back to ArrayBuffer instantiation");return Ga(c,a,b)}))}var D,E;
20
+ var qa=m.print||console.log.bind(console),r=m.printErr||console.error.bind(console);Object.assign(m,ma);ma=null;m.thisProgram&&(na=m.thisProgram);var ra=m.wasmBinary,p,sa=!1,ta,u,w,x,y;function ua(){var a=p.buffer;m.HEAP8=u=new Int8Array(a);m.HEAP16=new Int16Array(a);m.HEAPU8=w=new Uint8Array(a);m.HEAPU16=new Uint16Array(a);m.HEAP32=x=new Int32Array(a);m.HEAPU32=y=new Uint32Array(a);m.HEAPF32=new Float32Array(a);m.HEAPF64=new Float64Array(a)}
21
+ m.wasmMemory?p=m.wasmMemory:p=new WebAssembly.Memory({initial:(m.INITIAL_MEMORY||16777216)/65536,maximum:32768});ua();var va=[],wa=[],xa=[];function ya(){var a=m.preRun.shift();va.unshift(a)}var z=0,za=null,A=null;function Aa(){z++;m.monitorRunDependencies?.(z)}function B(){z--;m.monitorRunDependencies?.(z);if(0==z&&(null!==za&&(clearInterval(za),za=null),A)){var a=A;A=null;a()}}
22
+ function C(a){m.onAbort?.(a);a="Aborted("+a+")";r(a);sa=!0;ta=1;a=new WebAssembly.RuntimeError(a+". Build with -sASSERTIONS for more info.");fa(a);throw a;}var Ba=a=>a.startsWith("data:application/octet-stream;base64,"),Ca;function Da(a){if(a==Ca&&ra)return new Uint8Array(ra);if(pa)return pa(a);throw"both async and sync fetching of the wasm failed";}function Fa(a){return ra?Promise.resolve().then(()=>Da(a)):oa(a).then(b=>new Uint8Array(b),()=>Da(a))}
23
+ function Ga(a,b,c){return Fa(a).then(d=>WebAssembly.instantiate(d,b)).then(c,d=>{r(`failed to asynchronously prepare wasm: ${d}`);C(d)})}function Ha(a,b){var c=Ca;return ra||"function"!=typeof WebAssembly.instantiateStreaming||Ba(c)||"function"!=typeof fetch?Ga(c,a,b):fetch(c,{credentials:"same-origin"}).then(d=>WebAssembly.instantiateStreaming(d,a).then(b,function(f){r(`wasm streaming compile failed: ${f}`);r("falling back to ArrayBuffer instantiation");return Ga(c,a,b)}))}var D,E;
24
24
  function Ia(a){this.name="ExitStatus";this.message=`Program terminated with exit(${a})`;this.status=a}
25
- var Ja=a=>{for(;0<a.length;)a.shift()(l)},Ka=l.noExitRuntime||!0,La="undefined"!=typeof TextDecoder?new TextDecoder:void 0,F=(a,b)=>{for(var c=b+NaN,e=b;a[e]&&!(e>=c);)++e;if(16<e-b&&a.buffer&&La)return La.decode(a.subarray(b,e));for(c="";b<e;){var f=a[b++];if(f&128){var h=a[b++]&63;if(192==(f&224))c+=String.fromCharCode((f&31)<<6|h);else{var k=a[b++]&63;f=224==(f&240)?(f&15)<<12|h<<6|k:(f&7)<<18|h<<12|k<<6|a[b++]&63;65536>f?c+=String.fromCharCode(f):(f-=65536,c+=String.fromCharCode(55296|f>>10,56320|
26
- f&1023))}}else c+=String.fromCharCode(f)}return c},Ma=[0,31,60,91,121,152,182,213,244,274,305,335],Na=[0,31,59,90,120,151,181,212,243,273,304,334],G=(a,b)=>b+2097152>>>0<4194305-!!a?(a>>>0)+4294967296*b:NaN,H={},Oa=a=>{if(!(a instanceof Ia||"unwind"==a))throw a;},Pa=0,Qa=a=>{ta=a;Ka||0<Pa||(l.onExit?.(a),sa=!0);throw new Ia(a);},Ra=a=>{if(!sa)try{if(a(),!(Ka||0<Pa))try{ta=a=ta,Qa(a)}catch(b){Oa(b)}}catch(b){Oa(b)}},Sa;Sa=()=>performance.now();
27
- var J=(a,b,c,e)=>{if(!(0<e))return 0;var f=c;e=c+e-1;for(var h=0;h<a.length;++h){var k=a.charCodeAt(h);if(55296<=k&&57343>=k){var m=a.charCodeAt(++h);k=65536+((k&1023)<<10)|m&1023}if(127>=k){if(c>=e)break;b[c++]=k}else{if(2047>=k){if(c+1>=e)break;b[c++]=192|k>>6}else{if(65535>=k){if(c+2>=e)break;b[c++]=224|k>>12}else{if(c+3>=e)break;b[c++]=240|k>>18;b[c++]=128|k>>12&63}b[c++]=128|k>>6&63}b[c++]=128|k&63}}b[c]=0;return c-f},Ta=[],K=[],Ua=!1,L=a=>{for(var b=0,c=0;c<a.length;++c){var e=a.charCodeAt(c);
28
- 127>=e?b++:2047>=e?b+=2:55296<=e&&57343>=e?(b+=4,++c):b+=3}return b};function Va(a,b){a.lc[b]=void 0;a.zc.push(b)}class Wa{constructor(){this.lc=[void 0];this.zc=[]}get(a){return this.lc[a]}has(a){return void 0!==this.lc[a]}nc(a){var b=this.zc.pop()||this.lc.length;this.lc[b]=a;return b}}var M=new Wa,Xa=new Wa,N=new Wa,O=new Wa;
29
- async function Ya(a,b,c){a=N.get(a);let e;try{e=await a.getFileHandle(b,{create:c})}catch(f){return"NotFoundError"===f.name?-20:"TypeMismatchError"===f.name?-31:-29}return O.nc(e)}async function Za(a,b,c){a=N.get(a);let e;try{e=await a.getDirectoryHandle(b,{create:c})}catch(f){return"NotFoundError"===f.name?-20:"TypeMismatchError"===f.name?-54:-29}return N.nc(e)}
30
- class $a{constructor(a){this.handle=a}async close(){}async flush(){}async getSize(){return(await this.handle.getFile()).size}async read(a,b={at:0}){b=await (await (await this.handle.getFile()).slice(b.at,b.at+a.length)).arrayBuffer();b=new Uint8Array(b);a.set(b);return b.length}async write(a,b={at:0}){let c=await this.handle.createWritable({keepExistingData:!0});await c.write({type:"write",position:b.at,data:a});await c.close();return a.length}async truncate(a){let b=await this.handle.createWritable({keepExistingData:!0});
25
+ var Ja=a=>{for(;0<a.length;)a.shift()(m)},Ka=m.noExitRuntime||!0,La="undefined"!=typeof TextDecoder?new TextDecoder:void 0,F=(a,b,c)=>{var d=b+c;for(c=b;a[c]&&!(c>=d);)++c;if(16<c-b&&a.buffer&&La)return La.decode(a.subarray(b,c));for(d="";b<c;){var f=a[b++];if(f&128){var h=a[b++]&63;if(192==(f&224))d+=String.fromCharCode((f&31)<<6|h);else{var k=a[b++]&63;f=224==(f&240)?(f&15)<<12|h<<6|k:(f&7)<<18|h<<12|k<<6|a[b++]&63;65536>f?d+=String.fromCharCode(f):(f-=65536,d+=String.fromCharCode(55296|f>>10,56320|
26
+ f&1023))}}else d+=String.fromCharCode(f)}return d},Ma=(a,b)=>a?F(w,a,b):"",Na=[0,31,60,91,121,152,182,213,244,274,305,335],Oa=[0,31,59,90,120,151,181,212,243,273,304,334],G=(a,b)=>b+2097152>>>0<4194305-!!a?(a>>>0)+4294967296*b:NaN,H={},Pa=a=>{if(!(a instanceof Ia||"unwind"==a))throw a;},Qa=0,Ra=a=>{ta=a;Ka||0<Qa||(m.onExit?.(a),sa=!0);throw new Ia(a);},Sa=a=>{if(!sa)try{if(a(),!(Ka||0<Qa))try{ta=a=ta,Ra(a)}catch(b){Pa(b)}}catch(b){Pa(b)}},Ta;Ta=()=>performance.now();
27
+ var J=(a,b,c,d)=>{if(!(0<d))return 0;var f=c;d=c+d-1;for(var h=0;h<a.length;++h){var k=a.charCodeAt(h);if(55296<=k&&57343>=k){var l=a.charCodeAt(++h);k=65536+((k&1023)<<10)|l&1023}if(127>=k){if(c>=d)break;b[c++]=k}else{if(2047>=k){if(c+1>=d)break;b[c++]=192|k>>6}else{if(65535>=k){if(c+2>=d)break;b[c++]=224|k>>12}else{if(c+3>=d)break;b[c++]=240|k>>18;b[c++]=128|k>>12&63}b[c++]=128|k>>6&63}b[c++]=128|k&63}}b[c]=0;return c-f},Ua=[],K=[],Va=!1,L=a=>{for(var b=0,c=0;c<a.length;++c){var d=a.charCodeAt(c);
28
+ 127>=d?b++:2047>=d?b+=2:55296<=d&&57343>=d?(b+=4,++c):b+=3}return b};function Wa(a,b){a.lc[b]=void 0;a.zc.push(b)}class Xa{constructor(){this.lc=[void 0];this.zc=[]}get(a){return this.lc[a]}has(a){return void 0!==this.lc[a]}nc(a){var b=this.zc.pop()||this.lc.length;this.lc[b]=a;return b}}var M=new Xa,Ya=new Xa,N=new Xa,O=new Xa;
29
+ async function Za(a,b,c){a=N.get(a);let d;try{d=await a.getFileHandle(b,{create:c})}catch(f){return"NotFoundError"===f.name?-20:"TypeMismatchError"===f.name?-31:-29}return O.nc(d)}async function $a(a,b,c){a=N.get(a);let d;try{d=await a.getDirectoryHandle(b,{create:c})}catch(f){return"NotFoundError"===f.name?-20:"TypeMismatchError"===f.name?-54:-29}return N.nc(d)}
30
+ class ab{constructor(a){this.handle=a}async close(){}async flush(){}async getSize(){return(await this.handle.getFile()).size}async read(a,b={at:0}){b=await (await (await this.handle.getFile()).slice(b.at,b.at+a.length)).arrayBuffer();b=new Uint8Array(b);a.set(b);return b.length}async write(a,b={at:0}){let c=await this.handle.createWritable({keepExistingData:!0});await c.write({type:"write",position:b.at,data:a});await c.close();return a.length}async truncate(a){let b=await this.handle.createWritable({keepExistingData:!0});
31
31
  await b.truncate(a);await b.close()}}
32
- var ab=[],bb={},fb=()=>{if(!cb){var a={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:("object"==typeof navigator&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:na||"./this.program"},b;for(b in bb)void 0===bb[b]?delete a[b]:a[b]=bb[b];var c=[];for(b in a)c.push(`${b}=${a[b]}`);cb=c}return cb},cb,gb=()=>{if("object"==typeof crypto&&"function"==typeof crypto.getRandomValues)return a=>crypto.getRandomValues(a);C("initRandomDevice")},hb=
33
- a=>(hb=gb())(a),P={vc:a=>"/"===a.charAt(0),Lc:a=>/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(a).slice(1),yc:(a,b)=>{for(var c=0,e=a.length-1;0<=e;e--){var f=a[e];"."===f?a.splice(e,1):".."===f?(a.splice(e,1),c++):c&&(a.splice(e,1),c--)}if(b)for(;c;c--)a.unshift("..");return a},normalize:a=>{var b=P.vc(a),c="/"===a.substr(-1);(a=P.yc(a.split("/").filter(e=>!!e),!b).join("/"))||b||(a=".");a&&c&&(a+="/");return(b?"/":"")+a},dirname:a=>{var b=P.Lc(a);a=b[0];b=b[1];if(!a&&!b)return".";
34
- b&&=b.substr(0,b.length-1);return a+b},Sc:a=>{if("/"===a)return"/";a=P.normalize(a);a=a.replace(/\/$/,"");var b=a.lastIndexOf("/");return-1===b?a:a.substr(b+1)},join:(...a)=>P.normalize(a.join("/")),rc:(a,b)=>P.normalize(a+"/"+b)},Q=a=>{var b=L(a)+1,c=ib(b);J(a,v,c,b);return c},T=a=>{var b=R();a=a();S(b);return a},U=a=>y[a>>2]+4294967296*w[a+4>>2],kb=(a,b,c)=>V.handleError(T(()=>{var e=Q(a);return jb(e,b,c)})),lb=(a,b=438)=>kb(a,b&4095|32768,0),nb=(a,b)=>{var c=R();a=Q(a);if("string"==typeof b){var e=
35
- new Uint8Array(L(b)+1);b=J(b,e,0,e.length);b=e.slice(0,b)}e=W(b.length);for(var f=0;f<b.length;f++)t[e+f]=b[f];b=mb(a,e,b.length);X(e);S(c);return b},pb=(a,b,c,e,f)=>{a=b?a+"/"+b:a;e=ob(e,f);Ua?(lb(a,e),nb(a,c)):K.push({Jc:a,sc:c,mode:e})},qb=(a,b,c)=>{var e=`al ${a}`;oa(a).then(f=>{b(new Uint8Array(f));e&&B(e)},()=>{if(c)c();else throw`Loading data file "${a}" failed.`;});e&&Aa(e)},rb=(...a)=>{for(var b="",c=!1,e=a.length-1;-1<=e&&!c;e--){c=0<=e?a[e]:V.Ec();if("string"!=typeof c)throw new TypeError("Arguments to path.resolve must be strings");
36
- if(!c)return"";b=c+"/"+b;c=P.vc(c)}b=P.yc(b.split("/").filter(f=>!!f),!c).join("/");return(c?"/":"")+b||"."},sb=l.preloadPlugins||[],ub=(a,b,c,e)=>{"undefined"!=typeof Browser&&tb();var f=!1;sb.forEach(h=>{!f&&h.canHandle(b)&&(h.handle(a,b,c,e),f=!0)});return f},vb=(a,b,c,e,f,h,k,m,u,p)=>{function x(db){function eb(oc){p?.();m||pb(a,b,oc,e,f,u);h?.();B(Da)}ub(db,I,eb,()=>{k?.();B(Da)})||eb(db)}var I=b?rb(P.rc(a,b)):a,Da=`cp ${I}`;Aa(Da);"string"==typeof c?qb(c,x,k):x(c)},ob=(a,b)=>{var c=0;a&&(c|=
37
- 365);b&&(c|=146);return c},xb=(a,b=511)=>V.handleError(T(()=>{var c=Q(a);return wb(c,b)})),zb=a=>T(()=>{var b=Q(a);return yb(b)}),Y={},Ab={},Bb={};function la(a){var b=b||"binary";if("utf8"!==b&&"binary"!==b)throw Error('Invalid encoding type "'+b+'"');var c=R();a=Cb(Q(a));S(c);c=new Uint8Array(v.subarray(a+8,a+8+U(a)));"utf8"===b&&(c=F(c,0));return c}
38
- function tb(){V.ub||(V.ub=function(a){this.qc=a;this.message="FS error";this.name="ErrnoError"},V.ub.prototype=Error(),V.ub.prototype.constructor=V.ub)}function Db(a){var b=T(()=>Eb(Q(a)));return 44==b?null:{jd:31==b,hd:!1}}function Fb(a){var b=a+88;return{bd:y[a>>2],mode:y[a+4>>2],sd:y[a+8>>2],uid:y[a+12>>2],fd:y[a+16>>2],ud:y[a+20>>2],size:U(a+24),Tc:y[a+32>>2],Uc:y[a+36>>2],Rc:U(a+40),kc:U(a+56),ad:U(a+72),gd:y[b>>2]+4294967296*y[b+4>>2]}}
39
- function Gb(a,b){var c=Hb(),e={Nc:b.read,Oc:b.write,Bc:f=>{Bb[f]={}},Fc:f=>{Bb[f]=void 0},getSize:()=>{},zd:()=>0,read:(f,h,k,m)=>{var u=l.oc.subarray(h,h+k);try{var p=e.Nc(Bb[f],u,0,k,m)}catch(x){return-x.qc}l.oc.set(u,h);return p},write:(f,h,k,m)=>{var u=l.oc.subarray(h,h+k);try{var p=e.Oc(Bb[f],u,0,k,m)}catch(x){return-x.qc}l.oc.set(u,h);return p}};Y[c]=e;Ab[a]=c}
40
- function Ib(a,b,c){"undefined"===typeof c&&(c=b,b=438);var e=Ab[c];if(!e)throw Error("Invalid device ID.");return V.handleError(T(()=>Jb(Q(a),b,e)))}
41
- var V={ub:null,handleError(a){if(0>a)throw new V.ub(-a);return a},Zc(a,b,c,e,f,h){pb(a,b,c,e,f,h)},Dc(a,b){for(b=b.split("/").reverse();b.length;){var c=b.pop();if(c){var e=P.rc(a,c);Ua?V.xc(e):Ta.push({Ic:a,Cc:c});a=e}}return e},$c(a,b,c,e,f,h,k,m,u,p){return vb(a,b,c,e,f,h,k,m,u,p)},Ec:()=>{var a=Kb();return a?F(v,a):""},Qc(a){var b=!!Db(a);return{cd:b,object:{Xc:b?la(a):null}}},xc:(a,b)=>xb(a,b),nd:(a,b)=>{a=a.split("/");for(var c="",e=0;e<a.length;++e)if(a[e]){c+="/"+a[e];try{xb(c,b)}catch(f){if(20!=
42
- f.qc)throw f;}}},yd:a=>V.handleError(T(()=>Lb(Q(a)))),open:(a,b,c)=>T(()=>{if("string"==typeof b){var e={r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090}[b];if("undefined"==typeof e)throw Error(`Unknown file open mode: ${b}`);}else e=b;b=e;c="undefined"==typeof c?438:c;e=Q(a);return{mc:V.handleError(Mb(e,b,c))}}),create:(a,b)=>lb(a,b),close:a=>V.handleError(-Nb(a.mc)),Cd:a=>zb(a),Vc:a=>T(()=>{var b=Q(a);return Ob(b)}),read(a,b,c,e,f){var h="undefined"!=typeof f,k=W(e);a=h?Pb(a.mc,k,e,f):Qb(a.mc,k,e);a=
43
- V.handleError(a);for(f=0;f<e;f++)b[c+f]=t[k+f];X(k);return a},write(a,b,c,e,f){for(var h="undefined"!=typeof f,k=W(e),m=0;m<e;m++)t[k+m]=b[c+m];a=h?Rb(a.mc,k,e,f):Sb(a.mc,k,e);a=V.handleError(a);X(k);return a},nc(a,b,c){return V.handleError(Tb(a.mc,b>>>0,(D=b,1<=+Math.abs(D)?0<D?+Math.floor(D/4294967296)>>>0:~~+Math.ceil((D-+(~~D>>>0))/4294967296)>>>0:0),c>>>0,(D=c,1<=+Math.abs(D)?0<D?+Math.floor(D/4294967296)>>>0:~~+Math.ceil((D-+(~~D>>>0))/4294967296)>>>0:0)))},Pc:(a,b)=>nb(a,b),pd:(a,b,c,e,f)=>
44
- ({td:V.handleError(Ub(b,e,f,a.mc,c>>>0,(D=c,1<=+Math.abs(D)?0<D?+Math.floor(D/4294967296)>>>0:~~+Math.ceil((D-+(~~D>>>0))/4294967296)>>>0:0))),lc:!0}),qd:(a,b,c,e,f)=>{0===c||C();return V.handleError(Vb(b,e,f))},rd:(a,b)=>V.handleError(Wb(a,b)),Ad:(a,b)=>T(()=>Xb(Q(a),Q(b))),vd(a){var b=V.handleError(T(()=>Yb(Q(a))));return b?F(v,b):""},stat(a){var b=W(96);V.handleError(T(()=>Zb(Q(a),b)));var c=Fb(b);X(b);return c},md(a){var b=W(96);V.handleError(T(()=>$b(Q(a),b)));var c=Fb(b);X(b);return c},Wc(a,
45
- b){return V.handleError(T(()=>{var c=Q(a);return ac(c,b)}))},kd(a,b){return V.handleError(T(()=>{var c=Q(a);return bc(c,b)}))},dd(a,b){return V.handleError(cc(a,b))},Ed:(a,b,c)=>V.handleError(T(()=>dc(Q(a),b,c))),truncate(a,b){return V.handleError(T(()=>ec(Q(a),b>>>0,(D=b,1<=+Math.abs(D)?0<D?+Math.floor(D/4294967296)>>>0:~~+Math.ceil((D-+(~~D>>>0))/4294967296)>>>0:0))))},ed(a,b){return V.handleError(fc(a,b>>>0,(D=b,1<=+Math.abs(D)?0<D?+Math.floor(D/4294967296)>>>0:~~+Math.ceil((D-+(~~D>>>0))/4294967296)>>>
46
- 0:0)))},Kc:a=>T(()=>{var b=Q(a),c=[];b=gc(b);if(!b)throw Error("No such directory");for(var e;e=hc(b);)c.push(e?F(v,e):"");ic(b);return c}),Hc:(a,b,c)=>{var e=a.Yc(b);return V.handleError(T(()=>jc(Q(c),e)))},Dd:a=>V.handleError(T(()=>kc(Q(a)))),od:(a,b,c)=>kb(a,b,c),Gc:(a,b)=>a<<8|b,pc(a,b,c,e){if("string"!=typeof a)throw Error("Only string paths are accepted");a=P.rc(a,b);b=ob(!!c,!!e);V.pc.wc||(V.pc.wc=64);var f=V.Gc(V.pc.wc++,0);Gb(f,{read(h,k,m,u){for(var p=h=0;p<u;p++){try{var x=c()}catch(I){throw new V.ub(29);
47
- }if(void 0===x&&0===h)throw new V.ub(6);if(null===x||void 0===x)break;h++;k[m+p]=x}return h},write(h,k,m,u){for(h=0;h<u;h++)try{e(k[m+h])}catch(p){throw new V.ub(29);}return h}});return Ib(a,b,f)},xd(a,b){return V.handleError(T(()=>{var c=Q(a),e=Q(b);return lc(c,e)}))},ld(a,b,c){return V.handleError(mc(a.mc,b>>>0,(D=b,1<=+Math.abs(D)?0<D?+Math.floor(D/4294967296)>>>0:~~+Math.ceil((D-+(~~D>>>0))/4294967296)>>>0:0),c))}},nc=V.Dc;tb();
48
- var rc={b:(a,b,c,e)=>{C(`Assertion failed: ${a?F(v,a):""}, at: `+[b?b?F(v,b):"":"unknown filename",c,e?e?F(v,e):"":"unknown function"])},k:()=>{C("")},_:()=>{Ka=!1;Pa=0},t:function(a,b,c){a=new Date(1E3*G(a,b));w[c>>2]=a.getSeconds();w[c+4>>2]=a.getMinutes();w[c+8>>2]=a.getHours();w[c+12>>2]=a.getDate();w[c+16>>2]=a.getMonth();w[c+20>>2]=a.getFullYear()-1900;w[c+24>>2]=a.getDay();b=a.getFullYear();w[c+28>>2]=(0!==b%4||0===b%100&&0!==b%400?Na:Ma)[a.getMonth()]+a.getDate()-1|0;w[c+36>>2]=-(60*a.getTimezoneOffset());
49
- b=(new Date(a.getFullYear(),6,1)).getTimezoneOffset();var e=(new Date(a.getFullYear(),0,1)).getTimezoneOffset();w[c+32>>2]=(b!=e&&a.getTimezoneOffset()==Math.min(e,b))|0},u:(a,b)=>{H[a]&&(clearTimeout(H[a].id),delete H[a]);if(!b)return 0;var c=setTimeout(()=>{delete H[a];Ra(()=>pc(a,Sa()))},b);H[a]={id:c,Bd:b};return 0},$:(a,b,c,e)=>{var f=(new Date).getFullYear(),h=(new Date(f,0,1)).getTimezoneOffset();f=(new Date(f,6,1)).getTimezoneOffset();y[a>>2]=60*Math.max(h,f);w[b>>2]=Number(h!=f);b=k=>{var m=
50
- Math.abs(k);return`UTC${0<=k?"-":"+"}${String(Math.floor(m/60)).padStart(2,"0")}${String(m%60).padStart(2,"0")}`};a=b(h);b=b(f);f<h?(J(a,v,c,17),J(b,v,e,17)):(J(a,v,e,17),J(b,v,c,17))},U:(a,b)=>v.set(K[a].sc,b),R:()=>Ta.length,T:()=>{Ua=!0;return K.length},P:(a,b)=>{a=Ta[a].Cc;J(a,v,b,L(a)+1)},N:a=>K[a].mode,V:a=>K[a].sc.length,Q:(a,b)=>{a=Ta[a].Ic;J(a,v,b,L(a)+1)},O:(a,b)=>{a=K[a].Jc;J(a,v,b,L(a)+1)},M:(a,b)=>Y[a].Bc(b),j:(a,b)=>Y[a].Fc(b),L:(a,b)=>Y[a].getSize(b),r:function(a,b,c,e,f,h){return Y[a].read?
51
- Y[a].read(b,c,e,G(f,h)):-28},p:()=>0,q:function(a,b,c,e,f,h){return Y[a].write?Y[a].write(b,c,e,G(f,h)):-28},D:async function(a,b,c){a=M.get(b);try{await a.close()}catch{w[c>>2]=-29}Va(M,b)},h:a=>{Va(Xa,a)},z:async function(a,b,c){a=M.get(b);try{await a.flush()}catch{w[c>>2]=-29}},e:a=>{Va(N,a)},g:a=>{Va(O,a)},J:async function(a,b,c,e,f){a=c?F(v,c):"";c=1;let h=await Ya(b,a,!1);-31==h&&(c=2,h=await Za(b,a,!1));w[e>>2]=c;w[f>>2]=h},v:async function(a,b,c,e){a=N.get(b);try{let f=a.entries();for(let h;h=
52
- await f.next(),!h.done;){let [k,m]=h.value,u=R(),p=Q(k);qc(c,p,"file"==m.kind?1:2);S(u)}}catch{w[e>>2]=-29}},G:async function(a,b,c){a=M.get(b);let e;try{e=await a.getSize()}catch{e=-29}E=[e>>>0,(D=e,1<=+Math.abs(D)?0<D?+Math.floor(D/4294967296)>>>0:~~+Math.ceil((D-+(~~D>>>0))/4294967296)>>>0:0)];w[c>>2]=E[0];w[c+4>>2]=E[1]},F:a=>Xa.get(a).size,H:async function(a,b,c){a=O.get(b);let e;try{e=(await a.getFile()).size}catch{e=-29}E=[e>>>0,(D=e,1<=+Math.abs(D)?0<D?+Math.floor(D/4294967296)>>>0:~~+Math.ceil((D-
53
- +(~~D>>>0))/4294967296)>>>0:0)];w[c>>2]=E[0];w[c+4>>2]=E[1]},K:async function(){if(1==N.lc.length){let a=await navigator.storage.getDirectory();N.lc.push(a)}},x:async function(a,b,c,e){a=c?F(v,c):"";b=await Za(b,a,!0);w[e>>2]=b},y:async function(a,b,c,e){a=c?F(v,c):"";b=await Ya(b,a,!0);w[e>>2]=b},f:async function(a,b,c,e,f){a=e?F(v,e):"";b=O.get(b);c=N.get(c);try{await b.move(c,a)}catch{w[f>>2]=-29}},i:async function(a,b,c){a=O.get(b);let e;try{let f;f=await new $a(a);e=M.nc(f)}catch(f){e="InvalidStateError"===
54
- f.name||"NoModificationAllowedError"===f.name?-2:-29}w[c>>2]=e},E:async function(a,b,c){a=O.get(b);let e;try{let f=await a.getFile();e=Xa.nc(f)}catch(f){e="NotAllowedError"===f.name?-2:-29}w[c>>2]=e},C:async function(a,b,c,e){a=M.get(a);b=v.subarray(b,b+c);try{return await a.read(b,{at:e})}catch(f){return"TypeError"==f.name?-28:-29}},B:async function(a,b,c,e,f,h){a=Xa.get(b).slice(f,f+e);b=0;try{let k=await a.arrayBuffer(),m=new Uint8Array(k);v.set(m,c);b+=m.length}catch(k){b=k instanceof RangeError?
55
- -21:-29}w[h>>2]=b},w:async function(a,b,c,e){a=c?F(v,c):"";b=N.get(b);try{await b.removeEntry(a)}catch{w[e>>2]=-29}},o:async function(a,b,c,e,f){a=G(c,e);b=M.get(b);try{await b.truncate(a)}catch{w[f>>2]=-29}},n:async function(a,b,c,e,f){a=G(c,e);b=O.get(b);try{let h=await b.createWritable({keepExistingData:!0});await h.truncate(a);await h.close()}catch{w[f>>2]=-29}},A:async function(a,b,c,e){a=M.get(a);b=v.subarray(b,b+c);try{return await a.write(b,{at:e})}catch(f){return"TypeError"==f.name?-28:-29}},
56
- Y:()=>{a:{if(!ab.length){var a=null;"undefined"!=typeof window&&"function"==typeof window.prompt&&(a=window.prompt("Input: "),null!==a&&(a+="\n"));if(!a){var b=null;break a}b=Array(L(a)+1);a=J(a,b,0,b.length);b.length=a;ab=b}b=ab.shift()}return"number"===typeof b?b:-1},c:()=>Date.now(),d:a=>r(a?F(v,a):""),X:a=>qa(a?F(v,a):""),Z:a=>{var b=v.length;a>>>=0;if(2147483648<a)return!1;for(var c=1;4>=c;c*=2){var e=b*(1+.2/c);e=Math.min(e,a+100663296);a:{e=(Math.min(2147483648,65536*Math.ceil(Math.max(a,e)/
57
- 65536))-n.buffer.byteLength+65535)/65536;try{n.grow(e);ua();var f=1;break a}catch(h){}f=void 0}if(f)return!0}return!1},m:(a,b)=>{var c=0;fb().forEach((e,f)=>{var h=b+c;f=y[a+4*f>>2]=h;for(h=0;h<e.length;++h)t[f++]=e.charCodeAt(h);t[f]=0;c+=e.length+1});return 0},s:(a,b)=>{var c=fb();y[a>>2]=c.length;var e=0;c.forEach(f=>e+=f.length+1);y[b>>2]=e;return 0},W:(a,b)=>{hb(v.subarray(a,a+b));return 0},a:n,l:Qa,ba:function(a,b,c,e,f){return l.callbacks.callFunction(void 0,a,b,c,e,f)},aa:function(a){return l.callbacks.shouldInterrupt(void 0,
58
- a)},S:function(a,b,c){c=c?F(v,c):"";return l.callbacks.loadModuleSource(void 0,a,b,c)},I:function(a,b,c,e){c=c?F(v,c):"";e=e?F(v,e):"";return l.callbacks.normalizeModule(void 0,a,b,c,e)}},Z=function(){function a(c){Z=c.exports;wa.unshift(Z.ca);B("wasm-instantiate");return Z}var b={a:rc};Aa("wasm-instantiate");if(l.instantiateWasm)try{return l.instantiateWasm(b,a)}catch(c){r(`Module.instantiateWasm callback failed with error: ${c}`),fa(c)}Ca||=l.locateFile?Ba("emscripten-module.wasm")?"emscripten-module.wasm":
59
- l.locateFile?l.locateFile("emscripten-module.wasm",q):q+"emscripten-module.wasm":(new URL("emscripten-module.wasm",import.meta.url)).href;Ha(b,function(c){a(c.instance)}).catch(fa);return{}}(),W=l._malloc=a=>(W=l._malloc=Z.da)(a);l._QTS_Throw=(a,b)=>(l._QTS_Throw=Z.ea)(a,b);l._QTS_NewError=a=>(l._QTS_NewError=Z.fa)(a);l._QTS_RuntimeSetMemoryLimit=(a,b)=>(l._QTS_RuntimeSetMemoryLimit=Z.ga)(a,b);l._QTS_RuntimeComputeMemoryUsage=(a,b)=>(l._QTS_RuntimeComputeMemoryUsage=Z.ha)(a,b);
60
- l._QTS_RuntimeDumpMemoryUsage=a=>(l._QTS_RuntimeDumpMemoryUsage=Z.ia)(a);l._QTS_RecoverableLeakCheck=()=>(l._QTS_RecoverableLeakCheck=Z.ja)();l._QTS_BuildIsSanitizeLeak=()=>(l._QTS_BuildIsSanitizeLeak=Z.ka)();l._QTS_RuntimeSetMaxStackSize=(a,b)=>(l._QTS_RuntimeSetMaxStackSize=Z.la)(a,b);l._QTS_GetUndefined=()=>(l._QTS_GetUndefined=Z.ma)();l._QTS_GetNull=()=>(l._QTS_GetNull=Z.na)();l._QTS_GetFalse=()=>(l._QTS_GetFalse=Z.oa)();l._QTS_GetTrue=()=>(l._QTS_GetTrue=Z.pa)();
61
- l._QTS_NewRuntime=()=>(l._QTS_NewRuntime=Z.qa)();l._QTS_FreeRuntime=a=>(l._QTS_FreeRuntime=Z.ra)(a);var X=l._free=a=>(X=l._free=Z.sa)(a);l._QTS_NewContext=(a,b)=>(l._QTS_NewContext=Z.ta)(a,b);l._QTS_FreeContext=a=>(l._QTS_FreeContext=Z.ua)(a);l._QTS_FreeValuePointer=(a,b)=>(l._QTS_FreeValuePointer=Z.va)(a,b);l._QTS_FreeValuePointerRuntime=(a,b)=>(l._QTS_FreeValuePointerRuntime=Z.wa)(a,b);l._QTS_FreeVoidPointer=(a,b)=>(l._QTS_FreeVoidPointer=Z.xa)(a,b);
62
- l._QTS_FreeCString=(a,b)=>(l._QTS_FreeCString=Z.ya)(a,b);l._QTS_DupValuePointer=(a,b)=>(l._QTS_DupValuePointer=Z.za)(a,b);l._QTS_NewObject=a=>(l._QTS_NewObject=Z.Aa)(a);l._QTS_NewObjectProto=(a,b)=>(l._QTS_NewObjectProto=Z.Ba)(a,b);l._QTS_NewArray=a=>(l._QTS_NewArray=Z.Ca)(a);l._QTS_NewArrayBuffer=(a,b,c)=>(l._QTS_NewArrayBuffer=Z.Da)(a,b,c);l._QTS_NewFloat64=(a,b)=>(l._QTS_NewFloat64=Z.Ea)(a,b);l._QTS_GetFloat64=(a,b)=>(l._QTS_GetFloat64=Z.Fa)(a,b);
63
- l._QTS_NewString=(a,b)=>(l._QTS_NewString=Z.Ga)(a,b);l._QTS_GetString=(a,b)=>(l._QTS_GetString=Z.Ha)(a,b);l._QTS_GetArrayBuffer=(a,b)=>(l._QTS_GetArrayBuffer=Z.Ia)(a,b);l._QTS_GetArrayBufferLength=(a,b)=>(l._QTS_GetArrayBufferLength=Z.Ja)(a,b);l._QTS_NewSymbol=(a,b,c)=>(l._QTS_NewSymbol=Z.Ka)(a,b,c);l._QTS_GetSymbolDescriptionOrKey=(a,b)=>(l._QTS_GetSymbolDescriptionOrKey=Z.La)(a,b);l._QTS_IsGlobalSymbol=(a,b)=>(l._QTS_IsGlobalSymbol=Z.Ma)(a,b);l._QTS_IsJobPending=a=>(l._QTS_IsJobPending=Z.Na)(a);
64
- l._QTS_ExecutePendingJob=(a,b,c)=>(l._QTS_ExecutePendingJob=Z.Oa)(a,b,c);l._QTS_GetProp=(a,b,c)=>(l._QTS_GetProp=Z.Pa)(a,b,c);l._QTS_GetPropNumber=(a,b,c)=>(l._QTS_GetPropNumber=Z.Qa)(a,b,c);l._QTS_SetProp=(a,b,c,e)=>(l._QTS_SetProp=Z.Ra)(a,b,c,e);l._QTS_DefineProp=(a,b,c,e,f,h,k,m,u)=>(l._QTS_DefineProp=Z.Sa)(a,b,c,e,f,h,k,m,u);l._QTS_GetOwnPropertyNames=(a,b,c,e,f)=>(l._QTS_GetOwnPropertyNames=Z.Ta)(a,b,c,e,f);l._QTS_Call=(a,b,c,e,f)=>(l._QTS_Call=Z.Ua)(a,b,c,e,f);
65
- l._QTS_ResolveException=(a,b)=>(l._QTS_ResolveException=Z.Va)(a,b);l._QTS_Dump=(a,b)=>(l._QTS_Dump=Z.Wa)(a,b);l._QTS_Eval=(a,b,c,e,f,h)=>(l._QTS_Eval=Z.Xa)(a,b,c,e,f,h);l._QTS_GetModuleNamespace=(a,b)=>(l._QTS_GetModuleNamespace=Z.Ya)(a,b);l._QTS_Typeof=(a,b)=>(l._QTS_Typeof=Z.Za)(a,b);l._QTS_GetLength=(a,b,c)=>(l._QTS_GetLength=Z._a)(a,b,c);l._QTS_IsEqual=(a,b,c,e)=>(l._QTS_IsEqual=Z.$a)(a,b,c,e);l._QTS_GetGlobalObject=a=>(l._QTS_GetGlobalObject=Z.ab)(a);
66
- l._QTS_NewPromiseCapability=(a,b)=>(l._QTS_NewPromiseCapability=Z.bb)(a,b);l._QTS_PromiseState=(a,b)=>(l._QTS_PromiseState=Z.cb)(a,b);l._QTS_PromiseResult=(a,b)=>(l._QTS_PromiseResult=Z.db)(a,b);l._QTS_TestStringArg=a=>(l._QTS_TestStringArg=Z.eb)(a);l._QTS_GetDebugLogEnabled=a=>(l._QTS_GetDebugLogEnabled=Z.fb)(a);l._QTS_SetDebugLogEnabled=(a,b)=>(l._QTS_SetDebugLogEnabled=Z.gb)(a,b);l._QTS_BuildIsDebug=()=>(l._QTS_BuildIsDebug=Z.hb)();l._QTS_BuildIsAsyncify=()=>(l._QTS_BuildIsAsyncify=Z.ib)();
67
- l._QTS_NewFunction=(a,b,c)=>(l._QTS_NewFunction=Z.jb)(a,b,c);l._QTS_ArgvGetJSValueConstPointer=(a,b)=>(l._QTS_ArgvGetJSValueConstPointer=Z.kb)(a,b);l._QTS_RuntimeEnableInterruptHandler=a=>(l._QTS_RuntimeEnableInterruptHandler=Z.lb)(a);l._QTS_RuntimeDisableInterruptHandler=a=>(l._QTS_RuntimeDisableInterruptHandler=Z.mb)(a);l._QTS_RuntimeEnableModuleLoader=(a,b)=>(l._QTS_RuntimeEnableModuleLoader=Z.nb)(a,b);l._QTS_RuntimeDisableModuleLoader=a=>(l._QTS_RuntimeDisableModuleLoader=Z.ob)(a);
68
- l._QTS_bjson_encode=(a,b)=>(l._QTS_bjson_encode=Z.pb)(a,b);l._QTS_bjson_decode=(a,b)=>(l._QTS_bjson_decode=Z.qb)(a,b);l._QTS_EvalFunction=(a,b)=>(l._QTS_EvalFunction=Z.rb)(a,b);l._QTS_EncodeBytecode=(a,b)=>(l._QTS_EncodeBytecode=Z.sb)(a,b);l._QTS_DecodeBytecode=(a,b)=>(l._QTS_DecodeBytecode=Z.tb)(a,b);
69
- var pc=(a,b)=>(pc=Z.vb)(a,b),S=a=>(S=Z.wb)(a),ib=a=>(ib=Z.xb)(a),R=()=>(R=Z.yb)(),Cb=a=>(Cb=Z.zb)(a),mb=(a,b,c)=>(mb=Z.Ab)(a,b,c),wb=(a,b)=>(wb=Z.Bb)(a,b),Lb=a=>(Lb=Z.Cb)(a),Mb=(a,b,c)=>(Mb=Z.Db)(a,b,c),Tb=(a,b,c,e,f)=>(Tb=Z.Eb)(a,b,c,e,f),jb=(a,b,c)=>(jb=Z.Fb)(a,b,c),yb=a=>(yb=Z.Gb)(a),Ob=a=>(Ob=Z.Hb)(a),Xb=(a,b)=>(Xb=Z.Ib)(a,b),Yb=a=>(Yb=Z.Jb)(a),Sb=(a,b,c)=>(Sb=Z.Kb)(a,b,c),Rb=(a,b,c,e,f)=>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FS:69,EMLINK:34,EPIPE:64,EDOM:18,ERANGE:68,ENOMSG:49,EIDRM:24,ECHRNG:106,EL2NSYNC:156,EL3HLT:107,EL3RST:108,ELNRNG:109,EUNATCH:110,ENOCSI:111,EL2HLT:112,EDEADLK:16,ENOLCK:46,EBADE:113,EBADR:114,
32
+ var bb=[],cb={},gb=()=>{if(!db){var a={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:("object"==typeof navigator&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:na||"./this.program"},b;for(b in cb)void 0===cb[b]?delete a[b]:a[b]=cb[b];var c=[];for(b in a)c.push(`${b}=${a[b]}`);db=c}return db},db,hb=()=>{if("object"==typeof crypto&&"function"==typeof crypto.getRandomValues)return a=>crypto.getRandomValues(a);C("initRandomDevice")},ib=
33
+ a=>(ib=hb())(a),P={vc:a=>"/"===a.charAt(0),Lc:a=>/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(a).slice(1),yc:(a,b)=>{for(var c=0,d=a.length-1;0<=d;d--){var f=a[d];"."===f?a.splice(d,1):".."===f?(a.splice(d,1),c++):c&&(a.splice(d,1),c--)}if(b)for(;c;c--)a.unshift("..");return a},normalize:a=>{var b=P.vc(a),c="/"===a.substr(-1);(a=P.yc(a.split("/").filter(d=>!!d),!b).join("/"))||b||(a=".");a&&c&&(a+="/");return(b?"/":"")+a},dirname:a=>{var b=P.Lc(a);a=b[0];b=b[1];if(!a&&!b)return".";
34
+ b&&=b.substr(0,b.length-1);return a+b},Sc:a=>{if("/"===a)return"/";a=P.normalize(a);a=a.replace(/\/$/,"");var b=a.lastIndexOf("/");return-1===b?a:a.substr(b+1)},join:(...a)=>P.normalize(a.join("/")),rc:(a,b)=>P.normalize(a+"/"+b)},Q=a=>{var b=L(a)+1,c=jb(b);J(a,w,c,b);return c},T=a=>{var b=R();a=a();S(b);return a},U=a=>y[a>>2]+4294967296*x[a+4>>2],lb=(a,b,c)=>V.handleError(T(()=>{var d=Q(a);return kb(d,b,c)})),mb=(a,b=438)=>lb(a,b&4095|32768,0),ob=(a,b)=>{var c=R();a=Q(a);if("string"==typeof b){var d=
35
+ new Uint8Array(L(b)+1);b=J(b,d,0,d.length);b=d.slice(0,b)}d=W(b.length);for(var f=0;f<b.length;f++)u[d+f]=b[f];b=nb(a,d,b.length);X(d);S(c);return b},qb=(a,b,c,d,f)=>{a=b?a+"/"+b:a;d=pb(d,f);Va?(mb(a,d),ob(a,c)):K.push({Jc:a,sc:c,mode:d})},rb=(a,b,c)=>{var d=`al ${a}`;oa(a).then(f=>{b(new Uint8Array(f));d&&B(d)},()=>{if(c)c();else throw`Loading data file "${a}" failed.`;});d&&Aa(d)},sb=(...a)=>{for(var b="",c=!1,d=a.length-1;-1<=d&&!c;d--){c=0<=d?a[d]:V.Ec();if("string"!=typeof c)throw new TypeError("Arguments to path.resolve must be strings");
36
+ if(!c)return"";b=c+"/"+b;c=P.vc(c)}b=P.yc(b.split("/").filter(f=>!!f),!c).join("/");return(c?"/":"")+b||"."},tb=m.preloadPlugins||[],vb=(a,b,c,d)=>{"undefined"!=typeof Browser&&ub();var f=!1;tb.forEach(h=>{!f&&h.canHandle(b)&&(h.handle(a,b,c,d),f=!0)});return f},wb=(a,b,c,d,f,h,k,l,t,n)=>{function v(eb){function fb(pc){n?.();l||qb(a,b,pc,d,f,t);h?.();B(Ea)}vb(eb,I,fb,()=>{k?.();B(Ea)})||fb(eb)}var I=b?sb(P.rc(a,b)):a,Ea=`cp ${I}`;Aa(Ea);"string"==typeof c?rb(c,v,k):v(c)},pb=(a,b)=>{var c=0;a&&(c|=
37
+ 365);b&&(c|=146);return c},yb=(a,b=511)=>V.handleError(T(()=>{var c=Q(a);return xb(c,b)})),Ab=a=>T(()=>{var b=Q(a);return zb(b)}),Y={},Bb={},Cb={};function la(a){var b=b||"binary";if("utf8"!==b&&"binary"!==b)throw Error('Invalid encoding type "'+b+'"');var c=R();a=Db(Q(a));S(c);c=new Uint8Array(w.subarray(a+8,a+8+U(a)));"utf8"===b&&(c=F(c,0));return c}
38
+ function ub(){V.ub||(V.ub=function(a){this.qc=a;this.message="FS error";this.name="ErrnoError"},V.ub.prototype=Error(),V.ub.prototype.constructor=V.ub)}function Eb(a){var b=T(()=>Fb(Q(a)));return 44==b?null:{jd:31==b,hd:!1}}function Gb(a){var b=a+88;return{bd:y[a>>2],mode:y[a+4>>2],sd:y[a+8>>2],uid:y[a+12>>2],fd:y[a+16>>2],ud:y[a+20>>2],size:U(a+24),Tc:y[a+32>>2],Uc:y[a+36>>2],Rc:U(a+40),kc:U(a+56),ad:U(a+72),gd:y[b>>2]+4294967296*y[b+4>>2]}}
39
+ function Hb(a,b){var c=Ib(),d={Nc:b.read,Oc:b.write,Bc:f=>{Cb[f]={}},Fc:f=>{Cb[f]=void 0},getSize:()=>{},zd:()=>0,read:(f,h,k,l)=>{var t=m.oc.subarray(h,h+k);try{var n=d.Nc(Cb[f],t,0,k,l)}catch(v){return-v.qc}m.oc.set(t,h);return n},write:(f,h,k,l)=>{var t=m.oc.subarray(h,h+k);try{var n=d.Oc(Cb[f],t,0,k,l)}catch(v){return-v.qc}m.oc.set(t,h);return n}};Y[c]=d;Bb[a]=c}
40
+ function Jb(a,b,c){"undefined"===typeof c&&(c=b,b=438);var d=Bb[c];if(!d)throw Error("Invalid device ID.");return V.handleError(T(()=>Kb(Q(a),b,d)))}
41
+ var V={ub:null,handleError(a){if(0>a)throw new V.ub(-a);return a},Zc(a,b,c,d,f,h){qb(a,b,c,d,f,h)},Dc(a,b){for(b=b.split("/").reverse();b.length;){var c=b.pop();if(c){var d=P.rc(a,c);Va?V.xc(d):Ua.push({Ic:a,Cc:c});a=d}}return d},$c(a,b,c,d,f,h,k,l,t,n){return wb(a,b,c,d,f,h,k,l,t,n)},Ec:()=>Ma(Lb()),Qc(a){var b=!!Eb(a);return{cd:b,object:{Xc:b?la(a):null}}},xc:(a,b)=>yb(a,b),nd:(a,b)=>{a=a.split("/");for(var c="",d=0;d<a.length;++d)if(a[d]){c+="/"+a[d];try{yb(c,b)}catch(f){if(20!=f.qc)throw f;}}},
42
+ yd:a=>V.handleError(T(()=>Mb(Q(a)))),open:(a,b,c)=>T(()=>{if("string"==typeof b){var d={r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090}[b];if("undefined"==typeof d)throw Error(`Unknown file open mode: ${b}`);}else d=b;b=d;c="undefined"==typeof c?438:c;d=Q(a);return{mc:V.handleError(Nb(d,b,c))}}),create:(a,b)=>mb(a,b),close:a=>V.handleError(-Ob(a.mc)),Cd:a=>Ab(a),Vc:a=>T(()=>{var b=Q(a);return Pb(b)}),read(a,b,c,d,f){var h="undefined"!=typeof f,k=W(d);a=h?Qb(a.mc,k,d,f):Rb(a.mc,k,d);a=V.handleError(a);
43
+ for(f=0;f<d;f++)b[c+f]=u[k+f];X(k);return a},write(a,b,c,d,f){for(var h="undefined"!=typeof f,k=W(d),l=0;l<d;l++)u[k+l]=b[c+l];a=h?Sb(a.mc,k,d,f):Tb(a.mc,k,d);a=V.handleError(a);X(k);return a},nc(a,b,c){return V.handleError(Ub(a.mc,b>>>0,(D=b,1<=+Math.abs(D)?0<D?+Math.floor(D/4294967296)>>>0:~~+Math.ceil((D-+(~~D>>>0))/4294967296)>>>0:0),c>>>0,(D=c,1<=+Math.abs(D)?0<D?+Math.floor(D/4294967296)>>>0:~~+Math.ceil((D-+(~~D>>>0))/4294967296)>>>0:0)))},Pc:(a,b)=>ob(a,b),pd:(a,b,c,d,f)=>({td:V.handleError(Vb(b,
44
+ d,f,a.mc,c>>>0,(D=c,1<=+Math.abs(D)?0<D?+Math.floor(D/4294967296)>>>0:~~+Math.ceil((D-+(~~D>>>0))/4294967296)>>>0:0))),lc:!0}),qd:(a,b,c,d,f)=>{0===c||C();return V.handleError(Wb(b,d,f))},rd:(a,b)=>V.handleError(Xb(a,b)),Ad:(a,b)=>T(()=>Yb(Q(a),Q(b))),vd(a){var b=V.handleError(T(()=>Zb(Q(a))));return b?F(w,b):""},stat(a){var b=W(96);V.handleError(T(()=>$b(Q(a),b)));var c=Gb(b);X(b);return c},md(a){var b=W(96);V.handleError(T(()=>ac(Q(a),b)));var c=Gb(b);X(b);return c},Wc(a,b){return V.handleError(T(()=>
45
+ {var c=Q(a);return bc(c,b)}))},kd(a,b){return V.handleError(T(()=>{var c=Q(a);return cc(c,b)}))},dd(a,b){return V.handleError(dc(a,b))},Ed:(a,b,c)=>V.handleError(T(()=>ec(Q(a),b,c))),truncate(a,b){return V.handleError(T(()=>fc(Q(a),b>>>0,(D=b,1<=+Math.abs(D)?0<D?+Math.floor(D/4294967296)>>>0:~~+Math.ceil((D-+(~~D>>>0))/4294967296)>>>0:0))))},ed(a,b){return V.handleError(gc(a,b>>>0,(D=b,1<=+Math.abs(D)?0<D?+Math.floor(D/4294967296)>>>0:~~+Math.ceil((D-+(~~D>>>0))/4294967296)>>>0:0)))},Kc:a=>T(()=>
46
+ {var b=Q(a),c=[];b=hc(b);if(!b)throw Error("No such directory");for(var d;d=ic(b);)c.push(d?F(w,d):"");jc(b);return c}),Hc:(a,b,c)=>{var d=a.Yc(b);return V.handleError(T(()=>kc(Q(c),d)))},Dd:a=>V.handleError(T(()=>lc(Q(a)))),od:(a,b,c)=>lb(a,b,c),Gc:(a,b)=>a<<8|b,pc(a,b,c,d){if("string"!=typeof a)throw Error("Only string paths are accepted");a=P.rc(a,b);b=pb(!!c,!!d);V.pc.wc||(V.pc.wc=64);var f=V.Gc(V.pc.wc++,0);Hb(f,{read(h,k,l,t){for(var n=h=0;n<t;n++){try{var v=c()}catch(I){throw new V.ub(29);
47
+ }if(void 0===v&&0===h)throw new V.ub(6);if(null===v||void 0===v)break;h++;k[l+n]=v}return h},write(h,k,l,t){for(h=0;h<t;h++)try{d(k[l+h])}catch(n){throw new V.ub(29);}return h}});return Jb(a,b,f)},xd(a,b){return V.handleError(T(()=>{var c=Q(a),d=Q(b);return mc(c,d)}))},ld(a,b,c){return V.handleError(nc(a.mc,b>>>0,(D=b,1<=+Math.abs(D)?0<D?+Math.floor(D/4294967296)>>>0:~~+Math.ceil((D-+(~~D>>>0))/4294967296)>>>0:0),c))}},oc=(a,b,c,d)=>{var f={string:n=>{var v=0;null!==n&&void 0!==n&&0!==n&&(v=Q(n));
48
+ return v},array:n=>{var v=jb(n.length);u.set(n,v);return v}};a=m["_"+a];var h=[],k=0;if(d)for(var l=0;l<d.length;l++){var t=f[c[l]];t?(0===k&&(k=R()),h[l]=t(d[l])):h[l]=d[l]}c=a(...h);return c=function(n){0!==k&&S(k);return"string"===b?n?F(w,n):"":"boolean"===b?!!n:n}(c)},qc=V.Dc;ub();
49
+ var tc={b:(a,b,c,d)=>{C(`Assertion failed: ${a?F(w,a):""}, at: `+[b?b?F(w,b):"":"unknown filename",c,d?d?F(w,d):"":"unknown function"])},k:()=>{C("")},_:()=>{Ka=!1;Qa=0},t:function(a,b,c){a=new Date(1E3*G(a,b));x[c>>2]=a.getSeconds();x[c+4>>2]=a.getMinutes();x[c+8>>2]=a.getHours();x[c+12>>2]=a.getDate();x[c+16>>2]=a.getMonth();x[c+20>>2]=a.getFullYear()-1900;x[c+24>>2]=a.getDay();b=a.getFullYear();x[c+28>>2]=(0!==b%4||0===b%100&&0!==b%400?Oa:Na)[a.getMonth()]+a.getDate()-1|0;x[c+36>>2]=-(60*a.getTimezoneOffset());
50
+ b=(new Date(a.getFullYear(),6,1)).getTimezoneOffset();var d=(new Date(a.getFullYear(),0,1)).getTimezoneOffset();x[c+32>>2]=(b!=d&&a.getTimezoneOffset()==Math.min(d,b))|0},u:(a,b)=>{H[a]&&(clearTimeout(H[a].id),delete H[a]);if(!b)return 0;var c=setTimeout(()=>{delete H[a];Sa(()=>rc(a,Ta()))},b);H[a]={id:c,Bd:b};return 0},$:(a,b,c,d)=>{var f=(new Date).getFullYear(),h=(new Date(f,0,1)).getTimezoneOffset();f=(new Date(f,6,1)).getTimezoneOffset();y[a>>2]=60*Math.max(h,f);x[b>>2]=Number(h!=f);b=k=>{var l=
51
+ Math.abs(k);return`UTC${0<=k?"-":"+"}${String(Math.floor(l/60)).padStart(2,"0")}${String(l%60).padStart(2,"0")}`};a=b(h);b=b(f);f<h?(J(a,w,c,17),J(b,w,d,17)):(J(a,w,d,17),J(b,w,c,17))},U:(a,b)=>w.set(K[a].sc,b),R:()=>Ua.length,T:()=>{Va=!0;return K.length},P:(a,b)=>{a=Ua[a].Cc;J(a,w,b,L(a)+1)},N:a=>K[a].mode,V:a=>K[a].sc.length,Q:(a,b)=>{a=Ua[a].Ic;J(a,w,b,L(a)+1)},O:(a,b)=>{a=K[a].Jc;J(a,w,b,L(a)+1)},M:(a,b)=>Y[a].Bc(b),j:(a,b)=>Y[a].Fc(b),L:(a,b)=>Y[a].getSize(b),r:function(a,b,c,d,f,h){return Y[a].read?
52
+ Y[a].read(b,c,d,G(f,h)):-28},p:()=>0,q:function(a,b,c,d,f,h){return Y[a].write?Y[a].write(b,c,d,G(f,h)):-28},D:async function(a,b,c){a=M.get(b);try{await a.close()}catch{x[c>>2]=-29}Wa(M,b)},h:a=>{Wa(Ya,a)},z:async function(a,b,c){a=M.get(b);try{await a.flush()}catch{x[c>>2]=-29}},e:a=>{Wa(N,a)},g:a=>{Wa(O,a)},J:async function(a,b,c,d,f){a=c?F(w,c):"";c=1;let h=await Za(b,a,!1);-31==h&&(c=2,h=await $a(b,a,!1));x[d>>2]=c;x[f>>2]=h},v:async function(a,b,c,d){a=N.get(b);try{let f=a.entries();for(let h;h=
53
+ await f.next(),!h.done;){let [k,l]=h.value,t=R(),n=Q(k);sc(c,n,"file"==l.kind?1:2);S(t)}}catch{x[d>>2]=-29}},G:async function(a,b,c){a=M.get(b);let d;try{d=await a.getSize()}catch{d=-29}E=[d>>>0,(D=d,1<=+Math.abs(D)?0<D?+Math.floor(D/4294967296)>>>0:~~+Math.ceil((D-+(~~D>>>0))/4294967296)>>>0:0)];x[c>>2]=E[0];x[c+4>>2]=E[1]},F:a=>Ya.get(a).size,H:async function(a,b,c){a=O.get(b);let d;try{d=(await a.getFile()).size}catch{d=-29}E=[d>>>0,(D=d,1<=+Math.abs(D)?0<D?+Math.floor(D/4294967296)>>>0:~~+Math.ceil((D-
54
+ +(~~D>>>0))/4294967296)>>>0:0)];x[c>>2]=E[0];x[c+4>>2]=E[1]},K:async function(){if(1==N.lc.length){let a=await navigator.storage.getDirectory();N.lc.push(a)}},x:async function(a,b,c,d){a=c?F(w,c):"";b=await $a(b,a,!0);x[d>>2]=b},y:async function(a,b,c,d){a=c?F(w,c):"";b=await Za(b,a,!0);x[d>>2]=b},f:async function(a,b,c,d,f){a=d?F(w,d):"";b=O.get(b);c=N.get(c);try{await b.move(c,a)}catch{x[f>>2]=-29}},i:async function(a,b,c){a=O.get(b);let d;try{let f;f=await new ab(a);d=M.nc(f)}catch(f){d="InvalidStateError"===
55
+ f.name||"NoModificationAllowedError"===f.name?-2:-29}x[c>>2]=d},E:async function(a,b,c){a=O.get(b);let d;try{let f=await a.getFile();d=Ya.nc(f)}catch(f){d="NotAllowedError"===f.name?-2:-29}x[c>>2]=d},C:async function(a,b,c,d){a=M.get(a);b=w.subarray(b,b+c);try{return await a.read(b,{at:d})}catch(f){return"TypeError"==f.name?-28:-29}},B:async function(a,b,c,d,f,h){a=Ya.get(b).slice(f,f+d);b=0;try{let k=await a.arrayBuffer(),l=new Uint8Array(k);w.set(l,c);b+=l.length}catch(k){b=k instanceof RangeError?
56
+ -21:-29}x[h>>2]=b},w:async function(a,b,c,d){a=c?F(w,c):"";b=N.get(b);try{await b.removeEntry(a)}catch{x[d>>2]=-29}},o:async function(a,b,c,d,f){a=G(c,d);b=M.get(b);try{await b.truncate(a)}catch{x[f>>2]=-29}},n:async function(a,b,c,d,f){a=G(c,d);b=O.get(b);try{let h=await b.createWritable({keepExistingData:!0});await h.truncate(a);await h.close()}catch{x[f>>2]=-29}},A:async function(a,b,c,d){a=M.get(a);b=w.subarray(b,b+c);try{return await a.write(b,{at:d})}catch(f){return"TypeError"==f.name?-28:-29}},
57
+ Y:()=>{a:{if(!bb.length){var a=null;"undefined"!=typeof window&&"function"==typeof window.prompt&&(a=window.prompt("Input: "),null!==a&&(a+="\n"));if(!a){var b=null;break a}b=Array(L(a)+1);a=J(a,b,0,b.length);b.length=a;bb=b}b=bb.shift()}return"number"===typeof b?b:-1},c:()=>Date.now(),d:a=>r(a?F(w,a):""),X:a=>qa(a?F(w,a):""),Z:a=>{var b=w.length;a>>>=0;if(2147483648<a)return!1;for(var c=1;4>=c;c*=2){var d=b*(1+.2/c);d=Math.min(d,a+100663296);a:{d=(Math.min(2147483648,65536*Math.ceil(Math.max(a,d)/
58
+ 65536))-p.buffer.byteLength+65535)/65536;try{p.grow(d);ua();var f=1;break a}catch(h){}f=void 0}if(f)return!0}return!1},m:(a,b)=>{var c=0;gb().forEach((d,f)=>{var h=b+c;f=y[a+4*f>>2]=h;for(h=0;h<d.length;++h)u[f++]=d.charCodeAt(h);u[f]=0;c+=d.length+1});return 0},s:(a,b)=>{var c=gb();y[a>>2]=c.length;var d=0;c.forEach(f=>d+=f.length+1);y[b>>2]=d;return 0},W:(a,b)=>{ib(w.subarray(a,a+b));return 0},a:p,l:Ra,ba:function(a,b,c,d,f){return m.callbacks.callFunction(void 0,a,b,c,d,f)},aa:function(a){return m.callbacks.shouldInterrupt(void 0,
59
+ a)},S:function(a,b,c){c=c?F(w,c):"";return m.callbacks.loadModuleSource(void 0,a,b,c)},I:function(a,b,c,d){c=c?F(w,c):"";d=d?F(w,d):"";return m.callbacks.normalizeModule(void 0,a,b,c,d)}},Z=function(){function a(c){Z=c.exports;wa.unshift(Z.ca);B("wasm-instantiate");return Z}var b={a:tc};Aa("wasm-instantiate");if(m.instantiateWasm)try{return m.instantiateWasm(b,a)}catch(c){r(`Module.instantiateWasm callback failed with error: ${c}`),fa(c)}Ca||=m.locateFile?Ba("emscripten-module.wasm")?"emscripten-module.wasm":
60
+ m.locateFile?m.locateFile("emscripten-module.wasm",q):q+"emscripten-module.wasm":(new URL("emscripten-module.wasm",import.meta.url)).href;Ha(b,function(c){a(c.instance)}).catch(fa);return{}}(),W=m._malloc=a=>(W=m._malloc=Z.da)(a);m._QTS_Throw=(a,b)=>(m._QTS_Throw=Z.ea)(a,b);m._QTS_NewError=a=>(m._QTS_NewError=Z.fa)(a);m._QTS_RuntimeSetMemoryLimit=(a,b)=>(m._QTS_RuntimeSetMemoryLimit=Z.ga)(a,b);m._QTS_RuntimeComputeMemoryUsage=(a,b)=>(m._QTS_RuntimeComputeMemoryUsage=Z.ha)(a,b);
61
+ m._QTS_RuntimeDumpMemoryUsage=a=>(m._QTS_RuntimeDumpMemoryUsage=Z.ia)(a);m._QTS_RecoverableLeakCheck=()=>(m._QTS_RecoverableLeakCheck=Z.ja)();m._QTS_BuildIsSanitizeLeak=()=>(m._QTS_BuildIsSanitizeLeak=Z.ka)();m._QTS_RuntimeSetMaxStackSize=(a,b)=>(m._QTS_RuntimeSetMaxStackSize=Z.la)(a,b);m._QTS_GetUndefined=()=>(m._QTS_GetUndefined=Z.ma)();m._QTS_GetNull=()=>(m._QTS_GetNull=Z.na)();m._QTS_GetFalse=()=>(m._QTS_GetFalse=Z.oa)();m._QTS_GetTrue=()=>(m._QTS_GetTrue=Z.pa)();
62
+ m._QTS_NewRuntime=()=>(m._QTS_NewRuntime=Z.qa)();m._QTS_FreeRuntime=a=>(m._QTS_FreeRuntime=Z.ra)(a);var X=m._free=a=>(X=m._free=Z.sa)(a);m._QTS_NewContext=(a,b)=>(m._QTS_NewContext=Z.ta)(a,b);m._QTS_FreeContext=a=>(m._QTS_FreeContext=Z.ua)(a);m._QTS_FreeValuePointer=(a,b)=>(m._QTS_FreeValuePointer=Z.va)(a,b);m._QTS_FreeValuePointerRuntime=(a,b)=>(m._QTS_FreeValuePointerRuntime=Z.wa)(a,b);m._QTS_FreeVoidPointer=(a,b)=>(m._QTS_FreeVoidPointer=Z.xa)(a,b);
63
+ m._QTS_FreeCString=(a,b)=>(m._QTS_FreeCString=Z.ya)(a,b);m._QTS_DupValuePointer=(a,b)=>(m._QTS_DupValuePointer=Z.za)(a,b);m._QTS_NewObject=a=>(m._QTS_NewObject=Z.Aa)(a);m._QTS_NewObjectProto=(a,b)=>(m._QTS_NewObjectProto=Z.Ba)(a,b);m._QTS_NewArray=a=>(m._QTS_NewArray=Z.Ca)(a);m._QTS_NewArrayBuffer=(a,b,c)=>(m._QTS_NewArrayBuffer=Z.Da)(a,b,c);m._QTS_NewFloat64=(a,b)=>(m._QTS_NewFloat64=Z.Ea)(a,b);m._QTS_GetFloat64=(a,b)=>(m._QTS_GetFloat64=Z.Fa)(a,b);
64
+ m._QTS_NewString=(a,b)=>(m._QTS_NewString=Z.Ga)(a,b);m._QTS_GetString=(a,b)=>(m._QTS_GetString=Z.Ha)(a,b);m._QTS_GetArrayBuffer=(a,b)=>(m._QTS_GetArrayBuffer=Z.Ia)(a,b);m._QTS_GetArrayBufferLength=(a,b)=>(m._QTS_GetArrayBufferLength=Z.Ja)(a,b);m._QTS_NewSymbol=(a,b,c)=>(m._QTS_NewSymbol=Z.Ka)(a,b,c);m._QTS_GetSymbolDescriptionOrKey=(a,b)=>(m._QTS_GetSymbolDescriptionOrKey=Z.La)(a,b);m._QTS_IsGlobalSymbol=(a,b)=>(m._QTS_IsGlobalSymbol=Z.Ma)(a,b);m._QTS_IsJobPending=a=>(m._QTS_IsJobPending=Z.Na)(a);
65
+ m._QTS_ExecutePendingJob=(a,b,c)=>(m._QTS_ExecutePendingJob=Z.Oa)(a,b,c);m._QTS_GetProp=(a,b,c)=>(m._QTS_GetProp=Z.Pa)(a,b,c);m._QTS_GetPropNumber=(a,b,c)=>(m._QTS_GetPropNumber=Z.Qa)(a,b,c);m._QTS_SetProp=(a,b,c,d)=>(m._QTS_SetProp=Z.Ra)(a,b,c,d);m._QTS_DefineProp=(a,b,c,d,f,h,k,l,t)=>(m._QTS_DefineProp=Z.Sa)(a,b,c,d,f,h,k,l,t);m._QTS_GetOwnPropertyNames=(a,b,c,d,f)=>(m._QTS_GetOwnPropertyNames=Z.Ta)(a,b,c,d,f);m._QTS_Call=(a,b,c,d,f)=>(m._QTS_Call=Z.Ua)(a,b,c,d,f);
66
+ m._QTS_ResolveException=(a,b)=>(m._QTS_ResolveException=Z.Va)(a,b);m._QTS_Dump=(a,b)=>(m._QTS_Dump=Z.Wa)(a,b);m._QTS_Eval=(a,b,c,d,f,h)=>(m._QTS_Eval=Z.Xa)(a,b,c,d,f,h);m._QTS_GetModuleNamespace=(a,b)=>(m._QTS_GetModuleNamespace=Z.Ya)(a,b);m._QTS_Typeof=(a,b)=>(m._QTS_Typeof=Z.Za)(a,b);m._QTS_GetLength=(a,b,c)=>(m._QTS_GetLength=Z._a)(a,b,c);m._QTS_IsEqual=(a,b,c,d)=>(m._QTS_IsEqual=Z.$a)(a,b,c,d);m._QTS_GetGlobalObject=a=>(m._QTS_GetGlobalObject=Z.ab)(a);
67
+ m._QTS_NewPromiseCapability=(a,b)=>(m._QTS_NewPromiseCapability=Z.bb)(a,b);m._QTS_PromiseState=(a,b)=>(m._QTS_PromiseState=Z.cb)(a,b);m._QTS_PromiseResult=(a,b)=>(m._QTS_PromiseResult=Z.db)(a,b);m._QTS_TestStringArg=a=>(m._QTS_TestStringArg=Z.eb)(a);m._QTS_GetDebugLogEnabled=a=>(m._QTS_GetDebugLogEnabled=Z.fb)(a);m._QTS_SetDebugLogEnabled=(a,b)=>(m._QTS_SetDebugLogEnabled=Z.gb)(a,b);m._QTS_BuildIsDebug=()=>(m._QTS_BuildIsDebug=Z.hb)();m._QTS_BuildIsAsyncify=()=>(m._QTS_BuildIsAsyncify=Z.ib)();
68
+ m._QTS_NewFunction=(a,b,c)=>(m._QTS_NewFunction=Z.jb)(a,b,c);m._QTS_ArgvGetJSValueConstPointer=(a,b)=>(m._QTS_ArgvGetJSValueConstPointer=Z.kb)(a,b);m._QTS_RuntimeEnableInterruptHandler=a=>(m._QTS_RuntimeEnableInterruptHandler=Z.lb)(a);m._QTS_RuntimeDisableInterruptHandler=a=>(m._QTS_RuntimeDisableInterruptHandler=Z.mb)(a);m._QTS_RuntimeEnableModuleLoader=(a,b)=>(m._QTS_RuntimeEnableModuleLoader=Z.nb)(a,b);m._QTS_RuntimeDisableModuleLoader=a=>(m._QTS_RuntimeDisableModuleLoader=Z.ob)(a);
69
+ m._QTS_bjson_encode=(a,b)=>(m._QTS_bjson_encode=Z.pb)(a,b);m._QTS_bjson_decode=(a,b)=>(m._QTS_bjson_decode=Z.qb)(a,b);m._QTS_EvalFunction=(a,b)=>(m._QTS_EvalFunction=Z.rb)(a,b);m._QTS_EncodeBytecode=(a,b)=>(m._QTS_EncodeBytecode=Z.sb)(a,b);m._QTS_DecodeBytecode=(a,b)=>(m._QTS_DecodeBytecode=Z.tb)(a,b);
70
+ var rc=(a,b)=>(rc=Z.vb)(a,b),S=a=>(S=Z.wb)(a),jb=a=>(jb=Z.xb)(a),R=()=>(R=Z.yb)(),Db=a=>(Db=Z.zb)(a),nb=(a,b,c)=>(nb=Z.Ab)(a,b,c),xb=(a,b)=>(xb=Z.Bb)(a,b),Mb=a=>(Mb=Z.Cb)(a),Nb=(a,b,c)=>(Nb=Z.Db)(a,b,c),Ub=(a,b,c,d,f)=>(Ub=Z.Eb)(a,b,c,d,f),kb=(a,b,c)=>(kb=Z.Fb)(a,b,c),zb=a=>(zb=Z.Gb)(a),Pb=a=>(Pb=Z.Hb)(a),Yb=(a,b)=>(Yb=Z.Ib)(a,b),Zb=a=>(Zb=Z.Jb)(a),Tb=(a,b,c)=>(Tb=Z.Kb)(a,b,c),Sb=(a,b,c,d,f)=>(Sb=Z.Lb)(a,b,c,d,f),bc=(a,b)=>(bc=Z.Mb)(a,b),dc=(a,b)=>(dc=Z.Nb)(a,b),cc=(a,b)=>(cc=Z.Ob)(a,b),nc=(a,b,c,
71
+ d)=>(nc=Z.Pb)(a,b,c,d),mc=(a,b)=>(mc=Z.Qb)(a,b),Rb=(a,b,c)=>(Rb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ADRQC:103,EBADSLT:102,EDEADLOCK:16,EBFONT:101,ENOSTR:100,ENODATA:116,ETIME:117,ENOSR:118,ENONET:119,ENOPKG:120,EREMOTE:121,ENOLINK:47,EADV:122,ESRMNT:123,ECOMM:124,EPROTO:65,EMULTIHOP:36,EDOTDOT:125,EBADMSG:9,ENOTUNIQ:126,EBADFD:127,EREMCHG:128,ELIBACC:129,ELIBBAD:130,ELIBSCN:131,ELIBMAX:132,ELIBEXEC:133,ENOSYS:52,ENOTEMPTY:55,ENAMETOOLONG:37,ELOOP:32,EOPNOTSUPP:138,EPFNOSUPPORT:139,ECONNRESET:15,ENOBUFS:42,EAFNOSUPPORT:5,EPROTOTYPE:67,ENOTSOCK:57,ENOPROTOOPT:50,ESHUTDOWN:140,
74
- ECONNREFUSED:14,EADDRINUSE:3,ECONNABORTED:13,ENETUNREACH:40,ENETDOWN:38,ETIMEDOUT:73,EHOSTDOWN:142,EHOSTUNREACH:23,EINPROGRESS:26,EALREADY:7,EDESTADDRREQ:17,EMSGSIZE:35,EPROTONOSUPPORT:66,ESOCKTNOSUPPORT:137,EADDRNOTAVAIL:4,ENETRESET:39,EISCONN:30,ENOTCONN:53,ETOOMANYREFS:141,EUSERS:136,EDQUOT:19,ESTALE:72,ENOTSUP:138,ENOMEDIUM:148,EILSEQ:25,EOVERFLOW:61,ECANCELED:11,ENOTRECOVERABLE:56,EOWNERDEAD:62,ESTRPIPE:135};l.PATH=P;l.FS_createPreloadedFile=vb;l.FS_unlink=zb;l.FS_createPath=nc;l.FS=V;
75
- l.FS_createDataFile=pb;l.wasmfsOPFSGetOrCreateFile=Ya;l.wasmfsOPFSGetOrCreateDir=Za;var sc;A=function tc(){sc||uc();sc||(A=tc)};
76
- function uc(){function a(){if(!sc&&(sc=!0,l.calledRun=!0,!sa)){Ja(wa);ea(l);l.onRuntimeInitialized?.();if(l.postRun)for("function"==typeof l.postRun&&(l.postRun=[l.postRun]);l.postRun.length;){var b=l.postRun.shift();xa.unshift(b)}Ja(xa)}}if(!(0<z)){if(l.preRun)for("function"==typeof l.preRun&&(l.preRun=[l.preRun]);l.preRun.length;)ya();Ja(va);0<z||(l.setStatus?(l.setStatus("Running..."),setTimeout(function(){setTimeout(function(){l.setStatus("")},1);a()},1)):a())}}
77
- if(l.preInit)for("function"==typeof l.preInit&&(l.preInit=[l.preInit]);0<l.preInit.length;)l.preInit.pop()();uc();moduleRtn=ha;
75
+ ECONNREFUSED:14,EADDRINUSE:3,ECONNABORTED:13,ENETUNREACH:40,ENETDOWN:38,ETIMEDOUT:73,EHOSTDOWN:142,EHOSTUNREACH:23,EINPROGRESS:26,EALREADY:7,EDESTADDRREQ:17,EMSGSIZE:35,EPROTONOSUPPORT:66,ESOCKTNOSUPPORT:137,EADDRNOTAVAIL:4,ENETRESET:39,EISCONN:30,ENOTCONN:53,ETOOMANYREFS:141,EUSERS:136,EDQUOT:19,ESTALE:72,ENOTSUP:138,ENOMEDIUM:148,EILSEQ:25,EOVERFLOW:61,ECANCELED:11,ENOTRECOVERABLE:56,EOWNERDEAD:62,ESTRPIPE:135};
76
+ m.cwrap=(a,b,c,d)=>{var f=!c||c.every(h=>"number"===h||"boolean"===h);return"string"!==b&&f&&!d?m["_"+a]:(...h)=>oc(a,b,c,h)};m.PATH=P;m.UTF8ToString=Ma;m.stringToUTF8=(a,b,c)=>J(a,w,b,c);m.lengthBytesUTF8=L;m.FS_createPreloadedFile=wb;m.FS_unlink=Ab;m.FS_createPath=qc;m.FS=V;m.FS_createDataFile=qb;m.wasmfsOPFSGetOrCreateFile=Za;m.wasmfsOPFSGetOrCreateDir=$a;var uc;A=function vc(){uc||wc();uc||(A=vc)};
77
+ function wc(){function a(){if(!uc&&(uc=!0,m.calledRun=!0,!sa)){Ja(wa);ea(m);m.onRuntimeInitialized?.();if(m.postRun)for("function"==typeof m.postRun&&(m.postRun=[m.postRun]);m.postRun.length;){var b=m.postRun.shift();xa.unshift(b)}Ja(xa)}}if(!(0<z)){if(m.preRun)for("function"==typeof m.preRun&&(m.preRun=[m.preRun]);m.preRun.length;)ya();Ja(va);0<z||(m.setStatus?(m.setStatus("Running..."),setTimeout(function(){setTimeout(function(){m.setStatus("")},1);a()},1)):a())}}
78
+ if(m.preInit)for("function"==typeof m.preInit&&(m.preInit=[m.preInit]);0<m.preInit.length;)m.preInit.pop()();wc();moduleRtn=ha;
78
79
 
79
80
 
80
81
  return moduleRtn;
package/dist/ffi.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- import { QuickJSEmscriptenModule, JSContextPointer, JSValuePointer, JSValueConstPointer, JSRuntimePointer, OwnedHeapCharPointer, IntrinsicsFlags, JSVoidPointer, JSBorrowedCharPointer, BorrowedHeapCharPointer, JSContextPointerPointer, JSValuePointerPointerPointer, UInt32Pointer, JSValueConstPointerPointer, EvalDetectModule, EvalFlags, IsEqualOp, JSValuePointerPointer, JSPromiseStateEnum } from '@jitl/quickjs-ffi-types';
1
+ import { QuickJSEmscriptenModule, JSContextPointer, JSValuePointer, JSValueConstPointer, JSRuntimePointer, OwnedHeapCharPointer, IntrinsicsFlags, JSVoidPointer, JSBorrowedCharPointer, BorrowedHeapCharPointer, JSContextPointerPointer, JSValuePointerPointerPointer, UInt32Pointer, JSValueConstPointerPointer, EvalDetectModule, EvalFlags, IsEqualOp, JSValuePointerPointer, JSPromiseStateEnum } from '@componentor/quickjs-ffi-types';
2
2
 
3
3
  /**
4
4
  * Low-level FFI bindings to QuickJS's Emscripten module.
package/dist/ffi.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { QuickJSEmscriptenModule, JSContextPointer, JSValuePointer, JSValueConstPointer, JSRuntimePointer, OwnedHeapCharPointer, IntrinsicsFlags, JSVoidPointer, JSBorrowedCharPointer, BorrowedHeapCharPointer, JSContextPointerPointer, JSValuePointerPointerPointer, UInt32Pointer, JSValueConstPointerPointer, EvalDetectModule, EvalFlags, IsEqualOp, JSValuePointerPointer, JSPromiseStateEnum } from '@jitl/quickjs-ffi-types';
1
+ import { QuickJSEmscriptenModule, JSContextPointer, JSValuePointer, JSValueConstPointer, JSRuntimePointer, OwnedHeapCharPointer, IntrinsicsFlags, JSVoidPointer, JSBorrowedCharPointer, BorrowedHeapCharPointer, JSContextPointerPointer, JSValuePointerPointerPointer, UInt32Pointer, JSValueConstPointerPointer, EvalDetectModule, EvalFlags, IsEqualOp, JSValuePointerPointer, JSPromiseStateEnum } from '@componentor/quickjs-ffi-types';
2
2
 
3
3
  /**
4
4
  * Low-level FFI bindings to QuickJS's Emscripten module.
package/dist/ffi.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/ffi.ts"],"sourcesContent":["// This file generated by \"generate.ts ffi\" in the root of the repo.\nimport {\n QuickJSEmscriptenModule,\n JSRuntimePointer,\n JSContextPointer,\n JSContextPointerPointer,\n JSModuleDefPointer,\n JSValuePointer,\n JSValueConstPointer,\n JSValuePointerPointer,\n JSValuePointerPointerPointer,\n JSValueConstPointerPointer,\n QTS_C_To_HostCallbackFuncPointer,\n QTS_C_To_HostInterruptFuncPointer,\n QTS_C_To_HostLoadModuleFuncPointer,\n BorrowedHeapCharPointer,\n OwnedHeapCharPointer,\n JSBorrowedCharPointer,\n JSVoidPointer,\n UInt32Pointer,\n EvalFlags,\n IntrinsicsFlags,\n EvalDetectModule,\n GetOwnPropertyNamesFlags,\n IsEqualOp,\n JSPromiseStateEnum,\n} from \"@jitl/quickjs-ffi-types\"\n\n/**\n * Low-level FFI bindings to QuickJS's Emscripten module.\n * See instead {@link QuickJSContext}, the public Javascript interface exposed by this\n * library.\n *\n * @unstable The FFI interface is considered private and may change.\n */\nexport class QuickJSFFI {\n constructor(private module: QuickJSEmscriptenModule) {}\n /** Set at compile time. */\n readonly DEBUG = false\n\n QTS_Throw: (\n ctx: JSContextPointer,\n error: JSValuePointer | JSValueConstPointer,\n ) => JSValuePointer = this.module.cwrap(\"QTS_Throw\", \"number\", [\"number\", \"number\"])\n\n QTS_NewError: (ctx: JSContextPointer) => JSValuePointer = this.module.cwrap(\n \"QTS_NewError\",\n \"number\",\n [\"number\"],\n )\n\n QTS_RuntimeSetMemoryLimit: (rt: JSRuntimePointer, limit: number) => void = this.module.cwrap(\n \"QTS_RuntimeSetMemoryLimit\",\n null,\n [\"number\", \"number\"],\n )\n\n QTS_RuntimeComputeMemoryUsage: (rt: JSRuntimePointer, ctx: JSContextPointer) => JSValuePointer =\n this.module.cwrap(\"QTS_RuntimeComputeMemoryUsage\", \"number\", [\"number\", \"number\"])\n\n QTS_RuntimeDumpMemoryUsage: (rt: JSRuntimePointer) => OwnedHeapCharPointer = this.module.cwrap(\n \"QTS_RuntimeDumpMemoryUsage\",\n \"number\",\n [\"number\"],\n )\n\n QTS_RecoverableLeakCheck: () => number = this.module.cwrap(\n \"QTS_RecoverableLeakCheck\",\n \"number\",\n [],\n )\n\n QTS_BuildIsSanitizeLeak: () => number = this.module.cwrap(\"QTS_BuildIsSanitizeLeak\", \"number\", [])\n\n QTS_RuntimeSetMaxStackSize: (rt: JSRuntimePointer, stack_size: number) => void =\n this.module.cwrap(\"QTS_RuntimeSetMaxStackSize\", null, [\"number\", \"number\"])\n\n QTS_GetUndefined: () => JSValueConstPointer = this.module.cwrap(\"QTS_GetUndefined\", \"number\", [])\n\n QTS_GetNull: () => JSValueConstPointer = this.module.cwrap(\"QTS_GetNull\", \"number\", [])\n\n QTS_GetFalse: () => JSValueConstPointer = this.module.cwrap(\"QTS_GetFalse\", \"number\", [])\n\n QTS_GetTrue: () => JSValueConstPointer = this.module.cwrap(\"QTS_GetTrue\", \"number\", [])\n\n QTS_NewRuntime: () => JSRuntimePointer = this.module.cwrap(\"QTS_NewRuntime\", \"number\", [])\n\n QTS_FreeRuntime: (rt: JSRuntimePointer) => void = this.module.cwrap(\"QTS_FreeRuntime\", null, [\n \"number\",\n ])\n\n QTS_NewContext: (rt: JSRuntimePointer, intrinsics: IntrinsicsFlags) => JSContextPointer =\n this.module.cwrap(\"QTS_NewContext\", \"number\", [\"number\", \"number\"])\n\n QTS_FreeContext: (ctx: JSContextPointer) => void = this.module.cwrap(\"QTS_FreeContext\", null, [\n \"number\",\n ])\n\n QTS_FreeValuePointer: (ctx: JSContextPointer, value: JSValuePointer) => void = this.module.cwrap(\n \"QTS_FreeValuePointer\",\n null,\n [\"number\", \"number\"],\n )\n\n QTS_FreeValuePointerRuntime: (rt: JSRuntimePointer, value: JSValuePointer) => void =\n this.module.cwrap(\"QTS_FreeValuePointerRuntime\", null, [\"number\", \"number\"])\n\n QTS_FreeVoidPointer: (ctx: JSContextPointer, ptr: JSVoidPointer) => void = this.module.cwrap(\n \"QTS_FreeVoidPointer\",\n null,\n [\"number\", \"number\"],\n )\n\n QTS_FreeCString: (ctx: JSContextPointer, str: JSBorrowedCharPointer) => void = this.module.cwrap(\n \"QTS_FreeCString\",\n null,\n [\"number\", \"number\"],\n )\n\n QTS_DupValuePointer: (\n ctx: JSContextPointer,\n val: JSValuePointer | JSValueConstPointer,\n ) => JSValuePointer = this.module.cwrap(\"QTS_DupValuePointer\", \"number\", [\"number\", \"number\"])\n\n QTS_NewObject: (ctx: JSContextPointer) => JSValuePointer = this.module.cwrap(\n \"QTS_NewObject\",\n \"number\",\n [\"number\"],\n )\n\n QTS_NewObjectProto: (\n ctx: JSContextPointer,\n proto: JSValuePointer | JSValueConstPointer,\n ) => JSValuePointer = this.module.cwrap(\"QTS_NewObjectProto\", \"number\", [\"number\", \"number\"])\n\n QTS_NewArray: (ctx: JSContextPointer) => JSValuePointer = this.module.cwrap(\n \"QTS_NewArray\",\n \"number\",\n [\"number\"],\n )\n\n QTS_NewArrayBuffer: (\n ctx: JSContextPointer,\n buffer: JSVoidPointer,\n length: number,\n ) => JSValuePointer = this.module.cwrap(\"QTS_NewArrayBuffer\", \"number\", [\n \"number\",\n \"number\",\n \"number\",\n ])\n\n QTS_NewFloat64: (ctx: JSContextPointer, num: number) => JSValuePointer = this.module.cwrap(\n \"QTS_NewFloat64\",\n \"number\",\n [\"number\", \"number\"],\n )\n\n QTS_GetFloat64: (ctx: JSContextPointer, value: JSValuePointer | JSValueConstPointer) => number =\n this.module.cwrap(\"QTS_GetFloat64\", \"number\", [\"number\", \"number\"])\n\n QTS_NewString: (ctx: JSContextPointer, string: BorrowedHeapCharPointer) => JSValuePointer =\n this.module.cwrap(\"QTS_NewString\", \"number\", [\"number\", \"number\"])\n\n QTS_GetString: (\n ctx: JSContextPointer,\n value: JSValuePointer | JSValueConstPointer,\n ) => JSBorrowedCharPointer = this.module.cwrap(\"QTS_GetString\", \"number\", [\"number\", \"number\"])\n\n QTS_GetArrayBuffer: (\n ctx: JSContextPointer,\n data: JSValuePointer | JSValueConstPointer,\n ) => JSVoidPointer = this.module.cwrap(\"QTS_GetArrayBuffer\", \"number\", [\"number\", \"number\"])\n\n QTS_GetArrayBufferLength: (\n ctx: JSContextPointer,\n data: JSValuePointer | JSValueConstPointer,\n ) => number = this.module.cwrap(\"QTS_GetArrayBufferLength\", \"number\", [\"number\", \"number\"])\n\n QTS_NewSymbol: (\n ctx: JSContextPointer,\n description: BorrowedHeapCharPointer,\n isGlobal: number,\n ) => JSValuePointer = this.module.cwrap(\"QTS_NewSymbol\", \"number\", [\"number\", \"number\", \"number\"])\n\n QTS_GetSymbolDescriptionOrKey: (\n ctx: JSContextPointer,\n value: JSValuePointer | JSValueConstPointer,\n ) => JSBorrowedCharPointer = this.module.cwrap(\"QTS_GetSymbolDescriptionOrKey\", \"number\", [\n \"number\",\n \"number\",\n ])\n\n QTS_IsGlobalSymbol: (\n ctx: JSContextPointer,\n value: JSValuePointer | JSValueConstPointer,\n ) => number = this.module.cwrap(\"QTS_IsGlobalSymbol\", \"number\", [\"number\", \"number\"])\n\n QTS_IsJobPending: (rt: JSRuntimePointer) => number = this.module.cwrap(\n \"QTS_IsJobPending\",\n \"number\",\n [\"number\"],\n )\n\n QTS_ExecutePendingJob: (\n rt: JSRuntimePointer,\n maxJobsToExecute: number,\n lastJobContext: JSContextPointerPointer,\n ) => JSValuePointer = this.module.cwrap(\"QTS_ExecutePendingJob\", \"number\", [\n \"number\",\n \"number\",\n \"number\",\n ])\n\n QTS_GetProp: (\n ctx: JSContextPointer,\n this_val: JSValuePointer | JSValueConstPointer,\n prop_name: JSValuePointer | JSValueConstPointer,\n ) => JSValuePointer = this.module.cwrap(\"QTS_GetProp\", \"number\", [\"number\", \"number\", \"number\"])\n\n QTS_GetPropNumber: (\n ctx: JSContextPointer,\n this_val: JSValuePointer | JSValueConstPointer,\n prop_name: number,\n ) => JSValuePointer = this.module.cwrap(\"QTS_GetPropNumber\", \"number\", [\n \"number\",\n \"number\",\n \"number\",\n ])\n\n QTS_SetProp: (\n ctx: JSContextPointer,\n this_val: JSValuePointer | JSValueConstPointer,\n prop_name: JSValuePointer | JSValueConstPointer,\n prop_value: JSValuePointer | JSValueConstPointer,\n ) => void = this.module.cwrap(\"QTS_SetProp\", null, [\"number\", \"number\", \"number\", \"number\"])\n\n QTS_DefineProp: (\n ctx: JSContextPointer,\n this_val: JSValuePointer | JSValueConstPointer,\n prop_name: JSValuePointer | JSValueConstPointer,\n prop_value: JSValuePointer | JSValueConstPointer,\n get: JSValuePointer | JSValueConstPointer,\n set: JSValuePointer | JSValueConstPointer,\n configurable: boolean,\n enumerable: boolean,\n has_value: boolean,\n ) => void = this.module.cwrap(\"QTS_DefineProp\", null, [\n \"number\",\n \"number\",\n \"number\",\n \"number\",\n \"number\",\n \"number\",\n \"boolean\",\n \"boolean\",\n \"boolean\",\n ])\n\n QTS_GetOwnPropertyNames: (\n ctx: JSContextPointer,\n out_ptrs: JSValuePointerPointerPointer,\n out_len: UInt32Pointer,\n obj: JSValuePointer | JSValueConstPointer,\n flags: number,\n ) => JSValuePointer = this.module.cwrap(\"QTS_GetOwnPropertyNames\", \"number\", [\n \"number\",\n \"number\",\n \"number\",\n \"number\",\n \"number\",\n ])\n\n QTS_Call: (\n ctx: JSContextPointer,\n func_obj: JSValuePointer | JSValueConstPointer,\n this_obj: JSValuePointer | JSValueConstPointer,\n argc: number,\n argv_ptrs: JSValueConstPointerPointer,\n ) => JSValuePointer = this.module.cwrap(\"QTS_Call\", \"number\", [\n \"number\",\n \"number\",\n \"number\",\n \"number\",\n \"number\",\n ])\n\n QTS_ResolveException: (ctx: JSContextPointer, maybe_exception: JSValuePointer) => JSValuePointer =\n this.module.cwrap(\"QTS_ResolveException\", \"number\", [\"number\", \"number\"])\n\n QTS_Dump: (\n ctx: JSContextPointer,\n obj: JSValuePointer | JSValueConstPointer,\n ) => JSBorrowedCharPointer = this.module.cwrap(\"QTS_Dump\", \"number\", [\"number\", \"number\"])\n\n QTS_Eval: (\n ctx: JSContextPointer,\n js_code: BorrowedHeapCharPointer,\n js_code_length: number,\n filename: string,\n detectModule: EvalDetectModule,\n evalFlags: EvalFlags,\n ) => JSValuePointer = this.module.cwrap(\"QTS_Eval\", \"number\", [\n \"number\",\n \"number\",\n \"number\",\n \"string\",\n \"number\",\n \"number\",\n ])\n\n QTS_GetModuleNamespace: (\n ctx: JSContextPointer,\n module_func_obj: JSValuePointer | JSValueConstPointer,\n ) => JSValuePointer = this.module.cwrap(\"QTS_GetModuleNamespace\", \"number\", [\"number\", \"number\"])\n\n QTS_Typeof: (\n ctx: JSContextPointer,\n value: JSValuePointer | JSValueConstPointer,\n ) => OwnedHeapCharPointer = this.module.cwrap(\"QTS_Typeof\", \"number\", [\"number\", \"number\"])\n\n QTS_GetLength: (\n ctx: JSContextPointer,\n out_len: UInt32Pointer,\n value: JSValuePointer | JSValueConstPointer,\n ) => number = this.module.cwrap(\"QTS_GetLength\", \"number\", [\"number\", \"number\", \"number\"])\n\n QTS_IsEqual: (\n ctx: JSContextPointer,\n a: JSValuePointer | JSValueConstPointer,\n b: JSValuePointer | JSValueConstPointer,\n op: IsEqualOp,\n ) => number = this.module.cwrap(\"QTS_IsEqual\", \"number\", [\"number\", \"number\", \"number\", \"number\"])\n\n QTS_GetGlobalObject: (ctx: JSContextPointer) => JSValuePointer = this.module.cwrap(\n \"QTS_GetGlobalObject\",\n \"number\",\n [\"number\"],\n )\n\n QTS_NewPromiseCapability: (\n ctx: JSContextPointer,\n resolve_funcs_out: JSValuePointerPointer,\n ) => JSValuePointer = this.module.cwrap(\"QTS_NewPromiseCapability\", \"number\", [\n \"number\",\n \"number\",\n ])\n\n QTS_PromiseState: (\n ctx: JSContextPointer,\n promise: JSValuePointer | JSValueConstPointer,\n ) => JSPromiseStateEnum = this.module.cwrap(\"QTS_PromiseState\", \"number\", [\"number\", \"number\"])\n\n QTS_PromiseResult: (\n ctx: JSContextPointer,\n promise: JSValuePointer | JSValueConstPointer,\n ) => JSValuePointer = this.module.cwrap(\"QTS_PromiseResult\", \"number\", [\"number\", \"number\"])\n\n QTS_TestStringArg: (string: string) => void = this.module.cwrap(\"QTS_TestStringArg\", null, [\n \"string\",\n ])\n\n QTS_GetDebugLogEnabled: (rt: JSRuntimePointer) => number = this.module.cwrap(\n \"QTS_GetDebugLogEnabled\",\n \"number\",\n [\"number\"],\n )\n\n QTS_SetDebugLogEnabled: (rt: JSRuntimePointer, is_enabled: number) => void = this.module.cwrap(\n \"QTS_SetDebugLogEnabled\",\n null,\n [\"number\", \"number\"],\n )\n\n QTS_BuildIsDebug: () => number = this.module.cwrap(\"QTS_BuildIsDebug\", \"number\", [])\n\n QTS_BuildIsAsyncify: () => number = this.module.cwrap(\"QTS_BuildIsAsyncify\", \"number\", [])\n\n QTS_NewFunction: (ctx: JSContextPointer, func_id: number, name: string) => JSValuePointer =\n this.module.cwrap(\"QTS_NewFunction\", \"number\", [\"number\", \"number\", \"string\"])\n\n QTS_ArgvGetJSValueConstPointer: (\n argv: JSValuePointer | JSValueConstPointer,\n index: number,\n ) => JSValueConstPointer = this.module.cwrap(\"QTS_ArgvGetJSValueConstPointer\", \"number\", [\n \"number\",\n \"number\",\n ])\n\n QTS_RuntimeEnableInterruptHandler: (rt: JSRuntimePointer) => void = this.module.cwrap(\n \"QTS_RuntimeEnableInterruptHandler\",\n null,\n [\"number\"],\n )\n\n QTS_RuntimeDisableInterruptHandler: (rt: JSRuntimePointer) => void = this.module.cwrap(\n \"QTS_RuntimeDisableInterruptHandler\",\n null,\n [\"number\"],\n )\n\n QTS_RuntimeEnableModuleLoader: (rt: JSRuntimePointer, use_custom_normalize: number) => void =\n this.module.cwrap(\"QTS_RuntimeEnableModuleLoader\", null, [\"number\", \"number\"])\n\n QTS_RuntimeDisableModuleLoader: (rt: JSRuntimePointer) => void = this.module.cwrap(\n \"QTS_RuntimeDisableModuleLoader\",\n null,\n [\"number\"],\n )\n\n QTS_bjson_encode: (\n ctx: JSContextPointer,\n val: JSValuePointer | JSValueConstPointer,\n ) => JSValuePointer = this.module.cwrap(\"QTS_bjson_encode\", \"number\", [\"number\", \"number\"])\n\n QTS_bjson_decode: (\n ctx: JSContextPointer,\n data: JSValuePointer | JSValueConstPointer,\n ) => JSValuePointer = this.module.cwrap(\"QTS_bjson_decode\", \"number\", [\"number\", \"number\"])\n\n QTS_EvalFunction: (\n ctx: JSContextPointer,\n fun_obj: JSValuePointer | JSValueConstPointer,\n ) => JSValuePointer = this.module.cwrap(\"QTS_EvalFunction\", \"number\", [\"number\", \"number\"])\n\n QTS_EncodeBytecode: (\n ctx: JSContextPointer,\n val: JSValuePointer | JSValueConstPointer,\n ) => JSValuePointer = this.module.cwrap(\"QTS_EncodeBytecode\", \"number\", [\"number\", \"number\"])\n\n QTS_DecodeBytecode: (\n ctx: JSContextPointer,\n data: JSValuePointer | JSValueConstPointer,\n ) => JSValuePointer = this.module.cwrap(\"QTS_DecodeBytecode\", \"number\", [\"number\", \"number\"])\n}\n"],"mappings":"wpBAAA,8GAmCO,IAAM,WAAN,KAAiB,CACtB,YAAoBA,QAAiC,CAAjC,YAAAA,QAEpB,KAAS,MAAQ,GAEjB,eAGsB,KAAK,OAAO,MAAM,YAAa,SAAU,CAAC,SAAU,QAAQ,CAAC,EAEnF,kBAA0D,KAAK,OAAO,MACpE,eACA,SACA,CAAC,QAAQ,CACX,EAEA,+BAA2E,KAAK,OAAO,MACrF,4BACA,KACA,CAAC,SAAU,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,SAAU,QAAQ,CACrB,EAEA,sBAAiC,KAAK,OAAO,MAAM,mBAAoB,SAAU,CAAC,CAAC,EAEnF,yBAAoC,KAAK,OAAO,MAAM,sBAAuB,SAAU,CAAC,CAAC,EAEzF,qBACE,KAAK,OAAO,MAAM,kBAAmB,SAAU,CAAC,SAAU,SAAU,QAAQ,CAAC,EAE/E,oCAG2B,KAAK,OAAO,MAAM,iCAAkC,SAAU,CACvF,SACA,QACF,CAAC,EAED,uCAAoE,KAAK,OAAO,MAC9E,oCACA,KACA,CAAC,QAAQ,CACX,EAEA,wCAAqE,KAAK,OAAO,MAC/E,qCACA,KACA,CAAC,QAAQ,CACX,EAEA,mCACE,KAAK,OAAO,MAAM,gCAAiC,KAAM,CAAC,SAAU,QAAQ,CAAC,EAE/E,oCAAiE,KAAK,OAAO,MAC3E,iCACA,KACA,CAAC,QAAQ,CACX,EAEA,sBAGsB,KAAK,OAAO,MAAM,mBAAoB,SAAU,CAAC,SAAU,QAAQ,CAAC,EAE1F,sBAGsB,KAAK,OAAO,MAAM,mBAAoB,SAAU,CAAC,SAAU,QAAQ,CAAC,EAE1F,sBAGsB,KAAK,OAAO,MAAM,mBAAoB,SAAU,CAAC,SAAU,QAAQ,CAAC,EAE1F,wBAGsB,KAAK,OAAO,MAAM,qBAAsB,SAAU,CAAC,SAAU,QAAQ,CAAC,EAE5F,wBAGsB,KAAK,OAAO,MAAM,qBAAsB,SAAU,CAAC,SAAU,QAAQ,CAAC,CA5YtC,CA6YxD","names":["module"]}
1
+ {"version":3,"sources":["../src/ffi.ts"],"sourcesContent":["// This file generated by \"generate.ts ffi\" in the root of the repo.\nimport {\n QuickJSEmscriptenModule,\n JSRuntimePointer,\n JSContextPointer,\n JSContextPointerPointer,\n JSModuleDefPointer,\n JSValuePointer,\n JSValueConstPointer,\n JSValuePointerPointer,\n JSValuePointerPointerPointer,\n JSValueConstPointerPointer,\n QTS_C_To_HostCallbackFuncPointer,\n QTS_C_To_HostInterruptFuncPointer,\n QTS_C_To_HostLoadModuleFuncPointer,\n BorrowedHeapCharPointer,\n OwnedHeapCharPointer,\n JSBorrowedCharPointer,\n JSVoidPointer,\n UInt32Pointer,\n EvalFlags,\n IntrinsicsFlags,\n EvalDetectModule,\n GetOwnPropertyNamesFlags,\n IsEqualOp,\n JSPromiseStateEnum,\n} from \"@componentor/quickjs-ffi-types\"\n\n/**\n * Low-level FFI bindings to QuickJS's Emscripten module.\n * See instead {@link QuickJSContext}, the public Javascript interface exposed by this\n * library.\n *\n * @unstable The FFI interface is considered private and may change.\n */\nexport class QuickJSFFI {\n constructor(private module: QuickJSEmscriptenModule) {}\n /** Set at compile time. */\n readonly DEBUG = false\n\n QTS_Throw: (\n ctx: JSContextPointer,\n error: JSValuePointer | JSValueConstPointer,\n ) => JSValuePointer = this.module.cwrap(\"QTS_Throw\", \"number\", [\"number\", \"number\"])\n\n QTS_NewError: (ctx: JSContextPointer) => JSValuePointer = this.module.cwrap(\n \"QTS_NewError\",\n \"number\",\n [\"number\"],\n )\n\n QTS_RuntimeSetMemoryLimit: (rt: JSRuntimePointer, limit: number) => void = this.module.cwrap(\n \"QTS_RuntimeSetMemoryLimit\",\n null,\n [\"number\", \"number\"],\n )\n\n QTS_RuntimeComputeMemoryUsage: (rt: JSRuntimePointer, ctx: JSContextPointer) => JSValuePointer =\n this.module.cwrap(\"QTS_RuntimeComputeMemoryUsage\", \"number\", [\"number\", \"number\"])\n\n QTS_RuntimeDumpMemoryUsage: (rt: JSRuntimePointer) => OwnedHeapCharPointer = this.module.cwrap(\n \"QTS_RuntimeDumpMemoryUsage\",\n \"number\",\n [\"number\"],\n )\n\n QTS_RecoverableLeakCheck: () => number = this.module.cwrap(\n \"QTS_RecoverableLeakCheck\",\n \"number\",\n [],\n )\n\n QTS_BuildIsSanitizeLeak: () => number = this.module.cwrap(\"QTS_BuildIsSanitizeLeak\", \"number\", [])\n\n QTS_RuntimeSetMaxStackSize: (rt: JSRuntimePointer, stack_size: number) => void =\n this.module.cwrap(\"QTS_RuntimeSetMaxStackSize\", null, [\"number\", \"number\"])\n\n QTS_GetUndefined: () => JSValueConstPointer = this.module.cwrap(\"QTS_GetUndefined\", \"number\", [])\n\n QTS_GetNull: () => JSValueConstPointer = this.module.cwrap(\"QTS_GetNull\", \"number\", [])\n\n QTS_GetFalse: () => JSValueConstPointer = this.module.cwrap(\"QTS_GetFalse\", \"number\", [])\n\n QTS_GetTrue: () => JSValueConstPointer = this.module.cwrap(\"QTS_GetTrue\", \"number\", [])\n\n QTS_NewRuntime: () => JSRuntimePointer = this.module.cwrap(\"QTS_NewRuntime\", \"number\", [])\n\n QTS_FreeRuntime: (rt: JSRuntimePointer) => void = this.module.cwrap(\"QTS_FreeRuntime\", null, [\n \"number\",\n ])\n\n QTS_NewContext: (rt: JSRuntimePointer, intrinsics: IntrinsicsFlags) => JSContextPointer =\n this.module.cwrap(\"QTS_NewContext\", \"number\", [\"number\", \"number\"])\n\n QTS_FreeContext: (ctx: JSContextPointer) => void = this.module.cwrap(\"QTS_FreeContext\", null, [\n \"number\",\n ])\n\n QTS_FreeValuePointer: (ctx: JSContextPointer, value: JSValuePointer) => void = this.module.cwrap(\n \"QTS_FreeValuePointer\",\n null,\n [\"number\", \"number\"],\n )\n\n QTS_FreeValuePointerRuntime: (rt: JSRuntimePointer, value: JSValuePointer) => void =\n this.module.cwrap(\"QTS_FreeValuePointerRuntime\", null, [\"number\", \"number\"])\n\n QTS_FreeVoidPointer: (ctx: JSContextPointer, ptr: JSVoidPointer) => void = this.module.cwrap(\n \"QTS_FreeVoidPointer\",\n null,\n [\"number\", \"number\"],\n )\n\n QTS_FreeCString: (ctx: JSContextPointer, str: JSBorrowedCharPointer) => void = this.module.cwrap(\n \"QTS_FreeCString\",\n null,\n [\"number\", \"number\"],\n )\n\n QTS_DupValuePointer: (\n ctx: JSContextPointer,\n val: JSValuePointer | JSValueConstPointer,\n ) => JSValuePointer = this.module.cwrap(\"QTS_DupValuePointer\", \"number\", [\"number\", \"number\"])\n\n QTS_NewObject: (ctx: JSContextPointer) => JSValuePointer = this.module.cwrap(\n \"QTS_NewObject\",\n \"number\",\n [\"number\"],\n )\n\n QTS_NewObjectProto: (\n ctx: JSContextPointer,\n proto: JSValuePointer | JSValueConstPointer,\n ) => JSValuePointer = this.module.cwrap(\"QTS_NewObjectProto\", \"number\", [\"number\", \"number\"])\n\n QTS_NewArray: (ctx: JSContextPointer) => JSValuePointer = this.module.cwrap(\n \"QTS_NewArray\",\n \"number\",\n [\"number\"],\n )\n\n QTS_NewArrayBuffer: (\n ctx: JSContextPointer,\n buffer: JSVoidPointer,\n length: number,\n ) => JSValuePointer = this.module.cwrap(\"QTS_NewArrayBuffer\", \"number\", [\n \"number\",\n \"number\",\n \"number\",\n ])\n\n QTS_NewFloat64: (ctx: JSContextPointer, num: number) => JSValuePointer = this.module.cwrap(\n \"QTS_NewFloat64\",\n \"number\",\n [\"number\", \"number\"],\n )\n\n QTS_GetFloat64: (ctx: JSContextPointer, value: JSValuePointer | JSValueConstPointer) => number =\n this.module.cwrap(\"QTS_GetFloat64\", \"number\", [\"number\", \"number\"])\n\n QTS_NewString: (ctx: JSContextPointer, string: BorrowedHeapCharPointer) => JSValuePointer =\n this.module.cwrap(\"QTS_NewString\", \"number\", [\"number\", \"number\"])\n\n QTS_GetString: (\n ctx: JSContextPointer,\n value: JSValuePointer | JSValueConstPointer,\n ) => JSBorrowedCharPointer = this.module.cwrap(\"QTS_GetString\", \"number\", [\"number\", \"number\"])\n\n QTS_GetArrayBuffer: (\n ctx: JSContextPointer,\n data: JSValuePointer | JSValueConstPointer,\n ) => JSVoidPointer = this.module.cwrap(\"QTS_GetArrayBuffer\", \"number\", [\"number\", \"number\"])\n\n QTS_GetArrayBufferLength: (\n ctx: JSContextPointer,\n data: JSValuePointer | JSValueConstPointer,\n ) => number = this.module.cwrap(\"QTS_GetArrayBufferLength\", \"number\", [\"number\", \"number\"])\n\n QTS_NewSymbol: (\n ctx: JSContextPointer,\n description: BorrowedHeapCharPointer,\n isGlobal: number,\n ) => JSValuePointer = this.module.cwrap(\"QTS_NewSymbol\", \"number\", [\"number\", \"number\", \"number\"])\n\n QTS_GetSymbolDescriptionOrKey: (\n ctx: JSContextPointer,\n value: JSValuePointer | JSValueConstPointer,\n ) => JSBorrowedCharPointer = this.module.cwrap(\"QTS_GetSymbolDescriptionOrKey\", \"number\", [\n \"number\",\n \"number\",\n ])\n\n QTS_IsGlobalSymbol: (\n ctx: JSContextPointer,\n value: JSValuePointer | JSValueConstPointer,\n ) => number = this.module.cwrap(\"QTS_IsGlobalSymbol\", \"number\", [\"number\", \"number\"])\n\n QTS_IsJobPending: (rt: JSRuntimePointer) => number = this.module.cwrap(\n \"QTS_IsJobPending\",\n \"number\",\n [\"number\"],\n )\n\n QTS_ExecutePendingJob: (\n rt: JSRuntimePointer,\n maxJobsToExecute: number,\n lastJobContext: JSContextPointerPointer,\n ) => JSValuePointer = this.module.cwrap(\"QTS_ExecutePendingJob\", \"number\", [\n \"number\",\n \"number\",\n \"number\",\n ])\n\n QTS_GetProp: (\n ctx: JSContextPointer,\n this_val: JSValuePointer | JSValueConstPointer,\n prop_name: JSValuePointer | JSValueConstPointer,\n ) => JSValuePointer = this.module.cwrap(\"QTS_GetProp\", \"number\", [\"number\", \"number\", \"number\"])\n\n QTS_GetPropNumber: (\n ctx: JSContextPointer,\n this_val: JSValuePointer | JSValueConstPointer,\n prop_name: number,\n ) => JSValuePointer = this.module.cwrap(\"QTS_GetPropNumber\", \"number\", [\n \"number\",\n \"number\",\n \"number\",\n ])\n\n QTS_SetProp: (\n ctx: JSContextPointer,\n this_val: JSValuePointer | JSValueConstPointer,\n prop_name: JSValuePointer | JSValueConstPointer,\n prop_value: JSValuePointer | JSValueConstPointer,\n ) => void = this.module.cwrap(\"QTS_SetProp\", null, [\"number\", \"number\", \"number\", \"number\"])\n\n QTS_DefineProp: (\n ctx: JSContextPointer,\n this_val: JSValuePointer | JSValueConstPointer,\n prop_name: JSValuePointer | JSValueConstPointer,\n prop_value: JSValuePointer | JSValueConstPointer,\n get: JSValuePointer | JSValueConstPointer,\n set: JSValuePointer | JSValueConstPointer,\n configurable: boolean,\n enumerable: boolean,\n has_value: boolean,\n ) => void = this.module.cwrap(\"QTS_DefineProp\", null, [\n \"number\",\n \"number\",\n \"number\",\n \"number\",\n \"number\",\n \"number\",\n \"boolean\",\n \"boolean\",\n \"boolean\",\n ])\n\n QTS_GetOwnPropertyNames: (\n ctx: JSContextPointer,\n out_ptrs: JSValuePointerPointerPointer,\n out_len: UInt32Pointer,\n obj: JSValuePointer | JSValueConstPointer,\n flags: number,\n ) => JSValuePointer = this.module.cwrap(\"QTS_GetOwnPropertyNames\", \"number\", [\n \"number\",\n \"number\",\n \"number\",\n \"number\",\n \"number\",\n ])\n\n QTS_Call: (\n ctx: JSContextPointer,\n func_obj: JSValuePointer | JSValueConstPointer,\n this_obj: JSValuePointer | JSValueConstPointer,\n argc: number,\n argv_ptrs: JSValueConstPointerPointer,\n ) => JSValuePointer = this.module.cwrap(\"QTS_Call\", \"number\", [\n \"number\",\n \"number\",\n \"number\",\n \"number\",\n \"number\",\n ])\n\n QTS_ResolveException: (ctx: JSContextPointer, maybe_exception: JSValuePointer) => JSValuePointer =\n this.module.cwrap(\"QTS_ResolveException\", \"number\", [\"number\", \"number\"])\n\n QTS_Dump: (\n ctx: JSContextPointer,\n obj: JSValuePointer | JSValueConstPointer,\n ) => JSBorrowedCharPointer = this.module.cwrap(\"QTS_Dump\", \"number\", [\"number\", \"number\"])\n\n QTS_Eval: (\n ctx: JSContextPointer,\n js_code: BorrowedHeapCharPointer,\n js_code_length: number,\n filename: string,\n detectModule: EvalDetectModule,\n evalFlags: EvalFlags,\n ) => JSValuePointer = this.module.cwrap(\"QTS_Eval\", \"number\", [\n \"number\",\n \"number\",\n \"number\",\n \"string\",\n \"number\",\n \"number\",\n ])\n\n QTS_GetModuleNamespace: (\n ctx: JSContextPointer,\n module_func_obj: JSValuePointer | JSValueConstPointer,\n ) => JSValuePointer = this.module.cwrap(\"QTS_GetModuleNamespace\", \"number\", [\"number\", \"number\"])\n\n QTS_Typeof: (\n ctx: JSContextPointer,\n value: JSValuePointer | JSValueConstPointer,\n ) => OwnedHeapCharPointer = this.module.cwrap(\"QTS_Typeof\", \"number\", [\"number\", \"number\"])\n\n QTS_GetLength: (\n ctx: JSContextPointer,\n out_len: UInt32Pointer,\n value: JSValuePointer | JSValueConstPointer,\n ) => number = this.module.cwrap(\"QTS_GetLength\", \"number\", [\"number\", \"number\", \"number\"])\n\n QTS_IsEqual: (\n ctx: JSContextPointer,\n a: JSValuePointer | JSValueConstPointer,\n b: JSValuePointer | JSValueConstPointer,\n op: IsEqualOp,\n ) => number = this.module.cwrap(\"QTS_IsEqual\", \"number\", [\"number\", \"number\", \"number\", \"number\"])\n\n QTS_GetGlobalObject: (ctx: JSContextPointer) => JSValuePointer = this.module.cwrap(\n \"QTS_GetGlobalObject\",\n \"number\",\n [\"number\"],\n )\n\n QTS_NewPromiseCapability: (\n ctx: JSContextPointer,\n resolve_funcs_out: JSValuePointerPointer,\n ) => JSValuePointer = this.module.cwrap(\"QTS_NewPromiseCapability\", \"number\", [\n \"number\",\n \"number\",\n ])\n\n QTS_PromiseState: (\n ctx: JSContextPointer,\n promise: JSValuePointer | JSValueConstPointer,\n ) => JSPromiseStateEnum = this.module.cwrap(\"QTS_PromiseState\", \"number\", [\"number\", \"number\"])\n\n QTS_PromiseResult: (\n ctx: JSContextPointer,\n promise: JSValuePointer | JSValueConstPointer,\n ) => JSValuePointer = this.module.cwrap(\"QTS_PromiseResult\", \"number\", [\"number\", \"number\"])\n\n QTS_TestStringArg: (string: string) => void = this.module.cwrap(\"QTS_TestStringArg\", null, [\n \"string\",\n ])\n\n QTS_GetDebugLogEnabled: (rt: JSRuntimePointer) => number = this.module.cwrap(\n \"QTS_GetDebugLogEnabled\",\n \"number\",\n [\"number\"],\n )\n\n QTS_SetDebugLogEnabled: (rt: JSRuntimePointer, is_enabled: number) => void = this.module.cwrap(\n \"QTS_SetDebugLogEnabled\",\n null,\n [\"number\", \"number\"],\n )\n\n QTS_BuildIsDebug: () => number = this.module.cwrap(\"QTS_BuildIsDebug\", \"number\", [])\n\n QTS_BuildIsAsyncify: () => number = this.module.cwrap(\"QTS_BuildIsAsyncify\", \"number\", [])\n\n QTS_NewFunction: (ctx: JSContextPointer, func_id: number, name: string) => JSValuePointer =\n this.module.cwrap(\"QTS_NewFunction\", \"number\", [\"number\", \"number\", \"string\"])\n\n QTS_ArgvGetJSValueConstPointer: (\n argv: JSValuePointer | JSValueConstPointer,\n index: number,\n ) => JSValueConstPointer = this.module.cwrap(\"QTS_ArgvGetJSValueConstPointer\", \"number\", [\n \"number\",\n \"number\",\n ])\n\n QTS_RuntimeEnableInterruptHandler: (rt: JSRuntimePointer) => void = this.module.cwrap(\n \"QTS_RuntimeEnableInterruptHandler\",\n null,\n [\"number\"],\n )\n\n QTS_RuntimeDisableInterruptHandler: (rt: JSRuntimePointer) => void = this.module.cwrap(\n \"QTS_RuntimeDisableInterruptHandler\",\n null,\n [\"number\"],\n )\n\n QTS_RuntimeEnableModuleLoader: (rt: JSRuntimePointer, use_custom_normalize: number) => void =\n this.module.cwrap(\"QTS_RuntimeEnableModuleLoader\", null, [\"number\", \"number\"])\n\n QTS_RuntimeDisableModuleLoader: (rt: JSRuntimePointer) => void = this.module.cwrap(\n \"QTS_RuntimeDisableModuleLoader\",\n null,\n [\"number\"],\n )\n\n QTS_bjson_encode: (\n ctx: JSContextPointer,\n val: JSValuePointer | JSValueConstPointer,\n ) => JSValuePointer = this.module.cwrap(\"QTS_bjson_encode\", \"number\", [\"number\", \"number\"])\n\n QTS_bjson_decode: (\n ctx: JSContextPointer,\n data: JSValuePointer | JSValueConstPointer,\n ) => JSValuePointer = this.module.cwrap(\"QTS_bjson_decode\", \"number\", [\"number\", \"number\"])\n\n QTS_EvalFunction: (\n ctx: JSContextPointer,\n fun_obj: JSValuePointer | JSValueConstPointer,\n ) => JSValuePointer = this.module.cwrap(\"QTS_EvalFunction\", \"number\", [\"number\", \"number\"])\n\n QTS_EncodeBytecode: (\n ctx: JSContextPointer,\n val: JSValuePointer | JSValueConstPointer,\n ) => JSValuePointer = this.module.cwrap(\"QTS_EncodeBytecode\", \"number\", [\"number\", \"number\"])\n\n QTS_DecodeBytecode: (\n ctx: JSContextPointer,\n data: JSValuePointer | JSValueConstPointer,\n ) => JSValuePointer = this.module.cwrap(\"QTS_DecodeBytecode\", \"number\", [\"number\", \"number\"])\n}\n"],"mappings":"wpBAAA,8GAmCO,IAAM,WAAN,KAAiB,CACtB,YAAoBA,QAAiC,CAAjC,YAAAA,QAEpB,KAAS,MAAQ,GAEjB,eAGsB,KAAK,OAAO,MAAM,YAAa,SAAU,CAAC,SAAU,QAAQ,CAAC,EAEnF,kBAA0D,KAAK,OAAO,MACpE,eACA,SACA,CAAC,QAAQ,CACX,EAEA,+BAA2E,KAAK,OAAO,MACrF,4BACA,KACA,CAAC,SAAU,QAAQ,CACrB,EAEA,mCACE,KAAK,OAAO,MAAM,gCAAiC,SAAU,CAAC,SAAU,QAAQ,CAAC,EAEnF,gCAA6E,KAAK,OAAO,MACvF,6BACA,SACA,CAAC,QAAQ,CACX,EAEA,8BAAyC,KAAK,OAAO,MACnD,2BACA,SACA,CAAC,CACH,EAEA,6BAAwC,KAAK,OAAO,MAAM,0BAA2B,SAAU,CAAC,CAAC,EAEjG,gCACE,KAAK,OAAO,MAAM,6BAA8B,KAAM,CAAC,SAAU,QAAQ,CAAC,EAE5E,sBAA8C,KAAK,OAAO,MAAM,mBAAoB,SAAU,CAAC,CAAC,EAEhG,iBAAyC,KAAK,OAAO,MAAM,cAAe,SAAU,CAAC,CAAC,EAEtF,kBAA0C,KAAK,OAAO,MAAM,eAAgB,SAAU,CAAC,CAAC,EAExF,iBAAyC,KAAK,OAAO,MAAM,cAAe,SAAU,CAAC,CAAC,EAEtF,oBAAyC,KAAK,OAAO,MAAM,iBAAkB,SAAU,CAAC,CAAC,EAEzF,qBAAk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,OAAO,MAAM,mBAAoB,SAAU,CAAC,SAAU,QAAQ,CAAC,EAE1F,sBAGsB,KAAK,OAAO,MAAM,mBAAoB,SAAU,CAAC,SAAU,QAAQ,CAAC,EAE1F,wBAGsB,KAAK,OAAO,MAAM,qBAAsB,SAAU,CAAC,SAAU,QAAQ,CAAC,EAE5F,wBAGsB,KAAK,OAAO,MAAM,qBAAsB,SAAU,CAAC,SAAU,QAAQ,CAAC,CA5YtC,CA6YxD","names":["module"]}
package/dist/ffi.mjs.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/ffi.ts"],"sourcesContent":["// This file generated by \"generate.ts ffi\" in the root of the repo.\nimport {\n QuickJSEmscriptenModule,\n JSRuntimePointer,\n JSContextPointer,\n JSContextPointerPointer,\n JSModuleDefPointer,\n JSValuePointer,\n JSValueConstPointer,\n JSValuePointerPointer,\n JSValuePointerPointerPointer,\n JSValueConstPointerPointer,\n QTS_C_To_HostCallbackFuncPointer,\n QTS_C_To_HostInterruptFuncPointer,\n QTS_C_To_HostLoadModuleFuncPointer,\n BorrowedHeapCharPointer,\n OwnedHeapCharPointer,\n JSBorrowedCharPointer,\n JSVoidPointer,\n UInt32Pointer,\n EvalFlags,\n IntrinsicsFlags,\n EvalDetectModule,\n GetOwnPropertyNamesFlags,\n IsEqualOp,\n JSPromiseStateEnum,\n} from \"@jitl/quickjs-ffi-types\"\n\n/**\n * Low-level FFI bindings to QuickJS's Emscripten module.\n * See instead {@link QuickJSContext}, the public Javascript interface exposed by this\n * library.\n *\n * @unstable The FFI interface is considered private and may change.\n */\nexport class QuickJSFFI {\n constructor(private module: QuickJSEmscriptenModule) {}\n /** Set at compile time. */\n readonly DEBUG = false\n\n QTS_Throw: (\n ctx: JSContextPointer,\n error: JSValuePointer | JSValueConstPointer,\n ) => JSValuePointer = this.module.cwrap(\"QTS_Throw\", \"number\", [\"number\", \"number\"])\n\n QTS_NewError: (ctx: JSContextPointer) => JSValuePointer = this.module.cwrap(\n \"QTS_NewError\",\n \"number\",\n [\"number\"],\n )\n\n QTS_RuntimeSetMemoryLimit: (rt: JSRuntimePointer, limit: number) => void = this.module.cwrap(\n \"QTS_RuntimeSetMemoryLimit\",\n null,\n [\"number\", \"number\"],\n )\n\n QTS_RuntimeComputeMemoryUsage: (rt: JSRuntimePointer, ctx: JSContextPointer) => JSValuePointer =\n this.module.cwrap(\"QTS_RuntimeComputeMemoryUsage\", \"number\", [\"number\", \"number\"])\n\n QTS_RuntimeDumpMemoryUsage: (rt: JSRuntimePointer) => OwnedHeapCharPointer = this.module.cwrap(\n \"QTS_RuntimeDumpMemoryUsage\",\n \"number\",\n [\"number\"],\n )\n\n QTS_RecoverableLeakCheck: () => number = this.module.cwrap(\n \"QTS_RecoverableLeakCheck\",\n \"number\",\n [],\n )\n\n QTS_BuildIsSanitizeLeak: () => number = this.module.cwrap(\"QTS_BuildIsSanitizeLeak\", \"number\", [])\n\n QTS_RuntimeSetMaxStackSize: (rt: JSRuntimePointer, stack_size: number) => void =\n this.module.cwrap(\"QTS_RuntimeSetMaxStackSize\", null, [\"number\", \"number\"])\n\n QTS_GetUndefined: () => JSValueConstPointer = this.module.cwrap(\"QTS_GetUndefined\", \"number\", [])\n\n QTS_GetNull: () => JSValueConstPointer = this.module.cwrap(\"QTS_GetNull\", \"number\", [])\n\n QTS_GetFalse: () => JSValueConstPointer = this.module.cwrap(\"QTS_GetFalse\", \"number\", [])\n\n QTS_GetTrue: () => JSValueConstPointer = this.module.cwrap(\"QTS_GetTrue\", \"number\", [])\n\n QTS_NewRuntime: () => JSRuntimePointer = this.module.cwrap(\"QTS_NewRuntime\", \"number\", [])\n\n QTS_FreeRuntime: (rt: JSRuntimePointer) => void = this.module.cwrap(\"QTS_FreeRuntime\", null, [\n \"number\",\n ])\n\n QTS_NewContext: (rt: JSRuntimePointer, intrinsics: IntrinsicsFlags) => JSContextPointer =\n this.module.cwrap(\"QTS_NewContext\", \"number\", [\"number\", \"number\"])\n\n QTS_FreeContext: (ctx: JSContextPointer) => void = this.module.cwrap(\"QTS_FreeContext\", null, [\n \"number\",\n ])\n\n QTS_FreeValuePointer: (ctx: JSContextPointer, value: JSValuePointer) => void = this.module.cwrap(\n \"QTS_FreeValuePointer\",\n null,\n [\"number\", \"number\"],\n )\n\n QTS_FreeValuePointerRuntime: (rt: JSRuntimePointer, value: JSValuePointer) => void =\n this.module.cwrap(\"QTS_FreeValuePointerRuntime\", null, [\"number\", \"number\"])\n\n QTS_FreeVoidPointer: (ctx: JSContextPointer, ptr: JSVoidPointer) => void = this.module.cwrap(\n \"QTS_FreeVoidPointer\",\n null,\n [\"number\", \"number\"],\n )\n\n QTS_FreeCString: (ctx: JSContextPointer, str: JSBorrowedCharPointer) => void = this.module.cwrap(\n \"QTS_FreeCString\",\n null,\n [\"number\", \"number\"],\n )\n\n QTS_DupValuePointer: (\n ctx: JSContextPointer,\n val: JSValuePointer | JSValueConstPointer,\n ) => JSValuePointer = this.module.cwrap(\"QTS_DupValuePointer\", \"number\", [\"number\", \"number\"])\n\n QTS_NewObject: (ctx: JSContextPointer) => JSValuePointer = this.module.cwrap(\n \"QTS_NewObject\",\n \"number\",\n [\"number\"],\n )\n\n QTS_NewObjectProto: (\n ctx: JSContextPointer,\n proto: JSValuePointer | JSValueConstPointer,\n ) => JSValuePointer = this.module.cwrap(\"QTS_NewObjectProto\", \"number\", [\"number\", \"number\"])\n\n QTS_NewArray: (ctx: JSContextPointer) => JSValuePointer = this.module.cwrap(\n \"QTS_NewArray\",\n \"number\",\n [\"number\"],\n )\n\n QTS_NewArrayBuffer: (\n ctx: JSContextPointer,\n buffer: JSVoidPointer,\n length: number,\n ) => JSValuePointer = this.module.cwrap(\"QTS_NewArrayBuffer\", \"number\", [\n \"number\",\n \"number\",\n \"number\",\n ])\n\n QTS_NewFloat64: (ctx: JSContextPointer, num: number) => JSValuePointer = this.module.cwrap(\n \"QTS_NewFloat64\",\n \"number\",\n [\"number\", \"number\"],\n )\n\n QTS_GetFloat64: (ctx: JSContextPointer, value: JSValuePointer | JSValueConstPointer) => number =\n this.module.cwrap(\"QTS_GetFloat64\", \"number\", [\"number\", \"number\"])\n\n QTS_NewString: (ctx: JSContextPointer, string: BorrowedHeapCharPointer) => JSValuePointer =\n this.module.cwrap(\"QTS_NewString\", \"number\", [\"number\", \"number\"])\n\n QTS_GetString: (\n ctx: JSContextPointer,\n value: JSValuePointer | JSValueConstPointer,\n ) => JSBorrowedCharPointer = this.module.cwrap(\"QTS_GetString\", \"number\", [\"number\", \"number\"])\n\n QTS_GetArrayBuffer: (\n ctx: JSContextPointer,\n data: JSValuePointer | JSValueConstPointer,\n ) => JSVoidPointer = this.module.cwrap(\"QTS_GetArrayBuffer\", \"number\", [\"number\", \"number\"])\n\n QTS_GetArrayBufferLength: (\n ctx: JSContextPointer,\n data: JSValuePointer | JSValueConstPointer,\n ) => number = this.module.cwrap(\"QTS_GetArrayBufferLength\", \"number\", [\"number\", \"number\"])\n\n QTS_NewSymbol: (\n ctx: JSContextPointer,\n description: BorrowedHeapCharPointer,\n isGlobal: number,\n ) => JSValuePointer = this.module.cwrap(\"QTS_NewSymbol\", \"number\", [\"number\", \"number\", \"number\"])\n\n QTS_GetSymbolDescriptionOrKey: (\n ctx: JSContextPointer,\n value: JSValuePointer | JSValueConstPointer,\n ) => JSBorrowedCharPointer = this.module.cwrap(\"QTS_GetSymbolDescriptionOrKey\", \"number\", [\n \"number\",\n \"number\",\n ])\n\n QTS_IsGlobalSymbol: (\n ctx: JSContextPointer,\n value: JSValuePointer | JSValueConstPointer,\n ) => number = this.module.cwrap(\"QTS_IsGlobalSymbol\", \"number\", [\"number\", \"number\"])\n\n QTS_IsJobPending: (rt: JSRuntimePointer) => number = this.module.cwrap(\n \"QTS_IsJobPending\",\n \"number\",\n [\"number\"],\n )\n\n QTS_ExecutePendingJob: (\n rt: JSRuntimePointer,\n maxJobsToExecute: number,\n lastJobContext: JSContextPointerPointer,\n ) => JSValuePointer = this.module.cwrap(\"QTS_ExecutePendingJob\", \"number\", [\n \"number\",\n \"number\",\n \"number\",\n ])\n\n QTS_GetProp: (\n ctx: JSContextPointer,\n this_val: JSValuePointer | JSValueConstPointer,\n prop_name: JSValuePointer | JSValueConstPointer,\n ) => JSValuePointer = this.module.cwrap(\"QTS_GetProp\", \"number\", [\"number\", \"number\", \"number\"])\n\n QTS_GetPropNumber: (\n ctx: JSContextPointer,\n this_val: JSValuePointer | JSValueConstPointer,\n prop_name: number,\n ) => JSValuePointer = this.module.cwrap(\"QTS_GetPropNumber\", \"number\", [\n \"number\",\n \"number\",\n \"number\",\n ])\n\n QTS_SetProp: (\n ctx: JSContextPointer,\n this_val: JSValuePointer | JSValueConstPointer,\n prop_name: JSValuePointer | JSValueConstPointer,\n prop_value: JSValuePointer | JSValueConstPointer,\n ) => void = this.module.cwrap(\"QTS_SetProp\", null, [\"number\", \"number\", \"number\", \"number\"])\n\n QTS_DefineProp: (\n ctx: JSContextPointer,\n this_val: JSValuePointer | JSValueConstPointer,\n prop_name: JSValuePointer | JSValueConstPointer,\n prop_value: JSValuePointer | JSValueConstPointer,\n get: JSValuePointer | JSValueConstPointer,\n set: JSValuePointer | JSValueConstPointer,\n configurable: boolean,\n enumerable: boolean,\n has_value: boolean,\n ) => void = this.module.cwrap(\"QTS_DefineProp\", null, [\n \"number\",\n \"number\",\n \"number\",\n \"number\",\n \"number\",\n \"number\",\n \"boolean\",\n \"boolean\",\n \"boolean\",\n ])\n\n QTS_GetOwnPropertyNames: (\n ctx: JSContextPointer,\n out_ptrs: JSValuePointerPointerPointer,\n out_len: UInt32Pointer,\n obj: JSValuePointer | JSValueConstPointer,\n flags: number,\n ) => JSValuePointer = this.module.cwrap(\"QTS_GetOwnPropertyNames\", \"number\", [\n \"number\",\n \"number\",\n \"number\",\n \"number\",\n \"number\",\n ])\n\n QTS_Call: (\n ctx: JSContextPointer,\n func_obj: JSValuePointer | JSValueConstPointer,\n this_obj: JSValuePointer | JSValueConstPointer,\n argc: number,\n argv_ptrs: JSValueConstPointerPointer,\n ) => JSValuePointer = this.module.cwrap(\"QTS_Call\", \"number\", [\n \"number\",\n \"number\",\n \"number\",\n \"number\",\n \"number\",\n ])\n\n QTS_ResolveException: (ctx: JSContextPointer, maybe_exception: JSValuePointer) => JSValuePointer =\n this.module.cwrap(\"QTS_ResolveException\", \"number\", [\"number\", \"number\"])\n\n QTS_Dump: (\n ctx: JSContextPointer,\n obj: JSValuePointer | JSValueConstPointer,\n ) => JSBorrowedCharPointer = this.module.cwrap(\"QTS_Dump\", \"number\", [\"number\", \"number\"])\n\n QTS_Eval: (\n ctx: JSContextPointer,\n js_code: BorrowedHeapCharPointer,\n js_code_length: number,\n filename: string,\n detectModule: EvalDetectModule,\n evalFlags: EvalFlags,\n ) => JSValuePointer = this.module.cwrap(\"QTS_Eval\", \"number\", [\n \"number\",\n \"number\",\n \"number\",\n \"string\",\n \"number\",\n \"number\",\n ])\n\n QTS_GetModuleNamespace: (\n ctx: JSContextPointer,\n module_func_obj: JSValuePointer | JSValueConstPointer,\n ) => JSValuePointer = this.module.cwrap(\"QTS_GetModuleNamespace\", \"number\", [\"number\", \"number\"])\n\n QTS_Typeof: (\n ctx: JSContextPointer,\n value: JSValuePointer | JSValueConstPointer,\n ) => OwnedHeapCharPointer = this.module.cwrap(\"QTS_Typeof\", \"number\", [\"number\", \"number\"])\n\n QTS_GetLength: (\n ctx: JSContextPointer,\n out_len: UInt32Pointer,\n value: JSValuePointer | JSValueConstPointer,\n ) => number = this.module.cwrap(\"QTS_GetLength\", \"number\", [\"number\", \"number\", \"number\"])\n\n QTS_IsEqual: (\n ctx: JSContextPointer,\n a: JSValuePointer | JSValueConstPointer,\n b: JSValuePointer | JSValueConstPointer,\n op: IsEqualOp,\n ) => number = this.module.cwrap(\"QTS_IsEqual\", \"number\", [\"number\", \"number\", \"number\", \"number\"])\n\n QTS_GetGlobalObject: (ctx: JSContextPointer) => JSValuePointer = this.module.cwrap(\n \"QTS_GetGlobalObject\",\n \"number\",\n [\"number\"],\n )\n\n QTS_NewPromiseCapability: (\n ctx: JSContextPointer,\n resolve_funcs_out: JSValuePointerPointer,\n ) => JSValuePointer = this.module.cwrap(\"QTS_NewPromiseCapability\", \"number\", [\n \"number\",\n \"number\",\n ])\n\n QTS_PromiseState: (\n ctx: JSContextPointer,\n promise: JSValuePointer | JSValueConstPointer,\n ) => JSPromiseStateEnum = this.module.cwrap(\"QTS_PromiseState\", \"number\", [\"number\", \"number\"])\n\n QTS_PromiseResult: (\n ctx: JSContextPointer,\n promise: JSValuePointer | JSValueConstPointer,\n ) => JSValuePointer = this.module.cwrap(\"QTS_PromiseResult\", \"number\", [\"number\", \"number\"])\n\n QTS_TestStringArg: (string: string) => void = this.module.cwrap(\"QTS_TestStringArg\", null, [\n \"string\",\n ])\n\n QTS_GetDebugLogEnabled: (rt: JSRuntimePointer) => number = this.module.cwrap(\n \"QTS_GetDebugLogEnabled\",\n \"number\",\n [\"number\"],\n )\n\n QTS_SetDebugLogEnabled: (rt: JSRuntimePointer, is_enabled: number) => void = this.module.cwrap(\n \"QTS_SetDebugLogEnabled\",\n null,\n [\"number\", \"number\"],\n )\n\n QTS_BuildIsDebug: () => number = this.module.cwrap(\"QTS_BuildIsDebug\", \"number\", [])\n\n QTS_BuildIsAsyncify: () => number = this.module.cwrap(\"QTS_BuildIsAsyncify\", \"number\", [])\n\n QTS_NewFunction: (ctx: JSContextPointer, func_id: number, name: string) => JSValuePointer =\n this.module.cwrap(\"QTS_NewFunction\", \"number\", [\"number\", \"number\", \"string\"])\n\n QTS_ArgvGetJSValueConstPointer: (\n argv: JSValuePointer | JSValueConstPointer,\n index: number,\n ) => JSValueConstPointer = this.module.cwrap(\"QTS_ArgvGetJSValueConstPointer\", \"number\", [\n \"number\",\n \"number\",\n ])\n\n QTS_RuntimeEnableInterruptHandler: (rt: JSRuntimePointer) => void = this.module.cwrap(\n \"QTS_RuntimeEnableInterruptHandler\",\n null,\n [\"number\"],\n )\n\n QTS_RuntimeDisableInterruptHandler: (rt: JSRuntimePointer) => void = this.module.cwrap(\n \"QTS_RuntimeDisableInterruptHandler\",\n null,\n [\"number\"],\n )\n\n QTS_RuntimeEnableModuleLoader: (rt: JSRuntimePointer, use_custom_normalize: number) => void =\n this.module.cwrap(\"QTS_RuntimeEnableModuleLoader\", null, [\"number\", \"number\"])\n\n QTS_RuntimeDisableModuleLoader: (rt: JSRuntimePointer) => void = this.module.cwrap(\n \"QTS_RuntimeDisableModuleLoader\",\n null,\n [\"number\"],\n )\n\n QTS_bjson_encode: (\n ctx: JSContextPointer,\n val: JSValuePointer | JSValueConstPointer,\n ) => JSValuePointer = this.module.cwrap(\"QTS_bjson_encode\", \"number\", [\"number\", \"number\"])\n\n QTS_bjson_decode: (\n ctx: JSContextPointer,\n data: JSValuePointer | JSValueConstPointer,\n ) => JSValuePointer = this.module.cwrap(\"QTS_bjson_decode\", \"number\", [\"number\", \"number\"])\n\n QTS_EvalFunction: (\n ctx: JSContextPointer,\n fun_obj: JSValuePointer | JSValueConstPointer,\n ) => JSValuePointer = this.module.cwrap(\"QTS_EvalFunction\", \"number\", [\"number\", \"number\"])\n\n QTS_EncodeBytecode: (\n ctx: JSContextPointer,\n val: JSValuePointer | JSValueConstPointer,\n ) => JSValuePointer = this.module.cwrap(\"QTS_EncodeBytecode\", \"number\", [\"number\", \"number\"])\n\n QTS_DecodeBytecode: (\n ctx: JSContextPointer,\n data: JSValuePointer | JSValueConstPointer,\n ) => JSValuePointer = this.module.cwrap(\"QTS_DecodeBytecode\", \"number\", [\"number\", \"number\"])\n}\n"],"mappings":"AAmCO,IAAM,WAAN,KAAiB,CACtB,YAAoB,OAAiC,CAAjC,mBAEpB,KAAS,MAAQ,GAEjB,eAGsB,KAAK,OAAO,MAAM,YAAa,SAAU,CAAC,SAAU,QAAQ,CAAC,EAEnF,kBAA0D,KAAK,OAAO,MACpE,eACA,SACA,CAAC,QAAQ,CACX,EAEA,+BAA2E,KAAK,OAAO,MACrF,4BACA,KACA,CAAC,SAAU,QAAQ,CACrB,EAEA,m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EAEA,sBAAiC,KAAK,OAAO,MAAM,mBAAoB,SAAU,CAAC,CAAC,EAEnF,yBAAoC,KAAK,OAAO,MAAM,sBAAuB,SAAU,CAAC,CAAC,EAEzF,qBACE,KAAK,OAAO,MAAM,kBAAmB,SAAU,CAAC,SAAU,SAAU,QAAQ,CAAC,EAE/E,oCAG2B,KAAK,OAAO,MAAM,iCAAkC,SAAU,CACvF,SACA,QACF,CAAC,EAED,uCAAoE,KAAK,OAAO,MAC9E,oCACA,KACA,CAAC,QAAQ,CACX,EAEA,wCAAqE,KAAK,OAAO,MAC/E,qCACA,KACA,CAAC,QAAQ,CACX,EAEA,mCACE,KAAK,OAAO,MAAM,gCAAiC,KAAM,CAAC,SAAU,QAAQ,CAAC,EAE/E,oCAAiE,KAAK,OAAO,MAC3E,iCACA,KACA,CAAC,QAAQ,CACX,EAEA,sBAGsB,KAAK,OAAO,MAAM,mBAAoB,SAAU,CAAC,SAAU,QAAQ,CAAC,EAE1F,sBAGsB,KAAK,OAAO,MAAM,mBAAoB,SAAU,CAAC,SAAU,QAAQ,CAAC,EAE1F,sBAGsB,KAAK,OAAO,MAAM,mBAAoB,SAAU,CAAC,SAAU,QAAQ,CAAC,EAE1F,wBAGsB,KAAK,OAAO,MAAM,qBAAsB,SAAU,CAAC,SAAU,QAAQ,CAAC,EAE5F,wBAGsB,KAAK,OAAO,MAAM,qBAAsB,SAAU,CAAC,SAAU,QAAQ,CAAC,CA5YtC,CA6YxD","names":[]}
1
+ {"version":3,"sources":["../src/ffi.ts"],"sourcesContent":["// This file generated by \"generate.ts ffi\" in the root of the repo.\nimport {\n QuickJSEmscriptenModule,\n JSRuntimePointer,\n JSContextPointer,\n JSContextPointerPointer,\n JSModuleDefPointer,\n JSValuePointer,\n JSValueConstPointer,\n JSValuePointerPointer,\n JSValuePointerPointerPointer,\n JSValueConstPointerPointer,\n QTS_C_To_HostCallbackFuncPointer,\n QTS_C_To_HostInterruptFuncPointer,\n QTS_C_To_HostLoadModuleFuncPointer,\n BorrowedHeapCharPointer,\n OwnedHeapCharPointer,\n JSBorrowedCharPointer,\n JSVoidPointer,\n UInt32Pointer,\n EvalFlags,\n IntrinsicsFlags,\n EvalDetectModule,\n GetOwnPropertyNamesFlags,\n IsEqualOp,\n JSPromiseStateEnum,\n} from \"@componentor/quickjs-ffi-types\"\n\n/**\n * Low-level FFI bindings to QuickJS's Emscripten module.\n * See instead {@link QuickJSContext}, the public Javascript interface exposed by this\n * library.\n *\n * @unstable The FFI interface is considered private and may change.\n */\nexport class QuickJSFFI {\n constructor(private module: QuickJSEmscriptenModule) {}\n /** Set at compile time. */\n readonly DEBUG = false\n\n QTS_Throw: (\n ctx: JSContextPointer,\n error: JSValuePointer | JSValueConstPointer,\n ) => JSValuePointer = this.module.cwrap(\"QTS_Throw\", \"number\", [\"number\", \"number\"])\n\n QTS_NewError: (ctx: JSContextPointer) => JSValuePointer = this.module.cwrap(\n \"QTS_NewError\",\n \"number\",\n [\"number\"],\n )\n\n QTS_RuntimeSetMemoryLimit: (rt: JSRuntimePointer, limit: number) => void = this.module.cwrap(\n \"QTS_RuntimeSetMemoryLimit\",\n null,\n [\"number\", \"number\"],\n )\n\n QTS_RuntimeComputeMemoryUsage: (rt: JSRuntimePointer, ctx: JSContextPointer) => JSValuePointer =\n this.module.cwrap(\"QTS_RuntimeComputeMemoryUsage\", \"number\", [\"number\", \"number\"])\n\n QTS_RuntimeDumpMemoryUsage: (rt: JSRuntimePointer) => OwnedHeapCharPointer = this.module.cwrap(\n \"QTS_RuntimeDumpMemoryUsage\",\n \"number\",\n [\"number\"],\n )\n\n QTS_RecoverableLeakCheck: () => number = this.module.cwrap(\n \"QTS_RecoverableLeakCheck\",\n \"number\",\n [],\n )\n\n QTS_BuildIsSanitizeLeak: () => number = this.module.cwrap(\"QTS_BuildIsSanitizeLeak\", \"number\", [])\n\n QTS_RuntimeSetMaxStackSize: (rt: JSRuntimePointer, stack_size: number) => void =\n this.module.cwrap(\"QTS_RuntimeSetMaxStackSize\", null, [\"number\", \"number\"])\n\n QTS_GetUndefined: () => JSValueConstPointer = this.module.cwrap(\"QTS_GetUndefined\", \"number\", [])\n\n QTS_GetNull: () => JSValueConstPointer = this.module.cwrap(\"QTS_GetNull\", \"number\", [])\n\n QTS_GetFalse: () => JSValueConstPointer = this.module.cwrap(\"QTS_GetFalse\", \"number\", [])\n\n QTS_GetTrue: () => JSValueConstPointer = this.module.cwrap(\"QTS_GetTrue\", \"number\", [])\n\n QTS_NewRuntime: () => JSRuntimePointer = this.module.cwrap(\"QTS_NewRuntime\", \"number\", [])\n\n QTS_FreeRuntime: (rt: JSRuntimePointer) => void = this.module.cwrap(\"QTS_FreeRuntime\", null, [\n \"number\",\n ])\n\n QTS_NewContext: (rt: JSRuntimePointer, intrinsics: IntrinsicsFlags) => JSContextPointer =\n this.module.cwrap(\"QTS_NewContext\", \"number\", [\"number\", \"number\"])\n\n QTS_FreeContext: (ctx: JSContextPointer) => void = this.module.cwrap(\"QTS_FreeContext\", null, [\n \"number\",\n ])\n\n QTS_FreeValuePointer: (ctx: JSContextPointer, value: JSValuePointer) => void = this.module.cwrap(\n \"QTS_FreeValuePointer\",\n null,\n [\"number\", \"number\"],\n )\n\n QTS_FreeValuePointerRuntime: (rt: JSRuntimePointer, value: JSValuePointer) => void =\n this.module.cwrap(\"QTS_FreeValuePointerRuntime\", null, [\"number\", \"number\"])\n\n QTS_FreeVoidPointer: (ctx: JSContextPointer, ptr: JSVoidPointer) => void = this.module.cwrap(\n \"QTS_FreeVoidPointer\",\n null,\n [\"number\", \"number\"],\n )\n\n QTS_FreeCString: (ctx: JSContextPointer, str: JSBorrowedCharPointer) => void = this.module.cwrap(\n \"QTS_FreeCString\",\n null,\n [\"number\", \"number\"],\n )\n\n QTS_DupValuePointer: (\n ctx: JSContextPointer,\n val: JSValuePointer | JSValueConstPointer,\n ) => JSValuePointer = this.module.cwrap(\"QTS_DupValuePointer\", \"number\", [\"number\", \"number\"])\n\n QTS_NewObject: (ctx: JSContextPointer) => JSValuePointer = this.module.cwrap(\n \"QTS_NewObject\",\n \"number\",\n [\"number\"],\n )\n\n QTS_NewObjectProto: (\n ctx: JSContextPointer,\n proto: JSValuePointer | JSValueConstPointer,\n ) => JSValuePointer = this.module.cwrap(\"QTS_NewObjectProto\", \"number\", [\"number\", \"number\"])\n\n QTS_NewArray: (ctx: JSContextPointer) => JSValuePointer = this.module.cwrap(\n \"QTS_NewArray\",\n \"number\",\n [\"number\"],\n )\n\n QTS_NewArrayBuffer: (\n ctx: JSContextPointer,\n buffer: JSVoidPointer,\n length: number,\n ) => JSValuePointer = this.module.cwrap(\"QTS_NewArrayBuffer\", \"number\", [\n \"number\",\n \"number\",\n \"number\",\n ])\n\n QTS_NewFloat64: (ctx: JSContextPointer, num: number) => JSValuePointer = this.module.cwrap(\n \"QTS_NewFloat64\",\n \"number\",\n [\"number\", \"number\"],\n )\n\n QTS_GetFloat64: (ctx: JSContextPointer, value: JSValuePointer | JSValueConstPointer) => number =\n this.module.cwrap(\"QTS_GetFloat64\", \"number\", [\"number\", \"number\"])\n\n QTS_NewString: (ctx: JSContextPointer, string: BorrowedHeapCharPointer) => JSValuePointer =\n this.module.cwrap(\"QTS_NewString\", \"number\", [\"number\", \"number\"])\n\n QTS_GetString: (\n ctx: JSContextPointer,\n value: JSValuePointer | JSValueConstPointer,\n ) => JSBorrowedCharPointer = this.module.cwrap(\"QTS_GetString\", \"number\", [\"number\", \"number\"])\n\n QTS_GetArrayBuffer: (\n ctx: JSContextPointer,\n data: JSValuePointer | JSValueConstPointer,\n ) => JSVoidPointer = this.module.cwrap(\"QTS_GetArrayBuffer\", \"number\", [\"number\", \"number\"])\n\n QTS_GetArrayBufferLength: (\n ctx: JSContextPointer,\n data: JSValuePointer | JSValueConstPointer,\n ) => number = this.module.cwrap(\"QTS_GetArrayBufferLength\", \"number\", [\"number\", \"number\"])\n\n QTS_NewSymbol: (\n ctx: JSContextPointer,\n description: BorrowedHeapCharPointer,\n isGlobal: number,\n ) => JSValuePointer = this.module.cwrap(\"QTS_NewSymbol\", \"number\", [\"number\", \"number\", \"number\"])\n\n QTS_GetSymbolDescriptionOrKey: (\n ctx: JSContextPointer,\n value: JSValuePointer | JSValueConstPointer,\n ) => JSBorrowedCharPointer = this.module.cwrap(\"QTS_GetSymbolDescriptionOrKey\", \"number\", [\n \"number\",\n \"number\",\n ])\n\n QTS_IsGlobalSymbol: (\n ctx: JSContextPointer,\n value: JSValuePointer | JSValueConstPointer,\n ) => number = this.module.cwrap(\"QTS_IsGlobalSymbol\", \"number\", [\"number\", \"number\"])\n\n QTS_IsJobPending: (rt: JSRuntimePointer) => number = this.module.cwrap(\n \"QTS_IsJobPending\",\n \"number\",\n [\"number\"],\n )\n\n QTS_ExecutePendingJob: (\n rt: JSRuntimePointer,\n maxJobsToExecute: number,\n lastJobContext: JSContextPointerPointer,\n ) => JSValuePointer = this.module.cwrap(\"QTS_ExecutePendingJob\", \"number\", [\n \"number\",\n \"number\",\n \"number\",\n ])\n\n QTS_GetProp: (\n ctx: JSContextPointer,\n this_val: JSValuePointer | JSValueConstPointer,\n prop_name: JSValuePointer | JSValueConstPointer,\n ) => JSValuePointer = this.module.cwrap(\"QTS_GetProp\", \"number\", [\"number\", \"number\", \"number\"])\n\n QTS_GetPropNumber: (\n ctx: JSContextPointer,\n this_val: JSValuePointer | JSValueConstPointer,\n prop_name: number,\n ) => JSValuePointer = this.module.cwrap(\"QTS_GetPropNumber\", \"number\", [\n \"number\",\n \"number\",\n \"number\",\n ])\n\n QTS_SetProp: (\n ctx: JSContextPointer,\n this_val: JSValuePointer | JSValueConstPointer,\n prop_name: JSValuePointer | JSValueConstPointer,\n prop_value: JSValuePointer | JSValueConstPointer,\n ) => void = this.module.cwrap(\"QTS_SetProp\", null, [\"number\", \"number\", \"number\", \"number\"])\n\n QTS_DefineProp: (\n ctx: JSContextPointer,\n this_val: JSValuePointer | JSValueConstPointer,\n prop_name: JSValuePointer | JSValueConstPointer,\n prop_value: JSValuePointer | JSValueConstPointer,\n get: JSValuePointer | JSValueConstPointer,\n set: JSValuePointer | JSValueConstPointer,\n configurable: boolean,\n enumerable: boolean,\n has_value: boolean,\n ) => void = this.module.cwrap(\"QTS_DefineProp\", null, [\n \"number\",\n \"number\",\n \"number\",\n \"number\",\n \"number\",\n \"number\",\n \"boolean\",\n \"boolean\",\n \"boolean\",\n ])\n\n QTS_GetOwnPropertyNames: (\n ctx: JSContextPointer,\n out_ptrs: JSValuePointerPointerPointer,\n out_len: UInt32Pointer,\n obj: JSValuePointer | JSValueConstPointer,\n flags: number,\n ) => JSValuePointer = this.module.cwrap(\"QTS_GetOwnPropertyNames\", \"number\", [\n \"number\",\n \"number\",\n \"number\",\n \"number\",\n \"number\",\n ])\n\n QTS_Call: (\n ctx: JSContextPointer,\n func_obj: JSValuePointer | JSValueConstPointer,\n this_obj: JSValuePointer | JSValueConstPointer,\n argc: number,\n argv_ptrs: JSValueConstPointerPointer,\n ) => JSValuePointer = this.module.cwrap(\"QTS_Call\", \"number\", [\n \"number\",\n \"number\",\n \"number\",\n \"number\",\n \"number\",\n ])\n\n QTS_ResolveException: (ctx: JSContextPointer, maybe_exception: JSValuePointer) => JSValuePointer =\n this.module.cwrap(\"QTS_ResolveException\", \"number\", [\"number\", \"number\"])\n\n QTS_Dump: (\n ctx: JSContextPointer,\n obj: JSValuePointer | JSValueConstPointer,\n ) => JSBorrowedCharPointer = this.module.cwrap(\"QTS_Dump\", \"number\", [\"number\", \"number\"])\n\n QTS_Eval: (\n ctx: JSContextPointer,\n js_code: BorrowedHeapCharPointer,\n js_code_length: number,\n filename: string,\n detectModule: EvalDetectModule,\n evalFlags: EvalFlags,\n ) => JSValuePointer = this.module.cwrap(\"QTS_Eval\", \"number\", [\n \"number\",\n \"number\",\n \"number\",\n \"string\",\n \"number\",\n \"number\",\n ])\n\n QTS_GetModuleNamespace: (\n ctx: JSContextPointer,\n module_func_obj: JSValuePointer | JSValueConstPointer,\n ) => JSValuePointer = this.module.cwrap(\"QTS_GetModuleNamespace\", \"number\", [\"number\", \"number\"])\n\n QTS_Typeof: (\n ctx: JSContextPointer,\n value: JSValuePointer | JSValueConstPointer,\n ) => OwnedHeapCharPointer = this.module.cwrap(\"QTS_Typeof\", \"number\", [\"number\", \"number\"])\n\n QTS_GetLength: (\n ctx: JSContextPointer,\n out_len: UInt32Pointer,\n value: JSValuePointer | JSValueConstPointer,\n ) => number = this.module.cwrap(\"QTS_GetLength\", \"number\", [\"number\", \"number\", \"number\"])\n\n QTS_IsEqual: (\n ctx: JSContextPointer,\n a: JSValuePointer | JSValueConstPointer,\n b: JSValuePointer | JSValueConstPointer,\n op: IsEqualOp,\n ) => number = this.module.cwrap(\"QTS_IsEqual\", \"number\", [\"number\", \"number\", \"number\", \"number\"])\n\n QTS_GetGlobalObject: (ctx: JSContextPointer) => JSValuePointer = this.module.cwrap(\n \"QTS_GetGlobalObject\",\n \"number\",\n [\"number\"],\n )\n\n QTS_NewPromiseCapability: (\n ctx: JSContextPointer,\n resolve_funcs_out: JSValuePointerPointer,\n ) => JSValuePointer = this.module.cwrap(\"QTS_NewPromiseCapability\", \"number\", [\n \"number\",\n \"number\",\n ])\n\n QTS_PromiseState: (\n ctx: JSContextPointer,\n promise: JSValuePointer | JSValueConstPointer,\n ) => JSPromiseStateEnum = this.module.cwrap(\"QTS_PromiseState\", \"number\", [\"number\", \"number\"])\n\n QTS_PromiseResult: (\n ctx: JSContextPointer,\n promise: JSValuePointer | JSValueConstPointer,\n ) => JSValuePointer = this.module.cwrap(\"QTS_PromiseResult\", \"number\", [\"number\", \"number\"])\n\n QTS_TestStringArg: (string: string) => void = this.module.cwrap(\"QTS_TestStringArg\", null, [\n \"string\",\n ])\n\n QTS_GetDebugLogEnabled: (rt: JSRuntimePointer) => number = this.module.cwrap(\n \"QTS_GetDebugLogEnabled\",\n \"number\",\n [\"number\"],\n )\n\n QTS_SetDebugLogEnabled: (rt: JSRuntimePointer, is_enabled: number) => void = this.module.cwrap(\n \"QTS_SetDebugLogEnabled\",\n null,\n [\"number\", \"number\"],\n )\n\n QTS_BuildIsDebug: () => number = this.module.cwrap(\"QTS_BuildIsDebug\", \"number\", [])\n\n QTS_BuildIsAsyncify: () => number = this.module.cwrap(\"QTS_BuildIsAsyncify\", \"number\", [])\n\n QTS_NewFunction: (ctx: JSContextPointer, func_id: number, name: string) => JSValuePointer =\n this.module.cwrap(\"QTS_NewFunction\", \"number\", [\"number\", \"number\", \"string\"])\n\n QTS_ArgvGetJSValueConstPointer: (\n argv: JSValuePointer | JSValueConstPointer,\n index: number,\n ) => JSValueConstPointer = this.module.cwrap(\"QTS_ArgvGetJSValueConstPointer\", \"number\", [\n \"number\",\n \"number\",\n ])\n\n QTS_RuntimeEnableInterruptHandler: (rt: JSRuntimePointer) => void = this.module.cwrap(\n \"QTS_RuntimeEnableInterruptHandler\",\n null,\n [\"number\"],\n )\n\n QTS_RuntimeDisableInterruptHandler: (rt: JSRuntimePointer) => void = this.module.cwrap(\n \"QTS_RuntimeDisableInterruptHandler\",\n null,\n [\"number\"],\n )\n\n QTS_RuntimeEnableModuleLoader: (rt: JSRuntimePointer, use_custom_normalize: number) => void =\n this.module.cwrap(\"QTS_RuntimeEnableModuleLoader\", null, [\"number\", \"number\"])\n\n QTS_RuntimeDisableModuleLoader: (rt: JSRuntimePointer) => void = this.module.cwrap(\n \"QTS_RuntimeDisableModuleLoader\",\n null,\n [\"number\"],\n )\n\n QTS_bjson_encode: (\n ctx: JSContextPointer,\n val: JSValuePointer | JSValueConstPointer,\n ) => JSValuePointer = this.module.cwrap(\"QTS_bjson_encode\", \"number\", [\"number\", \"number\"])\n\n QTS_bjson_decode: (\n ctx: JSContextPointer,\n data: JSValuePointer | JSValueConstPointer,\n ) => JSValuePointer = this.module.cwrap(\"QTS_bjson_decode\", \"number\", [\"number\", \"number\"])\n\n QTS_EvalFunction: (\n ctx: JSContextPointer,\n fun_obj: JSValuePointer | JSValueConstPointer,\n ) => JSValuePointer = this.module.cwrap(\"QTS_EvalFunction\", \"number\", [\"number\", \"number\"])\n\n QTS_EncodeBytecode: (\n ctx: JSContextPointer,\n val: JSValuePointer | JSValueConstPointer,\n ) => JSValuePointer = this.module.cwrap(\"QTS_EncodeBytecode\", \"number\", [\"number\", \"number\"])\n\n QTS_DecodeBytecode: (\n ctx: JSContextPointer,\n data: JSValuePointer | JSValueConstPointer,\n ) => JSValuePointer = this.module.cwrap(\"QTS_DecodeBytecode\", \"number\", [\"number\", \"number\"])\n}\n"],"mappings":"AAmCO,IAAM,WAAN,KAAiB,CACtB,YAAoB,OAAiC,CAAjC,mBAEpB,KAAS,MAAQ,GAEjB,eAGsB,KAAK,OAAO,MAAM,YAAa,SAAU,CAAC,SAAU,QAAQ,CAAC,EAEnF,kBAA0D,KAAK,OAAO,MACpE,eACA,SACA,CAAC,QAAQ,CACX,EAEA,+BAA2E,KAAK,OAAO,MACrF,4BACA,KACA,CAAC,SAAU,QAAQ,CACrB,EAEA,mCACE,KAAK,OAAO,MAAM,gCAAiC,SAAU,CAAC,SAAU,QAAQ,CAAC,EAEnF,gCAA6E,KAAK,OAAO,MACvF,6BACA,SACA,CAAC,QAAQ,CACX,EAEA,8BAAyC,KAAK,OAAO,MACnD,2BACA,SACA,CAAC,CACH,EAEA,6BAAwC,KAAK,OAAO,MAAM,0BAA2B,SAAU,CAAC,CAAC,EAEjG,gCACE,KAAK,OAAO,MAAM,6BAA8B,KAAM,CAAC,SAAU,QAAQ,CAAC,EAE5E,sBAA8C,KAAK,OAAO,MAAM,mBAAoB,SAAU,CAAC,CAAC,EAEhG,iBAAyC,KAAK,OAAO,MAAM,cAAe,SAAU,CAAC,CAAC,EAEtF,kBAA0C,KAAK,OAAO,MAAM,eAAgB,SAAU,CAAC,CAAC,EAExF,iBAAyC,KAAK,OAAO,MAAM,cAAe,SAAU,CAAC,CAAC,EAEtF,oBAAyC,KAAK,OAAO,MAAM,iBAAkB,SAAU,CAAC,CAAC,EAEzF,qBAAkD,KAAK,OAAO,MAAM,kBAAmB,KAAM,CAC3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QAAQ,CAAC,EAE1F,sBAGsB,KAAK,OAAO,MAAM,mBAAoB,SAAU,CAAC,SAAU,QAAQ,CAAC,EAE1F,wBAGsB,KAAK,OAAO,MAAM,qBAAsB,SAAU,CAAC,SAAU,QAAQ,CAAC,EAE5F,wBAGsB,KAAK,OAAO,MAAM,qBAAsB,SAAU,CAAC,SAAU,QAAQ,CAAC,CA5YtC,CA6YxD","names":[]}
package/dist/index.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- import { QuickJSSyncVariant } from '@jitl/quickjs-ffi-types';
1
+ import { QuickJSSyncVariant } from '@componentor/quickjs-ffi-types';
2
2
 
3
3
  /**
4
4
  * ### @componentor/quickjs-wasmfs-release-sync
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { QuickJSSyncVariant } from '@jitl/quickjs-ffi-types';
1
+ import { QuickJSSyncVariant } from '@componentor/quickjs-ffi-types';
2
2
 
3
3
  /**
4
4
  * ### @componentor/quickjs-wasmfs-release-sync
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/ffi.ts","../src/index.ts"],"sourcesContent":["// This file generated by \"generate.ts ffi\" in the root of the repo.\nimport {\n QuickJSEmscriptenModule,\n JSRuntimePointer,\n JSContextPointer,\n JSContextPointerPointer,\n JSModuleDefPointer,\n JSValuePointer,\n JSValueConstPointer,\n JSValuePointerPointer,\n JSValuePointerPointerPointer,\n JSValueConstPointerPointer,\n QTS_C_To_HostCallbackFuncPointer,\n QTS_C_To_HostInterruptFuncPointer,\n QTS_C_To_HostLoadModuleFuncPointer,\n BorrowedHeapCharPointer,\n OwnedHeapCharPointer,\n JSBorrowedCharPointer,\n JSVoidPointer,\n UInt32Pointer,\n EvalFlags,\n IntrinsicsFlags,\n EvalDetectModule,\n GetOwnPropertyNamesFlags,\n IsEqualOp,\n JSPromiseStateEnum,\n} from \"@jitl/quickjs-ffi-types\"\n\n/**\n * Low-level FFI bindings to QuickJS's Emscripten module.\n * See instead {@link QuickJSContext}, the public Javascript interface exposed by this\n * library.\n *\n * @unstable The FFI interface is considered private and may change.\n */\nexport class QuickJSFFI {\n constructor(private module: QuickJSEmscriptenModule) {}\n /** Set at compile time. */\n readonly DEBUG = false\n\n QTS_Throw: (\n ctx: JSContextPointer,\n error: JSValuePointer | JSValueConstPointer,\n ) => JSValuePointer = this.module.cwrap(\"QTS_Throw\", \"number\", [\"number\", \"number\"])\n\n QTS_NewError: (ctx: JSContextPointer) => JSValuePointer = this.module.cwrap(\n \"QTS_NewError\",\n \"number\",\n [\"number\"],\n )\n\n QTS_RuntimeSetMemoryLimit: (rt: JSRuntimePointer, limit: number) => void = this.module.cwrap(\n \"QTS_RuntimeSetMemoryLimit\",\n null,\n [\"number\", \"number\"],\n )\n\n QTS_RuntimeComputeMemoryUsage: (rt: JSRuntimePointer, ctx: JSContextPointer) => JSValuePointer =\n this.module.cwrap(\"QTS_RuntimeComputeMemoryUsage\", \"number\", [\"number\", \"number\"])\n\n QTS_RuntimeDumpMemoryUsage: (rt: JSRuntimePointer) => OwnedHeapCharPointer = this.module.cwrap(\n \"QTS_RuntimeDumpMemoryUsage\",\n \"number\",\n [\"number\"],\n )\n\n QTS_RecoverableLeakCheck: () => number = this.module.cwrap(\n \"QTS_RecoverableLeakCheck\",\n \"number\",\n [],\n )\n\n QTS_BuildIsSanitizeLeak: () => number = this.module.cwrap(\"QTS_BuildIsSanitizeLeak\", \"number\", [])\n\n QTS_RuntimeSetMaxStackSize: (rt: JSRuntimePointer, stack_size: number) => void =\n this.module.cwrap(\"QTS_RuntimeSetMaxStackSize\", null, [\"number\", \"number\"])\n\n QTS_GetUndefined: () => JSValueConstPointer = this.module.cwrap(\"QTS_GetUndefined\", \"number\", [])\n\n QTS_GetNull: () => JSValueConstPointer = this.module.cwrap(\"QTS_GetNull\", \"number\", [])\n\n QTS_GetFalse: () => JSValueConstPointer = this.module.cwrap(\"QTS_GetFalse\", \"number\", [])\n\n QTS_GetTrue: () => JSValueConstPointer = this.module.cwrap(\"QTS_GetTrue\", \"number\", [])\n\n QTS_NewRuntime: () => JSRuntimePointer = this.module.cwrap(\"QTS_NewRuntime\", \"number\", [])\n\n QTS_FreeRuntime: (rt: JSRuntimePointer) => void = this.module.cwrap(\"QTS_FreeRuntime\", null, [\n \"number\",\n ])\n\n QTS_NewContext: (rt: JSRuntimePointer, intrinsics: IntrinsicsFlags) => JSContextPointer =\n this.module.cwrap(\"QTS_NewContext\", \"number\", [\"number\", \"number\"])\n\n QTS_FreeContext: (ctx: JSContextPointer) => void = this.module.cwrap(\"QTS_FreeContext\", null, [\n \"number\",\n ])\n\n QTS_FreeValuePointer: (ctx: JSContextPointer, value: JSValuePointer) => void = this.module.cwrap(\n \"QTS_FreeValuePointer\",\n null,\n [\"number\", \"number\"],\n )\n\n QTS_FreeValuePointerRuntime: (rt: JSRuntimePointer, value: JSValuePointer) => void =\n this.module.cwrap(\"QTS_FreeValuePointerRuntime\", null, [\"number\", \"number\"])\n\n QTS_FreeVoidPointer: (ctx: JSContextPointer, ptr: JSVoidPointer) => void = this.module.cwrap(\n \"QTS_FreeVoidPointer\",\n null,\n [\"number\", \"number\"],\n )\n\n QTS_FreeCString: (ctx: JSContextPointer, str: JSBorrowedCharPointer) => void = this.module.cwrap(\n \"QTS_FreeCString\",\n null,\n [\"number\", \"number\"],\n )\n\n QTS_DupValuePointer: (\n ctx: JSContextPointer,\n val: JSValuePointer | JSValueConstPointer,\n ) => JSValuePointer = this.module.cwrap(\"QTS_DupValuePointer\", \"number\", [\"number\", \"number\"])\n\n QTS_NewObject: (ctx: JSContextPointer) => JSValuePointer = this.module.cwrap(\n \"QTS_NewObject\",\n \"number\",\n [\"number\"],\n )\n\n QTS_NewObjectProto: (\n ctx: JSContextPointer,\n proto: JSValuePointer | JSValueConstPointer,\n ) => JSValuePointer = this.module.cwrap(\"QTS_NewObjectProto\", \"number\", [\"number\", \"number\"])\n\n QTS_NewArray: (ctx: JSContextPointer) => JSValuePointer = this.module.cwrap(\n \"QTS_NewArray\",\n \"number\",\n [\"number\"],\n )\n\n QTS_NewArrayBuffer: (\n ctx: JSContextPointer,\n buffer: JSVoidPointer,\n length: number,\n ) => JSValuePointer = this.module.cwrap(\"QTS_NewArrayBuffer\", \"number\", [\n \"number\",\n \"number\",\n \"number\",\n ])\n\n QTS_NewFloat64: (ctx: JSContextPointer, num: number) => JSValuePointer = this.module.cwrap(\n \"QTS_NewFloat64\",\n \"number\",\n [\"number\", \"number\"],\n )\n\n QTS_GetFloat64: (ctx: JSContextPointer, value: JSValuePointer | JSValueConstPointer) => number =\n this.module.cwrap(\"QTS_GetFloat64\", \"number\", [\"number\", \"number\"])\n\n QTS_NewString: (ctx: JSContextPointer, string: BorrowedHeapCharPointer) => JSValuePointer =\n this.module.cwrap(\"QTS_NewString\", \"number\", [\"number\", \"number\"])\n\n QTS_GetString: (\n ctx: JSContextPointer,\n value: JSValuePointer | JSValueConstPointer,\n ) => JSBorrowedCharPointer = this.module.cwrap(\"QTS_GetString\", \"number\", [\"number\", \"number\"])\n\n QTS_GetArrayBuffer: (\n ctx: JSContextPointer,\n data: JSValuePointer | JSValueConstPointer,\n ) => JSVoidPointer = this.module.cwrap(\"QTS_GetArrayBuffer\", \"number\", [\"number\", \"number\"])\n\n QTS_GetArrayBufferLength: (\n ctx: JSContextPointer,\n data: JSValuePointer | JSValueConstPointer,\n ) => number = this.module.cwrap(\"QTS_GetArrayBufferLength\", \"number\", [\"number\", \"number\"])\n\n QTS_NewSymbol: (\n ctx: JSContextPointer,\n description: BorrowedHeapCharPointer,\n isGlobal: number,\n ) => JSValuePointer = this.module.cwrap(\"QTS_NewSymbol\", \"number\", [\"number\", \"number\", \"number\"])\n\n QTS_GetSymbolDescriptionOrKey: (\n ctx: JSContextPointer,\n value: JSValuePointer | JSValueConstPointer,\n ) => JSBorrowedCharPointer = this.module.cwrap(\"QTS_GetSymbolDescriptionOrKey\", \"number\", [\n \"number\",\n \"number\",\n ])\n\n QTS_IsGlobalSymbol: (\n ctx: JSContextPointer,\n value: JSValuePointer | JSValueConstPointer,\n ) => number = this.module.cwrap(\"QTS_IsGlobalSymbol\", \"number\", [\"number\", \"number\"])\n\n QTS_IsJobPending: (rt: JSRuntimePointer) => number = this.module.cwrap(\n \"QTS_IsJobPending\",\n \"number\",\n [\"number\"],\n )\n\n QTS_ExecutePendingJob: (\n rt: JSRuntimePointer,\n maxJobsToExecute: number,\n lastJobContext: JSContextPointerPointer,\n ) => JSValuePointer = this.module.cwrap(\"QTS_ExecutePendingJob\", \"number\", [\n \"number\",\n \"number\",\n \"number\",\n ])\n\n QTS_GetProp: (\n ctx: JSContextPointer,\n this_val: JSValuePointer | JSValueConstPointer,\n prop_name: JSValuePointer | JSValueConstPointer,\n ) => JSValuePointer = this.module.cwrap(\"QTS_GetProp\", \"number\", [\"number\", \"number\", \"number\"])\n\n QTS_GetPropNumber: (\n ctx: JSContextPointer,\n this_val: JSValuePointer | JSValueConstPointer,\n prop_name: number,\n ) => JSValuePointer = this.module.cwrap(\"QTS_GetPropNumber\", \"number\", [\n \"number\",\n \"number\",\n \"number\",\n ])\n\n QTS_SetProp: (\n ctx: JSContextPointer,\n this_val: JSValuePointer | JSValueConstPointer,\n prop_name: JSValuePointer | JSValueConstPointer,\n prop_value: JSValuePointer | JSValueConstPointer,\n ) => void = this.module.cwrap(\"QTS_SetProp\", null, [\"number\", \"number\", \"number\", \"number\"])\n\n QTS_DefineProp: (\n ctx: JSContextPointer,\n this_val: JSValuePointer | JSValueConstPointer,\n prop_name: JSValuePointer | JSValueConstPointer,\n prop_value: JSValuePointer | JSValueConstPointer,\n get: JSValuePointer | JSValueConstPointer,\n set: JSValuePointer | JSValueConstPointer,\n configurable: boolean,\n enumerable: boolean,\n has_value: boolean,\n ) => void = this.module.cwrap(\"QTS_DefineProp\", null, [\n \"number\",\n \"number\",\n \"number\",\n \"number\",\n \"number\",\n \"number\",\n \"boolean\",\n \"boolean\",\n \"boolean\",\n ])\n\n QTS_GetOwnPropertyNames: (\n ctx: JSContextPointer,\n out_ptrs: JSValuePointerPointerPointer,\n out_len: UInt32Pointer,\n obj: JSValuePointer | JSValueConstPointer,\n flags: number,\n ) => JSValuePointer = this.module.cwrap(\"QTS_GetOwnPropertyNames\", \"number\", [\n \"number\",\n \"number\",\n \"number\",\n \"number\",\n \"number\",\n ])\n\n QTS_Call: (\n ctx: JSContextPointer,\n func_obj: JSValuePointer | JSValueConstPointer,\n this_obj: JSValuePointer | JSValueConstPointer,\n argc: number,\n argv_ptrs: JSValueConstPointerPointer,\n ) => JSValuePointer = this.module.cwrap(\"QTS_Call\", \"number\", [\n \"number\",\n \"number\",\n \"number\",\n \"number\",\n \"number\",\n ])\n\n QTS_ResolveException: (ctx: JSContextPointer, maybe_exception: JSValuePointer) => JSValuePointer =\n this.module.cwrap(\"QTS_ResolveException\", \"number\", [\"number\", \"number\"])\n\n QTS_Dump: (\n ctx: JSContextPointer,\n obj: JSValuePointer | JSValueConstPointer,\n ) => JSBorrowedCharPointer = this.module.cwrap(\"QTS_Dump\", \"number\", [\"number\", \"number\"])\n\n QTS_Eval: (\n ctx: JSContextPointer,\n js_code: BorrowedHeapCharPointer,\n js_code_length: number,\n filename: string,\n detectModule: EvalDetectModule,\n evalFlags: EvalFlags,\n ) => JSValuePointer = this.module.cwrap(\"QTS_Eval\", \"number\", [\n \"number\",\n \"number\",\n \"number\",\n \"string\",\n \"number\",\n \"number\",\n ])\n\n QTS_GetModuleNamespace: (\n ctx: JSContextPointer,\n module_func_obj: JSValuePointer | JSValueConstPointer,\n ) => JSValuePointer = this.module.cwrap(\"QTS_GetModuleNamespace\", \"number\", [\"number\", \"number\"])\n\n QTS_Typeof: (\n ctx: JSContextPointer,\n value: JSValuePointer | JSValueConstPointer,\n ) => OwnedHeapCharPointer = this.module.cwrap(\"QTS_Typeof\", \"number\", [\"number\", \"number\"])\n\n QTS_GetLength: (\n ctx: JSContextPointer,\n out_len: UInt32Pointer,\n value: JSValuePointer | JSValueConstPointer,\n ) => number = this.module.cwrap(\"QTS_GetLength\", \"number\", [\"number\", \"number\", \"number\"])\n\n QTS_IsEqual: (\n ctx: JSContextPointer,\n a: JSValuePointer | JSValueConstPointer,\n b: JSValuePointer | JSValueConstPointer,\n op: IsEqualOp,\n ) => number = this.module.cwrap(\"QTS_IsEqual\", \"number\", [\"number\", \"number\", \"number\", \"number\"])\n\n QTS_GetGlobalObject: (ctx: JSContextPointer) => JSValuePointer = this.module.cwrap(\n \"QTS_GetGlobalObject\",\n \"number\",\n [\"number\"],\n )\n\n QTS_NewPromiseCapability: (\n ctx: JSContextPointer,\n resolve_funcs_out: JSValuePointerPointer,\n ) => JSValuePointer = this.module.cwrap(\"QTS_NewPromiseCapability\", \"number\", [\n \"number\",\n \"number\",\n ])\n\n QTS_PromiseState: (\n ctx: JSContextPointer,\n promise: JSValuePointer | JSValueConstPointer,\n ) => JSPromiseStateEnum = this.module.cwrap(\"QTS_PromiseState\", \"number\", [\"number\", \"number\"])\n\n QTS_PromiseResult: (\n ctx: JSContextPointer,\n promise: JSValuePointer | JSValueConstPointer,\n ) => JSValuePointer = this.module.cwrap(\"QTS_PromiseResult\", \"number\", [\"number\", \"number\"])\n\n QTS_TestStringArg: (string: string) => void = this.module.cwrap(\"QTS_TestStringArg\", null, [\n \"string\",\n ])\n\n QTS_GetDebugLogEnabled: (rt: JSRuntimePointer) => number = this.module.cwrap(\n \"QTS_GetDebugLogEnabled\",\n \"number\",\n [\"number\"],\n )\n\n QTS_SetDebugLogEnabled: (rt: JSRuntimePointer, is_enabled: number) => void = this.module.cwrap(\n \"QTS_SetDebugLogEnabled\",\n null,\n [\"number\", \"number\"],\n )\n\n QTS_BuildIsDebug: () => number = this.module.cwrap(\"QTS_BuildIsDebug\", \"number\", [])\n\n QTS_BuildIsAsyncify: () => number = this.module.cwrap(\"QTS_BuildIsAsyncify\", \"number\", [])\n\n QTS_NewFunction: (ctx: JSContextPointer, func_id: number, name: string) => JSValuePointer =\n this.module.cwrap(\"QTS_NewFunction\", \"number\", [\"number\", \"number\", \"string\"])\n\n QTS_ArgvGetJSValueConstPointer: (\n argv: JSValuePointer | JSValueConstPointer,\n index: number,\n ) => JSValueConstPointer = this.module.cwrap(\"QTS_ArgvGetJSValueConstPointer\", \"number\", [\n \"number\",\n \"number\",\n ])\n\n QTS_RuntimeEnableInterruptHandler: (rt: JSRuntimePointer) => void = this.module.cwrap(\n \"QTS_RuntimeEnableInterruptHandler\",\n null,\n [\"number\"],\n )\n\n QTS_RuntimeDisableInterruptHandler: (rt: JSRuntimePointer) => void = this.module.cwrap(\n \"QTS_RuntimeDisableInterruptHandler\",\n null,\n [\"number\"],\n )\n\n QTS_RuntimeEnableModuleLoader: (rt: JSRuntimePointer, use_custom_normalize: number) => void =\n this.module.cwrap(\"QTS_RuntimeEnableModuleLoader\", null, [\"number\", \"number\"])\n\n QTS_RuntimeDisableModuleLoader: (rt: JSRuntimePointer) => void = this.module.cwrap(\n \"QTS_RuntimeDisableModuleLoader\",\n null,\n [\"number\"],\n )\n\n QTS_bjson_encode: (\n ctx: JSContextPointer,\n val: JSValuePointer | JSValueConstPointer,\n ) => JSValuePointer = this.module.cwrap(\"QTS_bjson_encode\", \"number\", [\"number\", \"number\"])\n\n QTS_bjson_decode: (\n ctx: JSContextPointer,\n data: JSValuePointer | JSValueConstPointer,\n ) => JSValuePointer = this.module.cwrap(\"QTS_bjson_decode\", \"number\", [\"number\", \"number\"])\n\n QTS_EvalFunction: (\n ctx: JSContextPointer,\n fun_obj: JSValuePointer | JSValueConstPointer,\n ) => JSValuePointer = this.module.cwrap(\"QTS_EvalFunction\", \"number\", [\"number\", \"number\"])\n\n QTS_EncodeBytecode: (\n ctx: JSContextPointer,\n val: JSValuePointer | JSValueConstPointer,\n ) => JSValuePointer = this.module.cwrap(\"QTS_EncodeBytecode\", \"number\", [\"number\", \"number\"])\n\n QTS_DecodeBytecode: (\n ctx: JSContextPointer,\n data: JSValuePointer | JSValueConstPointer,\n ) => JSValuePointer = this.module.cwrap(\"QTS_DecodeBytecode\", \"number\", [\"number\", \"number\"])\n}\n","import type { QuickJSSyncVariant } from \"@jitl/quickjs-ffi-types\"\n\n/**\n * ### @componentor/quickjs-wasmfs-release-sync\n *\n * QuickJS variant with WasmFS and OPFS support for native filesystem access\n * in browsers without JS boundary crossing.\n *\n * | Variable | Setting | Description |\n * | -- | -- | -- |\n * | library | quickjs | The original [bellard/quickjs](https://github.com/bellard/quickjs) library. |\n * | releaseMode | release | Optimized for performance. |\n * | syncMode | sync | Synchronous execution mode. |\n * | emscriptenInclusion | wasm | Has a separate .wasm file with WasmFS + OPFS support. |\n * | exports | browser | Browser-only (OPFS is a browser API) |\n *\n */\nconst variant: QuickJSSyncVariant = {\n type: \"sync\",\n importFFI: () => import(\"./ffi.js\").then((mod) => mod.QuickJSFFI),\n importModuleLoader: () =>\n import(\"@componentor/quickjs-wasmfs-release-sync/emscripten-module\").then((mod) => mod.default),\n} as const\n\nexport default variant\n"],"mappings":"q/BAAA,yEAmCa,WAnCb,4CAmCa,WAAN,KAAiB,CACtB,YAAoBA,QAAiC,CAAjC,YAAAA,QAEpB,KAAS,MAAQ,GAEjB,eAGsB,KAAK,OAAO,MAAM,YAAa,SAAU,CAAC,SAAU,QAAQ,CAAC,EAEnF,kBAA0D,KAAK,OAAO,MACpE,eACA,SACA,CAAC,QAAQ,CACX,EAEA,+BAA2E,KAAK,OAAO,MACrF,4BACA,KACA,CAAC,SAAU,QAAQ,CACrB,EAEA,mCACE,KAAK,OAAO,MAAM,gCAAiC,SAAU,CAAC,SAAU,QAAQ,CAAC,EAEnF,gCAA6E,KAAK,OAAO,MACvF,6BACA,SACA,CAAC,QAAQ,CACX,EAEA,8BAAyC,KAAK,OAAO,MACnD,2BACA,SACA,CAAC,CACH,EAEA,6BAAwC,KAAK,OAAO,MAAM,0BAA2B,SAAU,CAAC,CAAC,EAEjG,gCACE,KAAK,OAAO,MAAM,6BAA8B,KAAM,CAAC,SAAU,QAAQ,CAAC,EAE5E,sBAA8C,KAAK,OAAO,MAAM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KAAK,OAAO,MAC/E,qCACA,KACA,CAAC,QAAQ,CACX,EAEA,mCACE,KAAK,OAAO,MAAM,gCAAiC,KAAM,CAAC,SAAU,QAAQ,CAAC,EAE/E,oCAAiE,KAAK,OAAO,MAC3E,iCACA,KACA,CAAC,QAAQ,CACX,EAEA,sBAGsB,KAAK,OAAO,MAAM,mBAAoB,SAAU,CAAC,SAAU,QAAQ,CAAC,EAE1F,sBAGsB,KAAK,OAAO,MAAM,mBAAoB,SAAU,CAAC,SAAU,QAAQ,CAAC,EAE1F,sBAGsB,KAAK,OAAO,MAAM,mBAAoB,SAAU,CAAC,SAAU,QAAQ,CAAC,EAE1F,wBAGsB,KAAK,OAAO,MAAM,qBAAsB,SAAU,CAAC,SAAU,QAAQ,CAAC,EAE5F,wBAGsB,KAAK,OAAO,MAAM,qBAAsB,SAAU,CAAC,SAAU,QAAQ,CAAC,CA5YtC,CA6YxD,KCjbA,oHAiBA,IAAM,QAA8B,CAClC,KAAM,OACN,UAAW,IAAM,qDAAmB,KAAM,KAAQ,IAAI,UAAU,EAChE,mBAAoB,IAClB,OAAO,4DAA4D,EAAE,KAAM,KAAQ,IAAI,OAAO,CAClG,EAEO,cAAQ","names":["module"]}
1
+ {"version":3,"sources":["../src/ffi.ts","../src/index.ts"],"sourcesContent":["// This file generated by \"generate.ts ffi\" in the root of the repo.\nimport {\n QuickJSEmscriptenModule,\n JSRuntimePointer,\n JSContextPointer,\n JSContextPointerPointer,\n JSModuleDefPointer,\n JSValuePointer,\n JSValueConstPointer,\n JSValuePointerPointer,\n JSValuePointerPointerPointer,\n JSValueConstPointerPointer,\n QTS_C_To_HostCallbackFuncPointer,\n QTS_C_To_HostInterruptFuncPointer,\n QTS_C_To_HostLoadModuleFuncPointer,\n BorrowedHeapCharPointer,\n OwnedHeapCharPointer,\n JSBorrowedCharPointer,\n JSVoidPointer,\n UInt32Pointer,\n EvalFlags,\n IntrinsicsFlags,\n EvalDetectModule,\n GetOwnPropertyNamesFlags,\n IsEqualOp,\n JSPromiseStateEnum,\n} from \"@componentor/quickjs-ffi-types\"\n\n/**\n * Low-level FFI bindings to QuickJS's Emscripten module.\n * See instead {@link QuickJSContext}, the public Javascript interface exposed by this\n * library.\n *\n * @unstable The FFI interface is considered private and may change.\n */\nexport class QuickJSFFI {\n constructor(private module: QuickJSEmscriptenModule) {}\n /** Set at compile time. */\n readonly DEBUG = false\n\n QTS_Throw: (\n ctx: JSContextPointer,\n error: JSValuePointer | JSValueConstPointer,\n ) => JSValuePointer = this.module.cwrap(\"QTS_Throw\", \"number\", [\"number\", \"number\"])\n\n QTS_NewError: (ctx: JSContextPointer) => JSValuePointer = this.module.cwrap(\n \"QTS_NewError\",\n \"number\",\n [\"number\"],\n )\n\n QTS_RuntimeSetMemoryLimit: (rt: JSRuntimePointer, limit: number) => void = this.module.cwrap(\n \"QTS_RuntimeSetMemoryLimit\",\n null,\n [\"number\", \"number\"],\n )\n\n QTS_RuntimeComputeMemoryUsage: (rt: JSRuntimePointer, ctx: JSContextPointer) => JSValuePointer =\n this.module.cwrap(\"QTS_RuntimeComputeMemoryUsage\", \"number\", [\"number\", \"number\"])\n\n QTS_RuntimeDumpMemoryUsage: (rt: JSRuntimePointer) => OwnedHeapCharPointer = this.module.cwrap(\n \"QTS_RuntimeDumpMemoryUsage\",\n \"number\",\n [\"number\"],\n )\n\n QTS_RecoverableLeakCheck: () => number = this.module.cwrap(\n \"QTS_RecoverableLeakCheck\",\n \"number\",\n [],\n )\n\n QTS_BuildIsSanitizeLeak: () => number = this.module.cwrap(\"QTS_BuildIsSanitizeLeak\", \"number\", [])\n\n QTS_RuntimeSetMaxStackSize: (rt: JSRuntimePointer, stack_size: number) => void =\n this.module.cwrap(\"QTS_RuntimeSetMaxStackSize\", null, [\"number\", \"number\"])\n\n QTS_GetUndefined: () => JSValueConstPointer = this.module.cwrap(\"QTS_GetUndefined\", \"number\", [])\n\n QTS_GetNull: () => JSValueConstPointer = this.module.cwrap(\"QTS_GetNull\", \"number\", [])\n\n QTS_GetFalse: () => JSValueConstPointer = this.module.cwrap(\"QTS_GetFalse\", \"number\", [])\n\n QTS_GetTrue: () => JSValueConstPointer = this.module.cwrap(\"QTS_GetTrue\", \"number\", [])\n\n QTS_NewRuntime: () => JSRuntimePointer = this.module.cwrap(\"QTS_NewRuntime\", \"number\", [])\n\n QTS_FreeRuntime: (rt: JSRuntimePointer) => void = this.module.cwrap(\"QTS_FreeRuntime\", null, [\n \"number\",\n ])\n\n QTS_NewContext: (rt: JSRuntimePointer, intrinsics: IntrinsicsFlags) => JSContextPointer =\n this.module.cwrap(\"QTS_NewContext\", \"number\", [\"number\", \"number\"])\n\n QTS_FreeContext: (ctx: JSContextPointer) => void = this.module.cwrap(\"QTS_FreeContext\", null, [\n \"number\",\n ])\n\n QTS_FreeValuePointer: (ctx: JSContextPointer, value: JSValuePointer) => void = this.module.cwrap(\n \"QTS_FreeValuePointer\",\n null,\n [\"number\", \"number\"],\n )\n\n QTS_FreeValuePointerRuntime: (rt: JSRuntimePointer, value: JSValuePointer) => void =\n this.module.cwrap(\"QTS_FreeValuePointerRuntime\", null, [\"number\", \"number\"])\n\n QTS_FreeVoidPointer: (ctx: JSContextPointer, ptr: JSVoidPointer) => void = this.module.cwrap(\n \"QTS_FreeVoidPointer\",\n null,\n [\"number\", \"number\"],\n )\n\n QTS_FreeCString: (ctx: JSContextPointer, str: JSBorrowedCharPointer) => void = this.module.cwrap(\n \"QTS_FreeCString\",\n null,\n [\"number\", \"number\"],\n )\n\n QTS_DupValuePointer: (\n ctx: JSContextPointer,\n val: JSValuePointer | JSValueConstPointer,\n ) => JSValuePointer = this.module.cwrap(\"QTS_DupValuePointer\", \"number\", [\"number\", \"number\"])\n\n QTS_NewObject: (ctx: JSContextPointer) => JSValuePointer = this.module.cwrap(\n \"QTS_NewObject\",\n \"number\",\n [\"number\"],\n )\n\n QTS_NewObjectProto: (\n ctx: JSContextPointer,\n proto: JSValuePointer | JSValueConstPointer,\n ) => JSValuePointer = this.module.cwrap(\"QTS_NewObjectProto\", \"number\", [\"number\", \"number\"])\n\n QTS_NewArray: (ctx: JSContextPointer) => JSValuePointer = this.module.cwrap(\n \"QTS_NewArray\",\n \"number\",\n [\"number\"],\n )\n\n QTS_NewArrayBuffer: (\n ctx: JSContextPointer,\n buffer: JSVoidPointer,\n length: number,\n ) => JSValuePointer = this.module.cwrap(\"QTS_NewArrayBuffer\", \"number\", [\n \"number\",\n \"number\",\n \"number\",\n ])\n\n QTS_NewFloat64: (ctx: JSContextPointer, num: number) => JSValuePointer = this.module.cwrap(\n \"QTS_NewFloat64\",\n \"number\",\n [\"number\", \"number\"],\n )\n\n QTS_GetFloat64: (ctx: JSContextPointer, value: JSValuePointer | JSValueConstPointer) => number =\n this.module.cwrap(\"QTS_GetFloat64\", \"number\", [\"number\", \"number\"])\n\n QTS_NewString: (ctx: JSContextPointer, string: BorrowedHeapCharPointer) => JSValuePointer =\n this.module.cwrap(\"QTS_NewString\", \"number\", [\"number\", \"number\"])\n\n QTS_GetString: (\n ctx: JSContextPointer,\n value: JSValuePointer | JSValueConstPointer,\n ) => JSBorrowedCharPointer = this.module.cwrap(\"QTS_GetString\", \"number\", [\"number\", \"number\"])\n\n QTS_GetArrayBuffer: (\n ctx: JSContextPointer,\n data: JSValuePointer | JSValueConstPointer,\n ) => JSVoidPointer = this.module.cwrap(\"QTS_GetArrayBuffer\", \"number\", [\"number\", \"number\"])\n\n QTS_GetArrayBufferLength: (\n ctx: JSContextPointer,\n data: JSValuePointer | JSValueConstPointer,\n ) => number = this.module.cwrap(\"QTS_GetArrayBufferLength\", \"number\", [\"number\", \"number\"])\n\n QTS_NewSymbol: (\n ctx: JSContextPointer,\n description: BorrowedHeapCharPointer,\n isGlobal: number,\n ) => JSValuePointer = this.module.cwrap(\"QTS_NewSymbol\", \"number\", [\"number\", \"number\", \"number\"])\n\n QTS_GetSymbolDescriptionOrKey: (\n ctx: JSContextPointer,\n value: JSValuePointer | JSValueConstPointer,\n ) => JSBorrowedCharPointer = this.module.cwrap(\"QTS_GetSymbolDescriptionOrKey\", \"number\", [\n \"number\",\n \"number\",\n ])\n\n QTS_IsGlobalSymbol: (\n ctx: JSContextPointer,\n value: JSValuePointer | JSValueConstPointer,\n ) => number = this.module.cwrap(\"QTS_IsGlobalSymbol\", \"number\", [\"number\", \"number\"])\n\n QTS_IsJobPending: (rt: JSRuntimePointer) => number = this.module.cwrap(\n \"QTS_IsJobPending\",\n \"number\",\n [\"number\"],\n )\n\n QTS_ExecutePendingJob: (\n rt: JSRuntimePointer,\n maxJobsToExecute: number,\n lastJobContext: JSContextPointerPointer,\n ) => JSValuePointer = this.module.cwrap(\"QTS_ExecutePendingJob\", \"number\", [\n \"number\",\n \"number\",\n \"number\",\n ])\n\n QTS_GetProp: (\n ctx: JSContextPointer,\n this_val: JSValuePointer | JSValueConstPointer,\n prop_name: JSValuePointer | JSValueConstPointer,\n ) => JSValuePointer = this.module.cwrap(\"QTS_GetProp\", \"number\", [\"number\", \"number\", \"number\"])\n\n QTS_GetPropNumber: (\n ctx: JSContextPointer,\n this_val: JSValuePointer | JSValueConstPointer,\n prop_name: number,\n ) => JSValuePointer = this.module.cwrap(\"QTS_GetPropNumber\", \"number\", [\n \"number\",\n \"number\",\n \"number\",\n ])\n\n QTS_SetProp: (\n ctx: JSContextPointer,\n this_val: JSValuePointer | JSValueConstPointer,\n prop_name: JSValuePointer | JSValueConstPointer,\n prop_value: JSValuePointer | JSValueConstPointer,\n ) => void = this.module.cwrap(\"QTS_SetProp\", null, [\"number\", \"number\", \"number\", \"number\"])\n\n QTS_DefineProp: (\n ctx: JSContextPointer,\n this_val: JSValuePointer | JSValueConstPointer,\n prop_name: JSValuePointer | JSValueConstPointer,\n prop_value: JSValuePointer | JSValueConstPointer,\n get: JSValuePointer | JSValueConstPointer,\n set: JSValuePointer | JSValueConstPointer,\n configurable: boolean,\n enumerable: boolean,\n has_value: boolean,\n ) => void = this.module.cwrap(\"QTS_DefineProp\", null, [\n \"number\",\n \"number\",\n \"number\",\n \"number\",\n \"number\",\n \"number\",\n \"boolean\",\n \"boolean\",\n \"boolean\",\n ])\n\n QTS_GetOwnPropertyNames: (\n ctx: JSContextPointer,\n out_ptrs: JSValuePointerPointerPointer,\n out_len: UInt32Pointer,\n obj: JSValuePointer | JSValueConstPointer,\n flags: number,\n ) => JSValuePointer = this.module.cwrap(\"QTS_GetOwnPropertyNames\", \"number\", [\n \"number\",\n \"number\",\n \"number\",\n \"number\",\n \"number\",\n ])\n\n QTS_Call: (\n ctx: JSContextPointer,\n func_obj: JSValuePointer | JSValueConstPointer,\n this_obj: JSValuePointer | JSValueConstPointer,\n argc: number,\n argv_ptrs: JSValueConstPointerPointer,\n ) => JSValuePointer = this.module.cwrap(\"QTS_Call\", \"number\", [\n \"number\",\n \"number\",\n \"number\",\n \"number\",\n \"number\",\n ])\n\n QTS_ResolveException: (ctx: JSContextPointer, maybe_exception: JSValuePointer) => JSValuePointer =\n this.module.cwrap(\"QTS_ResolveException\", \"number\", [\"number\", \"number\"])\n\n QTS_Dump: (\n ctx: JSContextPointer,\n obj: JSValuePointer | JSValueConstPointer,\n ) => JSBorrowedCharPointer = this.module.cwrap(\"QTS_Dump\", \"number\", [\"number\", \"number\"])\n\n QTS_Eval: (\n ctx: JSContextPointer,\n js_code: BorrowedHeapCharPointer,\n js_code_length: number,\n filename: string,\n detectModule: EvalDetectModule,\n evalFlags: EvalFlags,\n ) => JSValuePointer = this.module.cwrap(\"QTS_Eval\", \"number\", [\n \"number\",\n \"number\",\n \"number\",\n \"string\",\n \"number\",\n \"number\",\n ])\n\n QTS_GetModuleNamespace: (\n ctx: JSContextPointer,\n module_func_obj: JSValuePointer | JSValueConstPointer,\n ) => JSValuePointer = this.module.cwrap(\"QTS_GetModuleNamespace\", \"number\", [\"number\", \"number\"])\n\n QTS_Typeof: (\n ctx: JSContextPointer,\n value: JSValuePointer | JSValueConstPointer,\n ) => OwnedHeapCharPointer = this.module.cwrap(\"QTS_Typeof\", \"number\", [\"number\", \"number\"])\n\n QTS_GetLength: (\n ctx: JSContextPointer,\n out_len: UInt32Pointer,\n value: JSValuePointer | JSValueConstPointer,\n ) => number = this.module.cwrap(\"QTS_GetLength\", \"number\", [\"number\", \"number\", \"number\"])\n\n QTS_IsEqual: (\n ctx: JSContextPointer,\n a: JSValuePointer | JSValueConstPointer,\n b: JSValuePointer | JSValueConstPointer,\n op: IsEqualOp,\n ) => number = this.module.cwrap(\"QTS_IsEqual\", \"number\", [\"number\", \"number\", \"number\", \"number\"])\n\n QTS_GetGlobalObject: (ctx: JSContextPointer) => JSValuePointer = this.module.cwrap(\n \"QTS_GetGlobalObject\",\n \"number\",\n [\"number\"],\n )\n\n QTS_NewPromiseCapability: (\n ctx: JSContextPointer,\n resolve_funcs_out: JSValuePointerPointer,\n ) => JSValuePointer = this.module.cwrap(\"QTS_NewPromiseCapability\", \"number\", [\n \"number\",\n \"number\",\n ])\n\n QTS_PromiseState: (\n ctx: JSContextPointer,\n promise: JSValuePointer | JSValueConstPointer,\n ) => JSPromiseStateEnum = this.module.cwrap(\"QTS_PromiseState\", \"number\", [\"number\", \"number\"])\n\n QTS_PromiseResult: (\n ctx: JSContextPointer,\n promise: JSValuePointer | JSValueConstPointer,\n ) => JSValuePointer = this.module.cwrap(\"QTS_PromiseResult\", \"number\", [\"number\", \"number\"])\n\n QTS_TestStringArg: (string: string) => void = this.module.cwrap(\"QTS_TestStringArg\", null, [\n \"string\",\n ])\n\n QTS_GetDebugLogEnabled: (rt: JSRuntimePointer) => number = this.module.cwrap(\n \"QTS_GetDebugLogEnabled\",\n \"number\",\n [\"number\"],\n )\n\n QTS_SetDebugLogEnabled: (rt: JSRuntimePointer, is_enabled: number) => void = this.module.cwrap(\n \"QTS_SetDebugLogEnabled\",\n null,\n [\"number\", \"number\"],\n )\n\n QTS_BuildIsDebug: () => number = this.module.cwrap(\"QTS_BuildIsDebug\", \"number\", [])\n\n QTS_BuildIsAsyncify: () => number = this.module.cwrap(\"QTS_BuildIsAsyncify\", \"number\", [])\n\n QTS_NewFunction: (ctx: JSContextPointer, func_id: number, name: string) => JSValuePointer =\n this.module.cwrap(\"QTS_NewFunction\", \"number\", [\"number\", \"number\", \"string\"])\n\n QTS_ArgvGetJSValueConstPointer: (\n argv: JSValuePointer | JSValueConstPointer,\n index: number,\n ) => JSValueConstPointer = this.module.cwrap(\"QTS_ArgvGetJSValueConstPointer\", \"number\", [\n \"number\",\n \"number\",\n ])\n\n QTS_RuntimeEnableInterruptHandler: (rt: JSRuntimePointer) => void = this.module.cwrap(\n \"QTS_RuntimeEnableInterruptHandler\",\n null,\n [\"number\"],\n )\n\n QTS_RuntimeDisableInterruptHandler: (rt: JSRuntimePointer) => void = this.module.cwrap(\n \"QTS_RuntimeDisableInterruptHandler\",\n null,\n [\"number\"],\n )\n\n QTS_RuntimeEnableModuleLoader: (rt: JSRuntimePointer, use_custom_normalize: number) => void =\n this.module.cwrap(\"QTS_RuntimeEnableModuleLoader\", null, [\"number\", \"number\"])\n\n QTS_RuntimeDisableModuleLoader: (rt: JSRuntimePointer) => void = this.module.cwrap(\n \"QTS_RuntimeDisableModuleLoader\",\n null,\n [\"number\"],\n )\n\n QTS_bjson_encode: (\n ctx: JSContextPointer,\n val: JSValuePointer | JSValueConstPointer,\n ) => JSValuePointer = this.module.cwrap(\"QTS_bjson_encode\", \"number\", [\"number\", \"number\"])\n\n QTS_bjson_decode: (\n ctx: JSContextPointer,\n data: JSValuePointer | JSValueConstPointer,\n ) => JSValuePointer = this.module.cwrap(\"QTS_bjson_decode\", \"number\", [\"number\", \"number\"])\n\n QTS_EvalFunction: (\n ctx: JSContextPointer,\n fun_obj: JSValuePointer | JSValueConstPointer,\n ) => JSValuePointer = this.module.cwrap(\"QTS_EvalFunction\", \"number\", [\"number\", \"number\"])\n\n QTS_EncodeBytecode: (\n ctx: JSContextPointer,\n val: JSValuePointer | JSValueConstPointer,\n ) => JSValuePointer = this.module.cwrap(\"QTS_EncodeBytecode\", \"number\", [\"number\", \"number\"])\n\n QTS_DecodeBytecode: (\n ctx: JSContextPointer,\n data: JSValuePointer | JSValueConstPointer,\n ) => JSValuePointer = this.module.cwrap(\"QTS_DecodeBytecode\", \"number\", [\"number\", \"number\"])\n}\n","import type { QuickJSSyncVariant } from \"@componentor/quickjs-ffi-types\"\n\n/**\n * ### @componentor/quickjs-wasmfs-release-sync\n *\n * QuickJS variant with WasmFS and OPFS support for native filesystem access\n * in browsers without JS boundary crossing.\n *\n * | Variable | Setting | Description |\n * | -- | -- | -- |\n * | library | quickjs | The original [bellard/quickjs](https://github.com/bellard/quickjs) library. |\n * | releaseMode | release | Optimized for performance. |\n * | syncMode | sync | Synchronous execution mode. |\n * | emscriptenInclusion | wasm | Has a separate .wasm file with WasmFS + OPFS support. |\n * | exports | browser | Browser-only (OPFS is a browser API) |\n *\n */\nconst variant: QuickJSSyncVariant = {\n type: \"sync\",\n importFFI: () => import(\"./ffi.js\").then((mod) => mod.QuickJSFFI),\n importModuleLoader: () =>\n import(\"@componentor/quickjs-wasmfs-release-sync/emscripten-module\").then((mod) => mod.default),\n} as const\n\nexport default variant\n"],"mappings":"q/BAAA,yEAmCa,WAnCb,4CAmCa,WAAN,KAAiB,CACtB,YAAoBA,QAAiC,CAAjC,YAAAA,QAEpB,KAAS,MAAQ,GAEjB,eAGsB,KAAK,OAAO,MAAM,YAAa,SAAU,CAAC,SAAU,QAAQ,CAAC,EAEnF,kBAA0D,KAAK,OAAO,MACpE,eACA,SACA,CAAC,QAAQ,CACX,EAEA,+BAA2E,KAAK,OAAO,MACrF,4BACA,KACA,CAAC,SAAU,QAAQ,CACrB,EAEA,mCACE,KAAK,OAAO,MAAM,gCAAiC,SAAU,CAAC,SAAU,QAAQ,CAAC,EAEnF,gCAA6E,KAAK,OAAO,MACvF,6BACA,SACA,CAAC,QAAQ,CACX,EAEA,8BAAyC,KAAK,OAAO,MACnD,2BACA,SACA,CAAC,CACH,EAEA,6BAAwC,KAAK,OAAO,MAAM,0BAA2B,SAAU,CAAC,CAAC,E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AAU,CACvF,SACA,QACF,CAAC,EAED,uCAAoE,KAAK,OAAO,MAC9E,oCACA,KACA,CAAC,QAAQ,CACX,EAEA,wCAAqE,KAAK,OAAO,MAC/E,qCACA,KACA,CAAC,QAAQ,CACX,EAEA,mCACE,KAAK,OAAO,MAAM,gCAAiC,KAAM,CAAC,SAAU,QAAQ,CAAC,EAE/E,oCAAiE,KAAK,OAAO,MAC3E,iCACA,KACA,CAAC,QAAQ,CACX,EAEA,sBAGsB,KAAK,OAAO,MAAM,mBAAoB,SAAU,CAAC,SAAU,QAAQ,CAAC,EAE1F,sBAGsB,KAAK,OAAO,MAAM,mBAAoB,SAAU,CAAC,SAAU,QAAQ,CAAC,EAE1F,sBAGsB,KAAK,OAAO,MAAM,mBAAoB,SAAU,CAAC,SAAU,QAAQ,CAAC,EAE1F,wBAGsB,KAAK,OAAO,MAAM,qBAAsB,SAAU,CAAC,SAAU,QAAQ,CAAC,EAE5F,wBAGsB,KAAK,OAAO,MAAM,qBAAsB,SAAU,CAAC,SAAU,QAAQ,CAAC,CA5YtC,CA6YxD,KCjbA,oHAiBA,IAAM,QAA8B,CAClC,KAAM,OACN,UAAW,IAAM,qDAAmB,KAAM,KAAQ,IAAI,UAAU,EAChE,mBAAoB,IAClB,OAAO,4DAA4D,EAAE,KAAM,KAAQ,IAAI,OAAO,CAClG,EAEO,cAAQ","names":["module"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts"],"sourcesContent":["import type { QuickJSSyncVariant } from \"@jitl/quickjs-ffi-types\"\n\n/**\n * ### @componentor/quickjs-wasmfs-release-sync\n *\n * QuickJS variant with WasmFS and OPFS support for native filesystem access\n * in browsers without JS boundary crossing.\n *\n * | Variable | Setting | Description |\n * | -- | -- | -- |\n * | library | quickjs | The original [bellard/quickjs](https://github.com/bellard/quickjs) library. |\n * | releaseMode | release | Optimized for performance. |\n * | syncMode | sync | Synchronous execution mode. |\n * | emscriptenInclusion | wasm | Has a separate .wasm file with WasmFS + OPFS support. |\n * | exports | browser | Browser-only (OPFS is a browser API) |\n *\n */\nconst variant: QuickJSSyncVariant = {\n type: \"sync\",\n importFFI: () => import(\"./ffi.js\").then((mod) => mod.QuickJSFFI),\n importModuleLoader: () =>\n import(\"@componentor/quickjs-wasmfs-release-sync/emscripten-module\").then((mod) => mod.default),\n} as const\n\nexport default variant\n"],"mappings":"AAiBA,IAAM,QAA8B,CAClC,KAAM,OACN,UAAW,IAAM,OAAO,WAAU,EAAE,KAAM,KAAQ,IAAI,UAAU,EAChE,mBAAoB,IAClB,OAAO,4DAA4D,EAAE,KAAM,KAAQ,IAAI,OAAO,CAClG,EAEO,cAAQ","names":[]}
1
+ {"version":3,"sources":["../src/index.ts"],"sourcesContent":["import type { QuickJSSyncVariant } from \"@componentor/quickjs-ffi-types\"\n\n/**\n * ### @componentor/quickjs-wasmfs-release-sync\n *\n * QuickJS variant with WasmFS and OPFS support for native filesystem access\n * in browsers without JS boundary crossing.\n *\n * | Variable | Setting | Description |\n * | -- | -- | -- |\n * | library | quickjs | The original [bellard/quickjs](https://github.com/bellard/quickjs) library. |\n * | releaseMode | release | Optimized for performance. |\n * | syncMode | sync | Synchronous execution mode. |\n * | emscriptenInclusion | wasm | Has a separate .wasm file with WasmFS + OPFS support. |\n * | exports | browser | Browser-only (OPFS is a browser API) |\n *\n */\nconst variant: QuickJSSyncVariant = {\n type: \"sync\",\n importFFI: () => import(\"./ffi.js\").then((mod) => mod.QuickJSFFI),\n importModuleLoader: () =>\n import(\"@componentor/quickjs-wasmfs-release-sync/emscripten-module\").then((mod) => mod.default),\n} as const\n\nexport default variant\n"],"mappings":"AAiBA,IAAM,QAA8B,CAClC,KAAM,OACN,UAAW,IAAM,OAAO,WAAU,EAAE,KAAM,KAAQ,IAAI,UAAU,EAChE,mBAAoB,IAClB,OAAO,4DAA4D,EAAE,KAAM,KAAQ,IAAI,OAAO,CAClG,EAEO,cAAQ","names":[]}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@componentor/quickjs-wasmfs-release-sync",
3
3
  "license": "MIT",
4
- "version": "0.31.0",
4
+ "version": "0.31.2",
5
5
  "description": "QuickJS variant with WasmFS and OPFS support for native filesystem access in browsers without JS boundary crossing.",
6
6
  "sideEffects": false,
7
7
  "repository": {
@@ -43,10 +43,10 @@
43
43
  }
44
44
  },
45
45
  "dependencies": {
46
- "@jitl/quickjs-ffi-types": "0.31.0"
46
+ "@componentor/quickjs-ffi-types": "0.31.2"
47
47
  },
48
48
  "devDependencies": {
49
- "@jitl/tsconfig": "0.31.0"
49
+ "@jitl/tsconfig": "0.31.2"
50
50
  },
51
51
  "scripts": {
52
52
  "build": "pnpm run build:c && pnpm run build:ts",