@componentor/quickjs-emscripten 0.31.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,2 @@
1
+ import{newQuickJSWASMModuleFromVariant,newQuickJSAsyncWASMModuleFromVariant}from"@componentor/quickjs-emscripten-core";import DEBUG_SYNC from"@componentor/quickjs-wasmfile-debug-sync";import RELEASE_SYNC from"@componentor/quickjs-wasmfile-release-sync";import DEBUG_ASYNC from"@componentor/quickjs-wasmfile-debug-asyncify";import RELEASE_ASYNC from"@componentor/quickjs-wasmfile-release-asyncify";async function newQuickJSWASMModule(variantOrPromise=RELEASE_SYNC){return newQuickJSWASMModuleFromVariant(variantOrPromise)}async function newQuickJSAsyncWASMModule(variantOrPromise=RELEASE_ASYNC){return newQuickJSAsyncWASMModuleFromVariant(variantOrPromise)}export{DEBUG_SYNC,RELEASE_SYNC,DEBUG_ASYNC,RELEASE_ASYNC,newQuickJSWASMModule,newQuickJSAsyncWASMModule};
2
+ //# sourceMappingURL=chunk-IBGVJUFE.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/variants.ts"],"sourcesContent":["import type {\n QuickJSSyncVariant,\n QuickJSAsyncVariant,\n QuickJSWASMModule,\n QuickJSAsyncWASMModule,\n PromisedDefault,\n} from \"@componentor/quickjs-emscripten-core\"\nimport {\n newQuickJSWASMModuleFromVariant,\n newQuickJSAsyncWASMModuleFromVariant,\n} from \"@componentor/quickjs-emscripten-core\"\nimport DEBUG_SYNC from \"@componentor/quickjs-wasmfile-debug-sync\"\nimport RELEASE_SYNC from \"@componentor/quickjs-wasmfile-release-sync\"\nimport DEBUG_ASYNC from \"@componentor/quickjs-wasmfile-debug-asyncify\"\nimport RELEASE_ASYNC from \"@componentor/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,uCACP,OAAO,eAAgB,2CACvB,OAAO,iBAAkB,6CACzB,OAAO,gBAAiB,+CACxB,OAAO,kBAAmB,iDAU1B,eAAsB,qBAIpB,iBAAwD,aAC5B,CAC5B,OAAO,gCAAgC,gBAAgB,CACzD,CAeA,eAAsB,0BAIpB,iBAAyD,cACxB,CACjC,OAAO,qCAAqC,gBAAgB,CAC9D","names":[]}
@@ -0,0 +1,57 @@
1
+ import { QuickJSWASMModule, AsyncRuntimeOptions, QuickJSAsyncRuntime, ContextOptions, QuickJSAsyncContext } from '@componentor/quickjs-emscripten-core';
2
+ export * from '@componentor/quickjs-emscripten-core';
3
+ export { newQuickJSAsyncWASMModule, newQuickJSWASMModule } from './variants.mjs';
4
+ export { default as DEBUG_SYNC } from '@componentor/quickjs-wasmfile-debug-sync';
5
+ export { default as RELEASE_SYNC } from '@componentor/quickjs-wasmfile-release-sync';
6
+ export { default as DEBUG_ASYNC } from '@componentor/quickjs-wasmfile-debug-asyncify';
7
+ export { default as RELEASE_ASYNC } from '@componentor/quickjs-wasmfile-release-asyncify';
8
+
9
+ /**
10
+ * Get a shared singleton {@link QuickJSWASMModule}. Use this to evaluate code
11
+ * or create Javascript environments.
12
+ *
13
+ * This is the top-level entrypoint for the quickjs-emscripten library.
14
+ *
15
+ * If you need strictest possible isolation guarantees, you may create a
16
+ * separate {@link QuickJSWASMModule} via {@link newQuickJSWASMModule}.
17
+ *
18
+ * To work with the asyncified version of this library, see these functions:
19
+ *
20
+ * - {@link newAsyncRuntime}.
21
+ * - {@link newAsyncContext}.
22
+ * - {@link newQuickJSAsyncWASMModule}.
23
+ */
24
+ declare function getQuickJS(): Promise<QuickJSWASMModule>;
25
+ /**
26
+ * Provides synchronous access to the shared {@link QuickJSWASMModule} instance returned by {@link getQuickJS}, as long as
27
+ * least once.
28
+ * @throws If called before `getQuickJS` resolves.
29
+ */
30
+ declare function getQuickJSSync(): QuickJSWASMModule;
31
+ /**
32
+ * Create a new {@link QuickJSAsyncRuntime} in a separate WebAssembly module.
33
+ *
34
+ * Each runtime is isolated in a separate WebAssembly module, so that errors in
35
+ * one runtime cannot contaminate another runtime, and each runtime can execute
36
+ * an asynchronous action without conflicts.
37
+ *
38
+ * Note that there is a hard limit on the number of WebAssembly modules in older
39
+ * versions of v8:
40
+ * https://bugs.chromium.org/p/v8/issues/detail?id=12076
41
+ */
42
+ declare function newAsyncRuntime(options?: AsyncRuntimeOptions): Promise<QuickJSAsyncRuntime>;
43
+ /**
44
+ * Create a new {@link QuickJSAsyncContext} (with an associated runtime) in an
45
+ * separate WebAssembly module.
46
+ *
47
+ * Each context is isolated in a separate WebAssembly module, so that errors in
48
+ * one runtime cannot contaminate another runtime, and each runtime can execute
49
+ * an asynchronous action without conflicts.
50
+ *
51
+ * Note that there is a hard limit on the number of WebAssembly modules in older
52
+ * versions of v8:
53
+ * https://bugs.chromium.org/p/v8/issues/detail?id=12076
54
+ */
55
+ declare function newAsyncContext(options?: ContextOptions): Promise<QuickJSAsyncContext>;
56
+
57
+ export { getQuickJS, getQuickJSSync, newAsyncContext, newAsyncRuntime };
@@ -0,0 +1,57 @@
1
+ import { QuickJSWASMModule, AsyncRuntimeOptions, QuickJSAsyncRuntime, ContextOptions, QuickJSAsyncContext } from '@componentor/quickjs-emscripten-core';
2
+ export * from '@componentor/quickjs-emscripten-core';
3
+ export { newQuickJSAsyncWASMModule, newQuickJSWASMModule } from './variants.js';
4
+ export { default as DEBUG_SYNC } from '@componentor/quickjs-wasmfile-debug-sync';
5
+ export { default as RELEASE_SYNC } from '@componentor/quickjs-wasmfile-release-sync';
6
+ export { default as DEBUG_ASYNC } from '@componentor/quickjs-wasmfile-debug-asyncify';
7
+ export { default as RELEASE_ASYNC } from '@componentor/quickjs-wasmfile-release-asyncify';
8
+
9
+ /**
10
+ * Get a shared singleton {@link QuickJSWASMModule}. Use this to evaluate code
11
+ * or create Javascript environments.
12
+ *
13
+ * This is the top-level entrypoint for the quickjs-emscripten library.
14
+ *
15
+ * If you need strictest possible isolation guarantees, you may create a
16
+ * separate {@link QuickJSWASMModule} via {@link newQuickJSWASMModule}.
17
+ *
18
+ * To work with the asyncified version of this library, see these functions:
19
+ *
20
+ * - {@link newAsyncRuntime}.
21
+ * - {@link newAsyncContext}.
22
+ * - {@link newQuickJSAsyncWASMModule}.
23
+ */
24
+ declare function getQuickJS(): Promise<QuickJSWASMModule>;
25
+ /**
26
+ * Provides synchronous access to the shared {@link QuickJSWASMModule} instance returned by {@link getQuickJS}, as long as
27
+ * least once.
28
+ * @throws If called before `getQuickJS` resolves.
29
+ */
30
+ declare function getQuickJSSync(): QuickJSWASMModule;
31
+ /**
32
+ * Create a new {@link QuickJSAsyncRuntime} in a separate WebAssembly module.
33
+ *
34
+ * Each runtime is isolated in a separate WebAssembly module, so that errors in
35
+ * one runtime cannot contaminate another runtime, and each runtime can execute
36
+ * an asynchronous action without conflicts.
37
+ *
38
+ * Note that there is a hard limit on the number of WebAssembly modules in older
39
+ * versions of v8:
40
+ * https://bugs.chromium.org/p/v8/issues/detail?id=12076
41
+ */
42
+ declare function newAsyncRuntime(options?: AsyncRuntimeOptions): Promise<QuickJSAsyncRuntime>;
43
+ /**
44
+ * Create a new {@link QuickJSAsyncContext} (with an associated runtime) in an
45
+ * separate WebAssembly module.
46
+ *
47
+ * Each context is isolated in a separate WebAssembly module, so that errors in
48
+ * one runtime cannot contaminate another runtime, and each runtime can execute
49
+ * an asynchronous action without conflicts.
50
+ *
51
+ * Note that there is a hard limit on the number of WebAssembly modules in older
52
+ * versions of v8:
53
+ * https://bugs.chromium.org/p/v8/issues/detail?id=12076
54
+ */
55
+ declare function newAsyncContext(options?: ContextOptions): Promise<QuickJSAsyncContext>;
56
+
57
+ export { getQuickJS, getQuickJSSync, newAsyncContext, newAsyncRuntime };