koffi 2.16.0-beta.2 → 2.16.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 (425) hide show
  1. package/CHANGELOG.md +59 -0
  2. package/build/koffi/darwin_arm64/koffi.node +0 -0
  3. package/build/koffi/darwin_x64/koffi.node +0 -0
  4. package/build/koffi/freebsd_arm64/koffi.node +0 -0
  5. package/build/koffi/freebsd_ia32/koffi.node +0 -0
  6. package/build/koffi/freebsd_x64/koffi.node +0 -0
  7. package/build/koffi/linux_arm64/koffi.node +0 -0
  8. package/build/koffi/linux_armhf/koffi.node +0 -0
  9. package/build/koffi/linux_ia32/koffi.node +0 -0
  10. package/build/koffi/linux_loong64/koffi.node +0 -0
  11. package/build/koffi/linux_riscv64d/koffi.node +0 -0
  12. package/build/koffi/linux_x64/koffi.node +0 -0
  13. package/build/koffi/musl_arm64/koffi.node +0 -0
  14. package/build/koffi/musl_x64/koffi.node +0 -0
  15. package/build/koffi/openbsd_ia32/koffi.node +0 -0
  16. package/build/koffi/openbsd_x64/koffi.node +0 -0
  17. package/build/koffi/win32_arm64/koffi.exp +0 -0
  18. package/build/koffi/win32_arm64/koffi.lib +0 -0
  19. package/build/koffi/win32_arm64/koffi.node +0 -0
  20. package/build/koffi/win32_ia32/koffi.exp +0 -0
  21. package/build/koffi/win32_ia32/koffi.lib +0 -0
  22. package/build/koffi/win32_ia32/koffi.node +0 -0
  23. package/build/koffi/win32_x64/koffi.exp +0 -0
  24. package/build/koffi/win32_x64/koffi.lib +0 -0
  25. package/build/koffi/win32_x64/koffi.node +0 -0
  26. package/index.d.ts +9 -11
  27. package/index.js +6 -9
  28. package/indirect.js +6 -9
  29. package/lib/native/base/base.cc +1 -6
  30. package/package.json +3 -3
  31. package/src/cnoke/assets/FindCNoke.cmake +27 -16
  32. package/src/cnoke/assets/toolchains.json +126 -0
  33. package/src/cnoke/cnoke.js +27 -33
  34. package/src/cnoke/src/builder.js +124 -63
  35. package/src/cnoke/src/tools.js +1 -5
  36. package/src/koffi/CMakeLists.txt +32 -21
  37. package/src/koffi/src/{abi/arm32.cc → abi_arm32.cc} +235 -238
  38. package/src/koffi/src/{abi/arm32_asm.S → abi_arm32_asm.S} +19 -15
  39. package/src/koffi/src/{abi/arm64.cc → abi_arm64.cc} +253 -274
  40. package/src/koffi/src/{abi/arm64_asm.S → abi_arm64_asm.S} +16 -10
  41. package/src/koffi/src/{abi/arm64_asm.asm → abi_arm64_asm.asm} +17 -10
  42. package/src/koffi/src/{abi/loong64_asm.S → abi_loong64_asm.S} +16 -10
  43. package/src/koffi/src/{abi/riscv64.cc → abi_riscv64.cc} +233 -236
  44. package/src/koffi/src/{abi/riscv64_asm.S → abi_riscv64_asm.S} +16 -10
  45. package/src/koffi/src/{abi/x64_sysv.cc → abi_x64_sysv.cc} +208 -212
  46. package/src/koffi/src/{abi/x64_sysv_asm.S → abi_x64_sysv_asm.S} +17 -10
  47. package/src/koffi/src/{abi/x64_win.cc → abi_x64_win.cc} +175 -206
  48. package/src/koffi/src/{abi/x64_win_asm.S → abi_x64_win_asm.S} +49 -27
  49. package/src/koffi/src/{abi/x64_win_asm.asm → abi_x64_win_asm.asm} +54 -27
  50. package/src/koffi/src/{abi/x86.cc → abi_x86.cc} +187 -226
  51. package/src/koffi/src/{abi/x86_asm.S → abi_x86_asm.S} +36 -21
  52. package/src/koffi/src/{abi/x86_asm.asm → abi_x86_asm.asm} +31 -16
  53. package/src/koffi/src/call.cc +473 -287
  54. package/src/koffi/src/call.hh +15 -18
  55. package/src/koffi/src/ffi.cc +167 -183
  56. package/src/koffi/src/ffi.hh +59 -13
  57. package/src/koffi/src/init.js +1 -0
  58. package/src/koffi/src/util.cc +113 -159
  59. package/src/koffi/src/util.hh +23 -74
  60. package/src/koffi/src/win32.cc +13 -0
  61. package/src/koffi/src/win32.hh +7 -0
  62. package/src/koffi/tools/write_trampolines.js +77 -0
  63. package/doc/README.md +0 -27
  64. package/doc/assets.ini +0 -24
  65. package/doc/build.sh +0 -9
  66. package/doc/develop.sh +0 -15
  67. package/doc/pages/404.md +0 -17
  68. package/doc/pages.ini +0 -86
  69. package/doc/static/highlight.js +0 -8
  70. package/doc/static/koffi.css +0 -11
  71. package/doc/static/koffi.png +0 -0
  72. package/doc/static/logo.webp +0 -0
  73. package/doc/static/perf_linux.png +0 -0
  74. package/doc/static/perf_windows.png +0 -0
  75. package/doc/static/print.css +0 -10
  76. package/doc/templates/code.html +0 -48
  77. package/doc/templates/page.html +0 -47
  78. package/src/koffi/cmake/raylib.cmake +0 -85
  79. package/src/koffi/cmake/sqlite3.cmake +0 -9
  80. package/src/koffi/examples/electron-builder/README.md +0 -11
  81. package/src/koffi/examples/electron-builder/package.json +0 -21
  82. package/src/koffi/examples/electron-builder/src/app.js +0 -20
  83. package/src/koffi/examples/electron-builder/src/index.html +0 -143
  84. package/src/koffi/examples/electron-builder/src/preload.js +0 -5
  85. package/src/koffi/examples/electron-forge/README.md +0 -25
  86. package/src/koffi/examples/electron-forge/forge.config.js +0 -63
  87. package/src/koffi/examples/electron-forge/package.json +0 -39
  88. package/src/koffi/examples/electron-forge/src/index.css +0 -7
  89. package/src/koffi/examples/electron-forge/src/index.html +0 -143
  90. package/src/koffi/examples/electron-forge/src/main.js +0 -52
  91. package/src/koffi/examples/electron-forge/src/preload.js +0 -5
  92. package/src/koffi/examples/electron-forge/src/renderer.js +0 -31
  93. package/src/koffi/examples/electron-forge/webpack.main.config.js +0 -11
  94. package/src/koffi/examples/electron-forge/webpack.renderer.config.js +0 -13
  95. package/src/koffi/examples/electron-forge/webpack.rules.js +0 -35
  96. package/src/koffi/examples/node-esbuild/README.md +0 -19
  97. package/src/koffi/examples/node-esbuild/index.js +0 -2
  98. package/src/koffi/examples/node-esbuild/package.json +0 -16
  99. package/src/koffi/examples/nwjs/README.md +0 -20
  100. package/src/koffi/examples/nwjs/package.json +0 -11
  101. package/src/koffi/examples/nwjs/src/index.html +0 -145
  102. package/src/koffi/examples/nwjs/src/package.json +0 -10
  103. package/src/koffi/examples/yao-pkg/README.md +0 -17
  104. package/src/koffi/examples/yao-pkg/index.js +0 -2
  105. package/src/koffi/examples/yao-pkg/package.json +0 -22
  106. package/src/koffi/src/primitives.inc +0 -39
  107. package/src/koffi/src/trampolines/armasm.inc +0 -32771
  108. package/src/koffi/src/trampolines/gnu.inc +0 -24577
  109. package/src/koffi/src/trampolines/masm32.inc +0 -32769
  110. package/src/koffi/src/trampolines/masm64.inc +0 -32769
  111. package/src/koffi/src/trampolines/prototypes.inc +0 -16388
  112. package/vendor/node-addon-api/CHANGELOG.md +0 -1272
  113. package/vendor/node-addon-api/CODE_OF_CONDUCT.md +0 -4
  114. package/vendor/node-addon-api/CONTRIBUTING.md +0 -203
  115. package/vendor/node-addon-api/appveyor.yml +0 -37
  116. package/vendor/node-addon-api/benchmark/README.md +0 -47
  117. package/vendor/node-addon-api/benchmark/binding.gyp +0 -25
  118. package/vendor/node-addon-api/benchmark/function_args.cc +0 -250
  119. package/vendor/node-addon-api/benchmark/function_args.js +0 -60
  120. package/vendor/node-addon-api/benchmark/index.js +0 -34
  121. package/vendor/node-addon-api/benchmark/property_descriptor.cc +0 -84
  122. package/vendor/node-addon-api/benchmark/property_descriptor.js +0 -38
  123. package/vendor/node-addon-api/common.gypi +0 -21
  124. package/vendor/node-addon-api/doc/README.md +0 -145
  125. package/vendor/node-addon-api/doc/addon.md +0 -163
  126. package/vendor/node-addon-api/doc/array.md +0 -81
  127. package/vendor/node-addon-api/doc/array_buffer.md +0 -165
  128. package/vendor/node-addon-api/doc/async_context.md +0 -86
  129. package/vendor/node-addon-api/doc/async_operations.md +0 -31
  130. package/vendor/node-addon-api/doc/async_worker.md +0 -428
  131. package/vendor/node-addon-api/doc/async_worker_variants.md +0 -578
  132. package/vendor/node-addon-api/doc/basic_env.md +0 -200
  133. package/vendor/node-addon-api/doc/bigint.md +0 -97
  134. package/vendor/node-addon-api/doc/boolean.md +0 -68
  135. package/vendor/node-addon-api/doc/buffer.md +0 -245
  136. package/vendor/node-addon-api/doc/callback_scope.md +0 -54
  137. package/vendor/node-addon-api/doc/callbackinfo.md +0 -97
  138. package/vendor/node-addon-api/doc/checker-tool.md +0 -32
  139. package/vendor/node-addon-api/doc/class_property_descriptor.md +0 -123
  140. package/vendor/node-addon-api/doc/cmake-js.md +0 -87
  141. package/vendor/node-addon-api/doc/contributing/creating_a_release.md +0 -95
  142. package/vendor/node-addon-api/doc/conversion-tool.md +0 -28
  143. package/vendor/node-addon-api/doc/dataview.md +0 -248
  144. package/vendor/node-addon-api/doc/date.md +0 -68
  145. package/vendor/node-addon-api/doc/env.md +0 -87
  146. package/vendor/node-addon-api/doc/error.md +0 -120
  147. package/vendor/node-addon-api/doc/error_handling.md +0 -266
  148. package/vendor/node-addon-api/doc/escapable_handle_scope.md +0 -80
  149. package/vendor/node-addon-api/doc/external.md +0 -79
  150. package/vendor/node-addon-api/doc/external_buffer.md +0 -18
  151. package/vendor/node-addon-api/doc/finalization.md +0 -153
  152. package/vendor/node-addon-api/doc/function.md +0 -402
  153. package/vendor/node-addon-api/doc/function_reference.md +0 -238
  154. package/vendor/node-addon-api/doc/generator.md +0 -13
  155. package/vendor/node-addon-api/doc/handle_scope.md +0 -77
  156. package/vendor/node-addon-api/doc/hierarchy.md +0 -95
  157. package/vendor/node-addon-api/doc/instance_wrap.md +0 -408
  158. package/vendor/node-addon-api/doc/maybe.md +0 -76
  159. package/vendor/node-addon-api/doc/memory_management.md +0 -27
  160. package/vendor/node-addon-api/doc/name.md +0 -29
  161. package/vendor/node-addon-api/doc/node-gyp.md +0 -82
  162. package/vendor/node-addon-api/doc/number.md +0 -163
  163. package/vendor/node-addon-api/doc/object.md +0 -411
  164. package/vendor/node-addon-api/doc/object_lifetime_management.md +0 -83
  165. package/vendor/node-addon-api/doc/object_reference.md +0 -117
  166. package/vendor/node-addon-api/doc/object_wrap.md +0 -604
  167. package/vendor/node-addon-api/doc/prebuild_tools.md +0 -16
  168. package/vendor/node-addon-api/doc/promises.md +0 -130
  169. package/vendor/node-addon-api/doc/property_descriptor.md +0 -286
  170. package/vendor/node-addon-api/doc/propertylvalue.md +0 -50
  171. package/vendor/node-addon-api/doc/range_error.md +0 -59
  172. package/vendor/node-addon-api/doc/reference.md +0 -113
  173. package/vendor/node-addon-api/doc/setup.md +0 -115
  174. package/vendor/node-addon-api/doc/string.md +0 -93
  175. package/vendor/node-addon-api/doc/symbol.md +0 -61
  176. package/vendor/node-addon-api/doc/syntax_error.md +0 -66
  177. package/vendor/node-addon-api/doc/threadsafe.md +0 -121
  178. package/vendor/node-addon-api/doc/threadsafe_function.md +0 -290
  179. package/vendor/node-addon-api/doc/type_error.md +0 -59
  180. package/vendor/node-addon-api/doc/type_taggable.md +0 -40
  181. package/vendor/node-addon-api/doc/typed_array.md +0 -78
  182. package/vendor/node-addon-api/doc/typed_array_of.md +0 -137
  183. package/vendor/node-addon-api/doc/typed_threadsafe_function.md +0 -306
  184. package/vendor/node-addon-api/doc/value.md +0 -368
  185. package/vendor/node-addon-api/doc/version_management.md +0 -43
  186. package/vendor/node-addon-api/eslint.config.js +0 -5
  187. package/vendor/node-addon-api/except.gypi +0 -25
  188. package/vendor/node-addon-api/index.js +0 -14
  189. package/vendor/node-addon-api/node_addon_api.gyp +0 -42
  190. package/vendor/node-addon-api/node_api.gyp +0 -9
  191. package/vendor/node-addon-api/noexcept.gypi +0 -26
  192. package/vendor/node-addon-api/nothing.c +0 -0
  193. package/vendor/node-addon-api/package-support.json +0 -21
  194. package/vendor/node-addon-api/package.json +0 -480
  195. package/vendor/node-addon-api/release-please-config.json +0 -15
  196. package/vendor/node-addon-api/test/README.md +0 -91
  197. package/vendor/node-addon-api/test/addon.cc +0 -44
  198. package/vendor/node-addon-api/test/addon.js +0 -7
  199. package/vendor/node-addon-api/test/addon_build/index.js +0 -49
  200. package/vendor/node-addon-api/test/addon_build/tpl/addon.cc +0 -18
  201. package/vendor/node-addon-api/test/addon_build/tpl/binding.gyp +0 -63
  202. package/vendor/node-addon-api/test/addon_build/tpl/index.js +0 -9
  203. package/vendor/node-addon-api/test/addon_build/tpl/package.json +0 -11
  204. package/vendor/node-addon-api/test/addon_data.cc +0 -98
  205. package/vendor/node-addon-api/test/addon_data.js +0 -24
  206. package/vendor/node-addon-api/test/array_buffer.cc +0 -243
  207. package/vendor/node-addon-api/test/array_buffer.js +0 -70
  208. package/vendor/node-addon-api/test/async_context.cc +0 -36
  209. package/vendor/node-addon-api/test/async_context.js +0 -122
  210. package/vendor/node-addon-api/test/async_progress_queue_worker.cc +0 -248
  211. package/vendor/node-addon-api/test/async_progress_queue_worker.js +0 -180
  212. package/vendor/node-addon-api/test/async_progress_worker.cc +0 -357
  213. package/vendor/node-addon-api/test/async_progress_worker.js +0 -200
  214. package/vendor/node-addon-api/test/async_worker.cc +0 -341
  215. package/vendor/node-addon-api/test/async_worker.js +0 -264
  216. package/vendor/node-addon-api/test/async_worker_nocallback.js +0 -19
  217. package/vendor/node-addon-api/test/async_worker_persistent.cc +0 -63
  218. package/vendor/node-addon-api/test/async_worker_persistent.js +0 -24
  219. package/vendor/node-addon-api/test/basic_types/array.cc +0 -40
  220. package/vendor/node-addon-api/test/basic_types/array.js +0 -34
  221. package/vendor/node-addon-api/test/basic_types/boolean.cc +0 -40
  222. package/vendor/node-addon-api/test/basic_types/boolean.js +0 -34
  223. package/vendor/node-addon-api/test/basic_types/number.cc +0 -105
  224. package/vendor/node-addon-api/test/basic_types/number.js +0 -115
  225. package/vendor/node-addon-api/test/basic_types/value.cc +0 -177
  226. package/vendor/node-addon-api/test/basic_types/value.js +0 -173
  227. package/vendor/node-addon-api/test/bigint.cc +0 -91
  228. package/vendor/node-addon-api/test/bigint.js +0 -53
  229. package/vendor/node-addon-api/test/binding-swallowexcept.cc +0 -12
  230. package/vendor/node-addon-api/test/binding.cc +0 -200
  231. package/vendor/node-addon-api/test/binding.gyp +0 -160
  232. package/vendor/node-addon-api/test/buffer.cc +0 -185
  233. package/vendor/node-addon-api/test/buffer.h +0 -26
  234. package/vendor/node-addon-api/test/buffer.js +0 -150
  235. package/vendor/node-addon-api/test/buffer_new_or_copy-inl.h +0 -68
  236. package/vendor/node-addon-api/test/buffer_no_external.cc +0 -24
  237. package/vendor/node-addon-api/test/callbackInfo.cc +0 -27
  238. package/vendor/node-addon-api/test/callbackInfo.js +0 -9
  239. package/vendor/node-addon-api/test/callbackscope.cc +0 -39
  240. package/vendor/node-addon-api/test/callbackscope.js +0 -49
  241. package/vendor/node-addon-api/test/child_processes/addon.js +0 -11
  242. package/vendor/node-addon-api/test/child_processes/addon_data.js +0 -24
  243. package/vendor/node-addon-api/test/child_processes/objectwrap_function.js +0 -22
  244. package/vendor/node-addon-api/test/child_processes/threadsafe_function_exception.js +0 -33
  245. package/vendor/node-addon-api/test/child_processes/typed_threadsafe_function_exception.js +0 -19
  246. package/vendor/node-addon-api/test/common/index.js +0 -246
  247. package/vendor/node-addon-api/test/common/test_helper.h +0 -71
  248. package/vendor/node-addon-api/test/dataview/dataview.cc +0 -48
  249. package/vendor/node-addon-api/test/dataview/dataview.js +0 -35
  250. package/vendor/node-addon-api/test/dataview/dataview_read_write.cc +0 -115
  251. package/vendor/node-addon-api/test/dataview/dataview_read_write.js +0 -92
  252. package/vendor/node-addon-api/test/date.cc +0 -45
  253. package/vendor/node-addon-api/test/date.js +0 -18
  254. package/vendor/node-addon-api/test/env_cleanup.cc +0 -100
  255. package/vendor/node-addon-api/test/env_cleanup.js +0 -55
  256. package/vendor/node-addon-api/test/env_misc.cc +0 -25
  257. package/vendor/node-addon-api/test/env_misc.js +0 -12
  258. package/vendor/node-addon-api/test/error.cc +0 -436
  259. package/vendor/node-addon-api/test/error.js +0 -111
  260. package/vendor/node-addon-api/test/error_handling_for_primitives.cc +0 -13
  261. package/vendor/node-addon-api/test/error_handling_for_primitives.js +0 -29
  262. package/vendor/node-addon-api/test/error_terminating_environment.js +0 -99
  263. package/vendor/node-addon-api/test/except_all.cc +0 -22
  264. package/vendor/node-addon-api/test/except_all.js +0 -14
  265. package/vendor/node-addon-api/test/exports.js +0 -19
  266. package/vendor/node-addon-api/test/external.cc +0 -85
  267. package/vendor/node-addon-api/test/external.js +0 -85
  268. package/vendor/node-addon-api/test/finalizer_order.cc +0 -152
  269. package/vendor/node-addon-api/test/finalizer_order.js +0 -98
  270. package/vendor/node-addon-api/test/function.cc +0 -338
  271. package/vendor/node-addon-api/test/function.js +0 -137
  272. package/vendor/node-addon-api/test/function_reference.cc +0 -204
  273. package/vendor/node-addon-api/test/function_reference.js +0 -157
  274. package/vendor/node-addon-api/test/globalObject/global_object.cc +0 -61
  275. package/vendor/node-addon-api/test/globalObject/global_object_delete_property.cc +0 -31
  276. package/vendor/node-addon-api/test/globalObject/global_object_delete_property.js +0 -58
  277. package/vendor/node-addon-api/test/globalObject/global_object_get_property.cc +0 -40
  278. package/vendor/node-addon-api/test/globalObject/global_object_get_property.js +0 -56
  279. package/vendor/node-addon-api/test/globalObject/global_object_has_own_property.cc +0 -28
  280. package/vendor/node-addon-api/test/globalObject/global_object_has_own_property.js +0 -46
  281. package/vendor/node-addon-api/test/globalObject/global_object_set_property.cc +0 -31
  282. package/vendor/node-addon-api/test/globalObject/global_object_set_property.js +0 -56
  283. package/vendor/node-addon-api/test/handlescope.cc +0 -86
  284. package/vendor/node-addon-api/test/handlescope.js +0 -16
  285. package/vendor/node-addon-api/test/index.js +0 -160
  286. package/vendor/node-addon-api/test/maybe/check.cc +0 -69
  287. package/vendor/node-addon-api/test/maybe/index.js +0 -50
  288. package/vendor/node-addon-api/test/memory_management.cc +0 -18
  289. package/vendor/node-addon-api/test/memory_management.js +0 -9
  290. package/vendor/node-addon-api/test/movable_callbacks.cc +0 -23
  291. package/vendor/node-addon-api/test/movable_callbacks.js +0 -21
  292. package/vendor/node-addon-api/test/name.cc +0 -110
  293. package/vendor/node-addon-api/test/name.js +0 -59
  294. package/vendor/node-addon-api/test/napi_child.js +0 -14
  295. package/vendor/node-addon-api/test/object/delete_property.cc +0 -38
  296. package/vendor/node-addon-api/test/object/delete_property.js +0 -41
  297. package/vendor/node-addon-api/test/object/finalizer.cc +0 -30
  298. package/vendor/node-addon-api/test/object/finalizer.js +0 -28
  299. package/vendor/node-addon-api/test/object/get_property.cc +0 -34
  300. package/vendor/node-addon-api/test/object/get_property.js +0 -40
  301. package/vendor/node-addon-api/test/object/has_own_property.cc +0 -34
  302. package/vendor/node-addon-api/test/object/has_own_property.js +0 -34
  303. package/vendor/node-addon-api/test/object/has_property.cc +0 -38
  304. package/vendor/node-addon-api/test/object/has_property.js +0 -37
  305. package/vendor/node-addon-api/test/object/object.cc +0 -430
  306. package/vendor/node-addon-api/test/object/object.js +0 -218
  307. package/vendor/node-addon-api/test/object/object_deprecated.cc +0 -70
  308. package/vendor/node-addon-api/test/object/object_deprecated.js +0 -42
  309. package/vendor/node-addon-api/test/object/object_freeze_seal.cc +0 -25
  310. package/vendor/node-addon-api/test/object/object_freeze_seal.js +0 -61
  311. package/vendor/node-addon-api/test/object/set_property.cc +0 -45
  312. package/vendor/node-addon-api/test/object/set_property.js +0 -30
  313. package/vendor/node-addon-api/test/object/subscript_operator.cc +0 -58
  314. package/vendor/node-addon-api/test/object/subscript_operator.js +0 -17
  315. package/vendor/node-addon-api/test/object_reference.cc +0 -417
  316. package/vendor/node-addon-api/test/object_reference.js +0 -262
  317. package/vendor/node-addon-api/test/objectwrap.cc +0 -295
  318. package/vendor/node-addon-api/test/objectwrap.js +0 -309
  319. package/vendor/node-addon-api/test/objectwrap_constructor_exception.cc +0 -26
  320. package/vendor/node-addon-api/test/objectwrap_constructor_exception.js +0 -18
  321. package/vendor/node-addon-api/test/objectwrap_function.cc +0 -43
  322. package/vendor/node-addon-api/test/objectwrap_function.js +0 -6
  323. package/vendor/node-addon-api/test/objectwrap_multiple_inheritance.cc +0 -30
  324. package/vendor/node-addon-api/test/objectwrap_multiple_inheritance.js +0 -13
  325. package/vendor/node-addon-api/test/objectwrap_removewrap.cc +0 -45
  326. package/vendor/node-addon-api/test/objectwrap_removewrap.js +0 -32
  327. package/vendor/node-addon-api/test/objectwrap_worker_thread.js +0 -20
  328. package/vendor/node-addon-api/test/promise.cc +0 -111
  329. package/vendor/node-addon-api/test/promise.js +0 -43
  330. package/vendor/node-addon-api/test/reference.cc +0 -78
  331. package/vendor/node-addon-api/test/reference.js +0 -20
  332. package/vendor/node-addon-api/test/require_basic_finalizers/index.js +0 -38
  333. package/vendor/node-addon-api/test/require_basic_finalizers/tpl/addon.cc +0 -12
  334. package/vendor/node-addon-api/test/require_basic_finalizers/tpl/binding.gyp +0 -48
  335. package/vendor/node-addon-api/test/require_basic_finalizers/tpl/index.js +0 -3
  336. package/vendor/node-addon-api/test/require_basic_finalizers/tpl/package.json +0 -11
  337. package/vendor/node-addon-api/test/run_script.cc +0 -56
  338. package/vendor/node-addon-api/test/run_script.js +0 -45
  339. package/vendor/node-addon-api/test/symbol.cc +0 -79
  340. package/vendor/node-addon-api/test/symbol.js +0 -66
  341. package/vendor/node-addon-api/test/testUtil.js +0 -54
  342. package/vendor/node-addon-api/test/threadsafe_function/threadsafe_function.cc +0 -230
  343. package/vendor/node-addon-api/test/threadsafe_function/threadsafe_function.js +0 -225
  344. package/vendor/node-addon-api/test/threadsafe_function/threadsafe_function_ctx.cc +0 -155
  345. package/vendor/node-addon-api/test/threadsafe_function/threadsafe_function_ctx.js +0 -13
  346. package/vendor/node-addon-api/test/threadsafe_function/threadsafe_function_exception.cc +0 -50
  347. package/vendor/node-addon-api/test/threadsafe_function/threadsafe_function_exception.js +0 -20
  348. package/vendor/node-addon-api/test/threadsafe_function/threadsafe_function_existing_tsfn.cc +0 -125
  349. package/vendor/node-addon-api/test/threadsafe_function/threadsafe_function_existing_tsfn.js +0 -14
  350. package/vendor/node-addon-api/test/threadsafe_function/threadsafe_function_ptr.cc +0 -27
  351. package/vendor/node-addon-api/test/threadsafe_function/threadsafe_function_ptr.js +0 -7
  352. package/vendor/node-addon-api/test/threadsafe_function/threadsafe_function_sum.cc +0 -240
  353. package/vendor/node-addon-api/test/threadsafe_function/threadsafe_function_sum.js +0 -59
  354. package/vendor/node-addon-api/test/threadsafe_function/threadsafe_function_unref.cc +0 -55
  355. package/vendor/node-addon-api/test/threadsafe_function/threadsafe_function_unref.js +0 -98
  356. package/vendor/node-addon-api/test/thunking_manual.cc +0 -127
  357. package/vendor/node-addon-api/test/thunking_manual.js +0 -16
  358. package/vendor/node-addon-api/test/type_taggable.cc +0 -66
  359. package/vendor/node-addon-api/test/type_taggable.js +0 -59
  360. package/vendor/node-addon-api/test/typed_threadsafe_function/typed_threadsafe_function.cc +0 -215
  361. package/vendor/node-addon-api/test/typed_threadsafe_function/typed_threadsafe_function.js +0 -188
  362. package/vendor/node-addon-api/test/typed_threadsafe_function/typed_threadsafe_function_ctx.cc +0 -120
  363. package/vendor/node-addon-api/test/typed_threadsafe_function/typed_threadsafe_function_ctx.js +0 -14
  364. package/vendor/node-addon-api/test/typed_threadsafe_function/typed_threadsafe_function_exception.cc +0 -39
  365. package/vendor/node-addon-api/test/typed_threadsafe_function/typed_threadsafe_function_exception.js +0 -13
  366. package/vendor/node-addon-api/test/typed_threadsafe_function/typed_threadsafe_function_existing_tsfn.cc +0 -127
  367. package/vendor/node-addon-api/test/typed_threadsafe_function/typed_threadsafe_function_existing_tsfn.js +0 -14
  368. package/vendor/node-addon-api/test/typed_threadsafe_function/typed_threadsafe_function_ptr.cc +0 -32
  369. package/vendor/node-addon-api/test/typed_threadsafe_function/typed_threadsafe_function_ptr.js +0 -8
  370. package/vendor/node-addon-api/test/typed_threadsafe_function/typed_threadsafe_function_sum.cc +0 -237
  371. package/vendor/node-addon-api/test/typed_threadsafe_function/typed_threadsafe_function_sum.js +0 -59
  372. package/vendor/node-addon-api/test/typed_threadsafe_function/typed_threadsafe_function_unref.cc +0 -67
  373. package/vendor/node-addon-api/test/typed_threadsafe_function/typed_threadsafe_function_unref.js +0 -98
  374. package/vendor/node-addon-api/test/typedarray-bigint.js +0 -58
  375. package/vendor/node-addon-api/test/typedarray.cc +0 -413
  376. package/vendor/node-addon-api/test/typedarray.js +0 -103
  377. package/vendor/node-addon-api/test/value_type_cast.cc +0 -60
  378. package/vendor/node-addon-api/test/value_type_cast.js +0 -106
  379. package/vendor/node-addon-api/test/version_management.cc +0 -28
  380. package/vendor/node-addon-api/test/version_management.js +0 -29
  381. package/vendor/node-addon-api/tools/README.md +0 -73
  382. package/vendor/node-addon-api/tools/check-napi.js +0 -99
  383. package/vendor/node-addon-api/tools/clang-format.js +0 -71
  384. package/vendor/node-addon-api/tools/conversion.js +0 -301
  385. package/vendor/node-addon-api/unit-test/README.md +0 -28
  386. package/vendor/node-addon-api/unit-test/binding-file-template.js +0 -39
  387. package/vendor/node-addon-api/unit-test/binding.gyp +0 -72
  388. package/vendor/node-addon-api/unit-test/exceptions.js +0 -32
  389. package/vendor/node-addon-api/unit-test/generate-binding-cc.js +0 -61
  390. package/vendor/node-addon-api/unit-test/injectTestParams.js +0 -101
  391. package/vendor/node-addon-api/unit-test/listOfTestModules.js +0 -88
  392. package/vendor/node-addon-api/unit-test/matchModules.js +0 -65
  393. package/vendor/node-addon-api/unit-test/setup.js +0 -13
  394. package/vendor/node-addon-api/unit-test/spawnTask.js +0 -26
  395. package/vendor/node-addon-api/unit-test/test.js +0 -30
  396. package/vendor/node-api-headers/CHANGELOG.md +0 -130
  397. package/vendor/node-api-headers/CODE_OF_CONDUCT.md +0 -4
  398. package/vendor/node-api-headers/CONTRIBUTING.md +0 -32
  399. package/vendor/node-api-headers/CREATING_A_RELEASE.md +0 -68
  400. package/vendor/node-api-headers/index.js +0 -17
  401. package/vendor/node-api-headers/lib/clang-utils.js +0 -50
  402. package/vendor/node-api-headers/lib/parse-utils.js +0 -92
  403. package/vendor/node-api-headers/package.json +0 -59
  404. package/vendor/node-api-headers/release-please-config.json +0 -12
  405. package/vendor/node-api-headers/scripts/update-headers.js +0 -246
  406. package/vendor/node-api-headers/scripts/write-symbols.js +0 -154
  407. package/vendor/node-api-headers/scripts/write-win32-def.js +0 -52
  408. package/vendor/node-api-headers/symbols.js +0 -257
  409. package/vendor/node-api-headers/test/parse-utils.js +0 -21
  410. /package/doc/{pages/benchmarks.md → benchmarks.md} +0 -0
  411. /package/doc/{pages/callbacks.md → callbacks.md} +0 -0
  412. /package/doc/{pages/contribute.md → contribute.md} +0 -0
  413. /package/doc/{pages/functions.md → functions.md} +0 -0
  414. /package/doc/{pages/index.md → index.md} +0 -0
  415. /package/doc/{pages/input.md → input.md} +0 -0
  416. /package/doc/{pages/migration.md → migration.md} +0 -0
  417. /package/doc/{pages/misc.md → misc.md} +0 -0
  418. /package/doc/{pages/output.md → output.md} +0 -0
  419. /package/doc/{pages/packaging.md → packaging.md} +0 -0
  420. /package/doc/{pages/platforms.md → platforms.md} +0 -0
  421. /package/doc/{pages/pointers.md → pointers.md} +0 -0
  422. /package/doc/{pages/start.md → start.md} +0 -0
  423. /package/doc/{pages/unions.md → unions.md} +0 -0
  424. /package/doc/{pages/variables.md → variables.md} +0 -0
  425. /package/src/koffi/src/{abi/loong64.cc → abi_loong64.cc} +0 -0
