Skip to content

Latest commit

 

History

History
1618 lines (849 loc) · 45.7 KB

File metadata and controls

1618 lines (849 loc) · 45.7 KB

quickjs-emscriptenquickjs-emscripten-coreReadme | Exports


quickjs-emscripten / quickjs-emscripten-core / QuickJSAsyncFFI

Interface: QuickJSAsyncFFI

Low-level FFI bindings to QuickJS's Emscripten module. See instead QuickJSContext, the public Javascript interface exposed by this library.

Contents

Unstable

The FFI interface is considered private and may change.

Properties

DEBUG

readonly DEBUG: boolean

Set at compile time.

Source

packages/quickjs-ffi-types/src/ffi-async.ts:39


QTS_ArgvGetJSValueConstPointer

QTS_ArgvGetJSValueConstPointer: (argv, index) => JSValueConstPointer

Parameters

argv: JSValuePointer | JSValueConstPointer

index: number

Returns

JSValueConstPointer

Source

packages/quickjs-ffi-types/src/ffi-async.ts:250


QTS_BuildIsAsyncify

QTS_BuildIsAsyncify: () => number

Returns

number

Source

packages/quickjs-ffi-types/src/ffi-async.ts:248


QTS_BuildIsDebug

QTS_BuildIsDebug: () => number

Returns

number

Source

packages/quickjs-ffi-types/src/ffi-async.ts:247


QTS_BuildIsSanitizeLeak

QTS_BuildIsSanitizeLeak: () => number

Returns

number

Source

packages/quickjs-ffi-types/src/ffi-async.ts:47


QTS_Call

QTS_Call: (ctx, func_obj, this_obj, argc, argv_ptrs) => JSValuePointer

Parameters

ctx: JSContextPointer

func_obj: JSValuePointer | JSValueConstPointer

this_obj: JSValuePointer | JSValueConstPointer

argc: number

argv_ptrs: JSValueConstPointerPointer

Returns

JSValuePointer

Source

packages/quickjs-ffi-types/src/ffi-async.ts:173


QTS_Call_MaybeAsync

QTS_Call_MaybeAsync: (ctx, func_obj, this_obj, argc, argv_ptrs) => JSValuePointer | Promise<JSValuePointer>

Parameters

ctx: JSContextPointer

func_obj: JSValuePointer | JSValueConstPointer

this_obj: JSValuePointer | JSValueConstPointer

argc: number

argv_ptrs: JSValueConstPointerPointer

Returns

JSValuePointer | Promise<JSValuePointer>

Source

packages/quickjs-ffi-types/src/ffi-async.ts:180


QTS_DefineProp

QTS_DefineProp: (ctx, this_val, prop_name, prop_value, get, set, configurable, enumerable, has_value) => void

Parameters

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

Returns

void

Source

packages/quickjs-ffi-types/src/ffi-async.ts:148


QTS_Dump

QTS_Dump: (ctx, obj) => JSBorrowedCharPointer

Parameters

ctx: JSContextPointer

obj: JSValuePointer | JSValueConstPointer

Returns

JSBorrowedCharPointer

Source

packages/quickjs-ffi-types/src/ffi-async.ts:188


QTS_Dump_MaybeAsync

QTS_Dump_MaybeAsync: (ctx, obj) => JSBorrowedCharPointer | Promise<JSBorrowedCharPointer>

Parameters

ctx: JSContextPointer

obj: JSValuePointer | JSValueConstPointer

Returns

JSBorrowedCharPointer | Promise<JSBorrowedCharPointer>

Source

packages/quickjs-ffi-types/src/ffi-async.ts:192


QTS_DupValuePointer

QTS_DupValuePointer: (ctx, val) => JSValuePointer

Parameters

ctx: JSContextPointer

val: JSValuePointer | JSValueConstPointer

Returns

JSValuePointer

Source

packages/quickjs-ffi-types/src/ffi-async.ts:61


QTS_Eval

