pub unsafe extern "C" fn napi_create_external_arraybuffer(
env: napi_env,
external_data: *mut c_void,
byte_length: usize,
finalize_cb: napi_finalize,
finalize_hint: *mut c_void,
result: *mut napi_value,
) -> napi_statusAvailable on crate feature
napi only.Expand description
The underlying data that ArrayBuffer point to.
§Arguments
-
env- Current running virtual machine context. -
external_data- Allocates an ArkTS value that references external data. -
byte_length- The length in bytes of the underlying buffer. -
finalize_cb- Optional callback to call when the ArrayBuffer is being collected. -
finalize_hint- Optional hint that can be passed to the finalize callback function during the garbage collection process. -
result- A napi_value representing an ArkTS ArrayBuffer.
§Returns
- Returns the function execution status.
[
napi_ok] If the function executed successfully.
[napi_invalid_arg] If the param env, external_data, finalize_cb and(or) result is nullptr.
[napi_pending_exception] There is an uncaught exception occurred before(in) execution.
Available since API-level: 10