@nocobase/plugin-workflow-javascript 2.1.0-beta.9 → 2.2.0-alpha.1
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.
- package/build.config.ts +52 -0
- package/dist/client/615.a016da4e5f572288.js +10 -0
- package/dist/client/944.18159d8a1521708e.js +10 -0
- package/dist/client/CodeEditor.d.ts +8 -0
- package/dist/client/index.js +1 -1
- package/dist/externalVersion.js +4 -4
- package/dist/node_modules/@jitl/quickjs-ffi-types/LICENSE +21 -0
- package/dist/node_modules/@jitl/quickjs-ffi-types/README.md +5 -0
- package/dist/node_modules/@jitl/quickjs-ffi-types/dist/index.d.mts +549 -0
- package/dist/node_modules/@jitl/quickjs-ffi-types/dist/index.d.ts +549 -0
- package/dist/node_modules/@jitl/quickjs-ffi-types/dist/index.js +2 -0
- package/dist/node_modules/@jitl/quickjs-ffi-types/dist/index.js.map +1 -0
- package/dist/node_modules/@jitl/quickjs-ffi-types/dist/index.mjs +2 -0
- package/dist/node_modules/@jitl/quickjs-ffi-types/dist/index.mjs.map +1 -0
- package/dist/node_modules/@jitl/quickjs-ffi-types/package.json +36 -0
- package/dist/node_modules/@jitl/quickjs-wasmfile-debug-asyncify/LICENSE +47 -0
- package/dist/node_modules/@jitl/quickjs-wasmfile-debug-asyncify/README.md +93 -0
- package/dist/node_modules/@jitl/quickjs-wasmfile-debug-asyncify/dist/emscripten-module.browser.d.ts +15 -0
- package/dist/node_modules/@jitl/quickjs-wasmfile-debug-asyncify/dist/emscripten-module.browser.mjs +2 -0
- package/dist/node_modules/@jitl/quickjs-wasmfile-debug-asyncify/dist/emscripten-module.cjs +2 -0
- package/dist/node_modules/@jitl/quickjs-wasmfile-debug-asyncify/dist/emscripten-module.cloudflare.cjs +2 -0
- package/dist/node_modules/@jitl/quickjs-wasmfile-debug-asyncify/dist/emscripten-module.cloudflare.d.ts +15 -0
- package/dist/node_modules/@jitl/quickjs-wasmfile-debug-asyncify/dist/emscripten-module.d.ts +15 -0
- package/dist/node_modules/@jitl/quickjs-wasmfile-debug-asyncify/dist/emscripten-module.mjs +2 -0
- package/dist/node_modules/@jitl/quickjs-wasmfile-debug-asyncify/dist/emscripten-module.wasm +0 -0
- package/dist/node_modules/@jitl/quickjs-wasmfile-debug-asyncify/dist/emscripten-module.wasm.map +1 -0
- package/dist/node_modules/@jitl/quickjs-wasmfile-debug-asyncify/dist/ffi.d.mts +94 -0
- package/dist/node_modules/@jitl/quickjs-wasmfile-debug-asyncify/dist/ffi.d.ts +94 -0
- package/dist/node_modules/@jitl/quickjs-wasmfile-debug-asyncify/dist/ffi.js +2 -0
- package/dist/node_modules/@jitl/quickjs-wasmfile-debug-asyncify/dist/ffi.js.map +1 -0
- package/dist/node_modules/@jitl/quickjs-wasmfile-debug-asyncify/dist/ffi.mjs +2 -0
- package/dist/node_modules/@jitl/quickjs-wasmfile-debug-asyncify/dist/ffi.mjs.map +1 -0
- package/dist/node_modules/@jitl/quickjs-wasmfile-debug-asyncify/dist/index.d.mts +20 -0
- package/dist/node_modules/@jitl/quickjs-wasmfile-debug-asyncify/dist/index.d.ts +20 -0
- package/dist/node_modules/@jitl/quickjs-wasmfile-debug-asyncify/dist/index.js +2 -0
- package/dist/node_modules/@jitl/quickjs-wasmfile-debug-asyncify/dist/index.js.map +1 -0
- package/dist/node_modules/@jitl/quickjs-wasmfile-debug-asyncify/dist/index.mjs +2 -0
- package/dist/node_modules/@jitl/quickjs-wasmfile-debug-asyncify/dist/index.mjs.map +1 -0
- package/dist/node_modules/@jitl/quickjs-wasmfile-debug-asyncify/package.json +61 -0
- package/dist/node_modules/@jitl/quickjs-wasmfile-debug-sync/LICENSE +47 -0
- package/dist/node_modules/@jitl/quickjs-wasmfile-debug-sync/README.md +88 -0
- package/dist/node_modules/@jitl/quickjs-wasmfile-debug-sync/dist/emscripten-module.browser.d.ts +11 -0
- package/dist/node_modules/@jitl/quickjs-wasmfile-debug-sync/dist/emscripten-module.browser.mjs +5430 -0
- package/dist/node_modules/@jitl/quickjs-wasmfile-debug-sync/dist/emscripten-module.cjs +5485 -0
- package/dist/node_modules/@jitl/quickjs-wasmfile-debug-sync/dist/emscripten-module.cloudflare.cjs +5424 -0
- package/dist/node_modules/@jitl/quickjs-wasmfile-debug-sync/dist/emscripten-module.cloudflare.d.ts +11 -0
- package/dist/node_modules/@jitl/quickjs-wasmfile-debug-sync/dist/emscripten-module.d.ts +11 -0
- package/dist/node_modules/@jitl/quickjs-wasmfile-debug-sync/dist/emscripten-module.mjs +5541 -0
- package/dist/node_modules/@jitl/quickjs-wasmfile-debug-sync/dist/emscripten-module.wasm +0 -0
- package/dist/node_modules/@jitl/quickjs-wasmfile-debug-sync/dist/emscripten-module.wasm.map +1 -0
- package/dist/node_modules/@jitl/quickjs-wasmfile-debug-sync/dist/ffi.d.mts +85 -0
- package/dist/node_modules/@jitl/quickjs-wasmfile-debug-sync/dist/ffi.d.ts +85 -0
- package/dist/node_modules/@jitl/quickjs-wasmfile-debug-sync/dist/ffi.js +2 -0
- package/dist/node_modules/@jitl/quickjs-wasmfile-debug-sync/dist/ffi.js.map +1 -0
- package/dist/node_modules/@jitl/quickjs-wasmfile-debug-sync/dist/ffi.mjs +2 -0
- package/dist/node_modules/@jitl/quickjs-wasmfile-debug-sync/dist/ffi.mjs.map +1 -0
- package/dist/node_modules/@jitl/quickjs-wasmfile-debug-sync/dist/index.d.mts +20 -0
- package/dist/node_modules/@jitl/quickjs-wasmfile-debug-sync/dist/index.d.ts +20 -0
- package/dist/node_modules/@jitl/quickjs-wasmfile-debug-sync/dist/index.js +2 -0
- package/dist/node_modules/@jitl/quickjs-wasmfile-debug-sync/dist/index.js.map +1 -0
- package/dist/node_modules/@jitl/quickjs-wasmfile-debug-sync/dist/index.mjs +2 -0
- package/dist/node_modules/@jitl/quickjs-wasmfile-debug-sync/dist/index.mjs.map +1 -0
- package/dist/node_modules/@jitl/quickjs-wasmfile-debug-sync/package.json +61 -0
- package/dist/node_modules/@jitl/quickjs-wasmfile-release-asyncify/LICENSE +47 -0
- package/dist/node_modules/@jitl/quickjs-wasmfile-release-asyncify/README.md +89 -0
- package/dist/node_modules/@jitl/quickjs-wasmfile-release-asyncify/dist/emscripten-module.browser.d.ts +15 -0
- package/dist/node_modules/@jitl/quickjs-wasmfile-release-asyncify/dist/emscripten-module.browser.mjs +26 -0
- package/dist/node_modules/@jitl/quickjs-wasmfile-release-asyncify/dist/emscripten-module.cjs +25 -0
- package/dist/node_modules/@jitl/quickjs-wasmfile-release-asyncify/dist/emscripten-module.cloudflare.cjs +25 -0
- package/dist/node_modules/@jitl/quickjs-wasmfile-release-asyncify/dist/emscripten-module.cloudflare.d.ts +15 -0
- package/dist/node_modules/@jitl/quickjs-wasmfile-release-asyncify/dist/emscripten-module.d.ts +15 -0
- package/dist/node_modules/@jitl/quickjs-wasmfile-release-asyncify/dist/emscripten-module.mjs +30 -0
- package/dist/node_modules/@jitl/quickjs-wasmfile-release-asyncify/dist/emscripten-module.wasm +0 -0
- package/dist/node_modules/@jitl/quickjs-wasmfile-release-asyncify/dist/ffi.d.mts +94 -0
- package/dist/node_modules/@jitl/quickjs-wasmfile-release-asyncify/dist/ffi.d.ts +94 -0
- package/dist/node_modules/@jitl/quickjs-wasmfile-release-asyncify/dist/ffi.js +2 -0
- package/dist/node_modules/@jitl/quickjs-wasmfile-release-asyncify/dist/ffi.js.map +1 -0
- package/dist/node_modules/@jitl/quickjs-wasmfile-release-asyncify/dist/ffi.mjs +2 -0
- package/dist/node_modules/@jitl/quickjs-wasmfile-release-asyncify/dist/ffi.mjs.map +1 -0
- package/dist/node_modules/@jitl/quickjs-wasmfile-release-asyncify/dist/index.d.mts +20 -0
- package/dist/node_modules/@jitl/quickjs-wasmfile-release-asyncify/dist/index.d.ts +20 -0
- package/dist/node_modules/@jitl/quickjs-wasmfile-release-asyncify/dist/index.js +2 -0
- package/dist/node_modules/@jitl/quickjs-wasmfile-release-asyncify/dist/index.js.map +1 -0
- package/dist/node_modules/@jitl/quickjs-wasmfile-release-asyncify/dist/index.mjs +2 -0
- package/dist/node_modules/@jitl/quickjs-wasmfile-release-asyncify/dist/index.mjs.map +1 -0
- package/dist/node_modules/@jitl/quickjs-wasmfile-release-asyncify/package.json +61 -0
- package/dist/node_modules/@jitl/quickjs-wasmfile-release-sync/LICENSE +47 -0
- package/dist/node_modules/@jitl/quickjs-wasmfile-release-sync/README.md +82 -0
- package/dist/node_modules/@jitl/quickjs-wasmfile-release-sync/dist/emscripten-module.browser.d.ts +11 -0
- package/dist/node_modules/@jitl/quickjs-wasmfile-release-sync/dist/emscripten-module.browser.mjs +22 -0
- package/dist/node_modules/@jitl/quickjs-wasmfile-release-sync/dist/emscripten-module.cjs +21 -0
- package/dist/node_modules/@jitl/quickjs-wasmfile-release-sync/dist/emscripten-module.cloudflare.cjs +21 -0
- package/dist/node_modules/@jitl/quickjs-wasmfile-release-sync/dist/emscripten-module.cloudflare.d.ts +11 -0
- package/dist/node_modules/@jitl/quickjs-wasmfile-release-sync/dist/emscripten-module.d.ts +11 -0
- package/dist/node_modules/@jitl/quickjs-wasmfile-release-sync/dist/emscripten-module.mjs +25 -0
- package/dist/node_modules/@jitl/quickjs-wasmfile-release-sync/dist/emscripten-module.wasm +0 -0
- package/dist/node_modules/@jitl/quickjs-wasmfile-release-sync/dist/ffi.d.mts +85 -0
- package/dist/node_modules/@jitl/quickjs-wasmfile-release-sync/dist/ffi.d.ts +85 -0
- package/dist/node_modules/@jitl/quickjs-wasmfile-release-sync/dist/ffi.js +2 -0
- package/dist/node_modules/@jitl/quickjs-wasmfile-release-sync/dist/ffi.js.map +1 -0
- package/dist/node_modules/@jitl/quickjs-wasmfile-release-sync/dist/ffi.mjs +2 -0
- package/dist/node_modules/@jitl/quickjs-wasmfile-release-sync/dist/ffi.mjs.map +1 -0
- package/dist/node_modules/@jitl/quickjs-wasmfile-release-sync/dist/index.d.mts +20 -0
- package/dist/node_modules/@jitl/quickjs-wasmfile-release-sync/dist/index.d.ts +20 -0
- package/dist/node_modules/@jitl/quickjs-wasmfile-release-sync/dist/index.js +2 -0
- package/dist/node_modules/@jitl/quickjs-wasmfile-release-sync/dist/index.js.map +1 -0
- package/dist/node_modules/@jitl/quickjs-wasmfile-release-sync/dist/index.mjs +2 -0
- package/dist/node_modules/@jitl/quickjs-wasmfile-release-sync/dist/index.mjs.map +1 -0
- package/dist/node_modules/@jitl/quickjs-wasmfile-release-sync/package.json +61 -0
- package/dist/node_modules/joi/dist/joi-browser.min.js +1 -0
- package/dist/node_modules/joi/lib/annotate.js +175 -0
- package/dist/node_modules/joi/lib/base.js +1069 -0
- package/dist/node_modules/joi/lib/cache.js +143 -0
- package/dist/node_modules/joi/lib/common.js +216 -0
- package/dist/node_modules/joi/lib/compile.js +283 -0
- package/dist/node_modules/joi/lib/errors.js +271 -0
- package/dist/node_modules/joi/lib/extend.js +312 -0
- package/dist/node_modules/joi/lib/index.d.ts +2365 -0
- package/dist/node_modules/joi/lib/index.js +1 -0
- package/dist/node_modules/joi/lib/manifest.js +476 -0
- package/dist/node_modules/joi/lib/messages.js +178 -0
- package/dist/node_modules/joi/lib/modify.js +267 -0
- package/dist/node_modules/joi/lib/ref.js +414 -0
- package/dist/node_modules/joi/lib/schemas.js +302 -0
- package/dist/node_modules/joi/lib/state.js +166 -0
- package/dist/node_modules/joi/lib/template.js +463 -0
- package/dist/node_modules/joi/lib/trace.js +346 -0
- package/dist/node_modules/joi/lib/types/alternatives.js +364 -0
- package/dist/node_modules/joi/lib/types/any.js +174 -0
- package/dist/node_modules/joi/lib/types/array.js +809 -0
- package/dist/node_modules/joi/lib/types/binary.js +100 -0
- package/dist/node_modules/joi/lib/types/boolean.js +150 -0
- package/dist/node_modules/joi/lib/types/date.js +233 -0
- package/dist/node_modules/joi/lib/types/function.js +93 -0
- package/dist/node_modules/joi/lib/types/keys.js +1067 -0
- package/dist/node_modules/joi/lib/types/link.js +168 -0
- package/dist/node_modules/joi/lib/types/number.js +363 -0
- package/dist/node_modules/joi/lib/types/object.js +22 -0
- package/dist/node_modules/joi/lib/types/string.js +850 -0
- package/dist/node_modules/joi/lib/types/symbol.js +102 -0
- package/dist/node_modules/joi/lib/validator.js +750 -0
- package/dist/node_modules/joi/lib/values.js +263 -0
- package/dist/node_modules/joi/node_modules/@hapi/topo/lib/index.d.ts +60 -0
- package/dist/node_modules/joi/node_modules/@hapi/topo/lib/index.js +225 -0
- package/dist/node_modules/joi/node_modules/@hapi/topo/package.json +30 -0
- package/dist/node_modules/joi/package.json +1 -0
- package/dist/node_modules/quickjs-emscripten/LICENSE +21 -0
- package/dist/node_modules/quickjs-emscripten/README.md +928 -0
- package/dist/node_modules/quickjs-emscripten/dist/chunk-OHAYRCBA.mjs +2 -0
- package/dist/node_modules/quickjs-emscripten/dist/chunk-OHAYRCBA.mjs.map +1 -0
- package/dist/node_modules/quickjs-emscripten/dist/index.d.mts +57 -0
- package/dist/node_modules/quickjs-emscripten/dist/index.d.ts +57 -0
- package/dist/node_modules/quickjs-emscripten/dist/index.global.js +7309 -0
- package/dist/node_modules/quickjs-emscripten/dist/index.js +2 -0
- package/dist/node_modules/quickjs-emscripten/dist/index.js.map +1 -0
- package/dist/node_modules/quickjs-emscripten/dist/index.mjs +2 -0
- package/dist/node_modules/quickjs-emscripten/dist/index.mjs.map +1 -0
- package/dist/node_modules/quickjs-emscripten/dist/variants.d.mts +39 -0
- package/dist/node_modules/quickjs-emscripten/dist/variants.d.ts +39 -0
- package/dist/node_modules/quickjs-emscripten/dist/variants.js +2 -0
- package/dist/node_modules/quickjs-emscripten/dist/variants.js.map +1 -0
- package/dist/node_modules/quickjs-emscripten/dist/variants.mjs +2 -0
- package/dist/node_modules/quickjs-emscripten/dist/variants.mjs.map +1 -0
- package/dist/node_modules/quickjs-emscripten/package.json +69 -0
- package/dist/node_modules/quickjs-emscripten-core/LICENSE +21 -0
- package/dist/node_modules/quickjs-emscripten-core/README.md +341 -0
- package/dist/node_modules/quickjs-emscripten-core/README.template.md +70 -0
- package/dist/node_modules/quickjs-emscripten-core/dist/chunk-TAV5CUKK.mjs +2 -0
- package/dist/node_modules/quickjs-emscripten-core/dist/chunk-TAV5CUKK.mjs.map +1 -0
- package/dist/node_modules/quickjs-emscripten-core/dist/chunk-V2S4ZYJR.mjs +7 -0
- package/dist/node_modules/quickjs-emscripten-core/dist/chunk-V2S4ZYJR.mjs.map +1 -0
- package/dist/node_modules/quickjs-emscripten-core/dist/index.d.mts +2033 -0
- package/dist/node_modules/quickjs-emscripten-core/dist/index.d.ts +2033 -0
- package/dist/node_modules/quickjs-emscripten-core/dist/index.js +7 -0
- package/dist/node_modules/quickjs-emscripten-core/dist/index.js.map +1 -0
- package/dist/node_modules/quickjs-emscripten-core/dist/index.mjs +2 -0
- package/dist/node_modules/quickjs-emscripten-core/dist/index.mjs.map +1 -0
- package/dist/node_modules/quickjs-emscripten-core/dist/module-ES6BEMUI.mjs +2 -0
- package/dist/node_modules/quickjs-emscripten-core/dist/module-ES6BEMUI.mjs.map +1 -0
- package/dist/node_modules/quickjs-emscripten-core/dist/module-asyncify-2EFITU5U.mjs +2 -0
- package/dist/node_modules/quickjs-emscripten-core/dist/module-asyncify-2EFITU5U.mjs.map +1 -0
- package/dist/node_modules/quickjs-emscripten-core/package.json +49 -0
- package/dist/node_modules/winston-transport/index.js +2 -2
- package/dist/node_modules/winston-transport/package.json +1 -1
- package/dist/server/QuickJs.js +145 -0
- package/dist/server/ScriptInstruction.d.ts +24 -10
- package/dist/server/ScriptInstruction.js +51 -11
- package/dist/server/Vm.js +42 -27
- package/package.json +4 -7
- package/dist/client/907399554f340b0a.js +0 -10
- package/dist/client/d608e8e5c2f2b5cf.js +0 -10
package/dist/node_modules/@jitl/quickjs-wasmfile-release-sync/dist/emscripten-module.cloudflare.cjs
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
var QuickJSRaw=(()=>{var _scriptName=globalThis.document?.currentScript?.src;return async function(moduleArg={}){var moduleRtn;var c=moduleArg;function n(a){a={log:a||function(){}};for(const d of n.Pa)d(a);return c.quickJSEmscriptenExtensions=a}n.Pa=[];c.quickjsEmscriptenInit=n;n.Pa.push(a=>{a.getWasmMemory=function(){return q}});var r="./this.program",t="",u;try{t=(new URL(".",_scriptName)).href}catch{}u=async a=>{a=await fetch(a,{credentials:"same-origin"});if(a.ok)return a.arrayBuffer();throw Error(a.status+" : "+a.url);};var v=console.log.bind(console),w=console.error.bind(console),y,z=!1,A,B,C,D,E,F,G,H=!1;
|
|
2
|
+
function I(){var a=q.buffer;c.HEAP8=D=new Int8Array(a);new Int16Array(a);c.HEAPU8=E=new Uint8Array(a);new Uint16Array(a);F=new Int32Array(a);G=new Uint32Array(a);new Float32Array(a);new Float64Array(a);new BigInt64Array(a);new BigUint64Array(a)}function J(a){c.onAbort?.(a);a="Aborted("+a+")";w(a);z=!0;a=new WebAssembly.RuntimeError(a+". Build with -sASSERTIONS for more info.");C?.(a);throw a;}var K;
|
|
3
|
+
async function aa(a){if(!y)try{var d=await u(a);return new Uint8Array(d)}catch{}if(a==K&&y)a=new Uint8Array(y);else throw"both async and sync fetching of the wasm failed";return a}async function ba(a,d){try{var b=await aa(a);return await WebAssembly.instantiate(b,d)}catch(e){w(`failed to asynchronously prepare wasm: ${e}`),J(e)}}
|
|
4
|
+
async function ca(a){var d=K;if(!y)try{var b=fetch(d,{credentials:"same-origin"});return await WebAssembly.instantiateStreaming(b,a)}catch(e){w(`wasm streaming compile failed: ${e}`),w("falling back to ArrayBuffer instantiation")}return ba(d,a)}class L{name="ExitStatus";constructor(a){this.message=`Program terminated with exit(${a})`;this.status=a}}
|
|
5
|
+
var M=a=>{for(;0<a.length;)a.shift()(c)},N=[],O=[],da=()=>{var a=c.preRun.shift();O.push(a)},P=!0,q,Q=new TextDecoder,ea=(a,d,b,e)=>{b=d+b;if(e)return b;for(;a[d]&&!(d>=b);)++d;return d},R=(a,d,b)=>a?Q.decode(E.subarray(a,ea(E,a,d,b))):"",S=0,fa=[0,31,60,91,121,152,182,213,244,274,305,335],ha=[0,31,59,90,120,151,181,212,243,273,304,334],T={},ia=a=>{if(!(a instanceof L||"unwind"==a))throw a;},ja=a=>{A=a;P||0<S||(c.onExit?.(a),z=!0);throw new L(a);},ka=a=>{if(!z)try{a()}catch(d){ia(d)}finally{if(!(P||
|
|
6
|
+
0<S))try{A=a=A,ja(a)}catch(d){ia(d)}}},U=(a,d,b)=>{var e=E;if(!(0<b))return 0;var f=d;b=d+b-1;for(var g=0;g<a.length;++g){var h=a.codePointAt(g);if(127>=h){if(d>=b)break;e[d++]=h}else if(2047>=h){if(d+1>=b)break;e[d++]=192|h>>6;e[d++]=128|h&63}else if(65535>=h){if(d+2>=b)break;e[d++]=224|h>>12;e[d++]=128|h>>6&63;e[d++]=128|h&63}else{if(d+3>=b)break;e[d++]=240|h>>18;e[d++]=128|h>>12&63;e[d++]=128|h>>6&63;e[d++]=128|h&63;g++}}e[d]=0;return d-f},V={},la=()=>{if(!W){var a={USER:"web_user",LOGNAME:"web_user",
|
|
7
|
+
PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:(globalThis.navigator?.language??"C").replace("-","_")+".UTF-8",_:r||"./this.program"},d;for(d in V)void 0===V[d]?delete a[d]:a[d]=V[d];var b=[];for(d in a)b.push(`${d}=${a[d]}`);W=b}return W},W,X=a=>{for(var d=0,b=0;b<a.length;++b){var e=a.charCodeAt(b);127>=e?d++:2047>=e?d+=2:55296<=e&&57343>=e?(d+=4,++b):d+=3}return d},ma=[null,[],[]],pa=(a,d,b,e)=>{var f={string:k=>{var l=0;if(null!==k&&void 0!==k&&0!==k){l=X(k)+1;var p=Y(l);U(k,p,l);l=p}return l},array:k=>
|
|
8
|
+
{var l=Y(k.length);D.set(k,l);return l}};a=c["_"+a];var g=[],h=0;if(e)for(var m=0;m<e.length;m++){var x=f[b[m]];x?(0===h&&(h=na()),g[m]=x(e[m])):g[m]=e[m]}b=a(...g);return b=function(k){0!==h&&oa(h);return"string"===d?R(k):"boolean"===d?!!k:k}(b)};c.wasmMemory?q=c.wasmMemory:q=new WebAssembly.Memory({initial:(c.INITIAL_MEMORY||16777216)/65536,maximum:32768});I();c.noExitRuntime&&(P=c.noExitRuntime);c.print&&(v=c.print);c.printErr&&(w=c.printErr);c.wasmBinary&&(y=c.wasmBinary);c.thisProgram&&(r=c.thisProgram);
|
|
9
|
+
if(c.preInit)for("function"==typeof c.preInit&&(c.preInit=[c.preInit]);0<c.preInit.length;)c.preInit.shift()();c.cwrap=(a,d,b,e)=>{var f=!b||b.every(g=>"number"===g||"boolean"===g);return"string"!==d&&f&&!e?c["_"+a]:(...g)=>pa(a,d,b,g)};c.UTF8ToString=R;c.stringToUTF8=(a,d,b)=>U(a,d,b);c.lengthBytesUTF8=X;
|
|
10
|
+
var qa,oa,Y,na,ra={b:(a,d,b,e)=>J(`Assertion failed: ${R(a)}, at: `+[d?R(d):"unknown filename",b,e?R(e):"unknown function"]),q:()=>J(""),l:()=>{P=!1;S=0},m:function(a,d){a=-9007199254740992>a||9007199254740992<a?NaN:Number(a);a=new Date(1E3*a);F[d>>2]=a.getSeconds();F[d+4>>2]=a.getMinutes();F[d+8>>2]=a.getHours();F[d+12>>2]=a.getDate();F[d+16>>2]=a.getMonth();F[d+20>>2]=a.getFullYear()-1900;F[d+24>>2]=a.getDay();var b=a.getFullYear();F[d+28>>2]=(0!==b%4||0===b%100&&0!==b%400?ha:fa)[a.getMonth()]+
|
|
11
|
+
a.getDate()-1|0;F[d+36>>2]=-(60*a.getTimezoneOffset());b=(new Date(a.getFullYear(),6,1)).getTimezoneOffset();var e=(new Date(a.getFullYear(),0,1)).getTimezoneOffset();F[d+32>>2]=(b!=e&&a.getTimezoneOffset()==Math.min(e,b))|0},j:(a,d)=>{T[a]&&(clearTimeout(T[a].id),delete T[a]);if(!d)return 0;var b=setTimeout(()=>{delete T[a];ka(()=>qa(a,performance.now()))},d);T[a]={id:b,Qa:d};return 0},n:(a,d,b,e)=>{var f=(new Date).getFullYear(),g=(new Date(f,0,1)).getTimezoneOffset();f=(new Date(f,6,1)).getTimezoneOffset();
|
|
12
|
+
G[a>>2]=60*Math.max(g,f);F[d>>2]=Number(g!=f);d=h=>{var m=Math.abs(h);return`UTC${0<=h?"-":"+"}${String(Math.floor(m/60)).padStart(2,"0")}${String(m%60).padStart(2,"0")}`};a=d(g);d=d(f);f<g?(U(a,b,17),U(d,e,17)):(U(a,e,17),U(d,b,17))},p:()=>Date.now(),k:a=>{var d=E.length;a>>>=0;if(2147483648<a)return!1;for(var b=1;4>=b;b*=2){var e=d*(1+.2/b);e=Math.min(e,a+100663296);a:{e=(Math.min(2147483648,65536*Math.ceil(Math.max(a,e)/65536))-q.buffer.byteLength+65535)/65536|0;try{q.grow(e);I();var f=1;break a}catch(g){}f=
|
|
13
|
+
void 0}if(f)return!0}return!1},e:(a,d)=>{var b=0,e=0,f;for(f of la()){var g=d+b;G[a+e>>2]=g;b+=U(f,g,Infinity)+1;e+=4}return 0},f:(a,d)=>{var b=la();G[a>>2]=b.length;a=0;for(var e of b)a+=X(e)+1;G[d>>2]=a;return 0},d:()=>52,o:function(){return 70},c:(a,d,b,e)=>{for(var f=0,g=0;g<b;g++){var h=G[d>>2],m=G[d+4>>2];d+=8;for(var x=0;x<m;x++){var k=a,l=E[h+x],p=ma[k];0===l||10===l?(k=1===k?v:w,l=ea(p,0),l=Q.decode(p.buffer?p.subarray(0,l):new Uint8Array(p.slice(0,l))),k(l),p.length=0):p.push(l)}f+=m}G[e>>
|
|
14
|
+
2]=f;return 0},a:q,r:ja,s:function(a,d,b,e,f){return c.callbacks.callFunction(void 0,a,d,b,e,f)},i:function(a){return c.callbacks.shouldInterrupt(void 0,a)},h:function(a,d,b){b=R(b);return c.callbacks.loadModuleSource(void 0,a,d,b)},g:function(a,d,b,e){b=R(b);e=R(e);return c.callbacks.normalizeModule(void 0,a,d,b,e)},t:function(a,d){c.callbacks.freeHostRef(void 0,a,d)}},Z;
|
|
15
|
+
Z=await (async function(){function a(b){b=Z=b.exports;c._malloc=b.v;c._QTS_Throw=b.w;c._QTS_NewError=b.x;c._QTS_RuntimeSetMemoryLimit=b.y;c._QTS_RuntimeComputeMemoryUsage=b.z;c._QTS_RuntimeDumpMemoryUsage=b.A;c._QTS_RecoverableLeakCheck=b.B;c._QTS_BuildIsSanitizeLeak=b.C;c._QTS_RuntimeSetMaxStackSize=b.D;c._QTS_GetUndefined=b.E;c._QTS_GetNull=b.F;c._QTS_GetFalse=b.G;c._QTS_GetTrue=b.H;c._QTS_NewHostRef=b.I;c._QTS_GetHostRefId=b.J;c._QTS_NewRuntime=b.K;c._QTS_FreeRuntime=b.L;c._free=b.M;
|
|
16
|
+
c._QTS_NewContext=b.N;c._QTS_FreeContext=b.O;c._QTS_FreeValuePointer=b.P;c._QTS_FreeValuePointerRuntime=b.Q;c._QTS_FreeVoidPointer=b.R;c._QTS_FreeCString=b.S;c._QTS_DupValuePointer=b.T;c._QTS_NewObject=b.U;c._QTS_NewObjectProto=b.V;c._QTS_NewArray=b.W;c._QTS_NewArrayBuffer=b.X;c._QTS_NewFloat64=b.Y;c._QTS_GetFloat64=b.Z;c._QTS_NewString=b._;c._QTS_GetString=b.$;c._QTS_GetArrayBuffer=b.aa;c._QTS_GetArrayBufferLength=b.ba;c._QTS_NewSymbol=b.ca;c._QTS_GetSymbolDescriptionOrKey=b.da;c._QTS_IsGlobalSymbol=
|
|
17
|
+
b.ea;c._QTS_IsJobPending=b.fa;c._QTS_ExecutePendingJob=b.ga;c._QTS_GetProp=b.ha;c._QTS_GetPropNumber=b.ia;c._QTS_SetProp=b.ja;c._QTS_DefineProp=b.ka;c._QTS_GetOwnPropertyNames=b.la;c._QTS_Call=b.ma;c._QTS_ResolveException=b.na;c._QTS_Dump=b.oa;c._QTS_Eval=b.pa;c._QTS_GetModuleNamespace=b.qa;c._QTS_Typeof=b.ra;c._QTS_GetLength=b.sa;c._QTS_IsEqual=b.ta;c._QTS_GetGlobalObject=b.ua;c._QTS_NewPromiseCapability=b.va;c._QTS_PromiseState=b.wa;c._QTS_PromiseResult=b.xa;c._QTS_TestStringArg=b.ya;c._QTS_GetDebugLogEnabled=
|
|
18
|
+
b.za;c._QTS_SetDebugLogEnabled=b.Aa;c._QTS_BuildIsDebug=b.Ba;c._QTS_BuildIsAsyncify=b.Ca;c._QTS_NewFunction=b.Da;c._QTS_ArgvGetJSValueConstPointer=b.Ea;c._QTS_RuntimeEnableInterruptHandler=b.Fa;c._QTS_RuntimeDisableInterruptHandler=b.Ga;c._QTS_RuntimeEnableModuleLoader=b.Ha;c._QTS_RuntimeDisableModuleLoader=b.Ia;c._QTS_bjson_encode=b.Ja;c._QTS_bjson_decode=b.Ka;qa=b.La;oa=b.Ma;Y=b.Na;na=b.Oa;return Z}var d={a:ra};if(c.instantiateWasm)return new Promise(b=>{c.instantiateWasm(d,(e,f)=>{b(a(e,f))})});
|
|
19
|
+
K??=c.locateFile?c.locateFile("emscripten-module.wasm",t):t+"emscripten-module.wasm";return a((await ca(d)).instance)}());
|
|
20
|
+
(function(){function a(){c.calledRun=!0;if(!z){H=!0;Z.u();B?.(c);c.onRuntimeInitialized?.();if(c.postRun)for("function"==typeof c.postRun&&(c.postRun=[c.postRun]);c.postRun.length;){var d=c.postRun.shift();N.push(d)}M(N)}}if(c.preRun)for("function"==typeof c.preRun&&(c.preRun=[c.preRun]);c.preRun.length;)da();M(O);c.setStatus?(c.setStatus("Running..."),setTimeout(()=>{setTimeout(()=>c.setStatus(""),1);a()},1)):a()})();H?moduleRtn=c:moduleRtn=new Promise((a,d)=>{B=a;C=d});
|
|
21
|
+
;return moduleRtn}})();if(typeof exports==="object"&&typeof module==="object"){module.exports=QuickJSRaw;module.exports.default=QuickJSRaw}else if(typeof define==="function"&&define["amd"])define([],()=>QuickJSRaw);
|
package/dist/node_modules/@jitl/quickjs-wasmfile-release-sync/dist/emscripten-module.cloudflare.d.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// Generated from ../../templates/emscripten-module.SYNC.d.ts
|
|
2
|
+
import type { EmscriptenModuleLoader, QuickJSEmscriptenModule } from "@jitl/quickjs-ffi-types"
|
|
3
|
+
/**
|
|
4
|
+
* Emscripten module built from the unmodified [`quickjs/quickjs.h`](../quickjs/quickjs.h)
|
|
5
|
+
* and our FFI support functions [c/interface.c](../c/interface.c).
|
|
6
|
+
*
|
|
7
|
+
* Note that emscripten modules returned by a `MODULARIZE=1` emscripten build
|
|
8
|
+
* (like this one) load asynchronously.
|
|
9
|
+
*/
|
|
10
|
+
declare const ModuleLoader: EmscriptenModuleLoader<QuickJSEmscriptenModule>
|
|
11
|
+
export default ModuleLoader
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// Generated from ../../templates/emscripten-module.SYNC.d.ts
|
|
2
|
+
import type { EmscriptenModuleLoader, QuickJSEmscriptenModule } from "@jitl/quickjs-ffi-types"
|
|
3
|
+
/**
|
|
4
|
+
* Emscripten module built from the unmodified [`quickjs/quickjs.h`](../quickjs/quickjs.h)
|
|
5
|
+
* and our FFI support functions [c/interface.c](../c/interface.c).
|
|
6
|
+
*
|
|
7
|
+
* Note that emscripten modules returned by a `MODULARIZE=1` emscripten build
|
|
8
|
+
* (like this one) load asynchronously.
|
|
9
|
+
*/
|
|
10
|
+
declare const ModuleLoader: EmscriptenModuleLoader<QuickJSEmscriptenModule>
|
|
11
|
+
export default ModuleLoader
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
async function QuickJSRaw(moduleArg={}){var moduleRtn;var d=moduleArg,aa=!!globalThis.window,n=!!globalThis.WorkerGlobalScope,q=globalThis.process?.versions?.node&&"renderer"!=globalThis.process?.type;if(q){const {createRequire:a}=await import("node:module");var require=a(import.meta.url)}function r(a){a={log:a||function(){}};for(const c of r.Pa)c(a);return d.quickJSEmscriptenExtensions=a}r.Pa=[];d.quickjsEmscriptenInit=r;r.Pa.push(a=>{a.getWasmMemory=function(){return t}});
|
|
2
|
+
var u="./this.program",v=(a,c)=>{throw c;},w=import.meta.url,y="",z,A;
|
|
3
|
+
if(q){var fs=require("node:fs");w.startsWith("file:")&&(y=require("node:path").dirname(require("node:url").fileURLToPath(w))+"/");A=a=>{a=B(a)?new URL(a):a;return fs.readFileSync(a)};z=async a=>{a=B(a)?new URL(a):a;return fs.readFileSync(a,void 0)};1<process.argv.length&&(u=process.argv[1].replace(/\\/g,"/"));process.argv.slice(2);v=(a,c)=>{process.exitCode=a;throw c;}}else if(aa||n){try{y=(new URL(".",w)).href}catch{}n&&(A=a=>{var c=new XMLHttpRequest;c.open("GET",a,!1);c.responseType="arraybuffer";
|
|
4
|
+
c.send(null);return new Uint8Array(c.response)});z=async a=>{if(B(a))return new Promise((b,e)=>{var f=new XMLHttpRequest;f.open("GET",a,!0);f.responseType="arraybuffer";f.onload=()=>{200==f.status||0==f.status&&f.response?b(f.response):e(f.status)};f.onerror=e;f.send(null)});var c=await fetch(a,{credentials:"same-origin"});if(c.ok)return c.arrayBuffer();throw Error(c.status+" : "+c.url);}}
|
|
5
|
+
var C=console.log.bind(console),D=console.error.bind(console),E,F=!1,G,B=a=>a.startsWith("file://"),H,I,J,K,L,M,ba=!1;function ca(){var a=t.buffer;d.HEAP8=J=new Int8Array(a);new Int16Array(a);d.HEAPU8=K=new Uint8Array(a);new Uint16Array(a);L=new Int32Array(a);M=new Uint32Array(a);new Float32Array(a);new Float64Array(a);new BigInt64Array(a);new BigUint64Array(a)}
|
|
6
|
+
function N(a){d.onAbort?.(a);a="Aborted("+a+")";D(a);F=!0;a=new WebAssembly.RuntimeError(a+". Build with -sASSERTIONS for more info.");I?.(a);throw a;}var O;async function da(a){if(!E)try{var c=await z(a);return new Uint8Array(c)}catch{}if(a==O&&E)a=new Uint8Array(E);else if(A)a=A(a);else throw"both async and sync fetching of the wasm failed";return a}
|
|
7
|
+
async function ea(a,c){try{var b=await da(a);return await WebAssembly.instantiate(b,c)}catch(e){D(`failed to asynchronously prepare wasm: ${e}`),N(e)}}async function fa(a){var c=O;if(!E&&!B(c)&&!q)try{var b=fetch(c,{credentials:"same-origin"});return await WebAssembly.instantiateStreaming(b,a)}catch(e){D(`wasm streaming compile failed: ${e}`),D("falling back to ArrayBuffer instantiation")}return ea(c,a)}
|
|
8
|
+
class P{name="ExitStatus";constructor(a){this.message=`Program terminated with exit(${a})`;this.status=a}}
|
|
9
|
+
var ha=a=>{for(;0<a.length;)a.shift()(d)},ia=[],ja=[],ka=()=>{var a=d.preRun.shift();ja.push(a)},Q=!0,t,la=new TextDecoder,ma=(a,c,b,e)=>{b=c+b;if(e)return b;for(;a[c]&&!(c>=b);)++c;return c},R=(a,c,b)=>a?la.decode(K.subarray(a,ma(K,a,c,b))):"",S=0,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],T={},pa=a=>{G=a;Q||0<S||(d.onExit?.(a),F=!0);v(a,new P(a))},qa=a=>{if(!F)try{a()}catch(c){c instanceof P||"unwind"==c||v(1,c)}finally{if(!(Q||0<S))try{G=a=G,
|
|
10
|
+
pa(a)}catch(c){c instanceof P||"unwind"==c||v(1,c)}}},U=(a,c,b)=>{var e=K;if(!(0<b))return 0;var f=c;b=c+b-1;for(var g=0;g<a.length;++g){var h=a.codePointAt(g);if(127>=h){if(c>=b)break;e[c++]=h}else if(2047>=h){if(c+1>=b)break;e[c++]=192|h>>6;e[c++]=128|h&63}else if(65535>=h){if(c+2>=b)break;e[c++]=224|h>>12;e[c++]=128|h>>6&63;e[c++]=128|h&63}else{if(c+3>=b)break;e[c++]=240|h>>18;e[c++]=128|h>>12&63;e[c++]=128|h>>6&63;e[c++]=128|h&63;g++}}e[c]=0;return c-f},V={},ra=()=>{if(!W){var a={USER:"web_user",
|
|
11
|
+
LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:(globalThis.navigator?.language??"C").replace("-","_")+".UTF-8",_:u||"./this.program"},c;for(c in V)void 0===V[c]?delete a[c]:a[c]=V[c];var b=[];for(c in a)b.push(`${c}=${a[c]}`);W=b}return W},W,X=a=>{for(var c=0,b=0;b<a.length;++b){var e=a.charCodeAt(b);127>=e?c++:2047>=e?c+=2:55296<=e&&57343>=e?(c+=4,++b):c+=3}return c},sa=[null,[],[]],va=(a,c,b,e)=>{var f={string:k=>{var l=0;if(null!==k&&void 0!==k&&0!==k){l=X(k)+1;var p=Y(l);U(k,p,
|
|
12
|
+
l);l=p}return l},array:k=>{var l=Y(k.length);J.set(k,l);return l}};a=d["_"+a];var g=[],h=0;if(e)for(var m=0;m<e.length;m++){var x=f[b[m]];x?(0===h&&(h=ta()),g[m]=x(e[m])):g[m]=e[m]}b=a(...g);return b=function(k){0!==h&&ua(h);return"string"===c?R(k):"boolean"===c?!!k:k}(b)};d.wasmMemory?t=d.wasmMemory:t=new WebAssembly.Memory({initial:(d.INITIAL_MEMORY||16777216)/65536,maximum:32768});ca();d.noExitRuntime&&(Q=d.noExitRuntime);d.print&&(C=d.print);d.printErr&&(D=d.printErr);d.wasmBinary&&(E=d.wasmBinary);
|
|
13
|
+
d.thisProgram&&(u=d.thisProgram);if(d.preInit)for("function"==typeof d.preInit&&(d.preInit=[d.preInit]);0<d.preInit.length;)d.preInit.shift()();d.cwrap=(a,c,b,e)=>{var f=!b||b.every(g=>"number"===g||"boolean"===g);return"string"!==c&&f&&!e?d["_"+a]:(...g)=>va(a,c,b,g)};d.UTF8ToString=R;d.stringToUTF8=(a,c,b)=>U(a,c,b);d.lengthBytesUTF8=X;
|
|
14
|
+
var wa,ua,Y,ta,xa={b:(a,c,b,e)=>N(`Assertion failed: ${R(a)}, at: `+[c?R(c):"unknown filename",b,e?R(e):"unknown function"]),q:()=>N(""),l:()=>{Q=!1;S=0},m:function(a,c){a=-9007199254740992>a||9007199254740992<a?NaN:Number(a);a=new Date(1E3*a);L[c>>2]=a.getSeconds();L[c+4>>2]=a.getMinutes();L[c+8>>2]=a.getHours();L[c+12>>2]=a.getDate();L[c+16>>2]=a.getMonth();L[c+20>>2]=a.getFullYear()-1900;L[c+24>>2]=a.getDay();var b=a.getFullYear();L[c+28>>2]=(0!==b%4||0===b%100&&0!==b%400?oa:na)[a.getMonth()]+
|
|
15
|
+
a.getDate()-1|0;L[c+36>>2]=-(60*a.getTimezoneOffset());b=(new Date(a.getFullYear(),6,1)).getTimezoneOffset();var e=(new Date(a.getFullYear(),0,1)).getTimezoneOffset();L[c+32>>2]=(b!=e&&a.getTimezoneOffset()==Math.min(e,b))|0},j:(a,c)=>{T[a]&&(clearTimeout(T[a].id),delete T[a]);if(!c)return 0;var b=setTimeout(()=>{delete T[a];qa(()=>wa(a,performance.now()))},c);T[a]={id:b,Qa:c};return 0},n:(a,c,b,e)=>{var f=(new Date).getFullYear(),g=(new Date(f,0,1)).getTimezoneOffset();f=(new Date(f,6,1)).getTimezoneOffset();
|
|
16
|
+
M[a>>2]=60*Math.max(g,f);L[c>>2]=Number(g!=f);c=h=>{var m=Math.abs(h);return`UTC${0<=h?"-":"+"}${String(Math.floor(m/60)).padStart(2,"0")}${String(m%60).padStart(2,"0")}`};a=c(g);c=c(f);f<g?(U(a,b,17),U(c,e,17)):(U(a,e,17),U(c,b,17))},p:()=>Date.now(),k:a=>{var c=K.length;a>>>=0;if(2147483648<a)return!1;for(var b=1;4>=b;b*=2){var e=c*(1+.2/b);e=Math.min(e,a+100663296);a:{e=(Math.min(2147483648,65536*Math.ceil(Math.max(a,e)/65536))-t.buffer.byteLength+65535)/65536|0;try{t.grow(e);ca();var f=1;break a}catch(g){}f=
|
|
17
|
+
void 0}if(f)return!0}return!1},e:(a,c)=>{var b=0,e=0,f;for(f of ra()){var g=c+b;M[a+e>>2]=g;b+=U(f,g,Infinity)+1;e+=4}return 0},f:(a,c)=>{var b=ra();M[a>>2]=b.length;a=0;for(var e of b)a+=X(e)+1;M[c>>2]=a;return 0},d:()=>52,o:function(){return 70},c:(a,c,b,e)=>{for(var f=0,g=0;g<b;g++){var h=M[c>>2],m=M[c+4>>2];c+=8;for(var x=0;x<m;x++){var k=a,l=K[h+x],p=sa[k];0===l||10===l?(k=1===k?C:D,l=ma(p,0),l=la.decode(p.buffer?p.subarray(0,l):new Uint8Array(p.slice(0,l))),k(l),p.length=0):p.push(l)}f+=m}M[e>>
|
|
18
|
+
2]=f;return 0},a:t,r:pa,s:function(a,c,b,e,f){return d.callbacks.callFunction(void 0,a,c,b,e,f)},i:function(a){return d.callbacks.shouldInterrupt(void 0,a)},h:function(a,c,b){b=R(b);return d.callbacks.loadModuleSource(void 0,a,c,b)},g:function(a,c,b,e){b=R(b);e=R(e);return d.callbacks.normalizeModule(void 0,a,c,b,e)},t:function(a,c){d.callbacks.freeHostRef(void 0,a,c)}},Z;
|
|
19
|
+
Z=await (async function(){function a(b){b=Z=b.exports;d._malloc=b.v;d._QTS_Throw=b.w;d._QTS_NewError=b.x;d._QTS_RuntimeSetMemoryLimit=b.y;d._QTS_RuntimeComputeMemoryUsage=b.z;d._QTS_RuntimeDumpMemoryUsage=b.A;d._QTS_RecoverableLeakCheck=b.B;d._QTS_BuildIsSanitizeLeak=b.C;d._QTS_RuntimeSetMaxStackSize=b.D;d._QTS_GetUndefined=b.E;d._QTS_GetNull=b.F;d._QTS_GetFalse=b.G;d._QTS_GetTrue=b.H;d._QTS_NewHostRef=b.I;d._QTS_GetHostRefId=b.J;d._QTS_NewRuntime=b.K;d._QTS_FreeRuntime=b.L;d._free=b.M;
|
|
20
|
+
d._QTS_NewContext=b.N;d._QTS_FreeContext=b.O;d._QTS_FreeValuePointer=b.P;d._QTS_FreeValuePointerRuntime=b.Q;d._QTS_FreeVoidPointer=b.R;d._QTS_FreeCString=b.S;d._QTS_DupValuePointer=b.T;d._QTS_NewObject=b.U;d._QTS_NewObjectProto=b.V;d._QTS_NewArray=b.W;d._QTS_NewArrayBuffer=b.X;d._QTS_NewFloat64=b.Y;d._QTS_GetFloat64=b.Z;d._QTS_NewString=b._;d._QTS_GetString=b.$;d._QTS_GetArrayBuffer=b.aa;d._QTS_GetArrayBufferLength=b.ba;d._QTS_NewSymbol=b.ca;d._QTS_GetSymbolDescriptionOrKey=b.da;d._QTS_IsGlobalSymbol=
|
|
21
|
+
b.ea;d._QTS_IsJobPending=b.fa;d._QTS_ExecutePendingJob=b.ga;d._QTS_GetProp=b.ha;d._QTS_GetPropNumber=b.ia;d._QTS_SetProp=b.ja;d._QTS_DefineProp=b.ka;d._QTS_GetOwnPropertyNames=b.la;d._QTS_Call=b.ma;d._QTS_ResolveException=b.na;d._QTS_Dump=b.oa;d._QTS_Eval=b.pa;d._QTS_GetModuleNamespace=b.qa;d._QTS_Typeof=b.ra;d._QTS_GetLength=b.sa;d._QTS_IsEqual=b.ta;d._QTS_GetGlobalObject=b.ua;d._QTS_NewPromiseCapability=b.va;d._QTS_PromiseState=b.wa;d._QTS_PromiseResult=b.xa;d._QTS_TestStringArg=b.ya;d._QTS_GetDebugLogEnabled=
|
|
22
|
+
b.za;d._QTS_SetDebugLogEnabled=b.Aa;d._QTS_BuildIsDebug=b.Ba;d._QTS_BuildIsAsyncify=b.Ca;d._QTS_NewFunction=b.Da;d._QTS_ArgvGetJSValueConstPointer=b.Ea;d._QTS_RuntimeEnableInterruptHandler=b.Fa;d._QTS_RuntimeDisableInterruptHandler=b.Ga;d._QTS_RuntimeEnableModuleLoader=b.Ha;d._QTS_RuntimeDisableModuleLoader=b.Ia;d._QTS_bjson_encode=b.Ja;d._QTS_bjson_decode=b.Ka;wa=b.La;ua=b.Ma;Y=b.Na;ta=b.Oa;return Z}var c={a:xa};if(d.instantiateWasm)return new Promise(b=>{d.instantiateWasm(c,(e,f)=>{b(a(e,f))})});
|
|
23
|
+
O??=d.locateFile?d.locateFile?d.locateFile("emscripten-module.wasm",y):y+"emscripten-module.wasm":(new URL("emscripten-module.wasm",import.meta.url)).href;return a((await fa(c)).instance)}());
|
|
24
|
+
(function(){function a(){d.calledRun=!0;if(!F){ba=!0;Z.u();H?.(d);d.onRuntimeInitialized?.();if(d.postRun)for("function"==typeof d.postRun&&(d.postRun=[d.postRun]);d.postRun.length;){var c=d.postRun.shift();ia.push(c)}ha(ia)}}if(d.preRun)for("function"==typeof d.preRun&&(d.preRun=[d.preRun]);d.preRun.length;)ka();ha(ja);d.setStatus?(d.setStatus("Running..."),setTimeout(()=>{setTimeout(()=>d.setStatus(""),1);a()},1)):a()})();ba?moduleRtn=d:moduleRtn=new Promise((a,c)=>{H=a;I=c});
|
|
25
|
+
;return moduleRtn}export default QuickJSRaw;
|
|
Binary file
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { QuickJSEmscriptenModule, JSContextPointer, JSValuePointer, JSValueConstPointer, JSRuntimePointer, OwnedHeapCharPointer, HostRefId, IntrinsicsFlags, JSVoidPointer, JSBorrowedCharPointer, BorrowedHeapCharPointer, JSContextPointerPointer, JSValuePointerPointerPointer, UInt32Pointer, JSValueConstPointerPointer, EvalDetectModule, EvalFlags, IsEqualOp, JSValuePointerPointer, JSPromiseStateEnum } from '@jitl/quickjs-ffi-types';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Low-level FFI bindings to QuickJS's Emscripten module.
|
|
5
|
+
* See instead {@link QuickJSContext}, the public Javascript interface exposed by this
|
|
6
|
+
* library.
|
|
7
|
+
*
|
|
8
|
+
* @unstable The FFI interface is considered private and may change.
|
|
9
|
+
*/
|
|
10
|
+
declare class QuickJSFFI {
|
|
11
|
+
private module;
|
|
12
|
+
constructor(module: QuickJSEmscriptenModule);
|
|
13
|
+
/** Set at compile time. */
|
|
14
|
+
readonly DEBUG = false;
|
|
15
|
+
QTS_Throw: (ctx: JSContextPointer, error: JSValuePointer | JSValueConstPointer) => JSValuePointer;
|
|
16
|
+
QTS_NewError: (ctx: JSContextPointer) => JSValuePointer;
|
|
17
|
+
QTS_RuntimeSetMemoryLimit: (rt: JSRuntimePointer, limit: number) => void;
|
|
18
|
+
QTS_RuntimeComputeMemoryUsage: (rt: JSRuntimePointer, ctx: JSContextPointer) => JSValuePointer;
|
|
19
|
+
QTS_RuntimeDumpMemoryUsage: (rt: JSRuntimePointer) => OwnedHeapCharPointer;
|
|
20
|
+
QTS_RecoverableLeakCheck: () => number;
|
|
21
|
+
QTS_BuildIsSanitizeLeak: () => number;
|
|
22
|
+
QTS_RuntimeSetMaxStackSize: (rt: JSRuntimePointer, stack_size: number) => void;
|
|
23
|
+
QTS_GetUndefined: () => JSValueConstPointer;
|
|
24
|
+
QTS_GetNull: () => JSValueConstPointer;
|
|
25
|
+
QTS_GetFalse: () => JSValueConstPointer;
|
|
26
|
+
QTS_GetTrue: () => JSValueConstPointer;
|
|
27
|
+
QTS_NewHostRef: (ctx: JSContextPointer, id: HostRefId) => JSValuePointer;
|
|
28
|
+
QTS_GetHostRefId: (value: JSValuePointer | JSValueConstPointer) => HostRefId;
|
|
29
|
+
QTS_NewRuntime: () => JSRuntimePointer;
|
|
30
|
+
QTS_FreeRuntime: (rt: JSRuntimePointer) => void;
|
|
31
|
+
QTS_NewContext: (rt: JSRuntimePointer, intrinsics: IntrinsicsFlags) => JSContextPointer;
|
|
32
|
+
QTS_FreeContext: (ctx: JSContextPointer) => void;
|
|
33
|
+
QTS_FreeValuePointer: (ctx: JSContextPointer, value: JSValuePointer) => void;
|
|
34
|
+
QTS_FreeValuePointerRuntime: (rt: JSRuntimePointer, value: JSValuePointer) => void;
|
|
35
|
+
QTS_FreeVoidPointer: (ctx: JSContextPointer, ptr: JSVoidPointer) => void;
|
|
36
|
+
QTS_FreeCString: (ctx: JSContextPointer, str: JSBorrowedCharPointer) => void;
|
|
37
|
+
QTS_DupValuePointer: (ctx: JSContextPointer, val: JSValuePointer | JSValueConstPointer) => JSValuePointer;
|
|
38
|
+
QTS_NewObject: (ctx: JSContextPointer) => JSValuePointer;
|
|
39
|
+
QTS_NewObjectProto: (ctx: JSContextPointer, proto: JSValuePointer | JSValueConstPointer) => JSValuePointer;
|
|
40
|
+
QTS_NewArray: (ctx: JSContextPointer) => JSValuePointer;
|
|
41
|
+
QTS_NewArrayBuffer: (ctx: JSContextPointer, buffer: JSVoidPointer, length: number) => JSValuePointer;
|
|
42
|
+
QTS_NewFloat64: (ctx: JSContextPointer, num: number) => JSValuePointer;
|
|
43
|
+
QTS_GetFloat64: (ctx: JSContextPointer, value: JSValuePointer | JSValueConstPointer) => number;
|
|
44
|
+
QTS_NewString: (ctx: JSContextPointer, string: BorrowedHeapCharPointer) => JSValuePointer;
|
|
45
|
+
QTS_GetString: (ctx: JSContextPointer, value: JSValuePointer | JSValueConstPointer) => JSBorrowedCharPointer;
|
|
46
|
+
QTS_GetArrayBuffer: (ctx: JSContextPointer, data: JSValuePointer | JSValueConstPointer) => JSVoidPointer;
|
|
47
|
+
QTS_GetArrayBufferLength: (ctx: JSContextPointer, data: JSValuePointer | JSValueConstPointer) => number;
|
|
48
|
+
QTS_NewSymbol: (ctx: JSContextPointer, description: BorrowedHeapCharPointer, isGlobal: number) => JSValuePointer;
|
|
49
|
+
QTS_GetSymbolDescriptionOrKey: (ctx: JSContextPointer, value: JSValuePointer | JSValueConstPointer) => JSBorrowedCharPointer;
|
|
50
|
+
QTS_IsGlobalSymbol: (ctx: JSContextPointer, value: JSValuePointer | JSValueConstPointer) => number;
|
|
51
|
+
QTS_IsJobPending: (rt: JSRuntimePointer) => number;
|
|
52
|
+
QTS_ExecutePendingJob: (rt: JSRuntimePointer, maxJobsToExecute: number, lastJobContext: JSContextPointerPointer) => JSValuePointer;
|
|
53
|
+
QTS_GetProp: (ctx: JSContextPointer, this_val: JSValuePointer | JSValueConstPointer, prop_name: JSValuePointer | JSValueConstPointer) => JSValuePointer;
|
|
54
|
+
QTS_GetPropNumber: (ctx: JSContextPointer, this_val: JSValuePointer | JSValueConstPointer, prop_name: number) => JSValuePointer;
|
|
55
|
+
QTS_SetProp: (ctx: JSContextPointer, this_val: JSValuePointer | JSValueConstPointer, prop_name: JSValuePointer | JSValueConstPointer, prop_value: JSValuePointer | JSValueConstPointer) => void;
|
|
56
|
+
QTS_DefineProp: (ctx: JSContextPointer, this_val: JSValuePointer | JSValueConstPointer, prop_name: JSValuePointer | JSValueConstPointer, prop_value: JSValuePointer | JSValueConstPointer, get: JSValuePointer | JSValueConstPointer, set: JSValuePointer | JSValueConstPointer, configurable: boolean, enumerable: boolean, has_value: boolean) => void;
|
|
57
|
+
QTS_GetOwnPropertyNames: (ctx: JSContextPointer, out_ptrs: JSValuePointerPointerPointer, out_len: UInt32Pointer, obj: JSValuePointer | JSValueConstPointer, flags: number) => JSValuePointer;
|
|
58
|
+
QTS_Call: (ctx: JSContextPointer, func_obj: JSValuePointer | JSValueConstPointer, this_obj: JSValuePointer | JSValueConstPointer, argc: number, argv_ptrs: JSValueConstPointerPointer) => JSValuePointer;
|
|
59
|
+
QTS_ResolveException: (ctx: JSContextPointer, maybe_exception: JSValuePointer) => JSValuePointer;
|
|
60
|
+
QTS_Dump: (ctx: JSContextPointer, obj: JSValuePointer | JSValueConstPointer) => JSBorrowedCharPointer;
|
|
61
|
+
QTS_Eval: (ctx: JSContextPointer, js_code: BorrowedHeapCharPointer, js_code_length: number, filename: string, detectModule: EvalDetectModule, evalFlags: EvalFlags) => JSValuePointer;
|
|
62
|
+
QTS_GetModuleNamespace: (ctx: JSContextPointer, module_func_obj: JSValuePointer | JSValueConstPointer) => JSValuePointer;
|
|
63
|
+
QTS_Typeof: (ctx: JSContextPointer, value: JSValuePointer | JSValueConstPointer) => OwnedHeapCharPointer;
|
|
64
|
+
QTS_GetLength: (ctx: JSContextPointer, out_len: UInt32Pointer, value: JSValuePointer | JSValueConstPointer) => number;
|
|
65
|
+
QTS_IsEqual: (ctx: JSContextPointer, a: JSValuePointer | JSValueConstPointer, b: JSValuePointer | JSValueConstPointer, op: IsEqualOp) => number;
|
|
66
|
+
QTS_GetGlobalObject: (ctx: JSContextPointer) => JSValuePointer;
|
|
67
|
+
QTS_NewPromiseCapability: (ctx: JSContextPointer, resolve_funcs_out: JSValuePointerPointer) => JSValuePointer;
|
|
68
|
+
QTS_PromiseState: (ctx: JSContextPointer, promise: JSValuePointer | JSValueConstPointer) => JSPromiseStateEnum;
|
|
69
|
+
QTS_PromiseResult: (ctx: JSContextPointer, promise: JSValuePointer | JSValueConstPointer) => JSValuePointer;
|
|
70
|
+
QTS_TestStringArg: (string: string) => void;
|
|
71
|
+
QTS_GetDebugLogEnabled: (rt: JSRuntimePointer) => number;
|
|
72
|
+
QTS_SetDebugLogEnabled: (rt: JSRuntimePointer, is_enabled: number) => void;
|
|
73
|
+
QTS_BuildIsDebug: () => number;
|
|
74
|
+
QTS_BuildIsAsyncify: () => number;
|
|
75
|
+
QTS_NewFunction: (ctx: JSContextPointer, name: string, arg_length: number, is_constructor: boolean, host_ref_id: HostRefId) => JSValuePointer;
|
|
76
|
+
QTS_ArgvGetJSValueConstPointer: (argv: JSValuePointer | JSValueConstPointer, index: number) => JSValueConstPointer;
|
|
77
|
+
QTS_RuntimeEnableInterruptHandler: (rt: JSRuntimePointer) => void;
|
|
78
|
+
QTS_RuntimeDisableInterruptHandler: (rt: JSRuntimePointer) => void;
|
|
79
|
+
QTS_RuntimeEnableModuleLoader: (rt: JSRuntimePointer, use_custom_normalize: number) => void;
|
|
80
|
+
QTS_RuntimeDisableModuleLoader: (rt: JSRuntimePointer) => void;
|
|
81
|
+
QTS_bjson_encode: (ctx: JSContextPointer, val: JSValuePointer | JSValueConstPointer) => JSValuePointer;
|
|
82
|
+
QTS_bjson_decode: (ctx: JSContextPointer, data: JSValuePointer | JSValueConstPointer) => JSValuePointer;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
export { QuickJSFFI };
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { QuickJSEmscriptenModule, JSContextPointer, JSValuePointer, JSValueConstPointer, JSRuntimePointer, OwnedHeapCharPointer, HostRefId, IntrinsicsFlags, JSVoidPointer, JSBorrowedCharPointer, BorrowedHeapCharPointer, JSContextPointerPointer, JSValuePointerPointerPointer, UInt32Pointer, JSValueConstPointerPointer, EvalDetectModule, EvalFlags, IsEqualOp, JSValuePointerPointer, JSPromiseStateEnum } from '@jitl/quickjs-ffi-types';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Low-level FFI bindings to QuickJS's Emscripten module.
|
|
5
|
+
* See instead {@link QuickJSContext}, the public Javascript interface exposed by this
|
|
6
|
+
* library.
|
|
7
|
+
*
|
|
8
|
+
* @unstable The FFI interface is considered private and may change.
|
|
9
|
+
*/
|
|
10
|
+
declare class QuickJSFFI {
|
|
11
|
+
private module;
|
|
12
|
+
constructor(module: QuickJSEmscriptenModule);
|
|
13
|
+
/** Set at compile time. */
|
|
14
|
+
readonly DEBUG = false;
|
|
15
|
+
QTS_Throw: (ctx: JSContextPointer, error: JSValuePointer | JSValueConstPointer) => JSValuePointer;
|
|
16
|
+
QTS_NewError: (ctx: JSContextPointer) => JSValuePointer;
|
|
17
|
+
QTS_RuntimeSetMemoryLimit: (rt: JSRuntimePointer, limit: number) => void;
|
|
18
|
+
QTS_RuntimeComputeMemoryUsage: (rt: JSRuntimePointer, ctx: JSContextPointer) => JSValuePointer;
|
|
19
|
+
QTS_RuntimeDumpMemoryUsage: (rt: JSRuntimePointer) => OwnedHeapCharPointer;
|
|
20
|
+
QTS_RecoverableLeakCheck: () => number;
|
|
21
|
+
QTS_BuildIsSanitizeLeak: () => number;
|
|
22
|
+
QTS_RuntimeSetMaxStackSize: (rt: JSRuntimePointer, stack_size: number) => void;
|
|
23
|
+
QTS_GetUndefined: () => JSValueConstPointer;
|
|
24
|
+
QTS_GetNull: () => JSValueConstPointer;
|
|
25
|
+
QTS_GetFalse: () => JSValueConstPointer;
|
|
26
|
+
QTS_GetTrue: () => JSValueConstPointer;
|
|
27
|
+
QTS_NewHostRef: (ctx: JSContextPointer, id: HostRefId) => JSValuePointer;
|
|
28
|
+
QTS_GetHostRefId: (value: JSValuePointer | JSValueConstPointer) => HostRefId;
|
|
29
|
+
QTS_NewRuntime: () => JSRuntimePointer;
|
|
30
|
+
QTS_FreeRuntime: (rt: JSRuntimePointer) => void;
|
|
31
|
+
QTS_NewContext: (rt: JSRuntimePointer, intrinsics: IntrinsicsFlags) => JSContextPointer;
|
|
32
|
+
QTS_FreeContext: (ctx: JSContextPointer) => void;
|
|
33
|
+
QTS_FreeValuePointer: (ctx: JSContextPointer, value: JSValuePointer) => void;
|
|
34
|
+
QTS_FreeValuePointerRuntime: (rt: JSRuntimePointer, value: JSValuePointer) => void;
|
|
35
|
+
QTS_FreeVoidPointer: (ctx: JSContextPointer, ptr: JSVoidPointer) => void;
|
|
36
|
+
QTS_FreeCString: (ctx: JSContextPointer, str: JSBorrowedCharPointer) => void;
|
|
37
|
+
QTS_DupValuePointer: (ctx: JSContextPointer, val: JSValuePointer | JSValueConstPointer) => JSValuePointer;
|
|
38
|
+
QTS_NewObject: (ctx: JSContextPointer) => JSValuePointer;
|
|
39
|
+
QTS_NewObjectProto: (ctx: JSContextPointer, proto: JSValuePointer | JSValueConstPointer) => JSValuePointer;
|
|
40
|
+
QTS_NewArray: (ctx: JSContextPointer) => JSValuePointer;
|
|
41
|
+
QTS_NewArrayBuffer: (ctx: JSContextPointer, buffer: JSVoidPointer, length: number) => JSValuePointer;
|
|
42
|
+
QTS_NewFloat64: (ctx: JSContextPointer, num: number) => JSValuePointer;
|
|
43
|
+
QTS_GetFloat64: (ctx: JSContextPointer, value: JSValuePointer | JSValueConstPointer) => number;
|
|
44
|
+
QTS_NewString: (ctx: JSContextPointer, string: BorrowedHeapCharPointer) => JSValuePointer;
|
|
45
|
+
QTS_GetString: (ctx: JSContextPointer, value: JSValuePointer | JSValueConstPointer) => JSBorrowedCharPointer;
|
|
46
|
+
QTS_GetArrayBuffer: (ctx: JSContextPointer, data: JSValuePointer | JSValueConstPointer) => JSVoidPointer;
|
|
47
|
+
QTS_GetArrayBufferLength: (ctx: JSContextPointer, data: JSValuePointer | JSValueConstPointer) => number;
|
|
48
|
+
QTS_NewSymbol: (ctx: JSContextPointer, description: BorrowedHeapCharPointer, isGlobal: number) => JSValuePointer;
|
|
49
|
+
QTS_GetSymbolDescriptionOrKey: (ctx: JSContextPointer, value: JSValuePointer | JSValueConstPointer) => JSBorrowedCharPointer;
|
|
50
|
+
QTS_IsGlobalSymbol: (ctx: JSContextPointer, value: JSValuePointer | JSValueConstPointer) => number;
|
|
51
|
+
QTS_IsJobPending: (rt: JSRuntimePointer) => number;
|
|
52
|
+
QTS_ExecutePendingJob: (rt: JSRuntimePointer, maxJobsToExecute: number, lastJobContext: JSContextPointerPointer) => JSValuePointer;
|
|
53
|
+
QTS_GetProp: (ctx: JSContextPointer, this_val: JSValuePointer | JSValueConstPointer, prop_name: JSValuePointer | JSValueConstPointer) => JSValuePointer;
|
|
54
|
+
QTS_GetPropNumber: (ctx: JSContextPointer, this_val: JSValuePointer | JSValueConstPointer, prop_name: number) => JSValuePointer;
|
|
55
|
+
QTS_SetProp: (ctx: JSContextPointer, this_val: JSValuePointer | JSValueConstPointer, prop_name: JSValuePointer | JSValueConstPointer, prop_value: JSValuePointer | JSValueConstPointer) => void;
|
|
56
|
+
QTS_DefineProp: (ctx: JSContextPointer, this_val: JSValuePointer | JSValueConstPointer, prop_name: JSValuePointer | JSValueConstPointer, prop_value: JSValuePointer | JSValueConstPointer, get: JSValuePointer | JSValueConstPointer, set: JSValuePointer | JSValueConstPointer, configurable: boolean, enumerable: boolean, has_value: boolean) => void;
|
|
57
|
+
QTS_GetOwnPropertyNames: (ctx: JSContextPointer, out_ptrs: JSValuePointerPointerPointer, out_len: UInt32Pointer, obj: JSValuePointer | JSValueConstPointer, flags: number) => JSValuePointer;
|
|
58
|
+
QTS_Call: (ctx: JSContextPointer, func_obj: JSValuePointer | JSValueConstPointer, this_obj: JSValuePointer | JSValueConstPointer, argc: number, argv_ptrs: JSValueConstPointerPointer) => JSValuePointer;
|
|
59
|
+
QTS_ResolveException: (ctx: JSContextPointer, maybe_exception: JSValuePointer) => JSValuePointer;
|
|
60
|
+
QTS_Dump: (ctx: JSContextPointer, obj: JSValuePointer | JSValueConstPointer) => JSBorrowedCharPointer;
|
|
61
|
+
QTS_Eval: (ctx: JSContextPointer, js_code: BorrowedHeapCharPointer, js_code_length: number, filename: string, detectModule: EvalDetectModule, evalFlags: EvalFlags) => JSValuePointer;
|
|
62
|
+
QTS_GetModuleNamespace: (ctx: JSContextPointer, module_func_obj: JSValuePointer | JSValueConstPointer) => JSValuePointer;
|
|
63
|
+
QTS_Typeof: (ctx: JSContextPointer, value: JSValuePointer | JSValueConstPointer) => OwnedHeapCharPointer;
|
|
64
|
+
QTS_GetLength: (ctx: JSContextPointer, out_len: UInt32Pointer, value: JSValuePointer | JSValueConstPointer) => number;
|
|
65
|
+
QTS_IsEqual: (ctx: JSContextPointer, a: JSValuePointer | JSValueConstPointer, b: JSValuePointer | JSValueConstPointer, op: IsEqualOp) => number;
|
|
66
|
+
QTS_GetGlobalObject: (ctx: JSContextPointer) => JSValuePointer;
|
|
67
|
+
QTS_NewPromiseCapability: (ctx: JSContextPointer, resolve_funcs_out: JSValuePointerPointer) => JSValuePointer;
|
|
68
|
+
QTS_PromiseState: (ctx: JSContextPointer, promise: JSValuePointer | JSValueConstPointer) => JSPromiseStateEnum;
|
|
69
|
+
QTS_PromiseResult: (ctx: JSContextPointer, promise: JSValuePointer | JSValueConstPointer) => JSValuePointer;
|
|
70
|
+
QTS_TestStringArg: (string: string) => void;
|
|
71
|
+
QTS_GetDebugLogEnabled: (rt: JSRuntimePointer) => number;
|
|
72
|
+
QTS_SetDebugLogEnabled: (rt: JSRuntimePointer, is_enabled: number) => void;
|
|
73
|
+
QTS_BuildIsDebug: () => number;
|
|
74
|
+
QTS_BuildIsAsyncify: () => number;
|
|
75
|
+
QTS_NewFunction: (ctx: JSContextPointer, name: string, arg_length: number, is_constructor: boolean, host_ref_id: HostRefId) => JSValuePointer;
|
|
76
|
+
QTS_ArgvGetJSValueConstPointer: (argv: JSValuePointer | JSValueConstPointer, index: number) => JSValueConstPointer;
|
|
77
|
+
QTS_RuntimeEnableInterruptHandler: (rt: JSRuntimePointer) => void;
|
|
78
|
+
QTS_RuntimeDisableInterruptHandler: (rt: JSRuntimePointer) => void;
|
|
79
|
+
QTS_RuntimeEnableModuleLoader: (rt: JSRuntimePointer, use_custom_normalize: number) => void;
|
|
80
|
+
QTS_RuntimeDisableModuleLoader: (rt: JSRuntimePointer) => void;
|
|
81
|
+
QTS_bjson_encode: (ctx: JSContextPointer, val: JSValuePointer | JSValueConstPointer) => JSValuePointer;
|
|
82
|
+
QTS_bjson_decode: (ctx: JSContextPointer, data: JSValuePointer | JSValueConstPointer) => JSValuePointer;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
export { QuickJSFFI };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";var __defProp=Object.defineProperty;var __getOwnPropDesc=Object.getOwnPropertyDescriptor;var __getOwnPropNames=Object.getOwnPropertyNames;var __hasOwnProp=Object.prototype.hasOwnProperty;var __export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:!0})},__copyProps=(to,from,except,desc)=>{if(from&&typeof from=="object"||typeof from=="function")for(let key of __getOwnPropNames(from))!__hasOwnProp.call(to,key)&&key!==except&&__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to};var __toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod);var ffi_exports={};__export(ffi_exports,{QuickJSFFI:()=>QuickJSFFI});module.exports=__toCommonJS(ffi_exports);var QuickJSFFI=class{constructor(module2){this.module=module2;this.DEBUG=!1;this.QTS_Throw=this.module.cwrap("QTS_Throw","number",["number","number"]);this.QTS_NewError=this.module.cwrap("QTS_NewError","number",["number"]);this.QTS_RuntimeSetMemoryLimit=this.module.cwrap("QTS_RuntimeSetMemoryLimit",null,["number","number"]);this.QTS_RuntimeComputeMemoryUsage=this.module.cwrap("QTS_RuntimeComputeMemoryUsage","number",["number","number"]);this.QTS_RuntimeDumpMemoryUsage=this.module.cwrap("QTS_RuntimeDumpMemoryUsage","number",["number"]);this.QTS_RecoverableLeakCheck=this.module.cwrap("QTS_RecoverableLeakCheck","number",[]);this.QTS_BuildIsSanitizeLeak=this.module.cwrap("QTS_BuildIsSanitizeLeak","number",[]);this.QTS_RuntimeSetMaxStackSize=this.module.cwrap("QTS_RuntimeSetMaxStackSize",null,["number","number"]);this.QTS_GetUndefined=this.module.cwrap("QTS_GetUndefined","number",[]);this.QTS_GetNull=this.module.cwrap("QTS_GetNull","number",[]);this.QTS_GetFalse=this.module.cwrap("QTS_GetFalse","number",[]);this.QTS_GetTrue=this.module.cwrap("QTS_GetTrue","number",[]);this.QTS_NewHostRef=this.module.cwrap("QTS_NewHostRef","number",["number","number"]);this.QTS_GetHostRefId=this.module.cwrap("QTS_GetHostRefId","number",["number"]);this.QTS_NewRuntime=this.module.cwrap("QTS_NewRuntime","number",[]);this.QTS_FreeRuntime=this.module.cwrap("QTS_FreeRuntime",null,["number"]);this.QTS_NewContext=this.module.cwrap("QTS_NewContext","number",["number","number"]);this.QTS_FreeContext=this.module.cwrap("QTS_FreeContext",null,["number"]);this.QTS_FreeValuePointer=this.module.cwrap("QTS_FreeValuePointer",null,["number","number"]);this.QTS_FreeValuePointerRuntime=this.module.cwrap("QTS_FreeValuePointerRuntime",null,["number","number"]);this.QTS_FreeVoidPointer=this.module.cwrap("QTS_FreeVoidPointer",null,["number","number"]);this.QTS_FreeCString=this.module.cwrap("QTS_FreeCString",null,["number","number"]);this.QTS_DupValuePointer=this.module.cwrap("QTS_DupValuePointer","number",["number","number"]);this.QTS_NewObject=this.module.cwrap("QTS_NewObject","number",["number"]);this.QTS_NewObjectProto=this.module.cwrap("QTS_NewObjectProto","number",["number","number"]);this.QTS_NewArray=this.module.cwrap("QTS_NewArray","number",["number"]);this.QTS_NewArrayBuffer=this.module.cwrap("QTS_NewArrayBuffer","number",["number","number","number"]);this.QTS_NewFloat64=this.module.cwrap("QTS_NewFloat64","number",["number","number"]);this.QTS_GetFloat64=this.module.cwrap("QTS_GetFloat64","number",["number","number"]);this.QTS_NewString=this.module.cwrap("QTS_NewString","number",["number","number"]);this.QTS_GetString=this.module.cwrap("QTS_GetString","number",["number","number"]);this.QTS_GetArrayBuffer=this.module.cwrap("QTS_GetArrayBuffer","number",["number","number"]);this.QTS_GetArrayBufferLength=this.module.cwrap("QTS_GetArrayBufferLength","number",["number","number"]);this.QTS_NewSymbol=this.module.cwrap("QTS_NewSymbol","number",["number","number","number"]);this.QTS_GetSymbolDescriptionOrKey=this.module.cwrap("QTS_GetSymbolDescriptionOrKey","number",["number","number"]);this.QTS_IsGlobalSymbol=this.module.cwrap("QTS_IsGlobalSymbol","number",["number","number"]);this.QTS_IsJobPending=this.module.cwrap("QTS_IsJobPending","number",["number"]);this.QTS_ExecutePendingJob=this.module.cwrap("QTS_ExecutePendingJob","number",["number","number","number"]);this.QTS_GetProp=this.module.cwrap("QTS_GetProp","number",["number","number","number"]);this.QTS_GetPropNumber=this.module.cwrap("QTS_GetPropNumber","number",["number","number","number"]);this.QTS_SetProp=this.module.cwrap("QTS_SetProp",null,["number","number","number","number"]);this.QTS_DefineProp=this.module.cwrap("QTS_DefineProp",null,["number","number","number","number","number","number","boolean","boolean","boolean"]);this.QTS_GetOwnPropertyNames=this.module.cwrap("QTS_GetOwnPropertyNames","number",["number","number","number","number","number"]);this.QTS_Call=this.module.cwrap("QTS_Call","number",["number","number","number","number","number"]);this.QTS_ResolveException=this.module.cwrap("QTS_ResolveException","number",["number","number"]);this.QTS_Dump=this.module.cwrap("QTS_Dump","number",["number","number"]);this.QTS_Eval=this.module.cwrap("QTS_Eval","number",["number","number","number","string","number","number"]);this.QTS_GetModuleNamespace=this.module.cwrap("QTS_GetModuleNamespace","number",["number","number"]);this.QTS_Typeof=this.module.cwrap("QTS_Typeof","number",["number","number"]);this.QTS_GetLength=this.module.cwrap("QTS_GetLength","number",["number","number","number"]);this.QTS_IsEqual=this.module.cwrap("QTS_IsEqual","number",["number","number","number","number"]);this.QTS_GetGlobalObject=this.module.cwrap("QTS_GetGlobalObject","number",["number"]);this.QTS_NewPromiseCapability=this.module.cwrap("QTS_NewPromiseCapability","number",["number","number"]);this.QTS_PromiseState=this.module.cwrap("QTS_PromiseState","number",["number","number"]);this.QTS_PromiseResult=this.module.cwrap("QTS_PromiseResult","number",["number","number"]);this.QTS_TestStringArg=this.module.cwrap("QTS_TestStringArg",null,["string"]);this.QTS_GetDebugLogEnabled=this.module.cwrap("QTS_GetDebugLogEnabled","number",["number"]);this.QTS_SetDebugLogEnabled=this.module.cwrap("QTS_SetDebugLogEnabled",null,["number","number"]);this.QTS_BuildIsDebug=this.module.cwrap("QTS_BuildIsDebug","number",[]);this.QTS_BuildIsAsyncify=this.module.cwrap("QTS_BuildIsAsyncify","number",[]);this.QTS_NewFunction=this.module.cwrap("QTS_NewFunction","number",["number","string","number","boolean","number"]);this.QTS_ArgvGetJSValueConstPointer=this.module.cwrap("QTS_ArgvGetJSValueConstPointer","number",["number","number"]);this.QTS_RuntimeEnableInterruptHandler=this.module.cwrap("QTS_RuntimeEnableInterruptHandler",null,["number"]);this.QTS_RuntimeDisableInterruptHandler=this.module.cwrap("QTS_RuntimeDisableInterruptHandler",null,["number"]);this.QTS_RuntimeEnableModuleLoader=this.module.cwrap("QTS_RuntimeEnableModuleLoader",null,["number","number"]);this.QTS_RuntimeDisableModuleLoader=this.module.cwrap("QTS_RuntimeDisableModuleLoader",null,["number"]);this.QTS_bjson_encode=this.module.cwrap("QTS_bjson_encode","number",["number","number"]);this.QTS_bjson_decode=this.module.cwrap("QTS_bjson_decode","number",["number","number"])}};0&&(module.exports={QuickJSFFI});
|
|
2
|
+
//# sourceMappingURL=ffi.js.map
|
|
@@ -0,0 +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 HostRefId,\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_NewHostRef: (ctx: JSContextPointer, id: HostRefId) => JSValuePointer = this.module.cwrap(\n \"QTS_NewHostRef\",\n \"number\",\n [\"number\", \"number\"],\n )\n\n QTS_GetHostRefId: (value: JSValuePointer | JSValueConstPointer) => HostRefId = this.module.cwrap(\n \"QTS_GetHostRefId\",\n \"number\",\n [\"number\"],\n )\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: (\n ctx: JSContextPointer,\n name: string,\n arg_length: number,\n is_constructor: boolean,\n host_ref_id: HostRefId,\n ) => JSValuePointer = this.module.cwrap(\"QTS_NewFunction\", \"number\", [\n \"number\",\n \"string\",\n \"number\",\n \"boolean\",\n \"number\",\n ])\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"],"mappings":"wpBAAA,8GAoCO,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,oBAA2E,KAAK,OAAO,MACrF,iBACA,SACA,CAAC,SAAU,QAAQ,CACrB,EAEA,sBAA+E,KAAK,OAAO,MACzF,mBACA,SACA,CAAC,QAAQ,CACX,EAEA,oBAAyC,KAAK,OAAO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SAAU,CAAC,SAAU,QAAQ,CAAC,EAE1F,sBAGsB,KAAK,OAAO,MAAM,mBAAoB,SAAU,CAAC,SAAU,QAAQ,CAAC,CApZpC,CAqZxD","names":["module"]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
var QuickJSFFI=class{constructor(module){this.module=module;this.DEBUG=!1;this.QTS_Throw=this.module.cwrap("QTS_Throw","number",["number","number"]);this.QTS_NewError=this.module.cwrap("QTS_NewError","number",["number"]);this.QTS_RuntimeSetMemoryLimit=this.module.cwrap("QTS_RuntimeSetMemoryLimit",null,["number","number"]);this.QTS_RuntimeComputeMemoryUsage=this.module.cwrap("QTS_RuntimeComputeMemoryUsage","number",["number","number"]);this.QTS_RuntimeDumpMemoryUsage=this.module.cwrap("QTS_RuntimeDumpMemoryUsage","number",["number"]);this.QTS_RecoverableLeakCheck=this.module.cwrap("QTS_RecoverableLeakCheck","number",[]);this.QTS_BuildIsSanitizeLeak=this.module.cwrap("QTS_BuildIsSanitizeLeak","number",[]);this.QTS_RuntimeSetMaxStackSize=this.module.cwrap("QTS_RuntimeSetMaxStackSize",null,["number","number"]);this.QTS_GetUndefined=this.module.cwrap("QTS_GetUndefined","number",[]);this.QTS_GetNull=this.module.cwrap("QTS_GetNull","number",[]);this.QTS_GetFalse=this.module.cwrap("QTS_GetFalse","number",[]);this.QTS_GetTrue=this.module.cwrap("QTS_GetTrue","number",[]);this.QTS_NewHostRef=this.module.cwrap("QTS_NewHostRef","number",["number","number"]);this.QTS_GetHostRefId=this.module.cwrap("QTS_GetHostRefId","number",["number"]);this.QTS_NewRuntime=this.module.cwrap("QTS_NewRuntime","number",[]);this.QTS_FreeRuntime=this.module.cwrap("QTS_FreeRuntime",null,["number"]);this.QTS_NewContext=this.module.cwrap("QTS_NewContext","number",["number","number"]);this.QTS_FreeContext=this.module.cwrap("QTS_FreeContext",null,["number"]);this.QTS_FreeValuePointer=this.module.cwrap("QTS_FreeValuePointer",null,["number","number"]);this.QTS_FreeValuePointerRuntime=this.module.cwrap("QTS_FreeValuePointerRuntime",null,["number","number"]);this.QTS_FreeVoidPointer=this.module.cwrap("QTS_FreeVoidPointer",null,["number","number"]);this.QTS_FreeCString=this.module.cwrap("QTS_FreeCString",null,["number","number"]);this.QTS_DupValuePointer=this.module.cwrap("QTS_DupValuePointer","number",["number","number"]);this.QTS_NewObject=this.module.cwrap("QTS_NewObject","number",["number"]);this.QTS_NewObjectProto=this.module.cwrap("QTS_NewObjectProto","number",["number","number"]);this.QTS_NewArray=this.module.cwrap("QTS_NewArray","number",["number"]);this.QTS_NewArrayBuffer=this.module.cwrap("QTS_NewArrayBuffer","number",["number","number","number"]);this.QTS_NewFloat64=this.module.cwrap("QTS_NewFloat64","number",["number","number"]);this.QTS_GetFloat64=this.module.cwrap("QTS_GetFloat64","number",["number","number"]);this.QTS_NewString=this.module.cwrap("QTS_NewString","number",["number","number"]);this.QTS_GetString=this.module.cwrap("QTS_GetString","number",["number","number"]);this.QTS_GetArrayBuffer=this.module.cwrap("QTS_GetArrayBuffer","number",["number","number"]);this.QTS_GetArrayBufferLength=this.module.cwrap("QTS_GetArrayBufferLength","number",["number","number"]);this.QTS_NewSymbol=this.module.cwrap("QTS_NewSymbol","number",["number","number","number"]);this.QTS_GetSymbolDescriptionOrKey=this.module.cwrap("QTS_GetSymbolDescriptionOrKey","number",["number","number"]);this.QTS_IsGlobalSymbol=this.module.cwrap("QTS_IsGlobalSymbol","number",["number","number"]);this.QTS_IsJobPending=this.module.cwrap("QTS_IsJobPending","number",["number"]);this.QTS_ExecutePendingJob=this.module.cwrap("QTS_ExecutePendingJob","number",["number","number","number"]);this.QTS_GetProp=this.module.cwrap("QTS_GetProp","number",["number","number","number"]);this.QTS_GetPropNumber=this.module.cwrap("QTS_GetPropNumber","number",["number","number","number"]);this.QTS_SetProp=this.module.cwrap("QTS_SetProp",null,["number","number","number","number"]);this.QTS_DefineProp=this.module.cwrap("QTS_DefineProp",null,["number","number","number","number","number","number","boolean","boolean","boolean"]);this.QTS_GetOwnPropertyNames=this.module.cwrap("QTS_GetOwnPropertyNames","number",["number","number","number","number","number"]);this.QTS_Call=this.module.cwrap("QTS_Call","number",["number","number","number","number","number"]);this.QTS_ResolveException=this.module.cwrap("QTS_ResolveException","number",["number","number"]);this.QTS_Dump=this.module.cwrap("QTS_Dump","number",["number","number"]);this.QTS_Eval=this.module.cwrap("QTS_Eval","number",["number","number","number","string","number","number"]);this.QTS_GetModuleNamespace=this.module.cwrap("QTS_GetModuleNamespace","number",["number","number"]);this.QTS_Typeof=this.module.cwrap("QTS_Typeof","number",["number","number"]);this.QTS_GetLength=this.module.cwrap("QTS_GetLength","number",["number","number","number"]);this.QTS_IsEqual=this.module.cwrap("QTS_IsEqual","number",["number","number","number","number"]);this.QTS_GetGlobalObject=this.module.cwrap("QTS_GetGlobalObject","number",["number"]);this.QTS_NewPromiseCapability=this.module.cwrap("QTS_NewPromiseCapability","number",["number","number"]);this.QTS_PromiseState=this.module.cwrap("QTS_PromiseState","number",["number","number"]);this.QTS_PromiseResult=this.module.cwrap("QTS_PromiseResult","number",["number","number"]);this.QTS_TestStringArg=this.module.cwrap("QTS_TestStringArg",null,["string"]);this.QTS_GetDebugLogEnabled=this.module.cwrap("QTS_GetDebugLogEnabled","number",["number"]);this.QTS_SetDebugLogEnabled=this.module.cwrap("QTS_SetDebugLogEnabled",null,["number","number"]);this.QTS_BuildIsDebug=this.module.cwrap("QTS_BuildIsDebug","number",[]);this.QTS_BuildIsAsyncify=this.module.cwrap("QTS_BuildIsAsyncify","number",[]);this.QTS_NewFunction=this.module.cwrap("QTS_NewFunction","number",["number","string","number","boolean","number"]);this.QTS_ArgvGetJSValueConstPointer=this.module.cwrap("QTS_ArgvGetJSValueConstPointer","number",["number","number"]);this.QTS_RuntimeEnableInterruptHandler=this.module.cwrap("QTS_RuntimeEnableInterruptHandler",null,["number"]);this.QTS_RuntimeDisableInterruptHandler=this.module.cwrap("QTS_RuntimeDisableInterruptHandler",null,["number"]);this.QTS_RuntimeEnableModuleLoader=this.module.cwrap("QTS_RuntimeEnableModuleLoader",null,["number","number"]);this.QTS_RuntimeDisableModuleLoader=this.module.cwrap("QTS_RuntimeDisableModuleLoader",null,["number"]);this.QTS_bjson_encode=this.module.cwrap("QTS_bjson_encode","number",["number","number"]);this.QTS_bjson_decode=this.module.cwrap("QTS_bjson_decode","number",["number","number"])}};export{QuickJSFFI};
|
|
2
|
+
//# sourceMappingURL=ffi.mjs.map
|
|
@@ -0,0 +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 HostRefId,\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_NewHostRef: (ctx: JSContextPointer, id: HostRefId) => JSValuePointer = this.module.cwrap(\n \"QTS_NewHostRef\",\n \"number\",\n [\"number\", \"number\"],\n )\n\n QTS_GetHostRefId: (value: JSValuePointer | JSValueConstPointer) => HostRefId = this.module.cwrap(\n \"QTS_GetHostRefId\",\n \"number\",\n [\"number\"],\n )\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: (\n ctx: JSContextPointer,\n name: string,\n arg_length: number,\n is_constructor: boolean,\n host_ref_id: HostRefId,\n ) => JSValuePointer = this.module.cwrap(\"QTS_NewFunction\", \"number\", [\n \"number\",\n \"string\",\n \"number\",\n \"boolean\",\n \"number\",\n ])\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"],"mappings":"AAoCO,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,QA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,QAAQ,CACrB,EAEA,sBAAiC,KAAK,OAAO,MAAM,mBAAoB,SAAU,CAAC,CAAC,EAEnF,yBAAoC,KAAK,OAAO,MAAM,sBAAuB,SAAU,CAAC,CAAC,EAEzF,qBAMsB,KAAK,OAAO,MAAM,kBAAmB,SAAU,CACnE,SACA,SACA,SACA,UACA,QACF,CAAC,EAED,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,CApZpC,CAqZxD","names":[]}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { QuickJSSyncVariant } from '@jitl/quickjs-ffi-types';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* ### @jitl/quickjs-wasmfile-release-sync
|
|
5
|
+
*
|
|
6
|
+
* [Docs](https://github.com/justjake/quickjs-emscripten/blob/main/doc/@jitl/quickjs-wasmfile-release-sync/README.md) |
|
|
7
|
+
* Variant with separate .WASM file. Supports browser ESM, NodeJS ESM, and NodeJS CommonJS.
|
|
8
|
+
*
|
|
9
|
+
* | Variable | Setting | Description |
|
|
10
|
+
* | -- | -- | -- |
|
|
11
|
+
* | library | quickjs | The original [bellard/quickjs](https://github.com/bellard/quickjs) library. Version [2025-09-13+f1139494](https://github.com/bellard/quickjs/commit/f1139494d18a2053630c5ed3384a42bb70db3c53) vendored to quickjs-emscripten on 2026-02-15. |
|
|
12
|
+
* | releaseMode | release | Optimized for performance; use when building/deploying your application. |
|
|
13
|
+
* | syncMode | sync | The default, normal build. Note that both variants support regular async functions. |
|
|
14
|
+
* | emscriptenInclusion | wasm | Has a separate .wasm file. May offer better caching in your browser, and reduces the size of your JS bundle. If you have issues, try a 'singlefile' variant. |
|
|
15
|
+
* | exports | require import browser workerd | Has these package.json export conditions |
|
|
16
|
+
*
|
|
17
|
+
*/
|
|
18
|
+
declare const variant: QuickJSSyncVariant;
|
|
19
|
+
|
|
20
|
+
export { variant as default };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { QuickJSSyncVariant } from '@jitl/quickjs-ffi-types';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* ### @jitl/quickjs-wasmfile-release-sync
|
|
5
|
+
*
|
|
6
|
+
* [Docs](https://github.com/justjake/quickjs-emscripten/blob/main/doc/@jitl/quickjs-wasmfile-release-sync/README.md) |
|
|
7
|
+
* Variant with separate .WASM file. Supports browser ESM, NodeJS ESM, and NodeJS CommonJS.
|
|
8
|
+
*
|
|
9
|
+
* | Variable | Setting | Description |
|
|
10
|
+
* | -- | -- | -- |
|
|
11
|
+
* | library | quickjs | The original [bellard/quickjs](https://github.com/bellard/quickjs) library. Version [2025-09-13+f1139494](https://github.com/bellard/quickjs/commit/f1139494d18a2053630c5ed3384a42bb70db3c53) vendored to quickjs-emscripten on 2026-02-15. |
|
|
12
|
+
* | releaseMode | release | Optimized for performance; use when building/deploying your application. |
|
|
13
|
+
* | syncMode | sync | The default, normal build. Note that both variants support regular async functions. |
|
|
14
|
+
* | emscriptenInclusion | wasm | Has a separate .wasm file. May offer better caching in your browser, and reduces the size of your JS bundle. If you have issues, try a 'singlefile' variant. |
|
|
15
|
+
* | exports | require import browser workerd | Has these package.json export conditions |
|
|
16
|
+
*
|
|
17
|
+
*/
|
|
18
|
+
declare const variant: QuickJSSyncVariant;
|
|
19
|
+
|
|
20
|
+
export { variant as default };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";var __create=Object.create;var __defProp=Object.defineProperty;var __getOwnPropDesc=Object.getOwnPropertyDescriptor;var __getOwnPropNames=Object.getOwnPropertyNames;var __getProtoOf=Object.getPrototypeOf,__hasOwnProp=Object.prototype.hasOwnProperty;var __esm=(fn,res)=>function(){return fn&&(res=(0,fn[__getOwnPropNames(fn)[0]])(fn=0)),res};var __export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:!0})},__copyProps=(to,from,except,desc)=>{if(from&&typeof from=="object"||typeof from=="function")for(let key of __getOwnPropNames(from))!__hasOwnProp.call(to,key)&&key!==except&&__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to};var __toESM=(mod,isNodeMode,target)=>(target=mod!=null?__create(__getProtoOf(mod)):{},__copyProps(isNodeMode||!mod||!mod.__esModule?__defProp(target,"default",{value:mod,enumerable:!0}):target,mod)),__toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod);var ffi_exports={};__export(ffi_exports,{QuickJSFFI:()=>QuickJSFFI});var QuickJSFFI,init_ffi=__esm({"src/ffi.ts"(){"use strict";QuickJSFFI=class{constructor(module2){this.module=module2;this.DEBUG=!1;this.QTS_Throw=this.module.cwrap("QTS_Throw","number",["number","number"]);this.QTS_NewError=this.module.cwrap("QTS_NewError","number",["number"]);this.QTS_RuntimeSetMemoryLimit=this.module.cwrap("QTS_RuntimeSetMemoryLimit",null,["number","number"]);this.QTS_RuntimeComputeMemoryUsage=this.module.cwrap("QTS_RuntimeComputeMemoryUsage","number",["number","number"]);this.QTS_RuntimeDumpMemoryUsage=this.module.cwrap("QTS_RuntimeDumpMemoryUsage","number",["number"]);this.QTS_RecoverableLeakCheck=this.module.cwrap("QTS_RecoverableLeakCheck","number",[]);this.QTS_BuildIsSanitizeLeak=this.module.cwrap("QTS_BuildIsSanitizeLeak","number",[]);this.QTS_RuntimeSetMaxStackSize=this.module.cwrap("QTS_RuntimeSetMaxStackSize",null,["number","number"]);this.QTS_GetUndefined=this.module.cwrap("QTS_GetUndefined","number",[]);this.QTS_GetNull=this.module.cwrap("QTS_GetNull","number",[]);this.QTS_GetFalse=this.module.cwrap("QTS_GetFalse","number",[]);this.QTS_GetTrue=this.module.cwrap("QTS_GetTrue","number",[]);this.QTS_NewHostRef=this.module.cwrap("QTS_NewHostRef","number",["number","number"]);this.QTS_GetHostRefId=this.module.cwrap("QTS_GetHostRefId","number",["number"]);this.QTS_NewRuntime=this.module.cwrap("QTS_NewRuntime","number",[]);this.QTS_FreeRuntime=this.module.cwrap("QTS_FreeRuntime",null,["number"]);this.QTS_NewContext=this.module.cwrap("QTS_NewContext","number",["number","number"]);this.QTS_FreeContext=this.module.cwrap("QTS_FreeContext",null,["number"]);this.QTS_FreeValuePointer=this.module.cwrap("QTS_FreeValuePointer",null,["number","number"]);this.QTS_FreeValuePointerRuntime=this.module.cwrap("QTS_FreeValuePointerRuntime",null,["number","number"]);this.QTS_FreeVoidPointer=this.module.cwrap("QTS_FreeVoidPointer",null,["number","number"]);this.QTS_FreeCString=this.module.cwrap("QTS_FreeCString",null,["number","number"]);this.QTS_DupValuePointer=this.module.cwrap("QTS_DupValuePointer","number",["number","number"]);this.QTS_NewObject=this.module.cwrap("QTS_NewObject","number",["number"]);this.QTS_NewObjectProto=this.module.cwrap("QTS_NewObjectProto","number",["number","number"]);this.QTS_NewArray=this.module.cwrap("QTS_NewArray","number",["number"]);this.QTS_NewArrayBuffer=this.module.cwrap("QTS_NewArrayBuffer","number",["number","number","number"]);this.QTS_NewFloat64=this.module.cwrap("QTS_NewFloat64","number",["number","number"]);this.QTS_GetFloat64=this.module.cwrap("QTS_GetFloat64","number",["number","number"]);this.QTS_NewString=this.module.cwrap("QTS_NewString","number",["number","number"]);this.QTS_GetString=this.module.cwrap("QTS_GetString","number",["number","number"]);this.QTS_GetArrayBuffer=this.module.cwrap("QTS_GetArrayBuffer","number",["number","number"]);this.QTS_GetArrayBufferLength=this.module.cwrap("QTS_GetArrayBufferLength","number",["number","number"]);this.QTS_NewSymbol=this.module.cwrap("QTS_NewSymbol","number",["number","number","number"]);this.QTS_GetSymbolDescriptionOrKey=this.module.cwrap("QTS_GetSymbolDescriptionOrKey","number",["number","number"]);this.QTS_IsGlobalSymbol=this.module.cwrap("QTS_IsGlobalSymbol","number",["number","number"]);this.QTS_IsJobPending=this.module.cwrap("QTS_IsJobPending","number",["number"]);this.QTS_ExecutePendingJob=this.module.cwrap("QTS_ExecutePendingJob","number",["number","number","number"]);this.QTS_GetProp=this.module.cwrap("QTS_GetProp","number",["number","number","number"]);this.QTS_GetPropNumber=this.module.cwrap("QTS_GetPropNumber","number",["number","number","number"]);this.QTS_SetProp=this.module.cwrap("QTS_SetProp",null,["number","number","number","number"]);this.QTS_DefineProp=this.module.cwrap("QTS_DefineProp",null,["number","number","number","number","number","number","boolean","boolean","boolean"]);this.QTS_GetOwnPropertyNames=this.module.cwrap("QTS_GetOwnPropertyNames","number",["number","number","number","number","number"]);this.QTS_Call=this.module.cwrap("QTS_Call","number",["number","number","number","number","number"]);this.QTS_ResolveException=this.module.cwrap("QTS_ResolveException","number",["number","number"]);this.QTS_Dump=this.module.cwrap("QTS_Dump","number",["number","number"]);this.QTS_Eval=this.module.cwrap("QTS_Eval","number",["number","number","number","string","number","number"]);this.QTS_GetModuleNamespace=this.module.cwrap("QTS_GetModuleNamespace","number",["number","number"]);this.QTS_Typeof=this.module.cwrap("QTS_Typeof","number",["number","number"]);this.QTS_GetLength=this.module.cwrap("QTS_GetLength","number",["number","number","number"]);this.QTS_IsEqual=this.module.cwrap("QTS_IsEqual","number",["number","number","number","number"]);this.QTS_GetGlobalObject=this.module.cwrap("QTS_GetGlobalObject","number",["number"]);this.QTS_NewPromiseCapability=this.module.cwrap("QTS_NewPromiseCapability","number",["number","number"]);this.QTS_PromiseState=this.module.cwrap("QTS_PromiseState","number",["number","number"]);this.QTS_PromiseResult=this.module.cwrap("QTS_PromiseResult","number",["number","number"]);this.QTS_TestStringArg=this.module.cwrap("QTS_TestStringArg",null,["string"]);this.QTS_GetDebugLogEnabled=this.module.cwrap("QTS_GetDebugLogEnabled","number",["number"]);this.QTS_SetDebugLogEnabled=this.module.cwrap("QTS_SetDebugLogEnabled",null,["number","number"]);this.QTS_BuildIsDebug=this.module.cwrap("QTS_BuildIsDebug","number",[]);this.QTS_BuildIsAsyncify=this.module.cwrap("QTS_BuildIsAsyncify","number",[]);this.QTS_NewFunction=this.module.cwrap("QTS_NewFunction","number",["number","string","number","boolean","number"]);this.QTS_ArgvGetJSValueConstPointer=this.module.cwrap("QTS_ArgvGetJSValueConstPointer","number",["number","number"]);this.QTS_RuntimeEnableInterruptHandler=this.module.cwrap("QTS_RuntimeEnableInterruptHandler",null,["number"]);this.QTS_RuntimeDisableInterruptHandler=this.module.cwrap("QTS_RuntimeDisableInterruptHandler",null,["number"]);this.QTS_RuntimeEnableModuleLoader=this.module.cwrap("QTS_RuntimeEnableModuleLoader",null,["number","number"]);this.QTS_RuntimeDisableModuleLoader=this.module.cwrap("QTS_RuntimeDisableModuleLoader",null,["number"]);this.QTS_bjson_encode=this.module.cwrap("QTS_bjson_encode","number",["number","number"]);this.QTS_bjson_decode=this.module.cwrap("QTS_bjson_decode","number",["number","number"])}}}});var src_exports={};__export(src_exports,{default:()=>src_default});module.exports=__toCommonJS(src_exports);var variant={type:"sync",importFFI:()=>Promise.resolve().then(()=>(init_ffi(),ffi_exports)).then(mod=>mod.QuickJSFFI),importModuleLoader:()=>import("@jitl/quickjs-wasmfile-release-sync/emscripten-module").then(mod=>mod.default)},src_default=variant;
|
|
2
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +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 HostRefId,\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_NewHostRef: (ctx: JSContextPointer, id: HostRefId) => JSValuePointer = this.module.cwrap(\n \"QTS_NewHostRef\",\n \"number\",\n [\"number\", \"number\"],\n )\n\n QTS_GetHostRefId: (value: JSValuePointer | JSValueConstPointer) => HostRefId = this.module.cwrap(\n \"QTS_GetHostRefId\",\n \"number\",\n [\"number\"],\n )\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: (\n ctx: JSContextPointer,\n name: string,\n arg_length: number,\n is_constructor: boolean,\n host_ref_id: HostRefId,\n ) => JSValuePointer = this.module.cwrap(\"QTS_NewFunction\", \"number\", [\n \"number\",\n \"string\",\n \"number\",\n \"boolean\",\n \"number\",\n ])\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","import type { QuickJSSyncVariant } from \"@jitl/quickjs-ffi-types\"\n\n/**\n * ### @jitl/quickjs-wasmfile-release-sync\n *\n * [Docs](https://github.com/justjake/quickjs-emscripten/blob/main/doc/@jitl/quickjs-wasmfile-release-sync/README.md) |\n * Variant with separate .WASM file. Supports browser ESM, NodeJS ESM, and NodeJS CommonJS.\n *\n * | Variable | Setting | Description |\n * | -- | -- | -- |\n * | library | quickjs | The original [bellard/quickjs](https://github.com/bellard/quickjs) library. Version [2025-09-13+f1139494](https://github.com/bellard/quickjs/commit/f1139494d18a2053630c5ed3384a42bb70db3c53) vendored to quickjs-emscripten on 2026-02-15. |\n * | releaseMode | release | Optimized for performance; use when building/deploying your application. |\n * | syncMode | sync | The default, normal build. Note that both variants support regular async functions. |\n * | emscriptenInclusion | wasm | Has a separate .wasm file. May offer better caching in your browser, and reduces the size of your JS bundle. If you have issues, try a 'singlefile' variant. |\n * | exports | require import browser workerd | Has these package.json export conditions |\n *\n */\nconst variant: QuickJSSyncVariant = {\n type: \"sync\",\n importFFI: () => import(\"./ffi.js\").then((mod) => mod.QuickJSFFI),\n importModuleLoader: () =>\n import(\"@jitl/quickjs-wasmfile-release-sync/emscripten-module\").then((mod) => mod.default),\n} as const\n\nexport default variant\n"],"mappings":"q/BAAA,yEAoCa,WApCb,4CAoCa,WAAN,KAAiB,CACtB,YAAoBA,QAAiC,CAAjC,YAAAA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]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
var variant={type:"sync",importFFI:()=>import("./ffi.mjs").then(mod=>mod.QuickJSFFI),importModuleLoader:()=>import("@jitl/quickjs-wasmfile-release-sync/emscripten-module").then(mod=>mod.default)},src_default=variant;export{src_default as default};
|
|
2
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["import type { QuickJSSyncVariant } from \"@jitl/quickjs-ffi-types\"\n\n/**\n * ### @jitl/quickjs-wasmfile-release-sync\n *\n * [Docs](https://github.com/justjake/quickjs-emscripten/blob/main/doc/@jitl/quickjs-wasmfile-release-sync/README.md) |\n * Variant with separate .WASM file. Supports browser ESM, NodeJS ESM, and NodeJS CommonJS.\n *\n * | Variable | Setting | Description |\n * | -- | -- | -- |\n * | library | quickjs | The original [bellard/quickjs](https://github.com/bellard/quickjs) library. Version [2025-09-13+f1139494](https://github.com/bellard/quickjs/commit/f1139494d18a2053630c5ed3384a42bb70db3c53) vendored to quickjs-emscripten on 2026-02-15. |\n * | releaseMode | release | Optimized for performance; use when building/deploying your application. |\n * | syncMode | sync | The default, normal build. Note that both variants support regular async functions. |\n * | emscriptenInclusion | wasm | Has a separate .wasm file. May offer better caching in your browser, and reduces the size of your JS bundle. If you have issues, try a 'singlefile' variant. |\n * | exports | require import browser workerd | Has these package.json export conditions |\n *\n */\nconst variant: QuickJSSyncVariant = {\n type: \"sync\",\n importFFI: () => import(\"./ffi.js\").then((mod) => mod.QuickJSFFI),\n importModuleLoader: () =>\n import(\"@jitl/quickjs-wasmfile-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,uDAAuD,EAAE,KAAM,KAAQ,IAAI,OAAO,CAC7F,EAEO,YAAQ","names":[]}
|