QTS_Eval: (ctx, js_code, js_code_length, filename, detectModule, evalFlags) => JSValuePointer

Parameters

ctx: JSContextPointer

js_code: BorrowedHeapCharPointer

js_code_length: number

filename: string

detectModule: EvalDetectModule

evalFlags: EvalFlags

Returns

JSValuePointer

Source

packages/quickjs-ffi-types/src/ffi-async.ts:196


QTS_Eval_MaybeAsync

QTS_Eval_MaybeAsync: (ctx, js_code, js_code_length, filename, detectModule, evalFlags) => JSValuePointer | Promise<JSValuePointer>

Parameters

ctx: JSContextPointer

js_code: BorrowedHeapCharPointer

js_code_length: number

filename: string

detectModule: EvalDetectModule

evalFlags: EvalFlags

Returns

JSValuePointer | Promise<JSValuePointer>

Source

packages/quickjs-ffi-types/src/ffi-async.ts:204


QTS_ExecutePendingJob

QTS_ExecutePendingJob: (rt, maxJobsToExecute, lastJobContext) => JSValuePointer

Parameters

rt: JSRuntimePointer

maxJobsToExecute: number

lastJobContext: JSContextPointerPointer

Returns

JSValuePointer

Source

packages/quickjs-ffi-types/src/ffi-async.ts:106


QTS_ExecutePendingJob_MaybeAsync

QTS_ExecutePendingJob_MaybeAsync: (rt, maxJobsToExecute, lastJobContext) => JSValuePointer | Promise<JSValuePointer>

Parameters

rt: JSRuntimePointer

maxJobsToExecute: number

lastJobContext: JSContextPointerPointer

Returns

JSValuePointer | Promise<JSValuePointer>

Source

packages/quickjs-ffi-types/src/ffi-async.ts:111


QTS_FreeCString

QTS_FreeCString: (ctx, str) => void

Parameters

ctx: JSContextPointer

str: JSBorrowedCharPointer

Returns

void

Source

packages/quickjs-ffi-types/src/ffi-async.ts:60


QTS_FreeContext

QTS_FreeContext: (ctx) => void

Parameters

ctx: JSContextPointer

Returns

void

Source

packages/quickjs-ffi-types/src/ffi-async.ts:56


QTS_FreeRuntime

QTS_FreeRuntime: (rt) => void

Parameters

rt: JSRuntimePointer

Returns

void

Source

packages/quickjs-ffi-types/src/ffi-async.ts:54


QTS_FreeValuePointer

QTS_FreeValuePointer: (ctx, value) => void

Parameters

ctx: JSContextPointer

value: JSValuePointer

Returns

void

Source

packages/quickjs-ffi-types/src/ffi-async.ts:57


QTS_FreeValuePointerRuntime

QTS_FreeValuePointerRuntime: (rt, value) => void

Parameters

rt: JSRuntimePointer

value: JSValuePointer

Returns

void

Source

packages/quickjs-ffi-types/src/ffi-async.ts:58


QTS_FreeVoidPointer

QTS_FreeVoidPointer: (ctx, ptr) => void

Parameters

ctx: JSContextPointer

ptr: JSVoidPointer

Returns

void

Source

packages/quickjs-ffi-types/src/ffi-async.ts:59


QTS_GetArrayBuffer

QTS_GetArrayBuffer: (ctx, data) => JSVoidPointer

Parameters

ctx: JSContextPointer

data: JSValuePointer | JSValueConstPointer

Returns

JSVoidPointer

Source

packages/quickjs-ffi-types/src/ffi-async.ts:83


QTS_GetArrayBufferLength

QTS_GetArrayBufferLength: (ctx, data) => number

Parameters

ctx: JSContextPointer

data: JSValuePointer | JSValueConstPointer

Returns

number

Source

packages/quickjs-ffi-types/src/ffi-async.ts:87


QTS_GetDebugLogEnabled

QTS_GetDebugLogEnabled: (rt) => number

Parameters

rt: JSRuntimePointer

