napi_coerce_to_native_binding_object

Function napi_coerce_to_native_binding_object 

Source
pub unsafe extern "C" fn napi_coerce_to_native_binding_object(
    env: napi_env,
    js_object: napi_value,
    detach_cb: napi_native_binding_detach_callback,
    attach_cb: napi_native_binding_attach_callback,
    native_object: *mut c_void,
    hint: *mut c_void,
) -> napi_status
Available on crate features napi and api-11 only.
Expand description

This API sets native properties to a object and converts this ArkTS object to native binding object.

§Arguments

  • env - Current running virtual machine context.

  • js_object - The ArkTS value to coerce.

  • detach_cb - Native callback that can be used to detach the ArkTS object and the native object.

  • attach_cb - Native callback that can be used to bind the ArkTS object and the native object.

  • native_object - User-provided native instance to pass to thr detach callback and attach callback.

  • hint - Optional hint to pass to the detach callback and attach callback.

§Returns

  • Return the function execution status.

Available since API-level: 11