quickjs-emscripten • quickjs-emscripten-core • Readme | Exports
quickjs-emscripten / quickjs-emscripten-core / EmscriptenModuleLoaderOptions
This structure is defined by Emscripten. It's possible to provide these parameters to an emscripten module loader. See the Emscripten Module API reference.
wasmBinary?:
ArrayBuffer
Compile this to WebAssembly.Module
packages/quickjs-ffi-types/src/emscripten-types.ts:104
wasmMemory?:
Memory
If provided, use this WebAssembly.Memory instead of an automatically created one.
packages/quickjs-ffi-types/src/emscripten-types.ts:107
optional
instantiateWasm(imports
,onSuccess
):Exports
|Promise
<Exports
>
Create an instance of the WASM module, call onSuccess(instance), then return instance.exports
• imports: Imports
• onSuccess: (instance
) => void
Exports
| Promise
<Exports
>
packages/quickjs-ffi-types/src/emscripten-types.ts:110
optional
locateFile(fileName
,prefix
):string
If set, this method will be called when the runtime needs to load a file, such as a .wasm WebAssembly file, .mem memory init file, or a file generated by the file packager.
The function receives two parameters:
fileName
, the relative path to the file as configured in build process, eg"emscripten-module.wasm"
.prefix
(path to the main JavaScript file’s directory). This may be''
(empty string) in some cases if the Emscripten Javascript code can't locate itself. Try logging it in your environment.
It should return the actual URI or path to the requested file.
This lets you host file packages on a different location than the directory of the JavaScript file (which is the default expectation), for example if you want to host them on a CDN.
• fileName: string
• prefix: string
Often ''
(empty string)
string
packages/quickjs-ffi-types/src/emscripten-types.ts:97
optional
monitorRunDependencies(left
):void
Called by emscripten as dependencies blocking initialization are added or fulfilled. May only be called in debug builds.
• left: number
void
packages/quickjs-ffi-types/src/emscripten-types.ts:116
Generated using typedoc-plugin-markdown and TypeDoc