Returns

number

Source

packages/quickjs-ffi-types/src/ffi-async.ts:245


QTS_GetFalse

QTS_GetFalse: () => JSValueConstPointer

Returns

JSValueConstPointer

Source

packages/quickjs-ffi-types/src/ffi-async.ts:51


QTS_GetFloat64

QTS_GetFloat64: (ctx, value) => number

Parameters

ctx: JSContextPointer

value: JSValuePointer | JSValueConstPointer

Returns

number

Source

packages/quickjs-ffi-types/src/ffi-async.ts:77


QTS_GetGlobalObject

QTS_GetGlobalObject: (ctx) => JSValuePointer

Parameters

ctx: JSContextPointer

Returns

JSValuePointer

Source

packages/quickjs-ffi-types/src/ffi-async.ts:231


QTS_GetLength

QTS_GetLength: (ctx, out_len, value) => number

Parameters

ctx: JSContextPointer

out_len: UInt32Pointer

value: JSValuePointer | JSValueConstPointer

Returns

number

Source

packages/quickjs-ffi-types/src/ffi-async.ts:220


QTS_GetModuleNamespace

QTS_GetModuleNamespace: (ctx, module_func_obj) => JSValuePointer

Parameters

ctx: JSContextPointer

module_func_obj: JSValuePointer | JSValueConstPointer

Returns

JSValuePointer

Source

packages/quickjs-ffi-types/src/ffi-async.ts:212


QTS_GetNull

QTS_GetNull: () => JSValueConstPointer

Returns

JSValueConstPointer

Source

packages/quickjs-ffi-types/src/ffi-async.ts:50


QTS_GetOwnPropertyNames

QTS_GetOwnPropertyNames: (ctx, out_ptrs, out_len, obj, flags) => JSValuePointer

Parameters

ctx: JSContextPointer

out_ptrs: JSValuePointerPointerPointer

out_len: UInt32Pointer

obj: JSValuePointer | JSValueConstPointer

flags: number

Returns

JSValuePointer

Source

packages/quickjs-ffi-types/src/ffi-async.ts:159


QTS_GetOwnPropertyNames_MaybeAsync

QTS_GetOwnPropertyNames_MaybeAsync: (ctx, out_ptrs, out_len, obj, flags) => JSValuePointer | Promise<JSValuePointer>

Parameters

ctx: JSContextPointer

out_ptrs: JSValuePointerPointerPointer

out_len: UInt32Pointer

obj: JSValuePointer | JSValueConstPointer

flags: number

Returns

JSValuePointer | Promise<JSValuePointer>

Source

packages/quickjs-ffi-types/src/ffi-async.ts:166


QTS_GetProp

QTS_GetProp: (ctx, this_val, prop_name) => JSValuePointer

Parameters

ctx: JSContextPointer

this_val: JSValuePointer | JSValueConstPointer

prop_name: JSValuePointer | JSValueConstPointer

Returns

JSValuePointer

Source

packages/quickjs-ffi-types/src/ffi-async.ts:116


QTS_GetPropNumber

QTS_GetPropNumber: (ctx, this_val, prop_name) => JSValuePointer

Parameters

ctx: JSContextPointer

this_val: JSValuePointer | JSValueConstPointer

prop_name: number

Returns

JSValuePointer

Source

packages/quickjs-ffi-types/src/ffi-async.ts:126


QTS_GetPropNumber_MaybeAsync

QTS_GetPropNumber_MaybeAsync: (ctx, this_val, prop_name) => JSValuePointer | Promise<JSValuePointer>

Parameters

ctx: JSContextPointer

this_val: JSValuePointer | JSValueConstPointer

prop_name: number

Returns

JSValuePointer | Promise<JSValuePointer>

Source

packages/quickjs-ffi-types/src/ffi-async.ts:131


QTS_GetProp_MaybeAsync

QTS_GetProp_MaybeAsync: (ctx, this_val, prop_name) => JSValuePointer | Promise<JSValuePointer>

