napi_get_all_property_names
napi_get_all_property_names(napi_env env,
napi_value object,
napi_key_collection_mode key_mode,
napi_key_filter key_filter,
napi_key_conversion key_conversion,
napi_value* result);
-
[in] env
:调用 Node-API 调用的环境。¥
[in] env
: The environment that the Node-API call is invoked under. -
[in] object
:从中检索属性的对象。¥
[in] object
: The object from which to retrieve the properties. -
[in] key_mode
:是否也检索原型属性。¥
[in] key_mode
: Whether to retrieve prototype properties as well. -
[in] key_filter
:要检索哪些属性(可枚举/可读/可写)。¥
[in] key_filter
: Which properties to retrieve (enumerable/readable/writable). -
[in] key_conversion
:是否将编号的属性键转换为字符串。¥
[in] key_conversion
: Whether to convert numbered property keys to strings. -
[out] result
:一个napi_value
,表示一个 JavaScript 值数组,这些值表示对象的属性名称。napi_get_array_length
和napi_get_element
可用于迭代result
。¥
[out] result
: Anapi_value
representing an array of JavaScript values that represent the property names of the object.napi_get_array_length
andnapi_get_element
can be used to iterate overresult
.
如果 API 成功,则返回 napi_ok
。
¥Returns napi_ok
if the API succeeded.
此 API 返回一个数组,其中包含此对象的可用属性的名称。
¥This API returns an array containing the names of the available properties of this object.