native 通过napi_create_external_buffer这个方法创建的buffer实际上得到的是ArrayBuffer,然后在ArkTs通过...
napi_create_external FUNC napi_create_external_arraybuffer FUNC napi_create_object FUNC napi_create_symbol FUNC napi_create_typedarray FUNC napi_create_dataview FUNC napi_create_int32 FUNC napi_create_uint32 FUNC napi_create_int64 FUNC napi_create_double FUNC napi_create_string_latin1 FUNC napi_...
node_api_create_buffer_from_arraybuffer(napi_env env, napi_value arraybuffer, size_t byte_offset, size_t length, napi_value* result); #endif // NODE_API_EXPERIMENTAL_HAS_CREATE_BUFFER_FROM_ARRAYBUFFER #ifndef NODE_API_NO_EXTERNAL_BUFFERS_ALLOWED NAPI_EXTERN napi_status NAPI_CDECL napi_create...
napi_status napi_create_external(napi_env env,void* data,napi_finalize finalize_cb,void* finalize_hint,napi_value* result) napi_create_external_arraybuffer napi_status napi_create_external_arraybuffer(napi_env env,void* external_data,size_t byte_length,napi_finalize finalize_cb,void* finalize_hin...
napi_status napi_create_external_arraybuffer(napi_env env,void* external_data,size_t byte_length,napi_finalize finalize_cb,void* finalize_hint,napi_value* result) napi_create_external_buffer napi_status napi_create_external_buffer(napi_env env,size_t length,void* data,napi_finalize finalize_cb...
在ArkTS侧如何引用Native侧使用napi_create_buffer接口构造的对象 Native侧如何通过char指针构造ArrayBuffer数组 在CMakeLists文件中如何获取模块版本信息 传入自定义类型对象到Native侧时,index.d.ts文件如何声明 Native侧如何对ArkTS传递的Object类型的数据、属性进行修改 如何通过多个xxx.d.ts文件导出Native侧接口...
Whitespace Ignore whitespace Split Unified 2 changes: 1 addition & 1 deletion2doc/api/n-api.md Original file line numberDiff line numberDiff line change Expand Up@@ -2038,7 +2038,7 @@ napi_status napi_create_external_buffer(napi_env env, ...
该段内存由引擎内部的ArrayBuffer Allocator管理,随JS对象ArrayBuffer的生命周期释放。 错误示例: void* arrayBufferPtr = nullptr; napi_value arrayBuffer = nullptr; size_t createBufferSize = ARRAY_BUFFER_SIZE; napi_status verification = napi_create_arraybuffer(env, createBufferSize, &arrayBufferPtr, &...
异步方式依赖NAPI框架提供的napi_create_async_work()函数创建异步工作项napi_create_async_work()在foundation/arkui/napi/native_engine/native_node_api.cpp第71行。 复制 NAPI_EXTERNnapi_statusnapi_create_async_work(napi_envenv,napi_valueasync_resource,napi_valueasync_resource_name,napi_async_execute_call...
/// void* externalData)` ); /// Creates a new ArrayBuffer instance, using an external buffer with /// specified byte length. template <typename Finalizer, typename Hint> static ArrayBuffer New( napi_env env, ///< Node-API environment void* externalData, ///< Pointer to the ex...