@basemaps/lambda-tiler 6.16.1 → 6.20.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (158) hide show
  1. package/CHANGELOG.md +49 -0
  2. package/LICENSE +2 -2
  3. package/build/__test__/tile.style.json.test.d.ts +2 -0
  4. package/build/__test__/tile.style.json.test.d.ts.map +1 -0
  5. package/build/__test__/tile.style.json.test.js +33 -0
  6. package/build/__test__/xyz.test.js +35 -34
  7. package/build/cli/dump.js +2 -2
  8. package/build/index.d.ts.map +1 -1
  9. package/build/index.js +10 -0
  10. package/build/routes/esri/rest.d.ts +10 -0
  11. package/build/routes/esri/rest.d.ts.map +1 -0
  12. package/build/routes/esri/rest.js +87 -0
  13. package/build/routes/imagery.d.ts +10 -0
  14. package/build/routes/imagery.d.ts.map +1 -0
  15. package/build/routes/imagery.js +50 -0
  16. package/build/routes/response.d.ts +4 -0
  17. package/build/routes/response.d.ts.map +1 -0
  18. package/build/routes/response.js +3 -0
  19. package/build/routes/tile.d.ts +0 -20
  20. package/build/routes/tile.d.ts.map +1 -1
  21. package/build/routes/tile.js +11 -164
  22. package/build/routes/tile.json.d.ts +10 -0
  23. package/build/routes/tile.json.d.ts.map +1 -0
  24. package/build/routes/tile.json.js +31 -0
  25. package/build/routes/tile.style.json.d.ts +10 -0
  26. package/build/routes/tile.style.json.d.ts.map +1 -0
  27. package/build/routes/tile.style.json.js +74 -0
  28. package/build/routes/tile.wmts.d.ts +9 -0
  29. package/build/routes/tile.wmts.d.ts.map +1 -0
  30. package/build/routes/tile.wmts.js +57 -0
  31. package/build/routes/tile.xyz.d.ts +13 -0
  32. package/build/routes/tile.xyz.d.ts.map +1 -0
  33. package/build/routes/tile.xyz.js +28 -0
  34. package/build/tile.set.raster.d.ts +2 -0
  35. package/build/tile.set.raster.d.ts.map +1 -1
  36. package/build/tile.set.raster.js +3 -1
  37. package/build/tile.set.vector.js +1 -1
  38. package/dist/index.js +10580 -9573
  39. package/dist/node_modules/color/README.md +7 -7
  40. package/dist/node_modules/color/index.js +173 -158
  41. package/dist/node_modules/color/package.json +18 -16
  42. package/dist/node_modules/color-convert/conversions.js +281 -310
  43. package/dist/node_modules/color-convert/index.js +27 -24
  44. package/dist/node_modules/color-convert/package.json +16 -14
  45. package/dist/node_modules/color-convert/route.js +22 -22
  46. package/dist/node_modules/color-name/package.json +17 -14
  47. package/dist/node_modules/color-string/index.js +2 -2
  48. package/dist/node_modules/color-string/package.json +10 -10
  49. package/dist/node_modules/decompress-response/index.d.ts +14 -21
  50. package/dist/node_modules/decompress-response/index.js +34 -16
  51. package/dist/node_modules/decompress-response/license +1 -1
  52. package/dist/node_modules/decompress-response/package.json +23 -17
  53. package/dist/node_modules/decompress-response/readme.md +2 -6
  54. package/dist/node_modules/detect-libc/package.json +0 -1
  55. package/dist/node_modules/mimic-response/index.d.ts +2 -2
  56. package/dist/node_modules/mimic-response/index.js +41 -2
  57. package/dist/node_modules/mimic-response/package.json +17 -17
  58. package/dist/node_modules/mimic-response/readme.md +22 -1
  59. package/dist/node_modules/node-abi/.circleci/config.yml +63 -0
  60. package/dist/node_modules/node-abi/.releaserc.json +9 -0
  61. package/dist/node_modules/node-abi/abi_registry.json +39 -4
  62. package/dist/node_modules/node-abi/index.js +5 -2
  63. package/dist/node_modules/node-abi/package.json +17 -16
  64. package/dist/node_modules/node-abi/test/index.js +7 -15
  65. package/dist/node_modules/node-addon-api/README.md +2 -2
  66. package/dist/node_modules/node-addon-api/except.gypi +20 -11
  67. package/dist/node_modules/node-addon-api/napi-inl.h +734 -196
  68. package/dist/node_modules/node-addon-api/napi.h +420 -164
  69. package/dist/node_modules/node-addon-api/noexcept.gypi +21 -11
  70. package/dist/node_modules/node-addon-api/package.json +43 -14
  71. package/dist/node_modules/node-addon-api/tools/clang-format.js +18 -17
  72. package/dist/node_modules/node-addon-api/tools/eslint-format.js +71 -0
  73. package/dist/node_modules/prebuild-install/CHANGELOG.md +24 -7
  74. package/dist/node_modules/prebuild-install/README.md +24 -4
  75. package/dist/node_modules/prebuild-install/asset.js +10 -10
  76. package/dist/node_modules/prebuild-install/bin.js +13 -13
  77. package/dist/node_modules/prebuild-install/download.js +22 -22
  78. package/dist/node_modules/prebuild-install/log.js +4 -4
  79. package/dist/node_modules/prebuild-install/node_modules/detect-libc/LICENSE +201 -0
  80. package/dist/node_modules/prebuild-install/node_modules/detect-libc/README.md +160 -0
  81. package/dist/node_modules/prebuild-install/node_modules/detect-libc/index.d.ts +11 -0
  82. package/dist/node_modules/prebuild-install/node_modules/detect-libc/lib/detect-libc.js +178 -0
  83. package/dist/node_modules/prebuild-install/node_modules/detect-libc/lib/process.js +16 -0
  84. package/dist/node_modules/prebuild-install/node_modules/detect-libc/package.json +71 -0
  85. package/dist/node_modules/prebuild-install/package.json +18 -19
  86. package/dist/node_modules/prebuild-install/proxy.js +10 -10
  87. package/dist/node_modules/prebuild-install/rc.js +12 -12
  88. package/dist/node_modules/prebuild-install/util.js +14 -14
  89. package/dist/node_modules/semver/package.json +1 -0
  90. package/dist/node_modules/sharp/README.md +2 -2
  91. package/dist/node_modules/sharp/binding.gyp +12 -9
  92. package/dist/node_modules/sharp/build/Release/sharp-linux-x64.node +0 -0
  93. package/dist/node_modules/sharp/install/dll-copy.js +6 -6
  94. package/dist/node_modules/sharp/install/libvips.js +4 -8
  95. package/dist/node_modules/sharp/lib/channel.js +11 -7
  96. package/dist/node_modules/sharp/lib/colour.js +42 -1
  97. package/dist/node_modules/sharp/lib/constructor.js +18 -31
  98. package/dist/node_modules/sharp/lib/input.js +45 -3
  99. package/dist/node_modules/sharp/lib/is.js +19 -5
  100. package/dist/node_modules/sharp/lib/libvips.js +4 -19
  101. package/dist/node_modules/sharp/lib/operation.js +28 -5
  102. package/dist/node_modules/sharp/lib/output.js +147 -16
  103. package/dist/node_modules/sharp/lib/sharp.js +31 -0
  104. package/dist/node_modules/sharp/lib/utility.js +3 -2
  105. package/dist/node_modules/sharp/package.json +32 -23
  106. package/dist/node_modules/sharp/src/common.cc +67 -11
  107. package/dist/node_modules/sharp/src/common.h +25 -5
  108. package/dist/node_modules/sharp/src/libvips/cplusplus/VConnection.cpp +0 -26
  109. package/dist/node_modules/sharp/src/libvips/cplusplus/VImage.cpp +54 -16
  110. package/dist/node_modules/sharp/src/libvips/cplusplus/VInterpolate.cpp +0 -13
  111. package/dist/node_modules/sharp/src/libvips/cplusplus/vips-operators.cpp +185 -1
  112. package/dist/node_modules/sharp/src/metadata.cc +14 -0
  113. package/dist/node_modules/sharp/src/metadata.h +1 -0
  114. package/dist/node_modules/sharp/src/operations.cc +29 -3
  115. package/dist/node_modules/sharp/src/operations.h +13 -2
  116. package/dist/node_modules/sharp/src/pipeline.cc +103 -35
  117. package/dist/node_modules/sharp/src/pipeline.h +23 -3
  118. package/dist/node_modules/sharp/src/utilities.cc +1 -1
  119. package/dist/node_modules/sharp/vendor/{8.10.6 → 8.11.3/linux-x64}/THIRD-PARTY-NOTICES.md +2 -3
  120. package/dist/node_modules/sharp/vendor/{8.10.6 → 8.11.3/linux-x64}/lib/libvips-cpp.so.42 +0 -0
  121. package/dist/node_modules/sharp/vendor/{8.10.6 → 8.11.3/linux-x64}/platform.json +0 -0
  122. package/dist/node_modules/sharp/vendor/8.11.3/linux-x64/versions.json +30 -0
  123. package/dist/node_modules/simple-get/.github/dependabot.yml +15 -0
  124. package/dist/node_modules/simple-get/.github/workflows/ci.yml +23 -0
  125. package/dist/node_modules/simple-get/README.md +17 -3
  126. package/dist/node_modules/simple-get/index.js +9 -0
  127. package/dist/node_modules/simple-get/package.json +27 -13
  128. package/dist/package-lock.json +54 -54
  129. package/dist/package.json +11 -11
  130. package/package.json +12 -12
  131. package/src/__test__/tile.style.json.test.ts +40 -0
  132. package/src/__test__/xyz.test.ts +43 -41
  133. package/src/cli/dump.ts +2 -2
  134. package/src/index.ts +10 -0
  135. package/src/routes/esri/rest.ts +90 -0
  136. package/src/routes/imagery.ts +52 -0
  137. package/src/routes/response.ts +4 -0
  138. package/src/routes/tile.json.ts +44 -0
  139. package/src/routes/tile.style.json.ts +77 -0
  140. package/src/routes/tile.ts +11 -186
  141. package/src/routes/tile.wmts.ts +59 -0
  142. package/src/routes/tile.xyz.ts +30 -0
  143. package/src/tile.set.raster.ts +4 -1
  144. package/src/tile.set.vector.ts +1 -1
  145. package/tsconfig.tsbuildinfo +1 -1
  146. package/dist/node_modules/color-name/.eslintrc.json +0 -43
  147. package/dist/node_modules/color-name/test.js +0 -7
  148. package/dist/node_modules/node-abi/.travis.yml +0 -17
  149. package/dist/node_modules/node-abi/node_modules/semver/CHANGELOG.md +0 -39
  150. package/dist/node_modules/node-abi/node_modules/semver/LICENSE +0 -15
  151. package/dist/node_modules/node-abi/node_modules/semver/README.md +0 -412
  152. package/dist/node_modules/node-abi/node_modules/semver/bin/semver +0 -160
  153. package/dist/node_modules/node-abi/node_modules/semver/package.json +0 -60
  154. package/dist/node_modules/node-abi/node_modules/semver/range.bnf +0 -16
  155. package/dist/node_modules/node-abi/node_modules/semver/semver.js +0 -1483
  156. package/dist/node_modules/node-addon-api/CHANGELOG.md +0 -722
  157. package/dist/node_modules/sharp/build/Release/sharp.node +0 -0
  158. package/dist/node_modules/sharp/vendor/8.10.6/versions.json +0 -31
