From 60867fb030bae582082340ead7dbc7efdc2f5398 Mon Sep 17 00:00:00 2001
From: 8cy <50817549+8cy@users.noreply.github.com>
Date: Fri, 3 Apr 2020 02:37:42 -0700
Subject: 2020/04/03, 02:34, v1.2.0
---
node_modules/node-addon-api/doc/bigint.md | 92 +++++++++++++++++++++++++++++++
1 file changed, 92 insertions(+)
create mode 100644 node_modules/node-addon-api/doc/bigint.md
(limited to 'node_modules/node-addon-api/doc/bigint.md')
diff --git a/node_modules/node-addon-api/doc/bigint.md b/node_modules/node-addon-api/doc/bigint.md
new file mode 100644
index 0000000..cc98104
--- /dev/null
+++ b/node_modules/node-addon-api/doc/bigint.md
@@ -0,0 +1,92 @@
+# BigInt
+
+A JavaScript BigInt value.
+
+## Methods
+
+### New
+
+```cpp
+static Napi::BigInt Napi::BigInt::New(Napi::Env env, int64_t value);
+```
+
+ - `[in] env`: The environment in which to construct the `Napi::BigInt` object.
+ - `[in] value`: The value the JavaScript `BigInt` will contain
+
+These APIs convert the C `int64_t` and `uint64_t` types to the JavaScript
+`BigInt` type.
+
+```cpp
+static Napi::BigInt Napi::BigInt::New(Napi::Env env,
+ int sign_bit,
+ size_t word_count,
+ const uint64_t* words);
+```
+
+ - `[in] env`: The environment in which to construct the `Napi::BigInt` object.
+ - `[in] sign_bit`: Determines if the resulting `BigInt` will be positive or negative.
+ - `[in] word_count`: The length of the words array.
+ - `[in] words`: An array of `uint64_t` little-endian 64-bit words.
+
+This API converts an array of unsigned 64-bit words into a single `BigInt`
+value.
+
+The resulting `BigInt` is calculated as: (–1)`sign_bit` (`words[0]`
+× (264)0 + `words[1]` × (264)1 + …)
+
+Returns a new JavaScript `BigInt`.
+
+### Constructor
+
+```cpp
+Napi::BigInt();
+```
+
+Returns a new empty JavaScript `Napi::BigInt`.
+
+### Int64Value
+
+```cpp
+int64_t Napi::BitInt::Int64Value(bool* lossless) const;
+```
+
+ - `[out] lossless`: Indicates whether the `BigInt` value was converted losslessly.
+
+Returns the C `int64_t` primitive equivalent of the given JavaScript
+`BigInt`. If needed it will truncate the value, setting lossless to false.
+
+### Uint64Value
+
+```cpp
+uint64_t Napi::BigInt::Uint64Value(bool* lossless) const;
+```
+
+ - `[out] lossless`: Indicates whether the `BigInt` value was converted
+ losslessly.
+
+Returns the C `uint64_t` primitive equivalent of the given JavaScript
+`BigInt`. If needed it will truncate the value, setting lossless to false.
+
+### WordCount
+
+```cpp
+size_t Napi::BigInt::WordCount() const;
+```
+
+Returns the number of words needed to store this `BigInt` value.
+
+### ToWords
+
+```cpp
+void Napi::BigInt::ToWords(size_t* word_count, int* sign_bit, uint64_t* words);
+```
+
+ - `[out] sign_bit`: Integer representing if the JavaScript `BigInt` is positive
+ or negative.
+ - `[in/out] word_count`: Must be initialized to the length of the words array.
+ Upon return, it will be set to the actual number of words that would be
+ needed to store this `BigInt`.
+ - `[out] words`: Pointer to a pre-allocated 64-bit word array.
+
+Returns a single `BigInt` value into a sign bit, 64-bit little-endian array,
+and the number of elements in the array.
--
cgit v1.2.3