simen-keyboard-listener 1.0.1 → 1.0.2

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 (29) hide show
  1. package/package.json +4 -2
  2. package/src/native/build/Makefile +0 -347
  3. package/src/native/build/Release/.deps/Release/obj.target/simen_keyboard_listener/simen_keyboard_listener.o.d +0 -18
  4. package/src/native/build/Release/.deps/Release/simen_keyboard_listener.node.d +0 -1
  5. package/src/native/build/Release/obj.target/simen_keyboard_listener/simen_keyboard_listener.o +0 -0
  6. package/src/native/build/Release/simen_keyboard_listener.node +0 -0
  7. package/src/native/build/binding.Makefile +0 -6
  8. package/src/native/build/gyp-mac-tool +0 -772
  9. package/src/native/build/simen_keyboard_listener.target.mk +0 -199
  10. package/src/native/node_modules/.package-lock.json +0 -17
  11. package/src/native/node_modules/node-addon-api/LICENSE.md +0 -9
  12. package/src/native/node_modules/node-addon-api/README.md +0 -95
  13. package/src/native/node_modules/node-addon-api/common.gypi +0 -21
  14. package/src/native/node_modules/node-addon-api/except.gypi +0 -25
  15. package/src/native/node_modules/node-addon-api/index.js +0 -14
  16. package/src/native/node_modules/node-addon-api/napi-inl.deprecated.h +0 -186
  17. package/src/native/node_modules/node-addon-api/napi-inl.h +0 -7033
  18. package/src/native/node_modules/node-addon-api/napi.h +0 -3309
  19. package/src/native/node_modules/node-addon-api/node_addon_api.gyp +0 -42
  20. package/src/native/node_modules/node-addon-api/node_api.gyp +0 -9
  21. package/src/native/node_modules/node-addon-api/noexcept.gypi +0 -26
  22. package/src/native/node_modules/node-addon-api/nothing.c +0 -0
  23. package/src/native/node_modules/node-addon-api/package-support.json +0 -21
  24. package/src/native/node_modules/node-addon-api/package.json +0 -480
  25. package/src/native/node_modules/node-addon-api/tools/README.md +0 -73
  26. package/src/native/node_modules/node-addon-api/tools/check-napi.js +0 -99
  27. package/src/native/node_modules/node-addon-api/tools/clang-format.js +0 -71
  28. package/src/native/node_modules/node-addon-api/tools/conversion.js +0 -301
  29. package/src/native/package-lock.json +0 -25