@@ -34,6 +34,13 @@ static_assert(sizeof(char16_t) == sizeof(wchar_t), "Size mismatch between char16
34
34
  #endif
35
35
  #endif
36
36
 
37
+ // If C++ NAPI_CPP_EXCEPTIONS are enabled, NODE_ADDON_API_ENABLE_MAYBE should
38
+ // not be set
39
+ #if defined(NAPI_CPP_EXCEPTIONS) && defined(NODE_ADDON_API_ENABLE_MAYBE)
40
+ #error NODE_ADDON_API_ENABLE_MAYBE should not be set when \
41
+ NAPI_CPP_EXCEPTIONS is defined.
42
+ #endif
43
+
37
44
  #ifdef _NOEXCEPT
38
45
  #define NAPI_NOEXCEPT _NOEXCEPT
39
46
  #else
@@ -77,20 +84,36 @@ static_assert(sizeof(char16_t) == sizeof(wchar_t), "Size mismatch between char16
77
84
  return; \
78
85
  } while (0)
79
86
 
80
- #define NAPI_THROW_IF_FAILED(env, status, ...) \
81
- if ((status) != napi_ok) { \
82
- Napi::Error::New(env).ThrowAsJavaScriptException(); \
83
- return __VA_ARGS__; \
87
+ #define NAPI_THROW_IF_FAILED(env, status, ...) \
88
+ if ((status) != napi_ok) { \
89
+ Napi::Error::New(env).ThrowAsJavaScriptException(); \
90
+ return __VA_ARGS__; \
84
91
  }
85
92
 
86
- #define NAPI_THROW_IF_FAILED_VOID(env, status) \
87
- if ((status) != napi_ok) { \
88
- Napi::Error::New(env).ThrowAsJavaScriptException(); \
89
- return; \
93
+ #define NAPI_THROW_IF_FAILED_VOID(env, status) \
94
+ if ((status) != napi_ok) { \
95
+ Napi::Error::New(env).ThrowAsJavaScriptException(); \
96
+ return; \
90
97
  }
91
98
 
92
99
  #endif // NAPI_CPP_EXCEPTIONS
93
100
 
101
+ #ifdef NODE_ADDON_API_ENABLE_MAYBE
102
+ #define NAPI_MAYBE_THROW_IF_FAILED(env, status, type) \
103
+ NAPI_THROW_IF_FAILED(env, status, Napi::Nothing<type>())
104
+
105
+ #define NAPI_RETURN_OR_THROW_IF_FAILED(env, status, result, type) \
106
+ NAPI_MAYBE_THROW_IF_FAILED(env, status, type); \
107
+ return Napi::Just<type>(result);
108
+ #else
109
+ #define NAPI_MAYBE_THROW_IF_FAILED(env, status, type) \
110
+ NAPI_THROW_IF_FAILED(env, status, type())
111
+
112
+ #define NAPI_RETURN_OR_THROW_IF_FAILED(env, status, result, type) \
113
+ NAPI_MAYBE_THROW_IF_FAILED(env, status, type); \
114
+ return result;
115
+ #endif
116
+
94
117
  # define NAPI_DISALLOW_ASSIGN(CLASS) void operator=(const CLASS&) = delete;
95
118
  # define NAPI_DISALLOW_COPY(CLASS) CLASS(const CLASS&) = delete;
96
119
 
@@ -98,13 +121,16 @@ static_assert(sizeof(char16_t) == sizeof(wchar_t), "Size mismatch between char16
98
121
  NAPI_DISALLOW_ASSIGN(CLASS) \
99
122
  NAPI_DISALLOW_COPY(CLASS)
100
123
 
101
- #define NAPI_FATAL_IF_FAILED(status, location, message) \
102
- do { \
103
- if ((status) != napi_ok) { \
104
- Napi::Error::Fatal((location), (message)); \
105
- } \
124
+ #define NAPI_CHECK(condition, location, message) \
125
+ do { \
126
+ if (!(condition)) { \
127
+ Napi::Error::Fatal((location), (message)); \
128
+ } \
106
129
  } while (0)
107
130
 
131
+ #define NAPI_FATAL_IF_FAILED(status, location, message) \
132
+ NAPI_CHECK((status) == napi_ok, location, message)
133
+
108
134
  ////////////////////////////////////////////////////////////////////////////////
109
135
  /// Node-API C++ Wrapper Classes
110
136
  ///
@@ -165,6 +191,67 @@ namespace Napi {
165
191
 
166
192
  class MemoryManagement;
167
193
 
194
+ /// A simple Maybe type, representing an object which may or may not have a
195
+ /// value.
196
+ ///
197
+ /// If an API method returns a Maybe<>, the API method can potentially fail
198
+ /// either because an exception is thrown, or because an exception is pending,
199
+ /// e.g. because a previous API call threw an exception that hasn't been
200
+ /// caught yet. In that case, a "Nothing" value is returned.
201
+ template <class T>
202
+ class Maybe {
203
+ public:
204
+ bool IsNothing() const;
205
+ bool IsJust() const;
206
+
207
+ /// Short-hand for Unwrap(), which doesn't return a value. Could be used
208
+ /// where the actual value of the Maybe is not needed like Object::Set.
209
+ /// If this Maybe is nothing (empty), node-addon-api will crash the
210
+ /// process.
211
+ void Check() const;
212
+
213
+ /// Return the value of type T contained in the Maybe. If this Maybe is
214
+ /// nothing (empty), node-addon-api will crash the process.
215
+ T Unwrap() const;
216
+
217
+ /// Return the value of type T contained in the Maybe, or using a default
218
+ /// value if this Maybe is nothing (empty).
219
+ T UnwrapOr(const T& default_value) const;
220
+
221
+ /// Converts this Maybe to a value of type T in the out. If this Maybe is
222
+ /// nothing (empty), `false` is returned and `out` is left untouched.
223
+ bool UnwrapTo(T* out) const;
224
+
225
+ bool operator==(const Maybe& other) const;
226
+ bool operator!=(const Maybe& other) const;
227
+
228
+ private:
229
+ Maybe();
230
+ explicit Maybe(const T& t);
231
+
232
+ bool _has_value;
233
+ T _value;
234
+
235
+ template <class U>
236
+ friend Maybe<U> Nothing();
237
+ template <class U>
238
+ friend Maybe<U> Just(const U& u);
239
+ };
240
+
241
+ template <class T>
242
+ inline Maybe<T> Nothing();
243
+
244
+ template <class T>
245
+ inline Maybe<T> Just(const T& t);
246
+
247
+ #if defined(NODE_ADDON_API_ENABLE_MAYBE)
248
+ template <typename T>
249
+ using MaybeOrValue = Maybe<T>;
250
+ #else
251
+ template <typename T>
252
+ using MaybeOrValue = T;
253
+ #endif
254
+
168
255
  /// Environment for Node-API values and operations.
169
256
  ///
170
257
  /// All Node-API values and operations must be associated with an environment.
@@ -179,8 +266,12 @@ namespace Napi {
179
266
  /// In the V8 JavaScript engine, a Node-API environment approximately
180
267
  /// corresponds to an Isolate.
181
268
  class Env {
269
+ private:
270
+ #if NAPI_VERSION > 2
271
+ template <typename Hook, typename Arg = void>
272
+ class CleanupHook;
273
+ #endif // NAPI_VERSION > 2
182
274
  #if NAPI_VERSION > 5
183
- private:
184
275
  template <typename T> static void DefaultFini(Env, T* data);
185
276
  template <typename DataType, typename HintType>
186
277
  static void DefaultFiniWithHint(Env, DataType* data, HintType* hint);
@@ -197,9 +288,17 @@ namespace Napi {
197
288
  bool IsExceptionPending() const;
198
289
  Error GetAndClearPendingException();
199
290
 
200
- Value RunScript(const char* utf8script);
201
- Value RunScript(const std::string& utf8script);
202
- Value RunScript(String script);
291
+ MaybeOrValue<Value> RunScript(const char* utf8script);
292
+ MaybeOrValue<Value> RunScript(const std::string& utf8script);
293
+ MaybeOrValue<Value> RunScript(String script);
294
+
295
+ #if NAPI_VERSION > 2
296
+ template <typename Hook>
297
+ CleanupHook<Hook> AddCleanupHook(Hook hook);
298
+
299
+ template <typename Hook, typename Arg>
300
+ CleanupHook<Hook, Arg> AddCleanupHook(Hook hook, Arg* arg);
301
+ #endif // NAPI_VERSION > 2
203
302
 
204
303
  #if NAPI_VERSION > 5
205
304
  template <typename T> T* GetInstanceData();
@@ -219,7 +318,28 @@ namespace Napi {
219
318
 
220
319
  private:
221
320
  napi_env _env;
321
+
322
+ #if NAPI_VERSION > 2
323
+ template <typename Hook, typename Arg>
324
+ class CleanupHook {
325
+ public:
326
+ CleanupHook(Env env, Hook hook, Arg* arg);
327
+ CleanupHook(Env env, Hook hook);
328
+ bool Remove(Env env);
329
+ bool IsEmpty() const;
330
+
331
+ private:
332
+ static inline void Wrapper(void* data) NAPI_NOEXCEPT;
333
+ static inline void WrapperWithArg(void* data) NAPI_NOEXCEPT;
334
+
335
+ void (*wrapper)(void* arg);
336
+ struct CleanupData {
337
+ Hook hook;
338
+ Arg* arg;
339
+ } * data;
340
+ };
222
341
  };
342
+ #endif // NAPI_VERSION > 2
223
343
 
224
344
  /// A JavaScript value of unknown type.
225
345
  ///
@@ -311,12 +431,16 @@ namespace Napi {
311
431
  /// value type will throw `Napi::Error`.
312
432
  template <typename T> T As() const;
313
433
 
314
- Boolean ToBoolean() const; ///< Coerces a value to a JavaScript boolean.
315
- Number ToNumber() const; ///< Coerces a value to a JavaScript number.
316
- String ToString() const; ///< Coerces a value to a JavaScript string.
317
- Object ToObject() const; ///< Coerces a value to a JavaScript object.
434
+ MaybeOrValue<Boolean> ToBoolean()
435
+ const; ///< Coerces a value to a JavaScript boolean.
436
+ MaybeOrValue<Number> ToNumber()
437
+ const; ///< Coerces a value to a JavaScript number.
438
+ MaybeOrValue<String> ToString()
439
+ const; ///< Coerces a value to a JavaScript string.
440
+ MaybeOrValue<Object> ToObject()
441
+ const; ///< Coerces a value to a JavaScript object.
318
442
 
319
- protected:
443
+ protected:
320
444
  /// !cond INTERNAL
321
445
  napi_env _env;
322
446
  napi_value _value;
@@ -536,7 +660,20 @@ namespace Napi {
536
660
  );
537
661
 
538
662
  /// Get a public Symbol (e.g. Symbol.iterator).
539
- static Symbol WellKnown(napi_env, const std::string& name);
663
+ static MaybeOrValue<Symbol> WellKnown(napi_env, const std::string& name);
664
+
665
+ // Create a symbol in the global registry, UTF-8 Encoded cpp string
666
+ static MaybeOrValue<Symbol> For(napi_env env,
667
+ const std::string& description);
668
+
669
+ // Create a symbol in the global registry, C style string (null terminated)
670
+ static MaybeOrValue<Symbol> For(napi_env env, const char* description);
671
+
672
+ // Create a symbol in the global registry, String value describing the symbol
673
+ static MaybeOrValue<Symbol> For(napi_env env, String description);
674
+
675
+ // Create a symbol in the global registry, napi_value describing the symbol
676
+ static MaybeOrValue<Symbol> For(napi_env env, napi_value description);
540
677
 
541
678
  Symbol(); ///< Creates a new _empty_ Symbol instance.
542
679
  Symbol(napi_env env,
@@ -546,16 +683,22 @@ namespace Napi {
546
683
  /// A JavaScript object value.
547
684
  class Object : public Value {
548
685
  public:
549
- /// Enables property and element assignments using indexing syntax.
550
- ///
551
- /// Example:
552
- ///
553
- /// Napi::Value propertyValue = object1['A'];
554
- /// object2['A'] = propertyValue;
555
- /// Napi::Value elementValue = array[0];
556
- /// array[1] = elementValue;
557
- template <typename Key>
558
- class PropertyLValue {
686
+ /// Enables property and element assignments using indexing syntax.
687
+ ///
688
+ /// This is a convenient helper to get and set object properties. As
689
+ /// getting and setting object properties may throw with JavaScript
690
+ /// exceptions, it is notable that these operations may fail.
691
+ /// When NODE_ADDON_API_ENABLE_MAYBE is defined, the process will abort
692
+ /// on JavaScript exceptions.
693
+ ///
694
+ /// Example:
695
+ ///
696
+ /// Napi::Value propertyValue = object1['A'];
697
+ /// object2['A'] = propertyValue;
698
+ /// Napi::Value elementValue = array[0];
699
+ /// array[1] = elementValue;
700
+ template <typename Key>
701
+ class PropertyLValue {
559
702
  public:
560
703
  /// Converts an L-value to a value.
561
704
  operator Value() const;
@@ -573,7 +716,7 @@ namespace Napi {
573
716
  Key _key;
574
717
 
575
718
  friend class Napi::Object;
576
- };
719
+ };
577
720
 
578
721
  /// Creates a new Object value.
579
722
  static Object New(napi_env env ///< Node-API environment
@@ -598,162 +741,178 @@ namespace Napi {
598
741
  uint32_t index /// Property / element index
599
742
  );
600
743
 
744
+ /// Gets or sets an indexed property or array element.
745
+ PropertyLValue<Value> operator[](Value index /// Property / element index
746
+ );
747
+
748
+ /// Gets or sets an indexed property or array element.
749
+ PropertyLValue<Value> operator[](Value index /// Property / element index
750
+ ) const;
751
+
601
752
  /// Gets a named property.
602
- Value operator [](
603
- const char* utf8name ///< UTF-8 encoded null-terminated property name
753
+ MaybeOrValue<Value> operator[](
754
+ const char* utf8name ///< UTF-8 encoded null-terminated property name
604
755
  ) const;
605
756
 
606
757
  /// Gets a named property.
607
- Value operator [](
608
- const std::string& utf8name ///< UTF-8 encoded property name
758
+ MaybeOrValue<Value> operator[](
759
+ const std::string& utf8name ///< UTF-8 encoded property name
609
760
  ) const;
610
761
 
611
762
  /// Gets an indexed property or array element.
612
- Value operator [](
613
- uint32_t index ///< Property / element index
763
+ MaybeOrValue<Value> operator[](uint32_t index ///< Property / element index
614
764
  ) const;
615
765
 
616
766
  /// Checks whether a property is present.
617
- bool Has(
618
- napi_value key ///< Property key primitive
767
+ MaybeOrValue<bool> Has(napi_value key ///< Property key primitive
619
768
  ) const;
620
769
 
621
770
  /// Checks whether a property is present.
622
- bool Has(
623
- Value key ///< Property key
771
+ MaybeOrValue<bool> Has(Value key ///< Property key
624
772
  ) const;
625
773
 
626
774
  /// Checks whether a named property is present.
627
- bool Has(
628
- const char* utf8name ///< UTF-8 encoded null-terminated property name
775
+ MaybeOrValue<bool> Has(
776
+ const char* utf8name ///< UTF-8 encoded null-terminated property name
629
777
  ) const;
630
778
 
631
779
  /// Checks whether a named property is present.
632
- bool Has(
633
- const std::string& utf8name ///< UTF-8 encoded property name
780
+ MaybeOrValue<bool> Has(
781
+ const std::string& utf8name ///< UTF-8 encoded property name
634
782
  ) const;
635
783
 
636
784
  /// Checks whether a own property is present.
637
- bool HasOwnProperty(
638
- napi_value key ///< Property key primitive
785
+ MaybeOrValue<bool> HasOwnProperty(
786
+ napi_value key ///< Property key primitive
639
787
  ) const;
640
788
 
641
789
  /// Checks whether a own property is present.
642
- bool HasOwnProperty(
643
- Value key ///< Property key
790
+ MaybeOrValue<bool> HasOwnProperty(Value key ///< Property key
644
791
  ) const;
645
792
 
646
793
  /// Checks whether a own property is present.
647
- bool HasOwnProperty(
648
- const char* utf8name ///< UTF-8 encoded null-terminated property name
794
+ MaybeOrValue<bool> HasOwnProperty(
795
+ const char* utf8name ///< UTF-8 encoded null-terminated property name
649
796
  ) const;
650
797
 
651
798
  /// Checks whether a own property is present.
652
- bool HasOwnProperty(
653
- const std::string& utf8name ///< UTF-8 encoded property name
799
+ MaybeOrValue<bool> HasOwnProperty(
800
+ const std::string& utf8name ///< UTF-8 encoded property name
654
801
  ) const;
655
802
 
656
803
  /// Gets a property.
657
- Value Get(
658
- napi_value key ///< Property key primitive
804
+ MaybeOrValue<Value> Get(napi_value key ///< Property key primitive
659
805
  ) const;
660
806
 
661
807
  /// Gets a property.
662
- Value Get(
663
- Value key ///< Property key
808
+ MaybeOrValue<Value> Get(Value key ///< Property key
664
809
  ) const;
665
810
 
666
811
  /// Gets a named property.
667
- Value Get(
668
- const char* utf8name ///< UTF-8 encoded null-terminated property name
812
+ MaybeOrValue<Value> Get(
813
+ const char* utf8name ///< UTF-8 encoded null-terminated property name
669
814
  ) const;
670
815
 
671
816
  /// Gets a named property.
672
- Value Get(
673
- const std::string& utf8name ///< UTF-8 encoded property name
817
+ MaybeOrValue<Value> Get(
818
+ const std::string& utf8name ///< UTF-8 encoded property name
674
819
  ) const;
675
820
 
676
821
  /// Sets a property.
677
822
  template <typename ValueType>
678
- bool Set(napi_value key, ///< Property key primitive
679
- const ValueType& value ///< Property value primitive
823
+ MaybeOrValue<bool> Set(napi_value key, ///< Property key primitive
824
+ const ValueType& value ///< Property value primitive
680
825
  );
681
826
 
682
827
  /// Sets a property.
683
828
  template <typename ValueType>
684
- bool Set(Value key, ///< Property key
685
- const ValueType& value ///< Property value
829
+ MaybeOrValue<bool> Set(Value key, ///< Property key
830
+ const ValueType& value ///< Property value
686
831
  );
687
832
 
688
833
  /// Sets a named property.
689
834
  template <typename ValueType>
690
- bool Set(
835
+ MaybeOrValue<bool> Set(
691
836
  const char* utf8name, ///< UTF-8 encoded null-terminated property name
692
837
  const ValueType& value);
693
838
 
694
839
  /// Sets a named property.
695
840
  template <typename ValueType>
696
- bool Set(const std::string& utf8name, ///< UTF-8 encoded property name
697
- const ValueType& value ///< Property value primitive
841
+ MaybeOrValue<bool> Set(
842
+ const std::string& utf8name, ///< UTF-8 encoded property name
843
+ const ValueType& value ///< Property value primitive
698
844
  );
699
845
 
700
846
  /// Delete property.
701
- bool Delete(
702
- napi_value key ///< Property key primitive
847
+ MaybeOrValue<bool> Delete(napi_value key ///< Property key primitive
703
848
  );
704
849
 
705
850
  /// Delete property.
706
- bool Delete(
707
- Value key ///< Property key
851
+ MaybeOrValue<bool> Delete(Value key ///< Property key
708
852
  );
709
853
 
710
854
  /// Delete property.
711
- bool Delete(
712
- const char* utf8name ///< UTF-8 encoded null-terminated property name
855
+ MaybeOrValue<bool> Delete(
856
+ const char* utf8name ///< UTF-8 encoded null-terminated property name
713
857
  );
714
858
 
715
859
  /// Delete property.
716
- bool Delete(
717
- const std::string& utf8name ///< UTF-8 encoded property name
860
+ MaybeOrValue<bool> Delete(
861
+ const std::string& utf8name ///< UTF-8 encoded property name
718
862
  );
719
863
 
720
864
  /// Checks whether an indexed property is present.
721
- bool Has(
722
- uint32_t index ///< Property / element index
865
+ MaybeOrValue<bool> Has(uint32_t index ///< Property / element index
723
866
  ) const;
724
867
 
725
868
  /// Gets an indexed property or array element.
726
- Value Get(
727
- uint32_t index ///< Property / element index
869
+ MaybeOrValue<Value> Get(uint32_t index ///< Property / element index
728
870
  ) const;
729
871
 
730
872
  /// Sets an indexed property or array element.
731
873
  template <typename ValueType>
732
- bool Set(uint32_t index, ///< Property / element index
733
- const ValueType& value ///< Property value primitive
874
+ MaybeOrValue<bool> Set(uint32_t index, ///< Property / element index
875
+ const ValueType& value ///< Property value primitive
734
876
  );
735
877
 
736
878
  /// Deletes an indexed property or array element.
737
- bool Delete(
738
- uint32_t index ///< Property / element index
879
+ MaybeOrValue<bool> Delete(uint32_t index ///< Property / element index
739
880
  );
740
881
 
741
- Array GetPropertyNames() const; ///< Get all property names
882
+ /// This operation can fail in case of Proxy.[[OwnPropertyKeys]] and
883
+ /// Proxy.[[GetOwnProperty]] calling into JavaScript. See:
884
+ /// -
885
+ /// https://tc39.es/ecma262/#sec-proxy-object-internal-methods-and-internal-slots-ownpropertykeys
886
+ /// -
887
+ /// https://tc39.es/ecma262/#sec-proxy-object-internal-methods-and-internal-slots-getownproperty-p
888
+ MaybeOrValue<Array> GetPropertyNames() const; ///< Get all property names
742
889
 
743
890
  /// Defines a property on the object.
744
- bool DefineProperty(
891
+ ///
892
+ /// This operation can fail in case of Proxy.[[DefineOwnProperty]] calling
893
+ /// into JavaScript. See
894
+ /// https://tc39.es/ecma262/#sec-proxy-object-internal-methods-and-internal-slots-defineownproperty-p-desc
895
+ MaybeOrValue<bool> DefineProperty(
745
896
  const PropertyDescriptor&
746
897
  property ///< Descriptor for the property to be defined
747
898
  );
748
899
 
749
900
  /// Defines properties on the object.
750
- bool DefineProperties(
901
+ ///
902
+ /// This operation can fail in case of Proxy.[[DefineOwnProperty]] calling
903
+ /// into JavaScript. See
904
+ /// https://tc39.es/ecma262/#sec-proxy-object-internal-methods-and-internal-slots-defineownproperty-p-desc
905
+ MaybeOrValue<bool> DefineProperties(
751
906
  const std::initializer_list<PropertyDescriptor>& properties
752
907
  ///< List of descriptors for the properties to be defined
753
908
  );
754
909
 
755
910
  /// Defines properties on the object.
756
- bool DefineProperties(
911
+ ///
912
+ /// This operation can fail in case of Proxy.[[DefineOwnProperty]] calling
913
+ /// into JavaScript. See
914
+ /// https://tc39.es/ecma262/#sec-proxy-object-internal-methods-and-internal-slots-defineownproperty-p-desc
915
+ MaybeOrValue<bool> DefineProperties(
757
916
  const std::vector<PropertyDescriptor>& properties
758
917
  ///< Vector of descriptors for the properties to be defined
759
918
  );
@@ -761,8 +920,13 @@ namespace Napi {
761
920
  /// Checks if an object is an instance created by a constructor function.
762
921
  ///
763
922
  /// This is equivalent to the JavaScript `instanceof` operator.
764
- bool InstanceOf(
765
- const Function& constructor ///< Constructor function
923
+ ///
924
+ /// This operation can fail in case of Proxy.[[GetPrototypeOf]] calling into
925
+ /// JavaScript.
926
+ /// See
927
+ /// https://tc39.es/ecma262/#sec-proxy-object-internal-methods-and-internal-slots-getprototypeof
928
+ MaybeOrValue<bool> InstanceOf(
929
+ const Function& constructor ///< Constructor function
766
930
  ) const;
767
931
 
768
932
  template <typename Finalizer, typename T>
@@ -772,9 +936,32 @@ namespace Napi {
772
936
  inline void AddFinalizer(Finalizer finalizeCallback,
773
937
  T* data,
774
938
  Hint* finalizeHint);
939
+
940
+ #ifdef NAPI_CPP_EXCEPTIONS
941
+ class const_iterator;
942
+
943
+ inline const_iterator begin() const;
944
+
945
+ inline const_iterator end() const;
946
+
947
+ class iterator;
948
+
949
+ inline iterator begin();
950
+
951
+ inline iterator end();
952
+ #endif // NAPI_CPP_EXCEPTIONS
953
+
775
954
  #if NAPI_VERSION >= 8
776
- bool Freeze();
777
- bool Seal();
955
+ /// This operation can fail in case of Proxy.[[GetPrototypeOf]] calling into
956
+ /// JavaScript.
957
+ /// See
958
+ /// https://tc39.es/ecma262/#sec-proxy-object-internal-methods-and-internal-slots-getprototypeof
959
+ MaybeOrValue<bool> Freeze();
960
+ /// This operation can fail in case of Proxy.[[GetPrototypeOf]] calling into
961
+ /// JavaScript.
962
+ /// See
963
+ /// https://tc39.es/ecma262/#sec-proxy-object-internal-methods-and-internal-slots-getprototypeof
964
+ MaybeOrValue<bool> Seal();
778
965
  #endif // NAPI_VERSION >= 8
779
966
  };
780
967
 
@@ -812,6 +999,55 @@ namespace Napi {
812
999
  uint32_t Length() const;
813
1000
  };
814
1001
 
1002
+ #ifdef NAPI_CPP_EXCEPTIONS
1003
+ class Object::const_iterator {
1004
+ private:
1005
+ enum class Type { BEGIN, END };
1006
+
1007
+ inline const_iterator(const Object* object, const Type type);
1008
+
1009
+ public:
1010
+ inline const_iterator& operator++();
1011
+
1012
+ inline bool operator==(const const_iterator& other) const;
1013
+
1014
+ inline bool operator!=(const const_iterator& other) const;
1015
+
1016
+ inline const std::pair<Value, Object::PropertyLValue<Value>> operator*()
1017
+ const;
1018
+
1019
+ private:
1020
+ const Napi::Object* _object;
1021
+ Array _keys;
1022
+ uint32_t _index;
1023
+
1024
+ friend class Object;
1025
+ };
1026
+
1027
+ class Object::iterator {
1028
+ private:
1029
+ enum class Type { BEGIN, END };
1030
+
1031
+ inline iterator(Object* object, const Type type);
1032
+
1033
+ public:
1034
+ inline iterator& operator++();
1035
+
1036
+ inline bool operator==(const iterator& other) const;
1037
+
1038
+ inline bool operator!=(const iterator& other) const;
1039
+
1040
+ inline std::pair<Value, Object::PropertyLValue<Value>> operator*();
1041
+
1042
+ private:
1043
+ Napi::Object* _object;
1044
+ Array _keys;
1045
+ uint32_t _index;
1046
+
1047
+ friend class Object;
1048
+ };
1049
+ #endif // NAPI_CPP_EXCEPTIONS
1050
+
815
1051
  /// A JavaScript array buffer value.
816
1052
  class ArrayBuffer : public Object {
817
1053
  public:
@@ -1108,30 +1344,37 @@ namespace Napi {
1108
1344
  Function();
1109
1345
  Function(napi_env env, napi_value value);
1110
1346
 
1111
- Value operator()(const std::initializer_list<napi_value>& args) const;
1112
-
1113
- Value Call(const std::initializer_list<napi_value>& args) const;
1114
- Value Call(const std::vector<napi_value>& args) const;
1115
- Value Call(size_t argc, const napi_value* args) const;
1116
- Value Call(napi_value recv,
1117
- const std::initializer_list<napi_value>& args) const;
1118
- Value Call(napi_value recv, const std::vector<napi_value>& args) const;
1119
- Value Call(napi_value recv, size_t argc, const napi_value* args) const;
1120
-
1121
- Value MakeCallback(napi_value recv,
1122
- const std::initializer_list<napi_value>& args,
1123
- napi_async_context context = nullptr) const;
1124
- Value MakeCallback(napi_value recv,
1125
- const std::vector<napi_value>& args,
1126
- napi_async_context context = nullptr) const;
1127
- Value MakeCallback(napi_value recv,
1128
- size_t argc,
1129
- const napi_value* args,
1130
- napi_async_context context = nullptr) const;
1131
-
1132
- Object New(const std::initializer_list<napi_value>& args) const;
1133
- Object New(const std::vector<napi_value>& args) const;
1134
- Object New(size_t argc, const napi_value* args) const;
1347
+ MaybeOrValue<Value> operator()(
1348
+ const std::initializer_list<napi_value>& args) const;
1349
+
1350
+ MaybeOrValue<Value> Call(
1351
+ const std::initializer_list<napi_value>& args) const;
1352
+ MaybeOrValue<Value> Call(const std::vector<napi_value>& args) const;
1353
+ MaybeOrValue<Value> Call(size_t argc, const napi_value* args) const;
1354
+ MaybeOrValue<Value> Call(
1355
+ napi_value recv, const std::initializer_list<napi_value>& args) const;
1356
+ MaybeOrValue<Value> Call(napi_value recv,
1357
+ const std::vector<napi_value>& args) const;
1358
+ MaybeOrValue<Value> Call(napi_value recv,
1359
+ size_t argc,
1360
+ const napi_value* args) const;
1361
+
1362
+ MaybeOrValue<Value> MakeCallback(
1363
+ napi_value recv,
1364
+ const std::initializer_list<napi_value>& args,
1365
+ napi_async_context context = nullptr) const;
1366
+ MaybeOrValue<Value> MakeCallback(napi_value recv,
1367
+ const std::vector<napi_value>& args,
1368
+ napi_async_context context = nullptr) const;
1369
+ MaybeOrValue<Value> MakeCallback(napi_value recv,
1370
+ size_t argc,
1371
+ const napi_value* args,
1372
+ napi_async_context context = nullptr) const;
1373
+
1374
+ MaybeOrValue<Object> New(
1375
+ const std::initializer_list<napi_value>& args) const;
1376
+ MaybeOrValue<Object> New(const std::vector<napi_value>& args) const;
1377
+ MaybeOrValue<Object> New(size_t argc, const napi_value* args) const;
1135
1378
  };
1136
1379
 
1137
1380
  class Promise : public Object {
@@ -1255,26 +1498,26 @@ namespace Napi {
1255
1498
  ObjectReference& operator =(ObjectReference&& other);
1256
1499
  NAPI_DISALLOW_ASSIGN(ObjectReference)
1257
1500
 
1258
- Napi::Value Get(const char* utf8name) const;
1259
- Napi::Value Get(const std::string& utf8name) const;
1260
- bool Set(const char* utf8name, napi_value value);
1261
- bool Set(const char* utf8name, Napi::Value value);
1262
- bool Set(const char* utf8name, const char* utf8value);
1263
- bool Set(const char* utf8name, bool boolValue);
1264
- bool Set(const char* utf8name, double numberValue);
1265
- bool Set(const std::string& utf8name, napi_value value);
1266
- bool Set(const std::string& utf8name, Napi::Value value);
1267
- bool Set(const std::string& utf8name, std::string& utf8value);
1268
- bool Set(const std::string& utf8name, bool boolValue);
1269
- bool Set(const std::string& utf8name, double numberValue);
1270
-
1271
- Napi::Value Get(uint32_t index) const;
1272
- bool Set(uint32_t index, const napi_value value);
1273
- bool Set(uint32_t index, const Napi::Value value);
1274
- bool Set(uint32_t index, const char* utf8value);
1275
- bool Set(uint32_t index, const std::string& utf8value);
1276
- bool Set(uint32_t index, bool boolValue);
1277
- bool Set(uint32_t index, double numberValue);
1501
+ MaybeOrValue<Napi::Value> Get(const char* utf8name) const;
1502
+ MaybeOrValue<Napi::Value> Get(const std::string& utf8name) const;
1503
+ MaybeOrValue<bool> Set(const char* utf8name, napi_value value);
1504
+ MaybeOrValue<bool> Set(const char* utf8name, Napi::Value value);
1505
+ MaybeOrValue<bool> Set(const char* utf8name, const char* utf8value);
1506
+ MaybeOrValue<bool> Set(const char* utf8name, bool boolValue);
1507
+ MaybeOrValue<bool> Set(const char* utf8name, double numberValue);
1508
+ MaybeOrValue<bool> Set(const std::string& utf8name, napi_value value);
1509
+ MaybeOrValue<bool> Set(const std::string& utf8name, Napi::Value value);
1510
+ MaybeOrValue<bool> Set(const std::string& utf8name, std::string& utf8value);
1511
+ MaybeOrValue<bool> Set(const std::string& utf8name, bool boolValue);
1512
+ MaybeOrValue<bool> Set(const std::string& utf8name, double numberValue);
1513
+
1514
+ MaybeOrValue<Napi::Value> Get(uint32_t index) const;
1515
+ MaybeOrValue<bool> Set(uint32_t index, const napi_value value);
1516
+ MaybeOrValue<bool> Set(uint32_t index, const Napi::Value value);
1517
+ MaybeOrValue<bool> Set(uint32_t index, const char* utf8value);
1518
+ MaybeOrValue<bool> Set(uint32_t index, const std::string& utf8value);
1519
+ MaybeOrValue<bool> Set(uint32_t index, bool boolValue);
1520
+ MaybeOrValue<bool> Set(uint32_t index, double numberValue);
1278
1521
 
1279
1522
  protected:
1280
1523
  ObjectReference(const ObjectReference&);
@@ -1292,27 +1535,37 @@ namespace Napi {
1292
1535
  FunctionReference& operator =(FunctionReference&& other);
1293
1536
  NAPI_DISALLOW_ASSIGN_COPY(FunctionReference)
1294
1537
 
1295
- Napi::Value operator ()(const std::initializer_list<napi_value>& args) const;
1296
-
1297
- Napi::Value Call(const std::initializer_list<napi_value>& args) const;
1298
- Napi::Value Call(const std::vector<napi_value>& args) const;
1299
- Napi::Value Call(napi_value recv, const std::initializer_list<napi_value>& args) const;
1300
- Napi::Value Call(napi_value recv, const std::vector<napi_value>& args) const;
1301
- Napi::Value Call(napi_value recv, size_t argc, const napi_value* args) const;
1302
-
1303
- Napi::Value MakeCallback(napi_value recv,
1304
- const std::initializer_list<napi_value>& args,
1305
- napi_async_context context = nullptr) const;
1306
- Napi::Value MakeCallback(napi_value recv,
1307
- const std::vector<napi_value>& args,
1308
- napi_async_context context = nullptr) const;
1309
- Napi::Value MakeCallback(napi_value recv,
1310
- size_t argc,
1311
- const napi_value* args,
1312
- napi_async_context context = nullptr) const;
1313
-
1314
- Object New(const std::initializer_list<napi_value>& args) const;
1315
- Object New(const std::vector<napi_value>& args) const;
1538
+ MaybeOrValue<Napi::Value> operator()(
1539
+ const std::initializer_list<napi_value>& args) const;
1540
+
1541
+ MaybeOrValue<Napi::Value> Call(
1542
+ const std::initializer_list<napi_value>& args) const;
1543
+ MaybeOrValue<Napi::Value> Call(const std::vector<napi_value>& args) const;
1544
+ MaybeOrValue<Napi::Value> Call(
1545
+ napi_value recv, const std::initializer_list<napi_value>& args) const;
1546
+ MaybeOrValue<Napi::Value> Call(napi_value recv,
1547
+ const std::vector<napi_value>& args) const;
1548
+ MaybeOrValue<Napi::Value> Call(napi_value recv,
1549
+ size_t argc,
1550
+ const napi_value* args) const;
1551
+
1552
+ MaybeOrValue<Napi::Value> MakeCallback(
1553
+ napi_value recv,
1554
+ const std::initializer_list<napi_value>& args,
1555
+ napi_async_context context = nullptr) const;
1556
+ MaybeOrValue<Napi::Value> MakeCallback(
1557
+ napi_value recv,
1558
+ const std::vector<napi_value>& args,
1559
+ napi_async_context context = nullptr) const;
1560
+ MaybeOrValue<Napi::Value> MakeCallback(
1561
+ napi_value recv,
1562
+ size_t argc,
1563
+ const napi_value* args,
1564
+ napi_async_context context = nullptr) const;
1565
+
1566
+ MaybeOrValue<Object> New(
1567
+ const std::initializer_list<napi_value>& args) const;
1568
+ MaybeOrValue<Object> New(const std::vector<napi_value>& args) const;
1316
1569
  };
1317
1570
 
1318
1571
  // Shortcuts to creating a new reference with inferred type and refcount = 0.
@@ -1446,6 +1699,8 @@ namespace Napi {
1446
1699
  const std::string& Message() const NAPI_NOEXCEPT;
1447
1700
  void ThrowAsJavaScriptException() const;
1448
1701
 
1702
+ Object Value() const;
1703
+
1449
1704
  #ifdef NAPI_CPP_EXCEPTIONS
1450
1705
  const char* what() const NAPI_NOEXCEPT override;
1451
1706
  #endif // NAPI_CPP_EXCEPTIONS
@@ -1465,7 +1720,9 @@ namespace Napi {
1465
1720
  /// !endcond
1466
1721
 
1467
1722
  private:
1468
- mutable std::string _message;
1723
+ const char* ERROR_WRAP_VALUE =
1724
+ "4bda9e7e-4913-4dbc-95de-891cbf66598e-errorVal";
1725
+ mutable std::string _message;
1469
1726
  };
1470
1727
 
1471
1728
  class TypeError : public Error {
@@ -2474,9 +2731,8 @@ namespace Napi {
2474
2731
  Finalizer finalizeCallback,
2475
2732
  FinalizerDataType* data = nullptr);
2476
2733
 
2477
- TypedThreadSafeFunction<ContextType, DataType, CallJs>();
2478
- TypedThreadSafeFunction<ContextType, DataType, CallJs>(
2479
- napi_threadsafe_function tsFunctionValue);
2734
+ TypedThreadSafeFunction();
2735
+ TypedThreadSafeFunction(napi_threadsafe_function tsFunctionValue);
2480
2736
 
2481
2737
  operator napi_threadsafe_function() const;
2482
2738