Parameters

ctx: JSContextPointer

this_val: JSValuePointer | JSValueConstPointer

prop_name: JSValuePointer | JSValueConstPointer

Returns

JSValuePointer | Promise<JSValuePointer>

Source

packages/quickjs-ffi-types/src/ffi-async.ts:121


QTS_GetString

QTS_GetString: (ctx, value) => JSBorrowedCharPointer

Parameters

ctx: JSContextPointer

value: JSValuePointer | JSValueConstPointer

Returns

JSBorrowedCharPointer

Source

packages/quickjs-ffi-types/src/ffi-async.ts:79


QTS_GetSymbolDescriptionOrKey

QTS_GetSymbolDescriptionOrKey: (ctx, value) => JSBorrowedCharPointer

Parameters

ctx: JSContextPointer

value: JSValuePointer | JSValueConstPointer

Returns

JSBorrowedCharPointer

Source

packages/quickjs-ffi-types/src/ffi-async.ts:96


QTS_GetSymbolDescriptionOrKey_MaybeAsync

QTS_GetSymbolDescriptionOrKey_MaybeAsync: (ctx, value) => JSBorrowedCharPointer | Promise<JSBorrowedCharPointer>

Parameters

ctx: JSContextPointer

value: JSValuePointer | JSValueConstPointer

Returns

JSBorrowedCharPointer | Promise<JSBorrowedCharPointer>

Source

packages/quickjs-ffi-types/src/ffi-async.ts:100


QTS_GetTrue

QTS_GetTrue: () => JSValueConstPointer

Returns

JSValueConstPointer

Source

packages/quickjs-ffi-types/src/ffi-async.ts:52


QTS_GetUndefined

QTS_GetUndefined: () => JSValueConstPointer

Returns

JSValueConstPointer

Source

packages/quickjs-ffi-types/src/ffi-async.ts:49


QTS_IsEqual

QTS_IsEqual: (ctx, a, b, op) => number

Parameters

ctx: JSContextPointer

a: JSValuePointer | JSValueConstPointer

b: JSValuePointer | JSValueConstPointer

op: IsEqualOp

Returns

number

Source

packages/quickjs-ffi-types/src/ffi-async.ts:225


QTS_IsGlobalSymbol

QTS_IsGlobalSymbol: (ctx, value) => number

Parameters

ctx: JSContextPointer

value: JSValuePointer | JSValueConstPointer

Returns

number

Source

packages/quickjs-ffi-types/src/ffi-async.ts:104


QTS_IsJobPending

QTS_IsJobPending: (rt) => number

Parameters

rt: JSRuntimePointer

Returns

number

Source

packages/quickjs-ffi-types/src/ffi-async.ts:105


QTS_NewArray

QTS_NewArray: (ctx) => JSValuePointer

Parameters

ctx: JSContextPointer

Returns

JSValuePointer

Source

packages/quickjs-ffi-types/src/ffi-async.ts:70


QTS_NewArrayBuffer

QTS_NewArrayBuffer: (ctx, buffer, length) => JSValuePointer

Parameters

ctx: JSContextPointer

buffer: JSVoidPointer

length: number

Returns

JSValuePointer

Source

packages/quickjs-ffi-types/src/ffi-async.ts:71


QTS_NewContext

QTS_NewContext: (rt, intrinsics) => JSContextPointer

Parameters

rt: JSRuntimePointer

intrinsics: IntrinsicsFlags

Returns

JSContextPointer

Source

packages/quickjs-ffi-types/src/ffi-async.ts:55


QTS_NewError

QTS_NewError: (ctx) => JSValuePointer

Parameters

ctx: JSContextPointer

Returns

JSValuePointer

Source

packages/quickjs-ffi-types/src/ffi-async.ts:42


QTS_NewFloat64

QTS_NewFloat64: (ctx, num) => JSValuePointer

Parameters

ctx: JSContextPointer

num: number

Returns

JSValuePointer

Source

