quickjs-emscripten
Version:
1 lines • 2.59 kB
Source Map (JSON)
{"version":3,"sources":["../src/variants.ts"],"sourcesContent":["import type {\n QuickJSSyncVariant,\n QuickJSAsyncVariant,\n QuickJSWASMModule,\n QuickJSAsyncWASMModule,\n PromisedDefault,\n} from \"quickjs-emscripten-core\"\nimport {\n newQuickJSWASMModuleFromVariant,\n newQuickJSAsyncWASMModuleFromVariant,\n} from \"quickjs-emscripten-core\"\nimport DEBUG_SYNC from \"@jitl/quickjs-wasmfile-debug-sync\"\nimport RELEASE_SYNC from \"@jitl/quickjs-wasmfile-release-sync\"\nimport DEBUG_ASYNC from \"@jitl/quickjs-wasmfile-debug-asyncify\"\nimport RELEASE_ASYNC from \"@jitl/quickjs-wasmfile-release-asyncify\"\n\n/**\n * Create a new, completely isolated WebAssembly module containing the QuickJS library.\n * See the documentation on {@link QuickJSWASMModule}.\n *\n * Note that there is a hard limit on the number of WebAssembly modules in older\n * versions of v8:\n * https://bugs.chromium.org/p/v8/issues/detail?id=12076\n */\nexport async function newQuickJSWASMModule(\n /**\n * Optionally, pass a {@link QuickJSSyncVariant} to construct a different WebAssembly module.\n */\n variantOrPromise: PromisedDefault<QuickJSSyncVariant> = RELEASE_SYNC,\n): Promise<QuickJSWASMModule> {\n return newQuickJSWASMModuleFromVariant(variantOrPromise)\n}\n\n/**\n * Create a new, completely isolated WebAssembly module containing a version of the QuickJS library\n * compiled with Emscripten's [ASYNCIFY](https://emscripten.org/docs/porting/asyncify.html) transform.\n *\n * This version of the library offers features that enable synchronous code\n * inside the VM to interact with asynchronous code in the host environment.\n * See the documentation on {@link QuickJSAsyncWASMModule}, {@link QuickJSAsyncRuntime},\n * and {@link QuickJSAsyncContext}.\n *\n * Note that there is a hard limit on the number of WebAssembly modules in older\n * versions of v8:\n * https://bugs.chromium.org/p/v8/issues/detail?id=12076\n */\nexport async function newQuickJSAsyncWASMModule(\n /**\n * Optionally, pass a {@link QuickJSAsyncVariant} to construct a different WebAssembly module.\n */\n variantOrPromise: PromisedDefault<QuickJSAsyncVariant> = RELEASE_ASYNC,\n): Promise<QuickJSAsyncWASMModule> {\n return newQuickJSAsyncWASMModuleFromVariant(variantOrPromise)\n}\n\nexport { DEBUG_SYNC, RELEASE_SYNC, DEBUG_ASYNC, RELEASE_ASYNC }\n"],"mappings":"AAOA,OACE,gCACA,yCACK,0BACP,OAAO,eAAgB,oCACvB,OAAO,iBAAkB,sCACzB,OAAO,gBAAiB,wCACxB,OAAO,kBAAmB,0CAU1B,eAAsB,qBAIpB,iBAAwD,aAC5B,CAC5B,OAAO,gCAAgC,gBAAgB,CACzD,CAeA,eAAsB,0BAIpB,iBAAyD,cACxB,CACjC,OAAO,qCAAqC,gBAAgB,CAC9D","names":[]}