-
Notifications
You must be signed in to change notification settings - Fork 3
/
ElectronAPI.fs
13714 lines (12574 loc) · 738 KB
/
ElectronAPI.fs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
(*
This module contains the interface to the Electron API. It is autogenerated from the published electron
typescript definitions converted by ts2fable. However, these do not exactly work, some changes are needed
*)
// ts2fable 0.8.0
module rec ElectronAPI
#nowarn "3390" // disable warnings for invalid XML comments
#nowarn "0044" // disable warnings for `Obsolete` usage
open System
open Fable.Core
open Fable.Core.JS
open Browser.Types
/// bool Option -> bool, with None -> false
let jsToBool (b : bool option) =
Option.defaultValue false b
type NodeEventEmitter = Node.Events.EventEmitter
type [<AllowNullLiteral>] MessagePort =
interface end
type [<AllowNullLiteral>] HTMLElementEventMap =
interface end
type [<AllowNullLiteral>] EventListenerOrEventListenerObject =
interface end
[<Erase>] type KeyOf<'T> = Key of string
type Array<'T> = System.Collections.Generic.IList<'T>
type Function = System.Action
type Record<'T,'S> = 'T * 'S
type String = string
type [<AllowNullLiteral>] GlobalEvent =
interface end
[<AutoOpen>]
module Electron =
let [<ImportAll("electron")>] common: Common.IExports = jsNative
let electron = common
let [<ImportAll("electron")>] main: Electron.IExports = jsNative
let mainProcess = main
[<ImportAll("electron")>]
let renderer: Renderer.IExports = jsNative
type Remote =
inherit RemoteMainInterface
/// Returns the object returned by require(module) in the main process.
/// Modules specified by their relative path will resolve relative to the
/// entrypoint of the main process.
abstract require: ``module``: string -> obj option
/// Returns the window to which this web page belongs.
///
/// Note: Do not use removeAllListeners on BrowserWindow. Use of this can
/// remove all blur listeners, disable click events on touch bar buttons, and
/// other unintended consequences.
abstract getCurrentWindow: unit -> BrowserWindow
/// Returns the web contents of this web page.
abstract getCurrentWebContents: unit -> WebContents
/// Returns the global variable of name (e.g. global[name]) in the main
/// process.
abstract getGlobal: name: string -> obj option
/// The `process` object in the main process. This is the same as
/// remote.getGlobal('process') but is cached.
abstract ``process``: NodeJS.Process
type [<AllowNullLiteral>] IExports =
abstract NodeEventEmitter: obj
abstract Accelerator: AcceleratorStatic
abstract BrowserView: BrowserViewStatic
abstract BrowserWindow: BrowserWindowStatic
abstract BrowserWindowProxy: BrowserWindowProxyStatic
abstract ClientRequest: ClientRequestStatic
abstract CommandLine: CommandLineStatic
abstract Cookies: CookiesStatic
abstract Debugger: DebuggerStatic
abstract Dock: DockStatic
abstract DownloadItem: DownloadItemStatic
abstract IncomingMessage: IncomingMessageStatic
abstract Menu: MenuStatic
abstract MenuItem: MenuItemStatic
abstract MessageChannelMain: MessageChannelMainStatic
abstract MessagePortMain: MessagePortMainStatic
abstract NativeImage: NativeImageStatic
abstract Notification: NotificationStatic
abstract ServiceWorkers: ServiceWorkersStatic
abstract Session: SessionStatic
abstract ShareMenu: ShareMenuStatic
abstract TouchBar: TouchBarStatic
abstract TouchBarButton: TouchBarButtonStatic
abstract TouchBarColorPicker: TouchBarColorPickerStatic
abstract TouchBarGroup: TouchBarGroupStatic
abstract TouchBarLabel: TouchBarLabelStatic
abstract TouchBarOtherItemsProxy: TouchBarOtherItemsProxyStatic
abstract TouchBarPopover: TouchBarPopoverStatic
abstract TouchBarScrubber: TouchBarScrubberStatic
abstract TouchBarSegmentedControl: TouchBarSegmentedControlStatic
abstract TouchBarSlider: TouchBarSliderStatic
abstract TouchBarSpacer: TouchBarSpacerStatic
abstract Tray: TrayStatic
abstract WebContents: WebContentsStatic
abstract WebFrameMain: WebFrameMainStatic
abstract WebRequest: WebRequestStatic
abstract app: App
abstract autoUpdater: AutoUpdater
abstract clipboard: Clipboard
abstract contentTracing: ContentTracing
abstract contextBridge: ContextBridge
abstract crashReporter: CrashReporter
abstract desktopCapturer: DesktopCapturer
abstract dialog: Dialog
abstract globalShortcut: GlobalShortcut
abstract inAppPurchase: InAppPurchase
abstract ipcMain: IpcMain
abstract ipcRenderer: IpcRenderer
abstract nativeImage: obj
abstract nativeTheme: NativeTheme
abstract net: Net
abstract netLog: NetLog
abstract powerMonitor: PowerMonitor
abstract powerSaveBlocker: PowerSaveBlocker
abstract protocol: Protocol
abstract screen: Screen
abstract session: obj
abstract shell: Shell
abstract systemPreferences: SystemPreferences
abstract webContents: WebContents
abstract webFrame: WebFrame
abstract webFrameMain: obj
abstract webviewTag: WebviewTag
type Accelerator = string
type [<AllowNullLiteral>] AcceleratorStatic =
[<EmitConstructor>] abstract Create: unit -> Accelerator
type [<AllowNullLiteral>] App =
inherit NodeJS.EventEmitter<App>
/// <summary>
/// Emitted when Chrome's accessibility support changes. This event fires when
/// assistive technologies, such as screen readers, are enabled or disabled. See
/// <see href="https://www.chromium.org/developers/design-documents/accessibility" /> for more
/// details.
/// </summary>
[<Emit "$0.on('accessibility-support-changed',$1)">] abstract ``on_accessibility-support-changed``: listener: (Event -> bool -> unit) -> App
[<Emit "$0.once('accessibility-support-changed',$1)">] abstract ``once_accessibility-support-changed``: listener: (Event -> bool -> unit) -> App
[<Emit "$0.addListener('accessibility-support-changed',$1)">] abstract ``addListener_accessibility-support-changed``: listener: (Event -> bool -> unit) -> App
[<Emit "$0.removeListener('accessibility-support-changed',$1)">] abstract ``removeListener_accessibility-support-changed``: listener: (Event -> bool -> unit) -> App
/// <summary>
/// Emitted when the application is activated. Various actions can trigger this
/// event, such as launching the application for the first time, attempting to
/// re-launch the application when it's already running, or clicking on the
/// application's dock or taskbar icon.
/// </summary>
[<Emit "$0.on('activate',$1)">] abstract on_activate: listener: (Event -> bool -> unit) -> App
[<Emit "$0.once('activate',$1)">] abstract once_activate: listener: (Event -> bool -> unit) -> App
[<Emit "$0.addListener('activate',$1)">] abstract addListener_activate: listener: (Event -> bool -> unit) -> App
[<Emit "$0.removeListener('activate',$1)">] abstract removeListener_activate: listener: (Event -> bool -> unit) -> App
/// <summary>
/// Emitted during Handoff after an activity from this device was successfully
/// resumed on another one.
/// </summary>
[<Emit "$0.on('activity-was-continued',$1)">] abstract ``on_activity-was-continued``: listener: (Event -> string -> obj -> unit) -> App
[<Emit "$0.once('activity-was-continued',$1)">] abstract ``once_activity-was-continued``: listener: (Event -> string -> obj -> unit) -> App
[<Emit "$0.addListener('activity-was-continued',$1)">] abstract ``addListener_activity-was-continued``: listener: (Event -> string -> obj -> unit) -> App
[<Emit "$0.removeListener('activity-was-continued',$1)">] abstract ``removeListener_activity-was-continued``: listener: (Event -> string -> obj -> unit) -> App
/// <summary>
/// Emitted before the application starts closing its windows. Calling
/// <c>event.preventDefault()</c> will prevent the default behavior, which is terminating
/// the application.
///
/// **Note:** If application quit was initiated by <c>autoUpdater.quitAndInstall()</c>,
/// then <c>before-quit</c> is emitted *after* emitting <c>close</c> event on all windows and
/// closing them.
///
/// **Note:** On Windows, this event will not be emitted if the app is closed due to
/// a shutdown/restart of the system or a user logout.
/// </summary>
[<Emit "$0.on('before-quit',$1)">] abstract ``on_before-quit``: listener: (Event -> unit) -> App
[<Emit "$0.once('before-quit',$1)">] abstract ``once_before-quit``: listener: (Event -> unit) -> App
[<Emit "$0.addListener('before-quit',$1)">] abstract ``addListener_before-quit``: listener: (Event -> unit) -> App
[<Emit "$0.removeListener('before-quit',$1)">] abstract ``removeListener_before-quit``: listener: (Event -> unit) -> App
/// Emitted when a browserWindow gets blurred.
[<Emit "$0.on('browser-window-blur',$1)">] abstract ``on_browser-window-blur``: listener: (Event -> BrowserWindow -> unit) -> App
[<Emit "$0.once('browser-window-blur',$1)">] abstract ``once_browser-window-blur``: listener: (Event -> BrowserWindow -> unit) -> App
[<Emit "$0.addListener('browser-window-blur',$1)">] abstract ``addListener_browser-window-blur``: listener: (Event -> BrowserWindow -> unit) -> App
[<Emit "$0.removeListener('browser-window-blur',$1)">] abstract ``removeListener_browser-window-blur``: listener: (Event -> BrowserWindow -> unit) -> App
/// Emitted when a new browserWindow is created.
[<Emit "$0.on('browser-window-created',$1)">] abstract ``on_browser-window-created``: listener: (Event -> BrowserWindow -> unit) -> App
[<Emit "$0.once('browser-window-created',$1)">] abstract ``once_browser-window-created``: listener: (Event -> BrowserWindow -> unit) -> App
[<Emit "$0.addListener('browser-window-created',$1)">] abstract ``addListener_browser-window-created``: listener: (Event -> BrowserWindow -> unit) -> App
[<Emit "$0.removeListener('browser-window-created',$1)">] abstract ``removeListener_browser-window-created``: listener: (Event -> BrowserWindow -> unit) -> App
/// Emitted when a browserWindow gets focused.
[<Emit "$0.on('browser-window-focus',$1)">] abstract ``on_browser-window-focus``: listener: (Event -> BrowserWindow -> unit) -> App
[<Emit "$0.once('browser-window-focus',$1)">] abstract ``once_browser-window-focus``: listener: (Event -> BrowserWindow -> unit) -> App
[<Emit "$0.addListener('browser-window-focus',$1)">] abstract ``addListener_browser-window-focus``: listener: (Event -> BrowserWindow -> unit) -> App
[<Emit "$0.removeListener('browser-window-focus',$1)">] abstract ``removeListener_browser-window-focus``: listener: (Event -> BrowserWindow -> unit) -> App
/// <summary>
/// Emitted when failed to verify the <c>certificate</c> for <c>url</c>, to trust the
/// certificate you should prevent the default behavior with
/// <c>event.preventDefault()</c> and call <c>callback(true)</c>.
/// </summary>
[<Emit "$0.on('certificate-error',$1)">] abstract ``on_certificate-error``: listener: (Event -> WebContents -> string -> string -> Certificate -> (bool -> unit) -> unit) -> App
[<Emit "$0.once('certificate-error',$1)">] abstract ``once_certificate-error``: listener: (Event -> WebContents -> string -> string -> Certificate -> (bool -> unit) -> unit) -> App
[<Emit "$0.addListener('certificate-error',$1)">] abstract ``addListener_certificate-error``: listener: (Event -> WebContents -> string -> string -> Certificate -> (bool -> unit) -> unit) -> App
[<Emit "$0.removeListener('certificate-error',$1)">] abstract ``removeListener_certificate-error``: listener: (Event -> WebContents -> string -> string -> Certificate -> (bool -> unit) -> unit) -> App
/// Emitted when the child process unexpectedly disappears. This is normally because
/// it was crashed or killed. It does not include renderer processes.
[<Emit "$0.on('child-process-gone',$1)">] abstract ``on_child-process-gone``: listener: (Event -> Details -> unit) -> App
[<Emit "$0.once('child-process-gone',$1)">] abstract ``once_child-process-gone``: listener: (Event -> Details -> unit) -> App
[<Emit "$0.addListener('child-process-gone',$1)">] abstract ``addListener_child-process-gone``: listener: (Event -> Details -> unit) -> App
[<Emit "$0.removeListener('child-process-gone',$1)">] abstract ``removeListener_child-process-gone``: listener: (Event -> Details -> unit) -> App
/// <summary>
/// Emitted during Handoff when an activity from a different device wants to be
/// resumed. You should call <c>event.preventDefault()</c> if you want to handle this
/// event.
///
/// A user activity can be continued only in an app that has the same developer Team
/// ID as the activity's source app and that supports the activity's type. Supported
/// activity types are specified in the app's <c>Info.plist</c> under the
/// <c>NSUserActivityTypes</c> key.
/// </summary>
[<Emit "$0.on('continue-activity',$1)">] abstract ``on_continue-activity``: listener: (Event -> string -> obj -> unit) -> App
[<Emit "$0.once('continue-activity',$1)">] abstract ``once_continue-activity``: listener: (Event -> string -> obj -> unit) -> App
[<Emit "$0.addListener('continue-activity',$1)">] abstract ``addListener_continue-activity``: listener: (Event -> string -> obj -> unit) -> App
[<Emit "$0.removeListener('continue-activity',$1)">] abstract ``removeListener_continue-activity``: listener: (Event -> string -> obj -> unit) -> App
/// <summary>
/// Emitted during Handoff when an activity from a different device fails to be
/// resumed.
/// </summary>
[<Emit "$0.on('continue-activity-error',$1)">] abstract ``on_continue-activity-error``: listener: (Event -> string -> string -> unit) -> App
[<Emit "$0.once('continue-activity-error',$1)">] abstract ``once_continue-activity-error``: listener: (Event -> string -> string -> unit) -> App
[<Emit "$0.addListener('continue-activity-error',$1)">] abstract ``addListener_continue-activity-error``: listener: (Event -> string -> string -> unit) -> App
[<Emit "$0.removeListener('continue-activity-error',$1)">] abstract ``removeListener_continue-activity-error``: listener: (Event -> string -> string -> unit) -> App
/// <summary>
/// Emitted when <c>desktopCapturer.getSources()</c> is called in the renderer process of
/// <c>webContents</c>. Calling <c>event.preventDefault()</c> will make it return empty
/// sources.
/// </summary>
[<Emit "$0.on('desktop-capturer-get-sources',$1)">] abstract ``on_desktop-capturer-get-sources``: listener: (Event -> WebContents -> unit) -> App
[<Emit "$0.once('desktop-capturer-get-sources',$1)">] abstract ``once_desktop-capturer-get-sources``: listener: (Event -> WebContents -> unit) -> App
[<Emit "$0.addListener('desktop-capturer-get-sources',$1)">] abstract ``addListener_desktop-capturer-get-sources``: listener: (Event -> WebContents -> unit) -> App
[<Emit "$0.removeListener('desktop-capturer-get-sources',$1)">] abstract ``removeListener_desktop-capturer-get-sources``: listener: (Event -> WebContents -> unit) -> App
/// <summary>
/// Emitted when mac application become active. Difference from <c>activate</c> event is
/// that <c>did-become-active</c> is emitted every time the app becomes active, not only
/// when Dock icon is clicked or application is re-launched.
/// </summary>
[<Emit "$0.on('did-become-active',$1)">] abstract ``on_did-become-active``: listener: (Event -> unit) -> App
[<Emit "$0.once('did-become-active',$1)">] abstract ``once_did-become-active``: listener: (Event -> unit) -> App
[<Emit "$0.addListener('did-become-active',$1)">] abstract ``addListener_did-become-active``: listener: (Event -> unit) -> App
[<Emit "$0.removeListener('did-become-active',$1)">] abstract ``removeListener_did-become-active``: listener: (Event -> unit) -> App
/// Emitted whenever there is a GPU info update.
[<Emit "$0.on('gpu-info-update',$1)">] abstract ``on_gpu-info-update``: listener: Function -> App
[<Emit "$0.once('gpu-info-update',$1)">] abstract ``once_gpu-info-update``: listener: Function -> App
[<Emit "$0.addListener('gpu-info-update',$1)">] abstract ``addListener_gpu-info-update``: listener: Function -> App
[<Emit "$0.removeListener('gpu-info-update',$1)">] abstract ``removeListener_gpu-info-update``: listener: Function -> App
/// <summary>
/// Emitted when the GPU process crashes or is killed.
///
/// **Deprecated:** This event is superceded by the <c>child-process-gone</c> event which
/// contains more information about why the child process disappeared. It isn't
/// always because it crashed. The <c>killed</c> boolean can be replaced by checking
/// <c>reason === 'killed'</c> when you switch to that event.
/// </summary>
[<Obsolete("")>]
[<Emit "$0.on('gpu-process-crashed',$1)">] abstract ``on_gpu-process-crashed``: listener: (Event -> bool -> unit) -> App
[<Emit "$0.once('gpu-process-crashed',$1)">] abstract ``once_gpu-process-crashed``: listener: (Event -> bool -> unit) -> App
[<Emit "$0.addListener('gpu-process-crashed',$1)">] abstract ``addListener_gpu-process-crashed``: listener: (Event -> bool -> unit) -> App
[<Emit "$0.removeListener('gpu-process-crashed',$1)">] abstract ``removeListener_gpu-process-crashed``: listener: (Event -> bool -> unit) -> App
/// <summary>
/// Emitted when <c>webContents</c> wants to do basic auth.
///
/// The default behavior is to cancel all authentications. To override this you
/// should prevent the default behavior with <c>event.preventDefault()</c> and call
/// <c>callback(username, password)</c> with the credentials.
///
/// If <c>callback</c> is called without a username or password, the authentication
/// request will be cancelled and the authentication error will be returned to the
/// page.
/// </summary>
[<Emit "$0.on('login',$1)">] abstract on_login: listener: (Event -> WebContents -> AuthenticationResponseDetails -> AuthInfo -> ((string) option -> (string) option -> unit) -> unit) -> App
[<Emit "$0.once('login',$1)">] abstract once_login: listener: (Event -> WebContents -> AuthenticationResponseDetails -> AuthInfo -> ((string) option -> (string) option -> unit) -> unit) -> App
[<Emit "$0.addListener('login',$1)">] abstract addListener_login: listener: (Event -> WebContents -> AuthenticationResponseDetails -> AuthInfo -> ((string) option -> (string) option -> unit) -> unit) -> App
[<Emit "$0.removeListener('login',$1)">] abstract removeListener_login: listener: (Event -> WebContents -> AuthenticationResponseDetails -> AuthInfo -> ((string) option -> (string) option -> unit) -> unit) -> App
/// <summary>
/// Emitted when the user clicks the native macOS new tab button. The new tab button
/// is only visible if the current <c>BrowserWindow</c> has a <c>tabbingIdentifier</c>
/// </summary>
[<Emit "$0.on('new-window-for-tab',$1)">] abstract ``on_new-window-for-tab``: listener: (Event -> unit) -> App
[<Emit "$0.once('new-window-for-tab',$1)">] abstract ``once_new-window-for-tab``: listener: (Event -> unit) -> App
[<Emit "$0.addListener('new-window-for-tab',$1)">] abstract ``addListener_new-window-for-tab``: listener: (Event -> unit) -> App
[<Emit "$0.removeListener('new-window-for-tab',$1)">] abstract ``removeListener_new-window-for-tab``: listener: (Event -> unit) -> App
/// <summary>
/// Emitted when the user wants to open a file with the application. The <c>open-file</c>
/// event is usually emitted when the application is already open and the OS wants
/// to reuse the application to open the file. <c>open-file</c> is also emitted when a
/// file is dropped onto the dock and the application is not yet running. Make sure
/// to listen for the <c>open-file</c> event very early in your application startup to
/// handle this case (even before the <c>ready</c> event is emitted).
///
/// You should call <c>event.preventDefault()</c> if you want to handle this event.
///
/// On Windows, you have to parse <c>process.argv</c> (in the main process) to get the
/// filepath.
/// </summary>
[<Emit "$0.on('open-file',$1)">] abstract ``on_open-file``: listener: (Event -> string -> unit) -> App
[<Emit "$0.once('open-file',$1)">] abstract ``once_open-file``: listener: (Event -> string -> unit) -> App
[<Emit "$0.addListener('open-file',$1)">] abstract ``addListener_open-file``: listener: (Event -> string -> unit) -> App
[<Emit "$0.removeListener('open-file',$1)">] abstract ``removeListener_open-file``: listener: (Event -> string -> unit) -> App
/// <summary>
/// Emitted when the user wants to open a URL with the application. Your
/// application's <c>Info.plist</c> file must define the URL scheme within the
/// <c>CFBundleURLTypes</c> key, and set <c>NSPrincipalClass</c> to <c>AtomApplication</c>.
///
/// You should call <c>event.preventDefault()</c> if you want to handle this event.
/// </summary>
[<Emit "$0.on('open-url',$1)">] abstract ``on_open-url``: listener: (Event -> string -> unit) -> App
[<Emit "$0.once('open-url',$1)">] abstract ``once_open-url``: listener: (Event -> string -> unit) -> App
[<Emit "$0.addListener('open-url',$1)">] abstract ``addListener_open-url``: listener: (Event -> string -> unit) -> App
[<Emit "$0.removeListener('open-url',$1)">] abstract ``removeListener_open-url``: listener: (Event -> string -> unit) -> App
/// Emitted when the application is quitting.
///
/// **Note:** On Windows, this event will not be emitted if the app is closed due to
/// a shutdown/restart of the system or a user logout.
[<Emit "$0.on('quit',$1)">] abstract on_quit: listener: (Event -> float -> unit) -> App
[<Emit "$0.once('quit',$1)">] abstract once_quit: listener: (Event -> float -> unit) -> App
[<Emit "$0.addListener('quit',$1)">] abstract addListener_quit: listener: (Event -> float -> unit) -> App
[<Emit "$0.removeListener('quit',$1)">] abstract removeListener_quit: listener: (Event -> float -> unit) -> App
/// <summary>
/// Emitted once, when Electron has finished initializing. On macOS, <c>launchInfo</c>
/// holds the <c>userInfo</c> of the <c>NSUserNotification</c> or information from
/// <c>UNNotificationResponse</c> that was used to open the application, if it was
/// launched from Notification Center. You can also call <c>app.isReady()</c> to check if
/// this event has already fired and <c>app.whenReady()</c> to get a Promise that is
/// fulfilled when Electron is initialized.
/// </summary>
[<Emit "$0.on('ready',$1)">] abstract on_ready: listener: (Event -> U2<Record<string, obj option>, NotificationResponse> -> unit) -> App
[<Emit "$0.once('ready',$1)">] abstract once_ready: listener: (Event -> U2<Record<string, obj option>, NotificationResponse> -> unit) -> App
[<Emit "$0.addListener('ready',$1)">] abstract addListener_ready: listener: (Event -> U2<Record<string, obj option>, NotificationResponse> -> unit) -> App
[<Emit "$0.removeListener('ready',$1)">] abstract removeListener_ready: listener: (Event -> U2<Record<string, obj option>, NotificationResponse> -> unit) -> App
/// Emitted when the renderer process unexpectedly disappears. This is normally
/// because it was crashed or killed.
[<Emit "$0.on('render-process-gone',$1)">] abstract ``on_render-process-gone``: listener: (Event -> WebContents -> RenderProcessGoneDetails -> unit) -> App
[<Emit "$0.once('render-process-gone',$1)">] abstract ``once_render-process-gone``: listener: (Event -> WebContents -> RenderProcessGoneDetails -> unit) -> App
[<Emit "$0.addListener('render-process-gone',$1)">] abstract ``addListener_render-process-gone``: listener: (Event -> WebContents -> RenderProcessGoneDetails -> unit) -> App
[<Emit "$0.removeListener('render-process-gone',$1)">] abstract ``removeListener_render-process-gone``: listener: (Event -> WebContents -> RenderProcessGoneDetails -> unit) -> App
/// <summary>
/// Emitted when the renderer process of <c>webContents</c> crashes or is killed.
///
/// **Deprecated:** This event is superceded by the <c>render-process-gone</c> event
/// which contains more information about why the render process disappeared. It
/// isn't always because it crashed. The <c>killed</c> boolean can be replaced by
/// checking <c>reason === 'killed'</c> when you switch to that event.
/// </summary>
[<Obsolete("")>]
[<Emit "$0.on('renderer-process-crashed',$1)">] abstract ``on_renderer-process-crashed``: listener: (Event -> WebContents -> bool -> unit) -> App
[<Emit "$0.once('renderer-process-crashed',$1)">] abstract ``once_renderer-process-crashed``: listener: (Event -> WebContents -> bool -> unit) -> App
[<Emit "$0.addListener('renderer-process-crashed',$1)">] abstract ``addListener_renderer-process-crashed``: listener: (Event -> WebContents -> bool -> unit) -> App
[<Emit "$0.removeListener('renderer-process-crashed',$1)">] abstract ``removeListener_renderer-process-crashed``: listener: (Event -> WebContents -> bool -> unit) -> App
/// <summary>
/// This event will be emitted inside the primary instance of your application when
/// a second instance has been executed and calls <c>app.requestSingleInstanceLock()</c>.
///
/// <c>argv</c> is an Array of the second instance's command line arguments, and
/// <c>workingDirectory</c> is its current working directory. Usually applications
/// respond to this by making their primary window focused and non-minimized.
///
/// **Note:** If the second instance is started by a different user than the first,
/// the <c>argv</c> array will not include the arguments.
///
/// This event is guaranteed to be emitted after the <c>ready</c> event of <c>app</c> gets
/// emitted.
///
/// **Note:** Extra command line arguments might be added by Chromium, such as
/// <c>--original-process-start-time</c>.
/// </summary>
[<Emit "$0.on('second-instance',$1)">] abstract ``on_second-instance``: listener: (Event -> ResizeArray<string> -> string -> unit) -> App
[<Emit "$0.once('second-instance',$1)">] abstract ``once_second-instance``: listener: (Event -> ResizeArray<string> -> string -> unit) -> App
[<Emit "$0.addListener('second-instance',$1)">] abstract ``addListener_second-instance``: listener: (Event -> ResizeArray<string> -> string -> unit) -> App
[<Emit "$0.removeListener('second-instance',$1)">] abstract ``removeListener_second-instance``: listener: (Event -> ResizeArray<string> -> string -> unit) -> App
/// <summary>
/// Emitted when a client certificate is requested.
///
/// The <c>url</c> corresponds to the navigation entry requesting the client certificate
/// and <c>callback</c> can be called with an entry filtered from the list. Using
/// <c>event.preventDefault()</c> prevents the application from using the first
/// certificate from the store.
/// </summary>
[<Emit "$0.on('select-client-certificate',$1)">] abstract ``on_select-client-certificate``: listener: (Event -> WebContents -> string -> ResizeArray<Certificate> -> ((Certificate) option -> unit) -> unit) -> App
[<Emit "$0.once('select-client-certificate',$1)">] abstract ``once_select-client-certificate``: listener: (Event -> WebContents -> string -> ResizeArray<Certificate> -> ((Certificate) option -> unit) -> unit) -> App
[<Emit "$0.addListener('select-client-certificate',$1)">] abstract ``addListener_select-client-certificate``: listener: (Event -> WebContents -> string -> ResizeArray<Certificate> -> ((Certificate) option -> unit) -> unit) -> App
[<Emit "$0.removeListener('select-client-certificate',$1)">] abstract ``removeListener_select-client-certificate``: listener: (Event -> WebContents -> string -> ResizeArray<Certificate> -> ((Certificate) option -> unit) -> unit) -> App
/// <summary>Emitted when Electron has created a new <c>session</c>.</summary>
[<Emit "$0.on('session-created',$1)">] abstract ``on_session-created``: listener: (Session -> unit) -> App
[<Emit "$0.once('session-created',$1)">] abstract ``once_session-created``: listener: (Session -> unit) -> App
[<Emit "$0.addListener('session-created',$1)">] abstract ``addListener_session-created``: listener: (Session -> unit) -> App
[<Emit "$0.removeListener('session-created',$1)">] abstract ``removeListener_session-created``: listener: (Session -> unit) -> App
/// <summary>
/// Emitted when Handoff is about to be resumed on another device. If you need to
/// update the state to be transferred, you should call <c>event.preventDefault()</c>
/// immediately, construct a new <c>userInfo</c> dictionary and call
/// <c>app.updateCurrentActivity()</c> in a timely manner. Otherwise, the operation will
/// fail and <c>continue-activity-error</c> will be called.
/// </summary>
[<Emit "$0.on('update-activity-state',$1)">] abstract ``on_update-activity-state``: listener: (Event -> string -> obj -> unit) -> App
[<Emit "$0.once('update-activity-state',$1)">] abstract ``once_update-activity-state``: listener: (Event -> string -> obj -> unit) -> App
[<Emit "$0.addListener('update-activity-state',$1)">] abstract ``addListener_update-activity-state``: listener: (Event -> string -> obj -> unit) -> App
[<Emit "$0.removeListener('update-activity-state',$1)">] abstract ``removeListener_update-activity-state``: listener: (Event -> string -> obj -> unit) -> App
/// Emitted when a new webContents is created.
[<Emit "$0.on('web-contents-created',$1)">] abstract ``on_web-contents-created``: listener: (Event -> WebContents -> unit) -> App
[<Emit "$0.once('web-contents-created',$1)">] abstract ``once_web-contents-created``: listener: (Event -> WebContents -> unit) -> App
[<Emit "$0.addListener('web-contents-created',$1)">] abstract ``addListener_web-contents-created``: listener: (Event -> WebContents -> unit) -> App
[<Emit "$0.removeListener('web-contents-created',$1)">] abstract ``removeListener_web-contents-created``: listener: (Event -> WebContents -> unit) -> App
/// <summary>
/// Emitted during Handoff before an activity from a different device wants to be
/// resumed. You should call <c>event.preventDefault()</c> if you want to handle this
/// event.
/// </summary>
[<Emit "$0.on('will-continue-activity',$1)">] abstract ``on_will-continue-activity``: listener: (Event -> string -> unit) -> App
[<Emit "$0.once('will-continue-activity',$1)">] abstract ``once_will-continue-activity``: listener: (Event -> string -> unit) -> App
[<Emit "$0.addListener('will-continue-activity',$1)">] abstract ``addListener_will-continue-activity``: listener: (Event -> string -> unit) -> App
[<Emit "$0.removeListener('will-continue-activity',$1)">] abstract ``removeListener_will-continue-activity``: listener: (Event -> string -> unit) -> App
/// <summary>
/// Emitted when the application has finished basic startup. On Windows and Linux,
/// the <c>will-finish-launching</c> event is the same as the <c>ready</c> event; on macOS,
/// this event represents the <c>applicationWillFinishLaunching</c> notification of
/// <c>NSApplication</c>. You would usually set up listeners for the <c>open-file</c> and
/// <c>open-url</c> events here, and start the crash reporter and auto updater.
///
/// In most cases, you should do everything in the <c>ready</c> event handler.
/// </summary>
[<Emit "$0.on('will-finish-launching',$1)">] abstract ``on_will-finish-launching``: listener: Function -> App
[<Emit "$0.once('will-finish-launching',$1)">] abstract ``once_will-finish-launching``: listener: Function -> App
[<Emit "$0.addListener('will-finish-launching',$1)">] abstract ``addListener_will-finish-launching``: listener: Function -> App
[<Emit "$0.removeListener('will-finish-launching',$1)">] abstract ``removeListener_will-finish-launching``: listener: Function -> App
/// <summary>
/// Emitted when all windows have been closed and the application will quit. Calling
/// <c>event.preventDefault()</c> will prevent the default behavior, which is terminating
/// the application.
///
/// See the description of the <c>window-all-closed</c> event for the differences between
/// the <c>will-quit</c> and <c>window-all-closed</c> events.
///
/// **Note:** On Windows, this event will not be emitted if the app is closed due to
/// a shutdown/restart of the system or a user logout.
/// </summary>
[<Emit "$0.on('will-quit',$1)">] abstract ``on_will-quit``: listener: (Event -> unit) -> App
[<Emit "$0.once('will-quit',$1)">] abstract ``once_will-quit``: listener: (Event -> unit) -> App
[<Emit "$0.addListener('will-quit',$1)">] abstract ``addListener_will-quit``: listener: (Event -> unit) -> App
[<Emit "$0.removeListener('will-quit',$1)">] abstract ``removeListener_will-quit``: listener: (Event -> unit) -> App
/// <summary>
/// Emitted when all windows have been closed.
///
/// If you do not subscribe to this event and all windows are closed, the default
/// behavior is to quit the app; however, if you subscribe, you control whether the
/// app quits or not. If the user pressed <c>Cmd + Q</c>, or the developer called
/// <c>app.quit()</c>, Electron will first try to close all the windows and then emit the
/// <c>will-quit</c> event, and in this case the <c>window-all-closed</c> event would not be
/// emitted.
/// </summary>
[<Emit "$0.on('window-all-closed',$1)">] abstract ``on_window-all-closed``: listener: Function -> App
[<Emit "$0.once('window-all-closed',$1)">] abstract ``once_window-all-closed``: listener: Function -> App
[<Emit "$0.addListener('window-all-closed',$1)">] abstract ``addListener_window-all-closed``: listener: Function -> App
[<Emit "$0.removeListener('window-all-closed',$1)">] abstract ``removeListener_window-all-closed``: listener: Function -> App
/// <summary>
/// Adds <c>path</c> to the recent documents list.
///
/// This list is managed by the OS. On Windows, you can visit the list from the task
/// bar, and on macOS, you can visit it from dock menu.
/// </summary>
abstract addRecentDocument: path: string -> unit
/// <summary>Clears the recent documents list.</summary>
abstract clearRecentDocuments: unit -> unit
/// By default, Chromium disables 3D APIs (e.g. WebGL) until restart on a per domain
/// basis if the GPU processes crashes too frequently. This function disables that
/// behavior.
///
/// This method can only be called before app is ready.
abstract disableDomainBlockingFor3DAPIs: unit -> unit
/// Disables hardware acceleration for current app.
///
/// This method can only be called before app is ready.
abstract disableHardwareAcceleration: unit -> unit
/// <summary>
/// Enables full sandbox mode on the app. This means that all renderers will be
/// launched sandboxed, regardless of the value of the <c>sandbox</c> flag in
/// WebPreferences.
///
/// This method can only be called before app is ready.
/// </summary>
abstract enableSandbox: unit -> unit
/// <summary>
/// Exits immediately with <c>exitCode</c>. <c>exitCode</c> defaults to 0.
///
/// All windows will be closed immediately without asking the user, and the
/// <c>before-quit</c> and <c>will-quit</c> events will not be emitted.
/// </summary>
abstract exit: ?exitCode: float -> unit
/// <summary>
/// On Linux, focuses on the first visible window. On macOS, makes the application
/// the active app. On Windows, focuses on the application's first window.
///
/// You should seek to use the <c>steal</c> option as sparingly as possible.
/// </summary>
abstract focus: ?options: FocusOptions -> unit
/// <summary>
/// Resolve with an object containing the following:
///
/// * <c>icon</c> NativeImage - the display icon of the app handling the protocol.
/// * <c>path</c> String - installation path of the app handling the protocol.
/// * <c>name</c> String - display name of the app handling the protocol.
///
/// This method returns a promise that contains the application name, icon and path
/// of the default handler for the protocol (aka URI scheme) of a URL.
/// </summary>
abstract getApplicationInfoForProtocol: url: string -> Promise<Electron.ApplicationInfoForProtocolReturnValue>
/// <summary>
/// Name of the application handling the protocol, or an empty string if there is no
/// handler. For instance, if Electron is the default handler of the URL, this could
/// be <c>Electron</c> on Windows and Mac. However, don't rely on the precise format
/// which is not guaranteed to remain unchanged. Expect a different format on Linux,
/// possibly with a <c>.desktop</c> suffix.
///
/// This method returns the application name of the default handler for the protocol
/// (aka URI scheme) of a URL.
/// </summary>
abstract getApplicationNameForProtocol: url: string -> string
/// <summary>
/// Array of <c>ProcessMetric</c> objects that correspond to memory and CPU usage
/// statistics of all the processes associated with the app.
/// </summary>
abstract getAppMetrics: unit -> ResizeArray<ProcessMetric>
/// The current application directory.
abstract getAppPath: unit -> string
/// <summary>The current value displayed in the counter badge.</summary>
abstract getBadgeCount: unit -> float
/// <summary>The type of the currently running activity.</summary>
abstract getCurrentActivityType: unit -> string
/// <summary>
/// fulfilled with the app's icon, which is a NativeImage.
///
/// Fetches a path's associated icon.
///
/// On _Windows_, there a 2 kinds of icons:
///
/// * Icons associated with certain file extensions, like <c>.mp3</c>, <c>.png</c>, etc.
/// * Icons inside the file itself, like <c>.exe</c>, <c>.dll</c>, <c>.ico</c>.
///
/// On _Linux_ and _macOS_, icons depend on the application associated with file
/// mime type.
/// </summary>
abstract getFileIcon: path: string * ?options: FileIconOptions -> Promise<Electron.NativeImage>
/// <summary>
/// The Graphics Feature Status from <c>chrome://gpu/</c>.
///
/// **Note:** This information is only usable after the <c>gpu-info-update</c> event is
/// emitted.
/// </summary>
abstract getGPUFeatureStatus: unit -> GPUFeatureStatus
/// <summary>
/// For <c>infoType</c> equal to <c>complete</c>: Promise is fulfilled with <c>Object</c>
/// containing all the GPU Information as in chromium's GPUInfo object. This
/// includes the version and driver information that's shown on <c>chrome://gpu</c> page.
///
/// For <c>infoType</c> equal to <c>basic</c>: Promise is fulfilled with <c>Object</c> containing
/// fewer attributes than when requested with <c>complete</c>. Here's an example of basic
/// response:
///
/// Using <c>basic</c> should be preferred if only basic information like <c>vendorId</c> or
/// <c>driverId</c> is needed.
/// </summary>
abstract getGPUInfo: infoType: AppGetGPUInfo -> Promise<obj>
/// <summary>
/// * <c>minItems</c> Integer - The minimum number of items that will be shown in the
/// Jump List (for a more detailed description of this value see the MSDN docs).
/// * <c>removedItems</c> JumpListItem[] - Array of <c>JumpListItem</c> objects that
/// correspond to items that the user has explicitly removed from custom categories
/// in the Jump List. These items must not be re-added to the Jump List in the
/// **next** call to <c>app.setJumpList()</c>, Windows will not display any custom
/// category that contains any of the removed items.
/// </summary>
abstract getJumpListSettings: unit -> JumpListSettings
/// <summary>
/// The current application locale, fetched using Chromium's <c>l10n_util</c> library.
/// Possible return values are documented here.
///
/// To set the locale, you'll want to use a command line switch at app startup,
/// which may be found here.
///
/// **Note:** When distributing your packaged app, you have to also ship the
/// <c>locales</c> folder.
///
/// **Note:** On Windows, you have to call it after the <c>ready</c> events gets emitted.
/// </summary>
abstract getLocale: unit -> string
/// User operating system's locale two-letter ISO 3166 country code. The value is
/// taken from native OS APIs.
///
/// **Note:** When unable to detect locale country code, it returns empty string.
abstract getLocaleCountryCode: unit -> string
/// <summary>
/// If you provided <c>path</c> and <c>args</c> options to <c>app.setLoginItemSettings</c>, then
/// you need to pass the same arguments here for <c>openAtLogin</c> to be set correctly.
///
///
/// * <c>openAtLogin</c> Boolean - <c>true</c> if the app is set to open at login.
/// * <c>openAsHidden</c> Boolean _macOS_ - <c>true</c> if the app is set to open as hidden at
/// login. This setting is not available on MAS builds.
/// * <c>wasOpenedAtLogin</c> Boolean _macOS_ - <c>true</c> if the app was opened at login
/// automatically. This setting is not available on MAS builds.
/// * <c>wasOpenedAsHidden</c> Boolean _macOS_ - <c>true</c> if the app was opened as a hidden
/// login item. This indicates that the app should not open any windows at startup.
/// This setting is not available on MAS builds.
/// * <c>restoreState</c> Boolean _macOS_ - <c>true</c> if the app was opened as a login item
/// that should restore the state from the previous session. This indicates that the
/// app should restore the windows that were open the last time the app was closed.
/// This setting is not available on MAS builds.
/// * <c>executableWillLaunchAtLogin</c> Boolean _Windows_ - <c>true</c> if app is set to open
/// at login and its run key is not deactivated. This differs from <c>openAtLogin</c> as
/// it ignores the <c>args</c> option, this property will be true if the given executable
/// would be launched at login with **any** arguments.
/// * <c>launchItems</c> Object[] _Windows_
/// * <c>name</c> String _Windows_ - name value of a registry entry.
/// * <c>path</c> String _Windows_ - The executable to an app that corresponds to a
/// registry entry.
/// * <c>args</c> String[] _Windows_ - the command-line arguments to pass to the
/// executable.
/// * <c>scope</c> String _Windows_ - one of <c>user</c> or <c>machine</c>. Indicates whether the
/// registry entry is under <c>HKEY_CURRENT USER</c> or <c>HKEY_LOCAL_MACHINE</c>.
/// * <c>enabled</c> Boolean _Windows_ - <c>true</c> if the app registry key is startup
/// approved and therefore shows as <c>enabled</c> in Task Manager and Windows settings.
/// </summary>
abstract getLoginItemSettings: ?options: LoginItemSettingsOptions -> LoginItemSettings
/// <summary>
/// The current application's name, which is the name in the application's
/// <c>package.json</c> file.
///
/// Usually the <c>name</c> field of <c>package.json</c> is a short lowercase name, according
/// to the npm modules spec. You should usually also specify a <c>productName</c> field,
/// which is your application's full capitalized name, and which will be preferred
/// over <c>name</c> by Electron.
/// </summary>
abstract getName: unit -> string
/// <summary>
/// A path to a special directory or file associated with <c>name</c>. On failure, an
/// <c>Error</c> is thrown.
///
/// If <c>app.getPath('logs')</c> is called without called <c>app.setAppLogsPath()</c> being
/// called first, a default log directory will be created equivalent to calling
/// <c>app.setAppLogsPath()</c> without a <c>path</c> parameter.
/// </summary>
abstract getPath: name: AppGetPath -> string
/// <summary>
/// The version of the loaded application. If no version is found in the
/// application's <c>package.json</c> file, the version of the current bundle or
/// executable is returned.
/// </summary>
abstract getVersion: unit -> string
/// <summary>
/// This method returns whether or not this instance of your app is currently
/// holding the single instance lock. You can request the lock with
/// <c>app.requestSingleInstanceLock()</c> and release with
/// <c>app.releaseSingleInstanceLock()</c>
/// </summary>
abstract hasSingleInstanceLock: unit -> bool
/// <summary>Hides all application windows without minimizing them.</summary>
abstract hide: unit -> unit
/// <summary>
/// Imports the certificate in pkcs12 format into the platform certificate store.
/// <c>callback</c> is called with the <c>result</c> of import operation, a value of <c>0</c>
/// indicates success while any other value indicates failure according to Chromium
/// net_error_list.
/// </summary>
abstract importCertificate: options: ImportCertificateOptions * callback: (float -> unit) -> unit
/// <summary>Invalidates the current Handoff user activity.</summary>
abstract invalidateCurrentActivity: unit -> unit
/// <summary>
/// <c>true</c> if Chrome's accessibility support is enabled, <c>false</c> otherwise. This API
/// will return <c>true</c> if the use of assistive technologies, such as screen readers,
/// has been detected. See
/// <see href="https://www.chromium.org/developers/design-documents/accessibility" /> for more
/// details.
/// </summary>
abstract isAccessibilitySupportEnabled: unit -> bool
/// <summary>
/// Whether the current executable is the default handler for a protocol (aka URI
/// scheme).
///
/// **Note:** On macOS, you can use this method to check if the app has been
/// registered as the default protocol handler for a protocol. You can also verify
/// this by checking <c>~/Library/Preferences/com.apple.LaunchServices.plist</c> on the
/// macOS machine. Please refer to Apple's documentation for details.
///
/// The API uses the Windows Registry and <c>LSCopyDefaultHandlerForURLScheme</c>
/// internally.
/// </summary>
abstract isDefaultProtocolClient: protocol: string * ?path: string * ?args: ResizeArray<string> -> bool
/// whether or not the current OS version allows for native emoji pickers.
abstract isEmojiPanelSupported: unit -> bool
/// <summary>
/// Whether the application is currently running from the systems Application
/// folder. Use in combination with <c>app.moveToApplicationsFolder()</c>
/// </summary>
abstract isInApplicationsFolder: unit -> bool
/// <summary>
/// <c>true</c> if Electron has finished initializing, <c>false</c> otherwise. See also
/// <c>app.whenReady()</c>.
/// </summary>
abstract isReady: unit -> bool
/// <summary>
/// whether <c>Secure Keyboard Entry</c> is enabled.
///
/// By default this API will return <c>false</c>.
/// </summary>
abstract isSecureKeyboardEntryEnabled: unit -> bool
/// <summary>Whether the current desktop environment is Unity launcher.</summary>
abstract isUnityRunning: unit -> bool
/// <summary>
/// Whether the move was successful. Please note that if the move is successful,
/// your application will quit and relaunch.
///
/// No confirmation dialog will be presented by default. If you wish to allow the
/// user to confirm the operation, you may do so using the <c>dialog</c> API.
///
/// **NOTE:** This method throws errors if anything other than the user causes the
/// move to fail. For instance if the user cancels the authorization dialog, this
/// method returns false. If we fail to perform the copy, then this method will
/// throw an error. The message in the error should be informative and tell you
/// exactly what went wrong.
///
/// By default, if an app of the same name as the one being moved exists in the
/// Applications directory and is _not_ running, the existing app will be trashed
/// and the active app moved into its place. If it _is_ running, the pre-existing
/// running app will assume focus and the previously active app will quit itself.
/// This behavior can be changed by providing the optional conflict handler, where
/// the boolean returned by the handler determines whether or not the move conflict
/// is resolved with default behavior. i.e. returning <c>false</c> will ensure no
/// further action is taken, returning <c>true</c> will result in the default behavior
/// and the method continuing.
///
/// For example:
///
/// Would mean that if an app already exists in the user directory, if the user
/// chooses to 'Continue Move' then the function would continue with its default
/// behavior and the existing app will be trashed and the active app moved into its
/// place.
/// </summary>
abstract moveToApplicationsFolder: ?options: MoveToApplicationsFolderOptions -> bool
/// <summary>
/// Try to close all windows. The <c>before-quit</c> event will be emitted first. If all
/// windows are successfully closed, the <c>will-quit</c> event will be emitted and by
/// default the application will terminate.
///
/// This method guarantees that all <c>beforeunload</c> and <c>unload</c> event handlers are
/// correctly executed. It is possible that a window cancels the quitting by
/// returning <c>false</c> in the <c>beforeunload</c> event handler.
/// </summary>
abstract quit: unit -> unit
/// <summary>
/// Relaunches the app when current instance exits.
///
/// By default, the new instance will use the same working directory and command
/// line arguments with current instance. When <c>args</c> is specified, the <c>args</c> will
/// be passed as command line arguments instead. When <c>execPath</c> is specified, the
/// <c>execPath</c> will be executed for relaunch instead of current app.
///
/// Note that this method does not quit the app when executed, you have to call
/// <c>app.quit</c> or <c>app.exit</c> after calling <c>app.relaunch</c> to make the app restart.
///
/// When <c>app.relaunch</c> is called for multiple times, multiple instances will be
/// started after current instance exited.
///
/// An example of restarting current instance immediately and adding a new command
/// line argument to the new instance:
/// </summary>
abstract relaunch: ?options: RelaunchOptions -> unit
/// <summary>
/// Releases all locks that were created by <c>requestSingleInstanceLock</c>. This will
/// allow multiple instances of the application to once again run side by side.
/// </summary>
abstract releaseSingleInstanceLock: unit -> unit
/// <summary>
/// Whether the call succeeded.
///
/// This method checks if the current executable as the default handler for a
/// protocol (aka URI scheme). If so, it will remove the app as the default handler.
/// </summary>
abstract removeAsDefaultProtocolClient: protocol: string * ?path: string * ?args: ResizeArray<string> -> bool
/// <summary>
/// The return value of this method indicates whether or not this instance of your
/// application successfully obtained the lock. If it failed to obtain the lock,
/// you can assume that another instance of your application is already running with
/// the lock and exit immediately.
///
/// I.e. This method returns <c>true</c> if your process is the primary instance of your
/// application and your app should continue loading. It returns <c>false</c> if your
/// process should immediately quit as it has sent its parameters to another
/// instance that has already acquired the lock.
///
/// On macOS, the system enforces single instance automatically when users try to
/// open a second instance of your app in Finder, and the <c>open-file</c> and <c>open-url</c>
/// events will be emitted for that. However when users start your app in command
/// line, the system's single instance mechanism will be bypassed, and you have to
/// use this method to ensure single instance.
///
/// An example of activating the window of primary instance when a second instance
/// starts:
/// </summary>
abstract requestSingleInstanceLock: unit -> bool
/// <summary>Marks the current Handoff user activity as inactive without invalidating it.</summary>
abstract resignCurrentActivity: unit -> unit
/// <summary>
/// Set the about panel options. This will override the values defined in the app's
/// <c>.plist</c> file on macOS. See the Apple docs for more details. On Linux, values
/// must be set in order to be shown; there are no defaults.
///
/// If you do not set <c>credits</c> but still wish to surface them in your app, AppKit
/// will look for a file named "Credits.html", "Credits.rtf", and "Credits.rtfd", in
/// that order, in the bundle returned by the NSBundle class method main. The first
/// file found is used, and if none is found, the info area is left blank. See Apple
/// documentation for more information.
/// </summary>
abstract setAboutPanelOptions: options: AboutPanelOptionsOptions -> unit
/// <summary>
/// Manually enables Chrome's accessibility support, allowing to expose
/// accessibility switch to users in application settings. See Chromium's
/// accessibility docs for more details. Disabled by default.
///
/// This API must be called after the <c>ready</c> event is emitted.
///
/// **Note:** Rendering accessibility tree can significantly affect the performance
/// of your app. It should not be enabled by default.
/// </summary>
abstract setAccessibilitySupportEnabled: enabled: bool -> unit
/// <summary>
/// Sets the activation policy for a given app.
///
/// Activation policy types:
///
/// * 'regular' - The application is an ordinary app that appears in the Dock and
/// may have a user interface.
/// * 'accessory' - The application doesn’t appear in the Dock and doesn’t have a
/// menu bar, but it may be activated programmatically or by clicking on one of its
/// windows.
/// * 'prohibited' - The application doesn’t appear in the Dock and may not create
/// windows or be activated.
/// </summary>
abstract setActivationPolicy: policy: AppSetActivationPolicy -> unit
/// <summary>
/// Sets or creates a directory your app's logs which can then be manipulated with
/// <c>app.getPath()</c> or <c>app.setPath(pathName, newPath)</c>.
///
/// Calling <c>app.setAppLogsPath()</c> without a <c>path</c> parameter will result in this
/// directory being set to <c>~/Library/Logs/YourAppName</c> on _macOS_, and inside the
/// <c>userData</c> directory on _Linux_ and _Windows_.
/// </summary>
abstract setAppLogsPath: ?path: string -> unit
/// <summary>Changes the Application User Model ID to <c>id</c>.</summary>
abstract setAppUserModelId: id: string -> unit
/// <summary>
/// Whether the call succeeded.
///
/// Sets the current executable as the default handler for a protocol (aka URI
/// scheme). It allows you to integrate your app deeper into the operating system.
/// Once registered, all links with <c>your-protocol://</c> will be opened with the
/// current executable. The whole link, including protocol, will be passed to your
/// application as a parameter.
///
/// **Note:** On macOS, you can only register protocols that have been added to your
/// app's <c>info.plist</c>, which cannot be modified at runtime. However, you can change
/// the file during build time via Electron Forge, Electron Packager, or by editing
/// <c>info.plist</c> with a text editor. Please refer to Apple's documentation for
/// details.
///
/// **Note:** In a Windows Store environment (when packaged as an <c>appx</c>) this API
/// will return <c>true</c> for all calls but the registry key it sets won't be
/// accessible by other applications. In order to register your Windows Store
/// application as a default protocol handler you must declare the protocol in your
/// manifest.
///
/// The API uses the Windows Registry and <c>LSSetDefaultHandlerForURLScheme</c>
/// internally.
/// </summary>
abstract setAsDefaultProtocolClient: protocol: string * ?path: string * ?args: ResizeArray<string> -> bool
/// <summary>
/// Whether the call succeeded.
///
/// Sets the counter badge for current app. Setting the count to <c>0</c> will hide the
/// badge.
///
/// On macOS, it shows on the dock icon. On Linux, it only works for Unity launcher.
///
/// **Note:** Unity launcher requires a <c>.desktop</c> file to work. For more
/// information, please read the Unity integration documentation.
/// </summary>
abstract setBadgeCount: ?count: float -> bool
/// <summary>
/// Sets or removes a custom Jump List for the application, and returns one of the
/// following strings:
///
/// * <c>ok</c> - Nothing went wrong.
/// * <c>error</c> - One or more errors occurred, enable runtime logging to figure out
/// the likely cause.
/// * <c>invalidSeparatorError</c> - An attempt was made to add a separator to a custom
/// category in the Jump List. Separators are only allowed in the standard <c>Tasks</c>
/// category.
/// * <c>fileTypeRegistrationError</c> - An attempt was made to add a file link to the
/// Jump List for a file type the app isn't registered to handle.
/// * <c>customCategoryAccessDeniedError</c> - Custom categories can't be added to the
/// Jump List due to user privacy or group policy settings.
///
/// If <c>categories</c> is <c>null</c> the previously set custom Jump List (if any) will be
/// replaced by the standard Jump List for the app (managed by Windows).
///
/// **Note:** If a <c>JumpListCategory</c> object has neither the <c>type</c> nor the <c>name</c>
/// property set then its <c>type</c> is assumed to be <c>tasks</c>. If the <c>name</c> property is
/// set but the <c>type</c> property is omitted then the <c>type</c> is assumed to be
/// <c>custom</c>.
///
/// **Note:** Users can remove items from custom categories, and Windows will not
/// allow a removed item to be added back into a custom category until **after** the
/// next successful call to <c>app.setJumpList(categories)</c>. Any attempt to re-add a
/// removed item to a custom category earlier than that will result in the entire
/// custom category being omitted from the Jump List. The list of removed items can
/// be obtained using <c>app.getJumpListSettings()</c>.
///
/// **Note:** The maximum length of a Jump List item's <c>description</c> property is 260
/// characters. Beyond this limit, the item will not be added to the Jump List, nor
/// will it be displayed.
///
/// Here's a very simple example of creating a custom Jump List:
/// </summary>
abstract setJumpList: categories: ResizeArray<JumpListCategory> option -> unit
/// <summary>
/// To work with Electron's <c>autoUpdater</c> on Windows, which uses Squirrel, you'll
/// want to set the launch path to Update.exe, and pass arguments that specify your
/// application name. For example:
/// </summary>
abstract setLoginItemSettings: settings: Settings -> unit
/// Overrides the current application's name.
///
/// **Note:** This function overrides the name used internally by Electron; it does
/// not affect the name that the OS uses.
abstract setName: name: string -> unit
/// <summary>
/// Overrides the <c>path</c> to a special directory or file associated with <c>name</c>. If
/// the path specifies a directory that does not exist, an <c>Error</c> is thrown. In
/// that case, the directory should be created with <c>fs.mkdirSync</c> or similar.
///
/// You can only override paths of a <c>name</c> defined in <c>app.getPath</c>.
///
/// By default, web pages' cookies and caches will be stored under the <c>userData</c>
/// directory. If you want to change this location, you have to override the
/// <c>userData</c> path before the <c>ready</c> event of the <c>app</c> module is emitted.
/// </summary>
abstract setPath: name: string * path: string -> unit
/// <summary>
/// Set the <c>Secure Keyboard Entry</c> is enabled in your application.
///
/// By using this API, important information such as password and other sensitive
/// information can be prevented from being intercepted by other processes.
///
/// See Apple's documentation for more details.
///
/// **Note:** Enable <c>Secure Keyboard Entry</c> only when it is needed and disable it
/// when it is no longer needed.
/// </summary>
abstract setSecureKeyboardEntryEnabled: enabled: bool -> unit
/// <summary>
/// Creates an <c>NSUserActivity</c> and sets it as the current activity. The activity is
/// eligible for Handoff to another device afterward.
/// </summary>
abstract setUserActivity: ``type``: string * userInfo: obj option * ?webpageURL: string -> unit
/// <summary>
/// Adds <c>tasks</c> to the Tasks category of the Jump List on Windows.
///
/// <c>tasks</c> is an array of <c>Task</c> objects.
///
/// Whether the call succeeded.
///
/// **Note:** If you'd like to customize the Jump List even more use