packages/quickjs-ffi-types/src/ffi-async.ts:76


QTS_NewFunction

QTS_NewFunction: (ctx, func_id, name) => JSValuePointer

Parameters

ctx: JSContextPointer

func_id: number

name: string

Returns

JSValuePointer

Source

packages/quickjs-ffi-types/src/ffi-async.ts:249


QTS_NewObject

QTS_NewObject: (ctx) => JSValuePointer

Parameters

ctx: JSContextPointer

Returns

JSValuePointer

Source

packages/quickjs-ffi-types/src/ffi-async.ts:65


QTS_NewObjectProto

QTS_NewObjectProto: (ctx, proto) => JSValuePointer

Parameters

ctx: JSContextPointer

proto: JSValuePointer | JSValueConstPointer

Returns

JSValuePointer

Source

packages/quickjs-ffi-types/src/ffi-async.ts:66


QTS_NewPromiseCapability

QTS_NewPromiseCapability: (ctx, resolve_funcs_out) => JSValuePointer

Parameters

ctx: JSContextPointer

resolve_funcs_out: JSValuePointerPointer

Returns

JSValuePointer

Source

packages/quickjs-ffi-types/src/ffi-async.ts:232


QTS_NewRuntime

QTS_NewRuntime: () => JSRuntimePointer

Returns

JSRuntimePointer

Source

packages/quickjs-ffi-types/src/ffi-async.ts:53


QTS_NewString

QTS_NewString: (ctx, string) => JSValuePointer

Parameters

ctx: JSContextPointer

string: BorrowedHeapCharPointer

Returns

JSValuePointer

Source

packages/quickjs-ffi-types/src/ffi-async.ts:78


QTS_NewSymbol

QTS_NewSymbol: (ctx, description, isGlobal) => JSValuePointer

Parameters

ctx: JSContextPointer

description: BorrowedHeapCharPointer

isGlobal: number

Returns

JSValuePointer

Source

packages/quickjs-ffi-types/src/ffi-async.ts:91


QTS_PromiseResult

QTS_PromiseResult: (ctx, promise) => JSValuePointer

Parameters

ctx: JSContextPointer

promise: JSValuePointer | JSValueConstPointer

Returns

JSValuePointer

Source

packages/quickjs-ffi-types/src/ffi-async.ts:240


QTS_PromiseState

QTS_PromiseState: (ctx, promise) => JSPromiseStateEnum

Parameters

ctx: JSContextPointer

promise: JSValuePointer | JSValueConstPointer

Returns

JSPromiseStateEnum

Source

packages/quickjs-ffi-types/src/ffi-async.ts:236


QTS_RecoverableLeakCheck

QTS_RecoverableLeakCheck: () => number

Returns

number

Source

packages/quickjs-ffi-types/src/ffi-async.ts:46


QTS_ResolveException

QTS_ResolveException: (ctx, maybe_exception) => JSValuePointer

Parameters

ctx: JSContextPointer

maybe_exception: JSValuePointer

Returns

JSValuePointer

Source

packages/quickjs-ffi-types/src/ffi-async.ts:187


QTS_RuntimeComputeMemoryUsage

QTS_RuntimeComputeMemoryUsage: (rt, ctx) => JSValuePointer

Parameters

rt: JSRuntimePointer

ctx: JSContextPointer

Returns

JSValuePointer

Source

packages/quickjs-ffi-types/src/ffi-async.ts:44


QTS_RuntimeDisableInterruptHandler

QTS_RuntimeDisableInterruptHandler: (rt) => void

Parameters

rt: JSRuntimePointer

Returns

void

Source

packages/quickjs-ffi-types/src/ffi-async.ts:255


QTS_RuntimeDisableModuleLoader

QTS_RuntimeDisableModuleLoader: (rt) => void

Parameters

rt: JSRuntimePointer

Returns

void

Source

packages/quickjs-ffi-types/src/ffi-async.ts:257


QTS_RuntimeDumpMemoryUsage

