HarmonyOS API:标准库
版本:v3.1 Beta
Node-API
更新时间: 2023-02-17 09:19
简介
Node-API是用于封装JavaScript能力为Native插件的API,独立于底层JavaScript,并作为Node.js的一部分。
支持的能力
Node-API可以去除底层的JavaScript引擎的差异,提供一套稳定的接口。
HarmonyOS的Native API组件对Node-API的接口进行了重新实现,底层对接了ArkJS等引擎。当前支持Node-API标准库中的部分接口。
Native API组件扩展的符号列表
符号类型  | 符号名  | 备注  | 
FUNC  | napi_run_script_path  | 运行JavaScript文件  | 
标准库中导出的符号列表
符号类型  | 符号名  | 备注  | 
FUNC  | napi_module_register  | 
  | 
FUNC  | napi_get_last_error_info  | 
  | 
FUNC  | napi_throw  | 
  | 
FUNC  | napi_throw_error  | 
  | 
FUNC  | napi_throw_type_error  | 
  | 
FUNC  | napi_throw_range_error  | 
  | 
FUNC  | napi_is_error  | 
  | 
FUNC  | napi_create_error  | 
  | 
FUNC  | napi_create_type_error  | 
  | 
FUNC  | napi_create_range_error  | 
  | 
FUNC  | napi_get_and_clear_last_exception  | 
  | 
FUNC  | napi_is_exception_pending  | 
  | 
FUNC  | napi_fatal_error  | 
  | 
FUNC  | napi_open_handle_scope  | 
  | 
FUNC  | napi_close_handle_scope  | 
  | 
FUNC  | napi_open_escapable_handle_scope  | 
  | 
FUNC  | napi_close_escapable_handle_scope  | 
  | 
FUNC  | napi_escape_handle  | 
  | 
FUNC  | napi_create_reference  | 
  | 
FUNC  | napi_delete_reference  | 
  | 
FUNC  | napi_reference_ref  | 
  | 
FUNC  | napi_reference_unref  | 
  | 
FUNC  | napi_get_reference_value  | 
  | 
FUNC  | napi_create_array  | 
  | 
FUNC  | napi_create_array_with_length  | 
  | 
FUNC  | napi_create_arraybuffer  | 
  | 
FUNC  | 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_create_string_utf8  | 
  | 
FUNC  | napi_get_array_length  | 
  | 
FUNC  | napi_get_arraybuffer_info  | 
  | 
FUNC  | napi_get_prototype  | 
  | 
FUNC  | napi_get_typedarray_info  | 
  | 
FUNC  | napi_get_dataview_info  | 
  | 
FUNC  | napi_get_value_bool  | 
  | 
FUNC  | napi_get_value_double  | 
  | 
FUNC  | napi_get_value_external  | 
  | 
FUNC  | napi_get_value_int32  | 
  | 
FUNC  | napi_get_value_int64  | 
  | 
FUNC  | napi_get_value_string_latin1  | 
  | 
FUNC  | napi_get_value_string_utf8  | 
  | 
FUNC  | napi_get_value_uint32  | 
  | 
FUNC  | napi_get_boolean  | 
  | 
FUNC  | napi_get_global  | 
  | 
FUNC  | napi_get_null  | 
  | 
FUNC  | napi_get_undefined  | 
  | 
FUNC  | napi_coerce_to_bool  | 
  | 
FUNC  | napi_coerce_to_number  | 
  | 
FUNC  | napi_coerce_to_object  | 
  | 
FUNC  | napi_coerce_to_string  | 
  | 
FUNC  | napi_typeof  | 
  | 
FUNC  | napi_instanceof  | 
  | 
FUNC  | napi_is_array  | 
  | 
FUNC  | napi_is_arraybuffer  | 
  | 
FUNC  | napi_is_typedarray  | 
  | 
FUNC  | napi_is_dataview  | 
  | 
FUNC  | napi_is_date  | 
  | 
FUNC  | napi_strict_equals  | 
  | 
FUNC  | napi_get_property_names  | 
  | 
FUNC  | napi_set_property  | 
  | 
FUNC  | napi_get_property  | 
  | 
