@lynx-js/lynxtron 0.0.1 → 0.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 (51) hide show
  1. package/README.md +80 -0
  2. package/apis/api/app.d.ts +1848 -0
  3. package/apis/api/asar.d.ts +124 -0
  4. package/apis/api/base-window.d.ts +1712 -0
  5. package/apis/api/clipboard.d.ts +54 -0
  6. package/apis/api/command-line.d.ts +46 -0
  7. package/apis/api/context-bridge.d.ts +8 -0
  8. package/apis/api/devtool.d.ts +34 -0
  9. package/apis/api/dialog.d.ts +633 -0
  10. package/apis/api/dock.d.ts +88 -0
  11. package/apis/api/environment.d.ts +9 -0
  12. package/apis/api/event.d.ts +8 -0
  13. package/apis/api/jump-list-item.d.ts +83 -0
  14. package/apis/api/lynx-library.d.ts +7 -0
  15. package/apis/api/lynx-template-bundle.d.ts +32 -0
  16. package/apis/api/lynx-template-data.d.ts +10 -0
  17. package/apis/api/lynx-update-meta.d.ts +16 -0
  18. package/apis/api/lynx-window.d.ts +405 -0
  19. package/apis/api/menu.d.ts +96 -0
  20. package/apis/api/native-image.d.ts +268 -0
  21. package/apis/api/notification-response.d.ts +26 -0
  22. package/apis/api/notification.d.ts +242 -0
  23. package/apis/api/power-monitor.d.ts +121 -0
  24. package/apis/api/process-metric.d.ts +93 -0
  25. package/apis/api/protocol.d.ts +54 -0
  26. package/apis/api/screen.d.ts +222 -0
  27. package/apis/api/shell.d.ts +124 -0
  28. package/apis/api/task.d.ts +39 -0
  29. package/apis/api/touch-bar.d.ts +206 -0
  30. package/apis/api/tray.d.ts +44 -0
  31. package/apis/api/utility-process.d.ts +73 -0
  32. package/apis/lynx.d.ts +15 -0
  33. package/apis/lynxtron.d.ts +39 -0
  34. package/apis/structures/point.d.ts +10 -0
  35. package/apis/structures/rectangle.d.ts +22 -0
  36. package/apis/structures/size.d.ts +8 -0
  37. package/apis/web-host.d.ts +24 -0
  38. package/cli.js +28 -0
  39. package/context-bridge.js +6 -0
  40. package/fuses-cli.js +143 -0
  41. package/fuses.js +299 -0
  42. package/install.js +127 -0
  43. package/lynx.js +1 -0
  44. package/lynxtron.js +43 -0
  45. package/lynxtron_bin.js +10 -0
  46. package/native-paths.cjs +38 -0
  47. package/package.json +71 -4
  48. package/utils/download.js +72 -0
  49. package/utils/env-config.js +35 -0
  50. package/web-host/index.js +110 -0
  51. package/web-worker.js +12 -0