QTS_RuntimeDumpMemoryUsage: (rt) => OwnedHeapCharPointer

Parameters

rt: JSRuntimePointer

Returns

OwnedHeapCharPointer

Source

packages/quickjs-ffi-types/src/ffi-async.ts:45


QTS_RuntimeEnableInterruptHandler

QTS_RuntimeEnableInterruptHandler: (rt) => void

Parameters

rt: JSRuntimePointer

Returns

void

Source

packages/quickjs-ffi-types/src/ffi-async.ts:254


QTS_RuntimeEnableModuleLoader

QTS_RuntimeEnableModuleLoader: (rt, use_custom_normalize) => void

Parameters

rt: JSRuntimePointer

use_custom_normalize: number

Returns

void

Source

packages/quickjs-ffi-types/src/ffi-async.ts:256


QTS_RuntimeSetMaxStackSize

QTS_RuntimeSetMaxStackSize: (rt, stack_size) => void

Parameters

rt: JSRuntimePointer

stack_size: number

Returns

void

Source

packages/quickjs-ffi-types/src/ffi-async.ts:48


QTS_RuntimeSetMemoryLimit

QTS_RuntimeSetMemoryLimit: (rt, limit) => void

Parameters

rt: JSRuntimePointer

limit: number

Returns

void

Source

packages/quickjs-ffi-types/src/ffi-async.ts:43


QTS_SetDebugLogEnabled

QTS_SetDebugLogEnabled: (rt, is_enabled) => void

Parameters

rt: JSRuntimePointer

is_enabled: number

Returns

void

Source

packages/quickjs-ffi-types/src/ffi-async.ts:246


QTS_SetProp

QTS_SetProp: (ctx, this_val, prop_name, prop_value) => void

Parameters

ctx: JSContextPointer

this_val: JSValuePointer | JSValueConstPointer

prop_name: JSValuePointer | JSValueConstPointer

prop_value: JSValuePointer | JSValueConstPointer

Returns

void

Source

packages/quickjs-ffi-types/src/ffi-async.ts:136


QTS_SetProp_MaybeAsync

QTS_SetProp_MaybeAsync: (ctx, this_val, prop_name, prop_value) => void | Promise<void>

Parameters

ctx: JSContextPointer

this_val: JSValuePointer | JSValueConstPointer

prop_name: JSValuePointer | JSValueConstPointer

prop_value: JSValuePointer | JSValueConstPointer

Returns

void | Promise<void>

Source

packages/quickjs-ffi-types/src/ffi-async.ts:142


QTS_TestStringArg

QTS_TestStringArg: (string) => void

Parameters

string: string

Returns

void

Source

packages/quickjs-ffi-types/src/ffi-async.ts:244


QTS_Throw

QTS_Throw: (ctx, error) => JSValuePointer

Parameters

ctx: JSContextPointer

error: JSValuePointer | JSValueConstPointer

Returns

JSValuePointer

Source

packages/quickjs-ffi-types/src/ffi-async.ts:41


QTS_Typeof

QTS_Typeof: (ctx, value) => OwnedHeapCharPointer

Parameters

ctx: JSContextPointer

value: JSValuePointer | JSValueConstPointer

Returns

OwnedHeapCharPointer

Source

packages/quickjs-ffi-types/src/ffi-async.ts:216


QTS_bjson_decode

QTS_bjson_decode: (ctx, data) => JSValuePointer

Parameters

ctx: JSContextPointer

data: JSValuePointer | JSValueConstPointer

Returns

JSValuePointer

Source

packages/quickjs-ffi-types/src/ffi-async.ts:262


QTS_bjson_encode

QTS_bjson_encode: (ctx, val) => JSValuePointer

Parameters

ctx: JSContextPointer

val: JSValuePointer | JSValueConstPointer

Returns

JSValuePointer

Source

packages/quickjs-ffi-types/src/ffi-async.ts:258


Generated using typedoc-plugin-markdown and TypeDoc