目录

JSVM_CallbackStruct

typedef struct {...} JSVM_CallbackStruct

Overview

Defines the pointer to the data of the native callbacks provided by the user. These functions are exposed to JavaScript via JSVM-API.

Use scenario: Implements functions callable by JavaScript on the native layer, encapsulates C/C++ functions as JavaScript callbacks, and implements bidirectional interaction between native and JavaScript.

Features: Supports passing custom data to callback functions, provides a standard callback function signature, and serves as the infrastructure for cross-language invocation.

System capability: SystemCapability.ArkCompiler.JSVM

Since: 11

Related module: JSVM

Header file: jsvm_types.h

Summary

[h2]Member Variables

Name Description
void* data Data of the native callbacks provided by the user.

[h2]Member Functions

Name Description
JSVM_Value(JSVM_CDECL* callback)(JSVM_Env env, JSVM_CallbackInfo info) Pointer to the user-provided native callback function.

Member Function Description

[h2]callback()

JSVM_Value(JSVM_CDECL* callback)(JSVM_Env env, JSVM_CallbackInfo info)

Description

Defines a pointer to the native callback provided by users.