@@ -0,0 +1,1848 @@
1
+ // Copyright 2026 The Lynxtron Authors. All rights reserved.
2
+ // Licensed under the Apache License Version 2.0 that can be found in the
3
+ // LICENSE file in the root directory of this source tree.
4
+
5
+ import { NativeImage } from './native-image';
6
+ import { NotificationResponse } from './notification-response';
7
+ import { ProcessMetric } from './process-metric';
8
+ import { JumpListSettings, JumpListCategory } from './jump-list-item';
9
+ import { Task } from './task';
10
+ import { CommandLine } from './command-line';
11
+ import { Menu } from './menu';
12
+ import { Dock } from './dock';
13
+ import { EventEmitter } from 'node:events';
14
+ import { LynxWindow } from './lynx-window';
15
+
16
+ export interface MoveToApplicationsFolderOptions {
17
+ /**
18
+ * A handler for potential conflict in move failure.
19
+ */
20
+ conflictHandler?: (conflictType: 'exists' | 'existsAndRunning') => boolean;
21
+ }
22
+
23
+ export interface ContinueActivityDetails {
24
+ /**
25
+ * A string identifying the URL of the webpage accessed by the activity on another
26
+ * device, if available.
27
+ */
28
+ webpageURL?: string;
29
+ }
30
+
31
+ /**
32
+ * The object returned by `getApplicationInfoForProtocol`.
33
+ */
34
+ export interface ApplicationInfoForProtocolReturnValue {
35
+ /**
36
+ * the display icon of the app handling the protocol.
37
+ */
38
+ icon: NativeImage;
39
+ /**
40
+ * installation path of the app handling the protocol.
41
+ */
42
+ path: string;
43
+ /**
44
+ * display name of the app handling the protocol.
45
+ */
46
+ name: string;
47
+ }
48
+
49
+ export interface FileIconOptions {
50
+ size?: 'small' | 'normal' | 'large';
51
+ }
52
+
53
+ export interface LaunchItems {
54
+ /**
55
+ * name value of a registry entry.
56
+ *
57
+ * @platform win32
58
+ */
59
+ name: string;
60
+ /**
61
+ * The executable to an app that corresponds to a registry entry.
62
+ *
63
+ * @platform win32
64
+ */
65
+ path: string;
66
+ /**
67
+ * the command-line arguments to pass to the executable.
68
+ *
69
+ * @platform win32
70
+ */
71
+ args: string[];
72
+ /**
73
+ * one of `user` or `machine`. Indicates whether the registry entry is under
74
+ * `HKEY_CURRENT USER` or `HKEY_LOCAL_MACHINE`.
75
+ *
76
+ * @platform win32
77
+ */
78
+ scope: string;
79
+ /**
80
+ * `true` if the app registry key is startup approved and therefore shows as
81
+ * `enabled` in Task Manager and Windows settings.
82
+ *
83
+ * @platform win32
84
+ */
85
+ enabled: boolean;
86
+ }
87
+
88
+ export interface LoginItemSettings {
89
+ /**
90
+ * `true` if the app is set to open at login.
91
+ */
92
+ openAtLogin: boolean;
93
+ /**
94
+ * `true` if the app is set to open as hidden at login. This does not work on macOS
95
+ * 13 and up.
96
+ *
97
+ * @deprecated
98
+ * @platform darwin
99
+ */
100
+ openAsHidden: boolean;
101
+ /**
102
+ * `true` if the app was opened at login automatically.
103
+ *
104
+ * @platform darwin
105
+ */
106
+ wasOpenedAtLogin: boolean;
107
+ /**
108
+ * `true` if the app was opened as a hidden login item. This indicates that the app
109
+ * should not open any windows at startup. This setting is not available on MAS
110
+ * builds or on macOS 13 and up.
111
+ *
112
+ * @deprecated
113
+ * @platform darwin
114
+ */
115
+ wasOpenedAsHidden: boolean;
116
+ /**
117
+ * `true` if the app was opened as a login item that should restore the state from
118
+ * the previous session. This indicates that the app should restore the windows
119
+ * that were open the last time the app was closed. This setting is not available
120
+ * on MAS builds or on macOS 13 and up.
121
+ *
122
+ * @deprecated
123
+ * @platform darwin
124
+ */
125
+ restoreState: boolean;
126
+ /**
127
+ * can be one of `not-registered`, `enabled`, `requires-approval`, or `not-found`.
128
+ *
129
+ * @platform darwin
130
+ */
131
+ status: string;
132
+ /**
133
+ * `true` if app is set to open at login and its run key is not deactivated. This
134
+ * differs from `openAtLogin` as it ignores the `args` option, this property will
135
+ * be true if the given executable would be launched at login with **any**
136
+ * arguments.
137
+ *
138
+ * @platform win32
139
+ */
140
+ executableWillLaunchAtLogin: boolean;
141
+ launchItems: LaunchItems[];
142
+ }
143
+
144
+ export interface AboutPanelOptions {
145
+ /**
146
+ * The app's name.
147
+ */
148
+ applicationName?: string;
149
+ /**
150
+ * The app's version.
151
+ */
152
+ applicationVersion?: string;
153
+ /**
154
+ * Copyright information.
155
+ */
156
+ copyright?: string;
157
+ /**
158
+ * The app's build version number.
159
+ *
160
+ * @platform darwin
161
+ */
162
+ version?: string;
163
+ /**
164
+ * Credit information.
165
+ *
166
+ * @platform darwin,win32
167
+ */
168
+ credits?: string;
169
+ /**
170
+ * List of app authors.
171
+ *
172
+ * @platform linux
173
+ */
174
+ authors?: string[];
175
+ /**
176
+ * The app's website.
177
+ *
178
+ * @platform linux
179
+ */
180
+ website?: string;
181
+ /**
182
+ * Path to the app's icon in a JPEG or PNG file format. On Linux, will be shown as
183
+ * 64x64 pixels while retaining aspect ratio. On Windows, a 48x48 PNG will result
184
+ * in the best visual quality.
185
+ *
186
+ * @platform linux,win32
187
+ */
188
+ iconPath?: string;
189
+ }
190
+
191
+ export interface LoginItemSettingsOptions {
192
+ /**
193
+ * Can be one of `mainAppService`, `agentService`, `daemonService`, or
194
+ * `loginItemService`. Defaults to `mainAppService`. Only available on macOS 13 and
195
+ * up. See app.setLoginItemSettings for more information about each type.
196
+ *
197
+ * @platform darwin
198
+ */
199
+ type?: string;
200
+ /**
201
+ * The name of the service. Required if `type` is non-default. Only available on
202
+ * macOS 13 and up.
203
+ *
204
+ * @platform darwin
205
+ */
206
+ serviceName?: string;
207
+ /**
208
+ * The executable path to compare against. Defaults to `process.execPath`.
209
+ *
210
+ * @platform win32
211
+ */
212
+ path?: string;
213
+ /**
214
+ * The command-line arguments to compare against. Defaults to an empty array.
215
+ *
216
+ * @platform win32
217
+ */
218
+ args?: string[];
219
+ }
220
+
221
+ export interface RelaunchOptions {
222
+ args?: string[];
223
+ execPath?: string;
224
+ }
225
+
226
+ export interface Settings {
227
+ /**
228
+ * `true` to open the app at login, `false` to remove the app as a login item.
229
+ * Defaults to `false`.
230
+ */
231
+ openAtLogin?: boolean;
232
+ /**
233
+ * `true` to open the app as hidden. Defaults to `false`. The user can edit this
234
+ * setting from the System Preferences so
235
+ * `app.getLoginItemSettings().wasOpenedAsHidden` should be checked when the app is
236
+ * opened to know the current value. This setting is not available on MAS builds or
237
+ * on macOS 13 and up.
238
+ *
239
+ * @deprecated
240
+ * @platform darwin
241
+ */
242
+ openAsHidden?: boolean;
243
+ /**
244
+ * The type of service to add as a login item. Defaults to `mainAppService`. Only
245
+ * available on macOS 13 and up.
246
+ *
247
+ * @platform darwin
248
+ */
249
+ type?:
250
+ | 'mainAppService'
251
+ | 'agentService'
252
+ | 'daemonService'
253
+ | 'loginItemService';
254
+ /**
255
+ * The name of the service. Required if `type` is non-default. Only available on
256
+ * macOS 13 and up.
257
+ *
258
+ * @platform darwin
259
+ */
260
+ serviceName?: string;
261
+ /**
262
+ * The executable to launch at login. Defaults to `process.execPath`.
263
+ *
264
+ * @platform win32
265
+ */
266
+ path?: string;
267
+ /**
268
+ * The command-line arguments to pass to the executable. Defaults to an empty
269
+ * array. Take care to wrap paths in quotes.
270
+ *
271
+ * @platform win32
272
+ */
273
+ args?: string[];
274
+ /**
275
+ * `true` will change the startup approved registry key and `enable / disable` the
276
+ * App in Task Manager and Windows Settings. Defaults to `true`.
277
+ *
278
+ * @platform win32
279
+ */
280
+ enabled?: boolean;
281
+ /**
282
+ * value name to write into registry. Defaults to the app's AppUserModelId().
283
+ *
284
+ * @platform win32
285
+ */
286
+ name?: string;
287
+ }
288
+
289
+ /**
290
+ * Control your application's event lifecycle.
291
+ * @public
292
+ */
293
+ export interface App extends EventEmitter {
294
+ setVersion(version: string): void;
295
+ setDesktopName(name: string): void;
296
+ setAppPath(path: string | null): void;
297
+ /**
298
+ * Emitted when the application is activated. Various actions can trigger this
299
+ * event, such as launching the application for the first time, attempting to
300
+ * re-launch the application when it's already running, or clicking on the
301
+ * application's dock or taskbar icon.
302
+ *
303
+ * @platform darwin
304
+ */
305
+ on(
306
+ event: 'activate',
307
+ listener: (event: Event, hasVisibleWindows: boolean) => void
308
+ ): this;
309
+ /**
310
+ * @platform darwin
311
+ */
312
+ off(
313
+ event: 'activate',
314
+ listener: (event: Event, hasVisibleWindows: boolean) => void
315
+ ): this;
316
+ /**
317
+ * @platform darwin
318
+ */
319
+ once(
320
+ event: 'activate',
321
+ listener: (event: Event, hasVisibleWindows: boolean) => void
322
+ ): this;
323
+ /**
324
+ * @platform darwin
325
+ */
326
+ addListener(
327
+ event: 'activate',
328
+ listener: (event: Event, hasVisibleWindows: boolean) => void
329
+ ): this;
330
+ /**
331
+ * @platform darwin
332
+ */
333
+ removeListener(
334
+ event: 'activate',
335
+ listener: (event: Event, hasVisibleWindows: boolean) => void
336
+ ): this;
337
+ /**
338
+ * Emitted during Handoff after an activity from this device was successfully
339
+ * resumed on another one.
340
+ *
341
+ * @platform darwin
342
+ */
343
+ on(
344
+ event: 'activity-was-continued',
345
+ listener: (
346
+ event: Event,
347
+ /**
348
+ * A string identifying the activity. Maps to `NSUserActivity.activityType`.
349
+ */
350
+ type: string,
351
+ /**
352
+ * Contains app-specific state stored by the activity.
353
+ */
354
+ userInfo: unknown
355
+ ) => void
356
+ ): this;
357
+ /**
358
+ * @platform darwin
359
+ */
360
+ off(
361
+ event: 'activity-was-continued',
362
+ listener: (
363
+ event: Event,
364
+ /**
365
+ * A string identifying the activity. Maps to `NSUserActivity.activityType`.
366
+ */
367
+ type: string,
368
+ /**
369
+ * Contains app-specific state stored by the activity.
370
+ */
371
+ userInfo: unknown
372
+ ) => void
373
+ ): this;
374
+ /**
375
+ * @platform darwin
376
+ */
377
+ once(
378
+ event: 'activity-was-continued',
379
+ listener: (
380
+ event: Event,
381
+ /**
382
+ * A string identifying the activity. Maps to `NSUserActivity.activityType`.
383
+ */
384
+ type: string,
385
+ /**
386
+ * Contains app-specific state stored by the activity.
387
+ */
388
+ userInfo: unknown
389
+ ) => void
390
+ ): this;
391
+ /**
392
+ * @platform darwin
393
+ */
394
+ addListener(
395
+ event: 'activity-was-continued',
396
+ listener: (
397
+ event: Event,
398
+ /**
399
+ * A string identifying the activity. Maps to `NSUserActivity.activityType`.
400
+ */
401
+ type: string,
402
+ /**
403
+ * Contains app-specific state stored by the activity.
404
+ */
405
+ userInfo: unknown
406
+ ) => void
407
+ ): this;
408
+ /**
409
+ * @platform darwin
410
+ */
411
+ removeListener(
412
+ event: 'activity-was-continued',
413
+ listener: (
414
+ event: Event,
415
+ /**
416
+ * A string identifying the activity. Maps to `NSUserActivity.activityType`.
417
+ */
418
+ type: string,
419
+ /**
420
+ * Contains app-specific state stored by the activity.
421
+ */
422
+ userInfo: unknown
423
+ ) => void
424
+ ): this;
425
+ /**
426
+ * Emitted before the application starts closing its windows. Calling
427
+ * `event.preventDefault()` will prevent the default behavior, which is terminating
428
+ * the application.
429
+ *
430
+ * [!NOTE] On Windows, this event will not be emitted if the app is closed due to
431
+ * a shutdown/restart of the system or a user logout.
432
+ */
433
+ on(event: 'before-quit', listener: (event: Event) => void): this;
434
+ off(event: 'before-quit', listener: (event: Event) => void): this;
435
+ once(event: 'before-quit', listener: (event: Event) => void): this;
436
+ addListener(event: 'before-quit', listener: (event: Event) => void): this;
437
+ removeListener(event: 'before-quit', listener: (event: Event) => void): this;
438
+
439
+ /**
440
+ * Emitted when a LynxWindow gets blurred.
441
+ */
442
+ on(
443
+ event: 'lynx-window-blur',
444
+ listener: (event: Event, window: LynxWindow) => void
445
+ ): this;
446
+ off(
447
+ event: 'lynx-window-blur',
448
+ listener: (event: Event, window: LynxWindow) => void
449
+ ): this;
450
+ once(
451
+ event: 'lynx-window-blur',
452
+ listener: (event: Event, window: LynxWindow) => void
453
+ ): this;
454
+ addListener(
455
+ event: 'lynx-window-blur',
456
+ listener: (event: Event, window: LynxWindow) => void
457
+ ): this;
458
+ removeListener(
459
+ event: 'lynx-window-blur',
460
+ listener: (event: Event, window: LynxWindow) => void
461
+ ): this;
462
+
463
+ /**
464
+ * Emitted when a new LynxWindow is created.
465
+ */
466
+ on(
467
+ event: 'lynx-window-created',
468
+ listener: (event: Event, window: LynxWindow) => void
469
+ ): this;
470
+ off(
471
+ event: 'lynx-window-created',
472
+ listener: (event: Event, window: LynxWindow) => void
473
+ ): this;
474
+ once(
475
+ event: 'lynx-window-created',
476
+ listener: (event: Event, window: LynxWindow) => void
477
+ ): this;
478
+ addListener(
479
+ event: 'lynx-window-created',
480
+ listener: (event: Event, window: LynxWindow) => void
481
+ ): this;
482
+ removeListener(
483
+ event: 'lynx-window-created',
484
+ listener: (event: Event, window: LynxWindow) => void
485
+ ): this;
486
+
487
+ /**
488
+ * Emitted when a LynxWindow gets focused.
489
+ */
490
+ on(
491
+ event: 'lynx-window-focus',
492
+ listener: (event: Event, window: LynxWindow) => void
493
+ ): this;
494
+ off(
495
+ event: 'lynx-window-focus',
496
+ listener: (event: Event, window: LynxWindow) => void
497
+ ): this;
498
+ once(
499
+ event: 'lynx-window-focus',
500
+ listener: (event: Event, window: LynxWindow) => void
501
+ ): this;
502
+ addListener(
503
+ event: 'lynx-window-focus',
504
+ listener: (event: Event, window: LynxWindow) => void
505
+ ): this;
506
+ removeListener(
507
+ event: 'lynx-window-focus',
508
+ listener: (event: Event, window: LynxWindow) => void
509
+ ): this;
510
+
511
+ /**
512
+ * Emitted during Handoff when an activity from a different device wants to be
513
+ * resumed. You should call `event.preventDefault()` if you want to handle this
514
+ * event.
515
+ *
516
+ * A user activity can be continued only in an app that has the same developer Team
517
+ * ID as the activity's source app and that supports the activity's type. Supported
518
+ * activity types are specified in the app's `Info.plist` under the
519
+ * `NSUserActivityTypes` key.
520
+ *
521
+ * @platform darwin
522
+ */
523
+ on(
524
+ event: 'continue-activity',
525
+ listener: (
526
+ event: Event,
527
+ /**
528
+ * A string identifying the activity. Maps to `NSUserActivity.activityType`.
529
+ */
530
+ type: string,
531
+ /**
532
+ * Contains app-specific state stored by the activity on another device.
533
+ */
534
+ userInfo: unknown,
535
+ details: ContinueActivityDetails
536
+ ) => void
537
+ ): this;
538
+ /**
539
+ * @platform darwin
540
+ */
541
+ off(
542
+ event: 'continue-activity',
543
+ listener: (
544
+ event: Event,
545
+ /**
546
+ * A string identifying the activity. Maps to `NSUserActivity.activityType`.
547
+ */
548
+ type: string,
549
+ /**
550
+ * Contains app-specific state stored by the activity on another device.
551
+ */
552
+ userInfo: unknown,
553
+ details: ContinueActivityDetails
554
+ ) => void
555
+ ): this;
556
+ /**
557
+ * @platform darwin
558
+ */
559
+ once(
560
+ event: 'continue-activity',
561
+ listener: (
562
+ event: Event,
563
+ /**
564
+ * A string identifying the activity. Maps to `NSUserActivity.activityType`.
565
+ */
566
+ type: string,
567
+ /**
568
+ * Contains app-specific state stored by the activity on another device.
569
+ */
570
+ userInfo: unknown,
571
+ details: ContinueActivityDetails
572
+ ) => void
573
+ ): this;
574
+ /**
575
+ * @platform darwin
576
+ */
577
+ addListener(
578
+ event: 'continue-activity',
579
+ listener: (
580
+ event: Event,
581
+ /**
582
+ * A string identifying the activity. Maps to `NSUserActivity.activityType`.
583
+ */
584
+ type: string,
585
+ /**
586
+ * Contains app-specific state stored by the activity on another device.
587
+ */
588
+ userInfo: unknown,
589
+ details: ContinueActivityDetails
590
+ ) => void
591
+ ): this;
592
+ /**
593
+ * @platform darwin
594
+ */
595
+ removeListener(
596
+ event: 'continue-activity',
597
+ listener: (
598
+ event: Event,
599
+ /**
600
+ * A string identifying the activity. Maps to `NSUserActivity.activityType`.
601
+ */
602
+ type: string,
603
+ /**
604
+ * Contains app-specific state stored by the activity on another device.
605
+ */
606
+ userInfo: unknown,
607
+ details: ContinueActivityDetails
608
+ ) => void
609
+ ): this;
610
+ /**
611
+ * Emitted during Handoff when an activity from a different device fails to be
612
+ * resumed.
613
+ *
614
+ * @platform darwin
615
+ */
616
+ on(
617
+ event: 'continue-activity-error',
618
+ listener: (
619
+ event: Event,
620
+ /**
621
+ * A string identifying the activity. Maps to `NSUserActivity.activityType`.
622
+ */
623
+ type: string,
624
+ /**
625
+ * A string with the error's localized description.
626
+ */
627
+ error: string
628
+ ) => void
629
+ ): this;
630
+ /**
631
+ * @platform darwin
632
+ */
633
+ off(
634
+ event: 'continue-activity-error',
635
+ listener: (
636
+ event: Event,
637
+ /**
638
+ * A string identifying the activity. Maps to `NSUserActivity.activityType`.
639
+ */
640
+ type: string,
641
+ /**
642
+ * A string with the error's localized description.
643
+ */
644
+ error: string
645
+ ) => void
646
+ ): this;
647
+ /**
648
+ * @platform darwin
649
+ */
650
+ once(
651
+ event: 'continue-activity-error',
652
+ listener: (
653
+ event: Event,
654
+ /**
655
+ * A string identifying the activity. Maps to `NSUserActivity.activityType`.
656
+ */
657
+ type: string,
658
+ /**
659
+ * A string with the error's localized description.
660
+ */
661
+ error: string
662
+ ) => void
663
+ ): this;
664
+ /**
665
+ * @platform darwin
666
+ */
667
+ addListener(
668
+ event: 'continue-activity-error',
669
+ listener: (
670
+ event: Event,
671
+ /**
672
+ * A string identifying the activity. Maps to `NSUserActivity.activityType`.
673
+ */
674
+ type: string,
675
+ /**
676
+ * A string with the error's localized description.
677
+ */
678
+ error: string
679
+ ) => void
680
+ ): this;
681
+ /**
682
+ * @platform darwin
683
+ */
684
+ removeListener(
685
+ event: 'continue-activity-error',
686
+ listener: (
687
+ event: Event,
688
+ /**
689
+ * A string identifying the activity. Maps to `NSUserActivity.activityType`.
690
+ */
691
+ type: string,
692
+ /**
693
+ * A string with the error's localized description.
694
+ */
695
+ error: string
696
+ ) => void
697
+ ): this;
698
+ /**
699
+ * Emitted when the application becomes active. This differs from the `activate`
700
+ * event in that `did-become-active` is emitted every time the app becomes active,
701
+ * not only when Dock icon is clicked or application is re-launched. It is also
702
+ * emitted when a user switches to the app via the macOS App Switcher.
703
+ *
704
+ * @platform darwin
705
+ */
706
+ on(event: 'did-become-active', listener: (event: Event) => void): this;
707
+ /**
708
+ * @platform darwin
709
+ */
710
+ off(event: 'did-become-active', listener: (event: Event) => void): this;
711
+ /**
712
+ * @platform darwin
713
+ */
714
+ once(event: 'did-become-active', listener: (event: Event) => void): this;
715
+ /**
716
+ * @platform darwin
717
+ */
718
+ addListener(
719
+ event: 'did-become-active',
720
+ listener: (event: Event) => void
721
+ ): this;
722
+ /**
723
+ * @platform darwin
724
+ */
725
+ removeListener(
726
+ event: 'did-become-active',
727
+ listener: (event: Event) => void
728
+ ): this;
729
+ /**
730
+ * Emitted when the app is no longer active and doesn’t have focus. This can be
731
+ * triggered, for example, by clicking on another application or by using the macOS
732
+ * App Switcher to switch to another application.
733
+ *
734
+ * @platform darwin
735
+ */
736
+ on(event: 'did-resign-active', listener: (event: Event) => void): this;
737
+ /**
738
+ * @platform darwin
739
+ */
740
+ off(event: 'did-resign-active', listener: (event: Event) => void): this;
741
+ /**
742
+ * @platform darwin
743
+ */
744
+ once(event: 'did-resign-active', listener: (event: Event) => void): this;
745
+ /**
746
+ * @platform darwin
747
+ */
748
+ addListener(
749
+ event: 'did-resign-active',
750
+ listener: (event: Event) => void
751
+ ): this;
752
+ /**
753
+ * @platform darwin
754
+ */
755
+ removeListener(
756
+ event: 'did-resign-active',
757
+ listener: (event: Event) => void
758
+ ): this;
759
+
760
+ /**
761
+ * Emitted when the user clicks the native macOS new tab button. The new tab button
762
+ * is only visible if the current `LynxWindow` has a `tabbingIdentifier`
763
+ *
764
+ * @platform darwin
765
+ */
766
+ on(event: 'new-window-for-tab', listener: (event: Event) => void): this;
767
+ /**
768
+ * @platform darwin
769
+ */
770
+ off(event: 'new-window-for-tab', listener: (event: Event) => void): this;
771
+ /**
772
+ * @platform darwin
773
+ */
774
+ once(event: 'new-window-for-tab', listener: (event: Event) => void): this;
775
+ /**
776
+ * @platform darwin
777
+ */
778
+ addListener(
779
+ event: 'new-window-for-tab',
780
+ listener: (event: Event) => void
781
+ ): this;
782
+ /**
783
+ * @platform darwin
784
+ */
785
+ removeListener(
786
+ event: 'new-window-for-tab',
787
+ listener: (event: Event) => void
788
+ ): this;
789
+ /**
790
+ * Emitted when the user wants to open a file with the application. The `open-file`
791
+ * event is usually emitted when the application is already open and the OS wants
792
+ * to reuse the application to open the file. `open-file` is also emitted when a
793
+ * file is dropped onto the dock and the application is not yet running. Make sure
794
+ * to listen for the `open-file` event very early in your application startup to
795
+ * handle this case (even before the `ready` event is emitted).
796
+ *
797
+ * You should call `event.preventDefault()` if you want to handle this event.
798
+ *
799
+ * On Windows, you have to parse `process.argv` (in the main process) to get the
800
+ * filepath.
801
+ *
802
+ * @platform darwin
803
+ */
804
+ on(event: 'open-file', listener: (event: Event, path: string) => void): this;
805
+ /**
806
+ * @platform darwin
807
+ */
808
+ off(event: 'open-file', listener: (event: Event, path: string) => void): this;
809
+ /**
810
+ * @platform darwin
811
+ */
812
+ once(
813
+ event: 'open-file',
814
+ listener: (event: Event, path: string) => void
815
+ ): this;
816
+ /**
817
+ * @platform darwin
818
+ */
819
+ addListener(
820
+ event: 'open-file',
821
+ listener: (event: Event, path: string) => void
822
+ ): this;
823
+ /**
824
+ * @platform darwin
825
+ */
826
+ removeListener(
827
+ event: 'open-file',
828
+ listener: (event: Event, path: string) => void
829
+ ): this;
830
+ /**
831
+ * Emitted when the user wants to open a URL with the application. Your
832
+ * application's `Info.plist` file must define the URL scheme within the
833
+ * `CFBundleURLTypes` key, and set `NSPrincipalClass` to
834
+ * `LynxtronApplication`.
835
+ *
836
+ * As with the `open-file` event, be sure to register a listener for the `open-url`
837
+ * event early in your application startup to detect if the application is being
838
+ * opened to handle a URL. If you register the listener in response to a `ready`
839
+ * event, you'll miss URLs that trigger the launch of your application.
840
+ *
841
+ * @platform darwin
842
+ */
843
+ on(event: 'open-url', listener: (event: Event, url: string) => void): this;
844
+ /**
845
+ * @platform darwin
846
+ */
847
+ off(event: 'open-url', listener: (event: Event, url: string) => void): this;
848
+ /**
849
+ * @platform darwin
850
+ */
851
+ once(event: 'open-url', listener: (event: Event, url: string) => void): this;
852
+ /**
853
+ * @platform darwin
854
+ */
855
+ addListener(
856
+ event: 'open-url',
857
+ listener: (event: Event, url: string) => void
858
+ ): this;
859
+ /**
860
+ * @platform darwin
861
+ */
862
+ removeListener(
863
+ event: 'open-url',
864
+ listener: (event: Event, url: string) => void
865
+ ): this;
866
+ /**
867
+ * Emitted when the application is quitting.
868
+ *
869
+ * [!NOTE] On Windows, this event will not be emitted if the app is closed due to
870
+ * a shutdown/restart of the system or a user logout.
871
+ */
872
+ on(event: 'quit', listener: (event: Event, exitCode: number) => void): this;
873
+ off(event: 'quit', listener: (event: Event, exitCode: number) => void): this;
874
+ once(event: 'quit', listener: (event: Event, exitCode: number) => void): this;
875
+ addListener(
876
+ event: 'quit',
877
+ listener: (event: Event, exitCode: number) => void
878
+ ): this;
879
+ removeListener(
880
+ event: 'quit',
881
+ listener: (event: Event, exitCode: number) => void
882
+ ): this;
883
+ /**
884
+ * Emitted once, when Lynxtron has finished initializing. On macOS, `launchInfo`
885
+ * holds the `userInfo` of the `NSUserNotification` or information from
886
+ * `UNNotificationResponse` that was used to open the application, if it was
887
+ * launched from Notification Center. You can also call `app.isReady()` to check if
888
+ * this event has already fired and `app.whenReady()` to get a Promise that is
889
+ * fulfilled when Lynxtron is initialized.
890
+ */
891
+ on(
892
+ event: 'ready',
893
+ listener: (
894
+ event: Event,
895
+ /**
896
+ * @platform darwin
897
+ */
898
+ launchInfo: Record<string, any> | NotificationResponse
899
+ ) => void
900
+ ): this;
901
+ off(
902
+ event: 'ready',
903
+ listener: (
904
+ event: Event,
905
+ /**
906
+ * @platform darwin
907
+ */
908
+ launchInfo: Record<string, any> | NotificationResponse
909
+ ) => void
910
+ ): this;
911
+ once(
912
+ event: 'ready',
913
+ listener: (
914
+ event: Event,
915
+ /**
916
+ * @platform darwin
917
+ */
918
+ launchInfo: Record<string, any> | NotificationResponse
919
+ ) => void
920
+ ): this;
921
+ addListener(
922
+ event: 'ready',
923
+ listener: (
924
+ event: Event,
925
+ /**
926
+ * @platform darwin
927
+ */
928
+ launchInfo: Record<string, any> | NotificationResponse
929
+ ) => void
930
+ ): this;
931
+ removeListener(
932
+ event: 'ready',
933
+ listener: (
934
+ event: Event,
935
+ /**
936
+ * @platform darwin
937
+ */
938
+ launchInfo: Record<string, any> | NotificationResponse
939
+ ) => void
940
+ ): this;
941
+
942
+ /**
943
+ * This event will be emitted inside the primary instance of your application when
944
+ * a second instance has been executed and calls `app.requestSingleInstanceLock()`.
945
+ *
946
+ * `argv` is an Array of the second instance's command line arguments, and
947
+ * `workingDirectory` is its current working directory. Usually applications
948
+ * respond to this by making their primary window focused and non-minimized.
949
+ *
950
+ * [!NOTE] `argv` will not be exactly the same list of arguments as those passed
951
+ * to the second instance. The order might change and additional arguments might be
952
+ * appended. If you need to maintain the exact same arguments, it's advised to use
953
+ * `additionalData` instead.
954
+ *
955
+ * [!NOTE] If the second instance is started by a different user than the first,
956
+ * the `argv` array will not include the arguments.
957
+ *
958
+ * This event is guaranteed to be emitted after the `ready` event of `app` gets
959
+ * emitted.
960
+ */
961
+ on(
962
+ event: 'second-instance',
963
+ listener: (
964
+ event: Event,
965
+ /**
966
+ * An array of the second instance's command line arguments
967
+ */
968
+ argv: string[],
969
+ /**
970
+ * The second instance's working directory
971
+ */
972
+ workingDirectory: string,
973
+ /**
974
+ * A JSON object of additional data passed from the second instance
975
+ */
976
+ additionalData: unknown
977
+ ) => void
978
+ ): this;
979
+ off(
980
+ event: 'second-instance',
981
+ listener: (
982
+ event: Event,
983
+ /**
984
+ * An array of the second instance's command line arguments
985
+ */
986
+ argv: string[],
987
+ /**
988
+ * The second instance's working directory
989
+ */
990
+ workingDirectory: string,
991
+ /**
992
+ * A JSON object of additional data passed from the second instance
993
+ */
994
+ additionalData: unknown
995
+ ) => void
996
+ ): this;
997
+ once(
998
+ event: 'second-instance',
999
+ listener: (
1000
+ event: Event,
1001
+ /**
1002
+ * An array of the second instance's command line arguments
1003
+ */
1004
+ argv: string[],
1005
+ /**
1006
+ * The second instance's working directory
1007
+ */
1008
+ workingDirectory: string,
1009
+ /**
1010
+ * A JSON object of additional data passed from the second instance
1011
+ */
1012
+ additionalData: unknown
1013
+ ) => void
1014
+ ): this;
1015
+ addListener(
1016
+ event: 'second-instance',
1017
+ listener: (
1018
+ event: Event,
1019
+ /**
1020
+ * An array of the second instance's command line arguments
1021
+ */
1022
+ argv: string[],
1023
+ /**
1024
+ * The second instance's working directory
1025
+ */
1026
+ workingDirectory: string,
1027
+ /**
1028
+ * A JSON object of additional data passed from the second instance
1029
+ */
1030
+ additionalData: unknown
1031
+ ) => void
1032
+ ): this;
1033
+ removeListener(
1034
+ event: 'second-instance',
1035
+ listener: (
1036
+ event: Event,
1037
+ /**
1038
+ * An array of the second instance's command line arguments
1039
+ */
1040
+ argv: string[],
1041
+ /**
1042
+ * The second instance's working directory
1043
+ */
1044
+ workingDirectory: string,
1045
+ /**
1046
+ * A JSON object of additional data passed from the second instance
1047
+ */
1048
+ additionalData: unknown
1049
+ ) => void
1050
+ ): this;
1051
+
1052
+ /**
1053
+ * Emitted when Handoff is about to be resumed on another device. If you need to
1054
+ * update the state to be transferred, you should call `event.preventDefault()`
1055
+ * immediately, construct a new `userInfo` dictionary and call
1056
+ * `app.updateCurrentActivity()` in a timely manner. Otherwise, the operation will
1057
+ * fail and `continue-activity-error` will be called.
1058
+ *
1059
+ * @platform darwin
1060
+ */
1061
+ on(
1062
+ event: 'update-activity-state',
1063
+ listener: (
1064
+ event: Event,
1065
+ /**
1066
+ * A string identifying the activity. Maps to `NSUserActivity.activityType`.
1067
+ */
1068
+ type: string,
1069
+ /**
1070
+ * Contains app-specific state stored by the activity.
1071
+ */
1072
+ userInfo: unknown
1073
+ ) => void
1074
+ ): this;
1075
+ /**
1076
+ * @platform darwin
1077
+ */
1078
+ off(
1079
+ event: 'update-activity-state',
1080
+ listener: (
1081
+ event: Event,
1082
+ /**
1083
+ * A string identifying the activity. Maps to `NSUserActivity.activityType`.
1084
+ */
1085
+ type: string,
1086
+ /**
1087
+ * Contains app-specific state stored by the activity.
1088
+ */
1089
+ userInfo: unknown
1090
+ ) => void
1091
+ ): this;
1092
+ /**
1093
+ * @platform darwin
1094
+ */
1095
+ once(
1096
+ event: 'update-activity-state',
1097
+ listener: (
1098
+ event: Event,
1099
+ /**
1100
+ * A string identifying the activity. Maps to `NSUserActivity.activityType`.
1101
+ */
1102
+ type: string,
1103
+ /**
1104
+ * Contains app-specific state stored by the activity.
1105
+ */
1106
+ userInfo: unknown
1107
+ ) => void
1108
+ ): this;
1109
+ /**
1110
+ * @platform darwin
1111
+ */
1112
+ addListener(
1113
+ event: 'update-activity-state',
1114
+ listener: (
1115
+ event: Event,
1116
+ /**
1117
+ * A string identifying the activity. Maps to `NSUserActivity.activityType`.
1118
+ */
1119
+ type: string,
1120
+ /**
1121
+ * Contains app-specific state stored by the activity.
1122
+ */
1123
+ userInfo: unknown
1124
+ ) => void
1125
+ ): this;
1126
+ /**
1127
+ * @platform darwin
1128
+ */
1129
+ removeListener(
1130
+ event: 'update-activity-state',
1131
+ listener: (
1132
+ event: Event,
1133
+ /**
1134
+ * A string identifying the activity. Maps to `NSUserActivity.activityType`.
1135
+ */
1136
+ type: string,
1137
+ /**
1138
+ * Contains app-specific state stored by the activity.
1139
+ */
1140
+ userInfo: unknown
1141
+ ) => void
1142
+ ): this;
1143
+
1144
+ /**
1145
+ * Emitted during Handoff before an activity from a different device wants to be
1146
+ * resumed. You should call `event.preventDefault()` if you want to handle this
1147
+ * event.
1148
+ *
1149
+ * @platform darwin
1150
+ */
1151
+ on(
1152
+ event: 'will-continue-activity',
1153
+ listener: (
1154
+ event: Event,
1155
+ /**
1156
+ * A string identifying the activity. Maps to `NSUserActivity.activityType`.
1157
+ */
1158
+ type: string
1159
+ ) => void
1160
+ ): this;
1161
+ /**
1162
+ * @platform darwin
1163
+ */
1164
+ off(
1165
+ event: 'will-continue-activity',
1166
+ listener: (
1167
+ event: Event,
1168
+ /**
1169
+ * A string identifying the activity. Maps to `NSUserActivity.activityType`.
1170
+ */
1171
+ type: string
1172
+ ) => void
1173
+ ): this;
1174
+ /**
1175
+ * @platform darwin
1176
+ */
1177
+ once(
1178
+ event: 'will-continue-activity',
1179
+ listener: (
1180
+ event: Event,
1181
+ /**
1182
+ * A string identifying the activity. Maps to `NSUserActivity.activityType`.
1183
+ */
1184
+ type: string
1185
+ ) => void
1186
+ ): this;
1187
+ /**
1188
+ * @platform darwin
1189
+ */
1190
+ addListener(
1191
+ event: 'will-continue-activity',
1192
+ listener: (
1193
+ event: Event,
1194
+ /**
1195
+ * A string identifying the activity. Maps to `NSUserActivity.activityType`.
1196
+ */
1197
+ type: string
1198
+ ) => void
1199
+ ): this;
1200
+ /**
1201
+ * @platform darwin
1202
+ */
1203
+ removeListener(
1204
+ event: 'will-continue-activity',
1205
+ listener: (
1206
+ event: Event,
1207
+ /**
1208
+ * A string identifying the activity. Maps to `NSUserActivity.activityType`.
1209
+ */
1210
+ type: string
1211
+ ) => void
1212
+ ): this;
1213
+ /**
1214
+ * Emitted when the application has finished basic startup. On Windows,
1215
+ * the `will-finish-launching` event is the same as the `ready` event; on macOS,
1216
+ * this event represents the `applicationWillFinishLaunching` notification of
1217
+ * `NSApplication`.
1218
+ *
1219
+ * In most cases, you should do everything in the `ready` event handler.
1220
+ */
1221
+ on(event: 'will-finish-launching', listener: () => void): this;
1222
+ off(event: 'will-finish-launching', listener: () => void): this;
1223
+ once(event: 'will-finish-launching', listener: () => void): this;
1224
+ addListener(event: 'will-finish-launching', listener: () => void): this;
1225
+ removeListener(event: 'will-finish-launching', listener: () => void): this;
1226
+ /**
1227
+ * Emitted when all windows have been closed and the application will quit. Calling
1228
+ * `event.preventDefault()` will prevent the default behavior, which is terminating
1229
+ * the application.
1230
+ *
1231
+ * See the description of the `window-all-closed` event for the differences between
1232
+ * the `will-quit` and `window-all-closed` events.
1233
+ *
1234
+ * [!NOTE] On Windows, this event will not be emitted if the app is closed due to
1235
+ * a shutdown/restart of the system or a user logout.
1236
+ */
1237
+ on(event: 'will-quit', listener: (event: Event) => void): this;
1238
+ off(event: 'will-quit', listener: (event: Event) => void): this;
1239
+ once(event: 'will-quit', listener: (event: Event) => void): this;
1240
+ addListener(event: 'will-quit', listener: (event: Event) => void): this;
1241
+ removeListener(event: 'will-quit', listener: (event: Event) => void): this;
1242
+ /**
1243
+ * Emitted when all windows have been closed.
1244
+ *
1245
+ * If you do not subscribe to this event and all windows are closed, the default
1246
+ * behavior is to quit the app; however, if you subscribe, you control whether the
1247
+ * app quits or not. If the user pressed `Cmd + Q`, or the developer called
1248
+ * `app.quit()`, Lynxtron will first try to close all the windows and then emit the
1249
+ * `will-quit` event, and in this case the `window-all-closed` event would not be
1250
+ * emitted.
1251
+ */
1252
+ on(event: 'window-all-closed', listener: () => void): this;
1253
+ off(event: 'window-all-closed', listener: () => void): this;
1254
+ once(event: 'window-all-closed', listener: () => void): this;
1255
+ addListener(event: 'window-all-closed', listener: () => void): this;
1256
+ removeListener(event: 'window-all-closed', listener: () => void): this;
1257
+ /**
1258
+ * Adds `path` to the recent documents list.
1259
+ *
1260
+ * This list is managed by the OS. On Windows, you can visit the list from the task
1261
+ * bar, and on macOS, you can visit it from dock menu.
1262
+ *
1263
+ * @platform darwin,win32
1264
+ */
1265
+ addRecentDocument(path: string): void;
1266
+ /**
1267
+ * Clears the recent documents list.
1268
+ *
1269
+ * @platform darwin,win32
1270
+ */
1271
+ clearRecentDocuments(): void;
1272
+ /**
1273
+ * Exits immediately with `exitCode`. `exitCode` defaults to 0.
1274
+ *
1275
+ * All windows will be closed immediately without asking the user, and the
1276
+ * `before-quit` and `will-quit` events will not be emitted.
1277
+ */
1278
+ exit(exitCode?: number): void;
1279
+ /**
1280
+ * On Linux, focuses on the first visible window. On macOS, makes the application
1281
+ * the active app. On Windows, focuses on the application's first window.
1282
+ *
1283
+ * You should seek to use the `steal` option as sparingly as possible.
1284
+ */
1285
+ focus(options?: FocusOptions): void;
1286
+ /**
1287
+ * Resolve with an object containing the following:
1288
+ *
1289
+ * * `icon` NativeImage - the display icon of the app handling the protocol.
1290
+ * * `path` string - installation path of the app handling the protocol.
1291
+ * * `name` string - display name of the app handling the protocol.
1292
+ *
1293
+ * This method returns a promise that contains the application name, icon and path
1294
+ * of the default handler for the protocol (aka URI scheme) of a URL.
1295
+ *
1296
+ * @platform darwin,win32
1297
+ */
1298
+ getApplicationInfoForProtocol(
1299
+ url: string
1300
+ ): Promise<ApplicationInfoForProtocolReturnValue>;
1301
+ /**
1302
+ * Name of the application handling the protocol, or an empty string if there is no
1303
+ * handler. For instance, if Lynxtron is the default handler of the URL, this could
1304
+ * be `Lynxtron` on Windows and Mac. However, don't rely on the precise format
1305
+ * which is not guaranteed to remain unchanged. Expect a different format on Linux,
1306
+ * possibly with a `.desktop` suffix.
1307
+ *
1308
+ * This method returns the application name of the default handler for the protocol
1309
+ * (aka URI scheme) of a URL.
1310
+ */
1311
+ getApplicationNameForProtocol(url: string): string;
1312
+ /**
1313
+ * Array of `ProcessMetric` objects that correspond to memory and CPU usage
1314
+ * statistics of all the processes associated with the app.
1315
+ */
1316
+ getAppMetrics(): ProcessMetric;
1317
+ /**
1318
+ * The current application directory.
1319
+ */
1320
+ getAppPath(): string;
1321
+ /**
1322
+ * The current value displayed in the counter badge.
1323
+ *
1324
+ * @platform linux,darwin
1325
+ */
1326
+ getBadgeCount(): number;
1327
+ /**
1328
+ * The type of the currently running activity.
1329
+ *
1330
+ * @platform darwin
1331
+ */
1332
+ getCurrentActivityType(): string;
1333
+ /**
1334
+ * * `minItems` Integer - The minimum number of items that will be shown in the
1335
+ * Jump List (for a more detailed description of this value see the MSDN docs).
1336
+ * * `removedItems` JumpListItem[] - Array of `JumpListItem` objects that
1337
+ * correspond to items that the user has explicitly removed from custom categories
1338
+ * in the Jump List. These items must not be re-added to the Jump List in the
1339
+ * **next** call to `app.setJumpList()`, Windows will not display any custom
1340
+ * category that contains any of the removed items.
1341
+ *
1342
+ * @platform win32
1343
+ */
1344
+ getJumpListSettings(): JumpListSettings;
1345
+ /**
1346
+ * The current application locale, fetched using Chromium's `l10n_util` library.
1347
+ * Possible return values are documented here.
1348
+ *
1349
+ * To set the locale, you'll want to use a command line switch at app startup,
1350
+ * which may be found here.
1351
+ *
1352
+ * > [!NOTE] When distributing your packaged app, you have to also ship the
1353
+ * `locales` folder.
1354
+ *
1355
+ * > [!NOTE] This API must be called after the `ready` event is emitted.
1356
+ *
1357
+ * > [!NOTE] To see example return values of this API compared to other locale and
1358
+ * language APIs, see `app.getPreferredSystemLanguages()`.
1359
+ */
1360
+ getLocale(): string;
1361
+ /**
1362
+ * User operating system's locale two-letter ISO 3166 country code. The value is
1363
+ * taken from native OS APIs.
1364
+ *
1365
+ * > [!NOTE] When unable to detect locale country code, it returns empty string.
1366
+ */
1367
+ getLocaleCountryCode(): string;
1368
+ /**
1369
+ * If you provided `path` and `args` options to `app.setLoginItemSettings`, then
1370
+ * you need to pass the same arguments here for `openAtLogin` to be set correctly.
1371
+ *
1372
+ *
1373
+ * * `openAtLogin` boolean - `true` if the app is set to open at login.
1374
+ * * `openAsHidden` boolean _macOS_ _Deprecated_ - `true` if the app is set to open
1375
+ * as hidden at login. This does not work on macOS 13 and up.
1376
+ * * `wasOpenedAtLogin` boolean _macOS_ - `true` if the app was opened at login
1377
+ * automatically.
1378
+ * * `wasOpenedAsHidden` boolean _macOS_ _Deprecated_ - `true` if the app was
1379
+ * opened as a hidden login item. This indicates that the app should not open any
1380
+ * windows at startup. This setting is not available on MAS builds or on macOS 13
1381
+ * and up.
1382
+ * * `restoreState` boolean _macOS_ _Deprecated_ - `true` if the app was opened as
1383
+ * a login item that should restore the state from the previous session. This
1384
+ * indicates that the app should restore the windows that were open the last time
1385
+ * the app was closed. This setting is not available on MAS builds or on macOS 13
1386
+ * and up.
1387
+ * * `status` string _macOS_ - can be one of `not-registered`, `enabled`,
1388
+ * `requires-approval`, or `not-found`.
1389
+ * * `executableWillLaunchAtLogin` boolean _Windows_ - `true` if app is set to open
1390
+ * at login and its run key is not deactivated. This differs from `openAtLogin` as
1391
+ * it ignores the `args` option, this property will be true if the given executable
1392
+ * would be launched at login with **any** arguments.
1393
+ * * `launchItems` Object[] _Windows_
1394
+ * * `name` string _Windows_ - name value of a registry entry.
1395
+ * * `path` string _Windows_ - The executable to an app that corresponds to a
1396
+ * registry entry.
1397
+ * * `args` string[] _Windows_ - the command-line arguments to pass to the
1398
+ * executable.
1399
+ * * `scope` string _Windows_ - one of `user` or `machine`. Indicates whether the
1400
+ * registry entry is under `HKEY_CURRENT USER` or `HKEY_LOCAL_MACHINE`.
1401
+ * * `enabled` boolean _Windows_ - `true` if the app registry key is startup
1402
+ * approved and therefore shows as `enabled` in Task Manager and Windows settings.
1403
+ *
1404
+ * @platform darwin,win32
1405
+ */
1406
+ getLoginItemSettings(options?: LoginItemSettingsOptions): LoginItemSettings;
1407
+ /**
1408
+ * The current application's name, which is the name in the application's
1409
+ * `package.json` file.
1410
+ *
1411
+ * Usually the `name` field of `package.json` is a short lowercase name, according
1412
+ * to the npm modules spec. You should usually also specify a `productName` field,
1413
+ * which is your application's full capitalized name, and which will be preferred
1414
+ * over `name` by Lynxtron.
1415
+ */
1416
+ getName(): string;
1417
+ /**
1418
+ * A path to a special directory or file associated with `name`. On failure, an
1419
+ * `Error` is thrown.
1420
+ *
1421
+ * If `app.getPath('logs')` is called without called `app.setAppLogsPath()` being
1422
+ * called first, a default log directory will be created equivalent to calling
1423
+ * `app.setAppLogsPath()` without a `path` parameter.
1424
+ */
1425
+ getPath(
1426
+ name:
1427
+ | 'home'
1428
+ | 'appData'
1429
+ | 'assets'
1430
+ | 'userData'
1431
+ | 'temp'
1432
+ | 'exe'
1433
+ | 'module'
1434
+ | 'desktop'
1435
+ | 'documents'
1436
+ | 'downloads'
1437
+ | 'music'
1438
+ | 'pictures'
1439
+ | 'videos'
1440
+ | 'recent'
1441
+ | 'logs'
1442
+ | 'crashDumps'
1443
+ ): string;
1444
+ getFileIcon(path: string, options?: FileIconOptions): Promise<NativeImage>;
1445
+ /**
1446
+ * An array containing documents in the most recent documents list.
1447
+ *
1448
+ * @platform darwin,win32
1449
+ */
1450
+ getRecentDocuments(): string[];
1451
+ /**
1452
+ * The version of the loaded application. If no version is found in the
1453
+ * application's `package.json` file, the version of the current bundle or
1454
+ * executable is returned.
1455
+ */
1456
+ getVersion(): string;
1457
+
1458
+ /**
1459
+ * The device model of the current device.
1460
+ */
1461
+ getDeviceModel(): string;
1462
+ /**
1463
+ * This method returns whether or not this instance of your app is currently
1464
+ * holding the single instance lock. You can request the lock with
1465
+ * `app.requestSingleInstanceLock()` and release with
1466
+ * `app.releaseSingleInstanceLock()`
1467
+ */
1468
+ hasSingleInstanceLock(): boolean;
1469
+ /**
1470
+ * Hides all application windows without minimizing them.
1471
+ *
1472
+ * @platform darwin
1473
+ */
1474
+ hide(): void;
1475
+ /**
1476
+ * Whether the current executable is the default handler for a protocol (aka URI
1477
+ * scheme).
1478
+ *
1479
+ * > [!NOTE] On macOS, you can use this method to check if the app has been
1480
+ * registered as the default protocol handler for a protocol. You can also verify
1481
+ * this by checking `~/Library/Preferences/com.apple.LaunchServices.plist` on the
1482
+ * macOS machine. Please refer to Apple's documentation for details.
1483
+ *
1484
+ * The API uses the Windows Registry and `LSCopyDefaultHandlerForURLScheme`
1485
+ * internally.
1486
+ */
1487
+ isDefaultProtocolClient(
1488
+ protocol: string,
1489
+ path?: string,
1490
+ args?: string[]
1491
+ ): boolean;
1492
+ /**
1493
+ * whether or not the current OS version allows for native emoji pickers.
1494
+ */
1495
+ isEmojiPanelSupported(): boolean;
1496
+ /**
1497
+ * `true` if the application—including all of its windows—is hidden (e.g. with
1498
+ * `Command-H`), `false` otherwise.
1499
+ *
1500
+ * @platform darwin
1501
+ */
1502
+ isHidden(): boolean;
1503
+ /**
1504
+ * Whether the application is currently running from the systems Application
1505
+ * folder. Use in combination with `app.moveToApplicationsFolder()`
1506
+ *
1507
+ * @platform darwin
1508
+ */
1509
+ isInApplicationsFolder(): boolean;
1510
+ /**
1511
+ * `true` if Lynxtron has finished initializing, `false` otherwise. See also
1512
+ * `app.whenReady()`.
1513
+ */
1514
+ isReady(): boolean;
1515
+ /**
1516
+ * Try to close all windows. The `before-quit` event will be emitted first. If all
1517
+ * windows are successfully closed, the `will-quit` event will be emitted and by
1518
+ * default the application will terminate.
1519
+ *
1520
+ * A window may still cancel the quit during its close flow.
1521
+ */
1522
+ quit(): void;
1523
+ /**
1524
+ * Relaunches the app when the current instance exits.
1525
+ *
1526
+ * By default, the new instance will use the same working directory and command
1527
+ * line arguments as the current instance. When `args` is specified, the `args`
1528
+ * will be passed as the command line arguments instead. When `execPath` is
1529
+ * specified, the `execPath` will be executed for the relaunch instead of the
1530
+ * current app.
1531
+ *
1532
+ * Note that this method does not quit the app when executed. You have to call
1533
+ * `app.quit` or `app.exit` after calling `app.relaunch` to make the app restart.
1534
+ *
1535
+ * When `app.relaunch` is called multiple times, multiple instances will be started
1536
+ * after the current instance exits.
1537
+ *
1538
+ * An example of restarting the current instance immediately and adding a new
1539
+ * command line argument to the new instance:
1540
+ */
1541
+ relaunch(options?: RelaunchOptions): void;
1542
+ /**
1543
+ * Releases all locks that were created by `requestSingleInstanceLock`. This will
1544
+ * allow multiple instances of the application to once again run side by side.
1545
+ */
1546
+ releaseSingleInstanceLock(): void;
1547
+ /**
1548
+ * Whether the call succeeded.
1549
+ *
1550
+ * This method checks if the current executable as the default handler for a
1551
+ * protocol (aka URI scheme). If so, it will remove the app as the default handler.
1552
+ *
1553
+ * @platform darwin,win32
1554
+ */
1555
+ removeAsDefaultProtocolClient(
1556
+ protocol: string,
1557
+ path?: string,
1558
+ args?: string[]
1559
+ ): boolean;
1560
+ /**
1561
+ * The return value of this method indicates whether or not this instance of your
1562
+ * application successfully obtained the lock. If it failed to obtain the lock,
1563
+ * you can assume that another instance of your application is already running with
1564
+ * the lock and exit immediately.
1565
+ *
1566
+ * I.e. This method returns `true` if your process is the primary instance of your
1567
+ * application and your app should continue loading. It returns `false` if your
1568
+ * process should immediately quit as it has sent its parameters to another
1569
+ * instance that has already acquired the lock.
1570
+ *
1571
+ * On macOS, the system enforces single instance automatically when users try to
1572
+ * open a second instance of your app in Finder, and the `open-file` and `open-url`
1573
+ * events will be emitted for that. However when users start your app in command
1574
+ * line, the system's single instance mechanism will be bypassed, and you have to
1575
+ * use this method to ensure single instance.
1576
+ *
1577
+ * An example of activating the window of primary instance when a second instance
1578
+ * starts:
1579
+ */
1580
+ requestSingleInstanceLock(additionalData?: Record<any, any>): boolean;
1581
+ /**
1582
+ * Set the about panel options. This will override the values defined in the app's
1583
+ * `.plist` file on macOS. See the Apple docs for more details. On Linux, values
1584
+ * must be set in order to be shown; there are no defaults.
1585
+ *
1586
+ * If you do not set `credits` but still wish to surface them in your app, AppKit
1587
+ * will look for a file named "Credits.html", "Credits.rtf", and "Credits.rtfd", in
1588
+ * that order, in the bundle returned by the NSBundle class method main. The first
1589
+ * file found is used, and if none is found, the info area is left blank. See Apple
1590
+ * documentation for more information.
1591
+ */
1592
+ setAboutPanelOptions(options: AboutPanelOptions): void;
1593
+ /**
1594
+ * Sets the activation policy for a given app.
1595
+ *
1596
+ * Activation policy types:
1597
+ *
1598
+ * * 'regular' - The application is an ordinary app that appears in the Dock and
1599
+ * may have a user interface.
1600
+ * * 'accessory' - The application doesn’t appear in the Dock and doesn’t have a
1601
+ * menu bar, but it may be activated programmatically or by clicking on one of its
1602
+ * windows.
1603
+ * * 'prohibited' - The application doesn’t appear in the Dock and may not create
1604
+ * windows or be activated.
1605
+ *
1606
+ * @platform darwin
1607
+ */
1608
+ setActivationPolicy(policy: 'regular' | 'accessory' | 'prohibited'): void;
1609
+ /**
1610
+ * Sets or creates a directory your app's logs which can then be manipulated with
1611
+ * `app.getPath()` or `app.setPath(pathName, newPath)`.
1612
+ *
1613
+ * Calling `app.setAppLogsPath()` without a `path` parameter will result in this
1614
+ * directory being set to `~/Library/Logs/YourAppName` on _macOS_, and inside the
1615
+ * `userData` directory on _Linux_ and _Windows_.
1616
+ */
1617
+ setAppLogsPath(path?: string): void;
1618
+ /**
1619
+ * Changes the Application User Model ID to `id`.
1620
+ *
1621
+ * @platform win32
1622
+ */
1623
+ setAppUserModelId(id: string): void;
1624
+ /**
1625
+ * Whether the call succeeded.
1626
+ *
1627
+ * Sets the current executable as the default handler for a protocol (aka URI
1628
+ * scheme). It allows you to integrate your app deeper into the operating system.
1629
+ * Once registered, all links with `your-protocol://` will be opened with the
1630
+ * current executable. The whole link, including protocol, will be passed to your
1631
+ * application as a parameter.
1632
+ *
1633
+ * > [!NOTE] On macOS, you can only register protocols that have been added to your
1634
+ * app's `info.plist`, which cannot be modified at runtime. However, you can change
1635
+ * the file during build time via Lynxtron Forge, Lynxtron Packager, or by editing
1636
+ * `info.plist` with a text editor. Please refer to Apple's documentation for
1637
+ * details.
1638
+ *
1639
+ * > [!NOTE] In a Windows Store environment (when packaged as an `appx`) this API
1640
+ * will return `true` for all calls but the registry key it sets won't be
1641
+ * accessible by other applications. In order to register your Windows Store
1642
+ * application as a default protocol handler you must declare the protocol in your
1643
+ * manifest.
1644
+ *
1645
+ * The API uses the Windows Registry and `LSSetDefaultHandlerForURLScheme`
1646
+ * internally.
1647
+ */
1648
+ setAsDefaultProtocolClient(
1649
+ protocol: string,
1650
+ path?: string,
1651
+ args?: string[]
1652
+ ): boolean;
1653
+ /**
1654
+ * Sets or removes a custom Jump List for the application, and returns one of the
1655
+ * following strings:
1656
+ *
1657
+ * * `ok` - Nothing went wrong.
1658
+ * * `error` - One or more errors occurred, enable runtime logging to figure out
1659
+ * the likely cause.
1660
+ * * `invalidSeparatorError` - An attempt was made to add a separator to a custom
1661
+ * category in the Jump List. Separators are only allowed in the standard `Tasks`
1662
+ * category.
1663
+ * * `fileTypeRegistrationError` - An attempt was made to add a file link to the
1664
+ * Jump List for a file type the app isn't registered to handle.
1665
+ * * `customCategoryAccessDeniedError` - Custom categories can't be added to the
1666
+ * Jump List due to user privacy or group policy settings.
1667
+ *
1668
+ * If `categories` is `null` the previously set custom Jump List (if any) will be
1669
+ * replaced by the standard Jump List for the app (managed by Windows).
1670
+ *
1671
+ * [!NOTE] If a `JumpListCategory` object has neither the `type` nor the `name`
1672
+ * property set then its `type` is assumed to be `tasks`. If the `name` property is
1673
+ * set but the `type` property is omitted then the `type` is assumed to be
1674
+ * `custom`.
1675
+ *
1676
+ * [!NOTE] Users can remove items from custom categories, and Windows will not
1677
+ * allow a removed item to be added back into a custom category until **after** the
1678
+ * next successful call to `app.setJumpList(categories)`. Any attempt to re-add a
1679
+ * removed item to a custom category earlier than that will result in the entire
1680
+ * custom category being omitted from the Jump List. The list of removed items can
1681
+ * be obtained using `app.getJumpListSettings()`.
1682
+ *
1683
+ * [!NOTE] The maximum length of a Jump List item's `description` property is 260
1684
+ * characters. Beyond this limit, the item will not be added to the Jump List, nor
1685
+ * will it be displayed.
1686
+ *
1687
+ * Here's a very simple example of creating a custom Jump List:
1688
+ *
1689
+ * @platform win32
1690
+ */
1691
+ setJumpList(
1692
+ categories: JumpListCategory[] | null
1693
+ ):
1694
+ | 'ok'
1695
+ | 'error'
1696
+ | 'invalidSeparatorError'
1697
+ | 'fileTypeRegistrationError'
1698
+ | 'customCategoryAccessDeniedError';
1699
+ /**
1700
+ * Set the app's login item settings.
1701
+ *
1702
+ * To work with Lynxtron's `autoUpdater` on Windows, which uses Squirrel, you'll
1703
+ * want to set the launch path to your executable's name but a directory up, which
1704
+ * is a stub application automatically generated by Squirrel which will
1705
+ * automatically launch the latest version.
1706
+ *
1707
+ * For more information about setting different services as login items on macOS 13
1708
+ * and up, see `SMAppService`.
1709
+ *
1710
+ * @platform darwin,win32
1711
+ */
1712
+ setLoginItemSettings(settings: Settings): void;
1713
+ /**
1714
+ * Overrides the current application's name.
1715
+ *
1716
+ * > [!NOTE] This function overrides the name used internally by Lynxtron; it does
1717
+ * not affect the name that the OS uses.
1718
+ */
1719
+ setName(name: string): void;
1720
+ /**
1721
+ * Overrides the `path` to a special directory or file associated with `name`. If
1722
+ * the path specifies a directory that does not exist, an `Error` is thrown. In
1723
+ * that case, the directory should be created with `fs.mkdirSync` or similar.
1724
+ *
1725
+ * You can only override paths of a `name` defined in `app.getPath`. Override the
1726
+ * path before the `ready` event if the runtime should use the custom location
1727
+ * during startup.
1728
+ */
1729
+ setPath(name: string, path: string): void;
1730
+ /**
1731
+ * Creates an `NSUserActivity` and sets it as the current activity. The activity is
1732
+ * eligible for Handoff to another device afterward.
1733
+ *
1734
+ * @platform darwin
1735
+ */
1736
+ setUserActivity(type: string, userInfo: any, webpageURL?: string): void;
1737
+ /**
1738
+ * Adds `tasks` to the Tasks category of the Jump List on Windows.
1739
+ *
1740
+ * `tasks` is an array of `Task` objects.
1741
+ *
1742
+ * Whether the call succeeded.
1743
+ *
1744
+ * > [!NOTE] If you'd like to customize the Jump List even more use
1745
+ * `app.setJumpList(categories)` instead.
1746
+ *
1747
+ * @platform win32
1748
+ */
1749
+ setUserTasks(tasks: Task[]): boolean;
1750
+ /**
1751
+ * Shows application windows after they were hidden. Does not automatically focus
1752
+ * them.
1753
+ *
1754
+ * @platform darwin
1755
+ */
1756
+ show(): void;
1757
+ /**
1758
+ * Show the app's about panel options. These options can be overridden with
1759
+ * `app.setAboutPanelOptions(options)`. This function runs asynchronously.
1760
+ */
1761
+ showAboutPanel(): void;
1762
+ /**
1763
+ * This function **must** be called once you have finished accessing the security
1764
+ * scoped file. If you do not remember to stop accessing the bookmark, kernel
1765
+ * resources will be leaked and your app will lose its ability to reach outside the
1766
+ * sandbox completely, until your app is restarted.
1767
+ *
1768
+ * Start accessing a security scoped resource. With this method Lynxtron
1769
+ * applications that are packaged for the Mac App Store may reach outside their
1770
+ * sandbox to access files chosen by the user. See Apple's documentation for a
1771
+ * description of how this system works.
1772
+ *
1773
+ * @platform mas
1774
+ */
1775
+ startAccessingSecurityScopedResource(bookmarkData: string): Function;
1776
+ /**
1777
+ * fulfilled when Lynxtron is initialized. May be used as a convenient alternative
1778
+ * to checking `app.isReady()` and subscribing to the `ready` event if the app is
1779
+ * not ready yet.
1780
+ */
1781
+ whenReady(): Promise<void>;
1782
+ /**
1783
+ * A `Menu | null` property that returns `Menu` if one has been set and `null`
1784
+ * otherwise. Users can pass a Menu to set this property.
1785
+ */
1786
+ applicationMenu: Menu | null;
1787
+ /**
1788
+ * An `Integer` property that returns the badge count for current app. Setting the
1789
+ * count to `0` will hide the badge.
1790
+ *
1791
+ * On macOS, setting this with any nonzero integer shows on the dock icon. On
1792
+ * Linux, this property only works for Unity launcher.
1793
+ *
1794
+ * > [!NOTE] Unity launcher requires a `.desktop` file to work. For more
1795
+ * information, please read the Unity integration documentation.
1796
+ *
1797
+ * > [!NOTE] On macOS, you need to ensure that your application has the permission
1798
+ * to display notifications for this property to take effect.
1799
+ *
1800
+ * @platform linux,darwin
1801
+ */
1802
+ badgeCount: number;
1803
+ /**
1804
+ * A `CommandLine` object that allows you to read and manipulate the command line
1805
+ * arguments.
1806
+ *
1807
+ */
1808
+ readonly commandLine: CommandLine;
1809
+ /**
1810
+ * A `Dock | undefined` property (`Dock` on macOS, `undefined` on all other
1811
+ * platforms) that allows you to perform actions on your app icon in the user's
1812
+ * dock.
1813
+ *
1814
+ * @platform darwin
1815
+ */
1816
+ readonly dock: Dock | undefined;
1817
+ /**
1818
+ * A `boolean` property that returns `true` if the app is packaged, `false`
1819
+ * otherwise. For many apps, this property can be used to distinguish development
1820
+ * and production environments.
1821
+ *
1822
+ */
1823
+ readonly isPackaged: boolean;
1824
+ /**
1825
+ * A `string` property that indicates the current application's name, which is the
1826
+ * name in the application's `package.json` file.
1827
+ *
1828
+ * Usually the `name` field of `package.json` is a short lowercase name, according
1829
+ * to the npm modules spec. You should usually also specify a `productName` field,
1830
+ * which is your application's full capitalized name, and which will be preferred
1831
+ * over `name` by Lynxtron.
1832
+ */
1833
+ name: string;
1834
+ /**
1835
+ * A `boolean` which when `true` indicates that the app is currently running under
1836
+ * an ARM64 translator (like the macOS Rosetta Translator Environment or Windows
1837
+ * WOW).
1838
+ *
1839
+ * You can use this property to prompt users to download the arm64 version of your
1840
+ * application when they are mistakenly running the x64 version under Rosetta or
1841
+ * WOW.
1842
+ *
1843
+ * @platform darwin,win32
1844
+ */
1845
+ readonly runningUnderARM64Translation: boolean;
1846
+ }
1847
+
1848
+ export declare const app: App;