napi_define_properties

Function napi_define_properties 

Source
pub unsafe extern "C" fn napi_define_properties(
    env: napi_env,
    object: napi_value,
    property_count: usize,
    properties: *const napi_property_descriptor,
) -> napi_status
Available on crate feature napi only.
Expand description

Efficient define multiple properties on the given ArkTS Object by napi_property_descriptor.

§Arguments

  • env - Current running virtual machine context.

  • object - The ArkTS Object.

  • property_count - The count of elements in the properties array.

  • properties - The properties array.

§Returns

  • Returns the function execution status. [napi_ok] If the function executed successfully.

[napi_invalid_arg] If the param env, object and(or) properties is nullptr.

[napi_object_expected] If the param object is not an ArkTS Object.

[napi_pending_exception] If have uncaught exception, or exception occurred in execution.

Available since API-level: 10