napi_get_value_bigint_uint64
napi_status napi_get_value_bigint_uint64(napi_env env,
napi_value value,
uint64_t* result,
bool* lossless);
-
[in] env
:调用 API 的环境。¥
[in] env
: The environment that the API is invoked under. -
[in] value
:napi_value
代表 JavaScriptBigInt
。¥
[in] value
:napi_value
representing JavaScriptBigInt
. -
[out] result
:给定的 JavaScriptBigInt
的 Cuint64_t
基础类型等价物。¥
[out] result
: Cuint64_t
primitive equivalent of the given JavaScriptBigInt
. -
[out] lossless
:指示BigInt
值是否已无损转换。¥
[out] lossless
: Indicates whether theBigInt
value was converted losslessly.
如果 API 成功,则返回 napi_ok
。如果传入非 BigInt
,则返回 napi_bigint_expected
。
¥Returns napi_ok
if the API succeeded. If a non-BigInt
is passed in it
returns napi_bigint_expected
.
此 API 返回给定 JavaScript BigInt
的 C uint64_t
基础类型等价物。如果需要,它将截断该值,将 lossless
设置为 false
。
¥This API returns the C uint64_t
primitive equivalent of the given JavaScript
BigInt
. If needed it will truncate the value, setting lossless
to false
.