Skip to content

Latest commit

 

History

History
511 lines (278 loc) · 9.66 KB

QuickJSAsyncEmscriptenModule.md

File metadata and controls

511 lines (278 loc) · 9.66 KB

quickjs-emscriptenquickjs-emscriptenReadme | Exports


quickjs-emscripten / quickjs-emscripten / QuickJSAsyncEmscriptenModule

Interface: QuickJSAsyncEmscriptenModule

Typings for the features we use to interface with our Emscripten build of QuickJS.

Contents

Extends

Properties

FAST_MEMORY

FAST_MEMORY: number

Inherited from

quickjs-emscripten.EmscriptenModule.FAST_MEMORY

Source

packages/quickjs-ffi-types/dist/index.d.ts:261


HEAP16

HEAP16: Int16Array

Inherited from

quickjs-emscripten.EmscriptenModule.HEAP16

Source

packages/quickjs-ffi-types/dist/index.d.ts:252


HEAP32

HEAP32: Int32Array

Inherited from

quickjs-emscripten.EmscriptenModule.HEAP32

Source

packages/quickjs-ffi-types/dist/index.d.ts:253


HEAP8

HEAP8: Int8Array

Inherited from

quickjs-emscripten.EmscriptenModule.HEAP8

Source

packages/quickjs-ffi-types/dist/index.d.ts:251


HEAPF32

HEAPF32: Float32Array

Inherited from

quickjs-emscripten.EmscriptenModule.HEAPF32

Source

packages/quickjs-ffi-types/dist/index.d.ts:257


HEAPF64

HEAPF64: Float64Array

Inherited from

quickjs-emscripten.EmscriptenModule.HEAPF64

Source

packages/quickjs-ffi-types/dist/index.d.ts:258


HEAPU16

HEAPU16: Uint16Array

Inherited from

quickjs-emscripten.EmscriptenModule.HEAPU16

Source

packages/quickjs-ffi-types/dist/index.d.ts:255


HEAPU32

HEAPU32: Uint32Array

Inherited from

quickjs-emscripten.EmscriptenModule.HEAPU32

Source

packages/quickjs-ffi-types/dist/index.d.ts:256


HEAPU8

HEAPU8: Uint8Array

Inherited from

quickjs-emscripten.EmscriptenModule.HEAPU8

Source

packages/quickjs-ffi-types/dist/index.d.ts:254


TOTAL_MEMORY

TOTAL_MEMORY: number

Inherited from

quickjs-emscripten.EmscriptenModule.TOTAL_MEMORY

Source

packages/quickjs-ffi-types/dist/index.d.ts:260


TOTAL_STACK

TOTAL_STACK: number

Inherited from

quickjs-emscripten.EmscriptenModule.TOTAL_STACK

Source

packages/quickjs-ffi-types/dist/index.d.ts:259


callbacks

callbacks: EmscriptenModuleCallbacks

Source

packages/quickjs-ffi-types/dist/index.d.ts:302


type

type: "async"

Todo

Implement this field

Source

packages/quickjs-ffi-types/dist/index.d.ts:301


wasmBinary?

wasmBinary?: ArrayBuffer

Compile this to WebAssembly.Module

Inherited from

quickjs-emscripten.EmscriptenModule.wasmBinary

Source

packages/quickjs-ffi-types/dist/index.d.ts:218


wasmMemory?

wasmMemory?: Memory

If provided, use this WebAssembly.Memory instead of an automatically created one.

Inherited from

quickjs-emscripten.EmscriptenModule.wasmMemory

Source

packages/quickjs-ffi-types/dist/index.d.ts:220

Methods

UTF8ToString()

UTF8ToString(ptr, maxBytesToRead?): string

HeapChar to JS string. https://emscripten.org/docs/api_reference/preamble.js.html#UTF8ToString

Parameters

ptr: BorrowedHeapCharPointer

maxBytesToRead?: number

Returns

string

Inherited from

quickjs-emscripten.EmscriptenModule.UTF8ToString

Source

packages/quickjs-ffi-types/dist/index.d.ts:246


_free()

_free(ptr): void

Parameters

ptr: number

Returns

void

Inherited from

quickjs-emscripten.EmscriptenModule._free

Source

packages/quickjs-ffi-types/dist/index.d.ts:249


_malloc()

_malloc(size): number

Parameters

size: number

Returns

number

Inherited from

quickjs-emscripten.EmscriptenModule._malloc

Source

packages/quickjs-ffi-types/dist/index.d.ts:248


cwrap()

cwrap(ident, returnType, argTypes, opts?): (...args) => any

Parameters

ident: string

returnType: null | ValueType

argTypes: ValueType[]

opts?: CCallOpts

Returns

Function

Parameters

• ...args: any[]

Returns

any

Inherited from

quickjs-emscripten.EmscriptenModule.cwrap

Source

packages/quickjs-ffi-types/dist/index.d.ts:250


instantiateWasm()?

optional instantiateWasm(imports, onSuccess): Exports | Promise<Exports>

Create an instance of the WASM module, call onSuccess(instance), then return instance.exports

Parameters

imports: Imports

onSuccess: (instance) => void

Returns

Exports | Promise<Exports>

Inherited from

quickjs-emscripten.EmscriptenModule.instantiateWasm

Source

packages/quickjs-ffi-types/dist/index.d.ts:222


lengthBytesUTF8()

lengthBytesUTF8(str): number

Parameters

str: string

Returns

number

Inherited from

quickjs-emscripten.EmscriptenModule.lengthBytesUTF8

Source

packages/quickjs-ffi-types/dist/index.d.ts:247


locateFile()?

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.

Parameters

fileName: string

prefix: string

Often '' (empty string)

Returns

string

Inherited from

quickjs-emscripten.EmscriptenModule.locateFile

Source

packages/quickjs-ffi-types/dist/index.d.ts:214


monitorRunDependencies()?

optional monitorRunDependencies(left): void

Called by emscripten as dependencies blocking initialization are added or fulfilled. May only be called in debug builds.

Parameters

left: number

Returns

void

Inherited from

quickjs-emscripten.EmscriptenModule.monitorRunDependencies

Source

packages/quickjs-ffi-types/dist/index.d.ts:224


stringToUTF8()

stringToUTF8(str, outPtr, maxBytesToRead?): void

Write JS str to HeapChar pointer. https://emscripten.org/docs/api_reference/preamble.js.html#stringToUTF8

Parameters

str: string

outPtr: OwnedHeapCharPointer

maxBytesToRead?: number

Returns

void

Inherited from

quickjs-emscripten.EmscriptenModule.stringToUTF8

Source

packages/quickjs-ffi-types/dist/index.d.ts:241


Generated using typedoc-plugin-markdown and TypeDoc