@@ -1,604 +0,0 @@
1
- # Object Wrap
2
-
3
- Class `Napi::ObjectWrap<T>` inherits from class [`Napi::InstanceWrap<T>`][].
4
-
5
- The `Napi::ObjectWrap<T>` class is used to bind the lifetime of C++ code to a
6
- JavaScript object. Once bound, each time an instance of the JavaScript object
7
- is created, an instance of the C++ class will also be created. When a method
8
- is called on the JavaScript object which is defined as an InstanceMethod, the
9
- corresponding C++ method on the wrapped C++ class will be invoked.
10
-
11
- In order to create a wrapper it's necessary to extend the
12
- `Napi::ObjectWrap<T>` class which contains all the plumbing to connect
13
- JavaScript code with a C++ object. Classes extending `Napi::ObjectWrap` can be
14
- instantiated from JavaScript using the **new** operator, and their methods can
15
- be directly invoked from JavaScript. The **wrap** word refers to a way of
16
- grouping methods and state of the class because it will be necessary write
17
- custom code to bridge each of your C++ class methods.
18
-
19
- **Caution:** When the JavaScript object is garbage collected, the call to the
20
- C++ destructor may be deferred until a later time. Within that period,
21
- `Value()` will return an empty value.
22
-
23
- ## Example
24
-
25
- ```cpp
26
- #include <napi.h>
27
-
28
- class Example : public Napi::ObjectWrap<Example> {
29
- public:
30
- static Napi::Object Init(Napi::Env env, Napi::Object exports);
31
- Example(const Napi::CallbackInfo& info);
32
- static Napi::Value CreateNewItem(const Napi::CallbackInfo& info);
33
-
34
- private:
35
- double _value;
36
- Napi::Value GetValue(const Napi::CallbackInfo& info);
37
- Napi::Value SetValue(const Napi::CallbackInfo& info);
38
- };
39
-
40
- Napi::Object Example::Init(Napi::Env env, Napi::Object exports) {
41
- // This method is used to hook the accessor and method callbacks
42
- Napi::Function func = DefineClass(env, "Example", {
43
- InstanceMethod<&Example::GetValue>("GetValue", static_cast<napi_property_attributes>(napi_writable | napi_configurable)),
44
- InstanceMethod<&Example::SetValue>("SetValue", static_cast<napi_property_attributes>(napi_writable | napi_configurable)),
45
- StaticMethod<&Example::CreateNewItem>("CreateNewItem", static_cast<napi_property_attributes>(napi_writable | napi_configurable)),
46
- });
47
-
48
- Napi::FunctionReference* constructor = new Napi::FunctionReference();
49
-
50
- // Create a persistent reference to the class constructor. This will allow
51
- // a function called on a class prototype and a function
52
- // called on instance of a class to be distinguished from each other.
53
- *constructor = Napi::Persistent(func);
54
- exports.Set("Example", func);
55
-
56
- // Store the constructor as the add-on instance data. This will allow this
57
- // add-on to support multiple instances of itself running on multiple worker
58
- // threads, as well as multiple instances of itself running in different
59
- // contexts on the same thread.
60
- //
61
- // By default, the value set on the environment here will be destroyed when
62
- // the add-on is unloaded using the `delete` operator, but it is also
63
- // possible to supply a custom deleter.
64
- env.SetInstanceData<Napi::FunctionReference>(constructor);
65
-
66
- return exports;
67
- }
68
-
69
- Example::Example(const Napi::CallbackInfo& info) :
70
- Napi::ObjectWrap<Example>(info) {
71
- Napi::Env env = info.Env();
72
- // ...
73
- Napi::Number value = info[0].As<Napi::Number>();
74
- this->_value = value.DoubleValue();
75
- }
76
-
77
- Napi::Value Example::GetValue(const Napi::CallbackInfo& info){
78
- Napi::Env env = info.Env();
79
- return Napi::Number::New(env, this->_value);
80
- }
81
-
82
- Napi::Value Example::SetValue(const Napi::CallbackInfo& info){
83
- Napi::Env env = info.Env();
84
- // ...
85
- Napi::Number value = info[0].As<Napi::Number>();
86
- this->_value = value.DoubleValue();
87
- return this->GetValue(info);
88
- }
89
-
90
- // Initialize native add-on
91
- Napi::Object Init (Napi::Env env, Napi::Object exports) {
92
- Example::Init(env, exports);
93
- return exports;
94
- }
95
-
96
- // Create a new item using the constructor stored during Init.
97
- Napi::Value Example::CreateNewItem(const Napi::CallbackInfo& info) {
98
- // Retrieve the instance data we stored during `Init()`. We only stored the
99
- // constructor there, so we retrieve it here to create a new instance of the
100
- // JS class the constructor represents.
101
- Napi::FunctionReference* constructor =
102
- info.Env().GetInstanceData<Napi::FunctionReference>();
103
- return constructor->New({ Napi::Number::New(info.Env(), 42) });
104
- }
105
-
106
- // Register and initialize native add-on
107
- NODE_API_MODULE(NODE_GYP_MODULE_NAME, Init)
108
- ```
109
-
110
- The above code can be used from JavaScript as follows:
111
-
112
- ```js
113
- 'use strict'
114
-
115
- const { Example } = require('bindings')('addon')
116
-
117
- const example = new Example(11)
118
- console.log(example.GetValue())
119
- // It prints 11
120
- example.SetValue(19)
121
- console.log(example.GetValue());
122
- // It prints 19
123
- ```
124
-
125
- At initialization time, the `Napi::ObjectWrap::DefineClass()` method must be
126
- used to hook up the accessor and method callbacks. It takes a list of property
127
- descriptors, which can be constructed via the various static methods on the base
128
- class.
129
-
130
- When JavaScript code invokes the constructor, the constructor callback will
131
- create a new C++ instance and "wrap" it into the newly created JavaScript
132
- object.
133
-
134
- When JavaScript code invokes a method or a property accessor on the class the
135
- corresponding C++ callback function will be executed.
136
-
137
- For a wrapped object it could be difficult to distinguish between a function
138
- called on a class prototype and a function called on instance of a class.
139
- Therefore it is good practice to save a persistent reference to the class
140
- constructor. This allows the two cases to be distinguished from each other by
141
- checking the this object against the class constructor.
142
-
143
- ## Methods
144
-
145
- ### Constructor
146
-
147
- Creates a new instance of a JavaScript object that wraps native instance.
148
-
149
- ```cpp
150
- Napi::ObjectWrap(const Napi::CallbackInfo& callbackInfo);
151
- ```
152
-
153
- - `[in] callbackInfo`: The object representing the components of the JavaScript
154
- request being made.
155
-
156
- ### Unwrap
157
-
158
- Retrieves a native instance wrapped in a JavaScript object.
159
-
160
- ```cpp
161
- static T* Napi::ObjectWrap::Unwrap(Napi::Object wrapper);
162
- ```
163
-
164
- * `[in] wrapper`: The JavaScript object that wraps the native instance.
165
-
166
- Returns a native instance wrapped in a JavaScript object. Given the
167
- `Napi::Object`, this allows a method to get a pointer to the wrapped
168
- C++ object and then reference fields, call methods, etc. within that class.
169
- In many cases calling Unwrap is not required, as methods can
170
- use the `this` field for ObjectWrap when running in a method on a
171
- class that extends ObjectWrap.
172
-
173
- ### DefineClass
174
-
175
- Defnines a JavaScript class with constructor, static and instance properties and
176
- methods.
177
-
178
- ```cpp
179
- static Napi::Function Napi::ObjectWrap::DefineClass(Napi::Env env,
180
- const char* utf8name,
181
- const std::initializer_list<PropertyDescriptor>& properties,
182
- void* data = nullptr);
183
- ```
184
-
185
- * `[in] env`: The environment in which to construct a JavaScript class.
186
- * `[in] utf8name`: Null-terminated string that represents the name of the
187
- JavaScript constructor function.
188
- * `[in] properties`: Initializer list of class property descriptor describing
189
- static and instance properties and methods of the class.
190
- See: [`Class property and descriptor`](class_property_descriptor.md).
191
- * `[in] data`: User-provided data passed to the constructor callback as `data`
192
- property of the `Napi::CallbackInfo`.
193
-
194
- Returns a `Napi::Function` representing the constructor function for the class.
195
-
196
- ### DefineClass
197
-
198
- Defnines a JavaScript class with constructor, static and instance properties and
199
- methods.
200
-
201
- ```cpp
202
- static Napi::Function Napi::ObjectWrap::DefineClass(Napi::Env env,
203
- const char* utf8name,
204
- const std::vector<PropertyDescriptor>& properties,
205
- void* data = nullptr);
206
- ```
207
-
208
- * `[in] env`: The environment in which to construct a JavaScript class.
209
- * `[in] utf8name`: Null-terminated string that represents the name of the
210
- JavaScript constructor function.
211
- * `[in] properties`: Vector of class property descriptor describing static and
212
- instance properties and methods of the class.
213
- See: [`Class property and descriptor`](class_property_descriptor.md).
214
- * `[in] data`: User-provided data passed to the constructor callback as `data`
215
- property of the `Napi::CallbackInfo`.
216
-
217
- Returns a `Napi::Function` representing the constructor function for the class.
218
-
219
- ### OnCalledAsFunction
220
-
221
- Provides an opportunity to customize the behavior when a `Napi::ObjectWrap<T>`
222
- class is called from JavaScript as a function (without the **new** operator).
223
-
224
- The default behavior in this scenario is to throw a `Napi::TypeError` with the
225
- message `Class constructors cannot be invoked without 'new'`. Define this
226
- public method on your derived class to override that behavior.
227
-
228
- For example, you could internally re-call the JavaScript contstructor _with_
229
- the **new** operator (via
230
- `Napi::Function::New(const std::vector<napi_value> &args)`), and return the
231
- resulting object. Or you might do something else entirely, such as the way
232
- [`Date()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date#constructor)
233
- produces a string when called as a function.
234
-
235
- ```cpp
236
- static Napi::Value OnCalledAsFunction(const Napi::CallbackInfo& callbackInfo);
237
- ```
238
-
239
- - `[in] callbackInfo`: The object representing the components of the JavaScript
240
- request being made.
241
-
242
- ### Finalize
243
-
244
- Provides an opportunity to run cleanup code that only utilizes basic Node APIs, if any.
245
- Override to implement. See [Finalization][] for more details.
246
-
247
- ```cpp
248
- virtual void Finalize(Napi::BasicEnv env);
249
- ```
250
-
251
- - `[in] env`: `Napi::Env`.
252
-
253
- ### Finalize
254
-
255
- Provides an opportunity to run cleanup code that utilizes non-basic Node APIs.
256
- Override to implement.
257
-
258
- *NOTE*: Defining this method causes the deletion of the underlying `T* data` to
259
- be postponed until _after_ the garbage collection cycle. Since an `Napi::Env`
260
- has access to non-basic Node APIs, it cannot run in the same current tick as the
261
- garbage collector.
262
-
263
- ```cpp
264
- virtual void Finalize(Napi::Env env);
265
- ```
266
-
267
- - `[in] env`: `Napi::Env`.
268
-
269
- ### StaticMethod
270
-
271
- Creates property descriptor that represents a static method of a JavaScript
272
- class.
273
-
274
- ```cpp
275
- static Napi::PropertyDescriptor Napi::ObjectWrap::StaticMethod(
276
- const char* utf8name,
277
- StaticVoidMethodCallback method,
278
- napi_property_attributes attributes = napi_default,
279
- void* data = nullptr);
280
- ```
281
-
282
- - `[in] utf8name`: Null-terminated string that represents the name of a static
283
- method for the class.
284
- - `[in] method`: The native function that represents a static method of a
285
- JavaScript class.
286
- - `[in] attributes`: The attributes associated with a particular property.
287
- One or more of `napi_property_attributes`.
288
- - `[in] data`: User-provided data passed into method when it is invoked.
289
-
290
- Returns `Napi::PropertyDescriptor` object that represents the static method of a
291
- JavaScript class.
292
-
293
- ### StaticMethod
294
-
295
- Creates property descriptor that represents a static method of a JavaScript
296
- class.
297
-
298
- ```cpp
299
- static Napi::PropertyDescriptor Napi::ObjectWrap::StaticMethod(
300
- const char* utf8name,
301
- StaticMethodCallback method,
302
- napi_property_attributes attributes = napi_default,
303
- void* data = nullptr);
304
- ```
305
-
306
- - `[in] utf8name`: Null-terminated string that represents the name of a static
307
- method for the class.
308
- - `[in] method`: The native function that represents a static method of a
309
- JavaScript class.
310
- - `[in] attributes`: The attributes associated with a particular property.
311
- One or more of `napi_property_attributes`.
312
- - `[in] data`: User-provided data passed into method when it is invoked.
313
-
314
- Returns `Napi::PropertyDescriptor` object that represents a static method of a
315
- JavaScript class.
316
-
317
- ### StaticMethod
318
-
319
- Creates property descriptor that represents a static method of a JavaScript
320
- class.
321
-
322
- ```cpp
323
- static Napi::PropertyDescriptor Napi::ObjectWrap::StaticMethod(Symbol name,
324
- StaticVoidMethodCallback method,
325
- napi_property_attributes attributes = napi_default,
326
- void* data = nullptr);
327
- ```
328
-
329
- - `[in] name`: Napi::Symbol that represents the name of a static
330
- method for the class.
331
- - `[in] method`: The native function that represents a static method of a
332
- JavaScript class.
333
- - `[in] attributes`: The attributes associated with a particular property.
334
- One or more of `napi_property_attributes`.
335
- - `[in] data`: User-provided data passed into method when it is invoked.
336
-
337
- Returns `Napi::PropertyDescriptor` object that represents the static method of a
338
- JavaScript class.
339
-
340
- ### StaticMethod
341
-
342
- Creates property descriptor that represents a static method of a JavaScript
343
- class.
344
-
345
- ```cpp
346
- static Napi::PropertyDescriptor Napi::ObjectWrap::StaticMethod(Symbol name,
347
- StaticMethodCallback method,
348
- napi_property_attributes attributes = napi_default,
349
- void* data = nullptr);
350
- ```
351
-
352
- method for the class.
353
- - `[in] name`: Napi::Symbol that represents the name of a static.
354
- - `[in] method`: The native function that represents a static method of a
355
- JavaScript class.
356
- - `[in] attributes`: The attributes associated with a particular property.
357
- One or more of `napi_property_attributes`.
358
- - `[in] data`: User-provided data passed into method when it is invoked.
359
-
360
- Returns `Napi::PropertyDescriptor` object that represents a static method of a
361
- JavaScript class.
362
-
363
- ### StaticMethod
364
-
365
- Creates property descriptor that represents a static method of a JavaScript
366
- class.
367
-
368
- ```cpp
369
- template <StaticVoidMethodCallback method>
370
- static Napi::PropertyDescriptor Napi::ObjectWrap::StaticMethod(
371
- const char* utf8name,
372
- napi_property_attributes attributes = napi_default,
373
- void* data = nullptr);
374
- ```
375
-
376
- - `[in] method`: The native function that represents a static method of a
377
- JavaScript class. This function returns nothing.
378
- - `[in] utf8name`: Null-terminated string that represents the name of a static
379
- method for the class.
380
- - `[in] attributes`: The attributes associated with a particular property.
381
- One or more of `napi_property_attributes`.
382
- - `[in] data`: User-provided data passed into method when it is invoked.
383
-
384
- Returns `Napi::PropertyDescriptor` object that represents the static method of a
385
- JavaScript class.
386
-
387
- ### StaticMethod
388
-
389
- Creates property descriptor that represents a static method of a JavaScript
390
- class.
391
-
392
- ```cpp
393
- template <StaticMethodCallback method>
394
- static Napi::PropertyDescriptor Napi::ObjectWrap::StaticMethod(
395
- const char* utf8name,
396
- napi_property_attributes attributes = napi_default,
397
- void* data = nullptr);
398
- ```
399
-
400
- - `[in] method`: The native function that represents a static method of a
401
- JavaScript class.
402
- - `[in] utf8name`: Null-terminated string that represents the name of a static
403
- method for the class.
404
- - `[in] attributes`: The attributes associated with a particular property.
405
- One or more of `napi_property_attributes`.
406
- - `[in] data`: User-provided data passed into method when it is invoked.
407
-
408
- Returns `Napi::PropertyDescriptor` object that represents a static method of a
409
- JavaScript class.
410
-
411
- ### StaticMethod
412
-
413
- Creates property descriptor that represents a static method of a JavaScript
414
- class.
415
-
416
- ```cpp
417
- template <StaticVoidMethodCallback method>
418
- static Napi::PropertyDescriptor Napi::ObjectWrap::StaticMethod(Symbol name,
419
- napi_property_attributes attributes = napi_default,
420
- void* data = nullptr);
421
- ```
422
-
423
- - `[in] method`: The native function that represents a static method of a
424
- JavaScript class.
425
- - `[in] name`: Napi::Symbol that represents the name of a static
426
- method for the class.
427
- - `[in] attributes`: The attributes associated with a particular property.
428
- One or more of `napi_property_attributes`.
429
- - `[in] data`: User-provided data passed into method when it is invoked.
430
-
431
- Returns `Napi::PropertyDescriptor` object that represents the static method of a
432
- JavaScript class.
433
-
434
- ### StaticMethod
435
-
436
- Creates property descriptor that represents a static method of a JavaScript
437
- class.
438
-
439
- ```cpp
440
- template <StaticMethodCallback method>
441
- static Napi::PropertyDescriptor Napi::ObjectWrap::StaticMethod(Symbol name,
442
- napi_property_attributes attributes = napi_default,
443
- void* data = nullptr);
444
- ```
445
-
446
- - `[in] method`: The native function that represents a static method of a
447
- JavaScript class.
448
- - `[in] name`: Napi::Symbol that represents the name of a static.
449
- - `[in] attributes`: The attributes associated with a particular property.
450
- One or more of `napi_property_attributes`.
451
- - `[in] data`: User-provided data passed into method when it is invoked.
452
-
453
- Returns `Napi::PropertyDescriptor` object that represents a static method of a
454
- JavaScript class.
455
-
456
- ### StaticAccessor
457
-
458
- Creates property descriptor that represents a static accessor property of a
459
- JavaScript class.
460
-
461
- ```cpp
462
- static Napi::PropertyDescriptor Napi::ObjectWrap::StaticAccessor(
463
- const char* utf8name,
464
- StaticGetterCallback getter,
465
- StaticSetterCallback setter,
466
- napi_property_attributes attributes = napi_default,
467
- void* data = nullptr);
468
- ```
469
-
470
- - `[in] utf8name`: Null-terminated string that represents the name of a static
471
- accessor property for the class.
472
- - `[in] getter`: The native function to call when a get access to the property
473
- of a JavaScript class is performed.
474
- - `[in] setter`: The native function to call when a set access to the property
475
- of a JavaScript class is performed.
476
- - `[in] attributes`: The attributes associated with a particular property.
477
- One or more of `napi_property_attributes`.
478
- - `[in] data`: User-provided data passed into getter or setter when
479
- is invoked.
480
-
481
- Returns `Napi::PropertyDescriptor` object that represents a static accessor
482
- property of a JavaScript class.
483
-
484
- ### StaticAccessor
485
-
486
- Creates property descriptor that represents a static accessor property of a
487
- JavaScript class.
488
-
489
- ```cpp
490
- static Napi::PropertyDescriptor Napi::ObjectWrap::StaticAccessor(Symbol name,
491
- StaticGetterCallback getter,
492
- StaticSetterCallback setter,
493
- napi_property_attributes attributes = napi_default,
494
- void* data = nullptr);
495
- ```
496
-
497
- - `[in] name`: Napi::Symbol that represents the name of a static accessor.
498
- - `[in] getter`: The native function to call when a get access to the property
499
- of a JavaScript class is performed.
500
- - `[in] setter`: The native function to call when a set access to the property
501
- of a JavaScript class is performed.
502
- - `[in] attributes`: The attributes associated with a particular property.
503
- One or more of `napi_property_attributes`.
504
- - `[in] data`: User-provided data passed into getter or setter when
505
- is invoked.
506
-
507
- Returns `Napi::PropertyDescriptor` object that represents a static accessor
508
- property of a JavaScript class.
509
-
510
- ### StaticAccessor
511
-
512
- Creates property descriptor that represents a static accessor property of a
513
- JavaScript class.
514
-
515
- ```cpp
516
- template <StaticGetterCallback getter, StaticSetterCallback setter=nullptr>
517
- static Napi::PropertyDescriptor Napi::ObjectWrap::StaticAccessor(
518
- const char* utf8name,
519
- napi_property_attributes attributes = napi_default,
520
- void* data = nullptr);
521
- ```
522
-
523
- - `[in] getter`: The native function to call when a get access to the property
524
- of a JavaScript class is performed.
525
- - `[in] setter`: The native function to call when a set access to the property
526
- of a JavaScript class is performed.
527
- - `[in] utf8name`: Null-terminated string that represents the name of a static
528
- accessor property for the class.
529
- - `[in] attributes`: The attributes associated with a particular property.
530
- One or more of `napi_property_attributes`.
531
- - `[in] data`: User-provided data passed into getter or setter when
532
- is invoked.
533
-
534
- Returns `Napi::PropertyDescriptor` object that represents a static accessor
535
- property of a JavaScript class.
536
-
537
- ### StaticAccessor
538
-
539
- Creates property descriptor that represents a static accessor property of a
540
- JavaScript class.
541
-
542
- ```cpp
543
- template <StaticGetterCallback getter, StaticSetterCallback setter=nullptr>
544
- static Napi::PropertyDescriptor Napi::ObjectWrap::StaticAccessor(Symbol name,
545
- napi_property_attributes attributes = napi_default,
546
- void* data = nullptr);
547
- ```
548
-
549
- - `[in] getter`: The native function to call when a get access to the property
550
- of a JavaScript class is performed.
551
- - `[in] setter`: The native function to call when a set access to the property
552
- of a JavaScript class is performed.
553
- - `[in] name`: Napi::Symbol that represents the name of a static accessor.
554
- - `[in] attributes`: The attributes associated with a particular property.
555
- One or more of `napi_property_attributes`.
556
- - `[in] data`: User-provided data passed into getter or setter when
557
- is invoked.
558
-
559
- Returns `Napi::PropertyDescriptor` object that represents a static accessor
560
- property of a JavaScript class.
561
-
562
- ### StaticValue
563
-
564
- Creates property descriptor that represents an static value property of a
565
- JavaScript class.
566
- ```cpp
567
- static Napi::PropertyDescriptor Napi::ObjectWrap::StaticValue(
568
- const char* utf8name,
569
- Napi::Value value,
570
- napi_property_attributes attributes = napi_default);
571
- ```
572
-
573
- - `[in] utf8name`: Null-terminated string that represents the name of the static
574
- property.
575
- - `[in] value`: The value that's retrieved by a get access of the property.
576
- - `[in] attributes`: The attributes to be associated with the property in
577
- addition to the napi_static attribute. One or more of
578
- `napi_property_attributes`.
579
-
580
- Returns `Napi::PropertyDescriptor` object that represents an static value
581
- property of a JavaScript class
582
-
583
- ### StaticValue
584
-
585
- Creates property descriptor that represents an static value property of a
586
- JavaScript class.
587
- ```cpp
588
- static Napi::PropertyDescriptor Napi::ObjectWrap::StaticValue(Symbol name,
589
- Napi::Value value,
590
- napi_property_attributes attributes = napi_default);
591
- ```
592
-
593
- - `[in] name`: The `Napi::Symbol` object whose value is used to identify the
594
- name of the static property.
595
- - `[in] value`: The value that's retrieved by a get access of the property.
596
- - `[in] attributes`: The attributes to be associated with the property in
597
- addition to the napi_static attribute. One or more of
598
- `napi_property_attributes`.
599
-
600
- Returns `Napi::PropertyDescriptor` object that represents an static value
601
- property of a JavaScript class
602
-
603
- [`Napi::InstanceWrap<T>`]: ./instance_wrap.md
604
- [Finalization]: ./finalization.md
@@ -1,16 +0,0 @@
1
- # Prebuild tools
2
-
3
- The distribution of a native add-on is just as important as its implementation.
4
- In order to install a native add-on it's important to have all the necessary
5
- dependencies installed and well configured (see the [setup](setup.md) section).
6
- The end-user will need to compile the add-on when they will do an `npm install`
7
- and in some cases this could create problems. To avoid the compilation process it's
8
- possible to distribute the native add-on in pre-built form for different platform
9
- and architectures. The prebuild tools help to create and distribute the pre-built
10
- form of a native add-on.
11
-
12
- The following list report known tools that are compatible with **Node-API**:
13
-
14
- - **[node-pre-gyp](https://www.npmjs.com/package/node-pre-gyp)**
15
- - **[prebuild](https://www.npmjs.com/package/prebuild)**
16
- - **[prebuildify](https://www.npmjs.com/package/prebuildify)**