FUNC  | napi_has_property  | 
  | 
FUNC  | napi_delete_property  | 
  | 
FUNC  | napi_has_own_property  | 
  | 
FUNC  | napi_set_named_property  | 
  | 
FUNC  | napi_get_named_property  | 
  | 
FUNC  | napi_has_named_property  | 
  | 
FUNC  | napi_set_element  | 
  | 
FUNC  | napi_get_element  | 
  | 
FUNC  | napi_has_element  | 
  | 
FUNC  | napi_delete_element  | 
  | 
FUNC  | napi_define_properties  | 
  | 
FUNC  | napi_call_function  | 
  | 
FUNC  | napi_create_function  | 
  | 
FUNC  | napi_get_cb_info  | 
  | 
FUNC  | napi_get_new_target  | 
  | 
FUNC  | napi_new_instance  | 
  | 
FUNC  | napi_define_class  | 
  | 
FUNC  | napi_wrap  | 
  | 
FUNC  | napi_unwrap  | 
  | 
FUNC  | napi_remove_wrap  | 
  | 
FUNC  | napi_create_async_work  | 
  | 
FUNC  | napi_delete_async_work  | 
  | 
FUNC  | napi_queue_async_work  | 
  | 
FUNC  | napi_cancel_async_work  | 
  | 
FUNC  | napi_get_node_version  | 
  | 
FUNC  | napi_get_version  | 
  | 
FUNC  | napi_create_promise  | 
  | 
FUNC  | napi_resolve_deferred  | 
  | 
FUNC  | napi_reject_deferred  | 
  | 
FUNC  | napi_is_promise  | 
  | 
FUNC  | napi_run_script  | 
  | 
FUNC  | napi_get_uv_event_loop  | 
  | 
libuv
更新时间: 2023-02-17 09:19
简介
libuv是一个跨平台库,基于事件驱动来实现异步I/O,主要作为Node.js的多平台支持库。
支持的能力
libuv实现了跨平台的基于事件驱动的异步I/O。
支持标准库接口。
Native API中支持的标准库
更新时间: 2023-02-17 09:19
简介
表1 HarmonyOS支持的标准库
名称  | 简介  | 
标准C库  | libc、libm、libdl组合实现C11标准C库。  | 
标准C++库  | libc++ 是C++标准库的一种实现。  | 
OpenSL ES  | OpenSL ES是一个嵌入式跨平台的音频处理库。  | 
zlib  | Zlib是基于C/C++语言实现的一个通用的数据压缩库。  | 
EGL  | EGL是渲染API与底层原生窗口系统之间的一种标准的软件接口。  | 
OpenGL ES  | OpenGL ES是一个嵌入式跨平台的为 3D 图形处理硬件指定标准的软件接口。  | 
标准C库
libc、libm、libdl组合实现C11标准C库。
libc:包含线程相关接口,以及大部分标准接口。
libm:数学库函数接口。
libdl:dlopen等动态链接器接口。
版本
1.2.0
支持的能力
C标准函数库是在C语言程序设计中,所有符合标准的头文件的集合,以及常用的函数库实现程序(如I/O输入输出和字符串控制)。
musl
标准C++库
libc++是C++标准库的一种实现。
版本
10.0.1
支持的能力
C++11、C++14标准已完全支持,C++17和C++20标准正在完善。
OpenSL ES
OpenSL ES是一个嵌入式跨平台的音频处理库。
zlib
Zlib是基于C/C++语言实现的一个通用的数据压缩库。
EGL
EGL 是Khronos渲染API (如OpenGL ES 或 OpenVG) 与底层原生窗口系统之间的接口。HarmonyOS 现已支持 EGL。
标准库中导出的符号列表
OpenGL ES
OpenGL 是一种跨平台的图形 API,用于为 3D 图形处理硬件指定标准的软件接口。OpenGL ES 是 OpenGL 规范的一种形式,适用于嵌入式设备。HarmonyOS 现已支持 OpenGL ES 3.0。
支持的能力
OpenGL ES 3.0
标准库中导出的符号列表
native api中导出的OpenGL ES 3.0符号列表




















