acode-plugin-types 1.11.7-patch.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.
Files changed (79) hide show
  1. package/README.md +8 -0
  2. package/index.d.ts +91 -0
  3. package/package.json +26 -0
  4. package/src/ace/index.d.ts +1 -0
  5. package/src/ace/modelist.d.ts +22 -0
  6. package/src/acode.d.ts +437 -0
  7. package/src/components/collapsibleList.d.ts +11 -0
  8. package/src/components/contextMenu.d.ts +66 -0
  9. package/src/components/index.d.ts +10 -0
  10. package/src/components/inputhints.d.ts +45 -0
  11. package/src/components/page.d.ts +22 -0
  12. package/src/components/palette.d.ts +21 -0
  13. package/src/components/sideButton.d.ts +35 -0
  14. package/src/components/terminal/index.d.ts +1 -0
  15. package/src/components/terminal/terminalManager.d.ts +113 -0
  16. package/src/components/toast.d.ts +20 -0
  17. package/src/components/tutorial.d.ts +13 -0
  18. package/src/components/webComponents/index.d.ts +1 -0
  19. package/src/components/webComponents/wcPage.d.ts +85 -0
  20. package/src/dialogs/alert.d.ts +15 -0
  21. package/src/dialogs/box.d.ts +45 -0
  22. package/src/dialogs/color.d.ts +15 -0
  23. package/src/dialogs/confirm.d.ts +16 -0
  24. package/src/dialogs/index.d.ts +8 -0
  25. package/src/dialogs/loader.d.ts +44 -0
  26. package/src/dialogs/multiPrompt.d.ts +16 -0
  27. package/src/dialogs/prompt.d.ts +47 -0
  28. package/src/dialogs/select.d.ts +66 -0
  29. package/src/fileSystem.d.ts +113 -0
  30. package/src/handlers/index.d.ts +3 -0
  31. package/src/handlers/intent.d.ts +47 -0
  32. package/src/handlers/keyboard.d.ts +30 -0
  33. package/src/handlers/windowResize.d.ts +13 -0
  34. package/src/index.d.ts +12 -0
  35. package/src/lib/actionStack.d.ts +60 -0
  36. package/src/lib/editorFile.d.ts +344 -0
  37. package/src/lib/editorManager.d.ts +127 -0
  38. package/src/lib/fileList.d.ts +70 -0
  39. package/src/lib/fonts.d.ts +29 -0
  40. package/src/lib/index.d.ts +9 -0
  41. package/src/lib/openFolder.d.ts +102 -0
  42. package/src/lib/projects.d.ts +28 -0
  43. package/src/lib/selectionMenu.d.ts +19 -0
  44. package/src/lib/settings.d.ts +155 -0
  45. package/src/pages/fileBrowser/fileBrowser.d.ts +65 -0
  46. package/src/pages/fileBrowser/index.d.ts +1 -0
  47. package/src/pages/index.d.ts +1 -0
  48. package/src/plugins/customtabs/CustomTabs.d.ts +57 -0
  49. package/src/plugins/customtabs/index.d.ts +1 -0
  50. package/src/plugins/index.d.ts +4 -0
  51. package/src/plugins/system/System.d.ts +550 -0
  52. package/src/plugins/system/index.d.ts +1 -0
  53. package/src/plugins/terminal/Executor.d.ts +155 -0
  54. package/src/plugins/terminal/Terminal.d.ts +123 -0
  55. package/src/plugins/terminal/index.d.ts +2 -0
  56. package/src/plugins/websocket/WebSocket.d.ts +224 -0
  57. package/src/plugins/websocket/index.d.ts +1 -0
  58. package/src/sideBarApps.d.ts +39 -0
  59. package/src/test.ts +517 -0
  60. package/src/theme/builder.d.ts +188 -0
  61. package/src/theme/index.d.ts +2 -0
  62. package/src/theme/list.d.ts +29 -0
  63. package/src/utils/KeyboardEvent.d.ts +19 -0
  64. package/src/utils/Url.d.ts +65 -0
  65. package/src/utils/color.d.ts +51 -0
  66. package/src/utils/encodings.d.ts +24 -0
  67. package/src/utils/helpers.d.ts +102 -0
  68. package/src/utils/index.d.ts +5 -0
  69. package/types/ace/VERSION +1 -0
  70. package/types/ace/ace-modes.d.ts +1724 -0
  71. package/types/ace/index.d.ts +1176 -0
  72. package/types/ace/types/ace-ext.d.ts +720 -0
  73. package/types/ace/types/ace-lib.d.ts +302 -0
  74. package/types/ace/types/ace-modules.d.ts +5293 -0
  75. package/types/ace/types/ace-snippets.d.ts +406 -0
  76. package/types/ace/types/ace-theme.d.ts +437 -0
  77. package/types/html-tag-js.d.ts +680 -0
  78. package/types/require.d.ts +412 -0
  79. package/types/xterm.d.ts +1908 -0
