@auto_js/napi_exports 0.0.8 → 0.0.10
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.
- package/CMakeLists.txt +2 -1
- package/js_native_api.cc +14 -0
- package/node_api.cc +0 -3
- package/node_api_types.cc +2 -0
- package/package.json +1 -1
package/CMakeLists.txt
CHANGED
|
@@ -5,10 +5,11 @@ target_compile_features(nodejs PUBLIC cxx_std_23)
|
|
|
5
5
|
if(NOT DEFINED NAPI_VERSION)
|
|
6
6
|
message(FATAL_ERROR "Missing 'NAPI_VERSION' cmake variable.")
|
|
7
7
|
elseif(NAPI_VERSION STREQUAL EXPERIMENTAL)
|
|
8
|
-
target_compile_definitions(nodejs PUBLIC NAPI_EXPERIMENTAL)
|
|
8
|
+
target_compile_definitions(nodejs PUBLIC NODE_API_EXPERIMENTAL_NO_WARNING NAPI_EXPERIMENTAL)
|
|
9
9
|
else()
|
|
10
10
|
target_compile_definitions(nodejs PUBLIC NAPI_VERSION=${NAPI_VERSION})
|
|
11
11
|
endif()
|
|
12
|
+
target_compile_options(nodejs PRIVATE "-Wno-#warnings")
|
|
12
13
|
|
|
13
14
|
# Architecture, for window linkage
|
|
14
15
|
string(TOLOWER ${CMAKE_HOST_SYSTEM_PROCESSOR} NODE_ARCH)
|
package/js_native_api.cc
CHANGED
|
@@ -3,8 +3,12 @@ module;
|
|
|
3
3
|
// https://nodejs.org/api/n-api.html
|
|
4
4
|
#include <js_native_api.h>
|
|
5
5
|
export module nodejs:js_native_api;
|
|
6
|
+
import std;
|
|
6
7
|
// NOLINTBEGIN(misc-unused-using-decls)
|
|
7
8
|
|
|
9
|
+
template <class Result, class... Params>
|
|
10
|
+
constexpr auto unimplemented = [](Params...) -> Result { std::terminate(); };
|
|
11
|
+
|
|
8
12
|
export using ::napi_add_finalizer;
|
|
9
13
|
export using ::napi_call_function;
|
|
10
14
|
export using ::napi_check_object_type_tag;
|
|
@@ -93,12 +97,22 @@ export using ::napi_type_tag_object;
|
|
|
93
97
|
export using ::napi_typeof;
|
|
94
98
|
export using ::napi_unwrap;
|
|
95
99
|
export using ::napi_wrap;
|
|
100
|
+
#ifdef NODE_API_EXPERIMENTAL_HAS_CREATE_EXTERNAL_SHAREDARRAYBUFFER
|
|
96
101
|
export using ::node_api_create_external_sharedarraybuffer;
|
|
102
|
+
#endif
|
|
97
103
|
export using ::node_api_create_property_key_latin1;
|
|
98
104
|
export using ::node_api_create_property_key_utf16;
|
|
99
105
|
export using ::node_api_create_property_key_utf8;
|
|
100
106
|
export using ::node_api_create_syntax_error;
|
|
107
|
+
#ifdef NODE_API_EXPERIMENTAL_HAS_SHAREDARRAYBUFFER
|
|
108
|
+
export constexpr auto node_api_has_sharedarraybuffer = true;
|
|
101
109
|
export using ::node_api_is_sharedarraybuffer;
|
|
110
|
+
#else
|
|
111
|
+
export constexpr auto node_api_has_sharedarraybuffer = false;
|
|
112
|
+
export auto node_api_is_sharedarraybuffer(napi_env, napi_value, bool*) -> napi_status {
|
|
113
|
+
std::terminate();
|
|
114
|
+
};
|
|
115
|
+
#endif
|
|
102
116
|
export using ::node_api_throw_syntax_error;
|
|
103
117
|
|
|
104
118
|
// NOLINTEND(misc-unused-using-decls)
|
package/node_api.cc
CHANGED
|
@@ -2,14 +2,12 @@ module;
|
|
|
2
2
|
#include "napi_js/extern.h"
|
|
3
3
|
#include <node_api.h>
|
|
4
4
|
export module nodejs:node_api;
|
|
5
|
-
// NOLINTBEGIN(misc-unused-using-decls)
|
|
6
5
|
|
|
7
6
|
// functions
|
|
8
7
|
export using ::napi_acquire_threadsafe_function;
|
|
9
8
|
export using ::napi_add_async_cleanup_hook;
|
|
10
9
|
export using ::napi_add_env_cleanup_hook;
|
|
11
10
|
export using ::napi_add_env_cleanup_hook;
|
|
12
|
-
export using ::napi_async_cleanup_hook_handle;
|
|
13
11
|
export using ::napi_call_threadsafe_function;
|
|
14
12
|
export using ::napi_create_threadsafe_function;
|
|
15
13
|
export using ::napi_get_threadsafe_function_context;
|
|
@@ -17,7 +15,6 @@ export using ::napi_get_uv_event_loop;
|
|
|
17
15
|
export using ::napi_ref_threadsafe_function;
|
|
18
16
|
export using ::napi_release_threadsafe_function;
|
|
19
17
|
export using ::napi_remove_async_cleanup_hook;
|
|
20
|
-
export using ::napi_threadsafe_function_call_js;
|
|
21
18
|
export using ::napi_unref_threadsafe_function;
|
|
22
19
|
|
|
23
20
|
// NOLINTEND(misc-unused-using-decls)
|
package/node_api_types.cc
CHANGED
|
@@ -3,8 +3,10 @@ module;
|
|
|
3
3
|
export module nodejs:node_api_types;
|
|
4
4
|
// NOLINTBEGIN(misc-unused-using-decls)
|
|
5
5
|
|
|
6
|
+
export using ::napi_async_cleanup_hook_handle;
|
|
6
7
|
export using ::napi_async_cleanup_hook;
|
|
7
8
|
export using ::napi_cleanup_hook;
|
|
9
|
+
export using ::napi_threadsafe_function_call_js;
|
|
8
10
|
export using ::napi_threadsafe_function;
|
|
9
11
|
|
|
10
12
|
// napi_threadsafe_function_release_mode
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@auto_js/napi_exports",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.10",
|
|
4
4
|
"description": "C++ module exports for nodejs & n-api",
|
|
5
5
|
"author": "https://github.com/laverdet/",
|
|
6
6
|
"homepage": "https://github.com/laverdet/isolated-vm/tree/experimental/packages/third_party/nodejs",
|