1
0
mirror of https://github.com/musix-org/musix-oss synced 2024-11-14 03:30:18 +00:00
musix-oss/node_modules/node-addon-api/doc/boolean.md
2020-03-04 13:43:21 +02:00

1.5 KiB

Boolean

Napi::Boolean class is a representation of the JavaScript Boolean object. The Napi::Boolean class inherits its behavior from the Napi::Value class (for more info see: Napi::Value).

Methods

Constructor

Creates a new empty instance of an Napi::Boolean object.

Napi::Boolean::Boolean();

Returns a new empty Napi::Boolean object.

Contructor

Creates a new instance of the Napi::Boolean object.

Napi::Boolean(napi_env env, napi_value value);
  • [in] env: The napi_env environment in which to construct the Napi::Boolean object.
  • [in] value: The napi_value which is a handle for a JavaScript Boolean.

Returns a non-empty Napi::Boolean object.

New

Initializes a new instance of the Napi::Boolean object.

Napi::Boolean Napi::Boolean::New(napi_env env, bool value);
  • [in] env: The napi_env environment in which to construct the Napi::Boolean object.
  • [in] value: The primitive boolean value (true or false).

Returns a new instance of the Napi::Boolean object.

Value

Converts a Napi::Boolean value to a boolean primitive.

bool Napi::Boolean::Value() const;

Returns the boolean primitive type of the corresponding Napi::Boolean object.

Operators

operator bool

Converts a Napi::Boolean value to a boolean primitive.

Napi::Boolean::operator bool() const;

Returns the boolean primitive type of the corresponding Napi::Boolean object.