@@ -0,0 +1,550 @@
1
+ /**
2
+ * Shortcut configuration for adding app shortcuts.
3
+ */
4
+ interface SystemShortcut {
5
+ /** Unique identifier for the shortcut. */
6
+ id: string;
7
+ /** Display label for the shortcut. */
8
+ label: string;
9
+ /** Description of the shortcut. */
10
+ description: string;
11
+ /** Icon for the shortcut (base64 or resource path). */
12
+ icon: string;
13
+ /** Action to perform when shortcut is activated. */
14
+ action: string;
15
+ /** Additional data to pass with the shortcut. */
16
+ data: string;
17
+ }
18
+
19
+ /**
20
+ * Application information returned by getAppInfo.
21
+ */
22
+ interface SystemAppInfo {
23
+ /** Application package name. */
24
+ packageName: string;
25
+ /** Application version name. */
26
+ versionName: string;
27
+ /** Application version code. */
28
+ versionCode: number;
29
+ /** Application label/name. */
30
+ label: string;
31
+ }
32
+
33
+ /**
34
+ * WebView information returned by getWebviewInfo.
35
+ */
36
+ interface SystemWebviewInfo {
37
+ /** WebView package name. */
38
+ packageName: string;
39
+ /** WebView version. */
40
+ versionName: string;
41
+ }
42
+
43
+ /**
44
+ * In-app browser instance returned by inAppBrowser.
45
+ */
46
+ interface SystemInAppBrowser {
47
+ /** Callback when an external browser is opened. */
48
+ onOpenExternalBrowser: ((url: string) => void) | null;
49
+ /** Callback when an error occurs. */
50
+ onError: ((error: string) => void) | null;
51
+ }
52
+
53
+ /**
54
+ * Intent data received by the intent handler.
55
+ */
56
+ interface SystemIntent {
57
+ /** The action of the intent. */
58
+ action?: string;
59
+ /** The data URI of the intent. */
60
+ data?: string;
61
+ /** The MIME type of the intent data. */
62
+ type?: string;
63
+ /** Extra data bundled with the intent. */
64
+ extras?: Record<string, unknown>;
65
+ }
66
+
67
+ /**
68
+ * Success callback type.
69
+ */
70
+ type SystemSuccessCallback<T = string> = (result: T) => void;
71
+
72
+ /**
73
+ * Error callback type.
74
+ */
75
+ type SystemErrorCallback = (error: string) => void;
76
+
77
+ /**
78
+ * System plugin providing native Android functionality for Cordova applications.
79
+ * Available globally as `system`.
80
+ */
81
+ interface System {
82
+ /**
83
+ * Checks if MANAGE_EXTERNAL_STORAGE permission is declared in AndroidManifest.xml.
84
+ * @param success - Callback with boolean result.
85
+ * @param error - Error callback.
86
+ */
87
+ isManageExternalStorageDeclared(
88
+ success: SystemSuccessCallback<boolean>,
89
+ error: SystemErrorCallback,
90
+ ): void;
91
+
92
+ /**
93
+ * Checks if storage manager permission has been granted.
94
+ * @param success - Callback with boolean result.
95
+ * @param error - Error callback.
96
+ */
97
+ hasGrantedStorageManager(
98
+ success: SystemSuccessCallback<boolean>,
99
+ error: SystemErrorCallback,
100
+ ): void;
101
+
102
+ /**
103
+ * Requests storage manager permission from the user.
104
+ * @param success - Callback on success.
105
+ * @param error - Error callback.
106
+ */
107
+ requestStorageManager(
108
+ success: SystemSuccessCallback,
109
+ error: SystemErrorCallback,
110
+ ): void;
111
+
112
+ /**
113
+ * Copies a file from source URI to destination URI.
114
+ * @param srcUri - Source file URI.
115
+ * @param destUri - Destination directory URI.
116
+ * @param fileName - Name for the copied file.
117
+ * @param success - Callback on success.
118
+ * @param error - Error callback.
119
+ */
120
+ copyToUri(
121
+ srcUri: string,
122
+ destUri: string,
123
+ fileName: string,
124
+ success: SystemSuccessCallback,
125
+ error: SystemErrorCallback,
126
+ ): void;
127
+
128
+ /**
129
+ * Checks if a file exists at the given path.
130
+ * @param path - File path to check.
131
+ * @param countSymlinks - Whether to follow symlinks.
132
+ * @param success - Callback with result (1 if exists, 0 if not).
133
+ * @param error - Error callback.
134
+ */
135
+ fileExists(
136
+ path: string,
137
+ countSymlinks: boolean,
138
+ success: SystemSuccessCallback<number>,
139
+ error: SystemErrorCallback,
140
+ ): void;
141
+
142
+ /**
143
+ * Creates a symbolic link.
144
+ * @param target - Target path the symlink points to.
145
+ * @param linkPath - Path where the symlink will be created.
146
+ * @param success - Callback on success.
147
+ * @param error - Error callback.
148
+ */
149
+ createSymlink(
150
+ target: string,
151
+ linkPath: string,
152
+ success: SystemSuccessCallback,
153
+ error: SystemErrorCallback,
154
+ ): void;
155
+
156
+ /**
157
+ * Writes text content to a file.
158
+ * @param path - File path to write to.
159
+ * @param content - Text content to write.
160
+ * @param success - Callback on success.
161
+ * @param error - Error callback.
162
+ */
163
+ writeText(
164
+ path: string,
165
+ content: string,
166
+ success: SystemSuccessCallback,
167
+ error: SystemErrorCallback,
168
+ ): void;
169
+
170
+ /**
171
+ * Deletes a file at the given path.
172
+ * @param path - File path to delete.
173
+ * @param success - Callback on success.
174
+ * @param error - Error callback.
175
+ */
176
+ deleteFile(
177
+ path: string,
178
+ success: SystemSuccessCallback,
179
+ error: SystemErrorCallback,
180
+ ): void;
181
+
182
+ /**
183
+ * Sets the executable permission on a file.
184
+ * @param path - File path.
185
+ * @param executable - Whether to make the file executable.
186
+ * @param success - Callback on success.
187
+ * @param error - Error callback.
188
+ */
189
+ setExec(
190
+ path: string,
191
+ executable: boolean,
192
+ success: SystemSuccessCallback,
193
+ error: SystemErrorCallback,
194
+ ): void;
195
+
196
+ /**
197
+ * Gets the native library path for the application.
198
+ * @param success - Callback with the library path.
199
+ * @param error - Error callback.
200
+ */
201
+ getNativeLibraryPath(
202
+ success: SystemSuccessCallback,
203
+ error: SystemErrorCallback,
204
+ ): void;
205
+
206
+ /**
207
+ * Gets the application's files directory path.
208
+ * @param success - Callback with the files directory path.
209
+ * @param error - Error callback.
210
+ */
211
+ getFilesDir(success: SystemSuccessCallback, error: SystemErrorCallback): void;
212
+
213
+ /**
214
+ * Gets the parent directory path of a given path.
215
+ * @param path - File or directory path.
216
+ * @param success - Callback with the parent path.
217
+ * @param error - Error callback.
218
+ */
219
+ getParentPath(
220
+ path: string,
221
+ success: SystemSuccessCallback,
222
+ error: SystemErrorCallback,
223
+ ): void;
224
+
225
+ /**
226
+ * Lists children of a directory.
227
+ * @param path - Directory path.
228
+ * @param success - Callback with array of child names.
229
+ * @param error - Error callback.
230
+ */
231
+ listChildren(
232
+ path: string,
233
+ success: SystemSuccessCallback<string[]>,
234
+ error: SystemErrorCallback,
235
+ ): void;
236
+
237
+ /**
238
+ * Creates directories recursively (like mkdir -p).
239
+ * @param path - Directory path to create.
240
+ * @param success - Callback on success.
241
+ * @param error - Error callback.
242
+ */
243
+ mkdirs(
244
+ path: string,
245
+ success: SystemSuccessCallback,
246
+ error: SystemErrorCallback,
247
+ ): void;
248
+
249
+ /**
250
+ * Gets the device CPU architecture.
251
+ * @param success - Callback with architecture string (e.g., 'arm64-v8a', 'armeabi-v7a', 'x86_64').
252
+ * @param error - Error callback.
253
+ */
254
+ getArch(
255
+ success: SystemSuccessCallback<
256
+ "arm64-v8a" | "armeabi-v7a" | "x86_64" | "x86"
257
+ >,
258
+ error: SystemErrorCallback,
259
+ ): void;
260
+
261
+ /**
262
+ * Clears the application cache.
263
+ * @param success - Callback on success.
264
+ * @param error - Error callback.
265
+ */
266
+ clearCache(success: SystemSuccessCallback, error: SystemErrorCallback): void;
267
+
268
+ /**
269
+ * Gets information about the WebView.
270
+ * @param success - Callback with WebView info.
271
+ * @param error - Error callback.
272
+ */
273
+ getWebviewInfo(
274
+ success: SystemSuccessCallback<SystemWebviewInfo>,
275
+ error: SystemErrorCallback,
276
+ ): void;
277
+
278
+ /**
279
+ * Checks if device is in power save mode.
280
+ * @param success - Callback with boolean result.
281
+ * @param error - Error callback.
282
+ */
283
+ isPowerSaveMode(
284
+ success: SystemSuccessCallback<boolean>,
285
+ error: SystemErrorCallback,
286
+ ): void;
287
+
288
+ /**
289
+ * Performs a file action using Android intents.
290
+ * @param fileUri - URI of the file.
291
+ * @param filename - Optional filename.
292
+ * @param action - Action to perform (e.g., 'VIEW', 'SEND', 'EDIT').
293
+ * @param mimeType - MIME type of the file.
294
+ * @param onFail - Error callback.
295
+ */
296
+ fileAction(
297
+ fileUri: string,
298
+ filename: string,
299
+ action: string,
300
+ mimeType: string,
301
+ onFail?: SystemErrorCallback,
302
+ ): void;
303
+
304
+ /**
305
+ * Performs a file action using Android intents (without filename).
306
+ * @param fileUri - URI of the file.
307
+ * @param action - Action to perform (e.g., 'VIEW', 'SEND', 'EDIT').
308
+ * @param mimeType - MIME type of the file.
309
+ * @param onFail - Error callback.
310
+ */
311
+ fileAction(
312
+ fileUri: string,
313
+ action: string,
314
+ mimeType: string,
315
+ onFail?: SystemErrorCallback,
316
+ ): void;
317
+
318
+ /**
319
+ * Gets application information.
320
+ * @param success - Callback with app info.
321
+ * @param error - Error callback.
322
+ */
323
+ getAppInfo(
324
+ success: SystemSuccessCallback<SystemAppInfo>,
325
+ error: SystemErrorCallback,
326
+ ): void;
327
+
328
+ /**
329
+ * Adds a dynamic app shortcut.
330
+ * @param shortcut - Shortcut configuration.
331
+ * @param success - Callback on success.
332
+ * @param error - Error callback.
333
+ */
334
+ addShortcut(
335
+ shortcut: SystemShortcut,
336
+ success: SystemSuccessCallback,
337
+ error: SystemErrorCallback,
338
+ ): void;
339
+
340
+ /**
341
+ * Removes a dynamic app shortcut.
342
+ * @param id - Shortcut ID to remove.
343
+ * @param success - Callback on success.
344
+ * @param error - Error callback.
345
+ */
346
+ removeShortcut(
347
+ id: string,
348
+ success: SystemSuccessCallback,
349
+ error: SystemErrorCallback,
350
+ ): void;
351
+
352
+ /**
353
+ * Pins a shortcut to the home screen.
354
+ * @param id - Shortcut ID to pin.
355
+ * @param success - Callback on success.
356
+ * @param error - Error callback.
357
+ */
358
+ pinShortcut(
359
+ id: string,
360
+ success: SystemSuccessCallback,
361
+ error: SystemErrorCallback,
362
+ ): void;
363
+
364
+ /**
365
+ * Requests MANAGE_EXTERNAL_STORAGE permission (All Files Access).
366
+ * @param success - Callback on success.
367
+ * @param error - Error callback.
368
+ */
369
+ manageAllFiles(
370
+ success: SystemSuccessCallback,
371
+ error: SystemErrorCallback,
372
+ ): void;
373
+
374
+ /**
375
+ * Gets the Android SDK version.
376
+ * @param success - Callback with version number.
377
+ * @param error - Error callback.
378
+ */
379
+ getAndroidVersion(
380
+ success: SystemSuccessCallback<number>,
381
+ error: SystemErrorCallback,
382
+ ): void;
383
+
384
+ /**
385
+ * Checks if the app is an external storage manager.
386
+ * @param success - Callback with boolean result.
387
+ * @param error - Error callback.
388
+ */
389
+ isExternalStorageManager(
390
+ success: SystemSuccessCallback<boolean>,
391
+ error: SystemErrorCallback,
392
+ ): void;
393
+
394
+ /**
395
+ * Requests a single Android permission.
396
+ * @param permission - Permission to request (e.g., 'android.permission.CAMERA').
397
+ * @param success - Callback with grant result.
398
+ * @param error - Error callback.
399
+ */
400
+ requestPermission(
401
+ permission: string,
402
+ success: SystemSuccessCallback<boolean>,
403
+ error: SystemErrorCallback,
404
+ ): void;
405
+
406
+ /**
407
+ * Requests multiple Android permissions.
408
+ * @param permissions - Array of permissions to request.
409
+ * @param success - Callback with grant results.
410
+ * @param error - Error callback.
411
+ */
412
+ requestPermissions(
413
+ permissions: string[],
414
+ success: SystemSuccessCallback<Record<string, boolean>>,
415
+ error: SystemErrorCallback,
416
+ ): void;
417
+
418
+ /**
419
+ * Checks if a permission has been granted.
420
+ * @param permission - Permission to check.
421
+ * @param success - Callback with boolean result.
422
+ * @param error - Error callback.
423
+ */
424
+ hasPermission(
425
+ permission: string,
426
+ success: SystemSuccessCallback<boolean>,
427
+ error: SystemErrorCallback,
428
+ ): void;
429
+
430
+ /**
431
+ * Opens a URL in the default browser.
432
+ * @param src - URL to open.
433
+ */
434
+ openInBrowser(src: string): void;
435
+
436
+ /**
437
+ * Launches an Android application.
438
+ * @param app - Package name of the app to launch.
439
+ * @param className - Optional class name to launch.
440
+ * @param data - Optional data to pass.
441
+ * @param success - Callback on success.
442
+ * @param error - Error callback.
443
+ */
444
+ launchApp(
445
+ app: string,
446
+ className: string | null,
447
+ data: string | null,
448
+ success: SystemSuccessCallback,
449
+ error: SystemErrorCallback,
450
+ ): void;
451
+
452
+ /**
453
+ * Opens a URL in an in-app browser.
454
+ * @param url - URL to open.
455
+ * @param title - Title for the browser window.
456
+ * @param showButtons - Whether to show navigation buttons.
457
+ * @param disableCache - Whether to disable caching.
458
+ * @returns In-app browser instance with event handlers.
459
+ */
460
+ inAppBrowser(
461
+ url: string,
462
+ title: string,
463
+ showButtons?: boolean,
464
+ disableCache?: boolean,
465
+ ): SystemInAppBrowser;
466
+
467
+ /**
468
+ * Sets the UI theme (status bar and navigation bar colors).
469
+ * @param systemBarColor - Color for system bars (hex string).
470
+ * @param theme - Theme mode ('light' or 'dark').
471
+ * @param success - Callback on success.
472
+ * @param error - Error callback.
473
+ */
474
+ setUiTheme(
475
+ systemBarColor: string,
476
+ theme: "light" | "dark",
477
+ success: SystemSuccessCallback,
478
+ error: SystemErrorCallback,
479
+ ): void;
480
+
481
+ /**
482
+ * Sets a handler for incoming intents.
483
+ * @param handler - Callback invoked when an intent is received.
484
+ * @param onerror - Error callback.
485
+ */
486
+ setIntentHandler(
487
+ handler: (intent: SystemIntent) => void,
488
+ onerror: SystemErrorCallback,
489
+ ): void;
490
+
491
+ /**
492
+ * Gets the intent that started the Cordova activity.
493
+ * @param success - Callback with intent data.
494
+ * @param error - Error callback.
495
+ */
496
+ getCordovaIntent(
497
+ success: SystemSuccessCallback<SystemIntent>,
498
+ error: SystemErrorCallback,
499
+ ): void;
500
+
501
+ /**
502
+ * Sets the input type for text fields.
503
+ * @param type - Input type string.
504
+ * @param success - Callback on success.
505
+ * @param error - Error callback.
506
+ */
507
+ setInputType(
508
+ type: string,
509
+ success: SystemSuccessCallback,
510
+ error: SystemErrorCallback,
511
+ ): void;
512
+
513
+ /**
514
+ * Gets a global Android setting value.
515
+ * @param key - Setting key to retrieve.
516
+ * @param success - Callback with setting value.
517
+ * @param error - Error callback.
518
+ */
519
+ getGlobalSetting(
520
+ key: string,
521
+ success: SystemSuccessCallback,
522
+ error: SystemErrorCallback,
523
+ ): void;
524
+
525
+ /**
526
+ * Compares file content with provided text in a background thread.
527
+ * @param fileUri - The URI of the file to read.
528
+ * @param encoding - The character encoding to use.
529
+ * @param currentText - The text to compare against.
530
+ * @returns Promise resolving to true if content differs, false if same.
531
+ */
532
+ compareFileText(
533
+ fileUri: string,
534
+ encoding: string,
535
+ currentText: string,
536
+ ): Promise<boolean>;
537
+
538
+ /**
539
+ * Compares two text strings in a background thread.
540
+ * @param text1 - First text to compare.
541
+ * @param text2 - Second text to compare.
542
+ * @returns Promise resolving to true if texts differ, false if same.
543
+ */
544
+ compareTexts(text1: string, text2: string): Promise<boolean>;
545
+ }
546
+
547
+ /**
548
+ * Global System instance providing native Android functionality.
549
+ */
550
+ declare const system: System;
@@ -0,0 +1 @@
1
+ /// <reference path="./System.d.ts" />
@@ -0,0 +1,155 @@
1
+ /**
2
+ * Type of output received from a running process.
3
+ * - `stdout`: Standard output line
4
+ * - `stderr`: Standard error line
5
+ * - `exit`: Exit code of the process
6
+ * - `unknown`: Unrecognized output format
7
+ */
8
+ type ExecutorOutputType = "stdout" | "stderr" | "exit" | "unknown";
9
+
10
+ /**
11
+ * Callback function for receiving real-time process output.
12
+ * @param type - The type of output
13
+ * @param data - The output data (line content or exit code)
14
+ */
15
+ type ExecutorOutputCallback = (type: ExecutorOutputType, data: string) => void;
16
+
17
+ /**
18
+ * Provides an interface to run shell commands from a Cordova app.
19
+ * Supports real-time process streaming, writing input to running processes,
20
+ * stopping them, and executing one-time commands.
21
+ */
22
+ interface Executor {
23
+ /**
24
+ * The type of executor: "Executor" for foreground or "BackgroundExecutor" for background.
25
+ */
26
+ readonly ExecutorType: "Executor" | "BackgroundExecutor";
27
+
28
+ /**
29
+ * A background executor instance for running processes in the background.
30
+ * Only available on the main Executor instance exported from the module.
31
+ */
32
+ BackgroundExecutor: Executor;
33
+
34
+ /**
35
+ * Starts a shell process and enables real-time streaming of stdout, stderr, and exit status.
36
+ *
37
+ * @param command - The shell command to run (e.g., `"sh"`, `"ls -al"`)
38
+ * @param onData - Callback that receives real-time output:
39
+ * - `"stdout"`: Standard output line
40
+ * - `"stderr"`: Standard error line
41
+ * - `"exit"`: Exit code of the process
42
+ * @param alpine - Whether to run the command inside the Alpine sandbox environment (`true`) or on Android directly (`false`)
43
+ * @returns Promise resolving with a unique process ID (UUID) used for future references like `write()` or `stop()`
44
+ *
45
+ * @example
46
+ * Executor.start('sh', (type, data) => {
47
+ * console.log(`[${type}] ${data}`);
48
+ * }).then(uuid => {
49
+ * Executor.write(uuid, 'echo Hello World');
50
+ * Executor.stop(uuid);
51
+ * });
52
+ */
53
+ start(
54
+ command: string,
55
+ onData: ExecutorOutputCallback,
56
+ alpine?: boolean,
57
+ ): Promise<string>;
58
+
59
+ /**
60
+ * Sends input to a running process's stdin.
61
+ *
62
+ * @param uuid - The process ID returned by {@link Executor.start}
63
+ * @param input - Input string to send (e.g., shell commands)
64
+ * @returns Promise resolving once the input is written
65
+ *
66
+ * @example
67
+ * Executor.write(uuid, 'ls /sdcard');
68
+ */
69
+ write(uuid: string, input: string): Promise<string>;
70
+
71
+ /**
72
+ * Moves the executor service to the background (stops foreground notification).
73
+ *
74
+ * @returns Promise resolving when the service is moved to background
75
+ *
76
+ * @example
77
+ * Executor.moveToBackground();
78
+ */
79
+ moveToBackground(): Promise<string>;
80
+
81
+ /**
82
+ * Moves the executor service to the foreground (shows notification).
83
+ *
84
+ * @returns Promise resolving when the service is moved to foreground
85
+ *
86
+ * @example
87
+ * Executor.moveToForeground();
88
+ */
89
+ moveToForeground(): Promise<string>;
90
+
91
+ /**
92
+ * Terminates a running process.
93
+ *
94
+ * @param uuid - The process ID returned by {@link Executor.start}
95
+ * @returns Promise resolving when the process has been stopped
96
+ *
97
+ * @example
98
+ * Executor.stop(uuid);
99
+ */
100
+ stop(uuid: string): Promise<string>;
101
+
102
+ /**
103
+ * Checks if a process is still running.
104
+ *
105
+ * @param uuid - The process ID returned by {@link Executor.start}
106
+ * @returns Promise resolving `true` if the process is running, `false` otherwise
107
+ *
108
+ * @example
109
+ * const isAlive = await Executor.isRunning(uuid);
110
+ */
111
+ isRunning(uuid: string): Promise<boolean>;
112
+
113
+ /**
114
+ * Stops the executor service completely.
115
+ *
116
+ * @returns Promise resolving when the service has been stopped
117
+ *
118
+ * @example
119
+ * Executor.stopService();
120
+ */
121
+ stopService(): Promise<string>;
122
+
123
+ /**
124
+ * Executes a shell command once and waits for it to finish.
125
+ * Unlike {@link Executor.start}, this does not stream output.
126
+ *
127
+ * @param command - The shell command to execute
128
+ * @param alpine - Whether to run the command in the Alpine sandbox (`true`) or Android environment (`false`)
129
+ * @returns Promise resolving with standard output on success, rejects with an error or standard error on failure
130
+ *
131
+ * @example
132
+ * Executor.execute('ls -l')
133
+ * .then(console.log)
134
+ * .catch(console.error);
135
+ */
136
+ execute(command: string, alpine?: boolean): Promise<string>;
137
+
138
+ /**
139
+ * Loads a native library from the specified path.
140
+ *
141
+ * @param path - The path to the native library to load
142
+ * @returns Promise resolving when the library has been loaded
143
+ *
144
+ * @example
145
+ * Executor.loadLibrary('/path/to/library.so');
146
+ */
147
+ loadLibrary(path: string): Promise<string>;
148
+ }
149
+
150
+ /**
151
+ * Global Executor instance for running shell commands.
152
+ * This is the default executor module exported by the terminal-native Cordova plugin.
153
+ * Use `Executor.BackgroundExecutor` for background process execution.
154
+ */
155
+ declare const Executor: Executor;