Class Napi::TypedArray inherits from class Napi::Object.
The Napi::TypedArray class corresponds to the
JavaScript TypedArray
class.
Initializes an empty instance of the Napi::TypedArray class.
Napi::TypedArray::TypedArray();Initializes a wrapper instance of an existing Napi::TypedArray instance.
Napi::TypedArray::TypedArray(napi_env env, napi_value value);[in] env: The environment in which to create theNapi::TypedArrayinstance.[in] value: TheNapi::TypedArrayreference to wrap.
napi_typedarray_type Napi::TypedArray::TypedArrayType() const;Returns the type of this instance.
Napi::ArrayBuffer Napi::TypedArray::ArrayBuffer() const;Returns the backing array buffer.
NOTE: If the Napi::TypedArray is not backed by an Napi::ArrayBuffer,
this method will terminate the process with a fatal error when using
NODE_ADDON_API_ENABLE_TYPE_CHECK_ON_AS or exhibit undefined behavior
otherwise. Use Buffer() instead to get the backing buffer without assuming its
type.
Napi::Value Napi::TypedArray::Buffer() const;Returns the backing array buffer as a generic Napi::Value, allowing optional
type-checking with Is*() and type-casting with As<>() methods.
uint8_t Napi::TypedArray::ElementSize() const;Returns the size of one element, in bytes.
size_t Napi::TypedArray::ElementLength() const;Returns the number of elements.
size_t Napi::TypedArray::ByteOffset() const;Returns the offset into the Napi::ArrayBuffer where the array starts, in bytes.
size_t Napi::TypedArray::ByteLength() const;Returns the length of the array, in bytes.