node-addon-api 3.0.0 → 3.2.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 (74) hide show
  1. package/CHANGELOG.md +242 -2
  2. package/README.md +106 -62
  3. package/common.gypi +1 -1
  4. package/index.js +5 -2
  5. package/napi-inl.deprecated.h +8 -8
  6. package/napi-inl.h +1221 -548
  7. package/napi.h +823 -524
  8. package/package-support.json +21 -0
  9. package/package.json +96 -4
  10. package/tools/README.md +8 -2
  11. package/tools/clang-format.js +67 -0
  12. package/tools/conversion.js +4 -4
  13. package/.editorconfig +0 -8
  14. package/.travis.yml +0 -59
  15. package/CODE_OF_CONDUCT.md +0 -4
  16. package/CONTRIBUTING.md +0 -66
  17. package/appveyor.yml +0 -48
  18. package/benchmark/README.md +0 -47
  19. package/benchmark/binding.gyp +0 -25
  20. package/benchmark/function_args.cc +0 -153
  21. package/benchmark/function_args.js +0 -52
  22. package/benchmark/index.js +0 -34
  23. package/benchmark/property_descriptor.cc +0 -60
  24. package/benchmark/property_descriptor.js +0 -29
  25. package/doc/Doxyfile +0 -2450
  26. package/doc/array_buffer.md +0 -129
  27. package/doc/async_context.md +0 -86
  28. package/doc/async_operations.md +0 -31
  29. package/doc/async_worker.md +0 -427
  30. package/doc/async_worker_variants.md +0 -456
  31. package/doc/basic_types.md +0 -423
  32. package/doc/bigint.md +0 -93
  33. package/doc/boolean.md +0 -64
  34. package/doc/buffer.md +0 -140
  35. package/doc/callback_scope.md +0 -54
  36. package/doc/callbackinfo.md +0 -97
  37. package/doc/checker-tool.md +0 -32
  38. package/doc/class_property_descriptor.md +0 -117
  39. package/doc/cmake-js.md +0 -68
  40. package/doc/conversion-tool.md +0 -28
  41. package/doc/creating_a_release.md +0 -62
  42. package/doc/dataview.md +0 -244
  43. package/doc/date.md +0 -68
  44. package/doc/env.md +0 -77
  45. package/doc/error.md +0 -115
  46. package/doc/error_handling.md +0 -186
  47. package/doc/escapable_handle_scope.md +0 -82
  48. package/doc/external.md +0 -59
  49. package/doc/function.md +0 -401
  50. package/doc/function_reference.md +0 -238
  51. package/doc/generator.md +0 -13
  52. package/doc/handle_scope.md +0 -65
  53. package/doc/memory_management.md +0 -27
  54. package/doc/node-gyp.md +0 -82
  55. package/doc/number.md +0 -163
  56. package/doc/object.md +0 -275
  57. package/doc/object_lifetime_management.md +0 -83
  58. package/doc/object_reference.md +0 -117
  59. package/doc/object_wrap.md +0 -833
  60. package/doc/prebuild_tools.md +0 -16
  61. package/doc/promises.md +0 -74
  62. package/doc/property_descriptor.md +0 -286
  63. package/doc/range_error.md +0 -59
  64. package/doc/reference.md +0 -111
  65. package/doc/setup.md +0 -81
  66. package/doc/string.md +0 -89
  67. package/doc/symbol.md +0 -44
  68. package/doc/threadsafe_function.md +0 -320
  69. package/doc/type_error.md +0 -59
  70. package/doc/typed_array.md +0 -74
  71. package/doc/typed_array_of.md +0 -133
  72. package/doc/value.md +0 -278
  73. package/doc/version_management.md +0 -43
  74. package/doc/working_with_javascript_values.md +0 -14
@@ -11,7 +11,7 @@ PropertyDescriptor::Accessor(const char* utf8name,
11
11
  Getter getter,
12
12
  napi_property_attributes attributes,
13
13
  void* /*data*/) {
14
- typedef details::CallbackData<Getter, Napi::Value> CbData;
14
+ using CbData = details::CallbackData<Getter, Napi::Value>;
15
15
  // TODO: Delete when the function is destroyed
16
16
  auto callbackData = new CbData({ getter, nullptr });
17
17
 
@@ -40,7 +40,7 @@ inline PropertyDescriptor PropertyDescriptor::Accessor(napi_value name,
40
40
  Getter getter,
41
41
  napi_property_attributes attributes,
42
42
  void* /*data*/) {
43
- typedef details::CallbackData<Getter, Napi::Value> CbData;
43
+ using CbData = details::CallbackData<Getter, Napi::Value>;
44
44
  // TODO: Delete when the function is destroyed
45
45
  auto callbackData = new CbData({ getter, nullptr });
46
46
 
@@ -71,7 +71,7 @@ inline PropertyDescriptor PropertyDescriptor::Accessor(const char* utf8name,
71
71
  Setter setter,
72
72
  napi_property_attributes attributes,
73
73
  void* /*data*/) {
74
- typedef details::AccessorCallbackData<Getter, Setter> CbData;
74
+ using CbData = details::AccessorCallbackData<Getter, Setter>;
75
75
  // TODO: Delete when the function is destroyed
76
76
  auto callbackData = new CbData({ getter, setter, nullptr });
77
77
 
@@ -102,7 +102,7 @@ inline PropertyDescriptor PropertyDescriptor::Accessor(napi_value name,
102
102
  Setter setter,
103
103
  napi_property_attributes attributes,
104
104
  void* /*data*/) {
105
- typedef details::AccessorCallbackData<Getter, Setter> CbData;
105
+ using CbData = details::AccessorCallbackData<Getter, Setter>;
106
106
  // TODO: Delete when the function is destroyed
107
107
  auto callbackData = new CbData({ getter, setter, nullptr });
108
108
 
@@ -133,8 +133,8 @@ inline PropertyDescriptor PropertyDescriptor::Function(const char* utf8name,
133
133
  Callable cb,
134
134
  napi_property_attributes attributes,
135
135
  void* /*data*/) {
136
- typedef decltype(cb(CallbackInfo(nullptr, nullptr))) ReturnType;
137
- typedef details::CallbackData<Callable, ReturnType> CbData;
136
+ using ReturnType = decltype(cb(CallbackInfo(nullptr, nullptr)));
137
+ using CbData = details::CallbackData<Callable, ReturnType>;
138
138
  // TODO: Delete when the function is destroyed
139
139
  auto callbackData = new CbData({ cb, nullptr });
140
140
 
@@ -163,8 +163,8 @@ inline PropertyDescriptor PropertyDescriptor::Function(napi_value name,
163
163
  Callable cb,
164
164
  napi_property_attributes attributes,
165
165
  void* /*data*/) {
166
- typedef decltype(cb(CallbackInfo(nullptr, nullptr))) ReturnType;
167
- typedef details::CallbackData<Callable, ReturnType> CbData;
166
+ using ReturnType = decltype(cb(CallbackInfo(nullptr, nullptr)));
167
+ using CbData = details::CallbackData<Callable, ReturnType>;
168
168
  // TODO: Delete when the function is destroyed
169
169
  auto callbackData = new CbData({ cb, nullptr });
170
170