OH_ArkUI_GetContextFromNapiValue

Function OH_ArkUI_GetContextFromNapiValue 

Source
pub unsafe extern "C" fn OH_ArkUI_GetContextFromNapiValue(
    env: napi_env,
    value: napi_value,
    context: *mut ArkUI_ContextHandle,
) -> i32
Available on crate feature api-12 only.
Expand description

Obtains a UIContext object on the ArkTS side and maps it to an ArkUI_ContextHandle object on the native side.

§Arguments

  • env - ndicates the NAPI environment pointer.

  • value - Indicates the UIContext object created on the ArkTS side.

  • context - Indicates the pointer to the ArkUI_ContextHandle object.

§Returns

  • Returns the error code. Returns [ARKUI_ERROR_CODE_NO_ERROR] if the operation is successful. Returns [ARKUI_ERROR_CODE_PARAM_INVALID] if a parameter error occurs.

Available since API-level: 12