diff options
| author | 8cy <[email protected]> | 2020-04-03 02:37:42 -0700 |
|---|---|---|
| committer | 8cy <[email protected]> | 2020-04-03 02:37:42 -0700 |
| commit | 60867fb030bae582082340ead7dbc7efdc2f5398 (patch) | |
| tree | 4c6a7356351be2e4914e15c4703172597c45656e /node_modules/node-addon-api/doc/symbol.md | |
| parent | commenting (diff) | |
| download | s5nical-60867fb030bae582082340ead7dbc7efdc2f5398.tar.xz s5nical-60867fb030bae582082340ead7dbc7efdc2f5398.zip | |
2020/04/03, 02:34, v1.2.0
Diffstat (limited to 'node_modules/node-addon-api/doc/symbol.md')
| -rw-r--r-- | node_modules/node-addon-api/doc/symbol.md | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/node_modules/node-addon-api/doc/symbol.md b/node_modules/node-addon-api/doc/symbol.md new file mode 100644 index 0000000..13abe3e --- /dev/null +++ b/node_modules/node-addon-api/doc/symbol.md @@ -0,0 +1,44 @@ +# Symbol + +## Methods + +### Constructor + +Instantiates a new `Napi::Symbol` value. + +```cpp +Napi::Symbol::Symbol(); +``` + +Returns a new empty `Napi::Symbol`. + +### New +```cpp +Napi::Symbol::New(napi_env env, const std::string& description); +Napi::Symbol::New(napi_env env, const char* description); +Napi::Symbol::New(napi_env env, Napi::String description); +Napi::Symbol::New(napi_env env, napi_value description); +``` + +- `[in] env`: The `napi_env` environment in which to construct the `Napi::Symbol` object. +- `[in] value`: The C++ primitive which represents the description hint for the `Napi::Symbol`. + `description` may be any of: + - `std::string&` - ANSI string description. + - `const char*` - represents a UTF8 string description. + - `String` - Node addon API String description. + - `napi_value` - N-API `napi_value` description. + +If an error occurs, a `Napi::Error` will get thrown. If C++ exceptions are not +being used, callers should check the result of `Napi::Env::IsExceptionPending` before +attempting to use the returned value. + +### Utf8Value +```cpp +static Napi::Symbol Napi::Symbol::WellKnown(napi_env env, const std::string& name); +``` + +- `[in] env`: The `napi_env` environment in which to construct the `Napi::Symbol` object. +- `[in] name`: The C++ string representing the `Napi::Symbol` to retrieve. + +Returns a `Napi::Symbol` representing a well-known `Symbol` from the +`Symbol` registry. |