@capawesome/capacitor-nodejs 0.0.1
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/Package.swift +42 -0
- package/README.md +443 -0
- package/android/CMakeLists.txt +32 -0
- package/android/build.gradle +123 -0
- package/android/src/main/AndroidManifest.xml +2 -0
- package/android/src/main/cpp/native-lib.cpp +192 -0
- package/android/src/main/java/io/capawesome/capacitorjs/plugins/nodejs/Nodejs.java +256 -0
- package/android/src/main/java/io/capawesome/capacitorjs/plugins/nodejs/NodejsConfig.java +30 -0
- package/android/src/main/java/io/capawesome/capacitorjs/plugins/nodejs/NodejsPlugin.java +159 -0
- package/android/src/main/java/io/capawesome/capacitorjs/plugins/nodejs/classes/CustomException.java +20 -0
- package/android/src/main/java/io/capawesome/capacitorjs/plugins/nodejs/classes/CustomExceptions.java +23 -0
- package/android/src/main/java/io/capawesome/capacitorjs/plugins/nodejs/classes/events/MessageEvent.java +27 -0
- package/android/src/main/java/io/capawesome/capacitorjs/plugins/nodejs/classes/options/SendOptions.java +48 -0
- package/android/src/main/java/io/capawesome/capacitorjs/plugins/nodejs/classes/options/StartOptions.java +81 -0
- package/android/src/main/java/io/capawesome/capacitorjs/plugins/nodejs/classes/results/IsReadyResult.java +22 -0
- package/android/src/main/java/io/capawesome/capacitorjs/plugins/nodejs/interfaces/Callback.java +5 -0
- package/android/src/main/java/io/capawesome/capacitorjs/plugins/nodejs/interfaces/EmptyCallback.java +5 -0
- package/android/src/main/java/io/capawesome/capacitorjs/plugins/nodejs/interfaces/NonEmptyResultCallback.java +7 -0
- package/android/src/main/java/io/capawesome/capacitorjs/plugins/nodejs/interfaces/Result.java +7 -0
- package/android/src/main/res/.gitkeep +0 -0
- package/dist/docs.json +432 -0
- package/dist/esm/definitions.d.ts +214 -0
- package/dist/esm/definitions.js +38 -0
- package/dist/esm/definitions.js.map +1 -0
- package/dist/esm/index.d.ts +4 -0
- package/dist/esm/index.js +7 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/web.d.ts +8 -0
- package/dist/esm/web.js +16 -0
- package/dist/esm/web.js.map +1 -0
- package/dist/plugin.cjs.js +68 -0
- package/dist/plugin.cjs.js.map +1 -0
- package/dist/plugin.js +71 -0
- package/dist/plugin.js.map +1 -0
- package/ios/Plugin/Assets/builtin_modules/bridge/index.js +205 -0
- package/ios/Plugin/Classes/Events/MessageEvent.swift +19 -0
- package/ios/Plugin/Classes/Options/SendOptions.swift +19 -0
- package/ios/Plugin/Classes/Options/StartOptions.swift +32 -0
- package/ios/Plugin/Classes/Results/IsReadyResult.swift +16 -0
- package/ios/Plugin/Enums/CustomError.swift +46 -0
- package/ios/Plugin/Nodejs.swift +148 -0
- package/ios/Plugin/NodejsConfig.swift +6 -0
- package/ios/Plugin/NodejsPlugin.swift +102 -0
- package/ios/Plugin/Protocols/Result.swift +6 -0
- package/ios/PluginNative/NodeRunner.mm +221 -0
- package/ios/PluginNative/bridge.cpp +225 -0
- package/ios/PluginNative/bridge.h +15 -0
- package/ios/PluginNative/include/NodeRunner.h +12 -0
- package/package.json +93 -0
- package/scripts/postinstall.js +109 -0
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
package io.capawesome.capacitorjs.plugins.nodejs.classes.events;
|
|
2
|
+
|
|
3
|
+
import androidx.annotation.NonNull;
|
|
4
|
+
import com.getcapacitor.JSArray;
|
|
5
|
+
import com.getcapacitor.JSObject;
|
|
6
|
+
|
|
7
|
+
public class MessageEvent {
|
|
8
|
+
|
|
9
|
+
@NonNull
|
|
10
|
+
private final JSArray args;
|
|
11
|
+
|
|
12
|
+
@NonNull
|
|
13
|
+
private final String eventName;
|
|
14
|
+
|
|
15
|
+
public MessageEvent(@NonNull String eventName, @NonNull JSArray args) {
|
|
16
|
+
this.args = args;
|
|
17
|
+
this.eventName = eventName;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
@NonNull
|
|
21
|
+
public JSObject toJSObject() {
|
|
22
|
+
JSObject result = new JSObject();
|
|
23
|
+
result.put("args", args);
|
|
24
|
+
result.put("eventName", eventName);
|
|
25
|
+
return result;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
package io.capawesome.capacitorjs.plugins.nodejs.classes.options;
|
|
2
|
+
|
|
3
|
+
import androidx.annotation.NonNull;
|
|
4
|
+
import com.getcapacitor.JSArray;
|
|
5
|
+
import com.getcapacitor.PluginCall;
|
|
6
|
+
import io.capawesome.capacitorjs.plugins.nodejs.classes.CustomExceptions;
|
|
7
|
+
|
|
8
|
+
public class SendOptions {
|
|
9
|
+
|
|
10
|
+
@NonNull
|
|
11
|
+
private final JSArray args;
|
|
12
|
+
|
|
13
|
+
@NonNull
|
|
14
|
+
private final String eventName;
|
|
15
|
+
|
|
16
|
+
public SendOptions(@NonNull PluginCall call) throws Exception {
|
|
17
|
+
this.args = SendOptions.getArgsFromCall(call);
|
|
18
|
+
this.eventName = SendOptions.getEventNameFromCall(call);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
@NonNull
|
|
22
|
+
public JSArray getArgs() {
|
|
23
|
+
return args;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
@NonNull
|
|
27
|
+
public String getEventName() {
|
|
28
|
+
return eventName;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
@NonNull
|
|
32
|
+
private static JSArray getArgsFromCall(@NonNull PluginCall call) {
|
|
33
|
+
JSArray args = call.getArray("args");
|
|
34
|
+
if (args == null) {
|
|
35
|
+
args = new JSArray();
|
|
36
|
+
}
|
|
37
|
+
return args;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
@NonNull
|
|
41
|
+
private static String getEventNameFromCall(@NonNull PluginCall call) throws Exception {
|
|
42
|
+
String eventName = call.getString("eventName");
|
|
43
|
+
if (eventName == null) {
|
|
44
|
+
throw CustomExceptions.EVENT_NAME_MISSING;
|
|
45
|
+
}
|
|
46
|
+
return eventName;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
package io.capawesome.capacitorjs.plugins.nodejs.classes.options;
|
|
2
|
+
|
|
3
|
+
import androidx.annotation.NonNull;
|
|
4
|
+
import androidx.annotation.Nullable;
|
|
5
|
+
import com.getcapacitor.JSObject;
|
|
6
|
+
import com.getcapacitor.PluginCall;
|
|
7
|
+
import java.util.ArrayList;
|
|
8
|
+
import java.util.HashMap;
|
|
9
|
+
import java.util.Iterator;
|
|
10
|
+
import java.util.List;
|
|
11
|
+
import java.util.Map;
|
|
12
|
+
|
|
13
|
+
public class StartOptions {
|
|
14
|
+
|
|
15
|
+
@NonNull
|
|
16
|
+
private final List<String> args;
|
|
17
|
+
|
|
18
|
+
@NonNull
|
|
19
|
+
private final Map<String, String> env;
|
|
20
|
+
|
|
21
|
+
@Nullable
|
|
22
|
+
private final String script;
|
|
23
|
+
|
|
24
|
+
public StartOptions() {
|
|
25
|
+
this.args = new ArrayList<>();
|
|
26
|
+
this.env = new HashMap<>();
|
|
27
|
+
this.script = null;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
public StartOptions(@NonNull PluginCall call) {
|
|
31
|
+
this.args = StartOptions.getArgsFromCall(call);
|
|
32
|
+
this.env = StartOptions.getEnvFromCall(call);
|
|
33
|
+
this.script = call.getString("script");
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
@NonNull
|
|
37
|
+
public List<String> getArgs() {
|
|
38
|
+
return args;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
@NonNull
|
|
42
|
+
public Map<String, String> getEnv() {
|
|
43
|
+
return env;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
@Nullable
|
|
47
|
+
public String getScript() {
|
|
48
|
+
return script;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
@NonNull
|
|
52
|
+
private static List<String> getArgsFromCall(@NonNull PluginCall call) {
|
|
53
|
+
List<String> args = new ArrayList<>();
|
|
54
|
+
try {
|
|
55
|
+
List<Object> values = call.getArray("args", new com.getcapacitor.JSArray()).toList();
|
|
56
|
+
for (Object value : values) {
|
|
57
|
+
args.add(value.toString());
|
|
58
|
+
}
|
|
59
|
+
} catch (Exception exception) {
|
|
60
|
+
// No args provided.
|
|
61
|
+
}
|
|
62
|
+
return args;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
@NonNull
|
|
66
|
+
private static Map<String, String> getEnvFromCall(@NonNull PluginCall call) {
|
|
67
|
+
Map<String, String> env = new HashMap<>();
|
|
68
|
+
JSObject envObject = call.getObject("env");
|
|
69
|
+
if (envObject != null) {
|
|
70
|
+
Iterator<String> keys = envObject.keys();
|
|
71
|
+
while (keys.hasNext()) {
|
|
72
|
+
String key = keys.next();
|
|
73
|
+
String value = envObject.getString(key);
|
|
74
|
+
if (value != null) {
|
|
75
|
+
env.put(key, value);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
return env;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
package io.capawesome.capacitorjs.plugins.nodejs.classes.results;
|
|
2
|
+
|
|
3
|
+
import androidx.annotation.NonNull;
|
|
4
|
+
import com.getcapacitor.JSObject;
|
|
5
|
+
import io.capawesome.capacitorjs.plugins.nodejs.interfaces.Result;
|
|
6
|
+
|
|
7
|
+
public class IsReadyResult implements Result {
|
|
8
|
+
|
|
9
|
+
private final boolean ready;
|
|
10
|
+
|
|
11
|
+
public IsReadyResult(boolean ready) {
|
|
12
|
+
this.ready = ready;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
@Override
|
|
16
|
+
@NonNull
|
|
17
|
+
public JSObject toJSObject() {
|
|
18
|
+
JSObject result = new JSObject();
|
|
19
|
+
result.put("ready", ready);
|
|
20
|
+
return result;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
File without changes
|
package/dist/docs.json
ADDED
|
@@ -0,0 +1,432 @@
|
|
|
1
|
+
{
|
|
2
|
+
"api": {
|
|
3
|
+
"name": "NodejsPlugin",
|
|
4
|
+
"slug": "nodejsplugin",
|
|
5
|
+
"docs": "",
|
|
6
|
+
"tags": [
|
|
7
|
+
{
|
|
8
|
+
"text": "0.0.1",
|
|
9
|
+
"name": "since"
|
|
10
|
+
}
|
|
11
|
+
],
|
|
12
|
+
"methods": [
|
|
13
|
+
{
|
|
14
|
+
"name": "isReady",
|
|
15
|
+
"signature": "() => Promise<IsReadyResult>",
|
|
16
|
+
"parameters": [],
|
|
17
|
+
"returns": "Promise<IsReadyResult>",
|
|
18
|
+
"tags": [
|
|
19
|
+
{
|
|
20
|
+
"name": "since",
|
|
21
|
+
"text": "0.0.1"
|
|
22
|
+
}
|
|
23
|
+
],
|
|
24
|
+
"docs": "Check if the Node.js runtime is ready to receive messages.\n\nThe Node.js runtime is considered ready as soon as the Node.js project\nhas required the `bridge` module.\n\nOnly available on Android and iOS.",
|
|
25
|
+
"complexTypes": [
|
|
26
|
+
"IsReadyResult"
|
|
27
|
+
],
|
|
28
|
+
"slug": "isready"
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
"name": "send",
|
|
32
|
+
"signature": "(options: SendOptions) => Promise<void>",
|
|
33
|
+
"parameters": [
|
|
34
|
+
{
|
|
35
|
+
"name": "options",
|
|
36
|
+
"docs": "",
|
|
37
|
+
"type": "SendOptions"
|
|
38
|
+
}
|
|
39
|
+
],
|
|
40
|
+
"returns": "Promise<void>",
|
|
41
|
+
"tags": [
|
|
42
|
+
{
|
|
43
|
+
"name": "since",
|
|
44
|
+
"text": "0.0.1"
|
|
45
|
+
}
|
|
46
|
+
],
|
|
47
|
+
"docs": "Send a message to the Node.js runtime.\n\nThis method is only available when the Node.js runtime is ready.\nUse the `isReady()` method or the `ready` event to check if the\nNode.js runtime is ready.\n\nOnly available on Android and iOS.",
|
|
48
|
+
"complexTypes": [
|
|
49
|
+
"SendOptions"
|
|
50
|
+
],
|
|
51
|
+
"slug": "send"
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
"name": "start",
|
|
55
|
+
"signature": "(options?: StartOptions | undefined) => Promise<void>",
|
|
56
|
+
"parameters": [
|
|
57
|
+
{
|
|
58
|
+
"name": "options",
|
|
59
|
+
"docs": "",
|
|
60
|
+
"type": "StartOptions | undefined"
|
|
61
|
+
}
|
|
62
|
+
],
|
|
63
|
+
"returns": "Promise<void>",
|
|
64
|
+
"tags": [
|
|
65
|
+
{
|
|
66
|
+
"name": "since",
|
|
67
|
+
"text": "0.0.1"
|
|
68
|
+
}
|
|
69
|
+
],
|
|
70
|
+
"docs": "Start the Node.js runtime manually.\n\nThis method is only available if the `startMode` configuration option\nis set to `manual`.\n\n**Attention**: The Node.js runtime can only be started once per app\nlaunch. Stopping and restarting the Node.js runtime is not supported.\n\nOnly available on Android and iOS.",
|
|
71
|
+
"complexTypes": [
|
|
72
|
+
"StartOptions"
|
|
73
|
+
],
|
|
74
|
+
"slug": "start"
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
"name": "addListener",
|
|
78
|
+
"signature": "(eventName: 'message', listenerFunc: (event: MessageEvent) => void) => Promise<PluginListenerHandle>",
|
|
79
|
+
"parameters": [
|
|
80
|
+
{
|
|
81
|
+
"name": "eventName",
|
|
82
|
+
"docs": "",
|
|
83
|
+
"type": "'message'"
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
"name": "listenerFunc",
|
|
87
|
+
"docs": "",
|
|
88
|
+
"type": "(event: MessageEvent) => void"
|
|
89
|
+
}
|
|
90
|
+
],
|
|
91
|
+
"returns": "Promise<PluginListenerHandle>",
|
|
92
|
+
"tags": [
|
|
93
|
+
{
|
|
94
|
+
"name": "since",
|
|
95
|
+
"text": "0.0.1"
|
|
96
|
+
}
|
|
97
|
+
],
|
|
98
|
+
"docs": "Called when a message is received from the Node.js runtime.\n\nOnly available on Android and iOS.",
|
|
99
|
+
"complexTypes": [
|
|
100
|
+
"PluginListenerHandle",
|
|
101
|
+
"MessageEvent"
|
|
102
|
+
],
|
|
103
|
+
"slug": "addlistenermessage-"
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
"name": "addListener",
|
|
107
|
+
"signature": "(eventName: 'ready', listenerFunc: () => void) => Promise<PluginListenerHandle>",
|
|
108
|
+
"parameters": [
|
|
109
|
+
{
|
|
110
|
+
"name": "eventName",
|
|
111
|
+
"docs": "",
|
|
112
|
+
"type": "'ready'"
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
"name": "listenerFunc",
|
|
116
|
+
"docs": "",
|
|
117
|
+
"type": "() => void"
|
|
118
|
+
}
|
|
119
|
+
],
|
|
120
|
+
"returns": "Promise<PluginListenerHandle>",
|
|
121
|
+
"tags": [
|
|
122
|
+
{
|
|
123
|
+
"name": "since",
|
|
124
|
+
"text": "0.0.1"
|
|
125
|
+
}
|
|
126
|
+
],
|
|
127
|
+
"docs": "Called when the Node.js runtime is ready to receive messages.\n\nOnly available on Android and iOS.",
|
|
128
|
+
"complexTypes": [
|
|
129
|
+
"PluginListenerHandle"
|
|
130
|
+
],
|
|
131
|
+
"slug": "addlistenerready-"
|
|
132
|
+
},
|
|
133
|
+
{
|
|
134
|
+
"name": "removeAllListeners",
|
|
135
|
+
"signature": "() => Promise<void>",
|
|
136
|
+
"parameters": [],
|
|
137
|
+
"returns": "Promise<void>",
|
|
138
|
+
"tags": [
|
|
139
|
+
{
|
|
140
|
+
"name": "since",
|
|
141
|
+
"text": "0.0.1"
|
|
142
|
+
}
|
|
143
|
+
],
|
|
144
|
+
"docs": "Remove all listeners for this plugin.",
|
|
145
|
+
"complexTypes": [],
|
|
146
|
+
"slug": "removealllisteners"
|
|
147
|
+
}
|
|
148
|
+
],
|
|
149
|
+
"properties": []
|
|
150
|
+
},
|
|
151
|
+
"interfaces": [
|
|
152
|
+
{
|
|
153
|
+
"name": "IsReadyResult",
|
|
154
|
+
"slug": "isreadyresult",
|
|
155
|
+
"docs": "",
|
|
156
|
+
"tags": [
|
|
157
|
+
{
|
|
158
|
+
"text": "0.0.1",
|
|
159
|
+
"name": "since"
|
|
160
|
+
}
|
|
161
|
+
],
|
|
162
|
+
"methods": [],
|
|
163
|
+
"properties": [
|
|
164
|
+
{
|
|
165
|
+
"name": "ready",
|
|
166
|
+
"tags": [
|
|
167
|
+
{
|
|
168
|
+
"text": "0.0.1",
|
|
169
|
+
"name": "since"
|
|
170
|
+
},
|
|
171
|
+
{
|
|
172
|
+
"text": "true",
|
|
173
|
+
"name": "example"
|
|
174
|
+
}
|
|
175
|
+
],
|
|
176
|
+
"docs": "Whether or not the Node.js runtime is ready to receive messages.",
|
|
177
|
+
"complexTypes": [],
|
|
178
|
+
"type": "boolean"
|
|
179
|
+
}
|
|
180
|
+
]
|
|
181
|
+
},
|
|
182
|
+
{
|
|
183
|
+
"name": "SendOptions",
|
|
184
|
+
"slug": "sendoptions",
|
|
185
|
+
"docs": "",
|
|
186
|
+
"tags": [
|
|
187
|
+
{
|
|
188
|
+
"text": "0.0.1",
|
|
189
|
+
"name": "since"
|
|
190
|
+
}
|
|
191
|
+
],
|
|
192
|
+
"methods": [],
|
|
193
|
+
"properties": [
|
|
194
|
+
{
|
|
195
|
+
"name": "args",
|
|
196
|
+
"tags": [
|
|
197
|
+
{
|
|
198
|
+
"text": "0.0.1",
|
|
199
|
+
"name": "since"
|
|
200
|
+
},
|
|
201
|
+
{
|
|
202
|
+
"text": "['Hello from Capacitor!']",
|
|
203
|
+
"name": "example"
|
|
204
|
+
}
|
|
205
|
+
],
|
|
206
|
+
"docs": "The arguments to send to the Node.js runtime.",
|
|
207
|
+
"complexTypes": [
|
|
208
|
+
"MessageArg"
|
|
209
|
+
],
|
|
210
|
+
"type": "MessageArg[] | undefined"
|
|
211
|
+
},
|
|
212
|
+
{
|
|
213
|
+
"name": "eventName",
|
|
214
|
+
"tags": [
|
|
215
|
+
{
|
|
216
|
+
"text": "0.0.1",
|
|
217
|
+
"name": "since"
|
|
218
|
+
},
|
|
219
|
+
{
|
|
220
|
+
"text": "'my-event'",
|
|
221
|
+
"name": "example"
|
|
222
|
+
}
|
|
223
|
+
],
|
|
224
|
+
"docs": "The name of the event to send to the Node.js runtime.",
|
|
225
|
+
"complexTypes": [],
|
|
226
|
+
"type": "string"
|
|
227
|
+
}
|
|
228
|
+
]
|
|
229
|
+
},
|
|
230
|
+
{
|
|
231
|
+
"name": "StartOptions",
|
|
232
|
+
"slug": "startoptions",
|
|
233
|
+
"docs": "",
|
|
234
|
+
"tags": [
|
|
235
|
+
{
|
|
236
|
+
"text": "0.0.1",
|
|
237
|
+
"name": "since"
|
|
238
|
+
}
|
|
239
|
+
],
|
|
240
|
+
"methods": [],
|
|
241
|
+
"properties": [
|
|
242
|
+
{
|
|
243
|
+
"name": "args",
|
|
244
|
+
"tags": [
|
|
245
|
+
{
|
|
246
|
+
"text": "0.0.1",
|
|
247
|
+
"name": "since"
|
|
248
|
+
},
|
|
249
|
+
{
|
|
250
|
+
"text": "['--option', 'value']",
|
|
251
|
+
"name": "example"
|
|
252
|
+
}
|
|
253
|
+
],
|
|
254
|
+
"docs": "The arguments to pass to the Node.js process.",
|
|
255
|
+
"complexTypes": [],
|
|
256
|
+
"type": "string[] | undefined"
|
|
257
|
+
},
|
|
258
|
+
{
|
|
259
|
+
"name": "env",
|
|
260
|
+
"tags": [
|
|
261
|
+
{
|
|
262
|
+
"text": "0.0.1",
|
|
263
|
+
"name": "since"
|
|
264
|
+
},
|
|
265
|
+
{
|
|
266
|
+
"text": "{ MY_ENV_VAR: 'value' }",
|
|
267
|
+
"name": "example"
|
|
268
|
+
}
|
|
269
|
+
],
|
|
270
|
+
"docs": "The environment variables to set for the Node.js process.",
|
|
271
|
+
"complexTypes": [],
|
|
272
|
+
"type": "{ [key: string]: string; } | undefined"
|
|
273
|
+
},
|
|
274
|
+
{
|
|
275
|
+
"name": "script",
|
|
276
|
+
"tags": [
|
|
277
|
+
{
|
|
278
|
+
"text": "0.0.1",
|
|
279
|
+
"name": "since"
|
|
280
|
+
},
|
|
281
|
+
{
|
|
282
|
+
"text": "The `main` field of the `package.json` file of the Node.js project.",
|
|
283
|
+
"name": "default"
|
|
284
|
+
},
|
|
285
|
+
{
|
|
286
|
+
"text": "'custom-main.js'",
|
|
287
|
+
"name": "example"
|
|
288
|
+
}
|
|
289
|
+
],
|
|
290
|
+
"docs": "The path of the script file to run, relative to the Node.js project directory.",
|
|
291
|
+
"complexTypes": [],
|
|
292
|
+
"type": "string | undefined"
|
|
293
|
+
}
|
|
294
|
+
]
|
|
295
|
+
},
|
|
296
|
+
{
|
|
297
|
+
"name": "PluginListenerHandle",
|
|
298
|
+
"slug": "pluginlistenerhandle",
|
|
299
|
+
"docs": "",
|
|
300
|
+
"tags": [],
|
|
301
|
+
"methods": [],
|
|
302
|
+
"properties": [
|
|
303
|
+
{
|
|
304
|
+
"name": "remove",
|
|
305
|
+
"tags": [],
|
|
306
|
+
"docs": "",
|
|
307
|
+
"complexTypes": [],
|
|
308
|
+
"type": "() => Promise<void>"
|
|
309
|
+
}
|
|
310
|
+
]
|
|
311
|
+
},
|
|
312
|
+
{
|
|
313
|
+
"name": "MessageEvent",
|
|
314
|
+
"slug": "messageevent",
|
|
315
|
+
"docs": "",
|
|
316
|
+
"tags": [
|
|
317
|
+
{
|
|
318
|
+
"text": "0.0.1",
|
|
319
|
+
"name": "since"
|
|
320
|
+
}
|
|
321
|
+
],
|
|
322
|
+
"methods": [],
|
|
323
|
+
"properties": [
|
|
324
|
+
{
|
|
325
|
+
"name": "args",
|
|
326
|
+
"tags": [
|
|
327
|
+
{
|
|
328
|
+
"text": "0.0.1",
|
|
329
|
+
"name": "since"
|
|
330
|
+
},
|
|
331
|
+
{
|
|
332
|
+
"text": "['Hello from Node.js!']",
|
|
333
|
+
"name": "example"
|
|
334
|
+
}
|
|
335
|
+
],
|
|
336
|
+
"docs": "The arguments received from the Node.js runtime.",
|
|
337
|
+
"complexTypes": [
|
|
338
|
+
"MessageArg"
|
|
339
|
+
],
|
|
340
|
+
"type": "MessageArg[]"
|
|
341
|
+
},
|
|
342
|
+
{
|
|
343
|
+
"name": "eventName",
|
|
344
|
+
"tags": [
|
|
345
|
+
{
|
|
346
|
+
"text": "0.0.1",
|
|
347
|
+
"name": "since"
|
|
348
|
+
},
|
|
349
|
+
{
|
|
350
|
+
"text": "'my-event'",
|
|
351
|
+
"name": "example"
|
|
352
|
+
}
|
|
353
|
+
],
|
|
354
|
+
"docs": "The name of the event received from the Node.js runtime.",
|
|
355
|
+
"complexTypes": [],
|
|
356
|
+
"type": "string"
|
|
357
|
+
}
|
|
358
|
+
]
|
|
359
|
+
}
|
|
360
|
+
],
|
|
361
|
+
"enums": [],
|
|
362
|
+
"typeAliases": [
|
|
363
|
+
{
|
|
364
|
+
"name": "MessageArg",
|
|
365
|
+
"slug": "messagearg",
|
|
366
|
+
"docs": "A single argument of a message that is exchanged with the Node.js runtime.",
|
|
367
|
+
"types": [
|
|
368
|
+
{
|
|
369
|
+
"text": "string",
|
|
370
|
+
"complexTypes": []
|
|
371
|
+
},
|
|
372
|
+
{
|
|
373
|
+
"text": "number",
|
|
374
|
+
"complexTypes": []
|
|
375
|
+
},
|
|
376
|
+
{
|
|
377
|
+
"text": "boolean",
|
|
378
|
+
"complexTypes": []
|
|
379
|
+
}
|
|
380
|
+
]
|
|
381
|
+
}
|
|
382
|
+
],
|
|
383
|
+
"pluginConfigs": [
|
|
384
|
+
{
|
|
385
|
+
"name": "Nodejs",
|
|
386
|
+
"slug": "nodejs",
|
|
387
|
+
"properties": [
|
|
388
|
+
{
|
|
389
|
+
"name": "nodeDir",
|
|
390
|
+
"tags": [
|
|
391
|
+
{
|
|
392
|
+
"text": "0.0.1",
|
|
393
|
+
"name": "since"
|
|
394
|
+
},
|
|
395
|
+
{
|
|
396
|
+
"text": "'nodejs'",
|
|
397
|
+
"name": "default"
|
|
398
|
+
},
|
|
399
|
+
{
|
|
400
|
+
"text": "'custom-nodejs'",
|
|
401
|
+
"name": "example"
|
|
402
|
+
}
|
|
403
|
+
],
|
|
404
|
+
"docs": "The directory of the Node.js project, relative to the Capacitor `webDir`.\n\nOnly available on Android and iOS.",
|
|
405
|
+
"complexTypes": [],
|
|
406
|
+
"type": "string | undefined"
|
|
407
|
+
},
|
|
408
|
+
{
|
|
409
|
+
"name": "startMode",
|
|
410
|
+
"tags": [
|
|
411
|
+
{
|
|
412
|
+
"text": "0.0.1",
|
|
413
|
+
"name": "since"
|
|
414
|
+
},
|
|
415
|
+
{
|
|
416
|
+
"text": "'auto'",
|
|
417
|
+
"name": "default"
|
|
418
|
+
},
|
|
419
|
+
{
|
|
420
|
+
"text": "'manual'",
|
|
421
|
+
"name": "example"
|
|
422
|
+
}
|
|
423
|
+
],
|
|
424
|
+
"docs": "The start mode of the Node.js runtime.\n\nIf set to `auto`, the Node.js runtime starts automatically when the app is launched.\nIf set to `manual`, the Node.js runtime must be started manually using the `start(...)` method.\n\nOnly available on Android and iOS.",
|
|
425
|
+
"complexTypes": [],
|
|
426
|
+
"type": "'manual' | 'auto' | undefined"
|
|
427
|
+
}
|
|
428
|
+
],
|
|
429
|
+
"docs": ""
|
|
430
|
+
}
|
|
431
|
+
]
|
|
432
|
+
}
|