Skip to content

Latest commit

 

History

History
78 lines (49 loc) · 1.45 KB

typed_array.md

File metadata and controls

78 lines (49 loc) · 1.45 KB

TypedArray

Class Napi::TypedArray inherits from class Napi::Object.

The Napi::TypedArray class corresponds to the JavaScript TypedArray class.

Methods

Constructor

Initializes an empty instance of the Napi::TypedArray class.

Napi::TypedArray::TypedArray();

Constructor

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 the Napi::TypedArray instance.
  • [in] value: The Napi::TypedArray reference to wrap.

TypedArrayType

napi_typedarray_type Napi::TypedArray::TypedArrayType() const;

Returns the type of this instance.

ArrayBuffer

Napi::ArrayBuffer Napi::TypedArray::ArrayBuffer() const;

Returns the backing array buffer.

ElementSize

uint8_t Napi::TypedArray::ElementSize() const;

Returns the size of one element, in bytes.

ElementLength

size_t Napi::TypedArray::ElementLength() const;

Returns the number of elements.

ByteOffset

size_t Napi::TypedArray::ByteOffset() const;

Returns the offset into the Napi::ArrayBuffer where the array starts, in bytes.

ByteLength

size_t Napi::TypedArray::ByteLength() const;

Returns the length of the array, in bytes.