@componentor/quickjs-wasmfile-debug-asyncify 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.
- package/LICENSE +47 -0
- package/README.md +93 -0
- package/dist/emscripten-module.browser.d.ts +18 -0
- package/dist/emscripten-module.browser.mjs +2424 -0
- package/dist/emscripten-module.cjs +2441 -0
- package/dist/emscripten-module.cloudflare.cjs +2412 -0
- package/dist/emscripten-module.cloudflare.d.ts +18 -0
- package/dist/emscripten-module.d.ts +18 -0
- package/dist/emscripten-module.mjs +2518 -0
- package/dist/emscripten-module.wasm +0 -0
- package/dist/emscripten-module.wasm.map +1 -0
- package/dist/ffi.d.mts +96 -0
- package/dist/ffi.d.ts +96 -0
- package/dist/ffi.js +2 -0
- package/dist/ffi.js.map +1 -0
- package/dist/ffi.mjs +2 -0
- package/dist/ffi.mjs.map +1 -0
- package/dist/index.d.mts +20 -0
- package/dist/index.d.ts +20 -0
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +2 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +62 -0
|
Binary file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":""}
|
package/dist/ffi.d.mts
ADDED
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { QuickJSAsyncEmscriptenModule, JSContextPointer, JSValuePointer, JSValueConstPointer, JSRuntimePointer, OwnedHeapCharPointer, IntrinsicsFlags, JSVoidPointer, JSBorrowedCharPointer, BorrowedHeapCharPointer, JSContextPointerPointer, JSValuePointerPointerPointer, UInt32Pointer, JSValueConstPointerPointer, EvalDetectModule, EvalFlags, IsEqualOp, JSValuePointerPointer, JSPromiseStateEnum } from '@componentor/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 QuickJSAsyncFFI {
|
|
11
|
+
private module;
|
|
12
|
+
constructor(module: QuickJSAsyncEmscriptenModule);
|
|
13
|
+
/** Set at compile time. */
|
|
14
|
+
readonly DEBUG = true;
|
|
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_NewRuntime: () => JSRuntimePointer;
|
|
28
|
+
QTS_FreeRuntime: (rt: JSRuntimePointer) => void;
|
|
29
|
+
QTS_NewContext: (rt: JSRuntimePointer, intrinsics: IntrinsicsFlags) => JSContextPointer;
|
|
30
|
+
QTS_FreeContext: (ctx: JSContextPointer) => void;
|
|
31
|
+
QTS_FreeValuePointer: (ctx: JSContextPointer, value: JSValuePointer) => void;
|
|
32
|
+
QTS_FreeValuePointerRuntime: (rt: JSRuntimePointer, value: JSValuePointer) => void;
|
|
33
|
+
QTS_FreeVoidPointer: (ctx: JSContextPointer, ptr: JSVoidPointer) => void;
|
|
34
|
+
QTS_FreeCString: (ctx: JSContextPointer, str: JSBorrowedCharPointer) => void;
|
|
35
|
+
QTS_DupValuePointer: (ctx: JSContextPointer, val: JSValuePointer | JSValueConstPointer) => JSValuePointer;
|
|
36
|
+
QTS_NewObject: (ctx: JSContextPointer) => JSValuePointer;
|
|
37
|
+
QTS_NewObjectProto: (ctx: JSContextPointer, proto: JSValuePointer | JSValueConstPointer) => JSValuePointer;
|
|
38
|
+
QTS_NewArray: (ctx: JSContextPointer) => JSValuePointer;
|
|
39
|
+
QTS_NewArrayBuffer: (ctx: JSContextPointer, buffer: JSVoidPointer, length: number) => JSValuePointer;
|
|
40
|
+
QTS_NewFloat64: (ctx: JSContextPointer, num: number) => JSValuePointer;
|
|
41
|
+
QTS_GetFloat64: (ctx: JSContextPointer, value: JSValuePointer | JSValueConstPointer) => number;
|
|
42
|
+
QTS_NewString: (ctx: JSContextPointer, string: BorrowedHeapCharPointer) => JSValuePointer;
|
|
43
|
+
QTS_GetString: (ctx: JSContextPointer, value: JSValuePointer | JSValueConstPointer) => JSBorrowedCharPointer;
|
|
44
|
+
QTS_GetArrayBuffer: (ctx: JSContextPointer, data: JSValuePointer | JSValueConstPointer) => JSVoidPointer;
|
|
45
|
+
QTS_GetArrayBufferLength: (ctx: JSContextPointer, data: JSValuePointer | JSValueConstPointer) => number;
|
|
46
|
+
QTS_NewSymbol: (ctx: JSContextPointer, description: BorrowedHeapCharPointer, isGlobal: number) => JSValuePointer;
|
|
47
|
+
QTS_GetSymbolDescriptionOrKey: (ctx: JSContextPointer, value: JSValuePointer | JSValueConstPointer) => JSBorrowedCharPointer;
|
|
48
|
+
QTS_GetSymbolDescriptionOrKey_MaybeAsync: (ctx: JSContextPointer, value: JSValuePointer | JSValueConstPointer) => JSBorrowedCharPointer | Promise<JSBorrowedCharPointer>;
|
|
49
|
+
QTS_IsGlobalSymbol: (ctx: JSContextPointer, value: JSValuePointer | JSValueConstPointer) => number;
|
|
50
|
+
QTS_IsJobPending: (rt: JSRuntimePointer) => number;
|
|
51
|
+
QTS_ExecutePendingJob: (rt: JSRuntimePointer, maxJobsToExecute: number, lastJobContext: JSContextPointerPointer) => JSValuePointer;
|
|
52
|
+
QTS_ExecutePendingJob_MaybeAsync: (rt: JSRuntimePointer, maxJobsToExecute: number, lastJobContext: JSContextPointerPointer) => JSValuePointer | Promise<JSValuePointer>;
|
|
53
|
+
QTS_GetProp: (ctx: JSContextPointer, this_val: JSValuePointer | JSValueConstPointer, prop_name: JSValuePointer | JSValueConstPointer) => JSValuePointer;
|
|
54
|
+
QTS_GetProp_MaybeAsync: (ctx: JSContextPointer, this_val: JSValuePointer | JSValueConstPointer, prop_name: JSValuePointer | JSValueConstPointer) => JSValuePointer | Promise<JSValuePointer>;
|
|
55
|
+
QTS_GetPropNumber: (ctx: JSContextPointer, this_val: JSValuePointer | JSValueConstPointer, prop_name: number) => JSValuePointer;
|
|
56
|
+
QTS_GetPropNumber_MaybeAsync: (ctx: JSContextPointer, this_val: JSValuePointer | JSValueConstPointer, prop_name: number) => JSValuePointer | Promise<JSValuePointer>;
|
|
57
|
+
QTS_SetProp: (ctx: JSContextPointer, this_val: JSValuePointer | JSValueConstPointer, prop_name: JSValuePointer | JSValueConstPointer, prop_value: JSValuePointer | JSValueConstPointer) => void;
|
|
58
|
+
QTS_SetProp_MaybeAsync: (ctx: JSContextPointer, this_val: JSValuePointer | JSValueConstPointer, prop_name: JSValuePointer | JSValueConstPointer, prop_value: JSValuePointer | JSValueConstPointer) => void | Promise<void>;
|
|
59
|
+
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;
|
|
60
|
+
QTS_GetOwnPropertyNames: (ctx: JSContextPointer, out_ptrs: JSValuePointerPointerPointer, out_len: UInt32Pointer, obj: JSValuePointer | JSValueConstPointer, flags: number) => JSValuePointer;
|
|
61
|
+
QTS_GetOwnPropertyNames_MaybeAsync: (ctx: JSContextPointer, out_ptrs: JSValuePointerPointerPointer, out_len: UInt32Pointer, obj: JSValuePointer | JSValueConstPointer, flags: number) => JSValuePointer | Promise<JSValuePointer>;
|
|
62
|
+
QTS_Call: (ctx: JSContextPointer, func_obj: JSValuePointer | JSValueConstPointer, this_obj: JSValuePointer | JSValueConstPointer, argc: number, argv_ptrs: JSValueConstPointerPointer) => JSValuePointer;
|
|
63
|
+
QTS_Call_MaybeAsync: (ctx: JSContextPointer, func_obj: JSValuePointer | JSValueConstPointer, this_obj: JSValuePointer | JSValueConstPointer, argc: number, argv_ptrs: JSValueConstPointerPointer) => JSValuePointer | Promise<JSValuePointer>;
|
|
64
|
+
QTS_ResolveException: (ctx: JSContextPointer, maybe_exception: JSValuePointer) => JSValuePointer;
|
|
65
|
+
QTS_Dump: (ctx: JSContextPointer, obj: JSValuePointer | JSValueConstPointer) => JSBorrowedCharPointer;
|
|
66
|
+
QTS_Dump_MaybeAsync: (ctx: JSContextPointer, obj: JSValuePointer | JSValueConstPointer) => JSBorrowedCharPointer | Promise<JSBorrowedCharPointer>;
|
|
67
|
+
QTS_Eval: (ctx: JSContextPointer, js_code: BorrowedHeapCharPointer, js_code_length: number, filename: string, detectModule: EvalDetectModule, evalFlags: EvalFlags) => JSValuePointer;
|
|
68
|
+
QTS_Eval_MaybeAsync: (ctx: JSContextPointer, js_code: BorrowedHeapCharPointer, js_code_length: number, filename: string, detectModule: EvalDetectModule, evalFlags: EvalFlags) => JSValuePointer | Promise<JSValuePointer>;
|
|
69
|
+
QTS_GetModuleNamespace: (ctx: JSContextPointer, module_func_obj: JSValuePointer | JSValueConstPointer) => JSValuePointer;
|
|
70
|
+
QTS_Typeof: (ctx: JSContextPointer, value: JSValuePointer | JSValueConstPointer) => OwnedHeapCharPointer;
|
|
71
|
+
QTS_GetLength: (ctx: JSContextPointer, out_len: UInt32Pointer, value: JSValuePointer | JSValueConstPointer) => number;
|
|
72
|
+
QTS_IsEqual: (ctx: JSContextPointer, a: JSValuePointer | JSValueConstPointer, b: JSValuePointer | JSValueConstPointer, op: IsEqualOp) => number;
|
|
73
|
+
QTS_GetGlobalObject: (ctx: JSContextPointer) => JSValuePointer;
|
|
74
|
+
QTS_NewPromiseCapability: (ctx: JSContextPointer, resolve_funcs_out: JSValuePointerPointer) => JSValuePointer;
|
|
75
|
+
QTS_PromiseState: (ctx: JSContextPointer, promise: JSValuePointer | JSValueConstPointer) => JSPromiseStateEnum;
|
|
76
|
+
QTS_PromiseResult: (ctx: JSContextPointer, promise: JSValuePointer | JSValueConstPointer) => JSValuePointer;
|
|
77
|
+
QTS_TestStringArg: (string: string) => void;
|
|
78
|
+
QTS_GetDebugLogEnabled: (rt: JSRuntimePointer) => number;
|
|
79
|
+
QTS_SetDebugLogEnabled: (rt: JSRuntimePointer, is_enabled: number) => void;
|
|
80
|
+
QTS_BuildIsDebug: () => number;
|
|
81
|
+
QTS_BuildIsAsyncify: () => number;
|
|
82
|
+
QTS_NewFunction: (ctx: JSContextPointer, func_id: number, name: string) => JSValuePointer;
|
|
83
|
+
QTS_ArgvGetJSValueConstPointer: (argv: JSValuePointer | JSValueConstPointer, index: number) => JSValueConstPointer;
|
|
84
|
+
QTS_RuntimeEnableInterruptHandler: (rt: JSRuntimePointer) => void;
|
|
85
|
+
QTS_RuntimeDisableInterruptHandler: (rt: JSRuntimePointer) => void;
|
|
86
|
+
QTS_RuntimeEnableModuleLoader: (rt: JSRuntimePointer, use_custom_normalize: number) => void;
|
|
87
|
+
QTS_RuntimeDisableModuleLoader: (rt: JSRuntimePointer) => void;
|
|
88
|
+
QTS_bjson_encode: (ctx: JSContextPointer, val: JSValuePointer | JSValueConstPointer) => JSValuePointer;
|
|
89
|
+
QTS_bjson_decode: (ctx: JSContextPointer, data: JSValuePointer | JSValueConstPointer) => JSValuePointer;
|
|
90
|
+
QTS_EvalFunction: (ctx: JSContextPointer, fun_obj: JSValuePointer | JSValueConstPointer) => JSValuePointer;
|
|
91
|
+
QTS_EvalFunction_MaybeAsync: (ctx: JSContextPointer, fun_obj: JSValuePointer | JSValueConstPointer) => JSValuePointer | Promise<JSValuePointer>;
|
|
92
|
+
QTS_EncodeBytecode: (ctx: JSContextPointer, val: JSValuePointer | JSValueConstPointer) => JSValuePointer;
|
|
93
|
+
QTS_DecodeBytecode: (ctx: JSContextPointer, data: JSValuePointer | JSValueConstPointer) => JSValuePointer;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
export { QuickJSAsyncFFI };
|
package/dist/ffi.d.ts
ADDED
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { QuickJSAsyncEmscriptenModule, JSContextPointer, JSValuePointer, JSValueConstPointer, JSRuntimePointer, OwnedHeapCharPointer, IntrinsicsFlags, JSVoidPointer, JSBorrowedCharPointer, BorrowedHeapCharPointer, JSContextPointerPointer, JSValuePointerPointerPointer, UInt32Pointer, JSValueConstPointerPointer, EvalDetectModule, EvalFlags, IsEqualOp, JSValuePointerPointer, JSPromiseStateEnum } from '@componentor/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 QuickJSAsyncFFI {
|
|
11
|
+
private module;
|
|
12
|
+
constructor(module: QuickJSAsyncEmscriptenModule);
|
|
13
|
+
/** Set at compile time. */
|
|
14
|
+
readonly DEBUG = true;
|
|
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_NewRuntime: () => JSRuntimePointer;
|
|
28
|
+
QTS_FreeRuntime: (rt: JSRuntimePointer) => void;
|
|
29
|
+
QTS_NewContext: (rt: JSRuntimePointer, intrinsics: IntrinsicsFlags) => JSContextPointer;
|
|
30
|
+
QTS_FreeContext: (ctx: JSContextPointer) => void;
|
|
31
|
+
QTS_FreeValuePointer: (ctx: JSContextPointer, value: JSValuePointer) => void;
|
|
32
|
+
QTS_FreeValuePointerRuntime: (rt: JSRuntimePointer, value: JSValuePointer) => void;
|
|
33
|
+
QTS_FreeVoidPointer: (ctx: JSContextPointer, ptr: JSVoidPointer) => void;
|
|
34
|
+
QTS_FreeCString: (ctx: JSContextPointer, str: JSBorrowedCharPointer) => void;
|
|
35
|
+
QTS_DupValuePointer: (ctx: JSContextPointer, val: JSValuePointer | JSValueConstPointer) => JSValuePointer;
|
|
36
|
+
QTS_NewObject: (ctx: JSContextPointer) => JSValuePointer;
|
|
37
|
+
QTS_NewObjectProto: (ctx: JSContextPointer, proto: JSValuePointer | JSValueConstPointer) => JSValuePointer;
|
|
38
|
+
QTS_NewArray: (ctx: JSContextPointer) => JSValuePointer;
|
|
39
|
+
QTS_NewArrayBuffer: (ctx: JSContextPointer, buffer: JSVoidPointer, length: number) => JSValuePointer;
|
|
40
|
+
QTS_NewFloat64: (ctx: JSContextPointer, num: number) => JSValuePointer;
|
|
41
|
+
QTS_GetFloat64: (ctx: JSContextPointer, value: JSValuePointer | JSValueConstPointer) => number;
|
|
42
|
+
QTS_NewString: (ctx: JSContextPointer, string: BorrowedHeapCharPointer) => JSValuePointer;
|
|
43
|
+
QTS_GetString: (ctx: JSContextPointer, value: JSValuePointer | JSValueConstPointer) => JSBorrowedCharPointer;
|
|
44
|
+
QTS_GetArrayBuffer: (ctx: JSContextPointer, data: JSValuePointer | JSValueConstPointer) => JSVoidPointer;
|
|
45
|
+
QTS_GetArrayBufferLength: (ctx: JSContextPointer, data: JSValuePointer | JSValueConstPointer) => number;
|
|
46
|
+
QTS_NewSymbol: (ctx: JSContextPointer, description: BorrowedHeapCharPointer, isGlobal: number) => JSValuePointer;
|
|
47
|
+
QTS_GetSymbolDescriptionOrKey: (ctx: JSContextPointer, value: JSValuePointer | JSValueConstPointer) => JSBorrowedCharPointer;
|
|
48
|
+
QTS_GetSymbolDescriptionOrKey_MaybeAsync: (ctx: JSContextPointer, value: JSValuePointer | JSValueConstPointer) => JSBorrowedCharPointer | Promise<JSBorrowedCharPointer>;
|
|
49
|
+
QTS_IsGlobalSymbol: (ctx: JSContextPointer, value: JSValuePointer | JSValueConstPointer) => number;
|
|
50
|
+
QTS_IsJobPending: (rt: JSRuntimePointer) => number;
|
|
51
|
+
QTS_ExecutePendingJob: (rt: JSRuntimePointer, maxJobsToExecute: number, lastJobContext: JSContextPointerPointer) => JSValuePointer;
|
|
52
|
+
QTS_ExecutePendingJob_MaybeAsync: (rt: JSRuntimePointer, maxJobsToExecute: number, lastJobContext: JSContextPointerPointer) => JSValuePointer | Promise<JSValuePointer>;
|
|
53
|
+
QTS_GetProp: (ctx: JSContextPointer, this_val: JSValuePointer | JSValueConstPointer, prop_name: JSValuePointer | JSValueConstPointer) => JSValuePointer;
|
|
54
|
+
QTS_GetProp_MaybeAsync: (ctx: JSContextPointer, this_val: JSValuePointer | JSValueConstPointer, prop_name: JSValuePointer | JSValueConstPointer) => JSValuePointer | Promise<JSValuePointer>;
|
|
55
|
+
QTS_GetPropNumber: (ctx: JSContextPointer, this_val: JSValuePointer | JSValueConstPointer, prop_name: number) => JSValuePointer;
|
|
56
|
+
QTS_GetPropNumber_MaybeAsync: (ctx: JSContextPointer, this_val: JSValuePointer | JSValueConstPointer, prop_name: number) => JSValuePointer | Promise<JSValuePointer>;
|
|
57
|
+
QTS_SetProp: (ctx: JSContextPointer, this_val: JSValuePointer | JSValueConstPointer, prop_name: JSValuePointer | JSValueConstPointer, prop_value: JSValuePointer | JSValueConstPointer) => void;
|
|
58
|
+
QTS_SetProp_MaybeAsync: (ctx: JSContextPointer, this_val: JSValuePointer | JSValueConstPointer, prop_name: JSValuePointer | JSValueConstPointer, prop_value: JSValuePointer | JSValueConstPointer) => void | Promise<void>;
|
|
59
|
+
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;
|
|
60
|
+
QTS_GetOwnPropertyNames: (ctx: JSContextPointer, out_ptrs: JSValuePointerPointerPointer, out_len: UInt32Pointer, obj: JSValuePointer | JSValueConstPointer, flags: number) => JSValuePointer;
|
|
61
|
+
QTS_GetOwnPropertyNames_MaybeAsync: (ctx: JSContextPointer, out_ptrs: JSValuePointerPointerPointer, out_len: UInt32Pointer, obj: JSValuePointer | JSValueConstPointer, flags: number) => JSValuePointer | Promise<JSValuePointer>;
|
|
62
|
+
QTS_Call: (ctx: JSContextPointer, func_obj: JSValuePointer | JSValueConstPointer, this_obj: JSValuePointer | JSValueConstPointer, argc: number, argv_ptrs: JSValueConstPointerPointer) => JSValuePointer;
|
|
63
|
+
QTS_Call_MaybeAsync: (ctx: JSContextPointer, func_obj: JSValuePointer | JSValueConstPointer, this_obj: JSValuePointer | JSValueConstPointer, argc: number, argv_ptrs: JSValueConstPointerPointer) => JSValuePointer | Promise<JSValuePointer>;
|
|
64
|
+
QTS_ResolveException: (ctx: JSContextPointer, maybe_exception: JSValuePointer) => JSValuePointer;
|
|
65
|
+
QTS_Dump: (ctx: JSContextPointer, obj: JSValuePointer | JSValueConstPointer) => JSBorrowedCharPointer;
|
|
66
|
+
QTS_Dump_MaybeAsync: (ctx: JSContextPointer, obj: JSValuePointer | JSValueConstPointer) => JSBorrowedCharPointer | Promise<JSBorrowedCharPointer>;
|
|
67
|
+
QTS_Eval: (ctx: JSContextPointer, js_code: BorrowedHeapCharPointer, js_code_length: number, filename: string, detectModule: EvalDetectModule, evalFlags: EvalFlags) => JSValuePointer;
|
|
68
|
+
QTS_Eval_MaybeAsync: (ctx: JSContextPointer, js_code: BorrowedHeapCharPointer, js_code_length: number, filename: string, detectModule: EvalDetectModule, evalFlags: EvalFlags) => JSValuePointer | Promise<JSValuePointer>;
|
|
69
|
+
QTS_GetModuleNamespace: (ctx: JSContextPointer, module_func_obj: JSValuePointer | JSValueConstPointer) => JSValuePointer;
|
|
70
|
+
QTS_Typeof: (ctx: JSContextPointer, value: JSValuePointer | JSValueConstPointer) => OwnedHeapCharPointer;
|
|
71
|
+
QTS_GetLength: (ctx: JSContextPointer, out_len: UInt32Pointer, value: JSValuePointer | JSValueConstPointer) => number;
|
|
72
|
+
QTS_IsEqual: (ctx: JSContextPointer, a: JSValuePointer | JSValueConstPointer, b: JSValuePointer | JSValueConstPointer, op: IsEqualOp) => number;
|
|
73
|
+
QTS_GetGlobalObject: (ctx: JSContextPointer) => JSValuePointer;
|
|
74
|
+
QTS_NewPromiseCapability: (ctx: JSContextPointer, resolve_funcs_out: JSValuePointerPointer) => JSValuePointer;
|
|
75
|
+
QTS_PromiseState: (ctx: JSContextPointer, promise: JSValuePointer | JSValueConstPointer) => JSPromiseStateEnum;
|
|
76
|
+
QTS_PromiseResult: (ctx: JSContextPointer, promise: JSValuePointer | JSValueConstPointer) => JSValuePointer;
|
|
77
|
+
QTS_TestStringArg: (string: string) => void;
|
|
78
|
+
QTS_GetDebugLogEnabled: (rt: JSRuntimePointer) => number;
|
|
79
|
+
QTS_SetDebugLogEnabled: (rt: JSRuntimePointer, is_enabled: number) => void;
|
|
80
|
+
QTS_BuildIsDebug: () => number;
|
|
81
|
+
QTS_BuildIsAsyncify: () => number;
|
|
82
|
+
QTS_NewFunction: (ctx: JSContextPointer, func_id: number, name: string) => JSValuePointer;
|
|
83
|
+
QTS_ArgvGetJSValueConstPointer: (argv: JSValuePointer | JSValueConstPointer, index: number) => JSValueConstPointer;
|
|
84
|
+
QTS_RuntimeEnableInterruptHandler: (rt: JSRuntimePointer) => void;
|
|
85
|
+
QTS_RuntimeDisableInterruptHandler: (rt: JSRuntimePointer) => void;
|
|
86
|
+
QTS_RuntimeEnableModuleLoader: (rt: JSRuntimePointer, use_custom_normalize: number) => void;
|
|
87
|
+
QTS_RuntimeDisableModuleLoader: (rt: JSRuntimePointer) => void;
|
|
88
|
+
QTS_bjson_encode: (ctx: JSContextPointer, val: JSValuePointer | JSValueConstPointer) => JSValuePointer;
|
|
89
|
+
QTS_bjson_decode: (ctx: JSContextPointer, data: JSValuePointer | JSValueConstPointer) => JSValuePointer;
|
|
90
|
+
QTS_EvalFunction: (ctx: JSContextPointer, fun_obj: JSValuePointer | JSValueConstPointer) => JSValuePointer;
|
|
91
|
+
QTS_EvalFunction_MaybeAsync: (ctx: JSContextPointer, fun_obj: JSValuePointer | JSValueConstPointer) => JSValuePointer | Promise<JSValuePointer>;
|
|
92
|
+
QTS_EncodeBytecode: (ctx: JSContextPointer, val: JSValuePointer | JSValueConstPointer) => JSValuePointer;
|
|
93
|
+
QTS_DecodeBytecode: (ctx: JSContextPointer, data: JSValuePointer | JSValueConstPointer) => JSValuePointer;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
export { QuickJSAsyncFFI };
|
package/dist/ffi.js
ADDED
|
@@ -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,{QuickJSAsyncFFI:()=>QuickJSAsyncFFI});module.exports=__toCommonJS(ffi_exports);var import_quickjs_ffi_types=require("@componentor/quickjs-ffi-types"),QuickJSAsyncFFI=class{constructor(module2){this.module=module2;this.DEBUG=!0;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_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=(0,import_quickjs_ffi_types.assertSync)(this.module.cwrap("QTS_GetSymbolDescriptionOrKey","number",["number","number"]));this.QTS_GetSymbolDescriptionOrKey_MaybeAsync=this.module.cwrap("QTS_GetSymbolDescriptionOrKey","number",["number","number"],{async:!0});this.QTS_IsGlobalSymbol=this.module.cwrap("QTS_IsGlobalSymbol","number",["number","number"]);this.QTS_IsJobPending=this.module.cwrap("QTS_IsJobPending","number",["number"]);this.QTS_ExecutePendingJob=(0,import_quickjs_ffi_types.assertSync)(this.module.cwrap("QTS_ExecutePendingJob","number",["number","number","number"]));this.QTS_ExecutePendingJob_MaybeAsync=this.module.cwrap("QTS_ExecutePendingJob","number",["number","number","number"],{async:!0});this.QTS_GetProp=(0,import_quickjs_ffi_types.assertSync)(this.module.cwrap("QTS_GetProp","number",["number","number","number"]));this.QTS_GetProp_MaybeAsync=this.module.cwrap("QTS_GetProp","number",["number","number","number"],{async:!0});this.QTS_GetPropNumber=(0,import_quickjs_ffi_types.assertSync)(this.module.cwrap("QTS_GetPropNumber","number",["number","number","number"]));this.QTS_GetPropNumber_MaybeAsync=this.module.cwrap("QTS_GetPropNumber","number",["number","number","number"],{async:!0});this.QTS_SetProp=(0,import_quickjs_ffi_types.assertSync)(this.module.cwrap("QTS_SetProp",null,["number","number","number","number"]));this.QTS_SetProp_MaybeAsync=this.module.cwrap("QTS_SetProp",null,["number","number","number","number"],{async:!0});this.QTS_DefineProp=this.module.cwrap("QTS_DefineProp",null,["number","number","number","number","number","number","boolean","boolean","boolean"]);this.QTS_GetOwnPropertyNames=(0,import_quickjs_ffi_types.assertSync)(this.module.cwrap("QTS_GetOwnPropertyNames","number",["number","number","number","number","number"]));this.QTS_GetOwnPropertyNames_MaybeAsync=this.module.cwrap("QTS_GetOwnPropertyNames","number",["number","number","number","number","number"],{async:!0});this.QTS_Call=(0,import_quickjs_ffi_types.assertSync)(this.module.cwrap("QTS_Call","number",["number","number","number","number","number"]));this.QTS_Call_MaybeAsync=this.module.cwrap("QTS_Call","number",["number","number","number","number","number"],{async:!0});this.QTS_ResolveException=this.module.cwrap("QTS_ResolveException","number",["number","number"]);this.QTS_Dump=(0,import_quickjs_ffi_types.assertSync)(this.module.cwrap("QTS_Dump","number",["number","number"]));this.QTS_Dump_MaybeAsync=this.module.cwrap("QTS_Dump","number",["number","number"],{async:!0});this.QTS_Eval=(0,import_quickjs_ffi_types.assertSync)(this.module.cwrap("QTS_Eval","number",["number","number","number","string","number","number"]));this.QTS_Eval_MaybeAsync=this.module.cwrap("QTS_Eval","number",["number","number","number","string","number","number"],{async:!0});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","number","string"]);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"]);this.QTS_EvalFunction=(0,import_quickjs_ffi_types.assertSync)(this.module.cwrap("QTS_EvalFunction","number",["number","number"]));this.QTS_EvalFunction_MaybeAsync=this.module.cwrap("QTS_EvalFunction","number",["number","number"],{async:!0});this.QTS_EncodeBytecode=this.module.cwrap("QTS_EncodeBytecode","number",["number","number"]);this.QTS_DecodeBytecode=this.module.cwrap("QTS_DecodeBytecode","number",["number","number"])}};0&&(module.exports={QuickJSAsyncFFI});
|
|
2
|
+
//# sourceMappingURL=ffi.js.map
|
package/dist/ffi.js.map
ADDED
|
@@ -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 QuickJSAsyncEmscriptenModule,\n JSRuntimePointer,\n JSContextPointer,\n JSContextPointerPointer,\n JSModuleDefPointer,\n JSValuePointer,\n JSValueConstPointer,\n JSValuePointerPointer,\n JSValuePointerPointerPointer,\n JSValueConstPointerPointer,\n QTS_C_To_HostCallbackFuncPointer,\n QTS_C_To_HostInterruptFuncPointer,\n QTS_C_To_HostLoadModuleFuncPointer,\n BorrowedHeapCharPointer,\n OwnedHeapCharPointer,\n JSBorrowedCharPointer,\n JSVoidPointer,\n UInt32Pointer,\n EvalFlags,\n IntrinsicsFlags,\n EvalDetectModule,\n GetOwnPropertyNamesFlags,\n IsEqualOp,\n JSPromiseStateEnum,\n assertSync,\n} from \"@componentor/quickjs-ffi-types\"\n\n/**\n * Low-level FFI bindings to QuickJS's Emscripten module.\n * See instead {@link QuickJSContext}, the public Javascript interface exposed by this\n * library.\n *\n * @unstable The FFI interface is considered private and may change.\n */\nexport class QuickJSAsyncFFI {\n constructor(private module: QuickJSAsyncEmscriptenModule) {}\n /** Set at compile time. */\n readonly DEBUG = true\n\n QTS_Throw: (\n ctx: JSContextPointer,\n error: JSValuePointer | JSValueConstPointer,\n ) => JSValuePointer = this.module.cwrap(\"QTS_Throw\", \"number\", [\"number\", \"number\"])\n\n QTS_NewError: (ctx: JSContextPointer) => JSValuePointer = this.module.cwrap(\n \"QTS_NewError\",\n \"number\",\n [\"number\"],\n )\n\n QTS_RuntimeSetMemoryLimit: (rt: JSRuntimePointer, limit: number) => void = this.module.cwrap(\n \"QTS_RuntimeSetMemoryLimit\",\n null,\n [\"number\", \"number\"],\n )\n\n QTS_RuntimeComputeMemoryUsage: (rt: JSRuntimePointer, ctx: JSContextPointer) => JSValuePointer =\n this.module.cwrap(\"QTS_RuntimeComputeMemoryUsage\", \"number\", [\"number\", \"number\"])\n\n QTS_RuntimeDumpMemoryUsage: (rt: JSRuntimePointer) => OwnedHeapCharPointer = this.module.cwrap(\n \"QTS_RuntimeDumpMemoryUsage\",\n \"number\",\n [\"number\"],\n )\n\n QTS_RecoverableLeakCheck: () => number = this.module.cwrap(\n \"QTS_RecoverableLeakCheck\",\n \"number\",\n [],\n )\n\n QTS_BuildIsSanitizeLeak: () => number = this.module.cwrap(\"QTS_BuildIsSanitizeLeak\", \"number\", [])\n\n QTS_RuntimeSetMaxStackSize: (rt: JSRuntimePointer, stack_size: number) => void =\n this.module.cwrap(\"QTS_RuntimeSetMaxStackSize\", null, [\"number\", \"number\"])\n\n QTS_GetUndefined: () => JSValueConstPointer = this.module.cwrap(\"QTS_GetUndefined\", \"number\", [])\n\n QTS_GetNull: () => JSValueConstPointer = this.module.cwrap(\"QTS_GetNull\", \"number\", [])\n\n QTS_GetFalse: () => JSValueConstPointer = this.module.cwrap(\"QTS_GetFalse\", \"number\", [])\n\n QTS_GetTrue: () => JSValueConstPointer = this.module.cwrap(\"QTS_GetTrue\", \"number\", [])\n\n QTS_NewRuntime: () => JSRuntimePointer = this.module.cwrap(\"QTS_NewRuntime\", \"number\", [])\n\n QTS_FreeRuntime: (rt: JSRuntimePointer) => void = this.module.cwrap(\"QTS_FreeRuntime\", null, [\n \"number\",\n ])\n\n QTS_NewContext: (rt: JSRuntimePointer, intrinsics: IntrinsicsFlags) => JSContextPointer =\n this.module.cwrap(\"QTS_NewContext\", \"number\", [\"number\", \"number\"])\n\n QTS_FreeContext: (ctx: JSContextPointer) => void = this.module.cwrap(\"QTS_FreeContext\", null, [\n \"number\",\n ])\n\n QTS_FreeValuePointer: (ctx: JSContextPointer, value: JSValuePointer) => void = this.module.cwrap(\n \"QTS_FreeValuePointer\",\n null,\n [\"number\", \"number\"],\n )\n\n QTS_FreeValuePointerRuntime: (rt: JSRuntimePointer, value: JSValuePointer) => void =\n this.module.cwrap(\"QTS_FreeValuePointerRuntime\", null, [\"number\", \"number\"])\n\n QTS_FreeVoidPointer: (ctx: JSContextPointer, ptr: JSVoidPointer) => void = this.module.cwrap(\n \"QTS_FreeVoidPointer\",\n null,\n [\"number\", \"number\"],\n )\n\n QTS_FreeCString: (ctx: JSContextPointer, str: JSBorrowedCharPointer) => void = this.module.cwrap(\n \"QTS_FreeCString\",\n null,\n [\"number\", \"number\"],\n )\n\n QTS_DupValuePointer: (\n ctx: JSContextPointer,\n val: JSValuePointer | JSValueConstPointer,\n ) => JSValuePointer = this.module.cwrap(\"QTS_DupValuePointer\", \"number\", [\"number\", \"number\"])\n\n QTS_NewObject: (ctx: JSContextPointer) => JSValuePointer = this.module.cwrap(\n \"QTS_NewObject\",\n \"number\",\n [\"number\"],\n )\n\n QTS_NewObjectProto: (\n ctx: JSContextPointer,\n proto: JSValuePointer | JSValueConstPointer,\n ) => JSValuePointer = this.module.cwrap(\"QTS_NewObjectProto\", \"number\", [\"number\", \"number\"])\n\n QTS_NewArray: (ctx: JSContextPointer) => JSValuePointer = this.module.cwrap(\n \"QTS_NewArray\",\n \"number\",\n [\"number\"],\n )\n\n QTS_NewArrayBuffer: (\n ctx: JSContextPointer,\n buffer: JSVoidPointer,\n length: number,\n ) => JSValuePointer = this.module.cwrap(\"QTS_NewArrayBuffer\", \"number\", [\n \"number\",\n \"number\",\n \"number\",\n ])\n\n QTS_NewFloat64: (ctx: JSContextPointer, num: number) => JSValuePointer = this.module.cwrap(\n \"QTS_NewFloat64\",\n \"number\",\n [\"number\", \"number\"],\n )\n\n QTS_GetFloat64: (ctx: JSContextPointer, value: JSValuePointer | JSValueConstPointer) => number =\n this.module.cwrap(\"QTS_GetFloat64\", \"number\", [\"number\", \"number\"])\n\n QTS_NewString: (ctx: JSContextPointer, string: BorrowedHeapCharPointer) => JSValuePointer =\n this.module.cwrap(\"QTS_NewString\", \"number\", [\"number\", \"number\"])\n\n QTS_GetString: (\n ctx: JSContextPointer,\n value: JSValuePointer | JSValueConstPointer,\n ) => JSBorrowedCharPointer = this.module.cwrap(\"QTS_GetString\", \"number\", [\"number\", \"number\"])\n\n QTS_GetArrayBuffer: (\n ctx: JSContextPointer,\n data: JSValuePointer | JSValueConstPointer,\n ) => JSVoidPointer = this.module.cwrap(\"QTS_GetArrayBuffer\", \"number\", [\"number\", \"number\"])\n\n QTS_GetArrayBufferLength: (\n ctx: JSContextPointer,\n data: JSValuePointer | JSValueConstPointer,\n ) => number = this.module.cwrap(\"QTS_GetArrayBufferLength\", \"number\", [\"number\", \"number\"])\n\n QTS_NewSymbol: (\n ctx: JSContextPointer,\n description: BorrowedHeapCharPointer,\n isGlobal: number,\n ) => JSValuePointer = this.module.cwrap(\"QTS_NewSymbol\", \"number\", [\"number\", \"number\", \"number\"])\n\n QTS_GetSymbolDescriptionOrKey: (\n ctx: JSContextPointer,\n value: JSValuePointer | JSValueConstPointer,\n ) => JSBorrowedCharPointer = assertSync(\n this.module.cwrap(\"QTS_GetSymbolDescriptionOrKey\", \"number\", [\"number\", \"number\"]),\n )\n\n QTS_GetSymbolDescriptionOrKey_MaybeAsync: (\n ctx: JSContextPointer,\n value: JSValuePointer | JSValueConstPointer,\n ) => JSBorrowedCharPointer | Promise<JSBorrowedCharPointer> = this.module.cwrap(\n \"QTS_GetSymbolDescriptionOrKey\",\n \"number\",\n [\"number\", \"number\"],\n { async: true },\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 = assertSync(\n this.module.cwrap(\"QTS_ExecutePendingJob\", \"number\", [\"number\", \"number\", \"number\"]),\n )\n\n QTS_ExecutePendingJob_MaybeAsync: (\n rt: JSRuntimePointer,\n maxJobsToExecute: number,\n lastJobContext: JSContextPointerPointer,\n ) => JSValuePointer | Promise<JSValuePointer> = this.module.cwrap(\n \"QTS_ExecutePendingJob\",\n \"number\",\n [\"number\", \"number\", \"number\"],\n { async: true },\n )\n\n QTS_GetProp: (\n ctx: JSContextPointer,\n this_val: JSValuePointer | JSValueConstPointer,\n prop_name: JSValuePointer | JSValueConstPointer,\n ) => JSValuePointer = assertSync(\n this.module.cwrap(\"QTS_GetProp\", \"number\", [\"number\", \"number\", \"number\"]),\n )\n\n QTS_GetProp_MaybeAsync: (\n ctx: JSContextPointer,\n this_val: JSValuePointer | JSValueConstPointer,\n prop_name: JSValuePointer | JSValueConstPointer,\n ) => JSValuePointer | Promise<JSValuePointer> = this.module.cwrap(\n \"QTS_GetProp\",\n \"number\",\n [\"number\", \"number\", \"number\"],\n { async: true },\n )\n\n QTS_GetPropNumber: (\n ctx: JSContextPointer,\n this_val: JSValuePointer | JSValueConstPointer,\n prop_name: number,\n ) => JSValuePointer = assertSync(\n this.module.cwrap(\"QTS_GetPropNumber\", \"number\", [\"number\", \"number\", \"number\"]),\n )\n\n QTS_GetPropNumber_MaybeAsync: (\n ctx: JSContextPointer,\n this_val: JSValuePointer | JSValueConstPointer,\n prop_name: number,\n ) => JSValuePointer | Promise<JSValuePointer> = this.module.cwrap(\n \"QTS_GetPropNumber\",\n \"number\",\n [\"number\", \"number\", \"number\"],\n { async: true },\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 = assertSync(\n this.module.cwrap(\"QTS_SetProp\", null, [\"number\", \"number\", \"number\", \"number\"]),\n )\n\n QTS_SetProp_MaybeAsync: (\n ctx: JSContextPointer,\n this_val: JSValuePointer | JSValueConstPointer,\n prop_name: JSValuePointer | JSValueConstPointer,\n prop_value: JSValuePointer | JSValueConstPointer,\n ) => void | Promise<void> = this.module.cwrap(\n \"QTS_SetProp\",\n null,\n [\"number\", \"number\", \"number\", \"number\"],\n { async: true },\n )\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 = assertSync(\n this.module.cwrap(\"QTS_GetOwnPropertyNames\", \"number\", [\n \"number\",\n \"number\",\n \"number\",\n \"number\",\n \"number\",\n ]),\n )\n\n QTS_GetOwnPropertyNames_MaybeAsync: (\n ctx: JSContextPointer,\n out_ptrs: JSValuePointerPointerPointer,\n out_len: UInt32Pointer,\n obj: JSValuePointer | JSValueConstPointer,\n flags: number,\n ) => JSValuePointer | Promise<JSValuePointer> = this.module.cwrap(\n \"QTS_GetOwnPropertyNames\",\n \"number\",\n [\"number\", \"number\", \"number\", \"number\", \"number\"],\n { async: true },\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 = assertSync(\n this.module.cwrap(\"QTS_Call\", \"number\", [\"number\", \"number\", \"number\", \"number\", \"number\"]),\n )\n\n QTS_Call_MaybeAsync: (\n ctx: JSContextPointer,\n func_obj: JSValuePointer | JSValueConstPointer,\n this_obj: JSValuePointer | JSValueConstPointer,\n argc: number,\n argv_ptrs: JSValueConstPointerPointer,\n ) => JSValuePointer | Promise<JSValuePointer> = this.module.cwrap(\n \"QTS_Call\",\n \"number\",\n [\"number\", \"number\", \"number\", \"number\", \"number\"],\n { async: true },\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 = assertSync(\n this.module.cwrap(\"QTS_Dump\", \"number\", [\"number\", \"number\"]),\n )\n\n QTS_Dump_MaybeAsync: (\n ctx: JSContextPointer,\n obj: JSValuePointer | JSValueConstPointer,\n ) => JSBorrowedCharPointer | Promise<JSBorrowedCharPointer> = this.module.cwrap(\n \"QTS_Dump\",\n \"number\",\n [\"number\", \"number\"],\n { async: true },\n )\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 = assertSync(\n this.module.cwrap(\"QTS_Eval\", \"number\", [\n \"number\",\n \"number\",\n \"number\",\n \"string\",\n \"number\",\n \"number\",\n ]),\n )\n\n QTS_Eval_MaybeAsync: (\n ctx: JSContextPointer,\n js_code: BorrowedHeapCharPointer,\n js_code_length: number,\n filename: string,\n detectModule: EvalDetectModule,\n evalFlags: EvalFlags,\n ) => JSValuePointer | Promise<JSValuePointer> = this.module.cwrap(\n \"QTS_Eval\",\n \"number\",\n [\"number\", \"number\", \"number\", \"string\", \"number\", \"number\"],\n { async: true },\n )\n\n QTS_GetModuleNamespace: (\n ctx: JSContextPointer,\n module_func_obj: JSValuePointer | JSValueConstPointer,\n ) => JSValuePointer = this.module.cwrap(\"QTS_GetModuleNamespace\", \"number\", [\"number\", \"number\"])\n\n QTS_Typeof: (\n ctx: JSContextPointer,\n value: JSValuePointer | JSValueConstPointer,\n ) => OwnedHeapCharPointer = this.module.cwrap(\"QTS_Typeof\", \"number\", [\"number\", \"number\"])\n\n QTS_GetLength: (\n ctx: JSContextPointer,\n out_len: UInt32Pointer,\n value: JSValuePointer | JSValueConstPointer,\n ) => number = this.module.cwrap(\"QTS_GetLength\", \"number\", [\"number\", \"number\", \"number\"])\n\n QTS_IsEqual: (\n ctx: JSContextPointer,\n a: JSValuePointer | JSValueConstPointer,\n b: JSValuePointer | JSValueConstPointer,\n op: IsEqualOp,\n ) => number = this.module.cwrap(\"QTS_IsEqual\", \"number\", [\"number\", \"number\", \"number\", \"number\"])\n\n QTS_GetGlobalObject: (ctx: JSContextPointer) => JSValuePointer = this.module.cwrap(\n \"QTS_GetGlobalObject\",\n \"number\",\n [\"number\"],\n )\n\n QTS_NewPromiseCapability: (\n ctx: JSContextPointer,\n resolve_funcs_out: JSValuePointerPointer,\n ) => JSValuePointer = this.module.cwrap(\"QTS_NewPromiseCapability\", \"number\", [\n \"number\",\n \"number\",\n ])\n\n QTS_PromiseState: (\n ctx: JSContextPointer,\n promise: JSValuePointer | JSValueConstPointer,\n ) => JSPromiseStateEnum = this.module.cwrap(\"QTS_PromiseState\", \"number\", [\"number\", \"number\"])\n\n QTS_PromiseResult: (\n ctx: JSContextPointer,\n promise: JSValuePointer | JSValueConstPointer,\n ) => JSValuePointer = this.module.cwrap(\"QTS_PromiseResult\", \"number\", [\"number\", \"number\"])\n\n QTS_TestStringArg: (string: string) => void = this.module.cwrap(\"QTS_TestStringArg\", null, [\n \"string\",\n ])\n\n QTS_GetDebugLogEnabled: (rt: JSRuntimePointer) => number = this.module.cwrap(\n \"QTS_GetDebugLogEnabled\",\n \"number\",\n [\"number\"],\n )\n\n QTS_SetDebugLogEnabled: (rt: JSRuntimePointer, is_enabled: number) => void = this.module.cwrap(\n \"QTS_SetDebugLogEnabled\",\n null,\n [\"number\", \"number\"],\n )\n\n QTS_BuildIsDebug: () => number = this.module.cwrap(\"QTS_BuildIsDebug\", \"number\", [])\n\n QTS_BuildIsAsyncify: () => number = this.module.cwrap(\"QTS_BuildIsAsyncify\", \"number\", [])\n\n QTS_NewFunction: (ctx: JSContextPointer, func_id: number, name: string) => JSValuePointer =\n this.module.cwrap(\"QTS_NewFunction\", \"number\", [\"number\", \"number\", \"string\"])\n\n QTS_ArgvGetJSValueConstPointer: (\n argv: JSValuePointer | JSValueConstPointer,\n index: number,\n ) => JSValueConstPointer = this.module.cwrap(\"QTS_ArgvGetJSValueConstPointer\", \"number\", [\n \"number\",\n \"number\",\n ])\n\n QTS_RuntimeEnableInterruptHandler: (rt: JSRuntimePointer) => void = this.module.cwrap(\n \"QTS_RuntimeEnableInterruptHandler\",\n null,\n [\"number\"],\n )\n\n QTS_RuntimeDisableInterruptHandler: (rt: JSRuntimePointer) => void = this.module.cwrap(\n \"QTS_RuntimeDisableInterruptHandler\",\n null,\n [\"number\"],\n )\n\n QTS_RuntimeEnableModuleLoader: (rt: JSRuntimePointer, use_custom_normalize: number) => void =\n this.module.cwrap(\"QTS_RuntimeEnableModuleLoader\", null, [\"number\", \"number\"])\n\n QTS_RuntimeDisableModuleLoader: (rt: JSRuntimePointer) => void = this.module.cwrap(\n \"QTS_RuntimeDisableModuleLoader\",\n null,\n [\"number\"],\n )\n\n QTS_bjson_encode: (\n ctx: JSContextPointer,\n val: JSValuePointer | JSValueConstPointer,\n ) => JSValuePointer = this.module.cwrap(\"QTS_bjson_encode\", \"number\", [\"number\", \"number\"])\n\n QTS_bjson_decode: (\n ctx: JSContextPointer,\n data: JSValuePointer | JSValueConstPointer,\n ) => JSValuePointer = this.module.cwrap(\"QTS_bjson_decode\", \"number\", [\"number\", \"number\"])\n\n QTS_EvalFunction: (\n ctx: JSContextPointer,\n fun_obj: JSValuePointer | JSValueConstPointer,\n ) => JSValuePointer = assertSync(\n this.module.cwrap(\"QTS_EvalFunction\", \"number\", [\"number\", \"number\"]),\n )\n\n QTS_EvalFunction_MaybeAsync: (\n ctx: JSContextPointer,\n fun_obj: JSValuePointer | JSValueConstPointer,\n ) => JSValuePointer | Promise<JSValuePointer> = this.module.cwrap(\n \"QTS_EvalFunction\",\n \"number\",\n [\"number\", \"number\"],\n { async: true },\n )\n\n QTS_EncodeBytecode: (\n ctx: JSContextPointer,\n val: JSValuePointer | JSValueConstPointer,\n ) => JSValuePointer = this.module.cwrap(\"QTS_EncodeBytecode\", \"number\", [\"number\", \"number\"])\n\n QTS_DecodeBytecode: (\n ctx: JSContextPointer,\n data: JSValuePointer | JSValueConstPointer,\n ) => JSValuePointer = this.module.cwrap(\"QTS_DecodeBytecode\", \"number\", [\"number\", \"number\"])\n}\n"],"mappings":"wpBAAA,wHACA,6BA0BO,0CASM,gBAAN,KAAsB,CAC3B,YAAoBA,QAAsC,CAAtC,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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zF,qBACE,KAAK,OAAO,MAAM,kBAAmB,SAAU,CAAC,SAAU,SAAU,QAAQ,CAAC,EAE/E,oCAG2B,KAAK,OAAO,MAAM,iCAAkC,SAAU,CACvF,SACA,QACF,CAAC,EAED,uCAAoE,KAAK,OAAO,MAC9E,oCACA,KACA,CAAC,QAAQ,CACX,EAEA,wCAAqE,KAAK,OAAO,MAC/E,qCACA,KACA,CAAC,QAAQ,CACX,EAEA,mCACE,KAAK,OAAO,MAAM,gCAAiC,KAAM,CAAC,SAAU,QAAQ,CAAC,EAE/E,oCAAiE,KAAK,OAAO,MAC3E,iCACA,KACA,CAAC,QAAQ,CACX,EAEA,sBAGsB,KAAK,OAAO,MAAM,mBAAoB,SAAU,CAAC,SAAU,QAAQ,CAAC,EAE1F,sBAGsB,KAAK,OAAO,MAAM,mBAAoB,SAAU,CAAC,SAAU,QAAQ,CAAC,EAE1F,yBAGsB,qCACpB,KAAK,OAAO,MAAM,mBAAoB,SAAU,CAAC,SAAU,QAAQ,CAAC,CACtE,EAEA,iCAGgD,KAAK,OAAO,MAC1D,mBACA,SACA,CAAC,SAAU,QAAQ,EACnB,CAAE,MAAO,EAAK,CAChB,EAEA,wBAGsB,KAAK,OAAO,MAAM,qBAAsB,SAAU,CAAC,SAAU,QAAQ,CAAC,EAE5F,wBAGsB,KAAK,OAAO,MAAM,qBAAsB,SAAU,CAAC,SAAU,QAAQ,CAAC,CAlgBjC,CAmgB7D","names":["module"]}
|
package/dist/ffi.mjs
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{assertSync}from"@componentor/quickjs-ffi-types";var QuickJSAsyncFFI=class{constructor(module){this.module=module;this.DEBUG=!0;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_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=assertSync(this.module.cwrap("QTS_GetSymbolDescriptionOrKey","number",["number","number"]));this.QTS_GetSymbolDescriptionOrKey_MaybeAsync=this.module.cwrap("QTS_GetSymbolDescriptionOrKey","number",["number","number"],{async:!0});this.QTS_IsGlobalSymbol=this.module.cwrap("QTS_IsGlobalSymbol","number",["number","number"]);this.QTS_IsJobPending=this.module.cwrap("QTS_IsJobPending","number",["number"]);this.QTS_ExecutePendingJob=assertSync(this.module.cwrap("QTS_ExecutePendingJob","number",["number","number","number"]));this.QTS_ExecutePendingJob_MaybeAsync=this.module.cwrap("QTS_ExecutePendingJob","number",["number","number","number"],{async:!0});this.QTS_GetProp=assertSync(this.module.cwrap("QTS_GetProp","number",["number","number","number"]));this.QTS_GetProp_MaybeAsync=this.module.cwrap("QTS_GetProp","number",["number","number","number"],{async:!0});this.QTS_GetPropNumber=assertSync(this.module.cwrap("QTS_GetPropNumber","number",["number","number","number"]));this.QTS_GetPropNumber_MaybeAsync=this.module.cwrap("QTS_GetPropNumber","number",["number","number","number"],{async:!0});this.QTS_SetProp=assertSync(this.module.cwrap("QTS_SetProp",null,["number","number","number","number"]));this.QTS_SetProp_MaybeAsync=this.module.cwrap("QTS_SetProp",null,["number","number","number","number"],{async:!0});this.QTS_DefineProp=this.module.cwrap("QTS_DefineProp",null,["number","number","number","number","number","number","boolean","boolean","boolean"]);this.QTS_GetOwnPropertyNames=assertSync(this.module.cwrap("QTS_GetOwnPropertyNames","number",["number","number","number","number","number"]));this.QTS_GetOwnPropertyNames_MaybeAsync=this.module.cwrap("QTS_GetOwnPropertyNames","number",["number","number","number","number","number"],{async:!0});this.QTS_Call=assertSync(this.module.cwrap("QTS_Call","number",["number","number","number","number","number"]));this.QTS_Call_MaybeAsync=this.module.cwrap("QTS_Call","number",["number","number","number","number","number"],{async:!0});this.QTS_ResolveException=this.module.cwrap("QTS_ResolveException","number",["number","number"]);this.QTS_Dump=assertSync(this.module.cwrap("QTS_Dump","number",["number","number"]));this.QTS_Dump_MaybeAsync=this.module.cwrap("QTS_Dump","number",["number","number"],{async:!0});this.QTS_Eval=assertSync(this.module.cwrap("QTS_Eval","number",["number","number","number","string","number","number"]));this.QTS_Eval_MaybeAsync=this.module.cwrap("QTS_Eval","number",["number","number","number","string","number","number"],{async:!0});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","number","string"]);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"]);this.QTS_EvalFunction=assertSync(this.module.cwrap("QTS_EvalFunction","number",["number","number"]));this.QTS_EvalFunction_MaybeAsync=this.module.cwrap("QTS_EvalFunction","number",["number","number"],{async:!0});this.QTS_EncodeBytecode=this.module.cwrap("QTS_EncodeBytecode","number",["number","number"]);this.QTS_DecodeBytecode=this.module.cwrap("QTS_DecodeBytecode","number",["number","number"])}};export{QuickJSAsyncFFI};
|
|
2
|
+
//# sourceMappingURL=ffi.mjs.map
|
package/dist/ffi.mjs.map
ADDED
|
@@ -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 QuickJSAsyncEmscriptenModule,\n JSRuntimePointer,\n JSContextPointer,\n JSContextPointerPointer,\n JSModuleDefPointer,\n JSValuePointer,\n JSValueConstPointer,\n JSValuePointerPointer,\n JSValuePointerPointerPointer,\n JSValueConstPointerPointer,\n QTS_C_To_HostCallbackFuncPointer,\n QTS_C_To_HostInterruptFuncPointer,\n QTS_C_To_HostLoadModuleFuncPointer,\n BorrowedHeapCharPointer,\n OwnedHeapCharPointer,\n JSBorrowedCharPointer,\n JSVoidPointer,\n UInt32Pointer,\n EvalFlags,\n IntrinsicsFlags,\n EvalDetectModule,\n GetOwnPropertyNamesFlags,\n IsEqualOp,\n JSPromiseStateEnum,\n assertSync,\n} from \"@componentor/quickjs-ffi-types\"\n\n/**\n * Low-level FFI bindings to QuickJS's Emscripten module.\n * See instead {@link QuickJSContext}, the public Javascript interface exposed by this\n * library.\n *\n * @unstable The FFI interface is considered private and may change.\n */\nexport class QuickJSAsyncFFI {\n constructor(private module: QuickJSAsyncEmscriptenModule) {}\n /** Set at compile time. */\n readonly DEBUG = true\n\n QTS_Throw: (\n ctx: JSContextPointer,\n error: JSValuePointer | JSValueConstPointer,\n ) => JSValuePointer = this.module.cwrap(\"QTS_Throw\", \"number\", [\"number\", \"number\"])\n\n QTS_NewError: (ctx: JSContextPointer) => JSValuePointer = this.module.cwrap(\n \"QTS_NewError\",\n \"number\",\n [\"number\"],\n )\n\n QTS_RuntimeSetMemoryLimit: (rt: JSRuntimePointer, limit: number) => void = this.module.cwrap(\n \"QTS_RuntimeSetMemoryLimit\",\n null,\n [\"number\", \"number\"],\n )\n\n QTS_RuntimeComputeMemoryUsage: (rt: JSRuntimePointer, ctx: JSContextPointer) => JSValuePointer =\n this.module.cwrap(\"QTS_RuntimeComputeMemoryUsage\", \"number\", [\"number\", \"number\"])\n\n QTS_RuntimeDumpMemoryUsage: (rt: JSRuntimePointer) => OwnedHeapCharPointer = this.module.cwrap(\n \"QTS_RuntimeDumpMemoryUsage\",\n \"number\",\n [\"number\"],\n )\n\n QTS_RecoverableLeakCheck: () => number = this.module.cwrap(\n \"QTS_RecoverableLeakCheck\",\n \"number\",\n [],\n )\n\n QTS_BuildIsSanitizeLeak: () => number = this.module.cwrap(\"QTS_BuildIsSanitizeLeak\", \"number\", [])\n\n QTS_RuntimeSetMaxStackSize: (rt: JSRuntimePointer, stack_size: number) => void =\n this.module.cwrap(\"QTS_RuntimeSetMaxStackSize\", null, [\"number\", \"number\"])\n\n QTS_GetUndefined: () => JSValueConstPointer = this.module.cwrap(\"QTS_GetUndefined\", \"number\", [])\n\n QTS_GetNull: () => JSValueConstPointer = this.module.cwrap(\"QTS_GetNull\", \"number\", [])\n\n QTS_GetFalse: () => JSValueConstPointer = this.module.cwrap(\"QTS_GetFalse\", \"number\", [])\n\n QTS_GetTrue: () => JSValueConstPointer = this.module.cwrap(\"QTS_GetTrue\", \"number\", [])\n\n QTS_NewRuntime: () => JSRuntimePointer = this.module.cwrap(\"QTS_NewRuntime\", \"number\", [])\n\n QTS_FreeRuntime: (rt: JSRuntimePointer) => void = this.module.cwrap(\"QTS_FreeRuntime\", null, [\n \"number\",\n ])\n\n QTS_NewContext: (rt: JSRuntimePointer, intrinsics: IntrinsicsFlags) => JSContextPointer =\n this.module.cwrap(\"QTS_NewContext\", \"number\", [\"number\", \"number\"])\n\n QTS_FreeContext: (ctx: JSContextPointer) => void = this.module.cwrap(\"QTS_FreeContext\", null, [\n \"number\",\n ])\n\n QTS_FreeValuePointer: (ctx: JSContextPointer, value: JSValuePointer) => void = this.module.cwrap(\n \"QTS_FreeValuePointer\",\n null,\n [\"number\", \"number\"],\n )\n\n QTS_FreeValuePointerRuntime: (rt: JSRuntimePointer, value: JSValuePointer) => void =\n this.module.cwrap(\"QTS_FreeValuePointerRuntime\", null, [\"number\", \"number\"])\n\n QTS_FreeVoidPointer: (ctx: JSContextPointer, ptr: JSVoidPointer) => void = this.module.cwrap(\n \"QTS_FreeVoidPointer\",\n null,\n [\"number\", \"number\"],\n )\n\n QTS_FreeCString: (ctx: JSContextPointer, str: JSBorrowedCharPointer) => void = this.module.cwrap(\n \"QTS_FreeCString\",\n null,\n [\"number\", \"number\"],\n )\n\n QTS_DupValuePointer: (\n ctx: JSContextPointer,\n val: JSValuePointer | JSValueConstPointer,\n ) => JSValuePointer = this.module.cwrap(\"QTS_DupValuePointer\", \"number\", [\"number\", \"number\"])\n\n QTS_NewObject: (ctx: JSContextPointer) => JSValuePointer = this.module.cwrap(\n \"QTS_NewObject\",\n \"number\",\n [\"number\"],\n )\n\n QTS_NewObjectProto: (\n ctx: JSContextPointer,\n proto: JSValuePointer | JSValueConstPointer,\n ) => JSValuePointer = this.module.cwrap(\"QTS_NewObjectProto\", \"number\", [\"number\", \"number\"])\n\n QTS_NewArray: (ctx: JSContextPointer) => JSValuePointer = this.module.cwrap(\n \"QTS_NewArray\",\n \"number\",\n [\"number\"],\n )\n\n QTS_NewArrayBuffer: (\n ctx: JSContextPointer,\n buffer: JSVoidPointer,\n length: number,\n ) => JSValuePointer = this.module.cwrap(\"QTS_NewArrayBuffer\", \"number\", [\n \"number\",\n \"number\",\n \"number\",\n ])\n\n QTS_NewFloat64: (ctx: JSContextPointer, num: number) => JSValuePointer = this.module.cwrap(\n \"QTS_NewFloat64\",\n \"number\",\n [\"number\", \"number\"],\n )\n\n QTS_GetFloat64: (ctx: JSContextPointer, value: JSValuePointer | JSValueConstPointer) => number =\n this.module.cwrap(\"QTS_GetFloat64\", \"number\", [\"number\", \"number\"])\n\n QTS_NewString: (ctx: JSContextPointer, string: BorrowedHeapCharPointer) => JSValuePointer =\n this.module.cwrap(\"QTS_NewString\", \"number\", [\"number\", \"number\"])\n\n QTS_GetString: (\n ctx: JSContextPointer,\n value: JSValuePointer | JSValueConstPointer,\n ) => JSBorrowedCharPointer = this.module.cwrap(\"QTS_GetString\", \"number\", [\"number\", \"number\"])\n\n QTS_GetArrayBuffer: (\n ctx: JSContextPointer,\n data: JSValuePointer | JSValueConstPointer,\n ) => JSVoidPointer = this.module.cwrap(\"QTS_GetArrayBuffer\", \"number\", [\"number\", \"number\"])\n\n QTS_GetArrayBufferLength: (\n ctx: JSContextPointer,\n data: JSValuePointer | JSValueConstPointer,\n ) => number = this.module.cwrap(\"QTS_GetArrayBufferLength\", \"number\", [\"number\", \"number\"])\n\n QTS_NewSymbol: (\n ctx: JSContextPointer,\n description: BorrowedHeapCharPointer,\n isGlobal: number,\n ) => JSValuePointer = this.module.cwrap(\"QTS_NewSymbol\", \"number\", [\"number\", \"number\", \"number\"])\n\n QTS_GetSymbolDescriptionOrKey: (\n ctx: JSContextPointer,\n value: JSValuePointer | JSValueConstPointer,\n ) => JSBorrowedCharPointer = assertSync(\n this.module.cwrap(\"QTS_GetSymbolDescriptionOrKey\", \"number\", [\"number\", \"number\"]),\n )\n\n QTS_GetSymbolDescriptionOrKey_MaybeAsync: (\n ctx: JSContextPointer,\n value: JSValuePointer | JSValueConstPointer,\n ) => JSBorrowedCharPointer | Promise<JSBorrowedCharPointer> = this.module.cwrap(\n \"QTS_GetSymbolDescriptionOrKey\",\n \"number\",\n [\"number\", \"number\"],\n { async: true },\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 = assertSync(\n this.module.cwrap(\"QTS_ExecutePendingJob\", \"number\", [\"number\", \"number\", \"number\"]),\n )\n\n QTS_ExecutePendingJob_MaybeAsync: (\n rt: JSRuntimePointer,\n maxJobsToExecute: number,\n lastJobContext: JSContextPointerPointer,\n ) => JSValuePointer | Promise<JSValuePointer> = this.module.cwrap(\n \"QTS_ExecutePendingJob\",\n \"number\",\n [\"number\", \"number\", \"number\"],\n { async: true },\n )\n\n QTS_GetProp: (\n ctx: JSContextPointer,\n this_val: JSValuePointer | JSValueConstPointer,\n prop_name: JSValuePointer | JSValueConstPointer,\n ) => JSValuePointer = assertSync(\n this.module.cwrap(\"QTS_GetProp\", \"number\", [\"number\", \"number\", \"number\"]),\n )\n\n QTS_GetProp_MaybeAsync: (\n ctx: JSContextPointer,\n this_val: JSValuePointer | JSValueConstPointer,\n prop_name: JSValuePointer | JSValueConstPointer,\n ) => JSValuePointer | Promise<JSValuePointer> = this.module.cwrap(\n \"QTS_GetProp\",\n \"number\",\n [\"number\", \"number\", \"number\"],\n { async: true },\n )\n\n QTS_GetPropNumber: (\n ctx: JSContextPointer,\n this_val: JSValuePointer | JSValueConstPointer,\n prop_name: number,\n ) => JSValuePointer = assertSync(\n this.module.cwrap(\"QTS_GetPropNumber\", \"number\", [\"number\", \"number\", \"number\"]),\n )\n\n QTS_GetPropNumber_MaybeAsync: (\n ctx: JSContextPointer,\n this_val: JSValuePointer | JSValueConstPointer,\n prop_name: number,\n ) => JSValuePointer | Promise<JSValuePointer> = this.module.cwrap(\n \"QTS_GetPropNumber\",\n \"number\",\n [\"number\", \"number\", \"number\"],\n { async: true },\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 = assertSync(\n this.module.cwrap(\"QTS_SetProp\", null, [\"number\", \"number\", \"number\", \"number\"]),\n )\n\n QTS_SetProp_MaybeAsync: (\n ctx: JSContextPointer,\n this_val: JSValuePointer | JSValueConstPointer,\n prop_name: JSValuePointer | JSValueConstPointer,\n prop_value: JSValuePointer | JSValueConstPointer,\n ) => void | Promise<void> = this.module.cwrap(\n \"QTS_SetProp\",\n null,\n [\"number\", \"number\", \"number\", \"number\"],\n { async: true },\n )\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 = assertSync(\n this.module.cwrap(\"QTS_GetOwnPropertyNames\", \"number\", [\n \"number\",\n \"number\",\n \"number\",\n \"number\",\n \"number\",\n ]),\n )\n\n QTS_GetOwnPropertyNames_MaybeAsync: (\n ctx: JSContextPointer,\n out_ptrs: JSValuePointerPointerPointer,\n out_len: UInt32Pointer,\n obj: JSValuePointer | JSValueConstPointer,\n flags: number,\n ) => JSValuePointer | Promise<JSValuePointer> = this.module.cwrap(\n \"QTS_GetOwnPropertyNames\",\n \"number\",\n [\"number\", \"number\", \"number\", \"number\", \"number\"],\n { async: true },\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 = assertSync(\n this.module.cwrap(\"QTS_Call\", \"number\", [\"number\", \"number\", \"number\", \"number\", \"number\"]),\n )\n\n QTS_Call_MaybeAsync: (\n ctx: JSContextPointer,\n func_obj: JSValuePointer | JSValueConstPointer,\n this_obj: JSValuePointer | JSValueConstPointer,\n argc: number,\n argv_ptrs: JSValueConstPointerPointer,\n ) => JSValuePointer | Promise<JSValuePointer> = this.module.cwrap(\n \"QTS_Call\",\n \"number\",\n [\"number\", \"number\", \"number\", \"number\", \"number\"],\n { async: true },\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 = assertSync(\n this.module.cwrap(\"QTS_Dump\", \"number\", [\"number\", \"number\"]),\n )\n\n QTS_Dump_MaybeAsync: (\n ctx: JSContextPointer,\n obj: JSValuePointer | JSValueConstPointer,\n ) => JSBorrowedCharPointer | Promise<JSBorrowedCharPointer> = this.module.cwrap(\n \"QTS_Dump\",\n \"number\",\n [\"number\", \"number\"],\n { async: true },\n )\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 = assertSync(\n this.module.cwrap(\"QTS_Eval\", \"number\", [\n \"number\",\n \"number\",\n \"number\",\n \"string\",\n \"number\",\n \"number\",\n ]),\n )\n\n QTS_Eval_MaybeAsync: (\n ctx: JSContextPointer,\n js_code: BorrowedHeapCharPointer,\n js_code_length: number,\n filename: string,\n detectModule: EvalDetectModule,\n evalFlags: EvalFlags,\n ) => JSValuePointer | Promise<JSValuePointer> = this.module.cwrap(\n \"QTS_Eval\",\n \"number\",\n [\"number\", \"number\", \"number\", \"string\", \"number\", \"number\"],\n { async: true },\n )\n\n QTS_GetModuleNamespace: (\n ctx: JSContextPointer,\n module_func_obj: JSValuePointer | JSValueConstPointer,\n ) => JSValuePointer = this.module.cwrap(\"QTS_GetModuleNamespace\", \"number\", [\"number\", \"number\"])\n\n QTS_Typeof: (\n ctx: JSContextPointer,\n value: JSValuePointer | JSValueConstPointer,\n ) => OwnedHeapCharPointer = this.module.cwrap(\"QTS_Typeof\", \"number\", [\"number\", \"number\"])\n\n QTS_GetLength: (\n ctx: JSContextPointer,\n out_len: UInt32Pointer,\n value: JSValuePointer | JSValueConstPointer,\n ) => number = this.module.cwrap(\"QTS_GetLength\", \"number\", [\"number\", \"number\", \"number\"])\n\n QTS_IsEqual: (\n ctx: JSContextPointer,\n a: JSValuePointer | JSValueConstPointer,\n b: JSValuePointer | JSValueConstPointer,\n op: IsEqualOp,\n ) => number = this.module.cwrap(\"QTS_IsEqual\", \"number\", [\"number\", \"number\", \"number\", \"number\"])\n\n QTS_GetGlobalObject: (ctx: JSContextPointer) => JSValuePointer = this.module.cwrap(\n \"QTS_GetGlobalObject\",\n \"number\",\n [\"number\"],\n )\n\n QTS_NewPromiseCapability: (\n ctx: JSContextPointer,\n resolve_funcs_out: JSValuePointerPointer,\n ) => JSValuePointer = this.module.cwrap(\"QTS_NewPromiseCapability\", \"number\", [\n \"number\",\n \"number\",\n ])\n\n QTS_PromiseState: (\n ctx: JSContextPointer,\n promise: JSValuePointer | JSValueConstPointer,\n ) => JSPromiseStateEnum = this.module.cwrap(\"QTS_PromiseState\", \"number\", [\"number\", \"number\"])\n\n QTS_PromiseResult: (\n ctx: JSContextPointer,\n promise: JSValuePointer | JSValueConstPointer,\n ) => JSValuePointer = this.module.cwrap(\"QTS_PromiseResult\", \"number\", [\"number\", \"number\"])\n\n QTS_TestStringArg: (string: string) => void = this.module.cwrap(\"QTS_TestStringArg\", null, [\n \"string\",\n ])\n\n QTS_GetDebugLogEnabled: (rt: JSRuntimePointer) => number = this.module.cwrap(\n \"QTS_GetDebugLogEnabled\",\n \"number\",\n [\"number\"],\n )\n\n QTS_SetDebugLogEnabled: (rt: JSRuntimePointer, is_enabled: number) => void = this.module.cwrap(\n \"QTS_SetDebugLogEnabled\",\n null,\n [\"number\", \"number\"],\n )\n\n QTS_BuildIsDebug: () => number = this.module.cwrap(\"QTS_BuildIsDebug\", \"number\", [])\n\n QTS_BuildIsAsyncify: () => number = this.module.cwrap(\"QTS_BuildIsAsyncify\", \"number\", [])\n\n QTS_NewFunction: (ctx: JSContextPointer, func_id: number, name: string) => JSValuePointer =\n this.module.cwrap(\"QTS_NewFunction\", \"number\", [\"number\", \"number\", \"string\"])\n\n QTS_ArgvGetJSValueConstPointer: (\n argv: JSValuePointer | JSValueConstPointer,\n index: number,\n ) => JSValueConstPointer = this.module.cwrap(\"QTS_ArgvGetJSValueConstPointer\", \"number\", [\n \"number\",\n \"number\",\n ])\n\n QTS_RuntimeEnableInterruptHandler: (rt: JSRuntimePointer) => void = this.module.cwrap(\n \"QTS_RuntimeEnableInterruptHandler\",\n null,\n [\"number\"],\n )\n\n QTS_RuntimeDisableInterruptHandler: (rt: JSRuntimePointer) => void = this.module.cwrap(\n \"QTS_RuntimeDisableInterruptHandler\",\n null,\n [\"number\"],\n )\n\n QTS_RuntimeEnableModuleLoader: (rt: JSRuntimePointer, use_custom_normalize: number) => void =\n this.module.cwrap(\"QTS_RuntimeEnableModuleLoader\", null, [\"number\", \"number\"])\n\n QTS_RuntimeDisableModuleLoader: (rt: JSRuntimePointer) => void = this.module.cwrap(\n \"QTS_RuntimeDisableModuleLoader\",\n null,\n [\"number\"],\n )\n\n QTS_bjson_encode: (\n ctx: JSContextPointer,\n val: JSValuePointer | JSValueConstPointer,\n ) => JSValuePointer = this.module.cwrap(\"QTS_bjson_encode\", \"number\", [\"number\", \"number\"])\n\n QTS_bjson_decode: (\n ctx: JSContextPointer,\n data: JSValuePointer | JSValueConstPointer,\n ) => JSValuePointer = this.module.cwrap(\"QTS_bjson_decode\", \"number\", [\"number\", \"number\"])\n\n QTS_EvalFunction: (\n ctx: JSContextPointer,\n fun_obj: JSValuePointer | JSValueConstPointer,\n ) => JSValuePointer = assertSync(\n this.module.cwrap(\"QTS_EvalFunction\", \"number\", [\"number\", \"number\"]),\n )\n\n QTS_EvalFunction_MaybeAsync: (\n ctx: JSContextPointer,\n fun_obj: JSValuePointer | JSValueConstPointer,\n ) => JSValuePointer | Promise<JSValuePointer> = this.module.cwrap(\n \"QTS_EvalFunction\",\n \"number\",\n [\"number\", \"number\"],\n { async: true },\n )\n\n QTS_EncodeBytecode: (\n ctx: JSContextPointer,\n val: JSValuePointer | JSValueConstPointer,\n ) => JSValuePointer = this.module.cwrap(\"QTS_EncodeBytecode\", \"number\", [\"number\", \"number\"])\n\n QTS_DecodeBytecode: (\n ctx: JSContextPointer,\n data: JSValuePointer | JSValueConstPointer,\n ) => JSValuePointer = this.module.cwrap(\"QTS_DecodeBytecode\", \"number\", [\"number\", \"number\"])\n}\n"],"mappings":"AACA,OAyBE,eACK,iCASA,IAAM,gBAAN,KAAsB,CAC3B,YAAoB,OAAsC,CAAtC,mBAEpB,KAAS,MAAQ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|
5
|
+
*
|
|
6
|
+
* [Docs](https://github.com/componentor/quickjs-emscripten/blob/main/doc/@componentor/quickjs-wasmfile-debug-asyncify/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 [2024-02-14+36911f0d](https://github.com/bellard/quickjs/commit/36911f0d3ab1a4c190a4d5cbe7c2db225a455389) vendored to quickjs-emscripten on 2024-06-15. |
|
|
12
|
+
* | releaseMode | debug | Enables assertions and memory sanitizers. Try to run your tests against debug variants, in addition to your preferred production variant, to catch more bugs. |
|
|
13
|
+
* | syncMode | asyncify | Build run through the ASYNCIFY WebAssembly transform. This imposes substantial size (2x the size of sync) and speed penalties (40% the speed of sync). In return, allows synchronous calls from the QuickJS WASM runtime to async functions on the host. The extra magic makes this variant slower than sync variants. Note that both variants support regular async functions. Only adopt ASYNCIFY if you need to! The [QuickJSAsyncRuntime](https://github.com/componentor/quickjs-emscripten/blob/main/doc/quickjs-emscripten/classes/QuickJSAsyncRuntime.md) and [QuickJSAsyncContext](https://github.com/componentor/quickjs-emscripten/blob/main/doc/quickjs-emscripten/classes/QuickJSAsyncContext.md) classes expose the ASYNCIFY-specific APIs. |
|
|
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: QuickJSAsyncVariant;
|
|
19
|
+
|
|
20
|
+
export { variant as default };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { QuickJSAsyncVariant } from '@componentor/quickjs-ffi-types';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* ### @componentor/quickjs-wasmfile-debug-asyncify
|
|
5
|
+
*
|
|
6
|
+
* [Docs](https://github.com/componentor/quickjs-emscripten/blob/main/doc/@componentor/quickjs-wasmfile-debug-asyncify/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 [2024-02-14+36911f0d](https://github.com/bellard/quickjs/commit/36911f0d3ab1a4c190a4d5cbe7c2db225a455389) vendored to quickjs-emscripten on 2024-06-15. |
|
|
12
|
+
* | releaseMode | debug | Enables assertions and memory sanitizers. Try to run your tests against debug variants, in addition to your preferred production variant, to catch more bugs. |
|
|
13
|
+
* | syncMode | asyncify | Build run through the ASYNCIFY WebAssembly transform. This imposes substantial size (2x the size of sync) and speed penalties (40% the speed of sync). In return, allows synchronous calls from the QuickJS WASM runtime to async functions on the host. The extra magic makes this variant slower than sync variants. Note that both variants support regular async functions. Only adopt ASYNCIFY if you need to! The [QuickJSAsyncRuntime](https://github.com/componentor/quickjs-emscripten/blob/main/doc/quickjs-emscripten/classes/QuickJSAsyncRuntime.md) and [QuickJSAsyncContext](https://github.com/componentor/quickjs-emscripten/blob/main/doc/quickjs-emscripten/classes/QuickJSAsyncContext.md) classes expose the ASYNCIFY-specific APIs. |
|
|
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: QuickJSAsyncVariant;
|
|
19
|
+
|
|
20
|
+
export { variant as default };
|
package/dist/index.js
ADDED
|
@@ -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,{QuickJSAsyncFFI:()=>QuickJSAsyncFFI});var import_quickjs_ffi_types,QuickJSAsyncFFI,init_ffi=__esm({"src/ffi.ts"(){"use strict";import_quickjs_ffi_types=require("@componentor/quickjs-ffi-types"),QuickJSAsyncFFI=class{constructor(module2){this.module=module2;this.DEBUG=!0;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_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=(0,import_quickjs_ffi_types.assertSync)(this.module.cwrap("QTS_GetSymbolDescriptionOrKey","number",["number","number"]));this.QTS_GetSymbolDescriptionOrKey_MaybeAsync=this.module.cwrap("QTS_GetSymbolDescriptionOrKey","number",["number","number"],{async:!0});this.QTS_IsGlobalSymbol=this.module.cwrap("QTS_IsGlobalSymbol","number",["number","number"]);this.QTS_IsJobPending=this.module.cwrap("QTS_IsJobPending","number",["number"]);this.QTS_ExecutePendingJob=(0,import_quickjs_ffi_types.assertSync)(this.module.cwrap("QTS_ExecutePendingJob","number",["number","number","number"]));this.QTS_ExecutePendingJob_MaybeAsync=this.module.cwrap("QTS_ExecutePendingJob","number",["number","number","number"],{async:!0});this.QTS_GetProp=(0,import_quickjs_ffi_types.assertSync)(this.module.cwrap("QTS_GetProp","number",["number","number","number"]));this.QTS_GetProp_MaybeAsync=this.module.cwrap("QTS_GetProp","number",["number","number","number"],{async:!0});this.QTS_GetPropNumber=(0,import_quickjs_ffi_types.assertSync)(this.module.cwrap("QTS_GetPropNumber","number",["number","number","number"]));this.QTS_GetPropNumber_MaybeAsync=this.module.cwrap("QTS_GetPropNumber","number",["number","number","number"],{async:!0});this.QTS_SetProp=(0,import_quickjs_ffi_types.assertSync)(this.module.cwrap("QTS_SetProp",null,["number","number","number","number"]));this.QTS_SetProp_MaybeAsync=this.module.cwrap("QTS_SetProp",null,["number","number","number","number"],{async:!0});this.QTS_DefineProp=this.module.cwrap("QTS_DefineProp",null,["number","number","number","number","number","number","boolean","boolean","boolean"]);this.QTS_GetOwnPropertyNames=(0,import_quickjs_ffi_types.assertSync)(this.module.cwrap("QTS_GetOwnPropertyNames","number",["number","number","number","number","number"]));this.QTS_GetOwnPropertyNames_MaybeAsync=this.module.cwrap("QTS_GetOwnPropertyNames","number",["number","number","number","number","number"],{async:!0});this.QTS_Call=(0,import_quickjs_ffi_types.assertSync)(this.module.cwrap("QTS_Call","number",["number","number","number","number","number"]));this.QTS_Call_MaybeAsync=this.module.cwrap("QTS_Call","number",["number","number","number","number","number"],{async:!0});this.QTS_ResolveException=this.module.cwrap("QTS_ResolveException","number",["number","number"]);this.QTS_Dump=(0,import_quickjs_ffi_types.assertSync)(this.module.cwrap("QTS_Dump","number",["number","number"]));this.QTS_Dump_MaybeAsync=this.module.cwrap("QTS_Dump","number",["number","number"],{async:!0});this.QTS_Eval=(0,import_quickjs_ffi_types.assertSync)(this.module.cwrap("QTS_Eval","number",["number","number","number","string","number","number"]));this.QTS_Eval_MaybeAsync=this.module.cwrap("QTS_Eval","number",["number","number","number","string","number","number"],{async:!0});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","number","string"]);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"]);this.QTS_EvalFunction=(0,import_quickjs_ffi_types.assertSync)(this.module.cwrap("QTS_EvalFunction","number",["number","number"]));this.QTS_EvalFunction_MaybeAsync=this.module.cwrap("QTS_EvalFunction","number",["number","number"],{async:!0});this.QTS_EncodeBytecode=this.module.cwrap("QTS_EncodeBytecode","number",["number","number"]);this.QTS_DecodeBytecode=this.module.cwrap("QTS_DecodeBytecode","number",["number","number"])}}}});var index_exports={};__export(index_exports,{default:()=>index_default});module.exports=__toCommonJS(index_exports);var variant={type:"async",importFFI:()=>Promise.resolve().then(()=>(init_ffi(),ffi_exports)).then(mod=>mod.QuickJSAsyncFFI),importModuleLoader:()=>import("@componentor/quickjs-wasmfile-debug-asyncify/emscripten-module").then(mod=>mod.default)},index_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 QuickJSAsyncEmscriptenModule,\n JSRuntimePointer,\n JSContextPointer,\n JSContextPointerPointer,\n JSModuleDefPointer,\n JSValuePointer,\n JSValueConstPointer,\n JSValuePointerPointer,\n JSValuePointerPointerPointer,\n JSValueConstPointerPointer,\n QTS_C_To_HostCallbackFuncPointer,\n QTS_C_To_HostInterruptFuncPointer,\n QTS_C_To_HostLoadModuleFuncPointer,\n BorrowedHeapCharPointer,\n OwnedHeapCharPointer,\n JSBorrowedCharPointer,\n JSVoidPointer,\n UInt32Pointer,\n EvalFlags,\n IntrinsicsFlags,\n EvalDetectModule,\n GetOwnPropertyNamesFlags,\n IsEqualOp,\n JSPromiseStateEnum,\n assertSync,\n} from \"@componentor/quickjs-ffi-types\"\n\n/**\n * Low-level FFI bindings to QuickJS's Emscripten module.\n * See instead {@link QuickJSContext}, the public Javascript interface exposed by this\n * library.\n *\n * @unstable The FFI interface is considered private and may change.\n */\nexport class QuickJSAsyncFFI {\n constructor(private module: QuickJSAsyncEmscriptenModule) {}\n /** Set at compile time. */\n readonly DEBUG = true\n\n QTS_Throw: (\n ctx: JSContextPointer,\n error: JSValuePointer | JSValueConstPointer,\n ) => JSValuePointer = this.module.cwrap(\"QTS_Throw\", \"number\", [\"number\", \"number\"])\n\n QTS_NewError: (ctx: JSContextPointer) => JSValuePointer = this.module.cwrap(\n \"QTS_NewError\",\n \"number\",\n [\"number\"],\n )\n\n QTS_RuntimeSetMemoryLimit: (rt: JSRuntimePointer, limit: number) => void = this.module.cwrap(\n \"QTS_RuntimeSetMemoryLimit\",\n null,\n [\"number\", \"number\"],\n )\n\n QTS_RuntimeComputeMemoryUsage: (rt: JSRuntimePointer, ctx: JSContextPointer) => JSValuePointer =\n this.module.cwrap(\"QTS_RuntimeComputeMemoryUsage\", \"number\", [\"number\", \"number\"])\n\n QTS_RuntimeDumpMemoryUsage: (rt: JSRuntimePointer) => OwnedHeapCharPointer = this.module.cwrap(\n \"QTS_RuntimeDumpMemoryUsage\",\n \"number\",\n [\"number\"],\n )\n\n QTS_RecoverableLeakCheck: () => number = this.module.cwrap(\n \"QTS_RecoverableLeakCheck\",\n \"number\",\n [],\n )\n\n QTS_BuildIsSanitizeLeak: () => number = this.module.cwrap(\"QTS_BuildIsSanitizeLeak\", \"number\", [])\n\n QTS_RuntimeSetMaxStackSize: (rt: JSRuntimePointer, stack_size: number) => void =\n this.module.cwrap(\"QTS_RuntimeSetMaxStackSize\", null, [\"number\", \"number\"])\n\n QTS_GetUndefined: () => JSValueConstPointer = this.module.cwrap(\"QTS_GetUndefined\", \"number\", [])\n\n QTS_GetNull: () => JSValueConstPointer = this.module.cwrap(\"QTS_GetNull\", \"number\", [])\n\n QTS_GetFalse: () => JSValueConstPointer = this.module.cwrap(\"QTS_GetFalse\", \"number\", [])\n\n QTS_GetTrue: () => JSValueConstPointer = this.module.cwrap(\"QTS_GetTrue\", \"number\", [])\n\n QTS_NewRuntime: () => JSRuntimePointer = this.module.cwrap(\"QTS_NewRuntime\", \"number\", [])\n\n QTS_FreeRuntime: (rt: JSRuntimePointer) => void = this.module.cwrap(\"QTS_FreeRuntime\", null, [\n \"number\",\n ])\n\n QTS_NewContext: (rt: JSRuntimePointer, intrinsics: IntrinsicsFlags) => JSContextPointer =\n this.module.cwrap(\"QTS_NewContext\", \"number\", [\"number\", \"number\"])\n\n QTS_FreeContext: (ctx: JSContextPointer) => void = this.module.cwrap(\"QTS_FreeContext\", null, [\n \"number\",\n ])\n\n QTS_FreeValuePointer: (ctx: JSContextPointer, value: JSValuePointer) => void = this.module.cwrap(\n \"QTS_FreeValuePointer\",\n null,\n [\"number\", \"number\"],\n )\n\n QTS_FreeValuePointerRuntime: (rt: JSRuntimePointer, value: JSValuePointer) => void =\n this.module.cwrap(\"QTS_FreeValuePointerRuntime\", null, [\"number\", \"number\"])\n\n QTS_FreeVoidPointer: (ctx: JSContextPointer, ptr: JSVoidPointer) => void = this.module.cwrap(\n \"QTS_FreeVoidPointer\",\n null,\n [\"number\", \"number\"],\n )\n\n QTS_FreeCString: (ctx: JSContextPointer, str: JSBorrowedCharPointer) => void = this.module.cwrap(\n \"QTS_FreeCString\",\n null,\n [\"number\", \"number\"],\n )\n\n QTS_DupValuePointer: (\n ctx: JSContextPointer,\n val: JSValuePointer | JSValueConstPointer,\n ) => JSValuePointer = this.module.cwrap(\"QTS_DupValuePointer\", \"number\", [\"number\", \"number\"])\n\n QTS_NewObject: (ctx: JSContextPointer) => JSValuePointer = this.module.cwrap(\n \"QTS_NewObject\",\n \"number\",\n [\"number\"],\n )\n\n QTS_NewObjectProto: (\n ctx: JSContextPointer,\n proto: JSValuePointer | JSValueConstPointer,\n ) => JSValuePointer = this.module.cwrap(\"QTS_NewObjectProto\", \"number\", [\"number\", \"number\"])\n\n QTS_NewArray: (ctx: JSContextPointer) => JSValuePointer = this.module.cwrap(\n \"QTS_NewArray\",\n \"number\",\n [\"number\"],\n )\n\n QTS_NewArrayBuffer: (\n ctx: JSContextPointer,\n buffer: JSVoidPointer,\n length: number,\n ) => JSValuePointer = this.module.cwrap(\"QTS_NewArrayBuffer\", \"number\", [\n \"number\",\n \"number\",\n \"number\",\n ])\n\n QTS_NewFloat64: (ctx: JSContextPointer, num: number) => JSValuePointer = this.module.cwrap(\n \"QTS_NewFloat64\",\n \"number\",\n [\"number\", \"number\"],\n )\n\n QTS_GetFloat64: (ctx: JSContextPointer, value: JSValuePointer | JSValueConstPointer) => number =\n this.module.cwrap(\"QTS_GetFloat64\", \"number\", [\"number\", \"number\"])\n\n QTS_NewString: (ctx: JSContextPointer, string: BorrowedHeapCharPointer) => JSValuePointer =\n this.module.cwrap(\"QTS_NewString\", \"number\", [\"number\", \"number\"])\n\n QTS_GetString: (\n ctx: JSContextPointer,\n value: JSValuePointer | JSValueConstPointer,\n ) => JSBorrowedCharPointer = this.module.cwrap(\"QTS_GetString\", \"number\", [\"number\", \"number\"])\n\n QTS_GetArrayBuffer: (\n ctx: JSContextPointer,\n data: JSValuePointer | JSValueConstPointer,\n ) => JSVoidPointer = this.module.cwrap(\"QTS_GetArrayBuffer\", \"number\", [\"number\", \"number\"])\n\n QTS_GetArrayBufferLength: (\n ctx: JSContextPointer,\n data: JSValuePointer | JSValueConstPointer,\n ) => number = this.module.cwrap(\"QTS_GetArrayBufferLength\", \"number\", [\"number\", \"number\"])\n\n QTS_NewSymbol: (\n ctx: JSContextPointer,\n description: BorrowedHeapCharPointer,\n isGlobal: number,\n ) => JSValuePointer = this.module.cwrap(\"QTS_NewSymbol\", \"number\", [\"number\", \"number\", \"number\"])\n\n QTS_GetSymbolDescriptionOrKey: (\n ctx: JSContextPointer,\n value: JSValuePointer | JSValueConstPointer,\n ) => JSBorrowedCharPointer = assertSync(\n this.module.cwrap(\"QTS_GetSymbolDescriptionOrKey\", \"number\", [\"number\", \"number\"]),\n )\n\n QTS_GetSymbolDescriptionOrKey_MaybeAsync: (\n ctx: JSContextPointer,\n value: JSValuePointer | JSValueConstPointer,\n ) => JSBorrowedCharPointer | Promise<JSBorrowedCharPointer> = this.module.cwrap(\n \"QTS_GetSymbolDescriptionOrKey\",\n \"number\",\n [\"number\", \"number\"],\n { async: true },\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 = assertSync(\n this.module.cwrap(\"QTS_ExecutePendingJob\", \"number\", [\"number\", \"number\", \"number\"]),\n )\n\n QTS_ExecutePendingJob_MaybeAsync: (\n rt: JSRuntimePointer,\n maxJobsToExecute: number,\n lastJobContext: JSContextPointerPointer,\n ) => JSValuePointer | Promise<JSValuePointer> = this.module.cwrap(\n \"QTS_ExecutePendingJob\",\n \"number\",\n [\"number\", \"number\", \"number\"],\n { async: true },\n )\n\n QTS_GetProp: (\n ctx: JSContextPointer,\n this_val: JSValuePointer | JSValueConstPointer,\n prop_name: JSValuePointer | JSValueConstPointer,\n ) => JSValuePointer = assertSync(\n this.module.cwrap(\"QTS_GetProp\", \"number\", [\"number\", \"number\", \"number\"]),\n )\n\n QTS_GetProp_MaybeAsync: (\n ctx: JSContextPointer,\n this_val: JSValuePointer | JSValueConstPointer,\n prop_name: JSValuePointer | JSValueConstPointer,\n ) => JSValuePointer | Promise<JSValuePointer> = this.module.cwrap(\n \"QTS_GetProp\",\n \"number\",\n [\"number\", \"number\", \"number\"],\n { async: true },\n )\n\n QTS_GetPropNumber: (\n ctx: JSContextPointer,\n this_val: JSValuePointer | JSValueConstPointer,\n prop_name: number,\n ) => JSValuePointer = assertSync(\n this.module.cwrap(\"QTS_GetPropNumber\", \"number\", [\"number\", \"number\", \"number\"]),\n )\n\n QTS_GetPropNumber_MaybeAsync: (\n ctx: JSContextPointer,\n this_val: JSValuePointer | JSValueConstPointer,\n prop_name: number,\n ) => JSValuePointer | Promise<JSValuePointer> = this.module.cwrap(\n \"QTS_GetPropNumber\",\n \"number\",\n [\"number\", \"number\", \"number\"],\n { async: true },\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 = assertSync(\n this.module.cwrap(\"QTS_SetProp\", null, [\"number\", \"number\", \"number\", \"number\"]),\n )\n\n QTS_SetProp_MaybeAsync: (\n ctx: JSContextPointer,\n this_val: JSValuePointer | JSValueConstPointer,\n prop_name: JSValuePointer | JSValueConstPointer,\n prop_value: JSValuePointer | JSValueConstPointer,\n ) => void | Promise<void> = this.module.cwrap(\n \"QTS_SetProp\",\n null,\n [\"number\", \"number\", \"number\", \"number\"],\n { async: true },\n )\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 = assertSync(\n this.module.cwrap(\"QTS_GetOwnPropertyNames\", \"number\", [\n \"number\",\n \"number\",\n \"number\",\n \"number\",\n \"number\",\n ]),\n )\n\n QTS_GetOwnPropertyNames_MaybeAsync: (\n ctx: JSContextPointer,\n out_ptrs: JSValuePointerPointerPointer,\n out_len: UInt32Pointer,\n obj: JSValuePointer | JSValueConstPointer,\n flags: number,\n ) => JSValuePointer | Promise<JSValuePointer> = this.module.cwrap(\n \"QTS_GetOwnPropertyNames\",\n \"number\",\n [\"number\", \"number\", \"number\", \"number\", \"number\"],\n { async: true },\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 = assertSync(\n this.module.cwrap(\"QTS_Call\", \"number\", [\"number\", \"number\", \"number\", \"number\", \"number\"]),\n )\n\n QTS_Call_MaybeAsync: (\n ctx: JSContextPointer,\n func_obj: JSValuePointer | JSValueConstPointer,\n this_obj: JSValuePointer | JSValueConstPointer,\n argc: number,\n argv_ptrs: JSValueConstPointerPointer,\n ) => JSValuePointer | Promise<JSValuePointer> = this.module.cwrap(\n \"QTS_Call\",\n \"number\",\n [\"number\", \"number\", \"number\", \"number\", \"number\"],\n { async: true },\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 = assertSync(\n this.module.cwrap(\"QTS_Dump\", \"number\", [\"number\", \"number\"]),\n )\n\n QTS_Dump_MaybeAsync: (\n ctx: JSContextPointer,\n obj: JSValuePointer | JSValueConstPointer,\n ) => JSBorrowedCharPointer | Promise<JSBorrowedCharPointer> = this.module.cwrap(\n \"QTS_Dump\",\n \"number\",\n [\"number\", \"number\"],\n { async: true },\n )\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 = assertSync(\n this.module.cwrap(\"QTS_Eval\", \"number\", [\n \"number\",\n \"number\",\n \"number\",\n \"string\",\n \"number\",\n \"number\",\n ]),\n )\n\n QTS_Eval_MaybeAsync: (\n ctx: JSContextPointer,\n js_code: BorrowedHeapCharPointer,\n js_code_length: number,\n filename: string,\n detectModule: EvalDetectModule,\n evalFlags: EvalFlags,\n ) => JSValuePointer | Promise<JSValuePointer> = this.module.cwrap(\n \"QTS_Eval\",\n \"number\",\n [\"number\", \"number\", \"number\", \"string\", \"number\", \"number\"],\n { async: true },\n )\n\n QTS_GetModuleNamespace: (\n ctx: JSContextPointer,\n module_func_obj: JSValuePointer | JSValueConstPointer,\n ) => JSValuePointer = this.module.cwrap(\"QTS_GetModuleNamespace\", \"number\", [\"number\", \"number\"])\n\n QTS_Typeof: (\n ctx: JSContextPointer,\n value: JSValuePointer | JSValueConstPointer,\n ) => OwnedHeapCharPointer = this.module.cwrap(\"QTS_Typeof\", \"number\", [\"number\", \"number\"])\n\n QTS_GetLength: (\n ctx: JSContextPointer,\n out_len: UInt32Pointer,\n value: JSValuePointer | JSValueConstPointer,\n ) => number = this.module.cwrap(\"QTS_GetLength\", \"number\", [\"number\", \"number\", \"number\"])\n\n QTS_IsEqual: (\n ctx: JSContextPointer,\n a: JSValuePointer | JSValueConstPointer,\n b: JSValuePointer | JSValueConstPointer,\n op: IsEqualOp,\n ) => number = this.module.cwrap(\"QTS_IsEqual\", \"number\", [\"number\", \"number\", \"number\", \"number\"])\n\n QTS_GetGlobalObject: (ctx: JSContextPointer) => JSValuePointer = this.module.cwrap(\n \"QTS_GetGlobalObject\",\n \"number\",\n [\"number\"],\n )\n\n QTS_NewPromiseCapability: (\n ctx: JSContextPointer,\n resolve_funcs_out: JSValuePointerPointer,\n ) => JSValuePointer = this.module.cwrap(\"QTS_NewPromiseCapability\", \"number\", [\n \"number\",\n \"number\",\n ])\n\n QTS_PromiseState: (\n ctx: JSContextPointer,\n promise: JSValuePointer | JSValueConstPointer,\n ) => JSPromiseStateEnum = this.module.cwrap(\"QTS_PromiseState\", \"number\", [\"number\", \"number\"])\n\n QTS_PromiseResult: (\n ctx: JSContextPointer,\n promise: JSValuePointer | JSValueConstPointer,\n ) => JSValuePointer = this.module.cwrap(\"QTS_PromiseResult\", \"number\", [\"number\", \"number\"])\n\n QTS_TestStringArg: (string: string) => void = this.module.cwrap(\"QTS_TestStringArg\", null, [\n \"string\",\n ])\n\n QTS_GetDebugLogEnabled: (rt: JSRuntimePointer) => number = this.module.cwrap(\n \"QTS_GetDebugLogEnabled\",\n \"number\",\n [\"number\"],\n )\n\n QTS_SetDebugLogEnabled: (rt: JSRuntimePointer, is_enabled: number) => void = this.module.cwrap(\n \"QTS_SetDebugLogEnabled\",\n null,\n [\"number\", \"number\"],\n )\n\n QTS_BuildIsDebug: () => number = this.module.cwrap(\"QTS_BuildIsDebug\", \"number\", [])\n\n QTS_BuildIsAsyncify: () => number = this.module.cwrap(\"QTS_BuildIsAsyncify\", \"number\", [])\n\n QTS_NewFunction: (ctx: JSContextPointer, func_id: number, name: string) => JSValuePointer =\n this.module.cwrap(\"QTS_NewFunction\", \"number\", [\"number\", \"number\", \"string\"])\n\n QTS_ArgvGetJSValueConstPointer: (\n argv: JSValuePointer | JSValueConstPointer,\n index: number,\n ) => JSValueConstPointer = this.module.cwrap(\"QTS_ArgvGetJSValueConstPointer\", \"number\", [\n \"number\",\n \"number\",\n ])\n\n QTS_RuntimeEnableInterruptHandler: (rt: JSRuntimePointer) => void = this.module.cwrap(\n \"QTS_RuntimeEnableInterruptHandler\",\n null,\n [\"number\"],\n )\n\n QTS_RuntimeDisableInterruptHandler: (rt: JSRuntimePointer) => void = this.module.cwrap(\n \"QTS_RuntimeDisableInterruptHandler\",\n null,\n [\"number\"],\n )\n\n QTS_RuntimeEnableModuleLoader: (rt: JSRuntimePointer, use_custom_normalize: number) => void =\n this.module.cwrap(\"QTS_RuntimeEnableModuleLoader\", null, [\"number\", \"number\"])\n\n QTS_RuntimeDisableModuleLoader: (rt: JSRuntimePointer) => void = this.module.cwrap(\n \"QTS_RuntimeDisableModuleLoader\",\n null,\n [\"number\"],\n )\n\n QTS_bjson_encode: (\n ctx: JSContextPointer,\n val: JSValuePointer | JSValueConstPointer,\n ) => JSValuePointer = this.module.cwrap(\"QTS_bjson_encode\", \"number\", [\"number\", \"number\"])\n\n QTS_bjson_decode: (\n ctx: JSContextPointer,\n data: JSValuePointer | JSValueConstPointer,\n ) => JSValuePointer = this.module.cwrap(\"QTS_bjson_decode\", \"number\", [\"number\", \"number\"])\n\n QTS_EvalFunction: (\n ctx: JSContextPointer,\n fun_obj: JSValuePointer | JSValueConstPointer,\n ) => JSValuePointer = assertSync(\n this.module.cwrap(\"QTS_EvalFunction\", \"number\", [\"number\", \"number\"]),\n )\n\n QTS_EvalFunction_MaybeAsync: (\n ctx: JSContextPointer,\n fun_obj: JSValuePointer | JSValueConstPointer,\n ) => JSValuePointer | Promise<JSValuePointer> = this.module.cwrap(\n \"QTS_EvalFunction\",\n \"number\",\n [\"number\", \"number\"],\n { async: true },\n )\n\n QTS_EncodeBytecode: (\n ctx: JSContextPointer,\n val: JSValuePointer | JSValueConstPointer,\n ) => JSValuePointer = this.module.cwrap(\"QTS_EncodeBytecode\", \"number\", [\"number\", \"number\"])\n\n QTS_DecodeBytecode: (\n ctx: JSContextPointer,\n data: JSValuePointer | JSValueConstPointer,\n ) => JSValuePointer = this.module.cwrap(\"QTS_DecodeBytecode\", \"number\", [\"number\", \"number\"])\n}\n","import type { QuickJSAsyncVariant } from \"@componentor/quickjs-ffi-types\"\n\n/**\n * ### @componentor/quickjs-wasmfile-debug-asyncify\n *\n * [Docs](https://github.com/componentor/quickjs-emscripten/blob/main/doc/@componentor/quickjs-wasmfile-debug-asyncify/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 [2024-02-14+36911f0d](https://github.com/bellard/quickjs/commit/36911f0d3ab1a4c190a4d5cbe7c2db225a455389) vendored to quickjs-emscripten on 2024-06-15. |\n * | releaseMode | debug | Enables assertions and memory sanitizers. Try to run your tests against debug variants, in addition to your preferred production variant, to catch more bugs. |\n * | syncMode | asyncify | Build run through the ASYNCIFY WebAssembly transform. This imposes substantial size (2x the size of sync) and speed penalties (40% the speed of sync). In return, allows synchronous calls from the QuickJS WASM runtime to async functions on the host. The extra magic makes this variant slower than sync variants. Note that both variants support regular async functions. Only adopt ASYNCIFY if you need to! The [QuickJSAsyncRuntime](https://github.com/componentor/quickjs-emscripten/blob/main/doc/quickjs-emscripten/classes/QuickJSAsyncRuntime.md) and [QuickJSAsyncContext](https://github.com/componentor/quickjs-emscripten/blob/main/doc/quickjs-emscripten/classes/QuickJSAsyncContext.md) classes expose the ASYNCIFY-specific APIs. |\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: QuickJSAsyncVariant = {\n type: \"async\",\n importFFI: () => import(\"./ffi.js\").then((mod) => mod.QuickJSAsyncFFI),\n importModuleLoader: () =>\n import(\"@componentor/quickjs-wasmfile-debug-asyncify/emscripten-module\").then(\n (mod) => mod.default,\n ),\n} as const\n\nexport default variant\n"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KAAM,QACN,UAAW,IAAM,qDAAmB,KAAM,KAAQ,IAAI,eAAe,EACrE,mBAAoB,IAClB,OAAO,gEAAgE,EAAE,KACtE,KAAQ,IAAI,OACf,CACJ,EAEO,cAAQ","names":["module"]}
|
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
var variant={type:"async",importFFI:()=>import("./ffi.mjs").then(mod=>mod.QuickJSAsyncFFI),importModuleLoader:()=>import("@componentor/quickjs-wasmfile-debug-asyncify/emscripten-module").then(mod=>mod.default)},index_default=variant;export{index_default as default};
|
|
2
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["import type { QuickJSAsyncVariant } from \"@componentor/quickjs-ffi-types\"\n\n/**\n * ### @componentor/quickjs-wasmfile-debug-asyncify\n *\n * [Docs](https://github.com/componentor/quickjs-emscripten/blob/main/doc/@componentor/quickjs-wasmfile-debug-asyncify/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 [2024-02-14+36911f0d](https://github.com/bellard/quickjs/commit/36911f0d3ab1a4c190a4d5cbe7c2db225a455389) vendored to quickjs-emscripten on 2024-06-15. |\n * | releaseMode | debug | Enables assertions and memory sanitizers. Try to run your tests against debug variants, in addition to your preferred production variant, to catch more bugs. |\n * | syncMode | asyncify | Build run through the ASYNCIFY WebAssembly transform. This imposes substantial size (2x the size of sync) and speed penalties (40% the speed of sync). In return, allows synchronous calls from the QuickJS WASM runtime to async functions on the host. The extra magic makes this variant slower than sync variants. Note that both variants support regular async functions. Only adopt ASYNCIFY if you need to! The [QuickJSAsyncRuntime](https://github.com/componentor/quickjs-emscripten/blob/main/doc/quickjs-emscripten/classes/QuickJSAsyncRuntime.md) and [QuickJSAsyncContext](https://github.com/componentor/quickjs-emscripten/blob/main/doc/quickjs-emscripten/classes/QuickJSAsyncContext.md) classes expose the ASYNCIFY-specific APIs. |\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: QuickJSAsyncVariant = {\n type: \"async\",\n importFFI: () => import(\"./ffi.js\").then((mod) => mod.QuickJSAsyncFFI),\n importModuleLoader: () =>\n import(\"@componentor/quickjs-wasmfile-debug-asyncify/emscripten-module\").then(\n (mod) => mod.default,\n ),\n} as const\n\nexport default variant\n"],"mappings":"AAiBA,IAAM,QAA+B,CACnC,KAAM,QACN,UAAW,IAAM,OAAO,WAAU,EAAE,KAAM,KAAQ,IAAI,eAAe,EACrE,mBAAoB,IAClB,OAAO,gEAAgE,EAAE,KACtE,KAAQ,IAAI,OACf,CACJ,EAEO,cAAQ","names":[]}
|