@@ -1,199 +0,0 @@
1
- # This file is generated by gyp; do not edit.
2
-
3
- TOOLSET := target
4
- TARGET := simen_keyboard_listener
5
- DEFS_Debug := \
6
- '-DNODE_GYP_MODULE_NAME=simen_keyboard_listener' \
7
- '-DUSING_UV_SHARED=1' \
8
- '-DUSING_V8_SHARED=1' \
9
- '-DV8_DEPRECATION_WARNINGS=1' \
10
- '-D_GLIBCXX_USE_CXX11_ABI=1' \
11
- '-D_FILE_OFFSET_BITS=64' \
12
- '-D_DARWIN_USE_64_BIT_INODE=1' \
13
- '-D_LARGEFILE_SOURCE' \
14
- '-DOPENSSL_NO_PINSHARED' \
15
- '-DOPENSSL_THREADS' \
16
- '-DNAPI_DISABLE_CPP_EXCEPTIONS' \
17
- '-DBUILDING_NODE_EXTENSION' \
18
- '-DDEBUG' \
19
- '-D_DEBUG'
20
-
21
- # Flags passed to all source files.
22
- CFLAGS_Debug := \
23
- -O0 \
24
- -gdwarf-2 \
25
- -mmacosx-version-min=11.0 \
26
- -arch \
27
- arm64 \
28
- -Wall \
29
- -Wendif-labels \
30
- -W \
31
- -Wno-unused-parameter
32
-
33
- # Flags passed to only C files.
34
- CFLAGS_C_Debug := \
35
- -fno-strict-aliasing
36
-
37
- # Flags passed to only C++ files.
38
- CFLAGS_CC_Debug := \
39
- -std=gnu++17 \
40
- -stdlib=libc++ \
41
- -fno-rtti \
42
- -fno-exceptions \
43
- -fno-strict-aliasing
44
-
45
- # Flags passed to only ObjC files.
46
- CFLAGS_OBJC_Debug :=
47
-
48
- # Flags passed to only ObjC++ files.
49
- CFLAGS_OBJCC_Debug :=
50
-
51
- INCS_Debug := \
52
- -I/Users/daydream/Library/Caches/node-gyp/20.19.5/include/node \
53
- -I/Users/daydream/Library/Caches/node-gyp/20.19.5/src \
54
- -I/Users/daydream/Library/Caches/node-gyp/20.19.5/deps/openssl/config \
55
- -I/Users/daydream/Library/Caches/node-gyp/20.19.5/deps/openssl/openssl/include \
56
- -I/Users/daydream/Library/Caches/node-gyp/20.19.5/deps/uv/include \
57
- -I/Users/daydream/Library/Caches/node-gyp/20.19.5/deps/zlib \
58
- -I/Users/daydream/Library/Caches/node-gyp/20.19.5/deps/v8/include \
59
- -I/Users/daydream/dev/simen-keyboard-listener/src/native/node_modules/node-addon-api
60
-
61
- DEFS_Release := \
62
- '-DNODE_GYP_MODULE_NAME=simen_keyboard_listener' \
63
- '-DUSING_UV_SHARED=1' \
64
- '-DUSING_V8_SHARED=1' \
65
- '-DV8_DEPRECATION_WARNINGS=1' \
66
- '-D_GLIBCXX_USE_CXX11_ABI=1' \
67
- '-D_FILE_OFFSET_BITS=64' \
68
- '-D_DARWIN_USE_64_BIT_INODE=1' \
69
- '-D_LARGEFILE_SOURCE' \
70
- '-DOPENSSL_NO_PINSHARED' \
71
- '-DOPENSSL_THREADS' \
72
- '-DNAPI_DISABLE_CPP_EXCEPTIONS' \
73
- '-DBUILDING_NODE_EXTENSION'
74
-
75
- # Flags passed to all source files.
76
- CFLAGS_Release := \
77
- -O3 \
78
- -gdwarf-2 \
79
- -mmacosx-version-min=11.0 \
80
- -arch \
81
- arm64 \
82
- -Wall \
83
- -Wendif-labels \
84
- -W \
85
- -Wno-unused-parameter
86
-
87
- # Flags passed to only C files.
88
- CFLAGS_C_Release := \
89
- -fno-strict-aliasing
90
-
91
- # Flags passed to only C++ files.
92
- CFLAGS_CC_Release := \
93
- -std=gnu++17 \
94
- -stdlib=libc++ \
95
- -fno-rtti \
96
- -fno-exceptions \
97
- -fno-strict-aliasing
98
-
99
- # Flags passed to only ObjC files.
100
- CFLAGS_OBJC_Release :=
101
-
102
- # Flags passed to only ObjC++ files.
103
- CFLAGS_OBJCC_Release :=
104
-
105
- INCS_Release := \
106
- -I/Users/daydream/Library/Caches/node-gyp/20.19.5/include/node \
107
- -I/Users/daydream/Library/Caches/node-gyp/20.19.5/src \
108
- -I/Users/daydream/Library/Caches/node-gyp/20.19.5/deps/openssl/config \
109
- -I/Users/daydream/Library/Caches/node-gyp/20.19.5/deps/openssl/openssl/include \
110
- -I/Users/daydream/Library/Caches/node-gyp/20.19.5/deps/uv/include \
111
- -I/Users/daydream/Library/Caches/node-gyp/20.19.5/deps/zlib \
112
- -I/Users/daydream/Library/Caches/node-gyp/20.19.5/deps/v8/include \
113
- -I/Users/daydream/dev/simen-keyboard-listener/src/native/node_modules/node-addon-api
114
-
115
- OBJS := \
116
- $(obj).target/$(TARGET)/simen_keyboard_listener.o
117
-
118
- # Add to the list of files we specially track dependencies for.
119
- all_deps += $(OBJS)
120
-
121
- # CFLAGS et al overrides must be target-local.
122
- # See "Target-specific Variable Values" in the GNU Make manual.
123
- $(OBJS): TOOLSET := $(TOOLSET)
124
- $(OBJS): GYP_CFLAGS := $(DEFS_$(BUILDTYPE)) $(INCS_$(BUILDTYPE)) $(CFLAGS_$(BUILDTYPE)) $(CFLAGS_C_$(BUILDTYPE))
125
- $(OBJS): GYP_CXXFLAGS := $(DEFS_$(BUILDTYPE)) $(INCS_$(BUILDTYPE)) $(CFLAGS_$(BUILDTYPE)) $(CFLAGS_CC_$(BUILDTYPE))
126
- $(OBJS): GYP_OBJCFLAGS := $(DEFS_$(BUILDTYPE)) $(INCS_$(BUILDTYPE)) $(CFLAGS_$(BUILDTYPE)) $(CFLAGS_C_$(BUILDTYPE)) $(CFLAGS_OBJC_$(BUILDTYPE))
127
- $(OBJS): GYP_OBJCXXFLAGS := $(DEFS_$(BUILDTYPE)) $(INCS_$(BUILDTYPE)) $(CFLAGS_$(BUILDTYPE)) $(CFLAGS_CC_$(BUILDTYPE)) $(CFLAGS_OBJCC_$(BUILDTYPE))
128
-
129
- # Suffix rules, putting all outputs into $(obj).
130
-
131
- $(obj).$(TOOLSET)/$(TARGET)/%.o: $(srcdir)/%.cc FORCE_DO_CMD
132
- @$(call do_cmd,cxx,1)
133
-
134
- # Try building from generated source, too.
135
-
136
- $(obj).$(TOOLSET)/$(TARGET)/%.o: $(obj).$(TOOLSET)/%.cc FORCE_DO_CMD
137
- @$(call do_cmd,cxx,1)
138
-
139
- $(obj).$(TOOLSET)/$(TARGET)/%.o: $(obj)/%.cc FORCE_DO_CMD
140
- @$(call do_cmd,cxx,1)
141
-
142
- # End of this set of suffix rules
143
- ### Rules for final target.
144
- LDFLAGS_Debug := \
145
- -framework \
146
- ApplicationServices \
147
- -undefined dynamic_lookup \
148
- -Wl,-search_paths_first \
149
- -mmacosx-version-min=11.0 \
150
- -arch \
151
- arm64 \
152
- -L$(builddir) \
153
- -stdlib=libc++
154
-
155
- LIBTOOLFLAGS_Debug := \
156
- -framework \
157
- ApplicationServices \
158
- -undefined dynamic_lookup \
159
- -Wl,-search_paths_first
160
-
161
- LDFLAGS_Release := \
162
- -framework \
163
- ApplicationServices \
164
- -undefined dynamic_lookup \
165
- -Wl,-search_paths_first \
166
- -mmacosx-version-min=11.0 \
167
- -arch \
168
- arm64 \
169
- -L$(builddir) \
170
- -stdlib=libc++
171
-
172
- LIBTOOLFLAGS_Release := \
173
- -framework \
174
- ApplicationServices \
175
- -undefined dynamic_lookup \
176
- -Wl,-search_paths_first
177
-
178
- LIBS :=
179
-
180
- $(builddir)/simen_keyboard_listener.node: GYP_LDFLAGS := $(LDFLAGS_$(BUILDTYPE))
181
- $(builddir)/simen_keyboard_listener.node: LIBS := $(LIBS)
182
- $(builddir)/simen_keyboard_listener.node: GYP_LIBTOOLFLAGS := $(LIBTOOLFLAGS_$(BUILDTYPE))
183
- $(builddir)/simen_keyboard_listener.node: TOOLSET := $(TOOLSET)
184
- $(builddir)/simen_keyboard_listener.node: $(OBJS) FORCE_DO_CMD
185
- $(call do_cmd,solink_module)
186
-
187
- all_deps += $(builddir)/simen_keyboard_listener.node
188
- # Add target alias
189
- .PHONY: simen_keyboard_listener
190
- simen_keyboard_listener: $(builddir)/simen_keyboard_listener.node
191
-
192
- # Short alias for building this executable.
193
- .PHONY: simen_keyboard_listener.node
194
- simen_keyboard_listener.node: $(builddir)/simen_keyboard_listener.node
195
-
196
- # Add executable to "all" target.
197
- .PHONY: all
198
- all: $(builddir)/simen_keyboard_listener.node
199
-
@@ -1,17 +0,0 @@
1
- {
2
- "name": "simen-keyboard-listener-native",
3
- "version": "1.0.0",
4
- "lockfileVersion": 3,
5
- "requires": true,
6
- "packages": {
7
- "node_modules/node-addon-api": {
8
- "version": "8.5.0",
9
- "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-8.5.0.tgz",
10
- "integrity": "sha512-/bRZty2mXUIFY/xU5HLvveNHlswNJej+RnxBjOMkidWfwZzgTbPG1E3K5TOxRLOR+5hX7bSofy8yf1hZevMS8A==",
11
- "license": "MIT",
12
- "engines": {
13
- "node": "^18 || ^20 || >= 21"
14
- }
15
- }
16
- }
17
- }
@@ -1,9 +0,0 @@
1
- The MIT License (MIT)
2
-
3
- Copyright (c) 2017 [Node.js API collaborators](https://github.com/nodejs/node-addon-api#collaborators)
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6
-
7
- The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
8
-
9
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -1,95 +0,0 @@
1
- # **node-addon-api module**
2
-
3
- [![codecov](https://codecov.io/gh/nodejs/node-addon-api/branch/main/graph/badge.svg)](https://app.codecov.io/gh/nodejs/node-addon-api/tree/main)
4
-
5
- [![NPM](https://nodei.co/npm/node-addon-api.png?downloads=true&downloadRank=true)](https://nodei.co/npm/node-addon-api/) [![NPM](https://nodei.co/npm-dl/node-addon-api.png?months=6&height=1)](https://nodei.co/npm/node-addon-api/)
6
-
7
- This module contains **header-only C++ wrapper classes** which simplify
8
- the use of the C based [Node-API](https://nodejs.org/dist/latest/docs/api/n-api.html)
9
- provided by Node.js when using C++. It provides a C++ object model
10
- and exception handling semantics with low overhead.
11
-
12
- - [API References](doc/README.md)
13
- - [Badges](#badges)
14
- - [Contributing](#contributing)
15
- - [License](#license)
16
-
17
- ## API References
18
-
19
- API references are available in the [doc](doc/README.md) directory.
20
-
21
- <!-- x-release-please-start-version -->
22
- ## Current version: 8.5.0
23
- <!-- x-release-please-end -->
24
-
25
- (See [CHANGELOG.md](CHANGELOG.md) for complete Changelog)
26
-
27
- node-addon-api is based on [Node-API](https://nodejs.org/api/n-api.html) and supports using different Node-API versions.
28
- This allows addons built with it to run with Node.js versions which support the targeted Node-API version.
29
- **However** the node-addon-api support model is to support only the active LTS Node.js versions. This means that
30
- every year there will be a new major which drops support for the Node.js LTS version which has gone out of service.
31
-
32
- The oldest Node.js version supported by the current version of node-addon-api is Node.js 18.x.
33
-
34
- ## Badges
35
-
36
- The use of badges is recommended to indicate the minimum version of Node-API
37
- required for the module. This helps to determine which Node.js major versions are
38
- supported. Addon maintainers can consult the [Node-API support matrix][] to determine
39
- which Node.js versions provide a given Node-API version. The following badges are
40
- available:
41
-
42
- ![Node-API v1 Badge](https://github.com/nodejs/abi-stable-node/blob/doc/assets/Node-API%20v1%20Badge.svg)
43
- ![Node-API v2 Badge](https://github.com/nodejs/abi-stable-node/blob/doc/assets/Node-API%20v2%20Badge.svg)
44
- ![Node-API v3 Badge](https://github.com/nodejs/abi-stable-node/blob/doc/assets/Node-API%20v3%20Badge.svg)
45
- ![Node-API v4 Badge](https://github.com/nodejs/abi-stable-node/blob/doc/assets/Node-API%20v4%20Badge.svg)
46
- ![Node-API v5 Badge](https://github.com/nodejs/abi-stable-node/blob/doc/assets/Node-API%20v5%20Badge.svg)
47
- ![Node-API v6 Badge](https://github.com/nodejs/abi-stable-node/blob/doc/assets/Node-API%20v6%20Badge.svg)
48
- ![Node-API v7 Badge](https://github.com/nodejs/abi-stable-node/blob/doc/assets/Node-API%20v7%20Badge.svg)
49
- ![Node-API v8 Badge](https://github.com/nodejs/abi-stable-node/blob/doc/assets/Node-API%20v8%20Badge.svg)
50
- ![Node-API v9 Badge](https://github.com/nodejs/abi-stable-node/blob/doc/assets/Node-API%20v9%20Badge.svg)
51
- ![Node-API Experimental Version Badge](https://github.com/nodejs/abi-stable-node/blob/doc/assets/Node-API%20Experimental%20Version%20Badge.svg)
52
-
53
- ## Contributing
54
-
55
- We love contributions from the community to **node-addon-api**!
56
- See [CONTRIBUTING.md](CONTRIBUTING.md) for more details on our philosophy around extending this module.
57
-
58
- ## Team members
59
-
60
- ### Active
61
-
62
- | Name | GitHub Link |
63
- | ------------------- | ----------------------------------------------------- |
64
- | Anna Henningsen | [addaleax](https://github.com/addaleax) |
65
- | Chengzhong Wu | [legendecas](https://github.com/legendecas) |
66
- | Jack Xia | [JckXia](https://github.com/JckXia) |
67
- | Kevin Eady | [KevinEady](https://github.com/KevinEady) |
68
- | Michael Dawson | [mhdawson](https://github.com/mhdawson) |
69
- | Nicola Del Gobbo | [NickNaso](https://github.com/NickNaso) |
70
- | Vladimir Morozov | [vmoroz](https://github.com/vmoroz) |
71
-
72
- <details>
73
-
74
- <summary>Emeritus</summary>
75
-
76
- ### Emeritus
77
-
78
- | Name | GitHub Link |
79
- | ------------------- | ----------------------------------------------------- |
80
- | Arunesh Chandra | [aruneshchandra](https://github.com/aruneshchandra) |
81
- | Benjamin Byholm | [kkoopa](https://github.com/kkoopa) |
82
- | Gabriel Schulhof | [gabrielschulhof](https://github.com/gabrielschulhof) |
83
- | Hitesh Kanwathirtha | [digitalinfinity](https://github.com/digitalinfinity) |
84
- | Jason Ginchereau | [jasongin](https://github.com/jasongin) |
85
- | Jim Schlight | [jschlight](https://github.com/jschlight) |
86
- | Sampson Gao | [sampsongao](https://github.com/sampsongao) |
87
- | Taylor Woll | [boingoing](https://github.com/boingoing) |
88
-
89
- </details>
90
-
91
- ## License
92
-
93
- Licensed under [MIT](./LICENSE.md)
94
-
95
- [Node-API support matrix]: https://nodejs.org/dist/latest/docs/api/n-api.html#node-api-version-matrix
@@ -1,21 +0,0 @@
1
- {
2
- 'variables': {
3
- 'NAPI_VERSION%': "<!(node -p \"process.env.NAPI_VERSION || process.versions.napi\")",
4
- 'disable_deprecated': "<!(node -p \"process.env['npm_config_disable_deprecated']\")"
5
- },
6
- 'conditions': [
7
- ['NAPI_VERSION!=""', { 'defines': ['NAPI_VERSION=<@(NAPI_VERSION)'] } ],
8
- ['NAPI_VERSION==2147483647', { 'defines': ['NAPI_EXPERIMENTAL'] } ],
9
- ['disable_deprecated=="true"', {
10
- 'defines': ['NODE_ADDON_API_DISABLE_DEPRECATED']
11
- }],
12
- ['OS=="mac"', {
13
- 'cflags+': ['-fvisibility=hidden'],
14
- 'xcode_settings': {
15
- 'OTHER_CFLAGS': ['-fvisibility=hidden']
16
- }
17
- }]
18
- ],
19
- 'cflags': [ '-Werror', '-Wall', '-Wextra', '-Wpedantic', '-Wunused-parameter' ],
20
- 'cflags_cc': [ '-Werror', '-Wall', '-Wextra', '-Wpedantic', '-Wunused-parameter' ]
21
- }
@@ -1,25 +0,0 @@
1
- {
2
- 'defines': [ 'NAPI_CPP_EXCEPTIONS' ],
3
- 'cflags!': [ '-fno-exceptions' ],
4
- 'cflags_cc!': [ '-fno-exceptions' ],
5
- 'conditions': [
6
- ["OS=='win'", {
7
- "defines": [
8
- "_HAS_EXCEPTIONS=1"
9
- ],
10
- "msvs_settings": {
11
- "VCCLCompilerTool": {
12
- "ExceptionHandling": 1,
13
- 'EnablePREfast': 'true',
14
- },
15
- },
16
- }],
17
- ["OS=='mac'", {
18
- 'xcode_settings': {
19
- 'GCC_ENABLE_CPP_EXCEPTIONS': 'YES',
20
- 'CLANG_CXX_LIBRARY': 'libc++',
21
- 'MACOSX_DEPLOYMENT_TARGET': '10.7',
22
- },
23
- }],
24
- ],
25
- }
@@ -1,14 +0,0 @@
1
- const path = require('path');
2
- const { version } = require('./package.json');
3
-
4
- const includeDir = path.relative('.', __dirname);
5
-
6
- module.exports = {
7
- include: `"${__dirname}"`, // deprecated, can be removed as part of 4.0.0
8
- include_dir: includeDir,
9
- gyp: path.join(includeDir, 'node_api.gyp:nothing'), // deprecated.
10
- targets: path.join(includeDir, 'node_addon_api.gyp'),
11
- version,
12
- isNodeApiBuiltin: true,
13
- needsFlag: false
14
- };
@@ -1,186 +0,0 @@
1
- #ifndef SRC_NAPI_INL_DEPRECATED_H_
2
- #define SRC_NAPI_INL_DEPRECATED_H_
3
-
4
- ////////////////////////////////////////////////////////////////////////////////
5
- // PropertyDescriptor class
6
- ////////////////////////////////////////////////////////////////////////////////
7
-
8
- template <typename Getter>
9
- inline PropertyDescriptor PropertyDescriptor::Accessor(
10
- const char* utf8name,
11
- Getter getter,
12
- napi_property_attributes attributes,
13
- void* /*data*/) {
14
- using CbData = details::CallbackData<Getter, Napi::Value>;
15
- // TODO: Delete when the function is destroyed
16
- auto callbackData = new CbData({getter, nullptr});
17
-
18
- return PropertyDescriptor({utf8name,
19
- nullptr,
20
- nullptr,
21
- CbData::Wrapper,
22
- nullptr,
23
- nullptr,
24
- attributes,
25
- callbackData});
26
- }
27
-
28
- template <typename Getter>
29
- inline PropertyDescriptor PropertyDescriptor::Accessor(
30
- const std::string& utf8name,
31
- Getter getter,
32
- napi_property_attributes attributes,
33
- void* data) {
34
- return Accessor(utf8name.c_str(), getter, attributes, data);
35
- }
36
-
37
- template <typename Getter>
38
- inline PropertyDescriptor PropertyDescriptor::Accessor(
39
- napi_value name,
40
- Getter getter,
41
- napi_property_attributes attributes,
42
- void* /*data*/) {
43
- using CbData = details::CallbackData<Getter, Napi::Value>;
44
- // TODO: Delete when the function is destroyed
45
- auto callbackData = new CbData({getter, nullptr});
46
-
47
- return PropertyDescriptor({nullptr,
48
- name,
49
- nullptr,
50
- CbData::Wrapper,
51
- nullptr,
52
- nullptr,
53
- attributes,
54
- callbackData});
55
- }
56
-
57
- template <typename Getter>
58
- inline PropertyDescriptor PropertyDescriptor::Accessor(
59
- Name name, Getter getter, napi_property_attributes attributes, void* data) {
60
- napi_value nameValue = name;
61
- return PropertyDescriptor::Accessor(nameValue, getter, attributes, data);
62
- }
63
-
64
- template <typename Getter, typename Setter>
65
- inline PropertyDescriptor PropertyDescriptor::Accessor(
66
- const char* utf8name,
67
- Getter getter,
68
- Setter setter,
69
- napi_property_attributes attributes,
70
- void* /*data*/) {
71
- using CbData = details::AccessorCallbackData<Getter, Setter>;
72
- // TODO: Delete when the function is destroyed
73
- auto callbackData = new CbData({getter, setter, nullptr});
74
-
75
- return PropertyDescriptor({utf8name,
76
- nullptr,
77
- nullptr,
78
- CbData::GetterWrapper,
79
- CbData::SetterWrapper,
80
- nullptr,
81
- attributes,
82
- callbackData});
83
- }
84
-
85
- template <typename Getter, typename Setter>
86
- inline PropertyDescriptor PropertyDescriptor::Accessor(
87
- const std::string& utf8name,
88
- Getter getter,
89
- Setter setter,
90
- napi_property_attributes attributes,
91
- void* data) {
92
- return Accessor(utf8name.c_str(), getter, setter, attributes, data);
93
- }
94
-
95
- template <typename Getter, typename Setter>
96
- inline PropertyDescriptor PropertyDescriptor::Accessor(
97
- napi_value name,
98
- Getter getter,
99
- Setter setter,
100
- napi_property_attributes attributes,
101
- void* /*data*/) {
102
- using CbData = details::AccessorCallbackData<Getter, Setter>;
103
- // TODO: Delete when the function is destroyed
104
- auto callbackData = new CbData({getter, setter, nullptr});
105
-
106
- return PropertyDescriptor({nullptr,
107
- name,
108
- nullptr,
109
- CbData::GetterWrapper,
110
- CbData::SetterWrapper,
111
- nullptr,
112
- attributes,
113
- callbackData});
114
- }
115
-
116
- template <typename Getter, typename Setter>
117
- inline PropertyDescriptor PropertyDescriptor::Accessor(
118
- Name name,
119
- Getter getter,
120
- Setter setter,
121
- napi_property_attributes attributes,
122
- void* data) {
123
- napi_value nameValue = name;
124
- return PropertyDescriptor::Accessor(
125
- nameValue, getter, setter, attributes, data);
126
- }
127
-
128
- template <typename Callable>
129
- inline PropertyDescriptor PropertyDescriptor::Function(
130
- const char* utf8name,
131
- Callable cb,
132
- napi_property_attributes attributes,
133
- void* /*data*/) {
134
- using ReturnType = decltype(cb(CallbackInfo(nullptr, nullptr)));
135
- using CbData = details::CallbackData<Callable, ReturnType>;
136
- // TODO: Delete when the function is destroyed
137
- auto callbackData = new CbData({cb, nullptr});
138
-
139
- return PropertyDescriptor({utf8name,
140
- nullptr,
141
- CbData::Wrapper,
142
- nullptr,
143
- nullptr,
144
- nullptr,
145
- attributes,
146
- callbackData});
147
- }
148
-
149
- template <typename Callable>
150
- inline PropertyDescriptor PropertyDescriptor::Function(
151
- const std::string& utf8name,
152
- Callable cb,
153
- napi_property_attributes attributes,
154
- void* data) {
155
- return Function(utf8name.c_str(), cb, attributes, data);
156
- }
157
-
158
- template <typename Callable>
159
- inline PropertyDescriptor PropertyDescriptor::Function(
160
- napi_value name,
161
- Callable cb,
162
- napi_property_attributes attributes,
163
- void* /*data*/) {
164
- using ReturnType = decltype(cb(CallbackInfo(nullptr, nullptr)));
165
- using CbData = details::CallbackData<Callable, ReturnType>;
166
- // TODO: Delete when the function is destroyed
167
- auto callbackData = new CbData({cb, nullptr});
168
-
169
- return PropertyDescriptor({nullptr,
170
- name,
171
- CbData::Wrapper,
172
- nullptr,
173
- nullptr,
174
- nullptr,
175
- attributes,
176
- callbackData});
177
- }
178
-
179
- template <typename Callable>
180
- inline PropertyDescriptor PropertyDescriptor::Function(
181
- Name name, Callable cb, napi_property_attributes attributes, void* data) {
182
- napi_value nameValue = name;
183
- return PropertyDescriptor::Function(nameValue, cb, attributes, data);
184
- }
185
-
186
- #endif // !SRC_NAPI_INL_DEPRECATED_H_