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
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
3508
3509
3510
3511
3512
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
3523
3524
3525
3526
3527
3528
3529
3530
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
3580
3581
3582
3583
3584
3585
3586
3587
3588
3589
3590
3591
3592
3593
3594
3595
3596
3597
3598
3599
3600
3601
3602
3603
3604
3605
3606
3607
3608
3609
3610
3611
3612
3613
3614
3615
3616
3617
3618
3619
3620
3621
3622
3623
3624
3625
3626
3627
3628
3629
3630
3631
3632
3633
3634
3635
3636
3637
3638
3639
3640
3641
3642
3643
3644
3645
3646
3647
3648
3649
3650
3651
3652
3653
3654
3655
3656
3657
3658
3659
3660
3661
3662
3663
3664
3665
3666
3667
3668
3669
3670
3671
3672
3673
3674
3675
3676
3677
3678
3679
3680
3681
3682
3683
3684
3685
3686
3687
3688
3689
3690
3691
3692
3693
3694
3695
3696
3697
3698
3699
3700
3701
3702
3703
3704
3705
3706
3707
3708
3709
3710
3711
3712
3713
3714
3715
3716
3717
3718
3719
3720
3721
3722
3723
3724
3725
3726
3727
3728
3729
3730
3731
3732
3733
3734
3735
3736
3737
3738
3739
3740
3741
3742
3743
3744
3745
3746
3747
3748
3749
3750
3751
3752
3753
3754
3755
3756
3757
3758
3759
3760
3761
3762
3763
3764
3765
3766
3767
3768
3769
3770
3771
3772
3773
3774
3775
3776
3777
3778
3779
3780
3781
3782
3783
3784
3785
3786
3787
3788
3789
3790
3791
3792
3793
3794
3795
3796
3797
3798
3799
3800
3801
3802
3803
3804
3805
3806
3807
3808
3809
3810
3811
3812
3813
3814
3815
3816
3817
3818
3819
3820
3821
3822
3823
3824
3825
3826
3827
3828
3829
3830
3831
3832
3833
3834
3835
3836
3837
3838
3839
3840
3841
3842
3843
3844
3845
3846
3847
3848
3849
3850
3851
3852
3853
3854
3855
3856
3857
3858
3859
3860
3861
3862
3863
3864
3865
3866
3867
3868
3869
3870
3871
3872
3873
3874
3875
3876
3877
3878
3879
3880
3881
3882
3883
3884
3885
3886
3887
3888
3889
3890
3891
3892
3893
3894
3895
3896
3897
3898
3899
3900
3901
3902
3903
3904
3905
3906
3907
3908
3909
3910
3911
3912
3913
3914
3915
3916
3917
3918
3919
3920
3921
3922
3923
3924
3925
3926
3927
3928
3929
3930
3931
3932
3933
3934
3935
3936
3937
3938
3939
3940
3941
3942
3943
3944
3945
3946
3947
3948
3949
3950
3951
3952
3953
3954
3955
3956
3957
3958
3959
3960
3961
3962
3963
3964
3965
3966
3967
3968
3969
3970
3971
3972
3973
3974
3975
3976
3977
3978
3979
3980
3981
3982
3983
3984
3985
3986
3987
3988
3989
3990
3991
3992
3993
3994
3995
3996
3997
3998
3999
4000
4001
4002
4003
4004
4005
4006
4007
4008
4009
4010
4011
4012
4013
4014
4015
4016
4017
4018
4019
4020
4021
4022
4023
4024
4025
4026
4027
4028
4029
4030
4031
4032
4033
4034
4035
4036
4037
4038
4039
4040
4041
4042
4043
4044
4045
4046
4047
4048
4049
4050
4051
4052
4053
4054
4055
4056
4057
4058
4059
4060
4061
4062
4063
4064
4065
4066
4067
4068
4069
4070
4071
4072
4073
4074
4075
4076
4077
4078
4079
4080
4081
4082
4083
4084
4085
4086
4087
4088
4089
4090
4091
4092
4093
4094
4095
4096
4097
4098
4099
4100
4101
4102
4103
4104
4105
4106
4107
4108
4109
4110
4111
4112
4113
4114
4115
4116
4117
4118
4119
4120
4121
4122
4123
4124
4125
4126
4127
4128
4129
4130
4131
4132
4133
4134
4135
4136
4137
4138
4139
4140
4141
4142
4143
4144
4145
4146
4147
4148
4149
4150
4151
4152
4153
4154
4155
4156
4157
4158
4159
4160
4161
4162
4163
4164
4165
4166
4167
4168
4169
4170
4171
4172
4173
4174
4175
4176
4177
4178
4179
4180
4181
4182
4183
4184
4185
4186
4187
4188
4189
4190
4191
4192
4193
4194
4195
4196
4197
4198
4199
4200
4201
4202
4203
4204
4205
4206
4207
4208
4209
4210
4211
4212
4213
4214
4215
4216
4217
4218
4219
4220
4221
4222
4223
4224
4225
4226
4227
4228
4229
4230
4231
4232
4233
4234
4235
4236
4237
4238
4239
4240
4241
4242
4243
4244
4245
4246
4247
4248
4249
4250
4251
4252
4253
4254
4255
4256
4257
4258
4259
4260
4261
4262
4263
4264
4265
4266
4267
4268
4269
4270
4271
4272
4273
4274
4275
4276
4277
4278
4279
4280
4281
4282
4283
4284
4285
4286
4287
4288
4289
4290
4291
4292
4293
4294
4295
4296
4297
4298
4299
4300
4301
4302
4303
4304
4305
4306
4307
4308
4309
4310
4311
4312
4313
4314
4315
4316
4317
4318
4319
4320
4321
4322
4323
4324
4325
4326
4327
4328
4329
4330
4331
4332
4333
4334
4335
4336
4337
4338
4339
4340
4341
4342
4343
4344
4345
4346
4347
4348
4349
4350
4351
4352
4353
4354
4355
4356
4357
4358
4359
4360
4361
4362
4363
4364
4365
4366
4367
4368
4369
4370
4371
4372
4373
4374
4375
4376
4377
4378
4379
4380
4381
4382
4383
4384
4385
4386
4387
4388
4389
4390
4391
4392
4393
4394
4395
4396
4397
4398
4399
4400
4401
4402
4403
4404
4405
4406
4407
4408
4409
4410
4411
4412
4413
4414
4415
4416
4417
4418
4419
4420
4421
4422
4423
4424
4425
4426
4427
4428
4429
4430
4431
4432
4433
4434
4435
4436
4437
4438
4439
4440
4441
4442
4443
4444
4445
4446
4447
4448
4449
4450
4451
4452
4453
4454
4455
4456
4457
4458
4459
4460
4461
4462
4463
4464
4465
4466
4467
4468
4469
4470
4471
4472
4473
4474
4475
4476
4477
4478
4479
4480
4481
4482
4483
4484
4485
4486
4487
4488
4489
4490
4491
4492
4493
4494
4495
4496
4497
4498
4499
4500
4501
4502
4503
4504
4505
4506
4507
4508
4509
4510
4511
4512
4513
4514
4515
4516
4517
4518
4519
4520
4521
4522
4523
4524
4525
4526
4527
4528
4529
4530
4531
4532
4533
4534
4535
4536
4537
4538
4539
4540
4541
4542
4543
4544
4545
4546
4547
4548
4549
4550
4551
4552
4553
4554
4555
4556
4557
4558
4559
4560
4561
4562
4563
4564
4565
4566
4567
4568
4569
4570
4571
4572
4573
4574
4575
4576
4577
4578
4579
4580
4581
4582
4583
4584
4585
4586
4587
4588
4589
4590
4591
4592
4593
4594
4595
4596
4597
4598
4599
4600
4601
4602
4603
4604
4605
4606
4607
4608
4609
4610
4611
4612
4613
4614
4615
4616
4617
4618
4619
4620
4621
4622
4623
4624
4625
4626
4627
4628
4629
4630
4631
4632
4633
4634
4635
4636
4637
4638
4639
4640
4641
4642
4643
4644
4645
4646
4647
4648
4649
4650
4651
4652
4653
4654
4655
4656
4657
4658
4659
4660
4661
4662
4663
4664
4665
4666
4667
4668
4669
4670
4671
4672
4673
4674
4675
4676
4677
4678
4679
4680
4681
4682
4683
4684
4685
4686
4687
4688
4689
4690
4691
4692
4693
4694
4695
4696
4697
4698
4699
4700
4701
4702
4703
4704
4705
4706
4707
4708
4709
4710
4711
4712
4713
4714
4715
4716
4717
4718
4719
4720
4721
4722
4723
4724
4725
4726
4727
4728
4729
4730
4731
4732
4733
4734
4735
4736
4737
4738
4739
4740
4741
4742
4743
4744
4745
4746
4747
4748
4749
4750
4751
4752
4753
4754
4755
4756
4757
4758
4759
4760
4761
4762
4763
4764
4765
4766
4767
4768
4769
4770
4771
4772
4773
4774
4775
4776
4777
4778
4779
4780
4781
4782
4783
4784
4785
4786
4787
4788
4789
4790
4791
4792
4793
4794
4795
4796
4797
4798
4799
4800
4801
4802
4803
4804
4805
4806
4807
4808
4809
4810
4811
4812
4813
4814
4815
4816
4817
4818
4819
4820
4821
4822
4823
4824
4825
4826
4827
4828
4829
4830
4831
4832
4833
4834
4835
4836
4837
4838
4839
4840
4841
4842
4843
4844
4845
4846
4847
4848
4849
4850
4851
4852
4853
4854
4855
4856
4857
4858
4859
4860
4861
4862
4863
4864
4865
4866
4867
4868
4869
4870
4871
4872
4873
4874
4875
4876
4877
4878
4879
4880
4881
4882
4883
4884
4885
4886
4887
4888
4889
4890
4891
4892
4893
4894
4895
4896
4897
4898
4899
4900
4901
4902
4903
4904
4905
4906
4907
4908
4909
4910
4911
4912
4913
4914
4915
4916
4917
4918
4919
4920
4921
4922
4923
4924
4925
4926
4927
4928
4929
4930
4931
4932
4933
4934
4935
4936
4937
4938
4939
4940
4941
4942
4943
4944
4945
4946
4947
4948
4949
4950
4951
4952
4953
4954
4955
4956
4957
4958
4959
4960
4961
4962
4963
4964
4965
4966
4967
4968
4969
4970
4971
4972
4973
4974
4975
4976
4977
4978
4979
4980
4981
4982
4983
4984
4985
4986
4987
4988
4989
4990
4991
4992
4993
4994
4995
4996
4997
4998
4999
5000
5001
5002
5003
5004
5005
5006
5007
5008
5009
5010
5011
5012
5013
5014
5015
5016
5017
5018
5019
5020
5021
5022
5023
5024
5025
5026
5027
5028
5029
5030
5031
5032
5033
5034
5035
5036
5037
5038
5039
5040
5041
5042
5043
5044
5045
5046
5047
5048
5049
5050
5051
5052
5053
5054
5055
5056
5057
5058
5059
5060
5061
5062
5063
5064
5065
5066
5067
5068
5069
5070
5071
5072
5073
5074
5075
5076
5077
5078
5079
5080
5081
5082
5083
5084
5085
5086
5087
5088
5089
5090
5091
5092
5093
5094
5095
5096
5097
5098
5099
5100
5101
5102
5103
5104
5105
5106
5107
5108
5109
5110
5111
5112
5113
5114
5115
5116
5117
5118
5119
5120
5121
5122
5123
5124
5125
5126
5127
5128
5129
5130
5131
5132
5133
5134
5135
5136
5137
5138
5139
5140
5141
5142
5143
5144
5145
5146
5147
5148
5149
5150
5151
5152
5153
5154
5155
5156
5157
5158
5159
5160
5161
5162
5163
5164
5165
5166
5167
5168
5169
5170
5171
5172
5173
5174
5175
5176
5177
5178
5179
5180
5181
5182
5183
5184
5185
5186
5187
5188
5189
5190
5191
5192
5193
5194
5195
5196
5197
5198
5199
5200
5201
5202
5203
5204
5205
5206
5207
5208
5209
5210
5211
5212
5213
5214
5215
5216
5217
5218
5219
5220
5221
5222
5223
5224
5225
5226
5227
5228
5229
5230
5231
5232
5233
5234
5235
5236
5237
5238
5239
5240
5241
5242
5243
5244
5245
5246
5247
5248
5249
5250
5251
5252
5253
5254
5255
5256
5257
5258
5259
5260
5261
5262
5263
5264
5265
5266
5267
5268
5269
5270
5271
5272
5273
5274
5275
5276
5277
5278
5279
5280
5281
5282
5283
5284
5285
5286
5287
5288
5289
5290
5291
5292
5293
5294
5295
5296
5297
5298
5299
5300
5301
5302
5303
5304
5305
5306
5307
5308
5309
5310
5311
5312
5313
5314
5315
5316
5317
5318
5319
5320
5321
5322
5323
5324
5325
5326
5327
5328
5329
5330
5331
5332
5333
5334
5335
5336
5337
5338
5339
5340
5341
5342
5343
5344
5345
5346
5347
5348
5349
5350
5351
5352
5353
5354
5355
5356
5357
5358
5359
5360
5361
5362
5363
5364
5365
5366
5367
5368
5369
5370
5371
5372
5373
5374
5375
5376
5377
5378
5379
5380
5381
5382
5383
5384
5385
5386
5387
5388
5389
5390
5391
5392
5393
5394
5395
5396
5397
5398
5399
5400
5401
5402
5403
5404
5405
5406
5407
5408
5409
5410
5411
5412
5413
5414
5415
5416
5417
5418
5419
5420
5421
5422
5423
5424
5425
5426
5427
5428
5429
5430
5431
5432
5433
5434
5435
5436
5437
5438
5439
5440
5441
5442
5443
5444
5445
5446
5447
5448
5449
5450
5451
5452
5453
5454
5455
5456
5457
5458
5459
5460
5461
5462
5463
5464
5465
5466
5467
5468
5469
5470
5471
5472
5473
5474
5475
5476
5477
5478
5479
5480
5481
5482
5483
5484
5485
5486
5487
5488
5489
5490
5491
5492
5493
5494
5495
5496
5497
5498
5499
5500
5501
5502
5503
5504
5505
5506
5507
5508
5509
5510
5511
5512
5513
5514
5515
5516
5517
5518
5519
5520
5521
5522
5523
5524
5525
5526
5527
5528
5529
5530
5531
5532
5533
5534
5535
5536
5537
5538
5539
5540
5541
5542
5543
5544
5545
5546
5547
5548
5549
5550
5551
5552
5553
5554
5555
5556
5557
5558
5559
5560
5561
5562
5563
5564
5565
5566
5567
5568
5569
5570
5571
5572
5573
5574
5575
5576
5577
5578
5579
5580
5581
5582
5583
5584
5585
5586
5587
5588
5589
5590
5591
5592
5593
5594
5595
5596
5597
5598
5599
5600
5601
5602
5603
5604
5605
5606
5607
5608
5609
5610
5611
5612
5613
5614
5615
5616
5617
5618
5619
5620
5621
5622
5623
5624
5625
5626
5627
5628
5629
5630
5631
5632
5633
5634
5635
5636
5637
5638
5639
5640
5641
5642
5643
5644
5645
5646
5647
5648
5649
5650
5651
5652
5653
5654
5655
5656
5657
5658
5659
5660
5661
5662
5663
5664
5665
5666
5667
5668
5669
5670
5671
5672
5673
5674
5675
5676
5677
5678
5679
5680
5681
5682
5683
5684
5685
5686
5687
5688
5689
5690
5691
5692
5693
5694
5695
5696
5697
5698
5699
5700
5701
5702
5703
5704
5705
5706
5707
5708
5709
5710
5711
5712
5713
5714
5715
5716
5717
5718
5719
5720
5721
5722
5723
5724
5725
5726
5727
5728
5729
5730
5731
5732
5733
5734
5735
5736
5737
5738
5739
5740
5741
5742
5743
5744
5745
5746
5747
5748
5749
5750
5751
5752
5753
5754
5755
5756
5757
5758
5759
5760
5761
5762
5763
5764
5765
5766
5767
5768
5769
5770
5771
5772
5773
5774
5775
5776
5777
5778
5779
5780
5781
5782
5783
5784
5785
5786
5787
5788
5789
5790
5791
5792
5793
5794
5795
5796
5797
5798
5799
5800
5801
5802
5803
5804
5805
5806
5807
5808
5809
5810
5811
5812
5813
5814
5815
5816
5817
5818
5819
5820
5821
5822
5823
5824
5825
5826
5827
5828
5829
5830
5831
5832
5833
5834
5835
5836
5837
5838
5839
5840
5841
5842
5843
5844
5845
5846
5847
5848
5849
5850
5851
5852
5853
5854
5855
5856
5857
5858
5859
5860
5861
5862
5863
5864
5865
5866
5867
5868
5869
5870
5871
5872
5873
5874
5875
5876
5877
5878
5879
5880
5881
5882
5883
5884
5885
5886
5887
5888
5889
5890
5891
5892
5893
5894
5895
5896
5897
5898
5899
5900
5901
5902
5903
5904
5905
5906
5907
5908
5909
5910
5911
5912
5913
5914
5915
5916
5917
5918
5919
5920
5921
5922
5923
5924
5925
5926
5927
5928
5929
5930
5931
5932
5933
5934
5935
5936
5937
5938
5939
5940
5941
5942
5943
5944
5945
5946
5947
5948
5949
5950
5951
5952
5953
5954
5955
5956
5957
5958
5959
5960
5961
5962
5963
5964
5965
5966
5967
5968
5969
5970
5971
5972
5973
5974
5975
5976
5977
5978
5979
5980
5981
5982
5983
5984
5985
5986
5987
5988
5989
5990
5991
5992
5993
5994
5995
5996
5997
5998
5999
6000
6001
6002
6003
6004
6005
6006
6007
6008
6009
6010
6011
6012
6013
6014
6015
6016
6017
6018
6019
6020
6021
6022
6023
6024
6025
6026
6027
6028
6029
6030
6031
6032
6033
6034
6035
6036
6037
6038
6039
6040
6041
6042
6043
6044
6045
6046
6047
6048
6049
6050
6051
6052
6053
6054
6055
6056
6057
6058
6059
6060
6061
6062
6063
6064
6065
6066
6067
6068
6069
6070
6071
6072
6073
6074
6075
6076
6077
6078
6079
6080
6081
6082
6083
6084
6085
6086
6087
6088
6089
6090
6091
6092
6093
6094
6095
6096
6097
6098
6099
6100
6101
6102
6103
6104
6105
6106
6107
6108
6109
6110
6111
6112
6113
6114
6115
6116
6117
6118
6119
6120
6121
6122
6123
6124
6125
6126
6127
6128
6129
6130
6131
6132
6133
6134
6135
6136
6137
6138
6139
6140
6141
6142
6143
6144
6145
6146
6147
6148
6149
6150
6151
6152
6153
6154
6155
6156
6157
6158
6159
6160
6161
6162
6163
6164
6165
6166
6167
6168
6169
6170
6171
6172
6173
6174
6175
6176
6177
6178
6179
6180
6181
6182
6183
6184
6185
6186
6187
6188
6189
6190
6191
6192
6193
6194
6195
6196
6197
6198
6199
6200
6201
6202
6203
6204
6205
6206
6207
6208
6209
6210
6211
6212
6213
6214
6215
6216
6217
6218
6219
6220
6221
6222
6223
6224
6225
6226
6227
6228
6229
6230
6231
6232
6233
6234
6235
6236
6237
6238
6239
6240
6241
6242
6243
6244
6245
6246
6247
6248
6249
6250
6251
6252
6253
6254
6255
6256
6257
6258
6259
6260
6261
6262
6263
6264
6265
6266
6267
6268
6269
6270
6271
6272
6273
6274
6275
6276
6277
6278
6279
6280
6281
6282
6283
6284
6285
6286
6287
6288
6289
6290
6291
6292
6293
6294
6295
6296
6297
6298
6299
6300
6301
6302
6303
6304
6305
6306
6307
6308
6309
6310
6311
6312
6313
6314
6315
6316
6317
6318
6319
6320
6321
6322
6323
6324
6325
6326
6327
6328
6329
6330
6331
6332
6333
6334
6335
6336
6337
6338
6339
6340
6341
6342
6343
6344
6345
6346
6347
6348
6349
6350
6351
6352
6353
6354
6355
6356
6357
6358
6359
6360
6361
6362
6363
6364
6365
6366
6367
6368
6369
6370
6371
6372
6373
6374
6375
6376
6377
6378
6379
6380
6381
6382
6383
6384
6385
6386
6387
6388
6389
6390
6391
6392
6393
6394
6395
6396
6397
6398
6399
6400
6401
6402
6403
6404
6405
6406
6407
6408
6409
6410
6411
6412
6413
6414
6415
6416
6417
6418
6419
6420
6421
6422
6423
6424
6425
6426
6427
6428
6429
6430
6431
6432
6433
6434
6435
6436
6437
6438
6439
6440
6441
6442
6443
6444
6445
6446
6447
6448
6449
6450
6451
6452
6453
6454
6455
6456
6457
6458
6459
6460
6461
6462
6463
6464
6465
6466
6467
6468
6469
6470
6471
6472
6473
6474
6475
6476
6477
6478
6479
6480
6481
6482
6483
6484
6485
6486
6487
6488
6489
6490
6491
6492
6493
6494
6495
6496
6497
6498
6499
6500
6501
6502
6503
6504
6505
6506
6507
6508
6509
6510
6511
6512
6513
6514
6515
6516
6517
6518
6519
6520
6521
6522
6523
6524
6525
6526
6527
6528
6529
6530
6531
6532
6533
6534
6535
6536
6537
6538
6539
6540
6541
6542
6543
6544
6545
6546
6547
6548
6549
6550
6551
6552
6553
6554
6555
6556
6557
6558
6559
6560
6561
6562
6563
6564
6565
6566
6567
6568
6569
6570
6571
6572
6573
6574
6575
6576
6577
6578
6579
6580
6581
6582
6583
6584
6585
6586
6587
6588
6589
6590
6591
6592
6593
6594
6595
6596
6597
6598
6599
6600
6601
6602
6603
6604
6605
6606
6607
6608
6609
6610
6611
6612
6613
6614
6615
6616
6617
6618
6619
6620
6621
6622
6623
6624
6625
6626
6627
6628
6629
6630
6631
6632
6633
6634
6635
6636
6637
6638
6639
6640
6641
6642
6643
6644
6645
6646
6647
6648
6649
6650
6651
6652
6653
6654
6655
6656
6657
6658
6659
6660
6661
6662
6663
6664
6665
6666
6667
6668
6669
6670
6671
6672
6673
6674
6675
6676
6677
6678
6679
6680
6681
6682
6683
6684
6685
6686
6687
6688
6689
6690
6691
6692
6693
6694
6695
6696
6697
6698
6699
6700
6701
6702
6703
6704
6705
6706
6707
6708
6709
6710
6711
6712
6713
6714
6715
6716
6717
6718
6719
6720
6721
6722
6723
6724
6725
6726
6727
6728
6729
6730
6731
6732
6733
6734
6735
6736
6737
6738
6739
6740
6741
6742
6743
6744
6745
6746
6747
6748
6749
6750
6751
6752
6753
6754
6755
6756
6757
6758
6759
6760
6761
6762
6763
6764
6765
6766
6767
6768
6769
6770
6771
6772
6773
6774
6775
6776
6777
6778
6779
6780
6781
6782
6783
6784
6785
6786
6787
6788
6789
6790
6791
6792
6793
6794
6795
6796
6797
6798
6799
6800
6801
6802
6803
6804
6805
6806
6807
6808
6809
6810
6811
6812
6813
6814
6815
6816
6817
6818
6819
6820
6821
6822
6823
6824
6825
6826
6827
6828
6829
6830
6831
6832
6833
6834
6835
6836
6837
6838
6839
6840
6841
6842
6843
6844
6845
6846
6847
6848
6849
6850
6851
6852
6853
6854
6855
6856
6857
6858
6859
6860
6861
6862
6863
6864
6865
6866
6867
6868
6869
6870
6871
6872
6873
6874
6875
6876
6877
6878
6879
6880
6881
6882
6883
6884
6885
6886
6887
6888
6889
6890
6891
6892
6893
6894
6895
6896
6897
6898
6899
6900
6901
6902
6903
6904
6905
6906
6907
6908
6909
6910
6911
6912
6913
6914
6915
6916
6917
6918
6919
6920
6921
6922
6923
6924
6925
6926
6927
6928
6929
6930
6931
6932
6933
6934
6935
6936
6937
6938
6939
6940
6941
6942
6943
6944
6945
6946
6947
6948
6949
6950
6951
6952
6953
6954
6955
6956
6957
6958
6959
6960
6961
6962
6963
6964
6965
6966
6967
6968
6969
6970
6971
6972
6973
6974
6975
6976
6977
6978
6979
6980
6981
6982
6983
6984
6985
6986
6987
6988
6989
6990
6991
6992
6993
6994
6995
6996
6997
6998
6999
7000
7001
7002
7003
7004
7005
7006
7007
7008
7009
7010
7011
7012
7013
7014
7015
7016
7017
7018
7019
7020
7021
7022
7023
7024
7025
7026
7027
7028
7029
7030
7031
7032
7033
7034
7035
7036
7037
7038
7039
7040
7041
7042
7043
7044
7045
7046
7047
7048
7049
7050
7051
7052
7053
7054
7055
7056
7057
7058
7059
7060
7061
7062
7063
7064
7065
7066
7067
7068
7069
7070
7071
7072
7073
7074
7075
7076
7077
7078
7079
7080
7081
7082
7083
7084
7085
7086
7087
7088
7089
7090
7091
7092
7093
7094
7095
7096
7097
7098
7099
7100
7101
7102
7103
7104
7105
7106
7107
7108
7109
7110
7111
7112
7113
7114
7115
7116
7117
7118
7119
7120
7121
7122
7123
7124
7125
7126
7127
7128
7129
7130
7131
7132
7133
7134
7135
7136
7137
7138
7139
7140
7141
7142
7143
7144
7145
7146
7147
7148
7149
7150
7151
7152
7153
7154
7155
7156
7157
7158
7159
7160
7161
7162
7163
7164
7165
7166
7167
7168
7169
7170
7171
7172
7173
7174
7175
7176
7177
7178
7179
7180
7181
7182
7183
7184
7185
7186
7187
7188
7189
7190
7191
7192
7193
7194
7195
7196
7197
7198
7199
7200
7201
7202
7203
7204
7205
7206
7207
7208
7209
7210
7211
7212
7213
7214
7215
7216
7217
7218
7219
7220
7221
7222
7223
7224
7225
7226
7227
7228
7229
7230
7231
7232
7233
7234
7235
7236
7237
7238
7239
7240
7241
7242
7243
7244
7245
7246
7247
7248
7249
7250
7251
7252
7253
7254
7255
7256
7257
7258
7259
7260
7261
7262
7263
7264
7265
7266
7267
7268
7269
7270
7271
7272
7273
7274
7275
7276
7277
7278
7279
7280
7281
7282
7283
7284
7285
7286
7287
7288
7289
7290
7291
7292
7293
7294
7295
7296
7297
7298
7299
7300
7301
7302
7303
7304
7305
7306
7307
7308
7309
7310
7311
7312
7313
7314
7315
7316
7317
7318
7319
7320
7321
7322
7323
7324
7325
7326
7327
7328
7329
7330
7331
7332
7333
7334
7335
7336
7337
7338
7339
7340
7341
7342
7343
7344
7345
7346
7347
7348
7349
7350
7351
7352
7353
7354
7355
7356
7357
7358
7359
7360
7361
7362
7363
7364
7365
7366
7367
7368
7369
7370
7371
7372
7373
7374
7375
7376
7377
7378
7379
7380
7381
7382
7383
7384
7385
7386
7387
7388
7389
7390
7391
7392
7393
7394
7395
7396
7397
7398
7399
7400
7401
7402
7403
7404
7405
7406
7407
7408
7409
7410
7411
7412
7413
7414
7415
7416
7417
7418
7419
7420
7421
7422
7423
7424
7425
7426
7427
7428
7429
7430
7431
7432
7433
7434
7435
7436
7437
7438
7439
7440
7441
7442
7443
7444
7445
7446
7447
7448
7449
7450
7451
7452
7453
7454
7455
7456
7457
7458
7459
7460
7461
7462
7463
7464
7465
7466
7467
7468
7469
7470
7471
7472
7473
7474
7475
7476
7477
7478
7479
7480
7481
7482
7483
7484
7485
7486
7487
7488
7489
7490
7491
7492
7493
7494
7495
7496
7497
7498
7499
7500
7501
7502
7503
7504
7505
7506
7507
7508
7509
7510
7511
7512
7513
7514
7515
7516
7517
7518
7519
7520
7521
7522
7523
7524
7525
7526
7527
7528
7529
7530
7531
7532
7533
7534
7535
7536
7537
7538
7539
7540
7541
7542
7543
7544
7545
7546
7547
7548
7549
7550
7551
7552
7553
7554
7555
7556
7557
7558
7559
7560
7561
7562
7563
7564
7565
7566
7567
7568
7569
7570
7571
7572
7573
7574
7575
7576
7577
7578
7579
7580
7581
7582
7583
7584
7585
7586
7587
7588
7589
7590
7591
7592
7593
7594
7595
7596
7597
7598
7599
7600
7601
7602
7603
7604
7605
7606
7607
7608
7609
7610
7611
7612
7613
7614
7615
7616
7617
7618
7619
7620
7621
7622
7623
7624
7625
7626
7627
7628
7629
7630
7631
7632
7633
7634
7635
7636
7637
7638
7639
7640
7641
7642
7643
7644
7645
7646
7647
7648
7649
7650
7651
7652
7653
7654
7655
7656
7657
7658
7659
7660
7661
7662
7663
7664
7665
7666
7667
7668
7669
7670
7671
7672
7673
7674
7675
7676
7677
7678
7679
7680
7681
7682
7683
7684
7685
7686
7687
7688
7689
7690
7691
7692
7693
7694
7695
7696
7697
7698
7699
7700
7701
7702
7703
7704
7705
7706
7707
7708
7709
7710
7711
7712
7713
7714
7715
7716
7717
7718
7719
7720
7721
7722
7723
7724
7725
7726
7727
7728
7729
7730
7731
7732
7733
7734
7735
7736
7737
7738
7739
7740
7741
7742
7743
7744
7745
7746
7747
7748
7749
7750
7751
7752
7753
7754
7755
7756
7757
7758
7759
7760
7761
7762
7763
7764
7765
7766
7767
7768
7769
7770
7771
7772
7773
7774
7775
7776
7777
7778
7779
7780
7781
7782
7783
7784
7785
7786
7787
7788
7789
7790
7791
7792
7793
7794
7795
7796
7797
7798
7799
7800
7801
7802
7803
7804
7805
7806
7807
7808
7809
7810
7811
7812
7813
7814
7815
7816
7817
7818
7819
7820
7821
7822
7823
7824
7825
7826
7827
7828
7829
7830
7831
7832
7833
7834
7835
7836
7837
7838
7839
7840
7841
7842
7843
7844
7845
7846
7847
7848
7849
7850
7851
7852
7853
7854
7855
7856
7857
7858
7859
7860
7861
7862
7863
7864
7865
7866
7867
7868
7869
7870
7871
7872
7873
7874
7875
7876
7877
7878
7879
7880
7881
7882
7883
7884
7885
7886
7887
7888
7889
7890
7891
7892
7893
7894
7895
7896
7897
7898
7899
7900
7901
7902
7903
7904
7905
7906
7907
7908
7909
7910
7911
7912
7913
7914
7915
7916
7917
7918
7919
7920
7921
7922
7923
7924
7925
7926
7927
7928
7929
7930
7931
7932
7933
7934
7935
7936
7937
7938
7939
7940
7941
7942
7943
7944
7945
7946
7947
7948
7949
7950
7951
7952
7953
7954
7955
7956
7957
7958
7959
7960
7961
7962
7963
7964
7965
7966
7967
7968
7969
7970
7971
7972
7973
7974
7975
7976
7977
7978
7979
7980
7981
7982
7983
7984
7985
7986
7987
7988
7989
7990
7991
7992
7993
7994
7995
7996
7997
7998
7999
8000
8001
8002
8003
8004
8005
8006
8007
8008
8009
8010
8011
8012
8013
8014
8015
8016
8017
8018
8019
8020
8021
8022
8023
8024
8025
8026
8027
8028
8029
8030
8031
8032
8033
8034
8035
8036
8037
8038
8039
8040
8041
8042
8043
8044
8045
8046
8047
8048
8049
8050
8051
8052
8053
8054
8055
8056
8057
8058
8059
8060
8061
8062
8063
8064
8065
8066
8067
8068
8069
8070
8071
8072
8073
8074
8075
8076
8077
8078
8079
8080
8081
8082
8083
8084
8085
8086
8087
8088
8089
8090
8091
8092
8093
8094
8095
8096
8097
8098
8099
8100
8101
8102
8103
8104
8105
8106
8107
8108
8109
8110
8111
8112
8113
8114
8115
8116
8117
8118
8119
8120
8121
8122
8123
8124
8125
8126
8127
8128
8129
8130
8131
8132
8133
8134
8135
8136
8137
8138
8139
8140
8141
8142
8143
8144
8145
8146
8147
8148
8149
8150
8151
8152
8153
8154
8155
8156
8157
8158
8159
8160
8161
8162
8163
8164
8165
8166
8167
8168
8169
8170
8171
8172
8173
8174
8175
8176
8177
8178
8179
8180
8181
8182
8183
8184
8185
8186
8187
8188
8189
8190
8191
8192
8193
8194
8195
8196
8197
8198
8199
8200
8201
8202
8203
8204
8205
8206
8207
8208
8209
8210
8211
8212
8213
8214
8215
8216
8217
8218
8219
8220
8221
8222
8223
8224
8225
8226
8227
8228
8229
8230
8231
8232
8233
8234
8235
8236
8237
8238
8239
8240
8241
8242
8243
8244
8245
8246
8247
8248
8249
8250
8251
8252
8253
8254
8255
8256
8257
8258
8259
8260
8261
8262
8263
8264
8265
8266
8267
8268
8269
8270
8271
8272
8273
8274
8275
8276
8277
8278
8279
8280
8281
8282
8283
8284
8285
8286
8287
8288
8289
8290
8291
8292
8293
8294
8295
8296
8297
8298
8299
8300
8301
8302
8303
8304
8305
8306
8307
8308
8309
8310
8311
8312
8313
8314
8315
8316
8317
8318
8319
8320
8321
8322
8323
8324
8325
8326
8327
8328
8329
8330
8331
8332
8333
8334
8335
8336
8337
8338
8339
8340
8341
8342
8343
8344
8345
8346
8347
8348
8349
8350
8351
8352
8353
8354
8355
8356
8357
8358
8359
8360
8361
8362
8363
8364
8365
8366
8367
8368
8369
8370
8371
8372
8373
8374
8375
8376
8377
8378
8379
8380
8381
8382
8383
8384
8385
8386
8387
8388
8389
8390
8391
8392
8393
8394
8395
8396
8397
8398
8399
8400
8401
8402
8403
8404
8405
8406
8407
8408
8409
8410
8411
8412
8413
8414
8415
8416
8417
8418
8419
8420
8421
8422
8423
8424
8425
8426
8427
8428
8429
8430
8431
8432
8433
8434
8435
8436
8437
8438
8439
8440
8441
8442
8443
8444
8445
8446
8447
8448
8449
8450
8451
8452
8453
8454
8455
8456
8457
8458
8459
8460
8461
8462
8463
8464
8465
8466
8467
8468
8469
8470
8471
8472
8473
8474
8475
8476
8477
8478
8479
8480
8481
8482
8483
8484
8485
8486
8487
8488
8489
8490
8491
8492
8493
8494
8495
8496
8497
8498
8499
8500
8501
8502
8503
8504
8505
8506
8507
8508
8509
8510
8511
8512
8513
8514
8515
8516
8517
8518
8519
8520
8521
8522
8523
8524
8525
8526
8527
8528
8529
8530
8531
8532
8533
8534
8535
8536
8537
8538
8539
8540
8541
8542
8543
8544
8545
8546
8547
8548
8549
8550
8551
8552
8553
8554
8555
8556
8557
8558
8559
8560
8561
8562
8563
8564
8565
8566
8567
8568
8569
8570
8571
8572
8573
8574
8575
8576
8577
8578
8579
8580
8581
8582
8583
8584
8585
8586
8587
8588
8589
8590
8591
8592
8593
8594
8595
8596
8597
8598
8599
8600
8601
8602
8603
8604
8605
8606
8607
8608
8609
8610
8611
8612
8613
8614
8615
8616
8617
8618
8619
8620
8621
8622
8623
8624
8625
8626
8627
8628
8629
8630
8631
8632
8633
8634
8635
8636
8637
8638
8639
8640
8641
8642
8643
8644
8645
8646
8647
8648
8649
8650
8651
8652
8653
8654
8655
8656
8657
8658
8659
8660
8661
8662
8663
8664
8665
8666
8667
8668
8669
8670
8671
8672
8673
8674
8675
8676
8677
8678
8679
8680
8681
8682
8683
8684
8685
8686
8687
8688
8689
8690
8691
8692
8693
8694
8695
8696
8697
8698
8699
8700
8701
8702
8703
8704
8705
8706
8707
8708
8709
8710
8711
8712
8713
8714
8715
8716
8717
8718
8719
8720
8721
8722
8723
8724
8725
8726
8727
8728
8729
8730
8731
8732
8733
8734
8735
8736
8737
8738
8739
8740
8741
8742
8743
8744
8745
8746
8747
8748
8749
8750
8751
8752
8753
8754
8755
8756
8757
8758
8759
8760
8761
8762
8763
8764
8765
8766
8767
8768
8769
8770
8771
8772
8773
8774
8775
8776
8777
8778
8779
8780
8781
8782
8783
8784
8785
8786
8787
8788
8789
8790
8791
8792
8793
8794
8795
8796
8797
8798
8799
8800
8801
8802
8803
8804
8805
8806
8807
8808
8809
8810
8811
8812
8813
8814
8815
8816
8817
8818
8819
8820
8821
8822
8823
8824
8825
8826
8827
8828
8829
8830
8831
8832
8833
8834
8835
8836
8837
8838
8839
8840
8841
8842
8843
8844
8845
8846
8847
8848
8849
8850
8851
8852
8853
8854
8855
8856
8857
8858
8859
8860
8861
8862
8863
8864
8865
8866
8867
8868
8869
8870
8871
8872
8873
8874
8875
8876
8877
8878
8879
8880
8881
8882
8883
8884
8885
8886
8887
8888
8889
8890
8891
8892
8893
8894
8895
8896
8897
8898
8899
8900
8901
8902
8903
8904
8905
8906
8907
8908
8909
8910
8911
8912
8913
8914
8915
8916
8917
8918
8919
8920
8921
8922
8923
8924
8925
8926
8927
8928
8929
8930
8931
8932
8933
8934
8935
8936
8937
8938
8939
8940
8941
8942
8943
8944
8945
8946
8947
8948
8949
8950
8951
8952
8953
8954
8955
8956
8957
8958
8959
8960
8961
8962
8963
8964
8965
8966
8967
8968
8969
8970
8971
8972
8973
8974
8975
8976
8977
8978
8979
8980
8981
8982
8983
8984
8985
8986
8987
8988
8989
8990
8991
8992
8993
8994
8995
8996
8997
8998
8999
9000
9001
9002
9003
9004
9005
9006
9007
9008
9009
9010
9011
9012
9013
9014
9015
9016
9017
9018
9019
9020
9021
9022
9023
9024
9025
9026
9027
9028
9029
9030
9031
9032
9033
9034
9035
9036
9037
9038
9039
9040
9041
9042
9043
9044
9045
9046
9047
9048
9049
9050
9051
9052
9053
9054
9055
9056
9057
9058
9059
9060
9061
9062
9063
9064
9065
9066
9067
9068
9069
9070
9071
9072
9073
9074
9075
9076
9077
9078
9079
9080
9081
9082
9083
9084
9085
9086
9087
9088
9089
9090
9091
9092
9093
9094
9095
9096
9097
9098
9099
9100
9101
9102
9103
9104
9105
9106
9107
9108
9109
9110
9111
9112
9113
9114
9115
9116
9117
9118
9119
9120
9121
9122
9123
9124
9125
9126
9127
9128
9129
9130
9131
9132
9133
9134
9135
9136
9137
9138
9139
9140
9141
9142
9143
9144
9145
9146
9147
9148
9149
9150
9151
9152
9153
9154
9155
9156
9157
9158
9159
9160
9161
9162
9163
9164
9165
9166
9167
9168
9169
9170
9171
9172
9173
9174
9175
9176
9177
9178
9179
9180
9181
9182
9183
9184
9185
9186
9187
9188
9189
9190
9191
9192
9193
9194
9195
9196
9197
9198
9199
9200
9201
9202
9203
9204
9205
9206
9207
9208
9209
9210
9211
9212
9213
9214
9215
9216
9217
9218
9219
9220
9221
9222
9223
9224
9225
9226
9227
9228
9229
9230
9231
9232
9233
9234
9235
9236
9237
9238
9239
9240
9241
9242
9243
9244
9245
9246
9247
9248
9249
9250
9251
9252
9253
9254
9255
9256
9257
9258
9259
9260
9261
9262
9263
9264
9265
9266
9267
9268
9269
9270
9271
9272
9273
9274
9275
9276
9277
9278
9279
9280
9281
9282
9283
9284
9285
9286
9287
9288
9289
9290
9291
9292
9293
9294
9295
9296
9297
9298
9299
9300
9301
9302
9303
9304
9305
9306
9307
9308
9309
9310
9311
9312
9313
9314
9315
9316
9317
9318
9319
9320
9321
9322
9323
9324
9325
9326
9327
9328
9329
9330
9331
9332
9333
9334
9335
9336
9337
9338
9339
9340
9341
9342
9343
9344
9345
9346
9347
9348
9349
9350
9351
9352
9353
9354
9355
9356
9357
9358
9359
9360
9361
9362
9363
9364
9365
9366
9367
9368
9369
9370
9371
9372
9373
9374
9375
9376
9377
9378
9379
9380
9381
9382
9383
9384
9385
9386
9387
9388
9389
9390
9391
9392
9393
9394
9395
9396
9397
9398
9399
9400
9401
9402
9403
9404
9405
9406
9407
9408
9409
9410
9411
9412
9413
9414
9415
9416
9417
9418
9419
9420
9421
9422
9423
9424
9425
9426
9427
9428
9429
9430
9431
9432
9433
9434
9435
9436
9437
9438
9439
9440
9441
9442
9443
9444
9445
9446
9447
9448
9449
9450
9451
9452
9453
9454
9455
9456
9457
9458
9459
9460
9461
9462
9463
9464
9465
9466
9467
9468
9469
9470
9471
9472
9473
9474
9475
9476
9477
9478
9479
9480
9481
9482
9483
9484
9485
9486
9487
9488
9489
9490
9491
9492
9493
9494
9495
9496
9497
9498
9499
9500
9501
9502
9503
9504
9505
9506
9507
9508
9509
9510
9511
9512
9513
9514
9515
9516
9517
9518
9519
9520
9521
9522
9523
9524
9525
9526
9527
9528
9529
9530
9531
9532
9533
9534
9535
9536
9537
9538
9539
9540
9541
9542
9543
9544
9545
9546
9547
9548
9549
9550
9551
9552
9553
9554
9555
9556
9557
9558
9559
9560
9561
9562
9563
9564
9565
9566
9567
9568
9569
9570
9571
9572
9573
9574
9575
9576
9577
9578
9579
9580
9581
9582
9583
9584
9585
9586
9587
9588
9589
9590
9591
9592
9593
9594
9595
9596
9597
9598
9599
9600
9601
9602
9603
9604
9605
9606
9607
9608
9609
9610
9611
9612
9613
9614
9615
9616
9617
9618
9619
9620
9621
9622
9623
9624
9625
9626
9627
9628
9629
9630
9631
9632
9633
9634
9635
9636
9637
9638
9639
9640
9641
9642
9643
9644
9645
9646
9647
9648
9649
9650
9651
9652
9653
9654
9655
9656
9657
9658
9659
9660
9661
9662
9663
9664
9665
9666
9667
9668
9669
9670
9671
9672
9673
9674
9675
9676
9677
9678
9679
9680
9681
9682
9683
9684
9685
9686
9687
9688
9689
9690
9691
9692
9693
9694
9695
9696
9697
9698
9699
9700
9701
9702
9703
9704
9705
9706
9707
9708
9709
9710
9711
9712
9713
9714
9715
9716
9717
9718
9719
9720
9721
9722
9723
9724
9725
9726
9727
9728
9729
9730
9731
9732
9733
9734
9735
9736
9737
9738
9739
9740
9741
9742
9743
9744
9745
9746
9747
9748
9749
9750
9751
9752
9753
9754
9755
9756
9757
9758
9759
9760
9761
9762
9763
9764
9765
9766
9767
9768
9769
9770
9771
9772
9773
9774
9775
9776
9777
9778
9779
9780
9781
9782
9783
9784
9785
9786
9787
9788
9789
9790
9791
9792
9793
9794
9795
9796
9797
9798
9799
9800
9801
9802
9803
9804
9805
9806
9807
9808
9809
9810
9811
9812
9813
9814
9815
9816
9817
9818
9819
9820
9821
9822
9823
9824
9825
9826
9827
9828
9829
9830
9831
9832
9833
9834
9835
9836
9837
9838
9839
9840
9841
9842
9843
9844
9845
9846
9847
9848
9849
9850
9851
9852
9853
9854
9855
9856
9857
9858
9859
9860
9861
9862
9863
9864
9865
9866
9867
9868
9869
9870
9871
9872
9873
9874
9875
9876
9877
9878
9879
9880
9881
9882
9883
9884
9885
9886
9887
9888
9889
9890
9891
9892
9893
9894
9895
9896
9897
9898
9899
9900
9901
9902
9903
9904
9905
9906
9907
9908
9909
9910
9911
9912
9913
9914
9915
9916
9917
9918
9919
9920
9921
9922
9923
9924
9925
9926
9927
9928
9929
9930
9931
9932
9933
9934
9935
9936
9937
9938
9939
9940
9941
9942
9943
9944
9945
9946
9947
9948
9949
9950
9951
9952
9953
9954
9955
9956
9957
9958
9959
9960
9961
9962
9963
9964
9965
9966
9967
9968
9969
9970
9971
9972
9973
9974
9975
9976
9977
9978
9979
9980
9981
9982
9983
9984
9985
9986
9987
9988
9989
9990
9991
9992
9993
9994
9995
9996
9997
9998
9999
10000
10001
10002
10003
10004
10005
10006
10007
10008
10009
10010
10011
10012
10013
10014
10015
10016
10017
10018
10019
10020
10021
10022
10023
10024
10025
10026
10027
10028
10029
10030
10031
10032
10033
10034
10035
10036
10037
10038
10039
10040
10041
10042
10043
10044
10045
10046
10047
10048
10049
10050
10051
10052
10053
10054
10055
10056
10057
10058
10059
10060
10061
10062
10063
10064
10065
10066
10067
10068
10069
10070
10071
10072
10073
10074
10075
10076
10077
10078
10079
10080
10081
10082
10083
10084
10085
10086
10087
10088
10089
10090
10091
10092
10093
10094
10095
10096
10097
10098
10099
10100
10101
10102
10103
10104
10105
10106
10107
10108
10109
10110
10111
10112
10113
10114
10115
10116
10117
10118
10119
10120
10121
10122
10123
10124
10125
10126
10127
10128
10129
10130
10131
10132
10133
10134
10135
10136
10137
10138
10139
10140
10141
10142
10143
10144
10145
10146
10147
10148
10149
10150
10151
10152
10153
10154
10155
10156
10157
10158
10159
10160
10161
10162
10163
10164
10165
10166
10167
10168
10169
10170
10171
10172
10173
10174
10175
10176
10177
10178
10179
10180
10181
10182
10183
10184
10185
10186
10187
10188
10189
10190
10191
10192
10193
10194
10195
10196
10197
10198
10199
10200
10201
10202
10203
10204
10205
10206
10207
10208
10209
10210
10211
10212
10213
10214
10215
10216
10217
10218
10219
10220
10221
10222
10223
10224
10225
10226
10227
10228
10229
10230
10231
10232
10233
10234
10235
10236
10237
10238
10239
10240
10241
10242
10243
10244
10245
10246
10247
10248
10249
10250
10251
10252
10253
10254
10255
10256
10257
10258
10259
10260
10261
10262
10263
10264
10265
10266
10267
10268
10269
10270
10271
10272
10273
10274
10275
10276
10277
10278
10279
10280
10281
10282
10283
10284
10285
10286
10287
10288
10289
10290
10291
10292
10293
10294
10295
10296
10297
10298
10299
10300
10301
10302
10303
10304
10305
10306
10307
10308
10309
10310
10311
10312
10313
10314
10315
10316
10317
10318
10319
10320
10321
10322
10323
10324
10325
10326
10327
10328
10329
10330
10331
10332
10333
10334
10335
10336
10337
10338
10339
10340
10341
10342
10343
10344
10345
10346
10347
10348
10349
10350
10351
10352
10353
10354
10355
10356
10357
10358
10359
10360
10361
10362
10363
10364
10365
10366
10367
10368
10369
10370
10371
10372
10373
10374
10375
10376
10377
10378
10379
10380
10381
10382
10383
10384
10385
10386
10387
10388
10389
10390
10391
10392
10393
10394
10395
10396
10397
10398
10399
10400
10401
10402
10403
10404
10405
10406
10407
10408
10409
10410
10411
10412
10413
10414
10415
10416
10417
10418
10419
10420
10421
10422
10423
10424
10425
10426
10427
10428
10429
10430
10431
10432
10433
10434
10435
10436
10437
10438
10439
10440
10441
10442
10443
10444
10445
10446
10447
10448
10449
10450
10451
10452
10453
10454
10455
10456
10457
10458
10459
10460
10461
10462
10463
10464
10465
10466
10467
10468
10469
10470
10471
10472
10473
10474
10475
10476
10477
10478
10479
10480
10481
10482
10483
10484
10485
10486
10487
10488
10489
10490
10491
10492
10493
10494
10495
10496
10497
10498
10499
10500
10501
10502
10503
10504
10505
10506
10507
10508
10509
10510
10511
10512
10513
10514
10515
10516
10517
10518
10519
10520
10521
10522
10523
10524
10525
10526
10527
10528
10529
10530
10531
10532
10533
10534
10535
10536
10537
10538
10539
10540
10541
10542
10543
10544
10545
10546
10547
10548
10549
10550
10551
10552
10553
10554
10555
10556
10557
10558
10559
10560
10561
10562
10563
10564
10565
10566
10567
10568
10569
10570
10571
10572
10573
10574
10575
10576
10577
10578
10579
10580
10581
10582
10583
10584
10585
10586
10587
10588
10589
10590
10591
10592
10593
10594
10595
10596
10597
10598
10599
10600
10601
10602
10603
10604
10605
10606
10607
10608
10609
10610
10611
10612
10613
10614
10615
10616
10617
10618
10619
10620
10621
10622
10623
10624
10625
10626
10627
10628
10629
10630
10631
10632
10633
10634
10635
10636
10637
10638
10639
10640
10641
10642
10643
10644
10645
10646
10647
10648
10649
10650
10651
10652
10653
10654
10655
10656
10657
10658
10659
10660
10661
10662
10663
10664
10665
10666
10667
10668
10669
10670
10671
10672
10673
10674
10675
10676
10677
10678
10679
10680
10681
10682
10683
10684
10685
10686
10687
10688
10689
10690
10691
10692
10693
10694
10695
10696
10697
10698
10699
10700
10701
10702
10703
10704
10705
10706
10707
10708
10709
10710
10711
10712
10713
10714
10715
10716
10717
10718
10719
10720
10721
10722
10723
10724
10725
10726
10727
10728
10729
10730
10731
10732
10733
10734
10735
10736
10737
10738
10739
10740
10741
10742
10743
10744
10745
10746
10747
10748
10749
10750
10751
10752
10753
10754
10755
10756
10757
10758
10759
10760
10761
10762
10763
10764
10765
10766
10767
10768
10769
10770
10771
10772
10773
10774
10775
10776
10777
10778
10779
10780
10781
10782
10783
10784
10785
10786
10787
10788
10789
10790
10791
10792
10793
10794
10795
10796
10797
10798
10799
10800
10801
10802
10803
10804
10805
10806
10807
10808
10809
10810
10811
10812
10813
10814
10815
10816
10817
10818
10819
10820
10821
10822
10823
10824
10825
10826
10827
10828
10829
10830
10831
10832
10833
10834
10835
10836
10837
10838
10839
10840
10841
10842
10843
10844
10845
10846
10847
10848
10849
10850
10851
10852
10853
10854
10855
10856
10857
10858
10859
10860
10861
10862
10863
10864
10865
10866
10867
10868
10869
10870
10871
10872
10873
10874
10875
10876
10877
10878
10879
10880
10881
10882
10883
10884
10885
10886
10887
10888
10889
10890
10891
10892
10893
10894
10895
10896
10897
10898
10899
10900
10901
10902
10903
10904
10905
10906
10907
10908
10909
10910
10911
10912
10913
10914
10915
10916
10917
10918
10919
10920
10921
10922
10923
10924
10925
10926
10927
10928
10929
10930
10931
10932
10933
10934
10935
10936
10937
10938
10939
10940
10941
10942
10943
10944
10945
10946
10947
10948
10949
10950
10951
10952
10953
10954
10955
10956
10957
10958
10959
10960
10961
10962
10963
10964
10965
10966
10967
10968
10969
10970
10971
10972
10973
10974
10975
10976
10977
10978
10979
10980
10981
10982
10983
10984
10985
10986
10987
10988
10989
10990
10991
10992
10993
10994
10995
10996
10997
10998
10999
11000
11001
11002
11003
11004
11005
11006
11007
11008
11009
11010
11011
11012
11013
11014
11015
11016
11017
11018
11019
11020
11021
11022
11023
11024
11025
11026
11027
11028
11029
11030
11031
11032
11033
11034
11035
11036
11037
11038
11039
11040
11041
11042
11043
11044
11045
11046
11047
11048
11049
11050
11051
11052
11053
11054
11055
11056
11057
11058
11059
11060
11061
11062
11063
11064
11065
11066
11067
11068
11069
11070
11071
11072
11073
11074
11075
11076
11077
11078
11079
11080
11081
11082
11083
11084
11085
11086
11087
11088
11089
11090
11091
11092
11093
11094
11095
11096
11097
11098
11099
11100
11101
11102
11103
11104
11105
11106
11107
11108
11109
11110
11111
11112
11113
11114
11115
11116
11117
11118
11119
11120
11121
11122
11123
11124
11125
11126
11127
11128
11129
11130
11131
11132
11133
11134
11135
11136
11137
11138
11139
11140
11141
11142
11143
11144
11145
11146
11147
11148
11149
11150
11151
11152
11153
11154
11155
11156
11157
11158
11159
11160
11161
11162
11163
11164
11165
11166
11167
11168
11169
11170
11171
11172
11173
11174
11175
11176
11177
11178
11179
11180
11181
11182
11183
11184
11185
11186
11187
11188
11189
11190
11191
11192
11193
11194
11195
11196
11197
11198
11199
11200
11201
11202
11203
11204
11205
11206
11207
11208
11209
11210
11211
11212
11213
11214
11215
11216
11217
11218
11219
11220
11221
11222
11223
11224
11225
11226
11227
11228
11229
11230
11231
11232
11233
11234
11235
11236
11237
11238
11239
11240
11241
11242
11243
11244
11245
11246
11247
11248
11249
11250
11251
11252
11253
11254
11255
11256
11257
11258
11259
11260
11261
11262
11263
11264
11265
11266
11267
11268
11269
11270
11271
11272
11273
11274
11275
11276
11277
11278
11279
11280
11281
11282
11283
11284
11285
11286
11287
11288
11289
11290
11291
11292
11293
11294
11295
11296
11297
11298
11299
11300
11301
11302
11303
11304
11305
11306
11307
11308
11309
11310
11311
11312
11313
11314
11315
11316
11317
11318
11319
11320
11321
11322
11323
11324
11325
11326
11327
11328
11329
11330
11331
11332
11333
11334
11335
11336
11337
11338
11339
11340
11341
11342
11343
11344
11345
11346
11347
11348
11349
11350
11351
11352
11353
11354
11355
11356
11357
11358
11359
11360
11361
11362
11363
11364
11365
11366
11367
11368
11369
11370
11371
11372
11373
11374
11375
11376
11377
11378
11379
11380
11381
11382
11383
11384
11385
11386
11387
11388
11389
11390
11391
11392
11393
11394
11395
11396
11397
11398
11399
11400
11401
11402
11403
11404
11405
11406
11407
11408
11409
11410
11411
11412
11413
11414
11415
11416
11417
11418
11419
11420
11421
11422
11423
11424
11425
11426
11427
11428
11429
11430
11431
11432
11433
11434
11435
11436
11437
11438
11439
11440
11441
11442
11443
11444
11445
11446
11447
11448
11449
11450
11451
11452
11453
11454
11455
11456
11457
11458
11459
11460
11461
11462
11463
11464
11465
11466
11467
11468
11469
11470
11471
11472
11473
11474
11475
11476
11477
11478
11479
11480
11481
11482
11483
11484
11485
11486
11487
11488
11489
11490
11491
11492
11493
11494
11495
11496
11497
11498
11499
11500
11501
11502
11503
11504
11505
11506
11507
11508
11509
11510
11511
11512
11513
11514
11515
11516
11517
11518
11519
11520
11521
11522
11523
11524
11525
11526
11527
11528
11529
11530
11531
11532
11533
11534
11535
11536
11537
11538
11539
11540
11541
11542
11543
11544
11545
11546
11547
11548
11549
11550
11551
11552
11553
11554
11555
11556
11557
11558
11559
11560
11561
11562
11563
11564
11565
11566
11567
11568
11569
11570
11571
11572
11573
11574
11575
11576
11577
11578
11579
11580
11581
11582
11583
11584
11585
11586
11587
11588
11589
11590
11591
11592
11593
11594
11595
11596
11597
11598
11599
11600
11601
11602
11603
11604
11605
11606
11607
11608
11609
11610
11611
11612
11613
11614
11615
11616
11617
11618
11619
11620
11621
11622
11623
11624
11625
11626
11627
11628
11629
11630
11631
11632
11633
11634
11635
11636
11637
11638
11639
11640
11641
11642
11643
11644
11645
11646
11647
11648
11649
11650
11651
11652
11653
11654
11655
11656
11657
11658
11659
11660
11661
11662
11663
11664
11665
11666
11667
11668
11669
11670
11671
11672
11673
11674
11675
11676
11677
11678
11679
11680
11681
11682
11683
11684
11685
11686
11687
11688
11689
11690
11691
11692
11693
11694
11695
11696
11697
11698
11699
11700
11701
11702
11703
11704
11705
11706
11707
11708
11709
11710
11711
11712
11713
11714
11715
11716
11717
11718
11719
11720
11721
11722
11723
11724
11725
11726
11727
11728
11729
11730
11731
11732
11733
11734
11735
11736
11737
11738
11739
11740
11741
11742
11743
11744
11745
11746
11747
11748
11749
11750
11751
11752
11753
11754
11755
11756
11757
11758
11759
11760
11761
11762
11763
11764
11765
11766
11767
11768
11769
11770
11771
11772
11773
11774
11775
11776
11777
11778
11779
11780
11781
11782
11783
11784
11785
11786
11787
11788
11789
11790
11791
11792
11793
11794
11795
11796
11797
11798
11799
11800
11801
11802
11803
11804
11805
11806
11807
11808
11809
11810
11811
11812
11813
11814
11815
11816
11817
11818
11819
11820
11821
11822
11823
11824
11825
11826
11827
11828
11829
11830
11831
11832
11833
11834
11835
11836
11837
11838
11839
11840
11841
11842
11843
11844
11845
11846
11847
11848
11849
11850
11851
11852
11853
11854
11855
11856
11857
11858
11859
11860
11861
11862
11863
11864
11865
11866
11867
11868
11869
11870
11871
11872
11873
11874
11875
11876
11877
11878
11879
11880
11881
11882
11883
11884
11885
11886
11887
11888
11889
11890
11891
11892
11893
11894
11895
11896
11897
11898
11899
11900
11901
11902
11903
11904
11905
11906
11907
11908
11909
11910
11911
11912
11913
11914
11915
11916
11917
11918
11919
11920
11921
11922
11923
11924
11925
11926
11927
11928
11929
11930
11931
11932
11933
11934
11935
11936
11937
11938
11939
11940
11941
11942
11943
11944
11945
11946
11947
11948
11949
11950
11951
11952
11953
11954
11955
11956
11957
11958
11959
11960
11961
11962
11963
11964
11965
11966
11967
11968
11969
11970
11971
11972
11973
11974
11975
11976
11977
11978
11979
11980
11981
11982
11983
11984
11985
11986
11987
11988
11989
11990
11991
11992
11993
11994
11995
11996
11997
11998
11999
12000
12001
12002
12003
12004
12005
12006
12007
12008
12009
12010
12011
12012
12013
12014
12015
12016
12017
12018
12019
12020
12021
12022
12023
12024
12025
12026
12027
12028
12029
12030
12031
12032
12033
12034
12035
12036
12037
12038
12039
12040
12041
12042
12043
12044
12045
12046
12047
12048
12049
12050
12051
12052
12053
12054
12055
12056
12057
12058
12059
12060
12061
12062
12063
12064
12065
12066
12067
12068
12069
12070
12071
12072
12073
12074
12075
12076
12077
12078
12079
12080
12081
12082
12083
12084
12085
12086
12087
12088
12089
12090
12091
12092
12093
12094
12095
12096
12097
12098
12099
12100
12101
12102
12103
12104
12105
12106
12107
12108
12109
12110
12111
12112
12113
12114
12115
12116
12117
12118
12119
12120
12121
12122
12123
12124
12125
12126
12127
12128
12129
12130
12131
12132
12133
12134
12135
12136
12137
12138
12139
12140
12141
12142
12143
12144
12145
12146
12147
12148
12149
12150
12151
12152
12153
12154
12155
12156
12157
12158
12159
12160
12161
12162
12163
12164
12165
12166
12167
12168
12169
12170
12171
12172
12173
12174
12175
12176
12177
12178
12179
12180
12181
12182
12183
12184
12185
12186
12187
12188
12189
12190
12191
12192
12193
12194
12195
12196
12197
12198
12199
12200
12201
12202
12203
12204
12205
12206
12207
12208
12209
12210
12211
12212
12213
12214
12215
12216
12217
12218
12219
12220
12221
12222
12223
12224
12225
12226
12227
12228
12229
12230
12231
12232
12233
12234
12235
12236
12237
12238
12239
12240
12241
12242
12243
12244
12245
12246
12247
12248
12249
12250
12251
12252
12253
12254
12255
12256
12257
12258
12259
12260
12261
12262
12263
12264
12265
12266
12267
12268
12269
12270
12271
12272
12273
12274
12275
12276
12277
12278
12279
12280
12281
12282
12283
12284
12285
12286
12287
12288
12289
12290
12291
12292
12293
12294
12295
12296
12297
12298
12299
12300
12301
12302
12303
12304
12305
12306
12307
12308
12309
12310
12311
12312
12313
12314
12315
12316
12317
12318
12319
12320
12321
12322
12323
12324
12325
12326
12327
12328
12329
12330
12331
12332
12333
12334
12335
12336
12337
12338
12339
12340
12341
12342
12343
12344
12345
12346
12347
12348
12349
12350
12351
12352
12353
12354
12355
12356
12357
12358
12359
12360
12361
12362
12363
12364
12365
12366
12367
12368
12369
12370
12371
12372
12373
12374
12375
12376
12377
12378
12379
12380
12381
12382
12383
12384
12385
12386
12387
12388
12389
12390
12391
12392
12393
12394
12395
12396
12397
12398
12399
12400
12401
12402
12403
12404
12405
12406
12407
12408
12409
12410
12411
12412
12413
12414
12415
12416
12417
12418
12419
12420
12421
12422
12423
12424
12425
12426
12427
12428
12429
12430
12431
12432
12433
12434
12435
12436
12437
12438
12439
12440
12441
12442
12443
12444
12445
12446
12447
12448
12449
12450
12451
12452
12453
12454
12455
12456
12457
12458
12459
12460
12461
12462
12463
12464
12465
12466
12467
12468
12469
12470
12471
12472
12473
12474
12475
12476
12477
12478
12479
12480
12481
12482
12483
12484
12485
12486
12487
12488
12489
12490
12491
12492
12493
12494
12495
12496
12497
12498
12499
12500
12501
12502
12503
12504
12505
12506
12507
12508
12509
12510
12511
12512
12513
12514
12515
12516
12517
12518
12519
12520
12521
12522
12523
12524
12525
12526
12527
12528
12529
12530
12531
12532
12533
12534
12535
12536
12537
12538
12539
12540
12541
12542
12543
12544
12545
12546
12547
12548
12549
12550
12551
12552
12553
12554
12555
12556
12557
12558
12559
12560
12561
12562
12563
12564
12565
12566
12567
12568
12569
12570
12571
12572
12573
12574
12575
12576
12577
12578
12579
12580
12581
12582
12583
12584
12585
12586
12587
12588
12589
12590
12591
12592
12593
12594
12595
12596
12597
12598
12599
12600
12601
12602
12603
12604
12605
12606
12607
12608
12609
12610
12611
12612
12613
12614
12615
12616
12617
12618
12619
12620
12621
12622
12623
12624
12625
12626
12627
12628
12629
12630
12631
12632
12633
12634
12635
12636
12637
12638
12639
12640
12641
12642
12643
12644
12645
12646
12647
12648
12649
12650
12651
12652
12653
12654
12655
12656
12657
12658
12659
12660
12661
12662
12663
12664
12665
12666
12667
12668
12669
12670
12671
12672
12673
12674
12675
12676
12677
12678
12679
12680
12681
12682
12683
12684
12685
12686
12687
12688
12689
12690
12691
12692
12693
12694
12695
12696
12697
12698
12699
12700
12701
12702
12703
12704
12705
12706
12707
12708
12709
12710
12711
12712
12713
12714
12715
12716
12717
12718
12719
12720
12721
12722
12723
12724
12725
12726
12727
12728
12729
12730
12731
12732
12733
12734
12735
12736
12737
12738
12739
12740
12741
12742
12743
12744
12745
12746
12747
12748
12749
12750
12751
12752
12753
12754
12755
12756
12757
12758
12759
12760
12761
12762
12763
12764
12765
12766
12767
12768
12769
12770
12771
12772
12773
12774
12775
12776
12777
12778
12779
12780
12781
12782
12783
12784
12785
12786
12787
12788
12789
12790
12791
12792
12793
12794
12795
12796
12797
12798
12799
12800
12801
12802
12803
12804
12805
12806
12807
12808
12809
12810
12811
12812
12813
12814
12815
12816
12817
12818
12819
12820
12821
12822
12823
12824
12825
12826
12827
12828
12829
12830
12831
12832
12833
12834
12835
12836
12837
12838
12839
12840
12841
12842
12843
12844
12845
12846
12847
12848
12849
12850
12851
12852
12853
12854
12855
12856
12857
12858
12859
12860
12861
12862
12863
12864
12865
12866
12867
12868
12869
12870
12871
12872
12873
12874
12875
12876
12877
12878
12879
12880
12881
12882
12883
12884
12885
12886
12887
12888
12889
12890
12891
12892
12893
12894
12895
12896
12897
12898
12899
12900
12901
12902
12903
12904
12905
12906
12907
12908
12909
12910
12911
12912
12913
12914
12915
12916
12917
12918
12919
12920
12921
12922
12923
12924
12925
12926
12927
12928
12929
12930
12931
12932
12933
12934
12935
12936
12937
12938
12939
12940
12941
12942
12943
12944
12945
12946
12947
12948
12949
12950
12951
12952
12953
12954
12955
12956
12957
12958
12959
12960
12961
12962
12963
12964
12965
12966
12967
12968
12969
12970
12971
12972
12973
12974
12975
12976
12977
12978
12979
12980
12981
12982
12983
12984
12985
12986
12987
12988
12989
12990
12991
12992
12993
12994
12995
12996
12997
12998
12999
13000
13001
13002
13003
13004
13005
13006
13007
13008
13009
13010
13011
13012
13013
13014
13015
13016
13017
13018
13019
13020
13021
13022
13023
13024
13025
13026
13027
13028
13029
13030
13031
13032
13033
13034
13035
13036
13037
13038
13039
13040
13041
13042
13043
13044
13045
13046
13047
13048
13049
13050
13051
13052
13053
13054
13055
13056
13057
13058
13059
13060
13061
13062
13063
13064
13065
13066
13067
13068
13069
13070
13071
13072
13073
13074
13075
13076
13077
13078
13079
13080
13081
13082
13083
13084
13085
13086
13087
13088
13089
13090
13091
13092
13093
13094
13095
13096
13097
13098
13099
13100
13101
13102
13103
13104
13105
13106
13107
13108
13109
13110
13111
13112
13113
13114
13115
13116
13117
13118
13119
13120
13121
13122
13123
13124
13125
13126
13127
13128
13129
13130
13131
13132
13133
13134
13135
13136
13137
13138
13139
13140
13141
13142
13143
13144
13145
13146
13147
13148
13149
13150
13151
13152
13153
13154
13155
13156
13157
13158
13159
13160
13161
13162
13163
13164
13165
13166
13167
13168
13169
13170
13171
13172
13173
13174
13175
13176
13177
13178
13179
13180
13181
13182
13183
13184
13185
13186
13187
13188
13189
13190
13191
13192
13193
13194
13195
13196
13197
13198
13199
13200
13201
13202
13203
13204
13205
13206
13207
13208
13209
13210
13211
13212
13213
13214
13215
13216
13217
13218
13219
13220
13221
13222
13223
13224
13225
13226
13227
13228
13229
13230
13231
13232
13233
13234
13235
13236
13237
13238
13239
13240
13241
13242
13243
13244
13245
13246
13247
13248
13249
13250
13251
13252
13253
13254
13255
13256
13257
13258
13259
13260
13261
13262
13263
13264
13265
13266
13267
13268
13269
13270
13271
13272
13273
13274
13275
13276
13277
13278
13279
13280
13281
13282
13283
13284
13285
13286
13287
13288
13289
13290
13291
13292
13293
13294
13295
13296
13297
13298
13299
13300
13301
13302
13303
13304
13305
13306
13307
13308
13309
13310
13311
13312
13313
13314
13315
13316
13317
13318
13319
13320
13321
13322
13323
13324
13325
13326
13327
13328
13329
13330
13331
13332
13333
13334
13335
13336
13337
13338
13339
13340
13341
13342
13343
13344
13345
13346
13347
13348
13349
13350
13351
13352
13353
13354
13355
13356
13357
13358
13359
13360
13361
13362
13363
13364
13365
13366
13367
13368
13369
13370
13371
13372
13373
13374
13375
13376
13377
13378
13379
13380
13381
13382
13383
13384
13385
13386
13387
13388
13389
13390
13391
13392
13393
13394
13395
13396
13397
13398
13399
13400
13401
13402
13403
13404
13405
13406
13407
13408
13409
13410
13411
13412
13413
13414
13415
13416
13417
13418
13419
13420
13421
13422
13423
13424
13425
13426
13427
13428
13429
13430
13431
13432
13433
13434
13435
13436
13437
13438
13439
13440
13441
13442
13443
13444
13445
13446
13447
13448
13449
13450
13451
13452
13453
13454
13455
13456
13457
13458
13459
13460
13461
13462
13463
13464
13465
13466
13467
13468
13469
13470
13471
13472
13473
13474
13475
13476
13477
13478
13479
13480
13481
13482
13483
13484
13485
13486
13487
13488
13489
13490
13491
13492
13493
13494
13495
13496
13497
13498
13499
13500
13501
13502
13503
13504
13505
13506
13507
13508
13509
13510
13511
13512
13513
13514
13515
13516
13517
13518
13519
13520
13521
13522
13523
13524
13525
13526
13527
13528
13529
13530
13531
13532
13533
13534
13535
13536
13537
13538
13539
13540
13541
13542
13543
13544
13545
13546
13547
13548
13549
13550
13551
13552
13553
13554
13555
13556
13557
13558
13559
13560
13561
13562
13563
13564
13565
13566
13567
13568
13569
13570
13571
13572
13573
13574
13575
13576
13577
13578
13579
13580
13581
13582
13583
13584
13585
13586
13587
13588
13589
13590
13591
13592
13593
13594
13595
13596
13597
13598
13599
13600
13601
13602
13603
13604
13605
13606
13607
13608
13609
13610
13611
13612
13613
13614
13615
13616
13617
13618
13619
13620
13621
13622
13623
13624
13625
13626
13627
13628
13629
13630
13631
13632
13633
13634
13635
13636
13637
13638
13639
13640
13641
13642
13643
13644
13645
13646
13647
13648
13649
13650
13651
13652
13653
13654
13655
13656
13657
13658
13659
13660
13661
13662
13663
13664
13665
13666
13667
13668
13669
13670
13671
13672
13673
13674
13675
13676
13677
13678
13679
13680
13681
13682
13683
13684
13685
13686
13687
13688
13689
13690
13691
13692
13693
13694
13695
13696
13697
13698
13699
13700
13701
13702
13703
13704
13705
13706
13707
13708
13709
13710
13711
13712
13713
13714
13715
13716
13717
13718
13719
13720
13721
13722
13723
13724
13725
13726
13727
13728
13729
13730
13731
13732
13733
13734
13735
13736
13737
13738
13739
13740
13741
13742
13743
13744
13745
13746
13747
13748
13749
13750
13751
13752
13753
13754
13755
13756
13757
13758
13759
13760
13761
13762
13763
13764
13765
13766
13767
13768
13769
13770
13771
13772
13773
13774
13775
13776
13777
13778
13779
13780
13781
13782
13783
13784
13785
13786
13787
13788
13789
13790
13791
13792
13793
13794
13795
13796
13797
13798
13799
13800
13801
13802
13803
13804
13805
13806
13807
13808
13809
13810
13811
13812
13813
13814
13815
13816
13817
13818
13819
13820
13821
13822
13823
13824
13825
13826
13827
13828
13829
13830
13831
13832
13833
13834
13835
13836
13837
13838
13839
13840
13841
13842
13843
13844
13845
13846
13847
13848
13849
13850
13851
13852
13853
13854
13855
13856
13857
13858
13859
13860
13861
13862
13863
13864
13865
13866
13867
13868
13869
13870
13871
13872
13873
13874
13875
13876
13877
13878
13879
13880
13881
13882
13883
13884
13885
13886
13887
13888
13889
13890
13891
13892
13893
13894
13895
13896
13897
13898
13899
13900
13901
13902
13903
13904
13905
13906
13907
13908
13909
13910
13911
13912
13913
13914
13915
13916
13917
13918
13919
13920
13921
13922
13923
13924
13925
13926
13927
13928
13929
13930
13931
13932
13933
13934
13935
13936
13937
13938
13939
13940
13941
13942
13943
13944
13945
13946
13947
13948
13949
13950
13951
13952
13953
13954
13955
13956
13957
13958
13959
13960
13961
13962
13963
13964
13965
13966
13967
13968
13969
13970
13971
13972
13973
13974
13975
13976
13977
13978
13979
13980
13981
13982
13983
13984
13985
13986
13987
13988
13989
13990
13991
13992
13993
13994
13995
13996
13997
13998
13999
14000
14001
14002
14003
14004
14005
14006
14007
14008
14009
14010
14011
14012
14013
14014
14015
14016
14017
14018
14019
14020
14021
14022
14023
14024
14025
14026
14027
14028
14029
14030
14031
14032
14033
14034
14035
14036
14037
14038
14039
14040
14041
14042
14043
14044
14045
14046
14047
14048
14049
14050
14051
14052
14053
14054
14055
14056
14057
14058
14059
14060
14061
14062
14063
14064
14065
14066
14067
14068
14069
14070
14071
14072
14073
14074
14075
14076
14077
14078
14079
14080
14081
14082
14083
14084
14085
14086
14087
14088
14089
14090
14091
14092
14093
14094
14095
14096
14097
14098
14099
14100
14101
14102
14103
14104
14105
14106
14107
14108
14109
14110
14111
14112
14113
14114
14115
14116
14117
14118
14119
14120
14121
14122
14123
14124
14125
14126
14127
14128
14129
14130
14131
14132
14133
14134
14135
14136
14137
14138
14139
14140
14141
14142
14143
14144
14145
14146
14147
14148
14149
14150
14151
14152
14153
14154
14155
14156
14157
14158
14159
14160
14161
14162
14163
14164
14165
14166
14167
14168
14169
14170
14171
14172
14173
14174
14175
14176
14177
14178
14179
14180
14181
14182
14183
14184
14185
14186
14187
14188
14189
14190
14191
14192
14193
14194
14195
14196
14197
14198
14199
14200
14201
14202
14203
14204
14205
14206
14207
14208
14209
14210
14211
14212
14213
14214
14215
14216
14217
14218
14219
14220
14221
14222
14223
14224
14225
14226
14227
14228
14229
14230
14231
14232
14233
14234
14235
14236
14237
14238
14239
14240
14241
14242
14243
14244
14245
14246
14247
14248
14249
14250
14251
14252
14253
14254
14255
14256
14257
14258
14259
14260
14261
14262
14263
14264
14265
14266
14267
14268
14269
14270
14271
14272
14273
14274
14275
14276
14277
14278
14279
14280
14281
14282
14283
14284
14285
14286
14287
14288
14289
14290
14291
14292
14293
14294
14295
14296
14297
14298
14299
14300
14301
14302
14303
14304
14305
14306
14307
14308
14309
14310
14311
14312
14313
14314
14315
14316
14317
14318
14319
14320
14321
14322
14323
14324
14325
14326
14327
14328
14329
14330
14331
14332
14333
14334
14335
14336
14337
14338
14339
14340
14341
14342
14343
14344
14345
14346
14347
14348
14349
14350
14351
14352
14353
14354
14355
14356
14357
14358
14359
14360
14361
14362
14363
14364
14365
14366
14367
14368
14369
14370
14371
14372
14373
14374
14375
14376
14377
14378
14379
14380
14381
14382
14383
14384
14385
14386
14387
14388
14389
14390
14391
14392
14393
14394
14395
14396
14397
14398
14399
14400
14401
14402
14403
14404
14405
14406
14407
14408
14409
14410
14411
14412
14413
14414
14415
14416
14417
14418
14419
14420
14421
14422
14423
14424
14425
14426
14427
14428
14429
14430
14431
14432
14433
14434
14435
14436
14437
14438
14439
14440
14441
14442
14443
14444
14445
14446
14447
14448
14449
14450
14451
14452
14453
14454
14455
14456
14457
14458
14459
14460
14461
14462
14463
14464
14465
14466
14467
14468
14469
14470
14471
14472
14473
14474
14475
14476
14477
14478
14479
14480
14481
14482
14483
14484
14485
14486
14487
14488
14489
14490
14491
14492
14493
14494
14495
14496
14497
14498
14499
14500
14501
14502
14503
14504
14505
14506
14507
14508
14509
14510
14511
14512
14513
14514
14515
14516
14517
14518
14519
14520
14521
14522
14523
14524
14525
14526
14527
14528
14529
14530
14531
14532
14533
14534
14535
14536
14537
14538
14539
14540
14541
14542
14543
14544
14545
14546
14547
14548
14549
14550
14551
14552
14553
14554
14555
14556
14557
14558
14559
14560
14561
14562
14563
14564
14565
14566
14567
14568
14569
14570
14571
14572
14573
14574
14575
14576
14577
14578
14579
14580
14581
14582
14583
14584
14585
14586
14587
14588
14589
14590
14591
14592
14593
14594
14595
14596
14597
14598
14599
14600
14601
14602
14603
14604
14605
14606
14607
14608
14609
14610
14611
14612
14613
14614
14615
14616
14617
14618
14619
14620
14621
14622
14623
14624
14625
14626
14627
14628
14629
14630
14631
14632
14633
14634
14635
14636
14637
14638
14639
14640
14641
14642
14643
14644
14645
14646
14647
14648
14649
14650
14651
14652
14653
14654
14655
14656
14657
14658
14659
14660
14661
14662
14663
14664
14665
14666
14667
14668
14669
14670
14671
14672
14673
14674
14675
14676
14677
14678
14679
14680
14681
14682
14683
14684
14685
14686
14687
14688
14689
14690
14691
14692
14693
14694
14695
14696
14697
14698
14699
14700
14701
14702
14703
14704
14705
14706
14707
14708
14709
14710
14711
14712
14713
14714
14715
14716
14717
14718
14719
14720
14721
14722
14723
14724
14725
14726
14727
14728
14729
14730
14731
14732
14733
14734
14735
14736
14737
14738
14739
14740
14741
14742
14743
14744
14745
14746
14747
14748
14749
14750
14751
14752
14753
14754
14755
14756
14757
14758
14759
14760
14761
14762
14763
14764
14765
14766
14767
14768
14769
14770
14771
14772
14773
14774
14775
14776
14777
14778
14779
14780
14781
14782
14783
14784
14785
14786
14787
14788
14789
14790
14791
14792
14793
14794
14795
14796
14797
14798
14799
14800
14801
14802
14803
14804
14805
14806
14807
14808
14809
14810
14811
14812
14813
14814
14815
14816
14817
14818
14819
14820
14821
14822
14823
14824
14825
14826
14827
14828
14829
14830
14831
14832
14833
14834
14835
14836
14837
14838
14839
14840
14841
14842
14843
14844
14845
14846
14847
14848
14849
14850
14851
14852
14853
14854
14855
14856
14857
14858
14859
14860
14861
14862
14863
14864
14865
14866
14867
14868
14869
14870
14871
14872
14873
14874
14875
14876
14877
14878
14879
14880
14881
14882
14883
14884
14885
14886
14887
14888
14889
14890
14891
14892
14893
14894
14895
14896
14897
14898
14899
14900
14901
14902
14903
14904
14905
14906
14907
14908
14909
14910
14911
14912
14913
14914
14915
14916
14917
14918
14919
14920
14921
14922
14923
14924
14925
14926
14927
14928
14929
14930
14931
14932
14933
14934
14935
14936
14937
14938
14939
14940
14941
14942
14943
14944
14945
14946
14947
14948
14949
14950
14951
14952
14953
14954
14955
14956
14957
14958
14959
14960
14961
14962
14963
14964
14965
14966
14967
14968
14969
14970
14971
14972
14973
14974
14975
14976
14977
14978
14979
14980
14981
14982
14983
14984
14985
14986
14987
14988
14989
14990
14991
14992
14993
14994
14995
14996
14997
14998
14999
15000
15001
15002
15003
15004
15005
15006
15007
15008
15009
15010
15011
15012
15013
15014
15015
15016
15017
15018
15019
15020
15021
15022
15023
15024
15025
15026
15027
15028
15029
15030
15031
15032
15033
15034
15035
15036
15037
15038
15039
15040
15041
15042
15043
15044
15045
15046
15047
15048
15049
15050
15051
15052
15053
15054
15055
15056
15057
15058
15059
15060
15061
15062
15063
15064
15065
15066
15067
15068
15069
15070
15071
15072
15073
15074
15075
15076
15077
15078
15079
15080
15081
15082
15083
15084
15085
15086
15087
15088
15089
15090
15091
15092
15093
15094
15095
15096
15097
15098
15099
15100
15101
15102
15103
15104
15105
15106
15107
15108
15109
15110
15111
15112
15113
15114
15115
15116
15117
15118
15119
15120
15121
15122
15123
15124
15125
15126
15127
15128
15129
15130
15131
15132
15133
15134
15135
15136
15137
15138
15139
15140
15141
15142
15143
15144
15145
15146
15147
15148
15149
15150
15151
15152
15153
15154
15155
15156
15157
15158
15159
15160
15161
15162
15163
15164
15165
15166
15167
15168
15169
15170
15171
15172
15173
15174
15175
15176
15177
15178
15179
15180
15181
15182
15183
15184
15185
15186
15187
15188
15189
15190
15191
15192
15193
15194
15195
15196
15197
15198
15199
15200
15201
15202
15203
15204
15205
15206
15207
15208
15209
15210
15211
15212
15213
15214
15215
15216
15217
15218
15219
15220
15221
15222
15223
15224
15225
15226
15227
15228
15229
15230
15231
15232
15233
15234
15235
15236
15237
15238
15239
15240
15241
15242
15243
15244
15245
15246
15247
15248
15249
15250
15251
15252
15253
15254
15255
15256
15257
15258
15259
15260
15261
15262
15263
15264
15265
15266
15267
15268
15269
15270
15271
15272
15273
15274
15275
15276
15277
15278
15279
15280
15281
15282
15283
15284
15285
15286
15287
15288
15289
15290
15291
15292
15293
15294
15295
15296
15297
15298
15299
15300
15301
15302
15303
15304
15305
15306
15307
15308
15309
15310
15311
15312
15313
15314
15315
15316
15317
15318
15319
15320
15321
15322
15323
15324
15325
15326
15327
15328
15329
15330
15331
15332
15333
15334
15335
15336
15337
15338
15339
15340
15341
15342
15343
15344
15345
15346
15347
15348
15349
15350
15351
15352
15353
15354
15355
15356
15357
15358
15359
15360
15361
15362
15363
15364
15365
15366
15367
15368
15369
15370
15371
15372
15373
15374
15375
15376
15377
15378
15379
15380
15381
15382
15383
15384
15385
15386
15387
15388
15389
15390
15391
15392
15393
15394
15395
15396
15397
15398
15399
15400
15401
15402
15403
15404
15405
15406
15407
15408
15409
15410
15411
15412
15413
15414
15415
15416
15417
15418
15419
15420
15421
15422
15423
15424
15425
15426
15427
15428
15429
15430
15431
15432
15433
15434
15435
15436
15437
15438
15439
15440
15441
15442
15443
15444
15445
15446
15447
15448
15449
15450
15451
15452
15453
15454
15455
15456
15457
15458
15459
15460
15461
15462
15463
15464
15465
15466
15467
15468
15469
15470
15471
15472
15473
15474
15475
15476
15477
15478
15479
15480
15481
15482
15483
15484
15485
15486
15487
15488
15489
15490
15491
15492
15493
15494
15495
15496
15497
15498
15499
15500
15501
15502
15503
15504
15505
15506
15507
15508
15509
15510
15511
15512
15513
15514
15515
15516
15517
15518
15519
15520
15521
15522
15523
15524
15525
15526
15527
15528
15529
15530
15531
15532
15533
15534
15535
15536
15537
15538
15539
15540
15541
15542
15543
15544
15545
15546
15547
15548
15549
15550
15551
15552
15553
15554
15555
15556
15557
15558
15559
15560
15561
15562
15563
15564
15565
15566
15567
15568
15569
15570
15571
15572
15573
15574
15575
15576
15577
15578
15579
15580
15581
15582
15583
15584
15585
15586
15587
15588
15589
15590
15591
15592
15593
15594
15595
15596
15597
15598
15599
15600
15601
15602
15603
15604
15605
15606
15607
15608
15609
15610
15611
15612
15613
15614
15615
15616
15617
15618
15619
15620
15621
15622
15623
15624
15625
15626
15627
15628
15629
15630
15631
15632
15633
15634
15635
15636
15637
15638
15639
15640
15641
15642
15643
15644
15645
15646
15647
15648
15649
15650
15651
15652
15653
15654
15655
15656
15657
15658
15659
15660
15661
15662
15663
15664
15665
15666
15667
15668
15669
15670
15671
15672
15673
15674
15675
15676
15677
15678
15679
15680
15681
15682
15683
15684
15685
15686
15687
15688
15689
15690
15691
15692
15693
15694
15695
15696
15697
15698
15699
15700
15701
15702
15703
15704
15705
15706
15707
15708
15709
15710
15711
15712
15713
15714
15715
15716
15717
15718
15719
15720
15721
15722
15723
15724
15725
15726
15727
15728
15729
15730
15731
15732
15733
15734
15735
15736
15737
15738
15739
15740
15741
15742
15743
15744
15745
15746
15747
15748
15749
15750
15751
15752
15753
15754
15755
15756
15757
15758
15759
15760
15761
15762
15763
15764
15765
15766
15767
15768
15769
15770
15771
15772
15773
15774
15775
15776
15777
15778
15779
15780
15781
15782
15783
15784
15785
15786
15787
15788
15789
15790
15791
15792
15793
15794
15795
15796
15797
15798
15799
15800
15801
15802
15803
15804
15805
15806
15807
15808
15809
15810
15811
15812
15813
15814
15815
15816
15817
15818
15819
15820
15821
15822
15823
15824
15825
15826
15827
15828
15829
15830
15831
15832
15833
15834
15835
15836
15837
15838
15839
15840
15841
15842
15843
15844
15845
15846
15847
15848
15849
15850
15851
15852
15853
15854
15855
15856
15857
15858
15859
15860
15861
15862
15863
15864
15865
15866
15867
15868
15869
15870
15871
15872
15873
15874
15875
15876
15877
15878
15879
15880
15881
15882
15883
15884
15885
15886
15887
15888
15889
15890
15891
15892
15893
15894
15895
15896
15897
15898
15899
15900
15901
15902
15903
15904
15905
15906
15907
15908
15909
15910
15911
15912
15913
15914
15915
15916
15917
15918
15919
15920
15921
15922
15923
15924
15925
15926
15927
15928
15929
15930
15931
15932
15933
15934
15935
15936
15937
15938
15939
15940
15941
15942
15943
15944
15945
15946
15947
15948
15949
15950
15951
15952
15953
15954
15955
15956
15957
15958
15959
15960
15961
15962
15963
15964
15965
15966
15967
15968
15969
15970
15971
15972
15973
15974
15975
15976
15977
15978
15979
15980
15981
15982
15983
15984
15985
15986
15987
15988
15989
15990
15991
15992
15993
15994
15995
15996
15997
15998
15999
16000
16001
16002
16003
16004
16005
16006
16007
16008
16009
16010
16011
16012
16013
16014
16015
16016
16017
16018
16019
16020
16021
16022
16023
16024
16025
16026
16027
16028
16029
16030
16031
16032
16033
16034
16035
16036
16037
16038
16039
16040
16041
16042
16043
16044
16045
16046
16047
16048
16049
16050
16051
16052
16053
16054
16055
16056
16057
16058
16059
16060
16061
16062
16063
16064
16065
16066
16067
16068
16069
16070
16071
16072
16073
16074
16075
16076
16077
16078
16079
16080
16081
16082
16083
16084
16085
16086
16087
16088
16089
16090
16091
16092
16093
16094
16095
16096
16097
16098
16099
16100
16101
16102
16103
16104
16105
16106
16107
16108
16109
16110
16111
16112
16113
16114
16115
16116
16117
16118
16119
16120
16121
16122
16123
16124
16125
16126
16127
16128
16129
16130
16131
16132
16133
16134
16135
16136
16137
16138
16139
16140
16141
16142
16143
16144
16145
16146
16147
16148
16149
16150
16151
16152
16153
16154
16155
16156
16157
16158
16159
16160
16161
16162
16163
16164
16165
16166
16167
16168
16169
16170
16171
16172
16173
16174
16175
16176
16177
16178
16179
16180
16181
16182
16183
16184
16185
16186
16187
16188
16189
16190
16191
16192
16193
16194
16195
16196
16197
16198
16199
16200
16201
16202
16203
16204
16205
16206
16207
16208
16209
16210
16211
16212
16213
16214
16215
16216
16217
16218
16219
16220
16221
16222
16223
16224
16225
16226
16227
16228
16229
16230
16231
16232
16233
16234
16235
16236
16237
16238
16239
16240
16241
16242
16243
16244
16245
16246
16247
16248
16249
16250
16251
16252
16253
16254
16255
16256
16257
16258
16259
16260
16261
16262
16263
16264
16265
16266
16267
16268
16269
16270
16271
16272
16273
16274
16275
16276
16277
16278
16279
16280
16281
16282
16283
16284
16285
16286
16287
16288
16289
16290
16291
16292
16293
16294
16295
16296
16297
16298
16299
16300
16301
16302
16303
16304
16305
16306
16307
16308
16309
16310
16311
16312
16313
16314
16315
16316
16317
16318
16319
16320
16321
16322
16323
16324
16325
16326
16327
16328
16329
16330
16331
16332
16333
16334
16335
16336
16337
16338
16339
16340
16341
16342
16343
16344
16345
16346
16347
16348
16349
16350
16351
16352
16353
16354
16355
16356
16357
16358
16359
16360
16361
16362
16363
16364
16365
16366
16367
16368
16369
16370
16371
16372
16373
16374
16375
16376
16377
16378
16379
16380
16381
16382
16383
16384
16385
16386
16387
16388
16389
16390
16391
16392
16393
16394
16395
16396
16397
16398
16399
16400
16401
16402
16403
16404
16405
16406
16407
16408
16409
16410
16411
16412
16413
16414
16415
16416
16417
16418
16419
16420
16421
16422
16423
16424
16425
16426
16427
16428
16429
16430
16431
16432
16433
16434
16435
16436
16437
16438
16439
16440
16441
16442
16443
16444
16445
16446
16447
16448
16449
16450
16451
16452
16453
16454
16455
16456
16457
16458
16459
16460
16461
16462
16463
16464
16465
16466
16467
16468
16469
16470
16471
16472
16473
16474
16475
16476
16477
16478
16479
16480
16481
16482
16483
16484
16485
16486
16487
16488
16489
16490
16491
16492
16493
16494
16495
16496
16497
16498
16499
16500
16501
16502
16503
16504
16505
16506
16507
16508
16509
16510
16511
16512
16513
16514
16515
16516
16517
16518
16519
16520
16521
16522
16523
16524
16525
16526
16527
16528
16529
16530
16531
16532
16533
16534
16535
16536
16537
16538
16539
16540
16541
16542
16543
16544
16545
16546
16547
16548
16549
16550
16551
16552
16553
16554
16555
16556
16557
16558
16559
16560
16561
16562
16563
16564
16565
16566
16567
16568
16569
16570
16571
16572
16573
16574
16575
16576
16577
16578
16579
16580
16581
16582
16583
16584
16585
16586
16587
16588
16589
16590
16591
16592
16593
16594
16595
16596
16597
16598
16599
16600
16601
16602
16603
16604
16605
16606
16607
16608
16609
16610
16611
16612
16613
16614
16615
16616
16617
16618
16619
16620
16621
16622
16623
16624
16625
16626
16627
16628
16629
16630
16631
16632
16633
16634
16635
16636
16637
16638
16639
16640
16641
16642
16643
16644
16645
16646
16647
16648
16649
16650
16651
16652
16653
16654
16655
16656
16657
16658
16659
16660
16661
16662
16663
16664
16665
16666
16667
16668
16669
16670
16671
16672
16673
16674
16675
16676
16677
16678
16679
16680
16681
16682
16683
16684
16685
16686
16687
16688
16689
16690
16691
16692
16693
16694
16695
16696
16697
16698
16699
16700
16701
16702
16703
16704
16705
16706
16707
16708
16709
16710
16711
16712
16713
16714
16715
16716
16717
16718
16719
16720
16721
16722
16723
16724
16725
16726
16727
16728
16729
16730
16731
16732
16733
16734
16735
16736
16737
16738
16739
16740
16741
16742
16743
16744
16745
16746
16747
16748
16749
16750
16751
16752
16753
16754
16755
16756
16757
16758
16759
16760
16761
16762
16763
16764
16765
16766
16767
16768
16769
16770
16771
16772
16773
16774
16775
16776
16777
16778
16779
16780
16781
16782
16783
16784
16785
16786
16787
16788
16789
16790
16791
16792
16793
16794
16795
16796
16797
16798
16799
16800
16801
16802
16803
16804
16805
16806
16807
16808
16809
16810
16811
16812
16813
16814
16815
16816
16817
16818
16819
16820
16821
16822
16823
16824
16825
16826
16827
16828
16829
16830
16831
16832
16833
16834
16835
16836
16837
16838
16839
16840
16841
16842
16843
16844
16845
16846
16847
16848
16849
16850
16851
16852
16853
16854
16855
16856
16857
16858
16859
16860
16861
16862
16863
16864
16865
16866
16867
16868
16869
16870
16871
16872
16873
16874
16875
16876
16877
16878
16879
16880
16881
16882
16883
16884
16885
16886
16887
16888
16889
16890
16891
16892
16893
16894
16895
16896
16897
16898
16899
16900
16901
16902
16903
16904
16905
16906
16907
16908
16909
16910
16911
16912
16913
16914
16915
16916
16917
16918
16919
16920
16921
16922
16923
16924
16925
16926
16927
16928
16929
16930
16931
16932
16933
16934
16935
16936
16937
16938
16939
16940
16941
16942
16943
16944
16945
16946
16947
16948
16949
16950
16951
16952
16953
16954
16955
16956
16957
16958
16959
16960
16961
16962
16963
16964
16965
16966
16967
16968
16969
16970
16971
16972
16973
16974
16975
16976
16977
16978
16979
16980
16981
16982
16983
16984
16985
16986
16987
16988
16989
16990
16991
16992
16993
16994
16995
16996
16997
16998
16999
17000
17001
17002
17003
17004
17005
17006
17007
17008
17009
17010
17011
17012
17013
17014
17015
17016
17017
17018
17019
17020
17021
17022
17023
17024
17025
17026
17027
17028
17029
17030
17031
17032
17033
17034
17035
17036
17037
17038
17039
17040
17041
17042
17043
17044
17045
17046
17047
17048
17049
17050
17051
17052
17053
17054
17055
17056
17057
17058
17059
17060
17061
17062
17063
17064
17065
17066
17067
17068
17069
17070
17071
17072
17073
17074
17075
17076
17077
17078
17079
17080
17081
17082
17083
17084
17085
17086
17087
17088
17089
17090
17091
17092
17093
17094
17095
17096
17097
17098
17099
17100
17101
17102
17103
17104
17105
17106
17107
17108
17109
17110
17111
17112
17113
17114
17115
17116
17117
17118
17119
17120
17121
17122
17123
17124
17125
17126
17127
17128
17129
17130
17131
17132
17133
17134
17135
17136
17137
17138
17139
17140
17141
17142
17143
17144
17145
17146
17147
17148
17149
17150
17151
17152
17153
17154
17155
17156
17157
17158
17159
17160
17161
17162
17163
17164
17165
17166
17167
17168
17169
17170
17171
17172
17173
17174
17175
17176
17177
17178
17179
17180
17181
17182
17183
17184
17185
17186
17187
17188
17189
17190
17191
17192
17193
17194
17195
17196
17197
17198
17199
17200
17201
17202
17203
17204
17205
17206
17207
17208
17209
17210
17211
17212
17213
17214
17215
17216
17217
17218
17219
17220
17221
17222
17223
17224
17225
17226
17227
17228
17229
17230
17231
17232
17233
17234
17235
17236
17237
17238
17239
17240
17241
17242
17243
17244
17245
17246
17247
17248
17249
17250
17251
17252
17253
17254
17255
17256
17257
17258
17259
17260
17261
17262
17263
17264
17265
17266
17267
17268
17269
17270
17271
17272
17273
17274
17275
17276
17277
17278
17279
17280
17281
17282
17283
17284
17285
17286
17287
17288
17289
17290
17291
17292
17293
17294
17295
17296
17297
17298
17299
17300
17301
17302
17303
17304
17305
17306
17307
17308
17309
17310
17311
17312
17313
17314
17315
17316
17317
17318
17319
17320
17321
17322
17323
17324
17325
17326
17327
17328
17329
17330
17331
17332
17333
17334
17335
17336
17337
17338
17339
17340
17341
17342
17343
17344
17345
17346
17347
17348
17349
17350
17351
17352
17353
17354
17355
17356
17357
17358
17359
17360
17361
17362
17363
17364
17365
17366
17367
17368
17369
17370
17371
17372
17373
17374
17375
17376
17377
17378
17379
17380
17381
17382
17383
17384
17385
17386
17387
17388
17389
17390
17391
17392
17393
17394
17395
17396
17397
17398
17399
17400
17401
17402
17403
17404
17405
17406
17407
17408
17409
17410
17411
17412
17413
17414
17415
17416
17417
17418
17419
17420
17421
17422
17423
17424
17425
17426
17427
17428
17429
17430
17431
17432
17433
17434
17435
17436
17437
17438
17439
17440
17441
17442
17443
17444
17445
17446
17447
17448
17449
17450
17451
17452
17453
17454
17455
17456
17457
17458
17459
17460
17461
17462
17463
17464
17465
17466
17467
17468
17469
17470
17471
17472
17473
17474
17475
17476
17477
17478
17479
17480
17481
17482
17483
17484
17485
17486
17487
17488
17489
17490
17491
17492
17493
17494
17495
17496
17497
17498
17499
17500
17501
17502
17503
17504
17505
17506
17507
17508
17509
17510
17511
17512
17513
17514
17515
17516
17517
17518
17519
17520
17521
17522
17523
17524
17525
17526
17527
17528
17529
17530
17531
17532
17533
17534
17535
17536
17537
17538
17539
17540
17541
17542
17543
17544
17545
17546
17547
17548
17549
17550
17551
17552
17553
17554
17555
17556
17557
17558
17559
17560
17561
17562
17563
17564
17565
17566
17567
17568
17569
17570
17571
17572
17573
17574
17575
17576
17577
17578
17579
17580
17581
17582
17583
17584
17585
17586
17587
17588
17589
17590
17591
17592
17593
17594
17595
17596
17597
17598
17599
17600
17601
17602
17603
17604
17605
17606
17607
17608
17609
17610
17611
17612
17613
17614
17615
17616
17617
17618
17619
17620
17621
17622
17623
17624
17625
17626
17627
17628
17629
17630
17631
17632
17633
17634
17635
17636
17637
17638
17639
17640
17641
17642
17643
17644
17645
17646
17647
17648
17649
17650
17651
17652
17653
17654
17655
17656
17657
17658
17659
17660
17661
17662
17663
17664
17665
17666
17667
17668
17669
17670
17671
17672
17673
17674
17675
17676
17677
17678
17679
17680
17681
17682
17683
17684
17685
17686
17687
17688
17689
17690
17691
17692
17693
17694
17695
17696
17697
17698
17699
17700
17701
17702
17703
17704
17705
17706
17707
17708
17709
17710
17711
17712
17713
17714
17715
17716
17717
17718
17719
17720
17721
17722
17723
17724
17725
17726
17727
17728
17729
17730
17731
17732
17733
17734
17735
17736
17737
17738
17739
17740
17741
17742
17743
17744
17745
17746
17747
17748
17749
17750
17751
17752
17753
17754
17755
17756
17757
17758
17759
17760
17761
17762
17763
17764
17765
17766
17767
17768
17769
17770
17771
17772
17773
17774
17775
17776
17777
17778
17779
17780
17781
17782
17783
17784
17785
17786
17787
17788
17789
17790
17791
17792
17793
17794
17795
17796
17797
17798
17799
17800
17801
17802
17803
17804
17805
17806
17807
17808
17809
17810
17811
17812
17813
17814
17815
17816
17817
17818
17819
17820
17821
17822
17823
17824
17825
17826
17827
17828
17829
17830
17831
17832
17833
17834
17835
17836
17837
17838
17839
17840
17841
17842
17843
17844
17845
17846
17847
17848
17849
17850
17851
17852
17853
17854
17855
17856
17857
17858
17859
17860
17861
17862
17863
17864
17865
17866
17867
17868
17869
17870
17871
17872
17873
17874
17875
17876
17877
17878
17879
17880
17881
17882
17883
17884
17885
17886
17887
17888
17889
17890
17891
17892
17893
17894
17895
17896
17897
17898
17899
17900
17901
17902
17903
17904
17905
17906
17907
17908
17909
17910
17911
17912
17913
17914
17915
17916
17917
17918
17919
17920
17921
17922
17923
17924
17925
17926
17927
17928
17929
17930
17931
17932
17933
17934
17935
17936
17937
17938
17939
17940
17941
17942
17943
17944
17945
17946
17947
17948
17949
17950
17951
17952
17953
17954
17955
17956
17957
17958
17959
17960
17961
17962
17963
17964
17965
17966
17967
17968
17969
17970
17971
17972
17973
17974
17975
17976
17977
17978
17979
17980
17981
17982
17983
17984
17985
17986
17987
17988
17989
17990
17991
17992
17993
17994
17995
17996
17997
17998
17999
18000
18001
18002
18003
18004
18005
18006
18007
18008
18009
18010
18011
18012
18013
18014
18015
18016
18017
18018
18019
18020
18021
18022
18023
18024
18025
18026
18027
18028
18029
18030
18031
18032
18033
18034
18035
18036
18037
18038
18039
18040
18041
18042
18043
18044
18045
18046
18047
18048
18049
18050
18051
18052
18053
18054
18055
18056
18057
18058
18059
18060
18061
18062
18063
18064
18065
18066
18067
18068
18069
18070
18071
18072
18073
18074
18075
18076
18077
18078
18079
18080
18081
18082
18083
18084
18085
18086
18087
18088
18089
18090
18091
18092
18093
18094
18095
18096
18097
18098
18099
18100
18101
18102
18103
18104
18105
18106
18107
18108
18109
18110
18111
18112
18113
18114
18115
18116
18117
18118
18119
18120
18121
18122
18123
18124
18125
18126
18127
18128
18129
18130
18131
18132
18133
18134
18135
18136
18137
18138
18139
18140
18141
18142
18143
18144
18145
18146
18147
18148
18149
18150
18151
18152
18153
18154
18155
18156
18157
18158
18159
18160
18161
18162
18163
18164
18165
18166
18167
18168
18169
18170
18171
18172
18173
18174
18175
18176
18177
18178
18179
18180
18181
18182
18183
18184
18185
18186
18187
18188
18189
18190
18191
18192
18193
18194
18195
18196
18197
18198
18199
18200
18201
18202
18203
18204
18205
18206
18207
18208
18209
18210
18211
18212
18213
18214
18215
18216
18217
18218
18219
18220
18221
18222
18223
18224
18225
18226
18227
18228
18229
18230
18231
18232
18233
18234
18235
18236
18237
18238
18239
18240
18241
18242
18243
18244
18245
18246
18247
18248
18249
18250
18251
18252
18253
18254
18255
18256
18257
18258
18259
18260
18261
18262
18263
18264
18265
18266
18267
18268
18269
18270
18271
18272
18273
18274
18275
18276
18277
18278
18279
18280
18281
18282
18283
18284
18285
18286
18287
18288
18289
18290
18291
18292
18293
18294
18295
18296
18297
18298
18299
18300
18301
18302
18303
18304
18305
18306
18307
18308
18309
18310
18311
18312
18313
18314
18315
18316
18317
18318
18319
18320
18321
18322
18323
18324
18325
18326
18327
18328
18329
18330
18331
18332
18333
18334
18335
18336
18337
18338
18339
18340
18341
18342
18343
18344
18345
18346
18347
18348
18349
18350
18351
18352
18353
18354
18355
18356
18357
18358
18359
18360
18361
18362
18363
18364
18365
18366
18367
18368
18369
18370
18371
18372
18373
18374
18375
18376
18377
18378
18379
18380
18381
18382
18383
18384
18385
18386
18387
18388
18389
18390
18391
18392
18393
18394
18395
18396
18397
18398
18399
18400
18401
18402
18403
18404
18405
18406
18407
18408
18409
18410
18411
18412
18413
18414
18415
18416
18417
18418
18419
18420
18421
18422
18423
18424
18425
18426
18427
18428
18429
18430
18431
18432
18433
18434
18435
18436
18437
18438
18439
18440
18441
18442
18443
18444
18445
18446
18447
18448
18449
18450
18451
18452
18453
18454
18455
18456
18457
18458
18459
18460
18461
18462
18463
18464
18465
18466
18467
18468
18469
18470
18471
18472
18473
18474
18475
18476
18477
18478
18479
18480
18481
18482
18483
18484
18485
18486
18487
18488
18489
18490
18491
18492
18493
18494
18495
18496
18497
18498
18499
18500
18501
18502
18503
18504
18505
18506
18507
18508
18509
18510
18511
18512
18513
18514
18515
18516
18517
18518
18519
18520
18521
18522
18523
18524
18525
18526
18527
18528
18529
18530
18531
18532
18533
18534
18535
18536
18537
18538
18539
18540
18541
18542
18543
18544
18545
18546
18547
18548
18549
18550
18551
18552
18553
18554
18555
18556
18557
18558
18559
18560
18561
18562
18563
18564
18565
18566
18567
18568
18569
18570
18571
18572
18573
18574
18575
18576
18577
18578
18579
18580
18581
18582
18583
18584
18585
18586
18587
18588
18589
18590
18591
18592
18593
18594
18595
18596
18597
18598
18599
18600
18601
18602
18603
18604
18605
18606
18607
18608
18609
18610
18611
18612
18613
18614
18615
18616
18617
18618
18619
18620
18621
18622
18623
18624
18625
18626
18627
18628
18629
18630
18631
18632
18633
18634
18635
18636
18637
18638
18639
18640
18641
18642
18643
18644
18645
18646
18647
18648
18649
18650
18651
18652
18653
18654
18655
18656
18657
18658
18659
18660
18661
18662
18663
18664
18665
18666
18667
18668
18669
18670
18671
18672
18673
18674
18675
18676
18677
18678
18679
18680
18681
18682
18683
18684
18685
18686
18687
18688
18689
18690
18691
18692
18693
18694
18695
18696
18697
18698
18699
18700
18701
18702
18703
18704
18705
18706
18707
18708
18709
18710
18711
18712
18713
18714
18715
18716
18717
18718
18719
18720
18721
18722
18723
18724
18725
18726
18727
18728
18729
18730
18731
18732
18733
18734
18735
18736
18737
18738
18739
18740
18741
18742
18743
18744
18745
18746
18747
18748
18749
18750
18751
18752
18753
18754
18755
18756
18757
18758
18759
18760
18761
18762
18763
18764
18765
18766
18767
18768
18769
18770
18771
18772
18773
18774
18775
18776
18777
18778
18779
18780
18781
18782
18783
18784
18785
18786
18787
18788
18789
18790
18791
18792
18793
18794
18795
18796
18797
18798
18799
18800
18801
18802
18803
18804
18805
18806
18807
18808
18809
18810
18811
18812
18813
18814
18815
18816
18817
18818
18819
18820
18821
18822
18823
18824
18825
18826
18827
18828
18829
18830
18831
18832
18833
18834
18835
18836
18837
18838
18839
18840
18841
18842
18843
18844
18845
18846
18847
18848
18849
18850
18851
18852
18853
18854
18855
18856
18857
18858
18859
18860
18861
18862
18863
18864
18865
18866
18867
18868
18869
18870
18871
18872
18873
18874
18875
18876
18877
18878
18879
18880
18881
18882
18883
18884
18885
18886
18887
18888
18889
18890
18891
18892
18893
18894
18895
18896
18897
18898
18899
18900
18901
18902
18903
18904
18905
18906
18907
18908
18909
18910
18911
18912
18913
18914
18915
18916
18917
18918
18919
18920
18921
18922
18923
18924
18925
18926
18927
18928
18929
18930
18931
18932
18933
18934
18935
18936
18937
18938
18939
18940
18941
18942
18943
18944
18945
18946
18947
18948
18949
18950
18951
18952
18953
18954
18955
18956
18957
18958
18959
18960
18961
18962
18963
18964
18965
18966
18967
18968
18969
18970
18971
18972
18973
18974
18975
18976
18977
18978
18979
18980
18981
18982
18983
18984
18985
18986
18987
18988
18989
18990
18991
18992
18993
18994
18995
18996
18997
18998
18999
19000
19001
19002
19003
19004
19005
19006
19007
19008
19009
19010
19011
19012
19013
19014
19015
19016
19017
19018
19019
19020
19021
19022
19023
19024
19025
19026
19027
19028
19029
19030
19031
19032
19033
19034
19035
19036
19037
19038
19039
19040
19041
19042
19043
19044
19045
19046
19047
19048
19049
19050
19051
19052
19053
19054
19055
19056
19057
19058
19059
19060
19061
19062
19063
19064
19065
19066
19067
19068
19069
19070
19071
19072
19073
19074
19075
19076
19077
19078
19079
19080
19081
19082
19083
19084
19085
19086
19087
19088
19089
19090
19091
19092
19093
19094
19095
19096
19097
19098
19099
19100
19101
19102
19103
19104
19105
19106
19107
19108
19109
19110
19111
19112
19113
19114
19115
19116
19117
19118
19119
19120
19121
19122
19123
19124
19125
19126
19127
19128
19129
19130
19131
19132
19133
19134
19135
19136
19137
19138
19139
19140
19141
19142
19143
19144
19145
19146
19147
19148
19149
19150
19151
19152
19153
19154
19155
19156
19157
19158
19159
19160
19161
19162
19163
19164
19165
19166
19167
19168
19169
19170
19171
19172
19173
19174
19175
19176
19177
19178
19179
19180
19181
19182
19183
19184
19185
19186
19187
19188
19189
19190
19191
19192
19193
19194
19195
19196
19197
19198
19199
19200
19201
19202
19203
19204
19205
19206
19207
19208
19209
19210
19211
19212
19213
19214
19215
19216
19217
19218
19219
19220
19221
19222
19223
19224
19225
19226
19227
19228
19229
19230
19231
19232
19233
19234
19235
19236
19237
19238
19239
19240
19241
19242
19243
19244
19245
19246
19247
19248
19249
19250
19251
19252
19253
19254
19255
19256
19257
19258
19259
19260
19261
19262
19263
19264
19265
19266
19267
19268
19269
19270
19271
19272
19273
19274
19275
19276
19277
19278
19279
19280
19281
19282
19283
19284
19285
19286
19287
19288
19289
19290
19291
19292
19293
19294
19295
19296
19297
19298
19299
19300
19301
19302
19303
19304
19305
19306
19307
19308
19309
19310
19311
19312
19313
19314
19315
19316
19317
19318
19319
19320
19321
19322
19323
19324
19325
19326
19327
19328
19329
19330
19331
19332
19333
19334
19335
19336
19337
19338
19339
19340
19341
19342
19343
19344
19345
19346
19347
19348
19349
19350
19351
19352
19353
19354
19355
19356
19357
19358
19359
19360
19361
19362
19363
19364
19365
19366
19367
19368
19369
19370
19371
19372
19373
19374
19375
19376
19377
19378
19379
19380
19381
19382
19383
19384
19385
19386
19387
19388
19389
19390
19391
19392
19393
19394
19395
19396
19397
19398
19399
19400
19401
19402
19403
19404
19405
19406
19407
19408
19409
19410
19411
19412
19413
19414
19415
19416
19417
19418
19419
19420
19421
19422
19423
19424
19425
19426
19427
19428
19429
19430
19431
19432
19433
19434
19435
19436
19437
19438
19439
19440
19441
19442
19443
19444
19445
19446
19447
19448
19449
19450
19451
19452
19453
19454
19455
19456
19457
19458
19459
19460
19461
19462
19463
19464
19465
19466
19467
19468
19469
19470
19471
19472
19473
19474
19475
19476
19477
19478
19479
19480
19481
19482
19483
19484
19485
19486
19487
19488
19489
19490
19491
19492
19493
19494
19495
19496
19497
19498
19499
19500
19501
19502
19503
19504
19505
19506
19507
19508
19509
19510
19511
19512
19513
19514
19515
19516
19517
19518
19519
|
// Type definitions for Electron 27.0.2
// Project: http://electronjs.org/
// Definitions by: The Electron Team <https://github.com/electron/electron>
// Definitions: https://github.com/electron/typescript-definitions
/// <reference types="node" />
type DOMEvent = Event;
type GlobalResponse = Response;
type GlobalRequest = Request;
declare namespace Electron {
const NodeEventEmitter: typeof import('events').EventEmitter;
type Accelerator = string;
type Event<Params extends object = {}> = {
preventDefault: () => void;
readonly defaultPrevented: boolean;
} & Params;
interface App extends NodeJS.EventEmitter {
// Docs: https://electronjs.org/docs/api/app
/**
* Emitted when Chrome's accessibility support changes. This event fires when
* assistive technologies, such as screen readers, are enabled or disabled. See
* https://www.chromium.org/developers/design-documents/accessibility for more
* details.
*
* @platform darwin,win32
*/
on(event: 'accessibility-support-changed', listener: (event: Event,
/**
* `true` when Chrome's accessibility support is enabled, `false` otherwise.
*/
accessibilitySupportEnabled: boolean) => void): this;
once(event: 'accessibility-support-changed', listener: (event: Event,
/**
* `true` when Chrome's accessibility support is enabled, `false` otherwise.
*/
accessibilitySupportEnabled: boolean) => void): this;
addListener(event: 'accessibility-support-changed', listener: (event: Event,
/**
* `true` when Chrome's accessibility support is enabled, `false` otherwise.
*/
accessibilitySupportEnabled: boolean) => void): this;
removeListener(event: 'accessibility-support-changed', listener: (event: Event,
/**
* `true` when Chrome's accessibility support is enabled, `false` otherwise.
*/
accessibilitySupportEnabled: boolean) => void): this;
/**
* 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.
*
* @platform darwin
*/
on(event: 'activate', listener: (event: Event,
hasVisibleWindows: boolean) => void): this;
once(event: 'activate', listener: (event: Event,
hasVisibleWindows: boolean) => void): this;
addListener(event: 'activate', listener: (event: Event,
hasVisibleWindows: boolean) => void): this;
removeListener(event: 'activate', listener: (event: Event,
hasVisibleWindows: boolean) => void): this;
/**
* Emitted during Handoff after an activity from this device was successfully
* resumed on another one.
*
* @platform darwin
*/
on(event: 'activity-was-continued', listener: (event: Event,
/**
* A string identifying the activity. Maps to `NSUserActivity.activityType`.
*/
type: string,
/**
* Contains app-specific state stored by the activity.
*/
userInfo: unknown) => void): this;
once(event: 'activity-was-continued', listener: (event: Event,
/**
* A string identifying the activity. Maps to `NSUserActivity.activityType`.
*/
type: string,
/**
* Contains app-specific state stored by the activity.
*/
userInfo: unknown) => void): this;
addListener(event: 'activity-was-continued', listener: (event: Event,
/**
* A string identifying the activity. Maps to `NSUserActivity.activityType`.
*/
type: string,
/**
* Contains app-specific state stored by the activity.
*/
userInfo: unknown) => void): this;
removeListener(event: 'activity-was-continued', listener: (event: Event,
/**
* A string identifying the activity. Maps to `NSUserActivity.activityType`.
*/
type: string,
/**
* Contains app-specific state stored by the activity.
*/
userInfo: unknown) => void): this;
/**
* Emitted before the application starts closing its windows. Calling
* `event.preventDefault()` will prevent the default behavior, which is terminating
* the application.
*
* **Note:** If application quit was initiated by `autoUpdater.quitAndInstall()`,
* then `before-quit` is emitted _after_ emitting `close` 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.
*/
on(event: 'before-quit', listener: (event: Event) => void): this;
once(event: 'before-quit', listener: (event: Event) => void): this;
addListener(event: 'before-quit', listener: (event: Event) => void): this;
removeListener(event: 'before-quit', listener: (event: Event) => void): this;
/**
* Emitted when a browserWindow gets blurred.
*/
on(event: 'browser-window-blur', listener: (event: Event,
window: BrowserWindow) => void): this;
once(event: 'browser-window-blur', listener: (event: Event,
window: BrowserWindow) => void): this;
addListener(event: 'browser-window-blur', listener: (event: Event,
window: BrowserWindow) => void): this;
removeListener(event: 'browser-window-blur', listener: (event: Event,
window: BrowserWindow) => void): this;
/**
* Emitted when a new browserWindow is created.
*/
on(event: 'browser-window-created', listener: (event: Event,
window: BrowserWindow) => void): this;
once(event: 'browser-window-created', listener: (event: Event,
window: BrowserWindow) => void): this;
addListener(event: 'browser-window-created', listener: (event: Event,
window: BrowserWindow) => void): this;
removeListener(event: 'browser-window-created', listener: (event: Event,
window: BrowserWindow) => void): this;
/**
* Emitted when a browserWindow gets focused.
*/
on(event: 'browser-window-focus', listener: (event: Event,
window: BrowserWindow) => void): this;
once(event: 'browser-window-focus', listener: (event: Event,
window: BrowserWindow) => void): this;
addListener(event: 'browser-window-focus', listener: (event: Event,
window: BrowserWindow) => void): this;
removeListener(event: 'browser-window-focus', listener: (event: Event,
window: BrowserWindow) => void): this;
/**
* Emitted when failed to verify the `certificate` for `url`, to trust the
* certificate you should prevent the default behavior with
* `event.preventDefault()` and call `callback(true)`.
*/
on(event: 'certificate-error', listener: (event: Event,
webContents: WebContents,
url: string,
/**
* The error code
*/
error: string,
certificate: Certificate,
callback: (isTrusted: boolean) => void,
isMainFrame: boolean) => void): this;
once(event: 'certificate-error', listener: (event: Event,
webContents: WebContents,
url: string,
/**
* The error code
*/
error: string,
certificate: Certificate,
callback: (isTrusted: boolean) => void,
isMainFrame: boolean) => void): this;
addListener(event: 'certificate-error', listener: (event: Event,
webContents: WebContents,
url: string,
/**
* The error code
*/
error: string,
certificate: Certificate,
callback: (isTrusted: boolean) => void,
isMainFrame: boolean) => void): this;
removeListener(event: 'certificate-error', listener: (event: Event,
webContents: WebContents,
url: string,
/**
* The error code
*/
error: string,
certificate: Certificate,
callback: (isTrusted: boolean) => void,
isMainFrame: boolean) => void): this;
/**
* Emitted when the child process unexpectedly disappears. This is normally because
* it was crashed or killed. It does not include renderer processes.
*/
on(event: 'child-process-gone', listener: (event: Event,
details: Details) => void): this;
once(event: 'child-process-gone', listener: (event: Event,
details: Details) => void): this;
addListener(event: 'child-process-gone', listener: (event: Event,
details: Details) => void): this;
removeListener(event: 'child-process-gone', listener: (event: Event,
details: Details) => void): this;
/**
* Emitted during Handoff when an activity from a different device wants to be
* resumed. You should call `event.preventDefault()` 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 `Info.plist` under the
* `NSUserActivityTypes` key.
*
* @platform darwin
*/
on(event: 'continue-activity', listener: (event: Event,
/**
* A string identifying the activity. Maps to `NSUserActivity.activityType`.
*/
type: string,
/**
* Contains app-specific state stored by the activity on another device.
*/
userInfo: unknown,
details: ContinueActivityDetails) => void): this;
once(event: 'continue-activity', listener: (event: Event,
/**
* A string identifying the activity. Maps to `NSUserActivity.activityType`.
*/
type: string,
/**
* Contains app-specific state stored by the activity on another device.
*/
userInfo: unknown,
details: ContinueActivityDetails) => void): this;
addListener(event: 'continue-activity', listener: (event: Event,
/**
* A string identifying the activity. Maps to `NSUserActivity.activityType`.
*/
type: string,
/**
* Contains app-specific state stored by the activity on another device.
*/
userInfo: unknown,
details: ContinueActivityDetails) => void): this;
removeListener(event: 'continue-activity', listener: (event: Event,
/**
* A string identifying the activity. Maps to `NSUserActivity.activityType`.
*/
type: string,
/**
* Contains app-specific state stored by the activity on another device.
*/
userInfo: unknown,
details: ContinueActivityDetails) => void): this;
/**
* Emitted during Handoff when an activity from a different device fails to be
* resumed.
*
* @platform darwin
*/
on(event: 'continue-activity-error', listener: (event: Event,
/**
* A string identifying the activity. Maps to `NSUserActivity.activityType`.
*/
type: string,
/**
* A string with the error's localized description.
*/
error: string) => void): this;
once(event: 'continue-activity-error', listener: (event: Event,
/**
* A string identifying the activity. Maps to `NSUserActivity.activityType`.
*/
type: string,
/**
* A string with the error's localized description.
*/
error: string) => void): this;
addListener(event: 'continue-activity-error', listener: (event: Event,
/**
* A string identifying the activity. Maps to `NSUserActivity.activityType`.
*/
type: string,
/**
* A string with the error's localized description.
*/
error: string) => void): this;
removeListener(event: 'continue-activity-error', listener: (event: Event,
/**
* A string identifying the activity. Maps to `NSUserActivity.activityType`.
*/
type: string,
/**
* A string with the error's localized description.
*/
error: string) => void): this;
/**
* Emitted when the application becomes active. This differs from the `activate`
* event in that `did-become-active` is emitted every time the app becomes active,
* not only when Dock icon is clicked or application is re-launched. It is also
* emitted when a user switches to the app via the macOS App Switcher.
*
* @platform darwin
*/
on(event: 'did-become-active', listener: (event: Event) => void): this;
once(event: 'did-become-active', listener: (event: Event) => void): this;
addListener(event: 'did-become-active', listener: (event: Event) => void): this;
removeListener(event: 'did-become-active', listener: (event: Event) => void): this;
/**
* Emitted when the app is no longer active and doesn’t have focus. This can be
* triggered, for example, by clicking on another application or by using the macOS
* App Switcher to switch to another application.
*
* @platform darwin
*/
on(event: 'did-resign-active', listener: (event: Event) => void): this;
once(event: 'did-resign-active', listener: (event: Event) => void): this;
addListener(event: 'did-resign-active', listener: (event: Event) => void): this;
removeListener(event: 'did-resign-active', listener: (event: Event) => void): this;
/**
* Emitted whenever there is a GPU info update.
*/
on(event: 'gpu-info-update', listener: Function): this;
once(event: 'gpu-info-update', listener: Function): this;
addListener(event: 'gpu-info-update', listener: Function): this;
removeListener(event: 'gpu-info-update', listener: Function): this;
/**
* Emitted when the GPU process crashes or is killed.
*
* **Deprecated:** This event is superceded by the `child-process-gone` event which
* contains more information about why the child process disappeared. It isn't
* always because it crashed. The `killed` boolean can be replaced by checking
* `reason === 'killed'` when you switch to that event.
*
* @deprecated
*/
on(event: 'gpu-process-crashed', listener: (event: Event,
killed: boolean) => void): this;
once(event: 'gpu-process-crashed', listener: (event: Event,
killed: boolean) => void): this;
addListener(event: 'gpu-process-crashed', listener: (event: Event,
killed: boolean) => void): this;
removeListener(event: 'gpu-process-crashed', listener: (event: Event,
killed: boolean) => void): this;
/**
* Emitted when `webContents` wants to do basic auth.
*
* The default behavior is to cancel all authentications. To override this you
* should prevent the default behavior with `event.preventDefault()` and call
* `callback(username, password)` with the credentials.
*
* If `callback` is called without a username or password, the authentication
* request will be cancelled and the authentication error will be returned to the
* page.
*/
on(event: 'login', listener: (event: Event,
webContents: WebContents,
authenticationResponseDetails: AuthenticationResponseDetails,
authInfo: AuthInfo,
callback: (username?: string, password?: string) => void) => void): this;
once(event: 'login', listener: (event: Event,
webContents: WebContents,
authenticationResponseDetails: AuthenticationResponseDetails,
authInfo: AuthInfo,
callback: (username?: string, password?: string) => void) => void): this;
addListener(event: 'login', listener: (event: Event,
webContents: WebContents,
authenticationResponseDetails: AuthenticationResponseDetails,
authInfo: AuthInfo,
callback: (username?: string, password?: string) => void) => void): this;
removeListener(event: 'login', listener: (event: Event,
webContents: WebContents,
authenticationResponseDetails: AuthenticationResponseDetails,
authInfo: AuthInfo,
callback: (username?: string, password?: string) => void) => void): this;
/**
* Emitted when the user clicks the native macOS new tab button. The new tab button
* is only visible if the current `BrowserWindow` has a `tabbingIdentifier`
*
* @platform darwin
*/
on(event: 'new-window-for-tab', listener: (event: Event) => void): this;
once(event: 'new-window-for-tab', listener: (event: Event) => void): this;
addListener(event: 'new-window-for-tab', listener: (event: Event) => void): this;
removeListener(event: 'new-window-for-tab', listener: (event: Event) => void): this;
/**
* Emitted when the user wants to open a file with the application. The `open-file`
* event is usually emitted when the application is already open and the OS wants
* to reuse the application to open the file. `open-file` is also emitted when a
* file is dropped onto the dock and the application is not yet running. Make sure
* to listen for the `open-file` event very early in your application startup to
* handle this case (even before the `ready` event is emitted).
*
* You should call `event.preventDefault()` if you want to handle this event.
*
* On Windows, you have to parse `process.argv` (in the main process) to get the
* filepath.
*
* @platform darwin
*/
on(event: 'open-file', listener: (event: Event,
path: string) => void): this;
once(event: 'open-file', listener: (event: Event,
path: string) => void): this;
addListener(event: 'open-file', listener: (event: Event,
path: string) => void): this;
removeListener(event: 'open-file', listener: (event: Event,
path: string) => void): this;
/**
* Emitted when the user wants to open a URL with the application. Your
* application's `Info.plist` file must define the URL scheme within the
* `CFBundleURLTypes` key, and set `NSPrincipalClass` to `AtomApplication`.
*
* As with the `open-file` event, be sure to register a listener for the `open-url`
* event early in your application startup to detect if the application is being
* opened to handle a URL. If you register the listener in response to a `ready`
* event, you'll miss URLs that trigger the launch of your application.
*
* @platform darwin
*/
on(event: 'open-url', listener: (event: Event,
url: string) => void): this;
once(event: 'open-url', listener: (event: Event,
url: string) => void): this;
addListener(event: 'open-url', listener: (event: Event,
url: string) => void): this;
removeListener(event: 'open-url', listener: (event: Event,
url: string) => void): this;
/**
* 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.
*/
on(event: 'quit', listener: (event: Event,
exitCode: number) => void): this;
once(event: 'quit', listener: (event: Event,
exitCode: number) => void): this;
addListener(event: 'quit', listener: (event: Event,
exitCode: number) => void): this;
removeListener(event: 'quit', listener: (event: Event,
exitCode: number) => void): this;
/**
* Emitted once, when Electron has finished initializing. On macOS, `launchInfo`
* holds the `userInfo` of the `NSUserNotification` or information from
* `UNNotificationResponse` that was used to open the application, if it was
* launched from Notification Center. You can also call `app.isReady()` to check if
* this event has already fired and `app.whenReady()` to get a Promise that is
* fulfilled when Electron is initialized.
*/
on(event: 'ready', listener: (event: Event,
/**
* @platform darwin
*/
launchInfo: (Record<string, any>) | (NotificationResponse)) => void): this;
once(event: 'ready', listener: (event: Event,
/**
* @platform darwin
*/
launchInfo: (Record<string, any>) | (NotificationResponse)) => void): this;
addListener(event: 'ready', listener: (event: Event,
/**
* @platform darwin
*/
launchInfo: (Record<string, any>) | (NotificationResponse)) => void): this;
removeListener(event: 'ready', listener: (event: Event,
/**
* @platform darwin
*/
launchInfo: (Record<string, any>) | (NotificationResponse)) => void): this;
/**
* Emitted when the renderer process unexpectedly disappears. This is normally
* because it was crashed or killed.
*/
on(event: 'render-process-gone', listener: (event: Event,
webContents: WebContents,
details: RenderProcessGoneDetails) => void): this;
once(event: 'render-process-gone', listener: (event: Event,
webContents: WebContents,
details: RenderProcessGoneDetails) => void): this;
addListener(event: 'render-process-gone', listener: (event: Event,
webContents: WebContents,
details: RenderProcessGoneDetails) => void): this;
removeListener(event: 'render-process-gone', listener: (event: Event,
webContents: WebContents,
details: RenderProcessGoneDetails) => void): this;
/**
* Emitted when the renderer process of `webContents` crashes or is killed.
*
* **Deprecated:** This event is superceded by the `render-process-gone` event
* which contains more information about why the render process disappeared. It
* isn't always because it crashed. The `killed` boolean can be replaced by
* checking `reason === 'killed'` when you switch to that event.
*
* @deprecated
*/
on(event: 'renderer-process-crashed', listener: (event: Event,
webContents: WebContents,
killed: boolean) => void): this;
once(event: 'renderer-process-crashed', listener: (event: Event,
webContents: WebContents,
killed: boolean) => void): this;
addListener(event: 'renderer-process-crashed', listener: (event: Event,
webContents: WebContents,
killed: boolean) => void): this;
removeListener(event: 'renderer-process-crashed', listener: (event: Event,
webContents: WebContents,
killed: boolean) => void): this;
/**
* This event will be emitted inside the primary instance of your application when
* a second instance has been executed and calls `app.requestSingleInstanceLock()`.
*
* `argv` is an Array of the second instance's command line arguments, and
* `workingDirectory` is its current working directory. Usually applications
* respond to this by making their primary window focused and non-minimized.
*
* **Note:** `argv` will not be exactly the same list of arguments as those passed
* to the second instance. The order might change and additional arguments might be
* appended. If you need to maintain the exact same arguments, it's advised to use
* `additionalData` instead.
*
* **Note:** If the second instance is started by a different user than the first,
* the `argv` array will not include the arguments.
*
* This event is guaranteed to be emitted after the `ready` event of `app` gets
* emitted.
*
* **Note:** Extra command line arguments might be added by Chromium, such as
* `--original-process-start-time`.
*/
on(event: 'second-instance', listener: (event: Event,
/**
* An array of the second instance's command line arguments
*/
argv: string[],
/**
* The second instance's working directory
*/
workingDirectory: string,
/**
* A JSON object of additional data passed from the second instance
*/
additionalData: unknown) => void): this;
once(event: 'second-instance', listener: (event: Event,
/**
* An array of the second instance's command line arguments
*/
argv: string[],
/**
* The second instance's working directory
*/
workingDirectory: string,
/**
* A JSON object of additional data passed from the second instance
*/
additionalData: unknown) => void): this;
addListener(event: 'second-instance', listener: (event: Event,
/**
* An array of the second instance's command line arguments
*/
argv: string[],
/**
* The second instance's working directory
*/
workingDirectory: string,
/**
* A JSON object of additional data passed from the second instance
*/
additionalData: unknown) => void): this;
removeListener(event: 'second-instance', listener: (event: Event,
/**
* An array of the second instance's command line arguments
*/
argv: string[],
/**
* The second instance's working directory
*/
workingDirectory: string,
/**
* A JSON object of additional data passed from the second instance
*/
additionalData: unknown) => void): this;
/**
* Emitted when a client certificate is requested.
*
* The `url` corresponds to the navigation entry requesting the client certificate
* and `callback` can be called with an entry filtered from the list. Using
* `event.preventDefault()` prevents the application from using the first
* certificate from the store.
*/
on(event: 'select-client-certificate', listener: (event: Event,
webContents: WebContents,
url: string,
certificateList: Certificate[],
callback: (certificate?: Certificate) => void) => void): this;
once(event: 'select-client-certificate', listener: (event: Event,
webContents: WebContents,
url: string,
certificateList: Certificate[],
callback: (certificate?: Certificate) => void) => void): this;
addListener(event: 'select-client-certificate', listener: (event: Event,
webContents: WebContents,
url: string,
certificateList: Certificate[],
callback: (certificate?: Certificate) => void) => void): this;
removeListener(event: 'select-client-certificate', listener: (event: Event,
webContents: WebContents,
url: string,
certificateList: Certificate[],
callback: (certificate?: Certificate) => void) => void): this;
/**
* Emitted when Electron has created a new `session`.
*/
on(event: 'session-created', listener: (session: Session) => void): this;
once(event: 'session-created', listener: (session: Session) => void): this;
addListener(event: 'session-created', listener: (session: Session) => void): this;
removeListener(event: 'session-created', listener: (session: Session) => void): this;
/**
* Emitted when Handoff is about to be resumed on another device. If you need to
* update the state to be transferred, you should call `event.preventDefault()`
* immediately, construct a new `userInfo` dictionary and call
* `app.updateCurrentActivity()` in a timely manner. Otherwise, the operation will
* fail and `continue-activity-error` will be called.
*
* @platform darwin
*/
on(event: 'update-activity-state', listener: (event: Event,
/**
* A string identifying the activity. Maps to `NSUserActivity.activityType`.
*/
type: string,
/**
* Contains app-specific state stored by the activity.
*/
userInfo: unknown) => void): this;
once(event: 'update-activity-state', listener: (event: Event,
/**
* A string identifying the activity. Maps to `NSUserActivity.activityType`.
*/
type: string,
/**
* Contains app-specific state stored by the activity.
*/
userInfo: unknown) => void): this;
addListener(event: 'update-activity-state', listener: (event: Event,
/**
* A string identifying the activity. Maps to `NSUserActivity.activityType`.
*/
type: string,
/**
* Contains app-specific state stored by the activity.
*/
userInfo: unknown) => void): this;
removeListener(event: 'update-activity-state', listener: (event: Event,
/**
* A string identifying the activity. Maps to `NSUserActivity.activityType`.
*/
type: string,
/**
* Contains app-specific state stored by the activity.
*/
userInfo: unknown) => void): this;
/**
* Emitted when a new webContents is created.
*/
on(event: 'web-contents-created', listener: (event: Event,
webContents: WebContents) => void): this;
once(event: 'web-contents-created', listener: (event: Event,
webContents: WebContents) => void): this;
addListener(event: 'web-contents-created', listener: (event: Event,
webContents: WebContents) => void): this;
removeListener(event: 'web-contents-created', listener: (event: Event,
webContents: WebContents) => void): this;
/**
* Emitted during Handoff before an activity from a different device wants to be
* resumed. You should call `event.preventDefault()` if you want to handle this
* event.
*
* @platform darwin
*/
on(event: 'will-continue-activity', listener: (event: Event,
/**
* A string identifying the activity. Maps to `NSUserActivity.activityType`.
*/
type: string) => void): this;
once(event: 'will-continue-activity', listener: (event: Event,
/**
* A string identifying the activity. Maps to `NSUserActivity.activityType`.
*/
type: string) => void): this;
addListener(event: 'will-continue-activity', listener: (event: Event,
/**
* A string identifying the activity. Maps to `NSUserActivity.activityType`.
*/
type: string) => void): this;
removeListener(event: 'will-continue-activity', listener: (event: Event,
/**
* A string identifying the activity. Maps to `NSUserActivity.activityType`.
*/
type: string) => void): this;
/**
* Emitted when the application has finished basic startup. On Windows and Linux,
* the `will-finish-launching` event is the same as the `ready` event; on macOS,
* this event represents the `applicationWillFinishLaunching` notification of
* `NSApplication`.
*
* In most cases, you should do everything in the `ready` event handler.
*/
on(event: 'will-finish-launching', listener: Function): this;
once(event: 'will-finish-launching', listener: Function): this;
addListener(event: 'will-finish-launching', listener: Function): this;
removeListener(event: 'will-finish-launching', listener: Function): this;
/**
* Emitted when all windows have been closed and the application will quit. Calling
* `event.preventDefault()` will prevent the default behavior, which is terminating
* the application.
*
* See the description of the `window-all-closed` event for the differences between
* the `will-quit` and `window-all-closed` 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.
*/
on(event: 'will-quit', listener: (event: Event) => void): this;
once(event: 'will-quit', listener: (event: Event) => void): this;
addListener(event: 'will-quit', listener: (event: Event) => void): this;
removeListener(event: 'will-quit', listener: (event: Event) => void): this;
/**
* 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 `Cmd + Q`, or the developer called
* `app.quit()`, Electron will first try to close all the windows and then emit the
* `will-quit` event, and in this case the `window-all-closed` event would not be
* emitted.
*/
on(event: 'window-all-closed', listener: Function): this;
once(event: 'window-all-closed', listener: Function): this;
addListener(event: 'window-all-closed', listener: Function): this;
removeListener(event: 'window-all-closed', listener: Function): this;
/**
* Adds `path` 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.
*
* @platform darwin,win32
*/
addRecentDocument(path: string): void;
/**
* Clears the recent documents list.
*
* @platform darwin,win32
*/
clearRecentDocuments(): void;
/**
* Configures host resolution (DNS and DNS-over-HTTPS). By default, the following
* resolvers will be used, in order:
*
* * DNS-over-HTTPS, if the DNS provider supports it, then
* * the built-in resolver (enabled on macOS only by default), then
* * the system's resolver (e.g. `getaddrinfo`).
*
* This can be configured to either restrict usage of non-encrypted DNS
* (`secureDnsMode: "secure"`), or disable DNS-over-HTTPS (`secureDnsMode: "off"`).
* It is also possible to enable or disable the built-in resolver.
*
* To disable insecure DNS, you can specify a `secureDnsMode` of `"secure"`. If you
* do so, you should make sure to provide a list of DNS-over-HTTPS servers to use,
* in case the user's DNS configuration does not include a provider that supports
* DoH.
*
* This API must be called after the `ready` event is emitted.
*/
configureHostResolver(options: ConfigureHostResolverOptions): void;
/**
* 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.
*/
disableDomainBlockingFor3DAPIs(): void;
/**
* Disables hardware acceleration for current app.
*
* This method can only be called before app is ready.
*/
disableHardwareAcceleration(): void;
/**
* Enables full sandbox mode on the app. This means that all renderers will be
* launched sandboxed, regardless of the value of the `sandbox` flag in
* `WebPreferences`.
*
* This method can only be called before app is ready.
*/
enableSandbox(): void;
/**
* Exits immediately with `exitCode`. `exitCode` defaults to 0.
*
* All windows will be closed immediately without asking the user, and the
* `before-quit` and `will-quit` events will not be emitted.
*/
exit(exitCode?: number): void;
/**
* 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 `steal` option as sparingly as possible.
*/
focus(options?: FocusOptions): void;
/**
* Resolve with an object containing the following:
*
* * `icon` NativeImage - the display icon of the app handling the protocol.
* * `path` string - installation path of the app handling the protocol.
* * `name` 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.
*
* @platform darwin,win32
*/
getApplicationInfoForProtocol(url: string): Promise<Electron.ApplicationInfoForProtocolReturnValue>;
/**
* 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 `Electron` 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 `.desktop` suffix.
*
* This method returns the application name of the default handler for the protocol
* (aka URI scheme) of a URL.
*/
getApplicationNameForProtocol(url: string): string;
/**
* Array of `ProcessMetric` objects that correspond to memory and CPU usage
* statistics of all the processes associated with the app.
*/
getAppMetrics(): ProcessMetric[];
/**
* The current application directory.
*/
getAppPath(): string;
/**
* The current value displayed in the counter badge.
*
* @platform linux,darwin
*/
getBadgeCount(): number;
/**
* The type of the currently running activity.
*
* @platform darwin
*/
getCurrentActivityType(): string;
/**
* 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 `.mp3`, `.png`, etc.
* * Icons inside the file itself, like `.exe`, `.dll`, `.ico`.
*
* On _Linux_ and _macOS_, icons depend on the application associated with file
* mime type.
*/
getFileIcon(path: string, options?: FileIconOptions): Promise<Electron.NativeImage>;
/**
* The Graphics Feature Status from `chrome://gpu/`.
*
* **Note:** This information is only usable after the `gpu-info-update` event is
* emitted.
*/
getGPUFeatureStatus(): GPUFeatureStatus;
/**
* For `infoType` equal to `complete`: Promise is fulfilled with `Object`
* containing all the GPU Information as in chromium's GPUInfo object. This
* includes the version and driver information that's shown on `chrome://gpu` page.
*
* For `infoType` equal to `basic`: Promise is fulfilled with `Object` containing
* fewer attributes than when requested with `complete`. Here's an example of basic
* response:
*
* Using `basic` should be preferred if only basic information like `vendorId` or
* `deviceId` is needed.
*/
getGPUInfo(infoType: 'basic' | 'complete'): Promise<unknown>;
/**
* * `minItems` 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).
* * `removedItems` JumpListItem[] - Array of `JumpListItem` 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 `app.setJumpList()`, Windows will not display any custom
* category that contains any of the removed items.
*
* @platform win32
*/
getJumpListSettings(): JumpListSettings;
/**
* The current application locale, fetched using Chromium's `l10n_util` 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
* `locales` folder.
*
* **Note:** This API must be called after the `ready` event is emitted.
*
* **Note:** To see example return values of this API compared to other locale and
* language APIs, see `app.getPreferredSystemLanguages()`.
*/
getLocale(): 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.
*/
getLocaleCountryCode(): string;
/**
* If you provided `path` and `args` options to `app.setLoginItemSettings`, then
* you need to pass the same arguments here for `openAtLogin` to be set correctly.
*
*
* * `openAtLogin` boolean - `true` if the app is set to open at login.
* * `openAsHidden` boolean _macOS_ - `true` if the app is set to open as hidden at
* login. This setting is not available on MAS builds.
* * `wasOpenedAtLogin` boolean _macOS_ - `true` if the app was opened at login
* automatically. This setting is not available on MAS builds.
* * `wasOpenedAsHidden` boolean _macOS_ - `true` 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.
* * `restoreState` boolean _macOS_ - `true` 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.
* * `executableWillLaunchAtLogin` boolean _Windows_ - `true` if app is set to open
* at login and its run key is not deactivated. This differs from `openAtLogin` as
* it ignores the `args` option, this property will be true if the given executable
* would be launched at login with **any** arguments.
* * `launchItems` Object[] _Windows_
* * `name` string _Windows_ - name value of a registry entry.
* * `path` string _Windows_ - The executable to an app that corresponds to a
* registry entry.
* * `args` string[] _Windows_ - the command-line arguments to pass to the
* executable.
* * `scope` string _Windows_ - one of `user` or `machine`. Indicates whether the
* registry entry is under `HKEY_CURRENT USER` or `HKEY_LOCAL_MACHINE`.
* * `enabled` boolean _Windows_ - `true` if the app registry key is startup
* approved and therefore shows as `enabled` in Task Manager and Windows settings.
*
* @platform darwin,win32
*/
getLoginItemSettings(options?: LoginItemSettingsOptions): LoginItemSettings;
/**
* The current application's name, which is the name in the application's
* `package.json` file.
*
* Usually the `name` field of `package.json` is a short lowercase name, according
* to the npm modules spec. You should usually also specify a `productName` field,
* which is your application's full capitalized name, and which will be preferred
* over `name` by Electron.
*/
getName(): string;
/**
* A path to a special directory or file associated with `name`. On failure, an
* `Error` is thrown.
*
* If `app.getPath('logs')` is called without called `app.setAppLogsPath()` being
* called first, a default log directory will be created equivalent to calling
* `app.setAppLogsPath()` without a `path` parameter.
*/
getPath(name: 'home' | 'appData' | 'userData' | 'sessionData' | 'temp' | 'exe' | 'module' | 'desktop' | 'documents' | 'downloads' | 'music' | 'pictures' | 'videos' | 'recent' | 'logs' | 'crashDumps'): string;
/**
* The user's preferred system languages from most preferred to least preferred,
* including the country codes if applicable. A user can modify and add to this
* list on Windows or macOS through the Language and Region settings.
*
* The API uses `GlobalizationPreferences` (with a fallback to
* `GetSystemPreferredUILanguages`) on Windows, `\[NSLocale preferredLanguages\]`
* on macOS, and `g_get_language_names` on Linux.
*
* This API can be used for purposes such as deciding what language to present the
* application in.
*
* Here are some examples of return values of the various language and locale APIs
* with different configurations:
*
* On Windows, given application locale is German, the regional format is Finnish
* (Finland), and the preferred system languages from most to least preferred are
* French (Canada), English (US), Simplified Chinese (China), Finnish, and Spanish
* (Latin America):
*
* On macOS, given the application locale is German, the region is Finland, and the
* preferred system languages from most to least preferred are French (Canada),
* English (US), Simplified Chinese, and Spanish (Latin America):
*
* Both the available languages and regions and the possible return values differ
* between the two operating systems.
*
* As can be seen with the example above, on Windows, it is possible that a
* preferred system language has no country code, and that one of the preferred
* system languages corresponds with the language used for the regional format. On
* macOS, the region serves more as a default country code: the user doesn't need
* to have Finnish as a preferred language to use Finland as the region,and the
* country code `FI` is used as the country code for preferred system languages
* that do not have associated countries in the language name.
*/
getPreferredSystemLanguages(): string[];
/**
* The current system locale. On Windows and Linux, it is fetched using Chromium's
* `i18n` library. On macOS, `[NSLocale currentLocale]` is used instead. To get the
* user's current system language, which is not always the same as the locale, it
* is better to use `app.getPreferredSystemLanguages()`.
*
* Different operating systems also use the regional data differently:
*
* * Windows 11 uses the regional format for numbers, dates, and times.
* * macOS Monterey uses the region for formatting numbers, dates, times, and for
* selecting the currency symbol to use.
*
* Therefore, this API can be used for purposes such as choosing a format for
* rendering dates and times in a calendar app, especially when the developer wants
* the format to be consistent with the OS.
*
* **Note:** This API must be called after the `ready` event is emitted.
*
* **Note:** To see example return values of this API compared to other locale and
* language APIs, see `app.getPreferredSystemLanguages()`.
*/
getSystemLocale(): string;
/**
* The version of the loaded application. If no version is found in the
* application's `package.json` file, the version of the current bundle or
* executable is returned.
*/
getVersion(): string;
/**
* This method returns whether or not this instance of your app is currently
* holding the single instance lock. You can request the lock with
* `app.requestSingleInstanceLock()` and release with
* `app.releaseSingleInstanceLock()`
*/
hasSingleInstanceLock(): boolean;
/**
* Hides all application windows without minimizing them.
*
* @platform darwin
*/
hide(): void;
/**
* Imports the certificate in pkcs12 format into the platform certificate store.
* `callback` is called with the `result` of import operation, a value of `0`
* indicates success while any other value indicates failure according to Chromium
* net_error_list.
*
* @platform linux
*/
importCertificate(options: ImportCertificateOptions, callback: (result: number) => void): void;
/**
* Invalidates the current Handoff user activity.
*
* @platform darwin
*/
invalidateCurrentActivity(): void;
/**
* `true` if Chrome's accessibility support is enabled, `false` otherwise. This API
* will return `true` if the use of assistive technologies, such as screen readers,
* has been detected. See
* https://www.chromium.org/developers/design-documents/accessibility for more
* details.
*
* @platform darwin,win32
*/
isAccessibilitySupportEnabled(): boolean;
/**
* 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 `~/Library/Preferences/com.apple.LaunchServices.plist` on the
* macOS machine. Please refer to Apple's documentation for details.
*
* The API uses the Windows Registry and `LSCopyDefaultHandlerForURLScheme`
* internally.
*/
isDefaultProtocolClient(protocol: string, path?: string, args?: string[]): boolean;
/**
* whether or not the current OS version allows for native emoji pickers.
*/
isEmojiPanelSupported(): boolean;
/**
* `true` if the application—including all of its windows—is hidden (e.g. with
* `Command-H`), `false` otherwise.
*
* @platform darwin
*/
isHidden(): boolean;
/**
* Whether the application is currently running from the systems Application
* folder. Use in combination with `app.moveToApplicationsFolder()`
*
* @platform darwin
*/
isInApplicationsFolder(): boolean;
/**
* `true` if Electron has finished initializing, `false` otherwise. See also
* `app.whenReady()`.
*/
isReady(): boolean;
/**
* whether `Secure Keyboard Entry` is enabled.
*
* By default this API will return `false`.
*
* @platform darwin
*/
isSecureKeyboardEntryEnabled(): boolean;
/**
* Whether the current desktop environment is Unity launcher.
*
* @platform linux
*/
isUnityRunning(): boolean;
/**
* 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 `dialog` 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 preexisting
* 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 `false` will ensure no
* further action is taken, returning `true` 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.
*
* @platform darwin
*/
moveToApplicationsFolder(options?: MoveToApplicationsFolderOptions): boolean;
/**
* Try to close all windows. The `before-quit` event will be emitted first. If all
* windows are successfully closed, the `will-quit` event will be emitted and by
* default the application will terminate.
*
* This method guarantees that all `beforeunload` and `unload` event handlers are
* correctly executed. It is possible that a window cancels the quitting by
* returning `false` in the `beforeunload` event handler.
*/
quit(): void;
/**
* 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 `args` is specified, the `args` will
* be passed as command line arguments instead. When `execPath` is specified, the
* `execPath` will be executed for relaunch instead of current app.
*
* Note that this method does not quit the app when executed, you have to call
* `app.quit` or `app.exit` after calling `app.relaunch` to make the app restart.
*
* When `app.relaunch` 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:
*/
relaunch(options?: RelaunchOptions): void;
/**
* Releases all locks that were created by `requestSingleInstanceLock`. This will
* allow multiple instances of the application to once again run side by side.
*/
releaseSingleInstanceLock(): void;
/**
* 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.
*
* @platform darwin,win32
*/
removeAsDefaultProtocolClient(protocol: string, path?: string, args?: string[]): boolean;
/**
* 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 `true` if your process is the primary instance of your
* application and your app should continue loading. It returns `false` 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 `open-file` and `open-url`
* 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:
*/
requestSingleInstanceLock(additionalData?: Record<any, any>): boolean;
/**
* Marks the current Handoff user activity as inactive without invalidating it.
*
* @platform darwin
*/
resignCurrentActivity(): void;
/**
* Set the about panel options. This will override the values defined in the app's
* `.plist` 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 `credits` 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.
*/
setAboutPanelOptions(options: AboutPanelOptionsOptions): void;
/**
* 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 `ready` event is emitted.
*
* **Note:** Rendering accessibility tree can significantly affect the performance
* of your app. It should not be enabled by default.
*
* @platform darwin,win32
*/
setAccessibilitySupportEnabled(enabled: boolean): void;
/**
* 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.
*
* @platform darwin
*/
setActivationPolicy(policy: 'regular' | 'accessory' | 'prohibited'): void;
/**
* Sets or creates a directory your app's logs which can then be manipulated with
* `app.getPath()` or `app.setPath(pathName, newPath)`.
*
* Calling `app.setAppLogsPath()` without a `path` parameter will result in this
* directory being set to `~/Library/Logs/YourAppName` on _macOS_, and inside the
* `userData` directory on _Linux_ and _Windows_.
*/
setAppLogsPath(path?: string): void;
/**
* Changes the Application User Model ID to `id`.
*
* @platform win32
*/
setAppUserModelId(id: string): void;
/**
* 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 `your-protocol://` 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 `info.plist`, which cannot be modified at runtime. However, you can change
* the file during build time via Electron Forge, Electron Packager, or by editing
* `info.plist` with a text editor. Please refer to Apple's documentation for
* details.
*
* **Note:** In a Windows Store environment (when packaged as an `appx`) this API
* will return `true` 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 `LSSetDefaultHandlerForURLScheme`
* internally.
*/
setAsDefaultProtocolClient(protocol: string, path?: string, args?: string[]): boolean;
/**
* Whether the call succeeded.
*
* Sets the counter badge for current app. Setting the count to `0` 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 `.desktop` file to work. For more
* information, please read the Unity integration documentation.
*
* **Note:** On macOS, you need to ensure that your application has the permission
* to display notifications for this method to work.
*
* @platform linux,darwin
*/
setBadgeCount(count?: number): boolean;
/**
* Sets or removes a custom Jump List for the application, and returns one of the
* following strings:
*
* * `ok` - Nothing went wrong.
* * `error` - One or more errors occurred, enable runtime logging to figure out
* the likely cause.
* * `invalidSeparatorError` - An attempt was made to add a separator to a custom
* category in the Jump List. Separators are only allowed in the standard `Tasks`
* category.
* * `fileTypeRegistrationError` - An attempt was made to add a file link to the
* Jump List for a file type the app isn't registered to handle.
* * `customCategoryAccessDeniedError` - Custom categories can't be added to the
* Jump List due to user privacy or group policy settings.
*
* If `categories` is `null` 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 `JumpListCategory` object has neither the `type` nor the `name`
* property set then its `type` is assumed to be `tasks`. If the `name` property is
* set but the `type` property is omitted then the `type` is assumed to be
* `custom`.
*
* **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 `app.setJumpList(categories)`. 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 `app.getJumpListSettings()`.
*
* **Note:** The maximum length of a Jump List item's `description` 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:
*
* @platform win32
*/
setJumpList(categories: (JumpListCategory[]) | (null)): ('ok' | 'error' | 'invalidSeparatorError' | 'fileTypeRegistrationError' | 'customCategoryAccessDeniedError');
/**
* To work with Electron's `autoUpdater` 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:
*
* @platform darwin,win32
*/
setLoginItemSettings(settings: Settings): void;
/**
* 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.
*/
setName(name: string): void;
/**
* Overrides the `path` to a special directory or file associated with `name`. If
* the path specifies a directory that does not exist, an `Error` is thrown. In
* that case, the directory should be created with `fs.mkdirSync` or similar.
*
* You can only override paths of a `name` defined in `app.getPath`.
*
* By default, web pages' cookies and caches will be stored under the `sessionData`
* directory. If you want to change this location, you have to override the
* `sessionData` path before the `ready` event of the `app` module is emitted.
*/
setPath(name: string, path: string): void;
/**
* Set the `Secure Keyboard Entry` 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 `Secure Keyboard Entry` only when it is needed and disable it
* when it is no longer needed.
*
* @platform darwin
*/
setSecureKeyboardEntryEnabled(enabled: boolean): void;
/**
* Creates an `NSUserActivity` and sets it as the current activity. The activity is
* eligible for Handoff to another device afterward.
*
* @platform darwin
*/
setUserActivity(type: string, userInfo: any, webpageURL?: string): void;
/**
* Adds `tasks` to the Tasks category of the Jump List on Windows.
*
* `tasks` is an array of `Task` objects.
*
* Whether the call succeeded.
*
* **Note:** If you'd like to customize the Jump List even more use
* `app.setJumpList(categories)` instead.
*
* @platform win32
*/
setUserTasks(tasks: Task[]): boolean;
/**
* Shows application windows after they were hidden. Does not automatically focus
* them.
*
* @platform darwin
*/
show(): void;
/**
* Show the app's about panel options. These options can be overridden with
* `app.setAboutPanelOptions(options)`. This function runs asynchronously.
*/
showAboutPanel(): void;
/**
* Show the platform's native emoji picker.
*
* @platform darwin,win32
*/
showEmojiPanel(): void;
/**
* This function **must** be called once you have finished accessing the security
* scoped file. If you do not remember to stop accessing the bookmark, kernel
* resources will be leaked and your app will lose its ability to reach outside the
* sandbox completely, until your app is restarted.
*
* Start accessing a security scoped resource. With this method Electron
* applications that are packaged for the Mac App Store may reach outside their
* sandbox to access files chosen by the user. See Apple's documentation for a
* description of how this system works.
*
* @platform mas
*/
startAccessingSecurityScopedResource(bookmarkData: string): Function;
/**
* Updates the current activity if its type matches `type`, merging the entries
* from `userInfo` into its current `userInfo` dictionary.
*
* @platform darwin
*/
updateCurrentActivity(type: string, userInfo: any): void;
/**
* fulfilled when Electron is initialized. May be used as a convenient alternative
* to checking `app.isReady()` and subscribing to the `ready` event if the app is
* not ready yet.
*/
whenReady(): Promise<void>;
/**
* A `boolean` property that's `true` if Chrome's accessibility support is enabled,
* `false` otherwise. This property will be `true` if the use of assistive
* technologies, such as screen readers, has been detected. Setting this property
* to `true` manually enables Chrome's accessibility support, allowing developers
* 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 `ready` event is emitted.
*
* **Note:** Rendering accessibility tree can significantly affect the performance
* of your app. It should not be enabled by default.
*
* @platform darwin,win32
*/
accessibilitySupportEnabled: boolean;
/**
* A `Menu | null` property that returns `Menu` if one has been set and `null`
* otherwise. Users can pass a Menu to set this property.
*/
applicationMenu: (Menu) | (null);
/**
* An `Integer` property that returns the badge count for current app. Setting the
* count to `0` will hide the badge.
*
* On macOS, setting this with any nonzero integer shows on the dock icon. On
* Linux, this property only works for Unity launcher.
*
* **Note:** Unity launcher requires a `.desktop` file to work. For more
* information, please read the Unity integration documentation.
*
* **Note:** On macOS, you need to ensure that your application has the permission
* to display notifications for this property to take effect.
*
* @platform linux,darwin
*/
badgeCount: number;
/**
* A `CommandLine` object that allows you to read and manipulate the command line
* arguments that Chromium uses.
*
*/
readonly commandLine: CommandLine;
/**
* A `Dock` `| undefined` object that allows you to perform actions on your app
* icon in the user's dock on macOS.
*
* @platform darwin
*/
readonly dock: Dock;
/**
* A `boolean` property that returns `true` if the app is packaged, `false`
* otherwise. For many apps, this property can be used to distinguish development
* and production environments.
*
*/
readonly isPackaged: boolean;
/**
* A `string` property that indicates the current application's name, which is the
* name in the application's `package.json` file.
*
* Usually the `name` field of `package.json` is a short lowercase name, according
* to the npm modules spec. You should usually also specify a `productName` field,
* which is your application's full capitalized name, and which will be preferred
* over `name` by Electron.
*/
name: string;
/**
* A `boolean` which when `true` indicates that the app is currently running under
* an ARM64 translator (like the macOS Rosetta Translator Environment or Windows
* WOW).
*
* You can use this property to prompt users to download the arm64 version of your
* application when they are mistakenly running the x64 version under Rosetta or
* WOW.
*
* @platform darwin,win32
*/
readonly runningUnderARM64Translation: boolean;
/**
* A `boolean` which when `true` indicates that the app is currently running under
* the Rosetta Translator Environment.
*
* You can use this property to prompt users to download the arm64 version of your
* application when they are running the x64 version under Rosetta incorrectly.
*
* **Deprecated:** This property is superceded by the
* `runningUnderARM64Translation` property which detects when the app is being
* translated to ARM64 in both macOS and Windows.
*
* @deprecated
* @platform darwin
*/
readonly runningUnderRosettaTranslation: boolean;
/**
* A `string` which is the user agent string Electron will use as a global
* fallback.
*
* This is the user agent that will be used when no user agent is set at the
* `webContents` or `session` level. It is useful for ensuring that your entire
* app has the same user agent. Set to a custom value as early as possible in your
* app's initialization to ensure that your overridden value is used.
*/
userAgentFallback: string;
}
interface AutoUpdater extends NodeJS.EventEmitter {
// Docs: https://electronjs.org/docs/api/auto-updater
/**
* This event is emitted after a user calls `quitAndInstall()`.
*
* When this API is called, the `before-quit` event is not emitted before all
* windows are closed. As a result you should listen to this event if you wish to
* perform actions before the windows are closed while a process is quitting, as
* well as listening to `before-quit`.
*/
on(event: 'before-quit-for-update', listener: Function): this;
once(event: 'before-quit-for-update', listener: Function): this;
addListener(event: 'before-quit-for-update', listener: Function): this;
removeListener(event: 'before-quit-for-update', listener: Function): this;
/**
* Emitted when checking if an update has started.
*/
on(event: 'checking-for-update', listener: Function): this;
once(event: 'checking-for-update', listener: Function): this;
addListener(event: 'checking-for-update', listener: Function): this;
removeListener(event: 'checking-for-update', listener: Function): this;
/**
* Emitted when there is an error while updating.
*/
on(event: 'error', listener: (error: Error) => void): this;
once(event: 'error', listener: (error: Error) => void): this;
addListener(event: 'error', listener: (error: Error) => void): this;
removeListener(event: 'error', listener: (error: Error) => void): this;
/**
* Emitted when there is an available update. The update is downloaded
* automatically.
*/
on(event: 'update-available', listener: Function): this;
once(event: 'update-available', listener: Function): this;
addListener(event: 'update-available', listener: Function): this;
removeListener(event: 'update-available', listener: Function): this;
/**
* Emitted when an update has been downloaded.
*
* On Windows only `releaseName` is available.
*
* **Note:** It is not strictly necessary to handle this event. A successfully
* downloaded update will still be applied the next time the application starts.
*/
on(event: 'update-downloaded', listener: (event: Event,
releaseNotes: string,
releaseName: string,
releaseDate: Date,
updateURL: string) => void): this;
once(event: 'update-downloaded', listener: (event: Event,
releaseNotes: string,
releaseName: string,
releaseDate: Date,
updateURL: string) => void): this;
addListener(event: 'update-downloaded', listener: (event: Event,
releaseNotes: string,
releaseName: string,
releaseDate: Date,
updateURL: string) => void): this;
removeListener(event: 'update-downloaded', listener: (event: Event,
releaseNotes: string,
releaseName: string,
releaseDate: Date,
updateURL: string) => void): this;
/**
* Emitted when there is no available update.
*/
on(event: 'update-not-available', listener: Function): this;
once(event: 'update-not-available', listener: Function): this;
addListener(event: 'update-not-available', listener: Function): this;
removeListener(event: 'update-not-available', listener: Function): this;
/**
* Asks the server whether there is an update. You must call `setFeedURL` before
* using this API.
*
* **Note:** If an update is available it will be downloaded automatically. Calling
* `autoUpdater.checkForUpdates()` twice will download the update two times.
*/
checkForUpdates(): void;
/**
* The current update feed URL.
*/
getFeedURL(): string;
/**
* Restarts the app and installs the update after it has been downloaded. It should
* only be called after `update-downloaded` has been emitted.
*
* Under the hood calling `autoUpdater.quitAndInstall()` will close all application
* windows first, and automatically call `app.quit()` after all windows have been
* closed.
*
* **Note:** It is not strictly necessary to call this function to apply an update,
* as a successfully downloaded update will always be applied the next time the
* application starts.
*/
quitAndInstall(): void;
/**
* Sets the `url` and initialize the auto updater.
*/
setFeedURL(options: FeedURLOptions): void;
}
interface BluetoothDevice {
// Docs: https://electronjs.org/docs/api/structures/bluetooth-device
deviceId: string;
deviceName: string;
}
class BrowserView {
// Docs: https://electronjs.org/docs/api/browser-view
/**
* BrowserView
*/
constructor(options?: BrowserViewConstructorOptions);
/**
* The `bounds` of this BrowserView instance as `Object`.
*
* @experimental
*/
getBounds(): Rectangle;
/**
* @experimental
*/
setAutoResize(options: AutoResizeOptions): void;
/**
* Examples of valid `color` values:
*
* * Hex
* * #fff (RGB)
* * #ffff (ARGB)
* * #ffffff (RRGGBB)
* * #ffffffff (AARRGGBB)
* * RGB
* * rgb(([\d]+),\s*([\d]+),\s*([\d]+))
* * e.g. rgb(255, 255, 255)
* * RGBA
* * rgba(([\d]+),\s*([\d]+),\s*([\d]+),\s*([\d.]+))
* * e.g. rgba(255, 255, 255, 1.0)
* * HSL
* * hsl((-?[\d.]+),\s*([\d.]+)%,\s*([\d.]+)%)
* * e.g. hsl(200, 20%, 50%)
* * HSLA
* * hsla((-?[\d.]+),\s*([\d.]+)%,\s*([\d.]+)%,\s*([\d.]+))
* * e.g. hsla(200, 20%, 50%, 0.5)
* * Color name
* * Options are listed in SkParseColor.cpp
* * Similar to CSS Color Module Level 3 keywords, but case-sensitive.
* * e.g. `blueviolet` or `red`
*
* **Note:** Hex format with alpha takes `AARRGGBB` or `ARGB`, _not_ `RRGGBBA` or
* `RGA`.
*
* @experimental
*/
setBackgroundColor(color: string): void;
/**
* Resizes and moves the view to the supplied bounds relative to the window.
*
* @experimental
*/
setBounds(bounds: Rectangle): void;
/**
* A `WebContents` object owned by this view.
*
* @experimental
*/
webContents: WebContents;
}
class BrowserWindow extends NodeEventEmitter {
// Docs: https://electronjs.org/docs/api/browser-window
/**
* Emitted when the window is set or unset to show always on top of other windows.
*/
on(event: 'always-on-top-changed', listener: (event: Event,
isAlwaysOnTop: boolean) => void): this;
once(event: 'always-on-top-changed', listener: (event: Event,
isAlwaysOnTop: boolean) => void): this;
addListener(event: 'always-on-top-changed', listener: (event: Event,
isAlwaysOnTop: boolean) => void): this;
removeListener(event: 'always-on-top-changed', listener: (event: Event,
isAlwaysOnTop: boolean) => void): this;
/**
* Emitted when an App Command is invoked. These are typically related to keyboard
* media keys or browser commands, as well as the "Back" button built into some
* mice on Windows.
*
* Commands are lowercased, underscores are replaced with hyphens, and the
* `APPCOMMAND_` prefix is stripped off. e.g. `APPCOMMAND_BROWSER_BACKWARD` is
* emitted as `browser-backward`.
*
* The following app commands are explicitly supported on Linux:
*
* * `browser-backward`
* * `browser-forward`
*
* @platform win32,linux
*/
on(event: 'app-command', listener: (event: Event,
command: string) => void): this;
once(event: 'app-command', listener: (event: Event,
command: string) => void): this;
addListener(event: 'app-command', listener: (event: Event,
command: string) => void): this;
removeListener(event: 'app-command', listener: (event: Event,
command: string) => void): this;
/**
* Emitted when the window loses focus.
*/
on(event: 'blur', listener: Function): this;
once(event: 'blur', listener: Function): this;
addListener(event: 'blur', listener: Function): this;
removeListener(event: 'blur', listener: Function): this;
/**
* Emitted when the window is going to be closed. It's emitted before the
* `beforeunload` and `unload` event of the DOM. Calling `event.preventDefault()`
* will cancel the close.
*
* Usually you would want to use the `beforeunload` handler to decide whether the
* window should be closed, which will also be called when the window is reloaded.
* In Electron, returning any value other than `undefined` would cancel the close.
* For example:
*
* _**Note**: There is a subtle difference between the behaviors of
* `window.onbeforeunload = handler` and `window.addEventListener('beforeunload',
* handler)`. It is recommended to always set the `event.returnValue` explicitly,
* instead of only returning a value, as the former works more consistently within
* Electron._
*/
on(event: 'close', listener: (event: Event) => void): this;
once(event: 'close', listener: (event: Event) => void): this;
addListener(event: 'close', listener: (event: Event) => void): this;
removeListener(event: 'close', listener: (event: Event) => void): this;
/**
* Emitted when the window is closed. After you have received this event you should
* remove the reference to the window and avoid using it any more.
*/
on(event: 'closed', listener: Function): this;
once(event: 'closed', listener: Function): this;
addListener(event: 'closed', listener: Function): this;
removeListener(event: 'closed', listener: Function): this;
/**
* Emitted when the window enters a full-screen state.
*/
on(event: 'enter-full-screen', listener: Function): this;
once(event: 'enter-full-screen', listener: Function): this;
addListener(event: 'enter-full-screen', listener: Function): this;
removeListener(event: 'enter-full-screen', listener: Function): this;
/**
* Emitted when the window enters a full-screen state triggered by HTML API.
*/
on(event: 'enter-html-full-screen', listener: Function): this;
once(event: 'enter-html-full-screen', listener: Function): this;
addListener(event: 'enter-html-full-screen', listener: Function): this;
removeListener(event: 'enter-html-full-screen', listener: Function): this;
/**
* Emitted when the window gains focus.
*/
on(event: 'focus', listener: Function): this;
once(event: 'focus', listener: Function): this;
addListener(event: 'focus', listener: Function): this;
removeListener(event: 'focus', listener: Function): this;
/**
* Emitted when the window is hidden.
*/
on(event: 'hide', listener: Function): this;
once(event: 'hide', listener: Function): this;
addListener(event: 'hide', listener: Function): this;
removeListener(event: 'hide', listener: Function): this;
/**
* Emitted when the window leaves a full-screen state.
*/
on(event: 'leave-full-screen', listener: Function): this;
once(event: 'leave-full-screen', listener: Function): this;
addListener(event: 'leave-full-screen', listener: Function): this;
removeListener(event: 'leave-full-screen', listener: Function): this;
/**
* Emitted when the window leaves a full-screen state triggered by HTML API.
*/
on(event: 'leave-html-full-screen', listener: Function): this;
once(event: 'leave-html-full-screen', listener: Function): this;
addListener(event: 'leave-html-full-screen', listener: Function): this;
removeListener(event: 'leave-html-full-screen', listener: Function): this;
/**
* Emitted when window is maximized.
*/
on(event: 'maximize', listener: Function): this;
once(event: 'maximize', listener: Function): this;
addListener(event: 'maximize', listener: Function): this;
removeListener(event: 'maximize', listener: Function): this;
/**
* Emitted when the window is minimized.
*/
on(event: 'minimize', listener: Function): this;
once(event: 'minimize', listener: Function): this;
addListener(event: 'minimize', listener: Function): this;
removeListener(event: 'minimize', listener: Function): this;
/**
* Emitted when the window is being moved to a new position.
*/
on(event: 'move', listener: Function): this;
once(event: 'move', listener: Function): this;
addListener(event: 'move', listener: Function): this;
removeListener(event: 'move', listener: Function): this;
/**
* Emitted once when the window is moved to a new position.
*
* **Note**: On macOS this event is an alias of `move`.
*
* @platform darwin,win32
*/
on(event: 'moved', listener: Function): this;
once(event: 'moved', listener: Function): this;
addListener(event: 'moved', listener: Function): this;
removeListener(event: 'moved', listener: Function): this;
/**
* Emitted when the native new tab button is clicked.
*
* @platform darwin
*/
on(event: 'new-window-for-tab', listener: Function): this;
once(event: 'new-window-for-tab', listener: Function): this;
addListener(event: 'new-window-for-tab', listener: Function): this;
removeListener(event: 'new-window-for-tab', listener: Function): this;
/**
* Emitted when the document changed its title, calling `event.preventDefault()`
* will prevent the native window's title from changing. `explicitSet` is false
* when title is synthesized from file URL.
*/
on(event: 'page-title-updated', listener: (event: Event,
title: string,
explicitSet: boolean) => void): this;
once(event: 'page-title-updated', listener: (event: Event,
title: string,
explicitSet: boolean) => void): this;
addListener(event: 'page-title-updated', listener: (event: Event,
title: string,
explicitSet: boolean) => void): this;
removeListener(event: 'page-title-updated', listener: (event: Event,
title: string,
explicitSet: boolean) => void): this;
/**
* Emitted when the web page has been rendered (while not being shown) and window
* can be displayed without a visual flash.
*
* Please note that using this event implies that the renderer will be considered
* "visible" and paint even though `show` is false. This event will never fire if
* you use `paintWhenInitiallyHidden: false`
*/
on(event: 'ready-to-show', listener: Function): this;
once(event: 'ready-to-show', listener: Function): this;
addListener(event: 'ready-to-show', listener: Function): this;
removeListener(event: 'ready-to-show', listener: Function): this;
/**
* Emitted after the window has been resized.
*/
on(event: 'resize', listener: Function): this;
once(event: 'resize', listener: Function): this;
addListener(event: 'resize', listener: Function): this;
removeListener(event: 'resize', listener: Function): this;
/**
* Emitted once when the window has finished being resized.
*
* This is usually emitted when the window has been resized manually. On macOS,
* resizing the window with `setBounds`/`setSize` and setting the `animate`
* parameter to `true` will also emit this event once resizing has finished.
*
* @platform darwin,win32
*/
on(event: 'resized', listener: Function): this;
once(event: 'resized', listener: Function): this;
addListener(event: 'resized', listener: Function): this;
removeListener(event: 'resized', listener: Function): this;
/**
* Emitted when the unresponsive web page becomes responsive again.
*/
on(event: 'responsive', listener: Function): this;
once(event: 'responsive', listener: Function): this;
addListener(event: 'responsive', listener: Function): this;
removeListener(event: 'responsive', listener: Function): this;
/**
* Emitted when the window is restored from a minimized state.
*/
on(event: 'restore', listener: Function): this;
once(event: 'restore', listener: Function): this;
addListener(event: 'restore', listener: Function): this;
removeListener(event: 'restore', listener: Function): this;
/**
* Emitted on trackpad rotation gesture. Continually emitted until rotation gesture
* is ended. The `rotation` value on each emission is the angle in degrees rotated
* since the last emission. The last emitted event upon a rotation gesture will
* always be of value `0`. Counter-clockwise rotation values are positive, while
* clockwise ones are negative.
*
* @platform darwin
*/
on(event: 'rotate-gesture', listener: (event: Event,
rotation: number) => void): this;
once(event: 'rotate-gesture', listener: (event: Event,
rotation: number) => void): this;
addListener(event: 'rotate-gesture', listener: (event: Event,
rotation: number) => void): this;
removeListener(event: 'rotate-gesture', listener: (event: Event,
rotation: number) => void): this;
/**
* Emitted when scroll wheel event phase has begun.
*
* > **Note** This event is deprecated beginning in Electron 22.0.0. See Breaking
* Changes for details of how to migrate to using the WebContents `input-event`
* event.
*
* @deprecated
* @platform darwin
*/
on(event: 'scroll-touch-begin', listener: Function): this;
once(event: 'scroll-touch-begin', listener: Function): this;
addListener(event: 'scroll-touch-begin', listener: Function): this;
removeListener(event: 'scroll-touch-begin', listener: Function): this;
/**
* Emitted when scroll wheel event phase filed upon reaching the edge of element.
*
* > **Note** This event is deprecated beginning in Electron 22.0.0. See Breaking
* Changes for details of how to migrate to using the WebContents `input-event`
* event.
*
* @deprecated
* @platform darwin
*/
on(event: 'scroll-touch-edge', listener: Function): this;
once(event: 'scroll-touch-edge', listener: Function): this;
addListener(event: 'scroll-touch-edge', listener: Function): this;
removeListener(event: 'scroll-touch-edge', listener: Function): this;
/**
* Emitted when scroll wheel event phase has ended.
*
* > **Note** This event is deprecated beginning in Electron 22.0.0. See Breaking
* Changes for details of how to migrate to using the WebContents `input-event`
* event.
*
* @deprecated
* @platform darwin
*/
on(event: 'scroll-touch-end', listener: Function): this;
once(event: 'scroll-touch-end', listener: Function): this;
addListener(event: 'scroll-touch-end', listener: Function): this;
removeListener(event: 'scroll-touch-end', listener: Function): this;
/**
* Emitted when window session is going to end due to force shutdown or machine
* restart or session log off.
*
* @platform win32
*/
on(event: 'session-end', listener: Function): this;
once(event: 'session-end', listener: Function): this;
addListener(event: 'session-end', listener: Function): this;
removeListener(event: 'session-end', listener: Function): this;
/**
* Emitted when the window opens a sheet.
*
* @platform darwin
*/
on(event: 'sheet-begin', listener: Function): this;
once(event: 'sheet-begin', listener: Function): this;
addListener(event: 'sheet-begin', listener: Function): this;
removeListener(event: 'sheet-begin', listener: Function): this;
/**
* Emitted when the window has closed a sheet.
*
* @platform darwin
*/
on(event: 'sheet-end', listener: Function): this;
once(event: 'sheet-end', listener: Function): this;
addListener(event: 'sheet-end', listener: Function): this;
removeListener(event: 'sheet-end', listener: Function): this;
/**
* Emitted when the window is shown.
*/
on(event: 'show', listener: Function): this;
once(event: 'show', listener: Function): this;
addListener(event: 'show', listener: Function): this;
removeListener(event: 'show', listener: Function): this;
/**
* Emitted on 3-finger swipe. Possible directions are `up`, `right`, `down`,
* `left`.
*
* The method underlying this event is built to handle older macOS-style trackpad
* swiping, where the content on the screen doesn't move with the swipe. Most macOS
* trackpads are not configured to allow this kind of swiping anymore, so in order
* for it to emit properly the 'Swipe between pages' preference in `System
* Preferences > Trackpad > More Gestures` must be set to 'Swipe with two or three
* fingers'.
*
* @platform darwin
*/
on(event: 'swipe', listener: (event: Event,
direction: string) => void): this;
once(event: 'swipe', listener: (event: Event,
direction: string) => void): this;
addListener(event: 'swipe', listener: (event: Event,
direction: string) => void): this;
removeListener(event: 'swipe', listener: (event: Event,
direction: string) => void): this;
/**
* Emitted when the system context menu is triggered on the window, this is
* normally only triggered when the user right clicks on the non-client area of
* your window. This is the window titlebar or any area you have declared as
* `-webkit-app-region: drag` in a frameless window.
*
* Calling `event.preventDefault()` will prevent the menu from being displayed.
*
* @platform win32
*/
on(event: 'system-context-menu', listener: (event: Event,
/**
* The screen coordinates the context menu was triggered at
*/
point: Point) => void): this;
once(event: 'system-context-menu', listener: (event: Event,
/**
* The screen coordinates the context menu was triggered at
*/
point: Point) => void): this;
addListener(event: 'system-context-menu', listener: (event: Event,
/**
* The screen coordinates the context menu was triggered at
*/
point: Point) => void): this;
removeListener(event: 'system-context-menu', listener: (event: Event,
/**
* The screen coordinates the context menu was triggered at
*/
point: Point) => void): this;
/**
* Emitted when the window exits from a maximized state.
*/
on(event: 'unmaximize', listener: Function): this;
once(event: 'unmaximize', listener: Function): this;
addListener(event: 'unmaximize', listener: Function): this;
removeListener(event: 'unmaximize', listener: Function): this;
/**
* Emitted when the web page becomes unresponsive.
*/
on(event: 'unresponsive', listener: Function): this;
once(event: 'unresponsive', listener: Function): this;
addListener(event: 'unresponsive', listener: Function): this;
removeListener(event: 'unresponsive', listener: Function): this;
/**
* Emitted before the window is moved. On Windows, calling `event.preventDefault()`
* will prevent the window from being moved.
*
* Note that this is only emitted when the window is being moved manually. Moving
* the window with `setPosition`/`setBounds`/`center` will not emit this event.
*
* @platform darwin,win32
*/
on(event: 'will-move', listener: (event: Event,
/**
* Location the window is being moved to.
*/
newBounds: Rectangle) => void): this;
once(event: 'will-move', listener: (event: Event,
/**
* Location the window is being moved to.
*/
newBounds: Rectangle) => void): this;
addListener(event: 'will-move', listener: (event: Event,
/**
* Location the window is being moved to.
*/
newBounds: Rectangle) => void): this;
removeListener(event: 'will-move', listener: (event: Event,
/**
* Location the window is being moved to.
*/
newBounds: Rectangle) => void): this;
/**
* Emitted before the window is resized. Calling `event.preventDefault()` will
* prevent the window from being resized.
*
* Note that this is only emitted when the window is being resized manually.
* Resizing the window with `setBounds`/`setSize` will not emit this event.
*
* The possible values and behaviors of the `edge` option are platform dependent.
* Possible values are:
*
* * On Windows, possible values are `bottom`, `top`, `left`, `right`, `top-left`,
* `top-right`, `bottom-left`, `bottom-right`.
* * On macOS, possible values are `bottom` and `right`.
* * The value `bottom` is used to denote vertical resizing.
* * The value `right` is used to denote horizontal resizing.
*
* @platform darwin,win32
*/
on(event: 'will-resize', listener: (event: Event,
/**
* Size the window is being resized to.
*/
newBounds: Rectangle,
details: WillResizeDetails) => void): this;
once(event: 'will-resize', listener: (event: Event,
/**
* Size the window is being resized to.
*/
newBounds: Rectangle,
details: WillResizeDetails) => void): this;
addListener(event: 'will-resize', listener: (event: Event,
/**
* Size the window is being resized to.
*/
newBounds: Rectangle,
details: WillResizeDetails) => void): this;
removeListener(event: 'will-resize', listener: (event: Event,
/**
* Size the window is being resized to.
*/
newBounds: Rectangle,
details: WillResizeDetails) => void): this;
/**
* BrowserWindow
*/
constructor(options?: BrowserWindowConstructorOptions);
/**
* The window that owns the given `browserView`. If the given view is not attached
* to any window, returns `null`.
*/
static fromBrowserView(browserView: BrowserView): (BrowserWindow) | (null);
/**
* The window with the given `id`.
*/
static fromId(id: number): (BrowserWindow) | (null);
/**
* The window that owns the given `webContents` or `null` if the contents are not
* owned by a window.
*/
static fromWebContents(webContents: WebContents): (BrowserWindow) | (null);
/**
* An array of all opened browser windows.
*/
static getAllWindows(): BrowserWindow[];
/**
* The window that is focused in this application, otherwise returns `null`.
*/
static getFocusedWindow(): (BrowserWindow) | (null);
/**
* Replacement API for setBrowserView supporting work with multi browser views.
*
* @experimental
*/
addBrowserView(browserView: BrowserView): void;
/**
* Adds a window as a tab on this window, after the tab for the window instance.
*
* @platform darwin
*/
addTabbedWindow(browserWindow: BrowserWindow): void;
/**
* Removes focus from the window.
*/
blur(): void;
blurWebView(): void;
/**
* Resolves with a NativeImage
*
* Captures a snapshot of the page within `rect`. Omitting `rect` will capture the
* whole visible page. If the page is not visible, `rect` may be empty. The page is
* considered visible when its browser window is hidden and the capturer count is
* non-zero. If you would like the page to stay hidden, you should ensure that
* `stayHidden` is set to true.
*/
capturePage(rect?: Rectangle, opts?: Opts): Promise<Electron.NativeImage>;
/**
* Moves window to the center of the screen.
*/
center(): void;
/**
* Try to close the window. This has the same effect as a user manually clicking
* the close button of the window. The web page may cancel the close though. See
* the close event.
*/
close(): void;
/**
* Closes the currently open Quick Look panel.
*
* @platform darwin
*/
closeFilePreview(): void;
/**
* Force closing the window, the `unload` and `beforeunload` event won't be emitted
* for the web page, and `close` event will also not be emitted for this window,
* but it guarantees the `closed` event will be emitted.
*/
destroy(): void;
/**
* Starts or stops flashing the window to attract user's attention.
*/
flashFrame(flag: boolean): void;
/**
* Focuses on the window.
*/
focus(): void;
focusOnWebView(): void;
/**
* Gets the background color of the window in Hex (`#RRGGBB`) format.
*
* See Setting `backgroundColor`.
*
* **Note:** The alpha value is _not_ returned alongside the red, green, and blue
* values.
*/
getBackgroundColor(): string;
/**
* The `bounds` of the window as `Object`.
*
* **Note:** On macOS, the y-coordinate value returned will be at minimum the Tray
* height. For example, calling `win.setBounds({ x: 25, y: 20, width: 800, height:
* 600 })` with a tray height of 38 means that `win.getBounds()` will return `{ x:
* 25, y: 38, width: 800, height: 600 }`.
*/
getBounds(): Rectangle;
/**
* The `BrowserView` attached to `win`. Returns `null` if one is not attached.
* Throws an error if multiple `BrowserView`s are attached.
*
* @experimental
*/
getBrowserView(): (BrowserView) | (null);
/**
* a sorted by z-index array of all BrowserViews that have been attached with
* `addBrowserView` or `setBrowserView`. The top-most BrowserView is the last
* element of the array.
*
* **Note:** The BrowserView API is currently experimental and may change or be
* removed in future Electron releases.
*
* @experimental
*/
getBrowserViews(): BrowserView[];
/**
* All child windows.
*/
getChildWindows(): BrowserWindow[];
/**
* The `bounds` of the window's client area as `Object`.
*/
getContentBounds(): Rectangle;
/**
* Contains the window's client area's width and height.
*/
getContentSize(): number[];
/**
* Contains the window's maximum width and height.
*/
getMaximumSize(): number[];
/**
* Window id in the format of DesktopCapturerSource's id. For example
* "window:1324:0".
*
* More precisely the format is `window:id:other_id` where `id` is `HWND` on
* Windows, `CGWindowID` (`uint64_t`) on macOS and `Window` (`unsigned long`) on
* Linux. `other_id` is used to identify web contents (tabs) so within the same top
* level window.
*/
getMediaSourceId(): string;
/**
* Contains the window's minimum width and height.
*/
getMinimumSize(): number[];
/**
* The platform-specific handle of the window.
*
* The native type of the handle is `HWND` on Windows, `NSView*` on macOS, and
* `Window` (`unsigned long`) on Linux.
*/
getNativeWindowHandle(): Buffer;
/**
* Contains the window bounds of the normal state
*
* **Note:** whatever the current state of the window : maximized, minimized or in
* fullscreen, this function always returns the position and size of the window in
* normal state. In normal state, getBounds and getNormalBounds returns the same
* `Rectangle`.
*/
getNormalBounds(): Rectangle;
/**
* between 0.0 (fully transparent) and 1.0 (fully opaque). On Linux, always returns
* 1.
*/
getOpacity(): number;
/**
* The parent window or `null` if there is no parent.
*/
getParentWindow(): (BrowserWindow) | (null);
/**
* Contains the window's current position.
*/
getPosition(): number[];
/**
* The pathname of the file the window represents.
*
* @platform darwin
*/
getRepresentedFilename(): string;
/**
* Contains the window's width and height.
*/
getSize(): number[];
/**
* The title of the native window.
*
* **Note:** The title of the web page can be different from the title of the
* native window.
*/
getTitle(): string;
/**
* The custom position for the traffic light buttons in frameless window, `{ x: 0,
* y: 0 }` will be returned when there is no custom position.
*
* > **Note** This function is deprecated. Use getWindowButtonPosition instead.
*
* @deprecated
* @platform darwin
*/
getTrafficLightPosition(): Point;
/**
* The custom position for the traffic light buttons in frameless window, `null`
* will be returned when there is no custom position.
*
* @platform darwin
*/
getWindowButtonPosition(): (Point) | (null);
/**
* Whether the window has a shadow.
*/
hasShadow(): boolean;
/**
* Hides the window.
*/
hide(): void;
/**
* Hooks a windows message. The `callback` is called when the message is received
* in the WndProc.
*
* @platform win32
*/
hookWindowMessage(message: number, callback: (wParam: Buffer, lParam: Buffer) => void): void;
/**
* Invalidates the window shadow so that it is recomputed based on the current
* window shape.
*
* `BrowserWindows` that are transparent can sometimes leave behind visual
* artifacts on macOS. This method can be used to clear these artifacts when, for
* example, performing an animation.
*
* @platform darwin
*/
invalidateShadow(): void;
/**
* Whether the window is always on top of other windows.
*/
isAlwaysOnTop(): boolean;
/**
* Whether the window can be manually closed by user.
*
* On Linux always returns `true`.
*
* @platform darwin,win32
*/
isClosable(): boolean;
/**
* Whether the window is destroyed.
*/
isDestroyed(): boolean;
/**
* Whether the window's document has been edited.
*
* @platform darwin
*/
isDocumentEdited(): boolean;
/**
* whether the window is enabled.
*/
isEnabled(): boolean;
/**
* Whether the window can be focused.
*
* @platform darwin,win32
*/
isFocusable(): boolean;
/**
* Whether the window is focused.
*/
isFocused(): boolean;
/**
* Whether the window is in fullscreen mode.
*/
isFullScreen(): boolean;
/**
* Whether the maximize/zoom window button toggles fullscreen mode or maximizes the
* window.
*/
isFullScreenable(): boolean;
/**
* Whether the window will be hidden when the user toggles into mission control.
*
* @platform darwin
*/
isHiddenInMissionControl(): boolean;
/**
* Whether the window is in kiosk mode.
*/
isKiosk(): boolean;
/**
* Whether the window can be manually maximized by user.
*
* On Linux always returns `true`.
*
* @platform darwin,win32
*/
isMaximizable(): boolean;
/**
* Whether the window is maximized.
*/
isMaximized(): boolean;
/**
* Whether menu bar automatically hides itself.
*
* @platform win32,linux
*/
isMenuBarAutoHide(): boolean;
/**
* Whether the menu bar is visible.
*
* @platform win32,linux
*/
isMenuBarVisible(): boolean;
/**
* Whether the window can be manually minimized by the user.
*
* On Linux always returns `true`.
*
* @platform darwin,win32
*/
isMinimizable(): boolean;
/**
* Whether the window is minimized.
*/
isMinimized(): boolean;
/**
* Whether current window is a modal window.
*/
isModal(): boolean;
/**
* Whether the window can be moved by user.
*
* On Linux always returns `true`.
*
* @platform darwin,win32
*/
isMovable(): boolean;
/**
* Whether the window is in normal state (not maximized, not minimized, not in
* fullscreen mode).
*/
isNormal(): boolean;
/**
* Whether the window can be manually resized by the user.
*/
isResizable(): boolean;
/**
* Whether the window is in simple (pre-Lion) fullscreen mode.
*
* @platform darwin
*/
isSimpleFullScreen(): boolean;
/**
* Whether the window is in Windows 10 tablet mode.
*
* Since Windows 10 users can use their PC as tablet, under this mode apps can
* choose to optimize their UI for tablets, such as enlarging the titlebar and
* hiding titlebar buttons.
*
* This API returns whether the window is in tablet mode, and the `resize` event
* can be be used to listen to changes to tablet mode.
*
* @platform win32
*/
isTabletMode(): boolean;
/**
* Whether the window is visible to the user in the foreground of the app.
*/
isVisible(): boolean;
/**
* Whether the window is visible on all workspaces.
*
* **Note:** This API always returns false on Windows.
*
* @platform darwin,linux
*/
isVisibleOnAllWorkspaces(): boolean;
/**
* `true` or `false` depending on whether the message is hooked.
*
* @platform win32
*/
isWindowMessageHooked(message: number): boolean;
/**
* the promise will resolve when the page has finished loading (see
* `did-finish-load`), and rejects if the page fails to load (see `did-fail-load`).
*
* Same as `webContents.loadFile`, `filePath` should be a path to an HTML file
* relative to the root of your application. See the `webContents` docs for more
* information.
*/
loadFile(filePath: string, options?: LoadFileOptions): Promise<void>;
/**
* the promise will resolve when the page has finished loading (see
* `did-finish-load`), and rejects if the page fails to load (see `did-fail-load`).
*
* Same as `webContents.loadURL(url[, options])`.
*
* The `url` can be a remote address (e.g. `http://`) or a path to a local HTML
* file using the `file://` protocol.
*
* To ensure that file URLs are properly formatted, it is recommended to use Node's
* `url.format` method:
*
* You can load a URL using a `POST` request with URL-encoded data by doing the
* following:
*/
loadURL(url: string, options?: LoadURLOptions): Promise<void>;
/**
* Maximizes the window. This will also show (but not focus) the window if it isn't
* being displayed already.
*/
maximize(): void;
/**
* Merges all windows into one window with multiple tabs when native tabs are
* enabled and there is more than one open window.
*
* @platform darwin
*/
mergeAllWindows(): void;
/**
* Minimizes the window. On some platforms the minimized window will be shown in
* the Dock.
*/
minimize(): void;
/**
* Moves window above the source window in the sense of z-order. If the
* `mediaSourceId` is not of type window or if the window does not exist then this
* method throws an error.
*/
moveAbove(mediaSourceId: string): void;
/**
* Moves the current tab into a new window if native tabs are enabled and there is
* more than one tab in the current window.
*
* @platform darwin
*/
moveTabToNewWindow(): void;
/**
* Moves window to top(z-order) regardless of focus
*/
moveTop(): void;
/**
* Uses Quick Look to preview a file at a given path.
*
* @platform darwin
*/
previewFile(path: string, displayName?: string): void;
/**
* Same as `webContents.reload`.
*/
reload(): void;
/**
* @experimental
*/
removeBrowserView(browserView: BrowserView): void;
/**
* Remove the window's menu bar.
*
* @platform linux,win32
*/
removeMenu(): void;
/**
* Restores the window from minimized state to its previous state.
*/
restore(): void;
/**
* Selects the next tab when native tabs are enabled and there are other tabs in
* the window.
*
* @platform darwin
*/
selectNextTab(): void;
/**
* Selects the previous tab when native tabs are enabled and there are other tabs
* in the window.
*
* @platform darwin
*/
selectPreviousTab(): void;
/**
* Sets whether the window should show always on top of other windows. After
* setting this, the window is still a normal window, not a toolbox window which
* can not be focused on.
*/
setAlwaysOnTop(flag: boolean, level?: 'normal' | 'floating' | 'torn-off-menu' | 'modal-panel' | 'main-menu' | 'status' | 'pop-up-menu' | 'screen-saver', relativeLevel?: number): void;
/**
* Sets the properties for the window's taskbar button.
*
* **Note:** `relaunchCommand` and `relaunchDisplayName` must always be set
* together. If one of those properties is not set, then neither will be used.
*
* @platform win32
*/
setAppDetails(options: AppDetailsOptions): void;
/**
* This will make a window maintain an aspect ratio. The extra size allows a
* developer to have space, specified in pixels, not included within the aspect
* ratio calculations. This API already takes into account the difference between a
* window's size and its content size.
*
* Consider a normal window with an HD video player and associated controls.
* Perhaps there are 15 pixels of controls on the left edge, 25 pixels of controls
* on the right edge and 50 pixels of controls below the player. In order to
* maintain a 16:9 aspect ratio (standard aspect ratio for HD @1920x1080) within
* the player itself we would call this function with arguments of 16/9 and {
* width: 40, height: 50 }. The second argument doesn't care where the extra width
* and height are within the content view--only that they exist. Sum any extra
* width and height areas you have within the overall content view.
*
* The aspect ratio is not respected when window is resized programmatically with
* APIs like `win.setSize`.
*
* To reset an aspect ratio, pass 0 as the `aspectRatio` value:
* `win.setAspectRatio(0)`.
*/
setAspectRatio(aspectRatio: number, extraSize?: Size): void;
/**
* Controls whether to hide cursor when typing.
*
* @platform darwin
*/
setAutoHideCursor(autoHide: boolean): void;
/**
* Sets whether the window menu bar should hide itself automatically. Once set the
* menu bar will only show when users press the single `Alt` key.
*
* If the menu bar is already visible, calling `setAutoHideMenuBar(true)` won't
* hide it immediately.
*
* @platform win32,linux
*/
setAutoHideMenuBar(hide: boolean): void;
/**
* Examples of valid `backgroundColor` values:
*
* * Hex
* * #fff (shorthand RGB)
* * #ffff (shorthand ARGB)
* * #ffffff (RGB)
* * #ffffffff (ARGB)
* * RGB
* * rgb(([\d]+),\s*([\d]+),\s*([\d]+))
* * e.g. rgb(255, 255, 255)
* * RGBA
* * rgba(([\d]+),\s*([\d]+),\s*([\d]+),\s*([\d.]+))
* * e.g. rgba(255, 255, 255, 1.0)
* * HSL
* * hsl((-?[\d.]+),\s*([\d.]+)%,\s*([\d.]+)%)
* * e.g. hsl(200, 20%, 50%)
* * HSLA
* * hsla((-?[\d.]+),\s*([\d.]+)%,\s*([\d.]+)%,\s*([\d.]+))
* * e.g. hsla(200, 20%, 50%, 0.5)
* * Color name
* * Options are listed in SkParseColor.cpp
* * Similar to CSS Color Module Level 3 keywords, but case-sensitive.
* * e.g. `blueviolet` or `red`
*
* Sets the background color of the window. See Setting `backgroundColor`.
*/
setBackgroundColor(backgroundColor: string): void;
/**
* This method sets the browser window's system-drawn background material,
* including behind the non-client area.
*
* See the Windows documentation for more details.
*
* **Note:** This method is only supported on Windows 11 22H2 and up.
*
* @platform win32
*/
setBackgroundMaterial(material: 'auto' | 'none' | 'mica' | 'acrylic' | 'tabbed'): void;
/**
* Resizes and moves the window to the supplied bounds. Any properties that are not
* supplied will default to their current values.
*
* **Note:** On macOS, the y-coordinate value cannot be smaller than the Tray
* height. The tray height has changed over time and depends on the operating
* system, but is between 20-40px. Passing a value lower than the tray height will
* result in a window that is flush to the tray.
*/
setBounds(bounds: Partial<Rectangle>, animate?: boolean): void;
/**
* @experimental
*/
setBrowserView(browserView: (BrowserView) | (null)): void;
/**
* Sets whether the window can be manually closed by user. On Linux does nothing.
*
* @platform darwin,win32
*/
setClosable(closable: boolean): void;
/**
* Resizes and moves the window's client area (e.g. the web page) to the supplied
* bounds.
*/
setContentBounds(bounds: Rectangle, animate?: boolean): void;
/**
* Prevents the window contents from being captured by other apps.
*
* On macOS it sets the NSWindow's sharingType to NSWindowSharingNone. On Windows
* it calls SetWindowDisplayAffinity with `WDA_EXCLUDEFROMCAPTURE`. For Windows 10
* version 2004 and up the window will be removed from capture entirely, older
* Windows versions behave as if `WDA_MONITOR` is applied capturing a black window.
*
* @platform darwin,win32
*/
setContentProtection(enable: boolean): void;
/**
* Resizes the window's client area (e.g. the web page) to `width` and `height`.
*/
setContentSize(width: number, height: number, animate?: boolean): void;
/**
* Specifies whether the window’s document has been edited, and the icon in title
* bar will become gray when set to `true`.
*
* @platform darwin
*/
setDocumentEdited(edited: boolean): void;
/**
* Disable or enable the window.
*/
setEnabled(enable: boolean): void;
/**
* Changes whether the window can be focused.
*
* On macOS it does not remove the focus from the window.
*
* @platform darwin,win32
*/
setFocusable(focusable: boolean): void;
/**
* Sets whether the window should be in fullscreen mode.
*
* **Note:** On macOS, fullscreen transitions take place asynchronously. If further
* actions depend on the fullscreen state, use the 'enter-full-screen' or
* 'leave-full-screen' events.
*/
setFullScreen(flag: boolean): void;
/**
* Sets whether the maximize/zoom window button toggles fullscreen mode or
* maximizes the window.
*/
setFullScreenable(fullscreenable: boolean): void;
/**
* Sets whether the window should have a shadow.
*/
setHasShadow(hasShadow: boolean): void;
/**
* Sets whether the window will be hidden when the user toggles into mission
* control.
*
* @platform darwin
*/
setHiddenInMissionControl(hidden: boolean): void;
/**
* Changes window icon.
*
* @platform win32,linux
*/
setIcon(icon: (NativeImage) | (string)): void;
/**
* Makes the window ignore all mouse events.
*
* All mouse events happened in this window will be passed to the window below this
* window, but if this window has focus, it will still receive keyboard events.
*/
setIgnoreMouseEvents(ignore: boolean, options?: IgnoreMouseEventsOptions): void;
/**
* Enters or leaves kiosk mode.
*/
setKiosk(flag: boolean): void;
/**
* Sets whether the window can be manually maximized by user. On Linux does
* nothing.
*
* @platform darwin,win32
*/
setMaximizable(maximizable: boolean): void;
/**
* Sets the maximum size of window to `width` and `height`.
*/
setMaximumSize(width: number, height: number): void;
/**
* Sets the `menu` as the window's menu bar.
*
* @platform linux,win32
*/
setMenu(menu: (Menu) | (null)): void;
/**
* Sets whether the menu bar should be visible. If the menu bar is auto-hide, users
* can still bring up the menu bar by pressing the single `Alt` key.
*
* @platform win32,linux
*/
setMenuBarVisibility(visible: boolean): void;
/**
* Sets whether the window can be manually minimized by user. On Linux does
* nothing.
*
* @platform darwin,win32
*/
setMinimizable(minimizable: boolean): void;
/**
* Sets the minimum size of window to `width` and `height`.
*/
setMinimumSize(width: number, height: number): void;
/**
* Sets whether the window can be moved by user. On Linux does nothing.
*
* @platform darwin,win32
*/
setMovable(movable: boolean): void;
/**
* Sets the opacity of the window. On Linux, does nothing. Out of bound number
* values are clamped to the [0, 1] range.
*
* @platform win32,darwin
*/
setOpacity(opacity: number): void;
/**
* Sets a 16 x 16 pixel overlay onto the current taskbar icon, usually used to
* convey some sort of application status or to passively notify the user.
*
* @platform win32
*/
setOverlayIcon(overlay: (NativeImage) | (null), description: string): void;
/**
* Sets `parent` as current window's parent window, passing `null` will turn
* current window into a top-level window.
*/
setParentWindow(parent: (BrowserWindow) | (null)): void;
/**
* Moves window to `x` and `y`.
*/
setPosition(x: number, y: number, animate?: boolean): void;
/**
* Sets progress value in progress bar. Valid range is [0, 1.0].
*
* Remove progress bar when progress < 0; Change to indeterminate mode when
* progress > 1.
*
* On Linux platform, only supports Unity desktop environment, you need to specify
* the `*.desktop` file name to `desktopName` field in `package.json`. By default,
* it will assume `{app.name}.desktop`.
*
* On Windows, a mode can be passed. Accepted values are `none`, `normal`,
* `indeterminate`, `error`, and `paused`. If you call `setProgressBar` without a
* mode set (but with a value within the valid range), `normal` will be assumed.
*/
setProgressBar(progress: number, options?: ProgressBarOptions): void;
/**
* Sets the pathname of the file the window represents, and the icon of the file
* will show in window's title bar.
*
* @platform darwin
*/
setRepresentedFilename(filename: string): void;
/**
* Sets whether the window can be manually resized by the user.
*/
setResizable(resizable: boolean): void;
/**
* Setting a window shape determines the area within the window where the system
* permits drawing and user interaction. Outside of the given region, no pixels
* will be drawn and no mouse events will be registered. Mouse events outside of
* the region will not be received by that window, but will fall through to
* whatever is behind the window.
*
* @experimental
* @platform win32,linux
*/
setShape(rects: Rectangle[]): void;
/**
* Changes the attachment point for sheets on macOS. By default, sheets are
* attached just below the window frame, but you may want to display them beneath a
* HTML-rendered toolbar. For example:
*
* @platform darwin
*/
setSheetOffset(offsetY: number, offsetX?: number): void;
/**
* Enters or leaves simple fullscreen mode.
*
* Simple fullscreen mode emulates the native fullscreen behavior found in versions
* of macOS prior to Lion (10.7).
*
* @platform darwin
*/
setSimpleFullScreen(flag: boolean): void;
/**
* Resizes the window to `width` and `height`. If `width` or `height` are below any
* set minimum size constraints the window will snap to its minimum size.
*/
setSize(width: number, height: number, animate?: boolean): void;
/**
* Makes the window not show in the taskbar.
*
* @platform darwin,win32
*/
setSkipTaskbar(skip: boolean): void;
/**
* Whether the buttons were added successfully
*
* Add a thumbnail toolbar with a specified set of buttons to the thumbnail image
* of a window in a taskbar button layout. Returns a `boolean` object indicates
* whether the thumbnail has been added successfully.
*
* The number of buttons in thumbnail toolbar should be no greater than 7 due to
* the limited room. Once you setup the thumbnail toolbar, the toolbar cannot be
* removed due to the platform's limitation. But you can call the API with an empty
* array to clean the buttons.
*
* The `buttons` is an array of `Button` objects:
*
* * `Button` Object
* * `icon` NativeImage - The icon showing in thumbnail toolbar.
* * `click` Function
* * `tooltip` string (optional) - The text of the button's tooltip.
* * `flags` string[] (optional) - Control specific states and behaviors of the
* button. By default, it is `['enabled']`.
*
* The `flags` is an array that can include following `string`s:
*
* * `enabled` - The button is active and available to the user.
* * `disabled` - The button is disabled. It is present, but has a visual state
* indicating it will not respond to user action.
* * `dismissonclick` - When the button is clicked, the thumbnail window closes
* immediately.
* * `nobackground` - Do not draw a button border, use only the image.
* * `hidden` - The button is not shown to the user.
* * `noninteractive` - The button is enabled but not interactive; no pressed
* button state is drawn. This value is intended for instances where the button is
* used in a notification.
*
* @platform win32
*/
setThumbarButtons(buttons: ThumbarButton[]): boolean;
/**
* Sets the region of the window to show as the thumbnail image displayed when
* hovering over the window in the taskbar. You can reset the thumbnail to be the
* entire window by specifying an empty region: `{ x: 0, y: 0, width: 0, height: 0
* }`.
*
* @platform win32
*/
setThumbnailClip(region: Rectangle): void;
/**
* Sets the toolTip that is displayed when hovering over the window thumbnail in
* the taskbar.
*
* @platform win32
*/
setThumbnailToolTip(toolTip: string): void;
/**
* Changes the title of native window to `title`.
*/
setTitle(title: string): void;
/**
* On a Window with Window Controls Overlay already enabled, this method updates
* the style of the title bar overlay.
*
* @platform win32
*/
setTitleBarOverlay(options: TitleBarOverlayOptions): void;
/**
* Raises `browserView` above other `BrowserView`s attached to `win`. Throws an
* error if `browserView` is not attached to `win`.
*
* @experimental
*/
setTopBrowserView(browserView: BrowserView): void;
/**
* Sets the touchBar layout for the current window. Specifying `null` or
* `undefined` clears the touch bar. This method only has an effect if the machine
* has a touch bar.
*
* **Note:** The TouchBar API is currently experimental and may change or be
* removed in future Electron releases.
*
* @platform darwin
*/
setTouchBar(touchBar: (TouchBar) | (null)): void;
/**
* Set a custom position for the traffic light buttons in frameless window. Passing
* `{ x: 0, y: 0 }` will reset the position to default.
*
* > **Note** This function is deprecated. Use setWindowButtonPosition instead.
*
* @deprecated
* @platform darwin
*/
setTrafficLightPosition(position: Point): void;
/**
* Adds a vibrancy effect to the browser window. Passing `null` or an empty string
* will remove the vibrancy effect on the window.
*
* @platform darwin
*/
setVibrancy(type: (('titlebar' | 'selection' | 'menu' | 'popover' | 'sidebar' | 'header' | 'sheet' | 'window' | 'hud' | 'fullscreen-ui' | 'tooltip' | 'content' | 'under-window' | 'under-page')) | (null)): void;
/**
* Sets whether the window should be visible on all workspaces.
*
* **Note:** This API does nothing on Windows.
*
* @platform darwin,linux
*/
setVisibleOnAllWorkspaces(visible: boolean, options?: VisibleOnAllWorkspacesOptions): void;
/**
* Set a custom position for the traffic light buttons in frameless window. Passing
* `null` will reset the position to default.
*
* @platform darwin
*/
setWindowButtonPosition(position: (Point) | (null)): void;
/**
* Sets whether the window traffic light buttons should be visible.
*
* @platform darwin
*/
setWindowButtonVisibility(visible: boolean): void;
/**
* Shows and gives focus to the window.
*/
show(): void;
/**
* Shows or hides the tab overview when native tabs are enabled.
*
* @platform darwin
*/
showAllTabs(): void;
/**
* Same as `webContents.showDefinitionForSelection()`.
*
* @platform darwin
*/
showDefinitionForSelection(): void;
/**
* Shows the window but doesn't focus on it.
*/
showInactive(): void;
/**
* Toggles the visibility of the tab bar if native tabs are enabled and there is
* only one tab in the current window.
*
* @platform darwin
*/
toggleTabBar(): void;
/**
* Unhooks all of the window messages.
*
* @platform win32
*/
unhookAllWindowMessages(): void;
/**
* Unhook the window message.
*
* @platform win32
*/
unhookWindowMessage(message: number): void;
/**
* Unmaximizes the window.
*/
unmaximize(): void;
/**
* A `string` property that defines an alternative title provided only to
* accessibility tools such as screen readers. This string is not directly visible
* to users.
*/
accessibleTitle: string;
/**
* A `boolean` property that determines whether the window menu bar should hide
* itself automatically. Once set, the menu bar will only show when users press the
* single `Alt` key.
*
* If the menu bar is already visible, setting this property to `true` won't hide
* it immediately.
*/
autoHideMenuBar: boolean;
/**
* A `boolean` property that determines whether the window can be manually closed
* by user.
*
* On Linux the setter is a no-op, although the getter returns `true`.
*
* @platform darwin,win32
*/
closable: boolean;
/**
* A `boolean` property that specifies whether the window’s document has been
* edited.
*
* The icon in title bar will become gray when set to `true`.
*
* @platform darwin
*/
documentEdited: boolean;
/**
* A `boolean` property that determines whether the window is excluded from the
* application’s Windows menu. `false` by default.
*
* @platform darwin
*/
excludedFromShownWindowsMenu: boolean;
/**
* A `boolean` property that determines whether the window is focusable.
*
* @platform win32,darwin
*/
focusable: boolean;
/**
* A `boolean` property that determines whether the window is in fullscreen mode.
*/
fullScreen: boolean;
/**
* A `boolean` property that determines whether the maximize/zoom window button
* toggles fullscreen mode or maximizes the window.
*/
fullScreenable: boolean;
/**
* A `Integer` property representing the unique ID of the window. Each ID is unique
* among all `BrowserWindow` instances of the entire Electron application.
*
*/
readonly id: number;
/**
* A `boolean` property that determines whether the window is in kiosk mode.
*/
kiosk: boolean;
/**
* A `boolean` property that determines whether the window can be manually
* maximized by user.
*
* On Linux the setter is a no-op, although the getter returns `true`.
*
* @platform darwin,win32
*/
maximizable: boolean;
/**
* A `boolean` property that determines whether the menu bar should be visible.
*
* **Note:** If the menu bar is auto-hide, users can still bring up the menu bar by
* pressing the single `Alt` key.
*
* @platform win32,linux
*/
menuBarVisible: boolean;
/**
* A `boolean` property that determines whether the window can be manually
* minimized by user.
*
* On Linux the setter is a no-op, although the getter returns `true`.
*
* @platform darwin,win32
*/
minimizable: boolean;
/**
* A `boolean` property that determines Whether the window can be moved by user.
*
* On Linux the setter is a no-op, although the getter returns `true`.
*
* @platform darwin,win32
*/
movable: boolean;
/**
* A `string` property that determines the pathname of the file the window
* represents, and the icon of the file will show in window's title bar.
*
* @platform darwin
*/
representedFilename: string;
/**
* A `boolean` property that determines whether the window can be manually resized
* by user.
*/
resizable: boolean;
/**
* A `boolean` property that determines whether the window has a shadow.
*/
shadow: boolean;
/**
* A `boolean` property that determines whether the window is in simple (pre-Lion)
* fullscreen mode.
*/
simpleFullScreen: boolean;
/**
* A `string` (optional) property that is equal to the `tabbingIdentifier` passed
* to the `BrowserWindow` constructor or `undefined` if none was set.
*
* @platform darwin
*/
readonly tabbingIdentifier?: string;
/**
* A `string` property that determines the title of the native window.
*
* **Note:** The title of the web page can be different from the title of the
* native window.
*/
title: string;
/**
* A `boolean` property that determines whether the window is visible on all
* workspaces.
*
* **Note:** Always returns false on Windows.
*
* @platform darwin,linux
*/
visibleOnAllWorkspaces: boolean;
/**
* A `WebContents` object this window owns. All web page related events and
* operations will be done via it.
*
* See the `webContents` documentation for its methods and events.
*
*/
readonly webContents: WebContents;
}
interface BrowserWindowConstructorOptions {
// Docs: https://electronjs.org/docs/api/structures/browser-window-options
/**
* Whether clicking an inactive window will also click through to the web contents.
* Default is `false` on macOS. This option is not configurable on other platforms.
*
* @platform darwin
*/
acceptFirstMouse?: boolean;
/**
* Whether the window should always stay on top of other windows. Default is
* `false`.
*/
alwaysOnTop?: boolean;
/**
* Auto hide the menu bar unless the `Alt` key is pressed. Default is `false`.
*/
autoHideMenuBar?: boolean;
/**
* The window's background color in Hex, RGB, RGBA, HSL, HSLA or named CSS color
* format. Alpha in #AARRGGBB format is supported if `transparent` is set to
* `true`. Default is `#FFF` (white). See win.setBackgroundColor for more
* information.
*/
backgroundColor?: string;
/**
* Set the window's system-drawn background material, including behind the
* non-client area. Can be `auto`, `none`, `mica`, `acrylic` or `tabbed`. See
* win.setBackgroundMaterial for more information.
*
* @platform win32
*/
backgroundMaterial?: ('auto' | 'none' | 'mica' | 'acrylic' | 'tabbed');
/**
* Show window in the center of the screen. Default is `false`.
*/
center?: boolean;
/**
* Whether window is closable. This is not implemented on Linux. Default is `true`.
*
* @platform darwin,win32
*/
closable?: boolean;
/**
* Forces using dark theme for the window, only works on some GTK+3 desktop
* environments. Default is `false`.
*/
darkTheme?: boolean;
/**
* Whether to hide cursor when typing. Default is `false`.
*/
disableAutoHideCursor?: boolean;
/**
* Enable the window to be resized larger than screen. Only relevant for macOS, as
* other OSes allow larger-than-screen windows by default. Default is `false`.
*
* @platform darwin
*/
enableLargerThanScreen?: boolean;
/**
* Whether the window can be focused. Default is `true`. On Windows setting
* `focusable: false` also implies setting `skipTaskbar: true`. On Linux setting
* `focusable: false` makes the window stop interacting with wm, so the window will
* always stay on top in all workspaces.
*/
focusable?: boolean;
/**
* Specify `false` to create a frameless window. Default is `true`.
*/
frame?: boolean;
/**
* Whether the window should show in fullscreen. When explicitly set to `false` the
* fullscreen button will be hidden or disabled on macOS. Default is `false`.
*/
fullscreen?: boolean;
/**
* Whether the window can be put into fullscreen mode. On macOS, also whether the
* maximize/zoom button should toggle full screen mode or maximize window. Default
* is `true`.
*/
fullscreenable?: boolean;
/**
* Shows the title in the title bar in full screen mode on macOS for `hiddenInset`
* titleBarStyle. Default is `false`.
*
* @deprecated
* @platform darwin
*/
fullscreenWindowTitle?: boolean;
/**
* Whether window should have a shadow. Default is `true`.
*/
hasShadow?: boolean;
/**
* Window's height in pixels. Default is `600`.
*/
height?: number;
/**
* Whether window should be hidden when the user toggles into mission control.
*
* @platform darwin
*/
hiddenInMissionControl?: boolean;
/**
* The window icon. On Windows it is recommended to use `ICO` icons to get best
* visual effects, you can also leave it undefined so the executable's icon will be
* used.
*/
icon?: (NativeImage) | (string);
/**
* Whether the window is in kiosk mode. Default is `false`.
*/
kiosk?: boolean;
/**
* Window's maximum height. Default is no limit.
*/
maxHeight?: number;
/**
* Whether window is maximizable. This is not implemented on Linux. Default is
* `true`.
*
* @platform darwin,win32
*/
maximizable?: boolean;
/**
* Window's maximum width. Default is no limit.
*/
maxWidth?: number;
/**
* Window's minimum height. Default is `0`.
*/
minHeight?: number;
/**
* Whether window is minimizable. This is not implemented on Linux. Default is
* `true`.
*
* @platform darwin,win32
*/
minimizable?: boolean;
/**
* Window's minimum width. Default is `0`.
*/
minWidth?: number;
/**
* Whether this is a modal window. This only works when the window is a child
* window. Default is `false`.
*/
modal?: boolean;
/**
* Whether window is movable. This is not implemented on Linux. Default is `true`.
*
* @platform darwin,win32
*/
movable?: boolean;
/**
* Set the initial opacity of the window, between 0.0 (fully transparent) and 1.0
* (fully opaque). This is only implemented on Windows and macOS.
*
* @platform darwin,win32
*/
opacity?: number;
/**
* Whether the renderer should be active when `show` is `false` and it has just
* been created. In order for `document.visibilityState` to work correctly on
* first load with `show: false` you should set this to `false`. Setting this to
* `false` will cause the `ready-to-show` event to not fire. Default is `true`.
*/
paintWhenInitiallyHidden?: boolean;
/**
* Specify parent window. Default is `null`.
*/
parent?: BrowserWindow;
/**
* Whether window is resizable. Default is `true`.
*/
resizable?: boolean;
/**
* Whether frameless window should have rounded corners on macOS. Default is
* `true`. Setting this property to `false` will prevent the window from being
* fullscreenable.
*
* @platform darwin
*/
roundedCorners?: boolean;
/**
* Whether window should be shown when created. Default is `true`.
*/
show?: boolean;
/**
* Use pre-Lion fullscreen on macOS. Default is `false`.
*
* @platform darwin
*/
simpleFullscreen?: boolean;
/**
* Whether to show the window in taskbar. Default is `false`.
*
* @platform darwin,win32
*/
skipTaskbar?: boolean;
/**
* Tab group name, allows opening the window as a native tab. Windows with the same
* tabbing identifier will be grouped together. This also adds a native new tab
* button to your window's tab bar and allows your `app` and window to receive the
* `new-window-for-tab` event.
*
* @platform darwin
*/
tabbingIdentifier?: string;
/**
* Use `WS_THICKFRAME` style for frameless windows on Windows, which adds standard
* window frame. Setting it to `false` will remove window shadow and window
* animations. Default is `true`.
*/
thickFrame?: boolean;
/**
* Default window title. Default is `"Electron"`. If the HTML tag `<title>` is
* defined in the HTML file loaded by `loadURL()`, this property will be ignored.
*/
title?: string;
/**
* When using a frameless window in conjunction with
* `win.setWindowButtonVisibility(true)` on macOS or using a `titleBarStyle` so
* that the standard window controls ("traffic lights" on macOS) are visible, this
* property enables the Window Controls Overlay JavaScript APIs and CSS Environment
* Variables. Specifying `true` will result in an overlay with default system
* colors. Default is `false`.
*/
titleBarOverlay?: (TitleBarOverlay) | (boolean);
/**
* The style of window title bar. Default is `default`. Possible values are:
*
* @platform darwin,win32
*/
titleBarStyle?: ('default' | 'hidden' | 'hiddenInset' | 'customButtonsOnHover');
/**
* Set a custom position for the traffic light buttons in frameless windows.
*
* @platform darwin
*/
trafficLightPosition?: Point;
/**
* Makes the window transparent. Default is `false`. On Windows, does not work
* unless the window is frameless.
*/
transparent?: boolean;
/**
* The type of window, default is normal window. See more about this below.
*/
type?: string;
/**
* The `width` and `height` would be used as web page's size, which means the
* actual window's size will include window frame's size and be slightly larger.
* Default is `false`.
*/
useContentSize?: boolean;
/**
* Add a type of vibrancy effect to the window, only on macOS. Can be
* `appearance-based`, `titlebar`, `selection`, `menu`, `popover`, `sidebar`,
* `header`, `sheet`, `window`, `hud`, `fullscreen-ui`, `tooltip`, `content`,
* `under-window`, or `under-page`.
*
* @platform darwin
*/
vibrancy?: ('appearance-based' | 'titlebar' | 'selection' | 'menu' | 'popover' | 'sidebar' | 'header' | 'sheet' | 'window' | 'hud' | 'fullscreen-ui' | 'tooltip' | 'content' | 'under-window' | 'under-page');
/**
* Specify how the material appearance should reflect window activity state on
* macOS. Must be used with the `vibrancy` property. Possible values are:
*
* @platform darwin
*/
visualEffectState?: ('followWindow' | 'active' | 'inactive');
/**
* Settings of web page's features.
*/
webPreferences?: WebPreferences;
/**
* Window's width in pixels. Default is `800`.
*/
width?: number;
/**
* (**required** if y is used) Window's left offset from screen. Default is to
* center the window.
*/
x?: number;
/**
* (**required** if x is used) Window's top offset from screen. Default is to
* center the window.
*/
y?: number;
/**
* Controls the behavior on macOS when option-clicking the green stoplight button
* on the toolbar or by clicking the Window > Zoom menu item. If `true`, the window
* will grow to the preferred width of the web page when zoomed, `false` will cause
* it to zoom to the width of the screen. This will also affect the behavior when
* calling `maximize()` directly. Default is `false`.
*
* @platform darwin
*/
zoomToPageWidth?: boolean;
}
interface Certificate {
// Docs: https://electronjs.org/docs/api/structures/certificate
/**
* PEM encoded data
*/
data: string;
/**
* Fingerprint of the certificate
*/
fingerprint: string;
/**
* Issuer principal
*/
issuer: CertificatePrincipal;
/**
* Issuer certificate (if not self-signed)
*/
issuerCert: Certificate;
/**
* Issuer's Common Name
*/
issuerName: string;
/**
* Hex value represented string
*/
serialNumber: string;
/**
* Subject principal
*/
subject: CertificatePrincipal;
/**
* Subject's Common Name
*/
subjectName: string;
/**
* End date of the certificate being valid in seconds
*/
validExpiry: number;
/**
* Start date of the certificate being valid in seconds
*/
validStart: number;
}
interface CertificatePrincipal {
// Docs: https://electronjs.org/docs/api/structures/certificate-principal
/**
* Common Name.
*/
commonName: string;
/**
* Country or region.
*/
country: string;
/**
* Locality.
*/
locality: string;
/**
* Organization names.
*/
organizations: string[];
/**
* Organization Unit names.
*/
organizationUnits: string[];
/**
* State or province.
*/
state: string;
}
class ClientRequest extends NodeEventEmitter {
// Docs: https://electronjs.org/docs/api/client-request
/**
* Emitted when the `request` is aborted. The `abort` event will not be fired if
* the `request` is already closed.
*/
on(event: 'abort', listener: Function): this;
once(event: 'abort', listener: Function): this;
addListener(event: 'abort', listener: Function): this;
removeListener(event: 'abort', listener: Function): this;
/**
* Emitted as the last event in the HTTP request-response transaction. The `close`
* event indicates that no more events will be emitted on either the `request` or
* `response` objects.
*/
on(event: 'close', listener: Function): this;
once(event: 'close', listener: Function): this;
addListener(event: 'close', listener: Function): this;
removeListener(event: 'close', listener: Function): this;
/**
* Emitted when the `net` module fails to issue a network request. Typically when
* the `request` object emits an `error` event, a `close` event will subsequently
* follow and no response object will be provided.
*/
on(event: 'error', listener: (
/**
* an error object providing some information about the failure.
*/
error: Error) => void): this;
once(event: 'error', listener: (
/**
* an error object providing some information about the failure.
*/
error: Error) => void): this;
addListener(event: 'error', listener: (
/**
* an error object providing some information about the failure.
*/
error: Error) => void): this;
removeListener(event: 'error', listener: (
/**
* an error object providing some information about the failure.
*/
error: Error) => void): this;
/**
* Emitted just after the last chunk of the `request`'s data has been written into
* the `request` object.
*/
on(event: 'finish', listener: Function): this;
once(event: 'finish', listener: Function): this;
addListener(event: 'finish', listener: Function): this;
removeListener(event: 'finish', listener: Function): this;
/**
* Emitted when an authenticating proxy is asking for user credentials.
*
* The `callback` function is expected to be called back with user credentials:
*
* * `username` string
* * `password` string
*
* Providing empty credentials will cancel the request and report an authentication
* error on the response object:
*/
on(event: 'login', listener: (authInfo: AuthInfo,
callback: (username?: string, password?: string) => void) => void): this;
once(event: 'login', listener: (authInfo: AuthInfo,
callback: (username?: string, password?: string) => void) => void): this;
addListener(event: 'login', listener: (authInfo: AuthInfo,
callback: (username?: string, password?: string) => void) => void): this;
removeListener(event: 'login', listener: (authInfo: AuthInfo,
callback: (username?: string, password?: string) => void) => void): this;
/**
* Emitted when the server returns a redirect response (e.g. 301 Moved
* Permanently). Calling `request.followRedirect` will continue with the
* redirection. If this event is handled, `request.followRedirect` must be called
* **synchronously**, otherwise the request will be cancelled.
*/
on(event: 'redirect', listener: (statusCode: number,
method: string,
redirectUrl: string,
responseHeaders: Record<string, string[]>) => void): this;
once(event: 'redirect', listener: (statusCode: number,
method: string,
redirectUrl: string,
responseHeaders: Record<string, string[]>) => void): this;
addListener(event: 'redirect', listener: (statusCode: number,
method: string,
redirectUrl: string,
responseHeaders: Record<string, string[]>) => void): this;
removeListener(event: 'redirect', listener: (statusCode: number,
method: string,
redirectUrl: string,
responseHeaders: Record<string, string[]>) => void): this;
on(event: 'response', listener: (
/**
* An object representing the HTTP response message.
*/
response: IncomingMessage) => void): this;
once(event: 'response', listener: (
/**
* An object representing the HTTP response message.
*/
response: IncomingMessage) => void): this;
addListener(event: 'response', listener: (
/**
* An object representing the HTTP response message.
*/
response: IncomingMessage) => void): this;
removeListener(event: 'response', listener: (
/**
* An object representing the HTTP response message.
*/
response: IncomingMessage) => void): this;
/**
* ClientRequest
*/
constructor(options: (ClientRequestConstructorOptions) | (string));
/**
* Cancels an ongoing HTTP transaction. If the request has already emitted the
* `close` event, the abort operation will have no effect. Otherwise an ongoing
* event will emit `abort` and `close` events. Additionally, if there is an ongoing
* response object,it will emit the `aborted` event.
*/
abort(): void;
/**
* Sends the last chunk of the request data. Subsequent write or end operations
* will not be allowed. The `finish` event is emitted just after the end operation.
*/
end(chunk?: (string) | (Buffer), encoding?: string, callback?: () => void): this;
/**
* Continues any pending redirection. Can only be called during a `'redirect'`
* event.
*/
followRedirect(): void;
/**
* The value of a previously set extra header name.
*/
getHeader(name: string): string;
/**
* * `active` boolean - Whether the request is currently active. If this is false
* no other properties will be set
* * `started` boolean - Whether the upload has started. If this is false both
* `current` and `total` will be set to 0.
* * `current` Integer - The number of bytes that have been uploaded so far
* * `total` Integer - The number of bytes that will be uploaded this request
*
* You can use this method in conjunction with `POST` requests to get the progress
* of a file upload or other data transfer.
*/
getUploadProgress(): UploadProgress;
/**
* Removes a previously set extra header name. This method can be called only
* before first write. Trying to call it after the first write will throw an error.
*/
removeHeader(name: string): void;
/**
* Adds an extra HTTP header. The header name will be issued as-is without
* lowercasing. It can be called only before first write. Calling this method after
* the first write will throw an error. If the passed value is not a `string`, its
* `toString()` method will be called to obtain the final value.
*
* Certain headers are restricted from being set by apps. These headers are listed
* below. More information on restricted headers can be found in Chromium's header
* utils.
*
* * `Content-Length`
* * `Host`
* * `Trailer` or `Te`
* * `Upgrade`
* * `Cookie2`
* * `Keep-Alive`
* * `Transfer-Encoding`
*
* Additionally, setting the `Connection` header to the value `upgrade` is also
* disallowed.
*/
setHeader(name: string, value: string): void;
/**
* `callback` is essentially a dummy function introduced in the purpose of keeping
* similarity with the Node.js API. It is called asynchronously in the next tick
* after `chunk` content have been delivered to the Chromium networking layer.
* Contrary to the Node.js implementation, it is not guaranteed that `chunk`
* content have been flushed on the wire before `callback` is called.
*
* Adds a chunk of data to the request body. The first write operation may cause
* the request headers to be issued on the wire. After the first write operation,
* it is not allowed to add or remove a custom header.
*/
write(chunk: (string) | (Buffer), encoding?: string, callback?: () => void): void;
/**
* A `boolean` specifying whether the request will use HTTP chunked transfer
* encoding or not. Defaults to false. The property is readable and writable,
* however it can be set only before the first write operation as the HTTP headers
* are not yet put on the wire. Trying to set the `chunkedEncoding` property after
* the first write will throw an error.
*
* Using chunked encoding is strongly recommended if you need to send a large
* request body as data will be streamed in small chunks instead of being
* internally buffered inside Electron process memory.
*/
chunkedEncoding: boolean;
}
interface Clipboard {
// Docs: https://electronjs.org/docs/api/clipboard
/**
* An array of supported formats for the clipboard `type`.
*/
availableFormats(type?: 'selection' | 'clipboard'): string[];
/**
* Clears the clipboard content.
*/
clear(type?: 'selection' | 'clipboard'): void;
/**
* Whether the clipboard supports the specified `format`.
*
* @experimental
*/
has(format: string, type?: 'selection' | 'clipboard'): boolean;
/**
* Reads `format` type from the clipboard.
*
* `format` should contain valid ASCII characters and have `/` separator. `a/c`,
* `a/bc` are valid formats while `/abc`, `abc/`, `a/`, `/a`, `a` are not valid.
*
* @experimental
*/
read(format: string): string;
/**
* * `title` string
* * `url` string
*
* Returns an Object containing `title` and `url` keys representing the bookmark in
* the clipboard. The `title` and `url` values will be empty strings when the
* bookmark is unavailable. The `title` value will always be empty on Windows.
*
* @platform darwin,win32
*/
readBookmark(): ReadBookmark;
/**
* Reads `format` type from the clipboard.
*
* @experimental
*/
readBuffer(format: string): Buffer;
/**
* The text on the find pasteboard, which is the pasteboard that holds information
* about the current state of the active application’s find panel.
*
* This method uses synchronous IPC when called from the renderer process. The
* cached value is reread from the find pasteboard whenever the application is
* activated.
*
* @platform darwin
*/
readFindText(): string;
/**
* The content in the clipboard as markup.
*/
readHTML(type?: 'selection' | 'clipboard'): string;
/**
* The image content in the clipboard.
*/
readImage(type?: 'selection' | 'clipboard'): NativeImage;
/**
* The content in the clipboard as RTF.
*/
readRTF(type?: 'selection' | 'clipboard'): string;
/**
* The content in the clipboard as plain text.
*/
readText(type?: 'selection' | 'clipboard'): string;
/**
* Writes `data` to the clipboard.
*/
write(data: Data, type?: 'selection' | 'clipboard'): void;
/**
* Writes the `title` (macOS only) and `url` into the clipboard as a bookmark.
*
* **Note:** Most apps on Windows don't support pasting bookmarks into them so you
* can use `clipboard.write` to write both a bookmark and fallback text to the
* clipboard.
*
* @platform darwin,win32
*/
writeBookmark(title: string, url: string, type?: 'selection' | 'clipboard'): void;
/**
* Writes the `buffer` into the clipboard as `format`.
*
* @experimental
*/
writeBuffer(format: string, buffer: Buffer, type?: 'selection' | 'clipboard'): void;
/**
* Writes the `text` into the find pasteboard (the pasteboard that holds
* information about the current state of the active application’s find panel) as
* plain text. This method uses synchronous IPC when called from the renderer
* process.
*
* @platform darwin
*/
writeFindText(text: string): void;
/**
* Writes `markup` to the clipboard.
*/
writeHTML(markup: string, type?: 'selection' | 'clipboard'): void;
/**
* Writes `image` to the clipboard.
*/
writeImage(image: NativeImage, type?: 'selection' | 'clipboard'): void;
/**
* Writes the `text` into the clipboard in RTF.
*/
writeRTF(text: string, type?: 'selection' | 'clipboard'): void;
/**
* Writes the `text` into the clipboard as plain text.
*/
writeText(text: string, type?: 'selection' | 'clipboard'): void;
}
class CommandLine {
// Docs: https://electronjs.org/docs/api/command-line
/**
* Append an argument to Chromium's command line. The argument will be quoted
* correctly. Switches will precede arguments regardless of appending order.
*
* If you're appending an argument like `--switch=value`, consider using
* `appendSwitch('switch', 'value')` instead.
*
* **Note:** This will not affect `process.argv`. The intended usage of this
* function is to control Chromium's behavior.
*/
appendArgument(value: string): void;
/**
* Append a switch (with optional `value`) to Chromium's command line.
*
* **Note:** This will not affect `process.argv`. The intended usage of this
* function is to control Chromium's behavior.
*/
appendSwitch(the_switch: string, value?: string): void;
/**
* The command-line switch value.
*
* **Note:** When the switch is not present or has no value, it returns empty
* string.
*/
getSwitchValue(the_switch: string): string;
/**
* Whether the command-line switch is present.
*/
hasSwitch(the_switch: string): boolean;
/**
* Removes the specified switch from Chromium's command line.
*
* **Note:** This will not affect `process.argv`. The intended usage of this
* function is to control Chromium's behavior.
*/
removeSwitch(the_switch: string): void;
}
interface ContentTracing {
// Docs: https://electronjs.org/docs/api/content-tracing
/**
* resolves with an array of category groups once all child processes have
* acknowledged the `getCategories` request
*
* Get a set of category groups. The category groups can change as new code paths
* are reached. See also the list of built-in tracing categories.
*
* > **NOTE:** Electron adds a non-default tracing category called `"electron"`.
* This category can be used to capture Electron-specific tracing events.
*/
getCategories(): Promise<string[]>;
/**
* Resolves with an object containing the `value` and `percentage` of trace buffer
* maximum usage
*
* * `value` number
* * `percentage` number
*
* Get the maximum usage across processes of trace buffer as a percentage of the
* full state.
*/
getTraceBufferUsage(): Promise<Electron.TraceBufferUsageReturnValue>;
/**
* resolved once all child processes have acknowledged the `startRecording`
* request.
*
* Start recording on all processes.
*
* Recording begins immediately locally and asynchronously on child processes as
* soon as they receive the EnableRecording request.
*
* If a recording is already running, the promise will be immediately resolved, as
* only one trace operation can be in progress at a time.
*/
startRecording(options: (TraceConfig) | (TraceCategoriesAndOptions)): Promise<void>;
/**
* resolves with a path to a file that contains the traced data once all child
* processes have acknowledged the `stopRecording` request
*
* Stop recording on all processes.
*
* Child processes typically cache trace data and only rarely flush and send trace
* data back to the main process. This helps to minimize the runtime overhead of
* tracing since sending trace data over IPC can be an expensive operation. So, to
* end tracing, Chromium asynchronously asks all child processes to flush any
* pending trace data.
*
* Trace data will be written into `resultFilePath`. If `resultFilePath` is empty
* or not provided, trace data will be written to a temporary file, and the path
* will be returned in the promise.
*/
stopRecording(resultFilePath?: string): Promise<string>;
}
interface ContextBridge {
// Docs: https://electronjs.org/docs/api/context-bridge
exposeInIsolatedWorld(worldId: number, apiKey: string, api: any): void;
exposeInMainWorld(apiKey: string, api: any): void;
}
interface Cookie {
// Docs: https://electronjs.org/docs/api/structures/cookie
/**
* The domain of the cookie; this will be normalized with a preceding dot so that
* it's also valid for subdomains.
*/
domain?: string;
/**
* The expiration date of the cookie as the number of seconds since the UNIX epoch.
* Not provided for session cookies.
*/
expirationDate?: number;
/**
* Whether the cookie is a host-only cookie; this will only be `true` if no domain
* was passed.
*/
hostOnly?: boolean;
/**
* Whether the cookie is marked as HTTP only.
*/
httpOnly?: boolean;
/**
* The name of the cookie.
*/
name: string;
/**
* The path of the cookie.
*/
path?: string;
/**
* The Same Site policy applied to this cookie. Can be `unspecified`,
* `no_restriction`, `lax` or `strict`.
*/
sameSite: ('unspecified' | 'no_restriction' | 'lax' | 'strict');
/**
* Whether the cookie is marked as secure.
*/
secure?: boolean;
/**
* Whether the cookie is a session cookie or a persistent cookie with an expiration
* date.
*/
session?: boolean;
/**
* The value of the cookie.
*/
value: string;
}
class Cookies extends NodeEventEmitter {
// Docs: https://electronjs.org/docs/api/cookies
/**
* Emitted when a cookie is changed because it was added, edited, removed, or
* expired.
*/
on(event: 'changed', listener: (event: Event,
/**
* The cookie that was changed.
*/
cookie: Cookie,
/**
* The cause of the change with one of the following values:
*/
cause: ('explicit' | 'overwrite' | 'expired' | 'evicted' | 'expired-overwrite'),
/**
* `true` if the cookie was removed, `false` otherwise.
*/
removed: boolean) => void): this;
once(event: 'changed', listener: (event: Event,
/**
* The cookie that was changed.
*/
cookie: Cookie,
/**
* The cause of the change with one of the following values:
*/
cause: ('explicit' | 'overwrite' | 'expired' | 'evicted' | 'expired-overwrite'),
/**
* `true` if the cookie was removed, `false` otherwise.
*/
removed: boolean) => void): this;
addListener(event: 'changed', listener: (event: Event,
/**
* The cookie that was changed.
*/
cookie: Cookie,
/**
* The cause of the change with one of the following values:
*/
cause: ('explicit' | 'overwrite' | 'expired' | 'evicted' | 'expired-overwrite'),
/**
* `true` if the cookie was removed, `false` otherwise.
*/
removed: boolean) => void): this;
removeListener(event: 'changed', listener: (event: Event,
/**
* The cookie that was changed.
*/
cookie: Cookie,
/**
* The cause of the change with one of the following values:
*/
cause: ('explicit' | 'overwrite' | 'expired' | 'evicted' | 'expired-overwrite'),
/**
* `true` if the cookie was removed, `false` otherwise.
*/
removed: boolean) => void): this;
/**
* A promise which resolves when the cookie store has been flushed
*
* Writes any unwritten cookies data to disk
*
* Cookies written by any method will not be written to disk immediately, but will
* be written every 30 seconds or 512 operations
*
* Calling this method can cause the cookie to be written to disk immediately.
*/
flushStore(): Promise<void>;
/**
* A promise which resolves an array of cookie objects.
*
* Sends a request to get all cookies matching `filter`, and resolves a promise
* with the response.
*/
get(filter: CookiesGetFilter): Promise<Electron.Cookie[]>;
/**
* A promise which resolves when the cookie has been removed
*
* Removes the cookies matching `url` and `name`
*/
remove(url: string, name: string): Promise<void>;
/**
* A promise which resolves when the cookie has been set
*
* Sets a cookie with `details`.
*/
set(details: CookiesSetDetails): Promise<void>;
}
interface CPUUsage {
// Docs: https://electronjs.org/docs/api/structures/cpu-usage
/**
* The number of average idle CPU wakeups per second since the last call to
* getCPUUsage. First call returns 0. Will always return 0 on Windows.
*/
idleWakeupsPerSecond: number;
/**
* Percentage of CPU used since the last call to getCPUUsage. First call returns 0.
*/
percentCPUUsage: number;
}
interface CrashReport {
// Docs: https://electronjs.org/docs/api/structures/crash-report
date: Date;
id: string;
}
interface CrashReporter {
// Docs: https://electronjs.org/docs/api/crash-reporter
/**
* Set an extra parameter to be sent with the crash report. The values specified
* here will be sent in addition to any values set via the `extra` option when
* `start` was called.
*
* Parameters added in this fashion (or via the `extra` parameter to
* `crashReporter.start`) are specific to the calling process. Adding extra
* parameters in the main process will not cause those parameters to be sent along
* with crashes from renderer or other child processes. Similarly, adding extra
* parameters in a renderer process will not result in those parameters being sent
* with crashes that occur in other renderer processes or in the main process.
*
* **Note:** Parameters have limits on the length of the keys and values. Key names
* must be no longer than 39 bytes, and values must be no longer than 20320 bytes.
* Keys with names longer than the maximum will be silently ignored. Key values
* longer than the maximum length will be truncated.
*/
addExtraParameter(key: string, value: string): void;
/**
* The date and ID of the last crash report. Only crash reports that have been
* uploaded will be returned; even if a crash report is present on disk it will not
* be returned until it is uploaded. In the case that there are no uploaded
* reports, `null` is returned.
*
* **Note:** This method is only available in the main process.
*/
getLastCrashReport(): CrashReport;
/**
* The current 'extra' parameters of the crash reporter.
*/
getParameters(): Record<string, string>;
/**
* Returns all uploaded crash reports. Each report contains the date and uploaded
* ID.
*
* **Note:** This method is only available in the main process.
*/
getUploadedReports(): CrashReport[];
/**
* Whether reports should be submitted to the server. Set through the `start`
* method or `setUploadToServer`.
*
* **Note:** This method is only available in the main process.
*/
getUploadToServer(): boolean;
/**
* Remove an extra parameter from the current set of parameters. Future crashes
* will not include this parameter.
*/
removeExtraParameter(key: string): void;
/**
* This would normally be controlled by user preferences. This has no effect if
* called before `start` is called.
*
* **Note:** This method is only available in the main process.
*/
setUploadToServer(uploadToServer: boolean): void;
/**
* This method must be called before using any other `crashReporter` APIs. Once
* initialized this way, the crashpad handler collects crashes from all
* subsequently created processes. The crash reporter cannot be disabled once
* started.
*
* This method should be called as early as possible in app startup, preferably
* before `app.on('ready')`. If the crash reporter is not initialized at the time a
* renderer process is created, then that renderer process will not be monitored by
* the crash reporter.
*
* **Note:** You can test out the crash reporter by generating a crash using
* `process.crash()`.
*
* **Note:** If you need to send additional/updated `extra` parameters after your
* first call `start` you can call `addExtraParameter`.
*
* **Note:** Parameters passed in `extra`, `globalExtra` or set with
* `addExtraParameter` have limits on the length of the keys and values. Key names
* must be at most 39 bytes long, and values must be no longer than 127 bytes. Keys
* with names longer than the maximum will be silently ignored. Key values longer
* than the maximum length will be truncated.
*
* **Note:** This method is only available in the main process.
*/
start(options: CrashReporterStartOptions): void;
}
interface CustomScheme {
// Docs: https://electronjs.org/docs/api/structures/custom-scheme
privileges?: Privileges;
/**
* Custom schemes to be registered with options.
*/
scheme: string;
}
class Debugger extends NodeEventEmitter {
// Docs: https://electronjs.org/docs/api/debugger
/**
* Emitted when the debugging session is terminated. This happens either when
* `webContents` is closed or devtools is invoked for the attached `webContents`.
*/
on(event: 'detach', listener: (event: Event,
/**
* Reason for detaching debugger.
*/
reason: string) => void): this;
once(event: 'detach', listener: (event: Event,
/**
* Reason for detaching debugger.
*/
reason: string) => void): this;
addListener(event: 'detach', listener: (event: Event,
/**
* Reason for detaching debugger.
*/
reason: string) => void): this;
removeListener(event: 'detach', listener: (event: Event,
/**
* Reason for detaching debugger.
*/
reason: string) => void): this;
/**
* Emitted whenever the debugging target issues an instrumentation event.
*/
on(event: 'message', listener: (event: Event,
/**
* Method name.
*/
method: string,
/**
* Event parameters defined by the 'parameters' attribute in the remote debugging
* protocol.
*/
params: any,
/**
* Unique identifier of attached debugging session, will match the value sent from
* `debugger.sendCommand`.
*/
sessionId: string) => void): this;
once(event: 'message', listener: (event: Event,
/**
* Method name.
*/
method: string,
/**
* Event parameters defined by the 'parameters' attribute in the remote debugging
* protocol.
*/
params: any,
/**
* Unique identifier of attached debugging session, will match the value sent from
* `debugger.sendCommand`.
*/
sessionId: string) => void): this;
addListener(event: 'message', listener: (event: Event,
/**
* Method name.
*/
method: string,
/**
* Event parameters defined by the 'parameters' attribute in the remote debugging
* protocol.
*/
params: any,
/**
* Unique identifier of attached debugging session, will match the value sent from
* `debugger.sendCommand`.
*/
sessionId: string) => void): this;
removeListener(event: 'message', listener: (event: Event,
/**
* Method name.
*/
method: string,
/**
* Event parameters defined by the 'parameters' attribute in the remote debugging
* protocol.
*/
params: any,
/**
* Unique identifier of attached debugging session, will match the value sent from
* `debugger.sendCommand`.
*/
sessionId: string) => void): this;
/**
* Attaches the debugger to the `webContents`.
*/
attach(protocolVersion?: string): void;
/**
* Detaches the debugger from the `webContents`.
*/
detach(): void;
/**
* Whether a debugger is attached to the `webContents`.
*/
isAttached(): boolean;
/**
* A promise that resolves with the response defined by the 'returns' attribute of
* the command description in the remote debugging protocol or is rejected
* indicating the failure of the command.
*
* Send given command to the debugging target.
*/
sendCommand(method: string, commandParams?: any, sessionId?: string): Promise<any>;
}
interface DesktopCapturer {
// Docs: https://electronjs.org/docs/api/desktop-capturer
/**
* Resolves with an array of `DesktopCapturerSource` objects, each
* `DesktopCapturerSource` represents a screen or an individual window that can be
* captured.
*
* **Note** Capturing the screen contents requires user consent on macOS 10.15
* Catalina or higher, which can detected by
* `systemPreferences.getMediaAccessStatus`.
*/
getSources(options: SourcesOptions): Promise<Electron.DesktopCapturerSource[]>;
}
interface DesktopCapturerSource {
// Docs: https://electronjs.org/docs/api/structures/desktop-capturer-source
/**
* An icon image of the application that owns the window or null if the source has
* a type screen. The size of the icon is not known in advance and depends on what
* the application provides.
*/
appIcon: NativeImage;
/**
* A unique identifier that will correspond to the `id` of the matching Display
* returned by the Screen API. On some platforms, this is equivalent to the `XX`
* portion of the `id` field above and on others it will differ. It will be an
* empty string if not available.
*/
display_id: string;
/**
* The identifier of a window or screen that can be used as a `chromeMediaSourceId`
* constraint when calling `navigator.getUserMedia`. The format of the identifier
* will be `window:XX:YY` or `screen:ZZ:0`. XX is the windowID/handle. YY is 1 for
* the current process, and 0 for all others. ZZ is a sequential number that
* represents the screen, and it does not equal to the index in the source's name.
*/
id: string;
/**
* A screen source will be named either `Entire Screen` or `Screen <index>`, while
* the name of a window source will match the window title.
*/
name: string;
/**
* A thumbnail image. **Note:** There is no guarantee that the size of the
* thumbnail is the same as the `thumbnailSize` specified in the `options` passed
* to `desktopCapturer.getSources`. The actual size depends on the scale of the
* screen or window.
*/
thumbnail: NativeImage;
}
interface Dialog {
// Docs: https://electronjs.org/docs/api/dialog
/**
* resolves when the certificate trust dialog is shown.
*
* On macOS, this displays a modal dialog that shows a message and certificate
* information, and gives the user the option of trusting/importing the
* certificate. If you provide a `browserWindow` argument the dialog will be
* attached to the parent window, making it modal.
*
* On Windows the options are more limited, due to the Win32 APIs used:
*
* * The `message` argument is not used, as the OS provides its own confirmation
* dialog.
* * The `browserWindow` argument is ignored since it is not possible to make this
* confirmation dialog modal.
*
* @platform darwin,win32
*/
showCertificateTrustDialog(browserWindow: BrowserWindow, options: CertificateTrustDialogOptions): Promise<void>;
/**
* resolves when the certificate trust dialog is shown.
*
* On macOS, this displays a modal dialog that shows a message and certificate
* information, and gives the user the option of trusting/importing the
* certificate. If you provide a `browserWindow` argument the dialog will be
* attached to the parent window, making it modal.
*
* On Windows the options are more limited, due to the Win32 APIs used:
*
* * The `message` argument is not used, as the OS provides its own confirmation
* dialog.
* * The `browserWindow` argument is ignored since it is not possible to make this
* confirmation dialog modal.
*
* @platform darwin,win32
*/
showCertificateTrustDialog(options: CertificateTrustDialogOptions): Promise<void>;
/**
* Displays a modal dialog that shows an error message.
*
* This API can be called safely before the `ready` event the `app` module emits,
* it is usually used to report errors in early stage of startup. If called before
* the app `ready`event on Linux, the message will be emitted to stderr, and no GUI
* dialog will appear.
*/
showErrorBox(title: string, content: string): void;
/**
* resolves with a promise containing the following properties:
*
* * `response` number - The index of the clicked button.
* * `checkboxChecked` boolean - The checked state of the checkbox if
* `checkboxLabel` was set. Otherwise `false`.
*
* Shows a message box.
*
* The `browserWindow` argument allows the dialog to attach itself to a parent
* window, making it modal.
*/
showMessageBox(browserWindow: BrowserWindow, options: MessageBoxOptions): Promise<Electron.MessageBoxReturnValue>;
/**
* resolves with a promise containing the following properties:
*
* * `response` number - The index of the clicked button.
* * `checkboxChecked` boolean - The checked state of the checkbox if
* `checkboxLabel` was set. Otherwise `false`.
*
* Shows a message box.
*
* The `browserWindow` argument allows the dialog to attach itself to a parent
* window, making it modal.
*/
showMessageBox(options: MessageBoxOptions): Promise<Electron.MessageBoxReturnValue>;
/**
* the index of the clicked button.
*
* Shows a message box, it will block the process until the message box is closed.
* It returns the index of the clicked button.
*
* The `browserWindow` argument allows the dialog to attach itself to a parent
* window, making it modal. If `browserWindow` is not shown dialog will not be
* attached to it. In such case it will be displayed as an independent window.
*/
showMessageBoxSync(browserWindow: BrowserWindow, options: MessageBoxSyncOptions): number;
/**
* the index of the clicked button.
*
* Shows a message box, it will block the process until the message box is closed.
* It returns the index of the clicked button.
*
* The `browserWindow` argument allows the dialog to attach itself to a parent
* window, making it modal. If `browserWindow` is not shown dialog will not be
* attached to it. In such case it will be displayed as an independent window.
*/
showMessageBoxSync(options: MessageBoxSyncOptions): number;
/**
* Resolve with an object containing the following:
*
* * `canceled` boolean - whether or not the dialog was canceled.
* * `filePaths` string[] - An array of file paths chosen by the user. If the
* dialog is cancelled this will be an empty array.
* * `bookmarks` string[] (optional) _macOS_ _mas_ - An array matching the
* `filePaths` array of base64 encoded strings which contains security scoped
* bookmark data. `securityScopedBookmarks` must be enabled for this to be
* populated. (For return values, see table here.)
*
* The `browserWindow` argument allows the dialog to attach itself to a parent
* window, making it modal.
*
* The `filters` specifies an array of file types that can be displayed or selected
* when you want to limit the user to a specific type. For example:
*
* The `extensions` array should contain extensions without wildcards or dots (e.g.
* `'png'` is good but `'.png'` and `'*.png'` are bad). To show all files, use the
* `'*'` wildcard (no other wildcard is supported).
*
* **Note:** On Windows and Linux an open dialog can not be both a file selector
* and a directory selector, so if you set `properties` to `['openFile',
* 'openDirectory']` on these platforms, a directory selector will be shown.
*/
showOpenDialog(browserWindow: BrowserWindow, options: OpenDialogOptions): Promise<Electron.OpenDialogReturnValue>;
/**
* Resolve with an object containing the following:
*
* * `canceled` boolean - whether or not the dialog was canceled.
* * `filePaths` string[] - An array of file paths chosen by the user. If the
* dialog is cancelled this will be an empty array.
* * `bookmarks` string[] (optional) _macOS_ _mas_ - An array matching the
* `filePaths` array of base64 encoded strings which contains security scoped
* bookmark data. `securityScopedBookmarks` must be enabled for this to be
* populated. (For return values, see table here.)
*
* The `browserWindow` argument allows the dialog to attach itself to a parent
* window, making it modal.
*
* The `filters` specifies an array of file types that can be displayed or selected
* when you want to limit the user to a specific type. For example:
*
* The `extensions` array should contain extensions without wildcards or dots (e.g.
* `'png'` is good but `'.png'` and `'*.png'` are bad). To show all files, use the
* `'*'` wildcard (no other wildcard is supported).
*
* **Note:** On Windows and Linux an open dialog can not be both a file selector
* and a directory selector, so if you set `properties` to `['openFile',
* 'openDirectory']` on these platforms, a directory selector will be shown.
*/
showOpenDialog(options: OpenDialogOptions): Promise<Electron.OpenDialogReturnValue>;
/**
* the file paths chosen by the user; if the dialog is cancelled it returns
* `undefined`.
*
* The `browserWindow` argument allows the dialog to attach itself to a parent
* window, making it modal.
*
* The `filters` specifies an array of file types that can be displayed or selected
* when you want to limit the user to a specific type. For example:
*
* The `extensions` array should contain extensions without wildcards or dots (e.g.
* `'png'` is good but `'.png'` and `'*.png'` are bad). To show all files, use the
* `'*'` wildcard (no other wildcard is supported).
*
* **Note:** On Windows and Linux an open dialog can not be both a file selector
* and a directory selector, so if you set `properties` to `['openFile',
* 'openDirectory']` on these platforms, a directory selector will be shown.
*/
showOpenDialogSync(browserWindow: BrowserWindow, options: OpenDialogSyncOptions): (string[]) | (undefined);
/**
* the file paths chosen by the user; if the dialog is cancelled it returns
* `undefined`.
*
* The `browserWindow` argument allows the dialog to attach itself to a parent
* window, making it modal.
*
* The `filters` specifies an array of file types that can be displayed or selected
* when you want to limit the user to a specific type. For example:
*
* The `extensions` array should contain extensions without wildcards or dots (e.g.
* `'png'` is good but `'.png'` and `'*.png'` are bad). To show all files, use the
* `'*'` wildcard (no other wildcard is supported).
*
* **Note:** On Windows and Linux an open dialog can not be both a file selector
* and a directory selector, so if you set `properties` to `['openFile',
* 'openDirectory']` on these platforms, a directory selector will be shown.
*/
showOpenDialogSync(options: OpenDialogSyncOptions): (string[]) | (undefined);
/**
* Resolve with an object containing the following:
*
* * `canceled` boolean - whether or not the dialog was canceled.
* * `filePath` string (optional) - If the dialog is canceled, this will be
* `undefined`.
* * `bookmark` string (optional) _macOS_ _mas_ - Base64 encoded string which
* contains the security scoped bookmark data for the saved file.
* `securityScopedBookmarks` must be enabled for this to be present. (For return
* values, see table here.)
*
* The `browserWindow` argument allows the dialog to attach itself to a parent
* window, making it modal.
*
* The `filters` specifies an array of file types that can be displayed, see
* `dialog.showOpenDialog` for an example.
*
* **Note:** On macOS, using the asynchronous version is recommended to avoid
* issues when expanding and collapsing the dialog.
*/
showSaveDialog(browserWindow: BrowserWindow, options: SaveDialogOptions): Promise<Electron.SaveDialogReturnValue>;
/**
* Resolve with an object containing the following:
*
* * `canceled` boolean - whether or not the dialog was canceled.
* * `filePath` string (optional) - If the dialog is canceled, this will be
* `undefined`.
* * `bookmark` string (optional) _macOS_ _mas_ - Base64 encoded string which
* contains the security scoped bookmark data for the saved file.
* `securityScopedBookmarks` must be enabled for this to be present. (For return
* values, see table here.)
*
* The `browserWindow` argument allows the dialog to attach itself to a parent
* window, making it modal.
*
* The `filters` specifies an array of file types that can be displayed, see
* `dialog.showOpenDialog` for an example.
*
* **Note:** On macOS, using the asynchronous version is recommended to avoid
* issues when expanding and collapsing the dialog.
*/
showSaveDialog(options: SaveDialogOptions): Promise<Electron.SaveDialogReturnValue>;
/**
* the path of the file chosen by the user; if the dialog is cancelled it returns
* `undefined`.
*
* The `browserWindow` argument allows the dialog to attach itself to a parent
* window, making it modal.
*
* The `filters` specifies an array of file types that can be displayed, see
* `dialog.showOpenDialog` for an example.
*/
showSaveDialogSync(browserWindow: BrowserWindow, options: SaveDialogSyncOptions): (string) | (undefined);
/**
* the path of the file chosen by the user; if the dialog is cancelled it returns
* `undefined`.
*
* The `browserWindow` argument allows the dialog to attach itself to a parent
* window, making it modal.
*
* The `filters` specifies an array of file types that can be displayed, see
* `dialog.showOpenDialog` for an example.
*/
showSaveDialogSync(options: SaveDialogSyncOptions): (string) | (undefined);
}
interface Display {
// Docs: https://electronjs.org/docs/api/structures/display
/**
* Can be `available`, `unavailable`, `unknown`.
*/
accelerometerSupport: ('available' | 'unavailable' | 'unknown');
/**
* the bounds of the display in DIP points.
*/
bounds: Rectangle;
/**
* The number of bits per pixel.
*/
colorDepth: number;
/**
* represent a color space (three-dimensional object which contains all realizable
* color combinations) for the purpose of color conversions
*/
colorSpace: string;
/**
* The number of bits per color component.
*/
depthPerComponent: number;
/**
* The display refresh rate.
*/
displayFrequency: number;
/**
* Unique identifier associated with the display.
*/
id: number;
/**
* `true` for an internal display and `false` for an external display
*/
internal: boolean;
/**
* User-friendly label, determined by the platform.
*/
label: string;
/**
* Whether or not the display is a monochrome display.
*/
monochrome: boolean;
/**
* Can be 0, 90, 180, 270, represents screen rotation in clock-wise degrees.
*/
rotation: number;
/**
* Output device's pixel scale factor.
*/
scaleFactor: number;
size: Size;
/**
* Can be `available`, `unavailable`, `unknown`.
*/
touchSupport: ('available' | 'unavailable' | 'unknown');
/**
* the work area of the display in DIP points.
*/
workArea: Rectangle;
workAreaSize: Size;
}
class Dock {
// Docs: https://electronjs.org/docs/api/dock
/**
* an ID representing the request.
*
* When `critical` is passed, the dock icon will bounce until either the
* application becomes active or the request is canceled.
*
* When `informational` is passed, the dock icon will bounce for one second.
* However, the request remains active until either the application becomes active
* or the request is canceled.
*
* **Note:** This method can only be used while the app is not focused; when the
* app is focused it will return -1.
*
* @platform darwin
*/
bounce(type?: 'critical' | 'informational'): number;
/**
* Cancel the bounce of `id`.
*
* @platform darwin
*/
cancelBounce(id: number): void;
/**
* Bounces the Downloads stack if the filePath is inside the Downloads folder.
*
* @platform darwin
*/
downloadFinished(filePath: string): void;
/**
* The badge string of the dock.
*
* @platform darwin
*/
getBadge(): string;
/**
* The application's dock menu.
*
* @platform darwin
*/
getMenu(): (Menu) | (null);
/**
* Hides the dock icon.
*
* @platform darwin
*/
hide(): void;
/**
* Whether the dock icon is visible.
*
* @platform darwin
*/
isVisible(): boolean;
/**
* Sets the string to be displayed in the dock’s badging area.
*
* @platform darwin
*/
setBadge(text: string): void;
/**
* Sets the `image` associated with this dock icon.
*
* @platform darwin
*/
setIcon(image: (NativeImage) | (string)): void;
/**
* Sets the application's dock menu.
*
* @platform darwin
*/
setMenu(menu: Menu): void;
/**
* Resolves when the dock icon is shown.
*
* @platform darwin
*/
show(): Promise<void>;
}
class DownloadItem extends NodeEventEmitter {
// Docs: https://electronjs.org/docs/api/download-item
/**
* Emitted when the download is in a terminal state. This includes a completed
* download, a cancelled download (via `downloadItem.cancel()`), and interrupted
* download that can't be resumed.
*
* The `state` can be one of following:
*
* * `completed` - The download completed successfully.
* * `cancelled` - The download has been cancelled.
* * `interrupted` - The download has interrupted and can not resume.
*/
on(event: 'done', listener: (event: Event,
/**
* Can be `completed`, `cancelled` or `interrupted`.
*/
state: ('completed' | 'cancelled' | 'interrupted')) => void): this;
once(event: 'done', listener: (event: Event,
/**
* Can be `completed`, `cancelled` or `interrupted`.
*/
state: ('completed' | 'cancelled' | 'interrupted')) => void): this;
addListener(event: 'done', listener: (event: Event,
/**
* Can be `completed`, `cancelled` or `interrupted`.
*/
state: ('completed' | 'cancelled' | 'interrupted')) => void): this;
removeListener(event: 'done', listener: (event: Event,
/**
* Can be `completed`, `cancelled` or `interrupted`.
*/
state: ('completed' | 'cancelled' | 'interrupted')) => void): this;
/**
* Emitted when the download has been updated and is not done.
*
* The `state` can be one of following:
*
* * `progressing` - The download is in-progress.
* * `interrupted` - The download has interrupted and can be resumed.
*/
on(event: 'updated', listener: (event: Event,
/**
* Can be `progressing` or `interrupted`.
*/
state: ('progressing' | 'interrupted')) => void): this;
once(event: 'updated', listener: (event: Event,
/**
* Can be `progressing` or `interrupted`.
*/
state: ('progressing' | 'interrupted')) => void): this;
addListener(event: 'updated', listener: (event: Event,
/**
* Can be `progressing` or `interrupted`.
*/
state: ('progressing' | 'interrupted')) => void): this;
removeListener(event: 'updated', listener: (event: Event,
/**
* Can be `progressing` or `interrupted`.
*/
state: ('progressing' | 'interrupted')) => void): this;
/**
* Cancels the download operation.
*/
cancel(): void;
/**
* Whether the download can resume.
*/
canResume(): boolean;
/**
* The Content-Disposition field from the response header.
*/
getContentDisposition(): string;
/**
* ETag header value.
*/
getETag(): string;
/**
* The file name of the download item.
*
* **Note:** The file name is not always the same as the actual one saved in local
* disk. If user changes the file name in a prompted download saving dialog, the
* actual name of saved file will be different.
*/
getFilename(): string;
/**
* Last-Modified header value.
*/
getLastModifiedTime(): string;
/**
* The files mime type.
*/
getMimeType(): string;
/**
* The received bytes of the download item.
*/
getReceivedBytes(): number;
/**
* Returns the object previously set by
* `downloadItem.setSaveDialogOptions(options)`.
*/
getSaveDialogOptions(): SaveDialogOptions;
/**
* The save path of the download item. This will be either the path set via
* `downloadItem.setSavePath(path)` or the path selected from the shown save
* dialog.
*/
getSavePath(): string;
/**
* Number of seconds since the UNIX epoch when the download was started.
*/
getStartTime(): number;
/**
* The current state. Can be `progressing`, `completed`, `cancelled` or
* `interrupted`.
*
* **Note:** The following methods are useful specifically to resume a `cancelled`
* item when session is restarted.
*/
getState(): ('progressing' | 'completed' | 'cancelled' | 'interrupted');
/**
* The total size in bytes of the download item.
*
* If the size is unknown, it returns 0.
*/
getTotalBytes(): number;
/**
* The origin URL where the item is downloaded from.
*/
getURL(): string;
/**
* The complete URL chain of the item including any redirects.
*/
getURLChain(): string[];
/**
* Whether the download has user gesture.
*/
hasUserGesture(): boolean;
/**
* Whether the download is paused.
*/
isPaused(): boolean;
/**
* Pauses the download.
*/
pause(): void;
/**
* Resumes the download that has been paused.
*
* **Note:** To enable resumable downloads the server you are downloading from must
* support range requests and provide both `Last-Modified` and `ETag` header
* values. Otherwise `resume()` will dismiss previously received bytes and restart
* the download from the beginning.
*/
resume(): void;
/**
* This API allows the user to set custom options for the save dialog that opens
* for the download item by default. The API is only available in session's
* `will-download` callback function.
*/
setSaveDialogOptions(options: SaveDialogOptions): void;
/**
* The API is only available in session's `will-download` callback function. If
* `path` doesn't exist, Electron will try to make the directory recursively. If
* user doesn't set the save path via the API, Electron will use the original
* routine to determine the save path; this usually prompts a save dialog.
*/
setSavePath(path: string): void;
/**
* A `string` property that determines the save file path of the download item.
*
* The property is only available in session's `will-download` callback function.
* If user doesn't set the save path via the property, Electron will use the
* original routine to determine the save path; this usually prompts a save dialog.
*/
savePath: string;
}
interface Extension {
// Docs: https://electronjs.org/docs/api/structures/extension
id: string;
/**
* Copy of the extension's manifest data.
*/
manifest: any;
name: string;
/**
* The extension's file path.
*/
path: string;
/**
* The extension's `chrome-extension://` URL.
*/
url: string;
version: string;
}
interface ExtensionInfo {
// Docs: https://electronjs.org/docs/api/structures/extension-info
name: string;
version: string;
}
interface FileFilter {
// Docs: https://electronjs.org/docs/api/structures/file-filter
extensions: string[];
name: string;
}
interface FilePathWithHeaders {
// Docs: https://electronjs.org/docs/api/structures/file-path-with-headers
/**
* Additional headers to be sent.
*/
headers?: Record<string, string>;
/**
* The path to the file to send.
*/
path: string;
}
interface GlobalShortcut {
// Docs: https://electronjs.org/docs/api/global-shortcut
/**
* Whether this application has registered `accelerator`.
*
* When the accelerator is already taken by other applications, this call will
* still return `false`. This behavior is intended by operating systems, since they
* don't want applications to fight for global shortcuts.
*/
isRegistered(accelerator: Accelerator): boolean;
/**
* Whether or not the shortcut was registered successfully.
*
* Registers a global shortcut of `accelerator`. The `callback` is called when the
* registered shortcut is pressed by the user.
*
* When the accelerator is already taken by other applications, this call will
* silently fail. This behavior is intended by operating systems, since they don't
* want applications to fight for global shortcuts.
*
* The following accelerators will not be registered successfully on macOS 10.14
* Mojave unless the app has been authorized as a trusted accessibility client:
*
* * "Media Play/Pause"
* * "Media Next Track"
* * "Media Previous Track"
* * "Media Stop"
*/
register(accelerator: Accelerator, callback: () => void): boolean;
/**
* Registers a global shortcut of all `accelerator` items in `accelerators`. The
* `callback` is called when any of the registered shortcuts are pressed by the
* user.
*
* When a given accelerator is already taken by other applications, this call will
* silently fail. This behavior is intended by operating systems, since they don't
* want applications to fight for global shortcuts.
*
* The following accelerators will not be registered successfully on macOS 10.14
* Mojave unless the app has been authorized as a trusted accessibility client:
*
* * "Media Play/Pause"
* * "Media Next Track"
* * "Media Previous Track"
* * "Media Stop"
*/
registerAll(accelerators: Accelerator[], callback: () => void): void;
/**
* Unregisters the global shortcut of `accelerator`.
*/
unregister(accelerator: Accelerator): void;
/**
* Unregisters all of the global shortcuts.
*/
unregisterAll(): void;
}
interface GPUFeatureStatus {
// Docs: https://electronjs.org/docs/api/structures/gpu-feature-status
/**
* Canvas.
*/
'2d_canvas': string;
/**
* Flash.
*/
flash_3d: string;
/**
* Flash Stage3D.
*/
flash_stage3d: string;
/**
* Flash Stage3D Baseline profile.
*/
flash_stage3d_baseline: string;
/**
* Compositing.
*/
gpu_compositing: string;
/**
* Multiple Raster Threads.
*/
multiple_raster_threads: string;
/**
* Native GpuMemoryBuffers.
*/
native_gpu_memory_buffers: string;
/**
* Rasterization.
*/
rasterization: string;
/**
* Video Decode.
*/
video_decode: string;
/**
* Video Encode.
*/
video_encode: string;
/**
* VPx Video Decode.
*/
vpx_decode: string;
/**
* WebGL.
*/
webgl: string;
/**
* WebGL2.
*/
webgl2: string;
}
interface HIDDevice {
// Docs: https://electronjs.org/docs/api/structures/hid-device
/**
* Unique identifier for the device.
*/
deviceId: string;
/**
* Unique identifier for the HID interface. A device may have multiple HID
* interfaces.
*/
guid?: string;
/**
* Name of the device.
*/
name: string;
/**
* The USB product ID.
*/
productId: number;
/**
* The USB device serial number.
*/
serialNumber?: string;
/**
* The USB vendor ID.
*/
vendorId: number;
}
interface InAppPurchase extends NodeJS.EventEmitter {
// Docs: https://electronjs.org/docs/api/in-app-purchase
on(event: 'transactions-updated', listener: Function): this;
once(event: 'transactions-updated', listener: Function): this;
addListener(event: 'transactions-updated', listener: Function): this;
removeListener(event: 'transactions-updated', listener: Function): this;
/**
* whether a user can make a payment.
*/
canMakePayments(): boolean;
/**
* Completes all pending transactions.
*/
finishAllTransactions(): void;
/**
* Completes the pending transactions corresponding to the date.
*/
finishTransactionByDate(date: string): void;
/**
* Resolves with an array of `Product` objects.
*
* Retrieves the product descriptions.
*/
getProducts(productIDs: string[]): Promise<Electron.Product[]>;
/**
* the path to the receipt.
*/
getReceiptURL(): string;
/**
* Returns `true` if the product is valid and added to the payment queue.
*
* You should listen for the `transactions-updated` event as soon as possible and
* certainly before you call `purchaseProduct`.
*/
purchaseProduct(productID: string, opts?: (number) | (PurchaseProductOpts)): Promise<boolean>;
/**
* Restores finished transactions. This method can be called either to install
* purchases on additional devices, or to restore purchases for an application that
* the user deleted and reinstalled.
*
* The payment queue delivers a new transaction for each previously completed
* transaction that can be restored. Each transaction includes a copy of the
* original transaction.
*/
restoreCompletedTransactions(): void;
}
class IncomingMessage extends NodeEventEmitter {
// Docs: https://electronjs.org/docs/api/incoming-message
/**
* Emitted when a request has been canceled during an ongoing HTTP transaction.
*/
on(event: 'aborted', listener: Function): this;
once(event: 'aborted', listener: Function): this;
addListener(event: 'aborted', listener: Function): this;
removeListener(event: 'aborted', listener: Function): this;
/**
* The `data` event is the usual method of transferring response data into
* applicative code.
*/
on(event: 'data', listener: (
/**
* A chunk of response body's data.
*/
chunk: Buffer) => void): this;
once(event: 'data', listener: (
/**
* A chunk of response body's data.
*/
chunk: Buffer) => void): this;
addListener(event: 'data', listener: (
/**
* A chunk of response body's data.
*/
chunk: Buffer) => void): this;
removeListener(event: 'data', listener: (
/**
* A chunk of response body's data.
*/
chunk: Buffer) => void): this;
/**
* Indicates that response body has ended. Must be placed before 'data' event.
*/
on(event: 'end', listener: Function): this;
once(event: 'end', listener: Function): this;
addListener(event: 'end', listener: Function): this;
removeListener(event: 'end', listener: Function): this;
/**
* Returns:
*
* `error` Error - Typically holds an error string identifying failure root cause.
*
* Emitted when an error was encountered while streaming response data events. For
* instance, if the server closes the underlying while the response is still
* streaming, an `error` event will be emitted on the response object and a `close`
* event will subsequently follow on the request object.
*/
on(event: 'error', listener: Function): this;
once(event: 'error', listener: Function): this;
addListener(event: 'error', listener: Function): this;
removeListener(event: 'error', listener: Function): this;
/**
* A `Record<string, string | string[]>` representing the HTTP response headers.
* The `headers` object is formatted as follows:
*
* * All header names are lowercased.
* * Duplicates of `age`, `authorization`, `content-length`, `content-type`,
* `etag`, `expires`, `from`, `host`, `if-modified-since`, `if-unmodified-since`,
* `last-modified`, `location`, `max-forwards`, `proxy-authorization`, `referer`,
* `retry-after`, `server`, or `user-agent` are discarded.
* * `set-cookie` is always an array. Duplicates are added to the array.
* * For duplicate `cookie` headers, the values are joined together with '; '.
* * For all other headers, the values are joined together with ', '.
*/
headers: Record<string, (string) | (string[])>;
/**
* A `string` indicating the HTTP protocol version number. Typical values are '1.0'
* or '1.1'. Additionally `httpVersionMajor` and `httpVersionMinor` are two
* Integer-valued readable properties that return respectively the HTTP major and
* minor version numbers.
*/
httpVersion: string;
/**
* An `Integer` indicating the HTTP protocol major version number.
*/
httpVersionMajor: number;
/**
* An `Integer` indicating the HTTP protocol minor version number.
*/
httpVersionMinor: number;
/**
* A `string[]` containing the raw HTTP response headers exactly as they were
* received. The keys and values are in the same list. It is not a list of tuples.
* So, the even-numbered offsets are key values, and the odd-numbered offsets are
* the associated values. Header names are not lowercased, and duplicates are not
* merged.
*/
rawHeaders: string[];
/**
* An `Integer` indicating the HTTP response status code.
*/
statusCode: number;
/**
* A `string` representing the HTTP status message.
*/
statusMessage: string;
}
interface InputEvent {
// Docs: https://electronjs.org/docs/api/structures/input-event
/**
* An array of modifiers of the event, can be `shift`, `control`, `ctrl`, `alt`,
* `meta`, `command`, `cmd`, `isKeypad`, `isAutoRepeat`, `leftButtonDown`,
* `middleButtonDown`, `rightButtonDown`, `capsLock`, `numLock`, `left`, `right`.
*/
modifiers?: Array<'shift' | 'control' | 'ctrl' | 'alt' | 'meta' | 'command' | 'cmd' | 'isKeypad' | 'isAutoRepeat' | 'leftButtonDown' | 'middleButtonDown' | 'rightButtonDown' | 'capsLock' | 'numLock' | 'left' | 'right'>;
/**
* Can be `undefined`, `mouseDown`, `mouseUp`, `mouseMove`, `mouseEnter`,
* `mouseLeave`, `contextMenu`, `mouseWheel`, `rawKeyDown`, `keyDown`, `keyUp`,
* `char`, `gestureScrollBegin`, `gestureScrollEnd`, `gestureScrollUpdate`,
* `gestureFlingStart`, `gestureFlingCancel`, `gesturePinchBegin`,
* `gesturePinchEnd`, `gesturePinchUpdate`, `gestureTapDown`, `gestureShowPress`,
* `gestureTap`, `gestureTapCancel`, `gestureShortPress`, `gestureLongPress`,
* `gestureLongTap`, `gestureTwoFingerTap`, `gestureTapUnconfirmed`,
* `gestureDoubleTap`, `touchStart`, `touchMove`, `touchEnd`, `touchCancel`,
* `touchScrollStarted`, `pointerDown`, `pointerUp`, `pointerMove`,
* `pointerRawUpdate`, `pointerCancel` or `pointerCausedUaAction`.
*/
type: ('undefined' | 'mouseDown' | 'mouseUp' | 'mouseMove' | 'mouseEnter' | 'mouseLeave' | 'contextMenu' | 'mouseWheel' | 'rawKeyDown' | 'keyDown' | 'keyUp' | 'char' | 'gestureScrollBegin' | 'gestureScrollEnd' | 'gestureScrollUpdate' | 'gestureFlingStart' | 'gestureFlingCancel' | 'gesturePinchBegin' | 'gesturePinchEnd' | 'gesturePinchUpdate' | 'gestureTapDown' | 'gestureShowPress' | 'gestureTap' | 'gestureTapCancel' | 'gestureShortPress' | 'gestureLongPress' | 'gestureLongTap' | 'gestureTwoFingerTap' | 'gestureTapUnconfirmed' | 'gestureDoubleTap' | 'touchStart' | 'touchMove' | 'touchEnd' | 'touchCancel' | 'touchScrollStarted' | 'pointerDown' | 'pointerUp' | 'pointerMove' | 'pointerRawUpdate' | 'pointerCancel' | 'pointerCausedUaAction');
}
interface IOCounters {
// Docs: https://electronjs.org/docs/api/structures/io-counters
/**
* Then number of I/O other operations.
*/
otherOperationCount: number;
/**
* Then number of I/O other transfers.
*/
otherTransferCount: number;
/**
* The number of I/O read operations.
*/
readOperationCount: number;
/**
* The number of I/O read transfers.
*/
readTransferCount: number;
/**
* The number of I/O write operations.
*/
writeOperationCount: number;
/**
* The number of I/O write transfers.
*/
writeTransferCount: number;
}
interface IpcMain extends NodeJS.EventEmitter {
// Docs: https://electronjs.org/docs/api/ipc-main
/**
* Adds a handler for an `invoke`able IPC. This handler will be called whenever a
* renderer calls `ipcRenderer.invoke(channel, ...args)`.
*
* If `listener` returns a Promise, the eventual result of the promise will be
* returned as a reply to the remote caller. Otherwise, the return value of the
* listener will be used as the value of the reply.
*
* The `event` that is passed as the first argument to the handler is the same as
* that passed to a regular event listener. It includes information about which
* WebContents is the source of the invoke request.
*
* Errors thrown through `handle` in the main process are not transparent as they
* are serialized and only the `message` property from the original error is
* provided to the renderer process. Please refer to #24427 for details.
*/
handle(channel: string, listener: (event: IpcMainInvokeEvent, ...args: any[]) => (Promise<any>) | (any)): void;
/**
* Handles a single `invoke`able IPC message, then removes the listener. See
* `ipcMain.handle(channel, listener)`.
*/
handleOnce(channel: string, listener: (event: IpcMainInvokeEvent, ...args: any[]) => (Promise<any>) | (any)): void;
/**
* Listens to `channel`, when a new message arrives `listener` would be called with
* `listener(event, args...)`.
*/
on(channel: string, listener: (event: IpcMainEvent, ...args: any[]) => void): this;
/**
* Adds a one time `listener` function for the event. This `listener` is invoked
* only the next time a message is sent to `channel`, after which it is removed.
*/
once(channel: string, listener: (event: IpcMainEvent, ...args: any[]) => void): this;
/**
* Removes listeners of the specified `channel`.
*/
removeAllListeners(channel?: string): this;
/**
* Removes any handler for `channel`, if present.
*/
removeHandler(channel: string): void;
/**
* Removes the specified `listener` from the listener array for the specified
* `channel`.
*/
removeListener(channel: string, listener: (...args: any[]) => void): this;
}
interface IpcMainEvent extends Event {
// Docs: https://electronjs.org/docs/api/structures/ipc-main-event
/**
* The ID of the renderer frame that sent this message
*/
frameId: number;
/**
* A list of MessagePorts that were transferred with this message
*/
ports: MessagePortMain[];
/**
* The internal ID of the renderer process that sent this message
*/
processId: number;
/**
* A function that will send an IPC message to the renderer frame that sent the
* original message that you are currently handling. You should use this method to
* "reply" to the sent message in order to guarantee the reply will go to the
* correct process and frame.
*/
reply: (channel: string, ...args: any[]) => void;
/**
* Set this to the value to be returned in a synchronous message
*/
returnValue: any;
/**
* Returns the `webContents` that sent the message
*/
sender: WebContents;
/**
* The frame that sent this message
*
*/
readonly senderFrame: WebFrameMain;
}
interface IpcMainInvokeEvent extends Event {
// Docs: https://electronjs.org/docs/api/structures/ipc-main-invoke-event
/**
* The ID of the renderer frame that sent this message
*/
frameId: number;
/**
* The internal ID of the renderer process that sent this message
*/
processId: number;
/**
* Returns the `webContents` that sent the message
*/
sender: WebContents;
/**
* The frame that sent this message
*
*/
readonly senderFrame: WebFrameMain;
}
interface IpcRenderer extends NodeJS.EventEmitter {
// Docs: https://electronjs.org/docs/api/ipc-renderer
/**
* Resolves with the response from the main process.
*
* Send a message to the main process via `channel` and expect a result
* asynchronously. Arguments will be serialized with the Structured Clone
* Algorithm, just like `window.postMessage`, so prototype chains will not be
* included. Sending Functions, Promises, Symbols, WeakMaps, or WeakSets will throw
* an exception.
*
* The main process should listen for `channel` with `ipcMain.handle()`.
*
* For example:
*
* If you need to transfer a `MessagePort` to the main process, use
* `ipcRenderer.postMessage`.
*
* If you do not need a response to the message, consider using `ipcRenderer.send`.
*
* > **Note** Sending non-standard JavaScript types such as DOM objects or special
* Electron objects will throw an exception.
*
* Since the main process does not have support for DOM objects such as
* `ImageBitmap`, `File`, `DOMMatrix` and so on, such objects cannot be sent over
* Electron's IPC to the main process, as the main process would have no way to
* decode them. Attempting to send such objects over IPC will result in an error.
*
* > **Note** If the handler in the main process throws an error, the promise
* returned by `invoke` will reject. However, the `Error` object in the renderer
* process will not be the same as the one thrown in the main process.
*/
invoke(channel: string, ...args: any[]): Promise<any>;
/**
* Listens to `channel`, when a new message arrives `listener` would be called with
* `listener(event, args...)`.
*/
on(channel: string, listener: (event: IpcRendererEvent, ...args: any[]) => void): this;
/**
* Adds a one time `listener` function for the event. This `listener` is invoked
* only the next time a message is sent to `channel`, after which it is removed.
*/
once(channel: string, listener: (event: IpcRendererEvent, ...args: any[]) => void): this;
/**
* Send a message to the main process, optionally transferring ownership of zero or
* more `MessagePort` objects.
*
* The transferred `MessagePort` objects will be available in the main process as
* `MessagePortMain` objects by accessing the `ports` property of the emitted
* event.
*
* For example:
*
* For more information on using `MessagePort` and `MessageChannel`, see the MDN
* documentation.
*/
postMessage(channel: string, message: any, transfer?: MessagePort[]): void;
/**
* Removes all listeners, or those of the specified `channel`.
*/
removeAllListeners(channel: string): this;
/**
* Removes the specified `listener` from the listener array for the specified
* `channel`.
*/
removeListener(channel: string, listener: (...args: any[]) => void): this;
/**
* Send an asynchronous message to the main process via `channel`, along with
* arguments. Arguments will be serialized with the Structured Clone Algorithm,
* just like `window.postMessage`, so prototype chains will not be included.
* Sending Functions, Promises, Symbols, WeakMaps, or WeakSets will throw an
* exception.
*
* > **NOTE:** Sending non-standard JavaScript types such as DOM objects or special
* Electron objects will throw an exception.
*
* Since the main process does not have support for DOM objects such as
* `ImageBitmap`, `File`, `DOMMatrix` and so on, such objects cannot be sent over
* Electron's IPC to the main process, as the main process would have no way to
* decode them. Attempting to send such objects over IPC will result in an error.
*
* The main process handles it by listening for `channel` with the `ipcMain`
* module.
*
* If you need to transfer a `MessagePort` to the main process, use
* `ipcRenderer.postMessage`.
*
* If you want to receive a single response from the main process, like the result
* of a method call, consider using `ipcRenderer.invoke`.
*/
send(channel: string, ...args: any[]): void;
/**
* The value sent back by the `ipcMain` handler.
*
* Send a message to the main process via `channel` and expect a result
* synchronously. Arguments will be serialized with the Structured Clone Algorithm,
* just like `window.postMessage`, so prototype chains will not be included.
* Sending Functions, Promises, Symbols, WeakMaps, or WeakSets will throw an
* exception.
*
* > **NOTE:** Sending non-standard JavaScript types such as DOM objects or special
* Electron objects will throw an exception.
*
* Since the main process does not have support for DOM objects such as
* `ImageBitmap`, `File`, `DOMMatrix` and so on, such objects cannot be sent over
* Electron's IPC to the main process, as the main process would have no way to
* decode them. Attempting to send such objects over IPC will result in an error.
*
* The main process handles it by listening for `channel` with `ipcMain` module,
* and replies by setting `event.returnValue`.
*
* > :warning: **WARNING**: Sending a synchronous message will block the whole
* renderer process until the reply is received, so use this method only as a last
* resort. It's much better to use the asynchronous version, `invoke()`.
*/
sendSync(channel: string, ...args: any[]): any;
/**
* Sends a message to a window with `webContentsId` via `channel`.
*
* @deprecated
*/
sendTo(webContentsId: number, channel: string, ...args: any[]): void;
/**
* Like `ipcRenderer.send` but the event will be sent to the `<webview>` element in
* the host page instead of the main process.
*/
sendToHost(channel: string, ...args: any[]): void;
}
interface IpcRendererEvent extends Event {
// Docs: https://electronjs.org/docs/api/structures/ipc-renderer-event
/**
* A list of MessagePorts that were transferred with this message
*/
ports: MessagePort[];
/**
* The `IpcRenderer` instance that emitted the event originally
*/
sender: IpcRenderer;
/**
* The `webContents.id` that sent the message, you can call
* `event.sender.sendTo(event.senderId, ...)` to reply to the message, see
* ipcRenderer.sendTo for more information. This only applies to messages sent from
* a different renderer. Messages sent directly from the main process set
* `event.senderId` to `0`.
*
* @deprecated
*/
senderId: number;
/**
* Whether the message sent via ipcRenderer.sendTo was sent by the main frame. This
* is relevant when `nodeIntegrationInSubFrames` is enabled in the originating
* `webContents`.
*
* @deprecated
*/
senderIsMainFrame?: boolean;
}
interface JumpListCategory {
// Docs: https://electronjs.org/docs/api/structures/jump-list-category
/**
* Array of `JumpListItem` objects if `type` is `tasks` or `custom`, otherwise it
* should be omitted.
*/
items?: JumpListItem[];
/**
* Must be set if `type` is `custom`, otherwise it should be omitted.
*/
name?: string;
/**
* One of the following:
*/
type?: ('tasks' | 'frequent' | 'recent' | 'custom');
}
interface JumpListItem {
// Docs: https://electronjs.org/docs/api/structures/jump-list-item
/**
* The command line arguments when `program` is executed. Should only be set if
* `type` is `task`.
*/
args?: string;
/**
* Description of the task (displayed in a tooltip). Should only be set if `type`
* is `task`. Maximum length 260 characters.
*/
description?: string;
/**
* The index of the icon in the resource file. If a resource file contains multiple
* icons this value can be used to specify the zero-based index of the icon that
* should be displayed for this task. If a resource file contains only one icon,
* this property should be set to zero.
*/
iconIndex?: number;
/**
* The absolute path to an icon to be displayed in a Jump List, which can be an
* arbitrary resource file that contains an icon (e.g. `.ico`, `.exe`, `.dll`). You
* can usually specify `process.execPath` to show the program icon.
*/
iconPath?: string;
/**
* Path of the file to open, should only be set if `type` is `file`.
*/
path?: string;
/**
* Path of the program to execute, usually you should specify `process.execPath`
* which opens the current program. Should only be set if `type` is `task`.
*/
program?: string;
/**
* The text to be displayed for the item in the Jump List. Should only be set if
* `type` is `task`.
*/
title?: string;
/**
* One of the following:
*/
type?: ('task' | 'separator' | 'file');
/**
* The working directory. Default is empty.
*/
workingDirectory?: string;
}
interface KeyboardEvent {
// Docs: https://electronjs.org/docs/api/structures/keyboard-event
/**
* whether an Alt key was used in an accelerator to trigger the Event
*/
altKey?: boolean;
/**
* whether the Control key was used in an accelerator to trigger the Event
*/
ctrlKey?: boolean;
/**
* whether a meta key was used in an accelerator to trigger the Event
*/
metaKey?: boolean;
/**
* whether a Shift key was used in an accelerator to trigger the Event
*/
shiftKey?: boolean;
/**
* whether an accelerator was used to trigger the event as opposed to another user
* gesture like mouse click
*/
triggeredByAccelerator?: boolean;
}
interface KeyboardInputEvent extends InputEvent {
// Docs: https://electronjs.org/docs/api/structures/keyboard-input-event
/**
* The character that will be sent as the keyboard event. Should only use the valid
* key codes in Accelerator.
*/
keyCode: string;
/**
* The type of the event, can be `rawKeyDown`, `keyDown`, `keyUp` or `char`.
*/
type: ('rawKeyDown' | 'keyDown' | 'keyUp' | 'char');
}
interface MemoryInfo {
// Docs: https://electronjs.org/docs/api/structures/memory-info
/**
* The maximum amount of memory that has ever been pinned to actual physical RAM.
*/
peakWorkingSetSize: number;
/**
* The amount of memory not shared by other processes, such as JS heap or HTML
* content.
*
* @platform win32
*/
privateBytes?: number;
/**
* The amount of memory currently pinned to actual physical RAM.
*/
workingSetSize: number;
}
interface MemoryUsageDetails {
// Docs: https://electronjs.org/docs/api/structures/memory-usage-details
count: number;
liveSize: number;
size: number;
}
class Menu extends NodeEventEmitter {
// Docs: https://electronjs.org/docs/api/menu
/**
* Emitted when a popup is closed either manually or with `menu.closePopup()`.
*/
on(event: 'menu-will-close', listener: (event: Event) => void): this;
once(event: 'menu-will-close', listener: (event: Event) => void): this;
addListener(event: 'menu-will-close', listener: (event: Event) => void): this;
removeListener(event: 'menu-will-close', listener: (event: Event) => void): this;
/**
* Emitted when `menu.popup()` is called.
*/
on(event: 'menu-will-show', listener: (event: Event) => void): this;
once(event: 'menu-will-show', listener: (event: Event) => void): this;
addListener(event: 'menu-will-show', listener: (event: Event) => void): this;
removeListener(event: 'menu-will-show', listener: (event: Event) => void): this;
/**
* Menu
*/
constructor();
/**
* Generally, the `template` is an array of `options` for constructing a MenuItem.
* The usage can be referenced above.
*
* You can also attach other fields to the element of the `template` and they will
* become properties of the constructed menu items.
*/
static buildFromTemplate(template: Array<(MenuItemConstructorOptions) | (MenuItem)>): Menu;
/**
* The application menu, if set, or `null`, if not set.
*
* **Note:** The returned `Menu` instance doesn't support dynamic addition or
* removal of menu items. Instance properties can still be dynamically modified.
*/
static getApplicationMenu(): (Menu) | (null);
/**
* Sends the `action` to the first responder of application. This is used for
* emulating default macOS menu behaviors. Usually you would use the `role`
* property of a `MenuItem`.
*
* See the macOS Cocoa Event Handling Guide for more information on macOS' native
* actions.
*
* @platform darwin
*/
static sendActionToFirstResponder(action: string): void;
/**
* Sets `menu` as the application menu on macOS. On Windows and Linux, the `menu`
* will be set as each window's top menu.
*
* Also on Windows and Linux, you can use a `&` in the top-level item name to
* indicate which letter should get a generated accelerator. For example, using
* `&File` for the file menu would result in a generated `Alt-F` accelerator that
* opens the associated menu. The indicated character in the button label then gets
* an underline, and the `&` character is not displayed on the button label.
*
* In order to escape the `&` character in an item name, add a proceeding `&`. For
* example, `&&File` would result in `&File` displayed on the button label.
*
* Passing `null` will suppress the default menu. On Windows and Linux, this has
* the additional effect of removing the menu bar from the window.
*
* **Note:** The default menu will be created automatically if the app does not set
* one. It contains standard items such as `File`, `Edit`, `View`, `Window` and
* `Help`.
*/
static setApplicationMenu(menu: (Menu) | (null)): void;
/**
* Appends the `menuItem` to the menu.
*/
append(menuItem: MenuItem): void;
/**
* Closes the context menu in the `browserWindow`.
*/
closePopup(browserWindow?: BrowserWindow): void;
/**
* the item with the specified `id`
*/
getMenuItemById(id: string): (MenuItem) | (null);
/**
* Inserts the `menuItem` to the `pos` position of the menu.
*/
insert(pos: number, menuItem: MenuItem): void;
/**
* Pops up this menu as a context menu in the `BrowserWindow`.
*/
popup(options?: PopupOptions): void;
/**
* A `MenuItem[]` array containing the menu's items.
*
* Each `Menu` consists of multiple `MenuItem`s and each `MenuItem` can have a
* submenu.
*/
items: MenuItem[];
}
class MenuItem {
// Docs: https://electronjs.org/docs/api/menu-item
/**
* MenuItem
*/
constructor(options: MenuItemConstructorOptions);
/**
* An `Accelerator` (optional) indicating the item's accelerator, if set.
*/
accelerator?: Accelerator;
/**
* A `boolean` indicating whether the item is checked, this property can be
* dynamically changed.
*
* A `checkbox` menu item will toggle the `checked` property on and off when
* selected.
*
* A `radio` menu item will turn on its `checked` property when clicked, and will
* turn off that property for all adjacent items in the same menu.
*
* You can add a `click` function for additional behavior.
*/
checked: boolean;
/**
* A `Function` that is fired when the MenuItem receives a click event. It can be
* called with `menuItem.click(event, focusedWindow, focusedWebContents)`.
*
* * `event` KeyboardEvent
* * `focusedWindow` BrowserWindow
* * `focusedWebContents` WebContents
*/
click: Function;
/**
* A `number` indicating an item's sequential unique id.
*/
commandId: number;
/**
* A `boolean` indicating whether the item is enabled, this property can be
* dynamically changed.
*/
enabled: boolean;
/**
* A `NativeImage | string` (optional) indicating the item's icon, if set.
*/
icon?: (NativeImage) | (string);
/**
* A `string` indicating the item's unique id, this property can be dynamically
* changed.
*/
id: string;
/**
* A `string` indicating the item's visible label.
*/
label: string;
/**
* A `Menu` that the item is a part of.
*/
menu: Menu;
/**
* A `boolean` indicating if the accelerator should be registered with the system
* or just displayed.
*
* This property can be dynamically changed.
*/
registerAccelerator: boolean;
/**
* A `string` (optional) indicating the item's role, if set. Can be `undo`, `redo`,
* `cut`, `copy`, `paste`, `pasteAndMatchStyle`, `delete`, `selectAll`, `reload`,
* `forceReload`, `toggleDevTools`, `resetZoom`, `zoomIn`, `zoomOut`,
* `toggleSpellChecker`, `togglefullscreen`, `window`, `minimize`, `close`, `help`,
* `about`, `services`, `hide`, `hideOthers`, `unhide`, `quit`, `startSpeaking`,
* `stopSpeaking`, `zoom`, `front`, `appMenu`, `fileMenu`, `editMenu`, `viewMenu`,
* `shareMenu`, `recentDocuments`, `toggleTabBar`, `selectNextTab`,
* `selectPreviousTab`, `showAllTabs`, `mergeAllWindows`, `clearRecentDocuments`,
* `moveTabToNewWindow` or `windowMenu`
*/
role?: ('undo' | 'redo' | 'cut' | 'copy' | 'paste' | 'pasteAndMatchStyle' | 'delete' | 'selectAll' | 'reload' | 'forceReload' | 'toggleDevTools' | 'resetZoom' | 'zoomIn' | 'zoomOut' | 'toggleSpellChecker' | 'togglefullscreen' | 'window' | 'minimize' | 'close' | 'help' | 'about' | 'services' | 'hide' | 'hideOthers' | 'unhide' | 'quit' | 'startSpeaking' | 'stopSpeaking' | 'zoom' | 'front' | 'appMenu' | 'fileMenu' | 'editMenu' | 'viewMenu' | 'shareMenu' | 'recentDocuments' | 'toggleTabBar' | 'selectNextTab' | 'selectPreviousTab' | 'showAllTabs' | 'mergeAllWindows' | 'clearRecentDocuments' | 'moveTabToNewWindow' | 'windowMenu');
/**
* A `SharingItem` indicating the item to share when the `role` is `shareMenu`.
*
* This property can be dynamically changed.
*
* @platform darwin
*/
sharingItem: SharingItem;
/**
* A `string` indicating the item's sublabel.
*/
sublabel: string;
/**
* A `Menu` (optional) containing the menu item's submenu, if present.
*/
submenu?: Menu;
/**
* A `string` indicating the item's hover text.
*
* @platform darwin
*/
toolTip: string;
/**
* A `string` indicating the type of the item. Can be `normal`, `separator`,
* `submenu`, `checkbox` or `radio`.
*/
type: ('normal' | 'separator' | 'submenu' | 'checkbox' | 'radio');
/**
* An `Accelerator | null` indicating the item's user-assigned accelerator for the
* menu item.
*
* **Note:** This property is only initialized after the `MenuItem` has been added
* to a `Menu`. Either via `Menu.buildFromTemplate` or via
* `Menu.append()/insert()`. Accessing before initialization will just return
* `null`.
*
* @platform darwin
*/
readonly userAccelerator: (Accelerator) | (null);
/**
* A `boolean` indicating whether the item is visible, this property can be
* dynamically changed.
*/
visible: boolean;
}
class MessageChannelMain extends NodeEventEmitter {
// Docs: https://electronjs.org/docs/api/message-channel-main
/**
* A `MessagePortMain` property.
*/
port1: MessagePortMain;
/**
* A `MessagePortMain` property.
*/
port2: MessagePortMain;
}
class MessagePortMain extends NodeEventEmitter {
// Docs: https://electronjs.org/docs/api/message-port-main
/**
* Emitted when the remote end of a MessagePortMain object becomes disconnected.
*/
on(event: 'close', listener: Function): this;
once(event: 'close', listener: Function): this;
addListener(event: 'close', listener: Function): this;
removeListener(event: 'close', listener: Function): this;
/**
* Emitted when a MessagePortMain object receives a message.
*/
on(event: 'message', listener: (messageEvent: MessageEvent) => void): this;
once(event: 'message', listener: (messageEvent: MessageEvent) => void): this;
addListener(event: 'message', listener: (messageEvent: MessageEvent) => void): this;
removeListener(event: 'message', listener: (messageEvent: MessageEvent) => void): this;
/**
* Disconnects the port, so it is no longer active.
*/
close(): void;
/**
* Sends a message from the port, and optionally, transfers ownership of objects to
* other browsing contexts.
*/
postMessage(message: any, transfer?: MessagePortMain[]): void;
/**
* Starts the sending of messages queued on the port. Messages will be queued until
* this method is called.
*/
start(): void;
}
interface MimeTypedBuffer {
// Docs: https://electronjs.org/docs/api/structures/mime-typed-buffer
/**
* Charset of the buffer.
*/
charset?: string;
/**
* The actual Buffer content.
*/
data: Buffer;
/**
* MIME type of the buffer.
*/
mimeType?: string;
}
interface MouseInputEvent extends InputEvent {
// Docs: https://electronjs.org/docs/api/structures/mouse-input-event
/**
* The button pressed, can be `left`, `middle`, `right`.
*/
button?: ('left' | 'middle' | 'right');
clickCount?: number;
globalX?: number;
globalY?: number;
movementX?: number;
movementY?: number;
/**
* The type of the event, can be `mouseDown`, `mouseUp`, `mouseEnter`,
* `mouseLeave`, `contextMenu`, `mouseWheel` or `mouseMove`.
*/
type: ('mouseDown' | 'mouseUp' | 'mouseEnter' | 'mouseLeave' | 'contextMenu' | 'mouseWheel' | 'mouseMove');
x: number;
y: number;
}
interface MouseWheelInputEvent extends MouseInputEvent {
// Docs: https://electronjs.org/docs/api/structures/mouse-wheel-input-event
accelerationRatioX?: number;
accelerationRatioY?: number;
canScroll?: boolean;
deltaX?: number;
deltaY?: number;
hasPreciseScrollingDeltas?: boolean;
/**
* The type of the event, can be `mouseWheel`.
*/
type: ('mouseWheel');
wheelTicksX?: number;
wheelTicksY?: number;
}
class NativeImage {
// Docs: https://electronjs.org/docs/api/native-image
/**
* Creates an empty `NativeImage` instance.
*/
static createEmpty(): NativeImage;
/**
* Creates a new `NativeImage` instance from `buffer` that contains the raw bitmap
* pixel data returned by `toBitmap()`. The specific format is platform-dependent.
*/
static createFromBitmap(buffer: Buffer, options: CreateFromBitmapOptions): NativeImage;
/**
* Creates a new `NativeImage` instance from `buffer`. Tries to decode as PNG or
* JPEG first.
*/
static createFromBuffer(buffer: Buffer, options?: CreateFromBufferOptions): NativeImage;
/**
* Creates a new `NativeImage` instance from `dataURL`.
*/
static createFromDataURL(dataURL: string): NativeImage;
/**
* Creates a new `NativeImage` instance from the NSImage that maps to the given
* image name. See `System Icons` for a list of possible values.
*
* The `hslShift` is applied to the image with the following rules:
*
* * `hsl_shift[0]` (hue): The absolute hue value for the image - 0 and 1 map to 0
* and 360 on the hue color wheel (red).
* * `hsl_shift[1]` (saturation): A saturation shift for the image, with the
* following key values: 0 = remove all color. 0.5 = leave unchanged. 1 = fully
* saturate the image.
* * `hsl_shift[2]` (lightness): A lightness shift for the image, with the
* following key values: 0 = remove all lightness (make all pixels black). 0.5 =
* leave unchanged. 1 = full lightness (make all pixels white).
*
* This means that `[-1, 0, 1]` will make the image completely white and `[-1, 1,
* 0]` will make the image completely black.
*
* In some cases, the `NSImageName` doesn't match its string representation; one
* example of this is `NSFolderImageName`, whose string representation would
* actually be `NSFolder`. Therefore, you'll need to determine the correct string
* representation for your image before passing it in. This can be done with the
* following:
*
* `echo -e '#import <Cocoa/Cocoa.h>\nint main() { NSLog(@"%@", SYSTEM_IMAGE_NAME);
* }' | clang -otest -x objective-c -framework Cocoa - && ./test`
*
* where `SYSTEM_IMAGE_NAME` should be replaced with any value from this list.
*
* @platform darwin
*/
static createFromNamedImage(imageName: string, hslShift?: number[]): NativeImage;
/**
* Creates a new `NativeImage` instance from a file located at `path`. This method
* returns an empty image if the `path` does not exist, cannot be read, or is not a
* valid image.
*/
static createFromPath(path: string): NativeImage;
/**
* fulfilled with the file's thumbnail preview image, which is a NativeImage.
*
* Note: The Windows implementation will ignore `size.height` and scale the height
* according to `size.width`.
*
* @platform darwin,win32
*/
static createThumbnailFromPath(path: string, size: Size): Promise<Electron.NativeImage>;
/**
* Add an image representation for a specific scale factor. This can be used to
* explicitly add different scale factor representations to an image. This can be
* called on empty images.
*/
addRepresentation(options: AddRepresentationOptions): void;
/**
* The cropped image.
*/
crop(rect: Rectangle): NativeImage;
/**
* The image's aspect ratio.
*
* If `scaleFactor` is passed, this will return the aspect ratio corresponding to
* the image representation most closely matching the passed value.
*/
getAspectRatio(scaleFactor?: number): number;
/**
* A Buffer that contains the image's raw bitmap pixel data.
*
* The difference between `getBitmap()` and `toBitmap()` is that `getBitmap()` does
* not copy the bitmap data, so you have to use the returned Buffer immediately in
* current event loop tick; otherwise the data might be changed or destroyed.
*/
getBitmap(options?: BitmapOptions): Buffer;
/**
* A Buffer that stores C pointer to underlying native handle of the image. On
* macOS, a pointer to `NSImage` instance would be returned.
*
* Notice that the returned pointer is a weak pointer to the underlying native
* image instead of a copy, so you _must_ ensure that the associated `nativeImage`
* instance is kept around.
*
* @platform darwin
*/
getNativeHandle(): Buffer;
/**
* An array of all scale factors corresponding to representations for a given
* nativeImage.
*/
getScaleFactors(): number[];
/**
* If `scaleFactor` is passed, this will return the size corresponding to the image
* representation most closely matching the passed value.
*/
getSize(scaleFactor?: number): Size;
/**
* Whether the image is empty.
*/
isEmpty(): boolean;
/**
* Whether the image is a template image.
*/
isTemplateImage(): boolean;
/**
* The resized image.
*
* If only the `height` or the `width` are specified then the current aspect ratio
* will be preserved in the resized image.
*/
resize(options: ResizeOptions): NativeImage;
/**
* Marks the image as a template image.
*/
setTemplateImage(option: boolean): void;
/**
* A Buffer that contains a copy of the image's raw bitmap pixel data.
*/
toBitmap(options?: ToBitmapOptions): Buffer;
/**
* The data URL of the image.
*/
toDataURL(options?: ToDataURLOptions): string;
/**
* A Buffer that contains the image's `JPEG` encoded data.
*/
toJPEG(quality: number): Buffer;
/**
* A Buffer that contains the image's `PNG` encoded data.
*/
toPNG(options?: ToPNGOptions): Buffer;
/**
* A `boolean` property that determines whether the image is considered a template
* image.
*
* Please note that this property only has an effect on macOS.
*
* @platform darwin
*/
isMacTemplateImage: boolean;
}
interface NativeTheme extends NodeJS.EventEmitter {
// Docs: https://electronjs.org/docs/api/native-theme
/**
* Emitted when something in the underlying NativeTheme has changed. This normally
* means that either the value of `shouldUseDarkColors`,
* `shouldUseHighContrastColors` or `shouldUseInvertedColorScheme` has changed. You
* will have to check them to determine which one has changed.
*/
on(event: 'updated', listener: Function): this;
once(event: 'updated', listener: Function): this;
addListener(event: 'updated', listener: Function): this;
removeListener(event: 'updated', listener: Function): this;
/**
* A `boolean` indicating whether Chromium is in forced colors mode, controlled by
* system accessibility settings. Currently, Windows high contrast is the only
* system setting that triggers forced colors mode.
*
* @platform win32
*/
readonly inForcedColorsMode: boolean;
/**
* A `boolean` for if the OS / Chromium currently has a dark mode enabled or is
* being instructed to show a dark-style UI. If you want to modify this value you
* should use `themeSource` below.
*
*/
readonly shouldUseDarkColors: boolean;
/**
* A `boolean` for if the OS / Chromium currently has high-contrast mode enabled or
* is being instructed to show a high-contrast UI.
*
* @platform darwin,win32
*/
readonly shouldUseHighContrastColors: boolean;
/**
* A `boolean` for if the OS / Chromium currently has an inverted color scheme or
* is being instructed to use an inverted color scheme.
*
* @platform darwin,win32
*/
readonly shouldUseInvertedColorScheme: boolean;
/**
* A `string` property that can be `system`, `light` or `dark`. It is used to
* override and supersede the value that Chromium has chosen to use internally.
*
* Setting this property to `system` will remove the override and everything will
* be reset to the OS default. By default `themeSource` is `system`.
*
* Settings this property to `dark` will have the following effects:
*
* * `nativeTheme.shouldUseDarkColors` will be `true` when accessed
* * Any UI Electron renders on Linux and Windows including context menus,
* devtools, etc. will use the dark UI.
* * Any UI the OS renders on macOS including menus, window frames, etc. will use
* the dark UI.
* * The `prefers-color-scheme` CSS query will match `dark` mode.
* * The `updated` event will be emitted
*
* Settings this property to `light` will have the following effects:
*
* * `nativeTheme.shouldUseDarkColors` will be `false` when accessed
* * Any UI Electron renders on Linux and Windows including context menus,
* devtools, etc. will use the light UI.
* * Any UI the OS renders on macOS including menus, window frames, etc. will use
* the light UI.
* * The `prefers-color-scheme` CSS query will match `light` mode.
* * The `updated` event will be emitted
*
* The usage of this property should align with a classic "dark mode" state machine
* in your application where the user has three options.
*
* * `Follow OS` --> `themeSource = 'system'`
* * `Dark Mode` --> `themeSource = 'dark'`
* * `Light Mode` --> `themeSource = 'light'`
*
* Your application should then always use `shouldUseDarkColors` to determine what
* CSS to apply.
*/
themeSource: ('system' | 'light' | 'dark');
}
interface Net {
// Docs: https://electronjs.org/docs/api/net
/**
* see Response.
*
* Sends a request, similarly to how `fetch()` works in the renderer, using
* Chrome's network stack. This differs from Node's `fetch()`, which uses Node.js's
* HTTP stack.
*
* Example:
*
* This method will issue requests from the default session. To send a `fetch`
* request from another session, use ses.fetch().
*
* See the MDN documentation for `fetch()` for more details.
*
* Limitations:
*
* * `net.fetch()` does not support the `data:` or `blob:` schemes.
* * The value of the `integrity` option is ignored.
* * The `.type` and `.url` values of the returned `Response` object are incorrect.
*
* By default, requests made with `net.fetch` can be made to custom protocols as
* well as `file:`, and will trigger webRequest handlers if present. When the
* non-standard `bypassCustomProtocolHandlers` option is set in RequestInit, custom
* protocol handlers will not be called for this request. This allows forwarding an
* intercepted request to the built-in handler. webRequest handlers will still be
* triggered when bypassing custom protocols.
*/
fetch(input: (string) | (GlobalRequest), init?: RequestInit & { bypassCustomProtocolHandlers?: boolean }): Promise<GlobalResponse>;
/**
* Whether there is currently internet connection.
*
* A return value of `false` is a pretty strong indicator that the user won't be
* able to connect to remote sites. However, a return value of `true` is
* inconclusive; even if some link is up, it is uncertain whether a particular
* connection attempt to a particular remote site will be successful.
*/
isOnline(): boolean;
/**
* Creates a `ClientRequest` instance using the provided `options` which are
* directly forwarded to the `ClientRequest` constructor. The `net.request` method
* would be used to issue both secure and insecure HTTP requests according to the
* specified protocol scheme in the `options` object.
*/
request(options: (ClientRequestConstructorOptions) | (string)): ClientRequest;
/**
* Resolves with the resolved IP addresses for the `host`.
*
* This method will resolve hosts from the default session. To resolve a host from
* another session, use ses.resolveHost().
*/
resolveHost(host: string, options?: ResolveHostOptions): Promise<Electron.ResolvedHost>;
/**
* A `boolean` property. Whether there is currently internet connection.
*
* A return value of `false` is a pretty strong indicator that the user won't be
* able to connect to remote sites. However, a return value of `true` is
* inconclusive; even if some link is up, it is uncertain whether a particular
* connection attempt to a particular remote site will be successful.
*
*/
readonly online: boolean;
}
interface NetLog {
// Docs: https://electronjs.org/docs/api/net-log
/**
* resolves when the net log has begun recording.
*
* Starts recording network events to `path`.
*/
startLogging(path: string, options?: StartLoggingOptions): Promise<void>;
/**
* resolves when the net log has been flushed to disk.
*
* Stops recording network events. If not called, net logging will automatically
* end when app quits.
*/
stopLogging(): Promise<void>;
/**
* A `boolean` property that indicates whether network logs are currently being
* recorded.
*
*/
readonly currentlyLogging: boolean;
}
class Notification extends NodeEventEmitter {
// Docs: https://electronjs.org/docs/api/notification
/**
* @platform darwin
*/
on(event: 'action', listener: (event: Event,
/**
* The index of the action that was activated.
*/
index: number) => void): this;
once(event: 'action', listener: (event: Event,
/**
* The index of the action that was activated.
*/
index: number) => void): this;
addListener(event: 'action', listener: (event: Event,
/**
* The index of the action that was activated.
*/
index: number) => void): this;
removeListener(event: 'action', listener: (event: Event,
/**
* The index of the action that was activated.
*/
index: number) => void): this;
/**
* Emitted when the notification is clicked by the user.
*/
on(event: 'click', listener: (event: Event) => void): this;
once(event: 'click', listener: (event: Event) => void): this;
addListener(event: 'click', listener: (event: Event) => void): this;
removeListener(event: 'click', listener: (event: Event) => void): this;
/**
* Emitted when the notification is closed by manual intervention from the user.
*
* This event is not guaranteed to be emitted in all cases where the notification
* is closed.
*
* On Windows, the `close` event can be emitted in one of three ways: programmatic
* dismissal with `notification.close()`, by the user closing the notification, or
* via system timeout. If a notification is in the Action Center after the initial
* `close` event is emitted, a call to `notification.close()` will remove the
* notification from the action center but the `close` event will not be emitted
* again.
*/
on(event: 'close', listener: (event: Event) => void): this;
once(event: 'close', listener: (event: Event) => void): this;
addListener(event: 'close', listener: (event: Event) => void): this;
removeListener(event: 'close', listener: (event: Event) => void): this;
/**
* Emitted when an error is encountered while creating and showing the native
* notification.
*
* @platform win32
*/
on(event: 'failed', listener: (event: Event,
/**
* The error encountered during execution of the `show()` method.
*/
error: string) => void): this;
once(event: 'failed', listener: (event: Event,
/**
* The error encountered during execution of the `show()` method.
*/
error: string) => void): this;
addListener(event: 'failed', listener: (event: Event,
/**
* The error encountered during execution of the `show()` method.
*/
error: string) => void): this;
removeListener(event: 'failed', listener: (event: Event,
/**
* The error encountered during execution of the `show()` method.
*/
error: string) => void): this;
/**
* Emitted when the user clicks the "Reply" button on a notification with
* `hasReply: true`.
*
* @platform darwin
*/
on(event: 'reply', listener: (event: Event,
/**
* The string the user entered into the inline reply field.
*/
reply: string) => void): this;
once(event: 'reply', listener: (event: Event,
/**
* The string the user entered into the inline reply field.
*/
reply: string) => void): this;
addListener(event: 'reply', listener: (event: Event,
/**
* The string the user entered into the inline reply field.
*/
reply: string) => void): this;
removeListener(event: 'reply', listener: (event: Event,
/**
* The string the user entered into the inline reply field.
*/
reply: string) => void): this;
/**
* Emitted when the notification is shown to the user. Note that this event can be
* fired multiple times as a notification can be shown multiple times through the
* `show()` method.
*/
on(event: 'show', listener: (event: Event) => void): this;
once(event: 'show', listener: (event: Event) => void): this;
addListener(event: 'show', listener: (event: Event) => void): this;
removeListener(event: 'show', listener: (event: Event) => void): this;
/**
* Notification
*/
constructor(options?: NotificationConstructorOptions);
/**
* Whether or not desktop notifications are supported on the current system
*/
static isSupported(): boolean;
/**
* Dismisses the notification.
*
* On Windows, calling `notification.close()` while the notification is visible on
* screen will dismiss the notification and remove it from the Action Center. If
* `notification.close()` is called after the notification is no longer visible on
* screen, calling `notification.close()` will try remove it from the Action
* Center.
*/
close(): void;
/**
* Immediately shows the notification to the user. Unlike the web notification API,
* instantiating a `new Notification()` does not immediately show it to the user.
* Instead, you need to call this method before the OS will display it.
*
* If the notification has been shown before, this method will dismiss the
* previously shown notification and create a new one with identical properties.
*/
show(): void;
/**
* A `NotificationAction[]` property representing the actions of the notification.
*/
actions: NotificationAction[];
/**
* A `string` property representing the body of the notification.
*/
body: string;
/**
* A `string` property representing the close button text of the notification.
*/
closeButtonText: string;
/**
* A `boolean` property representing whether the notification has a reply action.
*/
hasReply: boolean;
/**
* A `string` property representing the reply placeholder of the notification.
*/
replyPlaceholder: string;
/**
* A `boolean` property representing whether the notification is silent.
*/
silent: boolean;
/**
* A `string` property representing the sound of the notification.
*/
sound: string;
/**
* A `string` property representing the subtitle of the notification.
*/
subtitle: string;
/**
* A `string` property representing the type of timeout duration for the
* notification. Can be 'default' or 'never'.
*
* If `timeoutType` is set to 'never', the notification never expires. It stays
* open until closed by the calling API or the user.
*
* @platform linux,win32
*/
timeoutType: ('default' | 'never');
/**
* A `string` property representing the title of the notification.
*/
title: string;
/**
* A `string` property representing the custom Toast XML of the notification.
*
* @platform win32
*/
toastXml: string;
/**
* A `string` property representing the urgency level of the notification. Can be
* 'normal', 'critical', or 'low'.
*
* Default is 'low' - see NotifyUrgency for more information.
*
* @platform linux
*/
urgency: ('normal' | 'critical' | 'low');
}
interface NotificationAction {
// Docs: https://electronjs.org/docs/api/structures/notification-action
/**
* The label for the given action.
*/
text?: string;
/**
* The type of action, can be `button`.
*/
type: ('button');
}
interface NotificationResponse {
// Docs: https://electronjs.org/docs/api/structures/notification-response
/**
* The identifier string of the action that the user selected.
*/
actionIdentifier: string;
/**
* The delivery date of the notification.
*/
date: number;
/**
* The unique identifier for this notification request.
*/
identifier: string;
/**
* A dictionary of custom information associated with the notification.
*/
userInfo: Record<string, any>;
/**
* The text entered or chosen by the user.
*/
userText?: string;
}
interface ParentPort extends NodeJS.EventEmitter {
// Docs: https://electronjs.org/docs/api/parent-port
/**
* Emitted when the process receives a message. Messages received on this port will
* be queued up until a handler is registered for this event.
*/
on(event: 'message', listener: (messageEvent: MessageEvent) => void): this;
once(event: 'message', listener: (messageEvent: MessageEvent) => void): this;
addListener(event: 'message', listener: (messageEvent: MessageEvent) => void): this;
removeListener(event: 'message', listener: (messageEvent: MessageEvent) => void): this;
/**
* Sends a message from the process to its parent.
*/
postMessage(message: any): void;
}
interface PaymentDiscount {
// Docs: https://electronjs.org/docs/api/structures/payment-discount
/**
* A string used to uniquely identify a discount offer for a product.
*/
identifier: string;
/**
* A string that identifies the key used to generate the signature.
*/
keyIdentifier: string;
/**
* A universally unique ID (UUID) value that you define.
*/
nonce: string;
/**
* A UTF-8 string representing the properties of a specific discount offer,
* cryptographically signed.
*/
signature: string;
/**
* The date and time of the signature's creation in milliseconds, formatted in Unix
* epoch time.
*/
timestamp: number;
}
interface Point {
// Docs: https://electronjs.org/docs/api/structures/point
x: number;
y: number;
}
interface PostBody {
// Docs: https://electronjs.org/docs/api/structures/post-body
/**
* The boundary used to separate multiple parts of the message. Only valid when
* `contentType` is `multipart/form-data`.
*/
boundary?: string;
/**
* The `content-type` header used for the data. One of
* `application/x-www-form-urlencoded` or `multipart/form-data`. Corresponds to the
* `enctype` attribute of the submitted HTML form.
*/
contentType: string;
/**
* The post data to be sent to the new window.
*/
data: Array<(UploadRawData) | (UploadFile)>;
}
interface PowerMonitor extends NodeJS.EventEmitter {
// Docs: https://electronjs.org/docs/api/power-monitor
/**
* Emitted when the system is about to lock the screen.
*
* @platform darwin,win32
*/
on(event: 'lock-screen', listener: Function): this;
once(event: 'lock-screen', listener: Function): this;
addListener(event: 'lock-screen', listener: Function): this;
removeListener(event: 'lock-screen', listener: Function): this;
/**
* Emitted when the system changes to AC power.
*
* @platform darwin,win32
*/
on(event: 'on-ac', listener: Function): this;
once(event: 'on-ac', listener: Function): this;
addListener(event: 'on-ac', listener: Function): this;
removeListener(event: 'on-ac', listener: Function): this;
/**
* Emitted when system changes to battery power.
*
* @platform darwin
*/
on(event: 'on-battery', listener: Function): this;
once(event: 'on-battery', listener: Function): this;
addListener(event: 'on-battery', listener: Function): this;
removeListener(event: 'on-battery', listener: Function): this;
/**
* Emitted when system is resuming.
*/
on(event: 'resume', listener: Function): this;
once(event: 'resume', listener: Function): this;
addListener(event: 'resume', listener: Function): this;
removeListener(event: 'resume', listener: Function): this;
/**
* Emitted when the system is about to reboot or shut down. If the event handler
* invokes `e.preventDefault()`, Electron will attempt to delay system shutdown in
* order for the app to exit cleanly. If `e.preventDefault()` is called, the app
* should exit as soon as possible by calling something like `app.quit()`.
*
* @platform linux,darwin
*/
on(event: 'shutdown', listener: Function): this;
once(event: 'shutdown', listener: Function): this;
addListener(event: 'shutdown', listener: Function): this;
removeListener(event: 'shutdown', listener: Function): this;
/**
* Notification of a change in the operating system's advertised speed limit for
* CPUs, in percent. Values below 100 indicate that the system is impairing
* processing power due to thermal management.
*
* @platform darwin,win32
*/
on(event: 'speed-limit-change', listener: Function): this;
once(event: 'speed-limit-change', listener: Function): this;
addListener(event: 'speed-limit-change', listener: Function): this;
removeListener(event: 'speed-limit-change', listener: Function): this;
/**
* Emitted when the system is suspending.
*/
on(event: 'suspend', listener: Function): this;
once(event: 'suspend', listener: Function): this;
addListener(event: 'suspend', listener: Function): this;
removeListener(event: 'suspend', listener: Function): this;
/**
* Emitted when the thermal state of the system changes. Notification of a change
* in the thermal status of the system, such as entering a critical temperature
* range. Depending on the severity, the system might take steps to reduce said
* temperature, for example, throttling the CPU or switching on the fans if
* available.
*
* Apps may react to the new state by reducing expensive computing tasks (e.g.
* video encoding), or notifying the user. The same state might be received
* repeatedly.
*
* See
* https://developer.apple.com/library/archive/documentation/Performance/Conceptual/power_efficiency_guidelines_osx/RespondToThermalStateChanges.html
*
* @platform darwin
*/
on(event: 'thermal-state-change', listener: Function): this;
once(event: 'thermal-state-change', listener: Function): this;
addListener(event: 'thermal-state-change', listener: Function): this;
removeListener(event: 'thermal-state-change', listener: Function): this;
/**
* Emitted as soon as the systems screen is unlocked.
*
* @platform darwin,win32
*/
on(event: 'unlock-screen', listener: Function): this;
once(event: 'unlock-screen', listener: Function): this;
addListener(event: 'unlock-screen', listener: Function): this;
removeListener(event: 'unlock-screen', listener: Function): this;
/**
* Emitted when a login session is activated. See documentation for more
* information.
*
* @platform darwin
*/
on(event: 'user-did-become-active', listener: Function): this;
once(event: 'user-did-become-active', listener: Function): this;
addListener(event: 'user-did-become-active', listener: Function): this;
removeListener(event: 'user-did-become-active', listener: Function): this;
/**
* Emitted when a login session is deactivated. See documentation for more
* information.
*
* @platform darwin
*/
on(event: 'user-did-resign-active', listener: Function): this;
once(event: 'user-did-resign-active', listener: Function): this;
addListener(event: 'user-did-resign-active', listener: Function): this;
removeListener(event: 'user-did-resign-active', listener: Function): this;
/**
* The system's current thermal state. Can be `unknown`, `nominal`, `fair`,
* `serious`, or `critical`.
*
* @platform darwin
*/
getCurrentThermalState(): ('unknown' | 'nominal' | 'fair' | 'serious' | 'critical');
/**
* The system's current idle state. Can be `active`, `idle`, `locked` or `unknown`.
*
* Calculate the system idle state. `idleThreshold` is the amount of time (in
* seconds) before considered idle. `locked` is available on supported systems
* only.
*/
getSystemIdleState(idleThreshold: number): ('active' | 'idle' | 'locked' | 'unknown');
/**
* Idle time in seconds
*
* Calculate system idle time in seconds.
*/
getSystemIdleTime(): number;
/**
* Whether the system is on battery power.
*
* To monitor for changes in this property, use the `on-battery` and `on-ac`
* events.
*/
isOnBatteryPower(): boolean;
/**
* A `boolean` property. True if the system is on battery power.
*
* See `powerMonitor.isOnBatteryPower()`.
*/
onBatteryPower: boolean;
}
interface PowerSaveBlocker {
// Docs: https://electronjs.org/docs/api/power-save-blocker
/**
* Whether the corresponding `powerSaveBlocker` has started.
*/
isStarted(id: number): boolean;
/**
* The blocker ID that is assigned to this power blocker.
*
* Starts preventing the system from entering lower-power mode. Returns an integer
* identifying the power save blocker.
*
* **Note:** `prevent-display-sleep` has higher precedence over
* `prevent-app-suspension`. Only the highest precedence type takes effect. In
* other words, `prevent-display-sleep` always takes precedence over
* `prevent-app-suspension`.
*
* For example, an API calling A requests for `prevent-app-suspension`, and another
* calling B requests for `prevent-display-sleep`. `prevent-display-sleep` will be
* used until B stops its request. After that, `prevent-app-suspension` is used.
*/
start(type: 'prevent-app-suspension' | 'prevent-display-sleep'): number;
/**
* Stops the specified power save blocker.
*
* Whether the specified `powerSaveBlocker` has been stopped.
*/
stop(id: number): boolean;
}
interface PrinterInfo {
// Docs: https://electronjs.org/docs/api/structures/printer-info
/**
* a longer description of the printer's type.
*/
description: string;
/**
* the name of the printer as shown in Print Preview.
*/
displayName: string;
/**
* whether or not a given printer is set as the default printer on the OS.
*/
isDefault: boolean;
/**
* the name of the printer as understood by the OS.
*/
name: string;
/**
* an object containing a variable number of platform-specific printer information.
*/
options: Options;
/**
* the current status of the printer.
*/
status: number;
}
interface ProcessMemoryInfo {
// Docs: https://electronjs.org/docs/api/structures/process-memory-info
/**
* The amount of memory not shared by other processes, such as JS heap or HTML
* content in Kilobytes.
*/
private: number;
/**
* The amount of memory currently pinned to actual physical RAM in Kilobytes.
*
* @platform linux,win32
*/
residentSet: number;
/**
* The amount of memory shared between processes, typically memory consumed by the
* Electron code itself in Kilobytes.
*/
shared: number;
}
interface ProcessMetric {
// Docs: https://electronjs.org/docs/api/structures/process-metric
/**
* CPU usage of the process.
*/
cpu: CPUUsage;
/**
* Creation time for this process. The time is represented as number of
* milliseconds since epoch. Since the `pid` can be reused after a process dies, it
* is useful to use both the `pid` and the `creationTime` to uniquely identify a
* process.
*/
creationTime: number;
/**
* One of the following values:
*
* @platform win32
*/
integrityLevel?: ('untrusted' | 'low' | 'medium' | 'high' | 'unknown');
/**
* Memory information for the process.
*/
memory: MemoryInfo;
/**
* The name of the process. Examples for utility: `Audio Service`, `Content
* Decryption Module Service`, `Network Service`, `Video Capture`, etc.
*/
name?: string;
/**
* Process id of the process.
*/
pid: number;
/**
* Whether the process is sandboxed on OS level.
*
* @platform darwin,win32
*/
sandboxed?: boolean;
/**
* The non-localized name of the process.
*/
serviceName?: string;
/**
* Process type. One of the following values:
*/
type: ('Browser' | 'Tab' | 'Utility' | 'Zygote' | 'Sandbox helper' | 'GPU' | 'Pepper Plugin' | 'Pepper Plugin Broker' | 'Unknown');
}
interface Product {
// Docs: https://electronjs.org/docs/api/structures/product
/**
* 3 character code presenting a product's currency based on the ISO 4217 standard.
*/
currencyCode: string;
/**
* An array of discount offers
*/
discounts: ProductDiscount[];
/**
* The total size of the content, in bytes.
*/
downloadContentLengths: number[];
/**
* A string that identifies the version of the content.
*/
downloadContentVersion: string;
/**
* The locale formatted price of the product.
*/
formattedPrice: string;
/**
* The object containing introductory price information for the product. available
* for the product.
*/
introductoryPrice?: ProductDiscount;
/**
* A boolean value that indicates whether the App Store has downloadable content
* for this product. `true` if at least one file has been associated with the
* product.
*/
isDownloadable: boolean;
/**
* A description of the product.
*/
localizedDescription: string;
/**
* The name of the product.
*/
localizedTitle: string;
/**
* The cost of the product in the local currency.
*/
price: number;
/**
* The string that identifies the product to the Apple App Store.
*/
productIdentifier: string;
/**
* The identifier of the subscription group to which the subscription belongs.
*/
subscriptionGroupIdentifier: string;
/**
* The period details for products that are subscriptions.
*/
subscriptionPeriod?: ProductSubscriptionPeriod;
}
interface ProductDiscount {
// Docs: https://electronjs.org/docs/api/structures/product-discount
/**
* A string used to uniquely identify a discount offer for a product.
*/
identifier: string;
/**
* An integer that indicates the number of periods the product discount is
* available.
*/
numberOfPeriods: number;
/**
* The payment mode for this product discount. Can be `payAsYouGo`, `payUpFront`,
* or `freeTrial`.
*/
paymentMode: ('payAsYouGo' | 'payUpFront' | 'freeTrial');
/**
* The discount price of the product in the local currency.
*/
price: number;
/**
* The locale used to format the discount price of the product.
*/
priceLocale: string;
/**
* An object that defines the period for the product discount.
*/
subscriptionPeriod?: ProductSubscriptionPeriod;
/**
* The type of discount offer.
*/
type: number;
}
interface ProductSubscriptionPeriod {
// Docs: https://electronjs.org/docs/api/structures/product-subscription-period
/**
* The number of units per subscription period.
*/
numberOfUnits: number;
/**
* The increment of time that a subscription period is specified in. Can be `day`,
* `week`, `month`, `year`.
*/
unit: ('day' | 'week' | 'month' | 'year');
}
interface Protocol {
// Docs: https://electronjs.org/docs/api/protocol
/**
* Register a protocol handler for `scheme`. Requests made to URLs with this scheme
* will delegate to this handler to determine what response should be sent.
*
* Either a `Response` or a `Promise<Response>` can be returned.
*
* Example:
*
* See the MDN docs for `Request` and `Response` for more details.
*/
handle(scheme: string, handler: (request: GlobalRequest) => (GlobalResponse) | (Promise<GlobalResponse>)): void;
/**
* Whether the protocol was successfully intercepted
*
* Intercepts `scheme` protocol and uses `handler` as the protocol's new handler
* which sends a `Buffer` as a response.
*
* @deprecated
*/
interceptBufferProtocol(scheme: string, handler: (request: ProtocolRequest, callback: (response: (Buffer) | (ProtocolResponse)) => void) => void): boolean;
/**
* Whether the protocol was successfully intercepted
*
* Intercepts `scheme` protocol and uses `handler` as the protocol's new handler
* which sends a file as a response.
*
* @deprecated
*/
interceptFileProtocol(scheme: string, handler: (request: ProtocolRequest, callback: (response: (string) | (ProtocolResponse)) => void) => void): boolean;
/**
* Whether the protocol was successfully intercepted
*
* Intercepts `scheme` protocol and uses `handler` as the protocol's new handler
* which sends a new HTTP request as a response.
*
* @deprecated
*/
interceptHttpProtocol(scheme: string, handler: (request: ProtocolRequest, callback: (response: ProtocolResponse) => void) => void): boolean;
/**
* Whether the protocol was successfully intercepted
*
* Same as `protocol.registerStreamProtocol`, except that it replaces an existing
* protocol handler.
*
* @deprecated
*/
interceptStreamProtocol(scheme: string, handler: (request: ProtocolRequest, callback: (response: (NodeJS.ReadableStream) | (ProtocolResponse)) => void) => void): boolean;
/**
* Whether the protocol was successfully intercepted
*
* Intercepts `scheme` protocol and uses `handler` as the protocol's new handler
* which sends a `string` as a response.
*
* @deprecated
*/
interceptStringProtocol(scheme: string, handler: (request: ProtocolRequest, callback: (response: (string) | (ProtocolResponse)) => void) => void): boolean;
/**
* Whether `scheme` is already handled.
*/
isProtocolHandled(scheme: string): boolean;
/**
* Whether `scheme` is already intercepted.
*
* @deprecated
*/
isProtocolIntercepted(scheme: string): boolean;
/**
* Whether `scheme` is already registered.
*
* @deprecated
*/
isProtocolRegistered(scheme: string): boolean;
/**
* Whether the protocol was successfully registered
*
* Registers a protocol of `scheme` that will send a `Buffer` as a response.
*
* The usage is the same with `registerFileProtocol`, except that the `callback`
* should be called with either a `Buffer` object or an object that has the `data`
* property.
*
* Example:
*
* @deprecated
*/
registerBufferProtocol(scheme: string, handler: (request: ProtocolRequest, callback: (response: (Buffer) | (ProtocolResponse)) => void) => void): boolean;
/**
* Whether the protocol was successfully registered
*
* Registers a protocol of `scheme` that will send a file as the response. The
* `handler` will be called with `request` and `callback` where `request` is an
* incoming request for the `scheme`.
*
* To handle the `request`, the `callback` should be called with either the file's
* path or an object that has a `path` property, e.g. `callback(filePath)` or
* `callback({ path: filePath })`. The `filePath` must be an absolute path.
*
* By default the `scheme` is treated like `http:`, which is parsed differently
* from protocols that follow the "generic URI syntax" like `file:`.
*
* @deprecated
*/
registerFileProtocol(scheme: string, handler: (request: ProtocolRequest, callback: (response: (string) | (ProtocolResponse)) => void) => void): boolean;
/**
* Whether the protocol was successfully registered
*
* Registers a protocol of `scheme` that will send an HTTP request as a response.
*
* The usage is the same with `registerFileProtocol`, except that the `callback`
* should be called with an object that has the `url` property.
*
* @deprecated
*/
registerHttpProtocol(scheme: string, handler: (request: ProtocolRequest, callback: (response: ProtocolResponse) => void) => void): boolean;
/**
* **Note:** This method can only be used before the `ready` event of the `app`
* module gets emitted and can be called only once.
*
* Registers the `scheme` as standard, secure, bypasses content security policy for
* resources, allows registering ServiceWorker, supports fetch API, and streaming
* video/audio. Specify a privilege with the value of `true` to enable the
* capability.
*
* An example of registering a privileged scheme, that bypasses Content Security
* Policy:
*
* A standard scheme adheres to what RFC 3986 calls generic URI syntax. For example
* `http` and `https` are standard schemes, while `file` is not.
*
* Registering a scheme as standard allows relative and absolute resources to be
* resolved correctly when served. Otherwise the scheme will behave like the `file`
* protocol, but without the ability to resolve relative URLs.
*
* For example when you load following page with custom protocol without
* registering it as standard scheme, the image will not be loaded because
* non-standard schemes can not recognize relative URLs:
*
* Registering a scheme as standard will allow access to files through the
* FileSystem API. Otherwise the renderer will throw a security error for the
* scheme.
*
* By default web storage apis (localStorage, sessionStorage, webSQL, indexedDB,
* cookies) are disabled for non standard schemes. So in general if you want to
* register a custom protocol to replace the `http` protocol, you have to register
* it as a standard scheme.
*
* Protocols that use streams (http and stream protocols) should set `stream:
* true`. The `<video>` and `<audio>` HTML elements expect protocols to buffer
* their responses by default. The `stream` flag configures those elements to
* correctly expect streaming responses.
*/
registerSchemesAsPrivileged(customSchemes: CustomScheme[]): void;
/**
* Whether the protocol was successfully registered
*
* Registers a protocol of `scheme` that will send a stream as a response.
*
* The usage is the same with `registerFileProtocol`, except that the `callback`
* should be called with either a `ReadableStream` object or an object that has the
* `data` property.
*
* Example:
*
* It is possible to pass any object that implements the readable stream API (emits
* `data`/`end`/`error` events). For example, here's how a file could be returned:
*
* @deprecated
*/
registerStreamProtocol(scheme: string, handler: (request: ProtocolRequest, callback: (response: (NodeJS.ReadableStream) | (ProtocolResponse)) => void) => void): boolean;
/**
* Whether the protocol was successfully registered
*
* Registers a protocol of `scheme` that will send a `string` as a response.
*
* The usage is the same with `registerFileProtocol`, except that the `callback`
* should be called with either a `string` or an object that has the `data`
* property.
*
* @deprecated
*/
registerStringProtocol(scheme: string, handler: (request: ProtocolRequest, callback: (response: (string) | (ProtocolResponse)) => void) => void): boolean;
/**
* Removes a protocol handler registered with `protocol.handle`.
*/
unhandle(scheme: string): void;
/**
* Whether the protocol was successfully unintercepted
*
* Remove the interceptor installed for `scheme` and restore its original handler.
*
* @deprecated
*/
uninterceptProtocol(scheme: string): boolean;
/**
* Whether the protocol was successfully unregistered
*
* Unregisters the custom protocol of `scheme`.
*
* @deprecated
*/
unregisterProtocol(scheme: string): boolean;
}
interface ProtocolRequest {
// Docs: https://electronjs.org/docs/api/structures/protocol-request
headers: Record<string, string>;
method: string;
referrer: string;
uploadData?: UploadData[];
url: string;
}
interface ProtocolResponse {
// Docs: https://electronjs.org/docs/api/structures/protocol-response
/**
* The charset of response body, default is `"utf-8"`.
*/
charset?: string;
/**
* The response body. When returning stream as response, this is a Node.js readable
* stream representing the response body. When returning `Buffer` as response, this
* is a `Buffer`. When returning `string` as response, this is a `string`. This is
* ignored for other types of responses.
*/
data?: (Buffer) | (string) | (NodeJS.ReadableStream);
/**
* When assigned, the `request` will fail with the `error` number . For the
* available error numbers you can use, please see the net error list.
*/
error?: number;
/**
* An object containing the response headers. The keys must be string, and values
* must be either string or Array of string.
*/
headers?: Record<string, (string) | (string[])>;
/**
* The HTTP `method`. This is only used for file and URL responses.
*/
method?: string;
/**
* The MIME type of response body, default is `"text/html"`. Setting `mimeType`
* would implicitly set the `content-type` header in response, but if
* `content-type` is already set in `headers`, the `mimeType` would be ignored.
*/
mimeType?: string;
/**
* Path to the file which would be sent as response body. This is only used for
* file responses.
*/
path?: string;
/**
* The `referrer` URL. This is only used for file and URL responses.
*/
referrer?: string;
/**
* The session used for requesting URL, by default the HTTP request will reuse the
* current session. Setting `session` to `null` would use a random independent
* session. This is only used for URL responses.
*/
session?: Session;
/**
* The HTTP response code, default is 200.
*/
statusCode?: number;
/**
* The data used as upload data. This is only used for URL responses when `method`
* is `"POST"`.
*/
uploadData?: ProtocolResponseUploadData;
/**
* Download the `url` and pipe the result as response body. This is only used for
* URL responses.
*/
url?: string;
}
interface ProtocolResponseUploadData {
// Docs: https://electronjs.org/docs/api/structures/protocol-response-upload-data
/**
* MIME type of the content.
*/
contentType: string;
/**
* Content to be sent.
*/
data: (string) | (Buffer);
}
interface PushNotifications extends NodeJS.EventEmitter {
// Docs: https://electronjs.org/docs/api/push-notifications
/**
* Emitted when the app receives a remote notification while running. See:
* https://developer.apple.com/documentation/appkit/nsapplicationdelegate/1428430-application?language=objc
*
* @platform darwin
*/
on(event: 'received-apns-notification', listener: (event: Event,
userInfo: Record<string, any>) => void): this;
once(event: 'received-apns-notification', listener: (event: Event,
userInfo: Record<string, any>) => void): this;
addListener(event: 'received-apns-notification', listener: (event: Event,
userInfo: Record<string, any>) => void): this;
removeListener(event: 'received-apns-notification', listener: (event: Event,
userInfo: Record<string, any>) => void): this;
/**
* Registers the app with Apple Push Notification service (APNS) to receive Badge,
* Sound, and Alert notifications. If registration is successful, the promise will
* be resolved with the APNS device token. Otherwise, the promise will be rejected
* with an error message. See:
* https://developer.apple.com/documentation/appkit/nsapplication/1428476-registerforremotenotificationtyp?language=objc
*
* @platform darwin
*/
registerForAPNSNotifications(): Promise<string>;
/**
* Unregisters the app from notifications received from APNS. See:
* https://developer.apple.com/documentation/appkit/nsapplication/1428747-unregisterforremotenotifications?language=objc
*
* @platform darwin
*/
unregisterForAPNSNotifications(): void;
}
interface Rectangle {
// Docs: https://electronjs.org/docs/api/structures/rectangle
/**
* The height of the rectangle (must be an integer).
*/
height: number;
/**
* The width of the rectangle (must be an integer).
*/
width: number;
/**
* The x coordinate of the origin of the rectangle (must be an integer).
*/
x: number;
/**
* The y coordinate of the origin of the rectangle (must be an integer).
*/
y: number;
}
interface Referrer {
// Docs: https://electronjs.org/docs/api/structures/referrer
/**
* Can be `default`, `unsafe-url`, `no-referrer-when-downgrade`, `no-referrer`,
* `origin`, `strict-origin-when-cross-origin`, `same-origin` or `strict-origin`.
* See the Referrer-Policy spec for more details on the meaning of these values.
*/
policy: ('default' | 'unsafe-url' | 'no-referrer-when-downgrade' | 'no-referrer' | 'origin' | 'strict-origin-when-cross-origin' | 'same-origin' | 'strict-origin');
/**
* HTTP Referrer URL.
*/
url: string;
}
interface RenderProcessGoneDetails {
// Docs: https://electronjs.org/docs/api/structures/render-process-gone-details
/**
* The exit code of the process, unless `reason` is `launch-failed`, in which case
* `exitCode` will be a platform-specific launch failure error code.
*/
exitCode: number;
/**
* The reason the render process is gone. Possible values:
*/
reason: ('clean-exit' | 'abnormal-exit' | 'killed' | 'crashed' | 'oom' | 'launch-failed' | 'integrity-failure');
}
interface ResolvedEndpoint {
// Docs: https://electronjs.org/docs/api/structures/resolved-endpoint
address: string;
/**
* One of the following:
*/
family: ('ipv4' | 'ipv6' | 'unspec');
}
interface ResolvedHost {
// Docs: https://electronjs.org/docs/api/structures/resolved-host
/**
* resolved DNS entries for the hostname
*/
endpoints: ResolvedEndpoint[];
}
interface SafeStorage extends NodeJS.EventEmitter {
// Docs: https://electronjs.org/docs/api/safe-storage
/**
* the decrypted string. Decrypts the encrypted buffer obtained with
* `safeStorage.encryptString` back into a string.
*
* This function will throw an error if decryption fails.
*/
decryptString(encrypted: Buffer): string;
/**
* An array of bytes representing the encrypted string.
*
* This function will throw an error if encryption fails.
*/
encryptString(plainText: string): Buffer;
/**
* User friendly name of the password manager selected on Linux.
*
* This function will return one of the following values:
*
* * `basic_text` - When the desktop environment is not recognised or if the
* following command line flag is provided `--password-store="basic"`.
* * `gnome_libsecret` - When the desktop environment is `X-Cinnamon`, `Deepin`,
* `GNOME`, `Pantheon`, `XFCE`, `UKUI`, `unity` or if the following command line
* flag is provided `--password-store="gnome-libsecret"`.
* * `kwallet` - When the desktop session is `kde4` or if the following command
* line flag is provided `--password-store="kwallet"`.
* * `kwallet5` - When the desktop session is `kde5` or if the following command
* line flag is provided `--password-store="kwallet5"`.
* * `kwallet6` - When the desktop session is `kde6`.
* * `unknown` - When the function is called before app has emitted the `ready`
* event.
*
* @platform linux
*/
getSelectedStorageBackend(): ('basic_text' | 'gnome_libsecret' | 'kwallet' | 'kwallet5' | 'kwallet6' | 'unknown');
/**
* Whether encryption is available.
*
* On Linux, returns true if the app has emitted the `ready` event and the secret
* key is available. On MacOS, returns true if Keychain is available. On Windows,
* returns true once the app has emitted the `ready` event.
*/
isEncryptionAvailable(): boolean;
/**
* This function on Linux will force the module to use an in memory password for
* creating symmetric key that is used for encrypt/decrypt functions when a valid
* OS password manager cannot be determined for the current active desktop
* environment. This function is a no-op on Windows and MacOS.
*/
setUsePlainTextEncryption(usePlainText: boolean): void;
}
interface Screen extends NodeJS.EventEmitter {
// Docs: https://electronjs.org/docs/api/screen
/**
* Emitted when `newDisplay` has been added.
*/
on(event: 'display-added', listener: (event: Event,
newDisplay: Display) => void): this;
once(event: 'display-added', listener: (event: Event,
newDisplay: Display) => void): this;
addListener(event: 'display-added', listener: (event: Event,
newDisplay: Display) => void): this;
removeListener(event: 'display-added', listener: (event: Event,
newDisplay: Display) => void): this;
/**
* Emitted when one or more metrics change in a `display`. The `changedMetrics` is
* an array of strings that describe the changes. Possible changes are `bounds`,
* `workArea`, `scaleFactor` and `rotation`.
*/
on(event: 'display-metrics-changed', listener: (event: Event,
display: Display,
changedMetrics: string[]) => void): this;
once(event: 'display-metrics-changed', listener: (event: Event,
display: Display,
changedMetrics: string[]) => void): this;
addListener(event: 'display-metrics-changed', listener: (event: Event,
display: Display,
changedMetrics: string[]) => void): this;
removeListener(event: 'display-metrics-changed', listener: (event: Event,
display: Display,
changedMetrics: string[]) => void): this;
/**
* Emitted when `oldDisplay` has been removed.
*/
on(event: 'display-removed', listener: (event: Event,
oldDisplay: Display) => void): this;
once(event: 'display-removed', listener: (event: Event,
oldDisplay: Display) => void): this;
addListener(event: 'display-removed', listener: (event: Event,
oldDisplay: Display) => void): this;
removeListener(event: 'display-removed', listener: (event: Event,
oldDisplay: Display) => void): this;
/**
* Converts a screen DIP point to a screen physical point. The DPI scale is
* performed relative to the display containing the DIP point.
*
* @platform win32
*/
dipToScreenPoint(point: Point): Point;
/**
* Converts a screen DIP rect to a screen physical rect. The DPI scale is performed
* relative to the display nearest to `window`. If `window` is null, scaling will
* be performed to the display nearest to `rect`.
*
* @platform win32
*/
dipToScreenRect(window: (BrowserWindow) | (null), rect: Rectangle): Rectangle;
/**
* An array of displays that are currently available.
*/
getAllDisplays(): Display[];
/**
* The current absolute position of the mouse pointer.
*
* **Note:** The return value is a DIP point, not a screen physical point.
*/
getCursorScreenPoint(): Point;
/**
* The display that most closely intersects the provided bounds.
*/
getDisplayMatching(rect: Rectangle): Display;
/**
* The display nearest the specified point.
*/
getDisplayNearestPoint(point: Point): Display;
/**
* The primary display.
*/
getPrimaryDisplay(): Display;
/**
* Converts a screen physical point to a screen DIP point. The DPI scale is
* performed relative to the display containing the physical point.
*
* @platform win32
*/
screenToDipPoint(point: Point): Point;
/**
* Converts a screen physical rect to a screen DIP rect. The DPI scale is performed
* relative to the display nearest to `window`. If `window` is null, scaling will
* be performed to the display nearest to `rect`.
*
* @platform win32
*/
screenToDipRect(window: (BrowserWindow) | (null), rect: Rectangle): Rectangle;
}
interface ScrubberItem {
// Docs: https://electronjs.org/docs/api/structures/scrubber-item
/**
* The image to appear in this item.
*/
icon?: NativeImage;
/**
* The text to appear in this item.
*/
label?: string;
}
interface SegmentedControlSegment {
// Docs: https://electronjs.org/docs/api/structures/segmented-control-segment
/**
* Whether this segment is selectable. Default: true.
*/
enabled?: boolean;
/**
* The image to appear in this segment.
*/
icon?: NativeImage;
/**
* The text to appear in this segment.
*/
label?: string;
}
interface SerialPort {
// Docs: https://electronjs.org/docs/api/structures/serial-port
/**
* A stable identifier on Windows that can be used for device permissions.
*
* @platform win32
*/
deviceInstanceId?: string;
/**
* A string suitable for display to the user for describing this device.
*/
displayName?: string;
/**
* Unique identifier for the port.
*/
portId: string;
/**
* Name of the port.
*/
portName: string;
/**
* The USB product ID.
*/
productId?: string;
/**
* The USB device serial number.
*/
serialNumber?: string;
/**
* Represents a single serial port on macOS can be enumerated by multiple drivers.
*
* @platform darwin
*/
usbDriverName?: string;
/**
* The USB vendor ID.
*/
vendorId?: string;
}
interface ServiceWorkerInfo {
// Docs: https://electronjs.org/docs/api/structures/service-worker-info
/**
* The virtual ID of the process that this service worker is running in. This is
* not an OS level PID. This aligns with the ID set used for
* `webContents.getProcessId()`.
*/
renderProcessId: number;
/**
* The base URL that this service worker is active for.
*/
scope: string;
/**
* The full URL to the script that this service worker runs
*/
scriptUrl: string;
}
class ServiceWorkers extends NodeEventEmitter {
// Docs: https://electronjs.org/docs/api/service-workers
/**
* Emitted when a service worker logs something to the console.
*/
on(event: 'console-message', listener: (event: Event,
/**
* Information about the console message
*/
messageDetails: MessageDetails) => void): this;
once(event: 'console-message', listener: (event: Event,
/**
* Information about the console message
*/
messageDetails: MessageDetails) => void): this;
addListener(event: 'console-message', listener: (event: Event,
/**
* Information about the console message
*/
messageDetails: MessageDetails) => void): this;
removeListener(event: 'console-message', listener: (event: Event,
/**
* Information about the console message
*/
messageDetails: MessageDetails) => void): this;
/**
* Emitted when a service worker has been registered. Can occur after a call to
* `navigator.serviceWorker.register('/sw.js')` successfully resolves or when a
* Chrome extension is loaded.
*/
on(event: 'registration-completed', listener: (event: Event,
/**
* Information about the registered service worker
*/
details: RegistrationCompletedDetails) => void): this;
once(event: 'registration-completed', listener: (event: Event,
/**
* Information about the registered service worker
*/
details: RegistrationCompletedDetails) => void): this;
addListener(event: 'registration-completed', listener: (event: Event,
/**
* Information about the registered service worker
*/
details: RegistrationCompletedDetails) => void): this;
removeListener(event: 'registration-completed', listener: (event: Event,
/**
* Information about the registered service worker
*/
details: RegistrationCompletedDetails) => void): this;
/**
* A ServiceWorkerInfo object where the keys are the service worker version ID and
* the values are the information about that service worker.
*/
getAllRunning(): Record<number, ServiceWorkerInfo>;
/**
* Information about this service worker
*
* If the service worker does not exist or is not running this method will throw an
* exception.
*/
getFromVersionID(versionId: number): ServiceWorkerInfo;
}
class Session extends NodeEventEmitter {
// Docs: https://electronjs.org/docs/api/session
/**
* A session instance from `partition` string. When there is an existing `Session`
* with the same `partition`, it will be returned; otherwise a new `Session`
* instance will be created with `options`.
*
* If `partition` starts with `persist:`, the page will use a persistent session
* available to all pages in the app with the same `partition`. if there is no
* `persist:` prefix, the page will use an in-memory session. If the `partition` is
* empty then default session of the app will be returned.
*
* To create a `Session` with `options`, you have to ensure the `Session` with the
* `partition` has never been used before. There is no way to change the `options`
* of an existing `Session` object.
*/
static fromPartition(partition: string, options?: FromPartitionOptions): Session;
/**
* A session instance from the absolute path as specified by the `path` string.
* When there is an existing `Session` with the same absolute path, it will be
* returned; otherwise a new `Session` instance will be created with `options`. The
* call will throw an error if the path is not an absolute path. Additionally, an
* error will be thrown if an empty string is provided.
*
* To create a `Session` with `options`, you have to ensure the `Session` with the
* `path` has never been used before. There is no way to change the `options` of an
* existing `Session` object.
*/
static fromPath(path: string, options?: FromPathOptions): Session;
/**
* A `Session` object, the default session object of the app.
*/
static defaultSession: Session;
/**
* Emitted after an extension is loaded. This occurs whenever an extension is added
* to the "enabled" set of extensions. This includes:
*
* * Extensions being loaded from `Session.loadExtension`.
* * Extensions being reloaded:
* * from a crash.
* * if the extension requested it (`chrome.runtime.reload()`).
*/
on(event: 'extension-loaded', listener: (event: Event,
extension: Extension) => void): this;
once(event: 'extension-loaded', listener: (event: Event,
extension: Extension) => void): this;
addListener(event: 'extension-loaded', listener: (event: Event,
extension: Extension) => void): this;
removeListener(event: 'extension-loaded', listener: (event: Event,
extension: Extension) => void): this;
/**
* Emitted after an extension is loaded and all necessary browser state is
* initialized to support the start of the extension's background page.
*/
on(event: 'extension-ready', listener: (event: Event,
extension: Extension) => void): this;
once(event: 'extension-ready', listener: (event: Event,
extension: Extension) => void): this;
addListener(event: 'extension-ready', listener: (event: Event,
extension: Extension) => void): this;
removeListener(event: 'extension-ready', listener: (event: Event,
extension: Extension) => void): this;
/**
* Emitted after an extension is unloaded. This occurs when
* `Session.removeExtension` is called.
*/
on(event: 'extension-unloaded', listener: (event: Event,
extension: Extension) => void): this;
once(event: 'extension-unloaded', listener: (event: Event,
extension: Extension) => void): this;
addListener(event: 'extension-unloaded', listener: (event: Event,
extension: Extension) => void): this;
removeListener(event: 'extension-unloaded', listener: (event: Event,
extension: Extension) => void): this;
/**
* Emitted after `navigator.hid.requestDevice` has been called and
* `select-hid-device` has fired if a new device becomes available before the
* callback from `select-hid-device` is called. This event is intended for use
* when using a UI to ask users to pick a device so that the UI can be updated with
* the newly added device.
*/
on(event: 'hid-device-added', listener: (event: Event,
details: HidDeviceAddedDetails) => void): this;
once(event: 'hid-device-added', listener: (event: Event,
details: HidDeviceAddedDetails) => void): this;
addListener(event: 'hid-device-added', listener: (event: Event,
details: HidDeviceAddedDetails) => void): this;
removeListener(event: 'hid-device-added', listener: (event: Event,
details: HidDeviceAddedDetails) => void): this;
/**
* Emitted after `navigator.hid.requestDevice` has been called and
* `select-hid-device` has fired if a device has been removed before the callback
* from `select-hid-device` is called. This event is intended for use when using a
* UI to ask users to pick a device so that the UI can be updated to remove the
* specified device.
*/
on(event: 'hid-device-removed', listener: (event: Event,
details: HidDeviceRemovedDetails) => void): this;
once(event: 'hid-device-removed', listener: (event: Event,
details: HidDeviceRemovedDetails) => void): this;
addListener(event: 'hid-device-removed', listener: (event: Event,
details: HidDeviceRemovedDetails) => void): this;
removeListener(event: 'hid-device-removed', listener: (event: Event,
details: HidDeviceRemovedDetails) => void): this;
/**
* Emitted after `HIDDevice.forget()` has been called. This event can be used to
* help maintain persistent storage of permissions when
* `setDevicePermissionHandler` is used.
*/
on(event: 'hid-device-revoked', listener: (event: Event,
details: HidDeviceRevokedDetails) => void): this;
once(event: 'hid-device-revoked', listener: (event: Event,
details: HidDeviceRevokedDetails) => void): this;
addListener(event: 'hid-device-revoked', listener: (event: Event,
details: HidDeviceRevokedDetails) => void): this;
removeListener(event: 'hid-device-revoked', listener: (event: Event,
details: HidDeviceRevokedDetails) => void): this;
/**
* Emitted when a render process requests preconnection to a URL, generally due to
* a resource hint.
*/
on(event: 'preconnect', listener: (event: Event,
/**
* The URL being requested for preconnection by the renderer.
*/
preconnectUrl: string,
/**
* True if the renderer is requesting that the connection include credentials (see
* the spec for more details.)
*/
allowCredentials: boolean) => void): this;
once(event: 'preconnect', listener: (event: Event,
/**
* The URL being requested for preconnection by the renderer.
*/
preconnectUrl: string,
/**
* True if the renderer is requesting that the connection include credentials (see
* the spec for more details.)
*/
allowCredentials: boolean) => void): this;
addListener(event: 'preconnect', listener: (event: Event,
/**
* The URL being requested for preconnection by the renderer.
*/
preconnectUrl: string,
/**
* True if the renderer is requesting that the connection include credentials (see
* the spec for more details.)
*/
allowCredentials: boolean) => void): this;
removeListener(event: 'preconnect', listener: (event: Event,
/**
* The URL being requested for preconnection by the renderer.
*/
preconnectUrl: string,
/**
* True if the renderer is requesting that the connection include credentials (see
* the spec for more details.)
*/
allowCredentials: boolean) => void): this;
/**
* Emitted when a HID device needs to be selected when a call to
* `navigator.hid.requestDevice` is made. `callback` should be called with
* `deviceId` to be selected; passing no arguments to `callback` will cancel the
* request. Additionally, permissioning on `navigator.hid` can be further managed
* by using `ses.setPermissionCheckHandler(handler)` and
* `ses.setDevicePermissionHandler(handler)`.
*/
on(event: 'select-hid-device', listener: (event: Event,
details: SelectHidDeviceDetails,
callback: (deviceId?: (string) | (null)) => void) => void): this;
once(event: 'select-hid-device', listener: (event: Event,
details: SelectHidDeviceDetails,
callback: (deviceId?: (string) | (null)) => void) => void): this;
addListener(event: 'select-hid-device', listener: (event: Event,
details: SelectHidDeviceDetails,
callback: (deviceId?: (string) | (null)) => void) => void): this;
removeListener(event: 'select-hid-device', listener: (event: Event,
details: SelectHidDeviceDetails,
callback: (deviceId?: (string) | (null)) => void) => void): this;
/**
* Emitted when a serial port needs to be selected when a call to
* `navigator.serial.requestPort` is made. `callback` should be called with
* `portId` to be selected, passing an empty string to `callback` will cancel the
* request. Additionally, permissioning on `navigator.serial` can be managed by
* using ses.setPermissionCheckHandler(handler) with the `serial` permission.
*/
on(event: 'select-serial-port', listener: (event: Event,
portList: SerialPort[],
webContents: WebContents,
callback: (portId: string) => void) => void): this;
once(event: 'select-serial-port', listener: (event: Event,
portList: SerialPort[],
webContents: WebContents,
callback: (portId: string) => void) => void): this;
addListener(event: 'select-serial-port', listener: (event: Event,
portList: SerialPort[],
webContents: WebContents,
callback: (portId: string) => void) => void): this;
removeListener(event: 'select-serial-port', listener: (event: Event,
portList: SerialPort[],
webContents: WebContents,
callback: (portId: string) => void) => void): this;
/**
* Emitted when a USB device needs to be selected when a call to
* `navigator.usb.requestDevice` is made. `callback` should be called with
* `deviceId` to be selected; passing no arguments to `callback` will cancel the
* request. Additionally, permissioning on `navigator.usb` can be further managed
* by using `ses.setPermissionCheckHandler(handler)` and
* `ses.setDevicePermissionHandler(handler)`.
*/
on(event: 'select-usb-device', listener: (event: Event,
details: SelectUsbDeviceDetails,
callback: (deviceId?: string) => void) => void): this;
once(event: 'select-usb-device', listener: (event: Event,
details: SelectUsbDeviceDetails,
callback: (deviceId?: string) => void) => void): this;
addListener(event: 'select-usb-device', listener: (event: Event,
details: SelectUsbDeviceDetails,
callback: (deviceId?: string) => void) => void): this;
removeListener(event: 'select-usb-device', listener: (event: Event,
details: SelectUsbDeviceDetails,
callback: (deviceId?: string) => void) => void): this;
/**
* Emitted after `navigator.serial.requestPort` has been called and
* `select-serial-port` has fired if a new serial port becomes available before the
* callback from `select-serial-port` is called. This event is intended for use
* when using a UI to ask users to pick a port so that the UI can be updated with
* the newly added port.
*/
on(event: 'serial-port-added', listener: (event: Event,
port: SerialPort,
webContents: WebContents) => void): this;
once(event: 'serial-port-added', listener: (event: Event,
port: SerialPort,
webContents: WebContents) => void): this;
addListener(event: 'serial-port-added', listener: (event: Event,
port: SerialPort,
webContents: WebContents) => void): this;
removeListener(event: 'serial-port-added', listener: (event: Event,
port: SerialPort,
webContents: WebContents) => void): this;
/**
* Emitted after `navigator.serial.requestPort` has been called and
* `select-serial-port` has fired if a serial port has been removed before the
* callback from `select-serial-port` is called. This event is intended for use
* when using a UI to ask users to pick a port so that the UI can be updated to
* remove the specified port.
*/
on(event: 'serial-port-removed', listener: (event: Event,
port: SerialPort,
webContents: WebContents) => void): this;
once(event: 'serial-port-removed', listener: (event: Event,
port: SerialPort,
webContents: WebContents) => void): this;
addListener(event: 'serial-port-removed', listener: (event: Event,
port: SerialPort,
webContents: WebContents) => void): this;
removeListener(event: 'serial-port-removed', listener: (event: Event,
port: SerialPort,
webContents: WebContents) => void): this;
/**
* Emitted after `SerialPort.forget()` has been called. This event can be used to
* help maintain persistent storage of permissions when
* `setDevicePermissionHandler` is used.
*/
on(event: 'serial-port-revoked', listener: (event: Event,
details: SerialPortRevokedDetails) => void): this;
once(event: 'serial-port-revoked', listener: (event: Event,
details: SerialPortRevokedDetails) => void): this;
addListener(event: 'serial-port-revoked', listener: (event: Event,
details: SerialPortRevokedDetails) => void): this;
removeListener(event: 'serial-port-revoked', listener: (event: Event,
details: SerialPortRevokedDetails) => void): this;
/**
* Emitted when a hunspell dictionary file starts downloading
*/
on(event: 'spellcheck-dictionary-download-begin', listener: (event: Event,
/**
* The language code of the dictionary file
*/
languageCode: string) => void): this;
once(event: 'spellcheck-dictionary-download-begin', listener: (event: Event,
/**
* The language code of the dictionary file
*/
languageCode: string) => void): this;
addListener(event: 'spellcheck-dictionary-download-begin', listener: (event: Event,
/**
* The language code of the dictionary file
*/
languageCode: string) => void): this;
removeListener(event: 'spellcheck-dictionary-download-begin', listener: (event: Event,
/**
* The language code of the dictionary file
*/
languageCode: string) => void): this;
/**
* Emitted when a hunspell dictionary file download fails. For details on the
* failure you should collect a netlog and inspect the download request.
*/
on(event: 'spellcheck-dictionary-download-failure', listener: (event: Event,
/**
* The language code of the dictionary file
*/
languageCode: string) => void): this;
once(event: 'spellcheck-dictionary-download-failure', listener: (event: Event,
/**
* The language code of the dictionary file
*/
languageCode: string) => void): this;
addListener(event: 'spellcheck-dictionary-download-failure', listener: (event: Event,
/**
* The language code of the dictionary file
*/
languageCode: string) => void): this;
removeListener(event: 'spellcheck-dictionary-download-failure', listener: (event: Event,
/**
* The language code of the dictionary file
*/
languageCode: string) => void): this;
/**
* Emitted when a hunspell dictionary file has been successfully downloaded
*/
on(event: 'spellcheck-dictionary-download-success', listener: (event: Event,
/**
* The language code of the dictionary file
*/
languageCode: string) => void): this;
once(event: 'spellcheck-dictionary-download-success', listener: (event: Event,
/**
* The language code of the dictionary file
*/
languageCode: string) => void): this;
addListener(event: 'spellcheck-dictionary-download-success', listener: (event: Event,
/**
* The language code of the dictionary file
*/
languageCode: string) => void): this;
removeListener(event: 'spellcheck-dictionary-download-success', listener: (event: Event,
/**
* The language code of the dictionary file
*/
languageCode: string) => void): this;
/**
* Emitted when a hunspell dictionary file has been successfully initialized. This
* occurs after the file has been downloaded.
*/
on(event: 'spellcheck-dictionary-initialized', listener: (event: Event,
/**
* The language code of the dictionary file
*/
languageCode: string) => void): this;
once(event: 'spellcheck-dictionary-initialized', listener: (event: Event,
/**
* The language code of the dictionary file
*/
languageCode: string) => void): this;
addListener(event: 'spellcheck-dictionary-initialized', listener: (event: Event,
/**
* The language code of the dictionary file
*/
languageCode: string) => void): this;
removeListener(event: 'spellcheck-dictionary-initialized', listener: (event: Event,
/**
* The language code of the dictionary file
*/
languageCode: string) => void): this;
/**
* Emitted after `navigator.usb.requestDevice` has been called and
* `select-usb-device` has fired if a new device becomes available before the
* callback from `select-usb-device` is called. This event is intended for use
* when using a UI to ask users to pick a device so that the UI can be updated with
* the newly added device.
*/
on(event: 'usb-device-added', listener: (event: Event,
device: USBDevice,
webContents: WebContents) => void): this;
once(event: 'usb-device-added', listener: (event: Event,
device: USBDevice,
webContents: WebContents) => void): this;
addListener(event: 'usb-device-added', listener: (event: Event,
device: USBDevice,
webContents: WebContents) => void): this;
removeListener(event: 'usb-device-added', listener: (event: Event,
device: USBDevice,
webContents: WebContents) => void): this;
/**
* Emitted after `navigator.usb.requestDevice` has been called and
* `select-usb-device` has fired if a device has been removed before the callback
* from `select-usb-device` is called. This event is intended for use when using a
* UI to ask users to pick a device so that the UI can be updated to remove the
* specified device.
*/
on(event: 'usb-device-removed', listener: (event: Event,
device: USBDevice,
webContents: WebContents) => void): this;
once(event: 'usb-device-removed', listener: (event: Event,
device: USBDevice,
webContents: WebContents) => void): this;
addListener(event: 'usb-device-removed', listener: (event: Event,
device: USBDevice,
webContents: WebContents) => void): this;
removeListener(event: 'usb-device-removed', listener: (event: Event,
device: USBDevice,
webContents: WebContents) => void): this;
/**
* Emitted after `USBDevice.forget()` has been called. This event can be used to
* help maintain persistent storage of permissions when
* `setDevicePermissionHandler` is used.
*/
on(event: 'usb-device-revoked', listener: (event: Event,
details: UsbDeviceRevokedDetails) => void): this;
once(event: 'usb-device-revoked', listener: (event: Event,
details: UsbDeviceRevokedDetails) => void): this;
addListener(event: 'usb-device-revoked', listener: (event: Event,
details: UsbDeviceRevokedDetails) => void): this;
removeListener(event: 'usb-device-revoked', listener: (event: Event,
details: UsbDeviceRevokedDetails) => void): this;
/**
* Emitted when Electron is about to download `item` in `webContents`.
*
* Calling `event.preventDefault()` will cancel the download and `item` will not be
* available from next tick of the process.
*/
on(event: 'will-download', listener: (event: Event,
item: DownloadItem,
webContents: WebContents) => void): this;
once(event: 'will-download', listener: (event: Event,
item: DownloadItem,
webContents: WebContents) => void): this;
addListener(event: 'will-download', listener: (event: Event,
item: DownloadItem,
webContents: WebContents) => void): this;
removeListener(event: 'will-download', listener: (event: Event,
item: DownloadItem,
webContents: WebContents) => void): this;
/**
* Whether the word was successfully written to the custom dictionary. This API
* will not work on non-persistent (in-memory) sessions.
*
* **Note:** On macOS and Windows 10 this word will be written to the OS custom
* dictionary as well
*/
addWordToSpellCheckerDictionary(word: string): boolean;
/**
* Dynamically sets whether to always send credentials for HTTP NTLM or Negotiate
* authentication.
*/
allowNTLMCredentialsForDomains(domains: string): void;
/**
* resolves when the session’s HTTP authentication cache has been cleared.
*/
clearAuthCache(): Promise<void>;
/**
* resolves when the cache clear operation is complete.
*
* Clears the session’s HTTP cache.
*/
clearCache(): Promise<void>;
/**
* resolves when the code cache clear operation is complete.
*/
clearCodeCaches(options: ClearCodeCachesOptions): Promise<void>;
/**
* Resolves when the operation is complete.
*
* Clears the host resolver cache.
*/
clearHostResolverCache(): Promise<void>;
/**
* resolves when the storage data has been cleared.
*/
clearStorageData(options?: ClearStorageDataOptions): Promise<void>;
/**
* Resolves when all connections are closed.
*
* **Note:** It will terminate / fail all requests currently in flight.
*/
closeAllConnections(): Promise<void>;
/**
* Allows resuming `cancelled` or `interrupted` downloads from previous `Session`.
* The API will generate a DownloadItem that can be accessed with the will-download
* event. The DownloadItem will not have any `WebContents` associated with it and
* the initial state will be `interrupted`. The download will start only when the
* `resume` API is called on the DownloadItem.
*/
createInterruptedDownload(options: CreateInterruptedDownloadOptions): void;
/**
* Disables any network emulation already active for the `session`. Resets to the
* original network configuration.
*/
disableNetworkEmulation(): void;
/**
* Initiates a download of the resource at `url`. The API will generate a
* DownloadItem that can be accessed with the will-download event.
*
* **Note:** This does not perform any security checks that relate to a page's
* origin, unlike `webContents.downloadURL`.
*/
downloadURL(url: string, options?: DownloadURLOptions): void;
/**
* Emulates network with the given configuration for the `session`.
*/
enableNetworkEmulation(options: EnableNetworkEmulationOptions): void;
/**
* see Response.
*
* Sends a request, similarly to how `fetch()` works in the renderer, using
* Chrome's network stack. This differs from Node's `fetch()`, which uses Node.js's
* HTTP stack.
*
* Example:
*
* See also `net.fetch()`, a convenience method which issues requests from the
* default session.
*
* See the MDN documentation for `fetch()` for more details.
*
* Limitations:
*
* * `net.fetch()` does not support the `data:` or `blob:` schemes.
* * The value of the `integrity` option is ignored.
* * The `.type` and `.url` values of the returned `Response` object are incorrect.
*
* By default, requests made with `net.fetch` can be made to custom protocols as
* well as `file:`, and will trigger webRequest handlers if present. When the
* non-standard `bypassCustomProtocolHandlers` option is set in RequestInit, custom
* protocol handlers will not be called for this request. This allows forwarding an
* intercepted request to the built-in handler. webRequest handlers will still be
* triggered when bypassing custom protocols.
*/
fetch(input: (string) | (GlobalRequest), init?: RequestInit): Promise<GlobalResponse>;
/**
* Writes any unwritten DOMStorage data to disk.
*/
flushStorageData(): void;
/**
* Resolves when the all internal states of proxy service is reset and the latest
* proxy configuration is reapplied if it's already available. The pac script will
* be fetched from `pacScript` again if the proxy mode is `pac_script`.
*/
forceReloadProxyConfig(): Promise<void>;
/**
* A list of all loaded extensions.
*
* **Note:** This API cannot be called before the `ready` event of the `app` module
* is emitted.
*/
getAllExtensions(): Extension[];
/**
* resolves with blob data.
*/
getBlobData(identifier: string): Promise<Buffer>;
/**
* the session's current cache size, in bytes.
*/
getCacheSize(): Promise<number>;
/**
* The loaded extension with the given ID.
*
* **Note:** This API cannot be called before the `ready` event of the `app` module
* is emitted.
*/
getExtension(extensionId: string): (Extension) | (null);
/**
* an array of paths to preload scripts that have been registered.
*/
getPreloads(): string[];
/**
* An array of language codes the spellchecker is enabled for. If this list is
* empty the spellchecker will fallback to using `en-US`. By default on launch if
* this setting is an empty list Electron will try to populate this setting with
* the current OS locale. This setting is persisted across restarts.
*
* **Note:** On macOS the OS spellchecker is used and has its own list of
* languages. On macOS, this API will return whichever languages have been
* configured by the OS.
*/
getSpellCheckerLanguages(): string[];
/**
* The absolute file system path where data for this session is persisted on disk.
* For in memory sessions this returns `null`.
*/
getStoragePath(): (string) | (null);
/**
* The user agent for this session.
*/
getUserAgent(): string;
/**
* Whether or not this session is a persistent one. The default `webContents`
* session of a `BrowserWindow` is persistent. When creating a session from a
* partition, session prefixed with `persist:` will be persistent, while others
* will be temporary.
*/
isPersistent(): boolean;
/**
* Whether the builtin spell checker is enabled.
*/
isSpellCheckerEnabled(): boolean;
/**
* An array of all words in app's custom dictionary. Resolves when the full
* dictionary is loaded from disk.
*/
listWordsInSpellCheckerDictionary(): Promise<string[]>;
/**
* resolves when the extension is loaded.
*
* This method will raise an exception if the extension could not be loaded. If
* there are warnings when installing the extension (e.g. if the extension requests
* an API that Electron does not support) then they will be logged to the console.
*
* Note that Electron does not support the full range of Chrome extensions APIs.
* See Supported Extensions APIs for more details on what is supported.
*
* Note that in previous versions of Electron, extensions that were loaded would be
* remembered for future runs of the application. This is no longer the case:
* `loadExtension` must be called on every boot of your app if you want the
* extension to be loaded.
*
* This API does not support loading packed (.crx) extensions.
*
* **Note:** This API cannot be called before the `ready` event of the `app` module
* is emitted.
*
* **Note:** Loading extensions into in-memory (non-persistent) sessions is not
* supported and will throw an error.
*/
loadExtension(path: string, options?: LoadExtensionOptions): Promise<Electron.Extension>;
/**
* Preconnects the given number of sockets to an origin.
*/
preconnect(options: PreconnectOptions): void;
/**
* Unloads an extension.
*
* **Note:** This API cannot be called before the `ready` event of the `app` module
* is emitted.
*/
removeExtension(extensionId: string): void;
/**
* Whether the word was successfully removed from the custom dictionary. This API
* will not work on non-persistent (in-memory) sessions.
*
* **Note:** On macOS and Windows 10 this word will be removed from the OS custom
* dictionary as well
*/
removeWordFromSpellCheckerDictionary(word: string): boolean;
/**
* Resolves with the resolved IP addresses for the `host`.
*/
resolveHost(host: string, options?: ResolveHostOptions): Promise<Electron.ResolvedHost>;
/**
* Resolves with the proxy information for `url`.
*/
resolveProxy(url: string): Promise<string>;
/**
* Sets a handler to respond to Bluetooth pairing requests. This handler allows
* developers to handle devices that require additional validation before pairing.
* When a handler is not defined, any pairing on Linux or Windows that requires
* additional validation will be automatically cancelled. macOS does not require a
* handler because macOS handles the pairing automatically. To clear the handler,
* call `setBluetoothPairingHandler(null)`.
*
* @platform win32,linux
*/
setBluetoothPairingHandler(handler: ((details: BluetoothPairingHandlerHandlerDetails, callback: (response: Response) => void) => void) | (null)): void;
/**
* Sets the certificate verify proc for `session`, the `proc` will be called with
* `proc(request, callback)` whenever a server certificate verification is
* requested. Calling `callback(0)` accepts the certificate, calling `callback(-2)`
* rejects it.
*
* Calling `setCertificateVerifyProc(null)` will revert back to default certificate
* verify proc.
*
* > **NOTE:** The result of this procedure is cached by the network service.
*/
setCertificateVerifyProc(proc: ((request: Request, callback: (verificationResult: number) => void) => void) | (null)): void;
/**
* Sets the directory to store the generated JS code cache for this session. The
* directory is not required to be created by the user before this call, the
* runtime will create if it does not exist otherwise will use the existing
* directory. If directory cannot be created, then code cache will not be used and
* all operations related to code cache will fail silently inside the runtime. By
* default, the directory will be `Code Cache` under the respective user data
* folder.
*/
setCodeCachePath(path: string): void;
/**
* Sets the handler which can be used to respond to device permission checks for
* the `session`. Returning `true` will allow the device to be permitted and
* `false` will reject it. To clear the handler, call
* `setDevicePermissionHandler(null)`. This handler can be used to provide default
* permissioning to devices without first calling for permission to devices (eg via
* `navigator.hid.requestDevice`). If this handler is not defined, the default
* device permissions as granted through device selection (eg via
* `navigator.hid.requestDevice`) will be used. Additionally, the default behavior
* of Electron is to store granted device permision in memory. If longer term
* storage is needed, a developer can store granted device permissions (eg when
* handling the `select-hid-device` event) and then read from that storage with
* `setDevicePermissionHandler`.
*/
setDevicePermissionHandler(handler: ((details: DevicePermissionHandlerHandlerDetails) => boolean) | (null)): void;
/**
* This handler will be called when web content requests access to display media
* via the `navigator.mediaDevices.getDisplayMedia` API. Use the desktopCapturer
* API to choose which stream(s) to grant access to.
*
* Passing a WebFrameMain object as a video or audio stream will capture the video
* or audio stream from that frame.
*
* Passing `null` instead of a function resets the handler to its default state.
*/
setDisplayMediaRequestHandler(handler: ((request: DisplayMediaRequestHandlerHandlerRequest, callback: (streams: Streams) => void) => void) | (null)): void;
/**
* Sets download saving directory. By default, the download directory will be the
* `Downloads` under the respective app folder.
*/
setDownloadPath(path: string): void;
/**
* Sets the handler which can be used to respond to permission checks for the
* `session`. Returning `true` will allow the permission and `false` will reject
* it. Please note that you must also implement `setPermissionRequestHandler` to
* get complete permission handling. Most web APIs do a permission check and then
* make a permission request if the check is denied. To clear the handler, call
* `setPermissionCheckHandler(null)`.
*/
setPermissionCheckHandler(handler: ((webContents: (WebContents) | (null), permission: 'clipboard-read' | 'clipboard-sanitized-write' | 'geolocation' | 'fullscreen' | 'hid' | 'idle-detection' | 'media' | 'mediaKeySystem' | 'midi' | 'midiSysex' | 'notifications' | 'openExternal' | 'pointerLock' | 'serial' | 'usb', requestingOrigin: string, details: PermissionCheckHandlerHandlerDetails) => boolean) | (null)): void;
/**
* Sets the handler which can be used to respond to permission requests for the
* `session`. Calling `callback(true)` will allow the permission and
* `callback(false)` will reject it. To clear the handler, call
* `setPermissionRequestHandler(null)`. Please note that you must also implement
* `setPermissionCheckHandler` to get complete permission handling. Most web APIs
* do a permission check and then make a permission request if the check is denied.
*/
setPermissionRequestHandler(handler: ((webContents: WebContents, permission: 'clipboard-read' | 'clipboard-sanitized-write' | 'display-capture' | 'fullscreen' | 'geolocation' | 'idle-detection' | 'media' | 'mediaKeySystem' | 'midi' | 'midiSysex' | 'notifications' | 'pointerLock' | 'openExternal' | 'window-management' | 'unknown', callback: (permissionGranted: boolean) => void, details: PermissionRequestHandlerHandlerDetails) => void) | (null)): void;
/**
* Adds scripts that will be executed on ALL web contents that are associated with
* this session just before normal `preload` scripts run.
*/
setPreloads(preloads: string[]): void;
/**
* Resolves when the proxy setting process is complete.
*
* Sets the proxy settings.
*
* When `mode` is unspecified, `pacScript` and `proxyRules` are provided together,
* the `proxyRules` option is ignored and `pacScript` configuration is applied.
*
* You may need `ses.closeAllConnections` to close currently in flight connections
* to prevent pooled sockets using previous proxy from being reused by future
* requests.
*
* The `proxyRules` has to follow the rules below:
*
* For example:
*
* * `http=foopy:80;ftp=foopy2` - Use HTTP proxy `foopy:80` for `http://` URLs, and
* HTTP proxy `foopy2:80` for `ftp://` URLs.
* * `foopy:80` - Use HTTP proxy `foopy:80` for all URLs.
* * `foopy:80,bar,direct://` - Use HTTP proxy `foopy:80` for all URLs, failing
* over to `bar` if `foopy:80` is unavailable, and after that using no proxy.
* * `socks4://foopy` - Use SOCKS v4 proxy `foopy:1080` for all URLs.
* * `http=foopy,socks5://bar.com` - Use HTTP proxy `foopy` for http URLs, and fail
* over to the SOCKS5 proxy `bar.com` if `foopy` is unavailable.
* * `http=foopy,direct://` - Use HTTP proxy `foopy` for http URLs, and use no
* proxy if `foopy` is unavailable.
* * `http=foopy;socks=foopy2` - Use HTTP proxy `foopy` for http URLs, and use
* `socks4://foopy2` for all other URLs.
*
* The `proxyBypassRules` is a comma separated list of rules described below:
*
* * `[ URL_SCHEME "://" ] HOSTNAME_PATTERN [ ":" <port> ]`
*
* Match all hostnames that match the pattern HOSTNAME_PATTERN.
*
* Examples: "foobar.com", "*foobar.com", "*.foobar.com", "*foobar.com:99",
* "https://x.*.y.com:99"
* * `"." HOSTNAME_SUFFIX_PATTERN [ ":" PORT ]`
*
* Match a particular domain suffix.
*
* Examples: ".google.com", ".com", "http://.google.com"
* * `[ SCHEME "://" ] IP_LITERAL [ ":" PORT ]`
*
* Match URLs which are IP address literals.
*
* Examples: "127.0.1", "[0:0::1]", "[::1]", "http://[::1]:99"
* * `IP_LITERAL "/" PREFIX_LENGTH_IN_BITS`
*
* Match any URL that is to an IP literal that falls between the given range. IP
* range is specified using CIDR notation.
*
* Examples: "192.168.1.1/16", "fefe:13::abc/33".
* * `<local>`
*
* Match local addresses. The meaning of `<local>` is whether the host matches one
* of: "127.0.0.1", "::1", "localhost".
*/
setProxy(config: Config): Promise<void>;
/**
* By default Electron will download hunspell dictionaries from the Chromium CDN.
* If you want to override this behavior you can use this API to point the
* dictionary downloader at your own hosted version of the hunspell dictionaries.
* We publish a `hunspell_dictionaries.zip` file with each release which contains
* the files you need to host here.
*
* The file server must be **case insensitive**. If you cannot do this, you must
* upload each file twice: once with the case it has in the ZIP file and once with
* the filename as all lowercase.
*
* If the files present in `hunspell_dictionaries.zip` are available at
* `https://example.com/dictionaries/language-code.bdic` then you should call this
* api with
* `ses.setSpellCheckerDictionaryDownloadURL('https://example.com/dictionaries/')`.
* Please note the trailing slash. The URL to the dictionaries is formed as
* `${url}${filename}`.
*
* **Note:** On macOS the OS spellchecker is used and therefore we do not download
* any dictionary files. This API is a no-op on macOS.
*/
setSpellCheckerDictionaryDownloadURL(url: string): void;
/**
* Sets whether to enable the builtin spell checker.
*/
setSpellCheckerEnabled(enable: boolean): void;
/**
* The built in spellchecker does not automatically detect what language a user is
* typing in. In order for the spell checker to correctly check their words you
* must call this API with an array of language codes. You can get the list of
* supported language codes with the `ses.availableSpellCheckerLanguages` property.
*
* **Note:** On macOS the OS spellchecker is used and will detect your language
* automatically. This API is a no-op on macOS.
*/
setSpellCheckerLanguages(languages: string[]): void;
/**
* Sets the SSL configuration for the session. All subsequent network requests will
* use the new configuration. Existing network connections (such as WebSocket
* connections) will not be terminated, but old sockets in the pool will not be
* reused for new connections.
*/
setSSLConfig(config: SSLConfigConfig): void;
/**
* Sets the handler which can be used to override which USB classes are protected.
* The return value for the handler is a string array of USB classes which should
* be considered protected (eg not available in the renderer). Valid values for
* the array are:
*
* * `audio`
* * `audio-video`
* * `hid`
* * `mass-storage`
* * `smart-card`
* * `video`
* * `wireless`
*
* Returning an empty string array from the handler will allow all USB classes;
* returning the passed in array will maintain the default list of protected USB
* classes (this is also the default behavior if a handler is not defined). To
* clear the handler, call `setUSBProtectedClassesHandler(null)`.
*/
setUSBProtectedClassesHandler(handler: ((details: USBProtectedClassesHandlerHandlerDetails) => string[]) | (null)): void;
/**
* Overrides the `userAgent` and `acceptLanguages` for this session.
*
* The `acceptLanguages` must a comma separated ordered list of language codes, for
* example `"en-US,fr,de,ko,zh-CN,ja"`.
*
* This doesn't affect existing `WebContents`, and each `WebContents` can use
* `webContents.setUserAgent` to override the session-wide user agent.
*/
setUserAgent(userAgent: string, acceptLanguages?: string): void;
/**
* A `string[]` array which consists of all the known available spell checker
* languages. Providing a language code to the `setSpellCheckerLanguages` API that
* isn't in this array will result in an error.
*
*/
readonly availableSpellCheckerLanguages: string[];
/**
* A `Cookies` object for this session.
*
*/
readonly cookies: Cookies;
/**
* A `NetLog` object for this session.
*
*/
readonly netLog: NetLog;
/**
* A `Protocol` object for this session.
*
*/
readonly protocol: Protocol;
/**
* A `ServiceWorkers` object for this session.
*
*/
readonly serviceWorkers: ServiceWorkers;
/**
* A `boolean` indicating whether builtin spell checker is enabled.
*/
spellCheckerEnabled: boolean;
/**
* A `string | null` indicating the absolute file system path where data for this
* session is persisted on disk. For in memory sessions this returns `null`.
*
*/
readonly storagePath: (string) | (null);
/**
* A `WebRequest` object for this session.
*
*/
readonly webRequest: WebRequest;
}
interface SharedWorkerInfo {
// Docs: https://electronjs.org/docs/api/structures/shared-worker-info
/**
* The unique id of the shared worker.
*/
id: string;
/**
* The url of the shared worker.
*/
url: string;
}
class ShareMenu extends NodeEventEmitter {
// Docs: https://electronjs.org/docs/api/share-menu
/**
* ShareMenu
*/
constructor(sharingItem: SharingItem);
/**
* Closes the context menu in the `browserWindow`.
*/
closePopup(browserWindow?: BrowserWindow): void;
/**
* Pops up this menu as a context menu in the `BrowserWindow`.
*/
popup(options?: PopupOptions): void;
}
interface SharingItem {
// Docs: https://electronjs.org/docs/api/structures/sharing-item
/**
* An array of files to share.
*/
filePaths?: string[];
/**
* An array of text to share.
*/
texts?: string[];
/**
* An array of URLs to share.
*/
urls?: string[];
}
interface Shell {
// Docs: https://electronjs.org/docs/api/shell
/**
* Play the beep sound.
*/
beep(): void;
/**
* Open the given external protocol URL in the desktop's default manner. (For
* example, mailto: URLs in the user's default mail agent).
*/
openExternal(url: string, options?: OpenExternalOptions): Promise<void>;
/**
* Resolves with a string containing the error message corresponding to the failure
* if a failure occurred, otherwise "".
*
* Open the given file in the desktop's default manner.
*/
openPath(path: string): Promise<string>;
/**
* Resolves the shortcut link at `shortcutPath`.
*
* An exception will be thrown when any error happens.
*
* @platform win32
*/
readShortcutLink(shortcutPath: string): ShortcutDetails;
/**
* Show the given file in a file manager. If possible, select the file.
*/
showItemInFolder(fullPath: string): void;
/**
* Resolves when the operation has been completed. Rejects if there was an error
* while deleting the requested item.
*
* This moves a path to the OS-specific trash location (Trash on macOS, Recycle Bin
* on Windows, and a desktop-environment-specific location on Linux).
*/
trashItem(path: string): Promise<void>;
/**
* Whether the shortcut was created successfully.
*
* Creates or updates a shortcut link at `shortcutPath`.
*
* @platform win32
*/
writeShortcutLink(shortcutPath: string, operation: 'create' | 'update' | 'replace', options: ShortcutDetails): boolean;
/**
* Whether the shortcut was created successfully.
*
* Creates or updates a shortcut link at `shortcutPath`.
*
* @platform win32
*/
writeShortcutLink(shortcutPath: string, options: ShortcutDetails): boolean;
}
interface ShortcutDetails {
// Docs: https://electronjs.org/docs/api/structures/shortcut-details
/**
* The Application User Model ID. Default is empty.
*/
appUserModelId?: string;
/**
* The arguments to be applied to `target` when launching from this shortcut.
* Default is empty.
*/
args?: string;
/**
* The working directory. Default is empty.
*/
cwd?: string;
/**
* The description of the shortcut. Default is empty.
*/
description?: string;
/**
* The path to the icon, can be a DLL or EXE. `icon` and `iconIndex` have to be set
* together. Default is empty, which uses the target's icon.
*/
icon?: string;
/**
* The resource ID of icon when `icon` is a DLL or EXE. Default is 0.
*/
iconIndex?: number;
/**
* The target to launch from this shortcut.
*/
target: string;
/**
* The Application Toast Activator CLSID. Needed for participating in Action
* Center.
*/
toastActivatorClsid?: string;
}
interface Size {
// Docs: https://electronjs.org/docs/api/structures/size
height: number;
width: number;
}
interface SystemPreferences extends NodeJS.EventEmitter {
// Docs: https://electronjs.org/docs/api/system-preferences
/**
* @platform win32
*/
on(event: 'accent-color-changed', listener: (event: Event,
/**
* The new RGBA color the user assigned to be their system accent color.
*/
newColor: string) => void): this;
once(event: 'accent-color-changed', listener: (event: Event,
/**
* The new RGBA color the user assigned to be their system accent color.
*/
newColor: string) => void): this;
addListener(event: 'accent-color-changed', listener: (event: Event,
/**
* The new RGBA color the user assigned to be their system accent color.
*/
newColor: string) => void): this;
removeListener(event: 'accent-color-changed', listener: (event: Event,
/**
* The new RGBA color the user assigned to be their system accent color.
*/
newColor: string) => void): this;
/**
* @platform win32
*/
on(event: 'color-changed', listener: (event: Event) => void): this;
once(event: 'color-changed', listener: (event: Event) => void): this;
addListener(event: 'color-changed', listener: (event: Event) => void): this;
removeListener(event: 'color-changed', listener: (event: Event) => void): this;
/**
* A promise that resolves with `true` if consent was granted and `false` if it was
* denied. If an invalid `mediaType` is passed, the promise will be rejected. If an
* access request was denied and later is changed through the System Preferences
* pane, a restart of the app will be required for the new permissions to take
* effect. If access has already been requested and denied, it _must_ be changed
* through the preference pane; an alert will not pop up and the promise will
* resolve with the existing access status.
*
* **Important:** In order to properly leverage this API, you must set the
* `NSMicrophoneUsageDescription` and `NSCameraUsageDescription` strings in your
* app's `Info.plist` file. The values for these keys will be used to populate the
* permission dialogs so that the user will be properly informed as to the purpose
* of the permission request. See Electron Application Distribution for more
* information about how to set these in the context of Electron.
*
* This user consent was not required until macOS 10.14 Mojave, so this method will
* always return `true` if your system is running 10.13 High Sierra.
*
* @platform darwin
*/
askForMediaAccess(mediaType: 'microphone' | 'camera'): Promise<boolean>;
/**
* whether or not this device has the ability to use Touch ID.
*
* @platform darwin
*/
canPromptTouchID(): boolean;
/**
* The users current system wide accent color preference in RGBA hexadecimal form.
*
* This API is only available on macOS 10.14 Mojave or newer.
*
* @platform win32,darwin
*/
getAccentColor(): string;
/**
* * `shouldRenderRichAnimation` boolean - Returns true if rich animations should
* be rendered. Looks at session type (e.g. remote desktop) and accessibility
* settings to give guidance for heavy animations.
* * `scrollAnimationsEnabledBySystem` boolean - Determines on a per-platform basis
* whether scroll animations (e.g. produced by home/end key) should be enabled.
* * `prefersReducedMotion` boolean - Determines whether the user desires reduced
* motion based on platform APIs.
*
* Returns an object with system animation settings.
*/
getAnimationSettings(): AnimationSettings;
/**
* The system color setting in RGB hexadecimal form (`#ABCDEF`). See the Windows
* docs and the macOS docs for more details.
*
* The following colors are only available on macOS 10.14: `find-highlight`,
* `selected-content-background`, `separator`,
* `unemphasized-selected-content-background`,
* `unemphasized-selected-text-background`, and `unemphasized-selected-text`.
*
* @platform win32,darwin
*/
getColor(color: '3d-dark-shadow' | '3d-face' | '3d-highlight' | '3d-light' | '3d-shadow' | 'active-border' | 'active-caption' | 'active-caption-gradient' | 'app-workspace' | 'button-text' | 'caption-text' | 'desktop' | 'disabled-text' | 'highlight' | 'highlight-text' | 'hotlight' | 'inactive-border' | 'inactive-caption' | 'inactive-caption-gradient' | 'inactive-caption-text' | 'info-background' | 'info-text' | 'menu' | 'menu-highlight' | 'menubar' | 'menu-text' | 'scrollbar' | 'window' | 'window-frame' | 'window-text' | 'control-background' | 'control' | 'control-text' | 'disabled-control-text' | 'find-highlight' | 'grid' | 'header-text' | 'highlight' | 'keyboard-focus-indicator' | 'label' | 'link' | 'placeholder-text' | 'quaternary-label' | 'scrubber-textured-background' | 'secondary-label' | 'selected-content-background' | 'selected-control' | 'selected-control-text' | 'selected-menu-item-text' | 'selected-text-background' | 'selected-text' | 'separator' | 'shadow' | 'tertiary-label' | 'text-background' | 'text' | 'under-page-background' | 'unemphasized-selected-content-background' | 'unemphasized-selected-text-background' | 'unemphasized-selected-text' | 'window-background' | 'window-frame-text'): string;
/**
* Can be `dark`, `light` or `unknown`.
*
* Gets the macOS appearance setting that is currently applied to your application,
* maps to NSApplication.effectiveAppearance
*
* @platform darwin
*/
getEffectiveAppearance(): ('dark' | 'light' | 'unknown');
/**
* Can be `not-determined`, `granted`, `denied`, `restricted` or `unknown`.
*
* This user consent was not required on macOS 10.13 High Sierra so this method
* will always return `granted`. macOS 10.14 Mojave or higher requires consent for
* `microphone` and `camera` access. macOS 10.15 Catalina or higher requires
* consent for `screen` access.
*
* Windows 10 has a global setting controlling `microphone` and `camera` access for
* all win32 applications. It will always return `granted` for `screen` and for all
* media types on older versions of Windows.
*
* @platform win32,darwin
*/
getMediaAccessStatus(mediaType: 'microphone' | 'camera' | 'screen'): ('not-determined' | 'granted' | 'denied' | 'restricted' | 'unknown');
/**
* The standard system color formatted as `#RRGGBBAA`.
*
* Returns one of several standard system colors that automatically adapt to
* vibrancy and changes in accessibility settings like 'Increase contrast' and
* 'Reduce transparency'. See Apple Documentation for more details.
*
* @platform darwin
*/
getSystemColor(color: 'blue' | 'brown' | 'gray' | 'green' | 'orange' | 'pink' | 'purple' | 'red' | 'yellow'): string;
/**
* The value of `key` in `NSUserDefaults`.
*
* Some popular `key` and `type`s are:
*
* * `AppleInterfaceStyle`: `string`
* * `AppleAquaColorVariant`: `integer`
* * `AppleHighlightColor`: `string`
* * `AppleShowScrollBars`: `string`
* * `NSNavRecentPlaces`: `array`
* * `NSPreferredWebServices`: `dictionary`
* * `NSUserDictionaryReplacementItems`: `array`
*
* @platform darwin
*/
getUserDefault<Type extends keyof UserDefaultTypes>(key: string, type: Type): UserDefaultTypes[Type];
/**
* `true` if DWM composition (Aero Glass) is enabled, and `false` otherwise.
*
* An example of using it to determine if you should create a transparent window or
* not (transparent windows won't work correctly when DWM composition is disabled):
*
* @platform win32
*/
isAeroGlassEnabled(): boolean;
/**
* Whether the Swipe between pages setting is on.
*
* @platform darwin
*/
isSwipeTrackingFromScrollEventsEnabled(): boolean;
/**
* `true` if the current process is a trusted accessibility client and `false` if
* it is not.
*
* @platform darwin
*/
isTrustedAccessibilityClient(prompt: boolean): boolean;
/**
* Posts `event` as native notifications of macOS. The `userInfo` is an Object that
* contains the user information dictionary sent along with the notification.
*
* @platform darwin
*/
postLocalNotification(event: string, userInfo: Record<string, any>): void;
/**
* Posts `event` as native notifications of macOS. The `userInfo` is an Object that
* contains the user information dictionary sent along with the notification.
*
* @platform darwin
*/
postNotification(event: string, userInfo: Record<string, any>, deliverImmediately?: boolean): void;
/**
* Posts `event` as native notifications of macOS. The `userInfo` is an Object that
* contains the user information dictionary sent along with the notification.
*
* @platform darwin
*/
postWorkspaceNotification(event: string, userInfo: Record<string, any>): void;
/**
* resolves if the user has successfully authenticated with Touch ID.
*
* This API itself will not protect your user data; rather, it is a mechanism to
* allow you to do so. Native apps will need to set Access Control Constants like
* `kSecAccessControlUserPresence` on their keychain entry so that reading it would
* auto-prompt for Touch ID biometric consent. This could be done with
* `node-keytar`, such that one would store an encryption key with `node-keytar`
* and only fetch it if `promptTouchID()` resolves.
*
* @platform darwin
*/
promptTouchID(reason: string): Promise<void>;
/**
* Add the specified defaults to your application's `NSUserDefaults`.
*
* @platform darwin
*/
registerDefaults(defaults: Record<string, (string) | (boolean) | (number)>): void;
/**
* Removes the `key` in `NSUserDefaults`. This can be used to restore the default
* or global value of a `key` previously set with `setUserDefault`.
*
* @platform darwin
*/
removeUserDefault(key: string): void;
/**
* Set the value of `key` in `NSUserDefaults`.
*
* Note that `type` should match actual type of `value`. An exception is thrown if
* they don't.
*
* Some popular `key` and `type`s are:
*
* * `ApplePressAndHoldEnabled`: `boolean`
*
* @platform darwin
*/
setUserDefault<Type extends keyof UserDefaultTypes>(key: string, type: Type, value: UserDefaultTypes[Type]): void;
/**
* The ID of this subscription
*
* Same as `subscribeNotification`, but uses `NSNotificationCenter` for local
* defaults. This is necessary for events such as
* `NSUserDefaultsDidChangeNotification`.
*
* If `event` is null, the `NSNotificationCenter` doesn’t use it as criteria for
* delivery to the observer. See docs for more information.
*
* @platform darwin
*/
subscribeLocalNotification(event: (string) | (null), callback: (event: string, userInfo: Record<string, unknown>, object: string) => void): number;
/**
* The ID of this subscription
*
* Subscribes to native notifications of macOS, `callback` will be called with
* `callback(event, userInfo)` when the corresponding `event` happens. The
* `userInfo` is an Object that contains the user information dictionary sent along
* with the notification. The `object` is the sender of the notification, and only
* supports `NSString` values for now.
*
* The `id` of the subscriber is returned, which can be used to unsubscribe the
* `event`.
*
* Under the hood this API subscribes to `NSDistributedNotificationCenter`, example
* values of `event` are:
*
* * `AppleInterfaceThemeChangedNotification`
* * `AppleAquaColorVariantChanged`
* * `AppleColorPreferencesChangedNotification`
* * `AppleShowScrollBarsSettingChanged`
*
* If `event` is null, the `NSDistributedNotificationCenter` doesn’t use it as
* criteria for delivery to the observer. See docs for more information.
*
* @platform darwin
*/
subscribeNotification(event: (string) | (null), callback: (event: string, userInfo: Record<string, unknown>, object: string) => void): number;
/**
* The ID of this subscription
*
* Same as `subscribeNotification`, but uses
* `NSWorkspace.sharedWorkspace.notificationCenter`. This is necessary for events
* such as `NSWorkspaceDidActivateApplicationNotification`.
*
* If `event` is null, the `NSWorkspaceNotificationCenter` doesn’t use it as
* criteria for delivery to the observer. See docs for more information.
*
* @platform darwin
*/
subscribeWorkspaceNotification(event: (string) | (null), callback: (event: string, userInfo: Record<string, unknown>, object: string) => void): number;
/**
* Same as `unsubscribeNotification`, but removes the subscriber from
* `NSNotificationCenter`.
*
* @platform darwin
*/
unsubscribeLocalNotification(id: number): void;
/**
* Removes the subscriber with `id`.
*
* @platform darwin
*/
unsubscribeNotification(id: number): void;
/**
* Same as `unsubscribeNotification`, but removes the subscriber from
* `NSWorkspace.sharedWorkspace.notificationCenter`.
*
* @platform darwin
*/
unsubscribeWorkspaceNotification(id: number): void;
/**
* A `boolean` property which determines whether the app avoids using
* semitransparent backgrounds. This maps to
* NSWorkspace.accessibilityDisplayShouldReduceTransparency
*
* @platform darwin
*/
accessibilityDisplayShouldReduceTransparency(): boolean;
/**
* A `string` property that can be `dark`, `light` or `unknown`.
*
* Returns the macOS appearance setting that is currently applied to your
* application, maps to NSApplication.effectiveAppearance
*
* @platform darwin
*/
readonly effectiveAppearance: ('dark' | 'light' | 'unknown');
}
interface Task {
// Docs: https://electronjs.org/docs/api/structures/task
/**
* The command line arguments when `program` is executed.
*/
arguments: string;
/**
* Description of this task.
*/
description: string;
/**
* The icon index in the icon file. If an icon file consists of two or more icons,
* set this value to identify the icon. If an icon file consists of one icon, this
* value is 0.
*/
iconIndex: number;
/**
* The absolute path to an icon to be displayed in a JumpList, which can be an
* arbitrary resource file that contains an icon. You can usually specify
* `process.execPath` to show the icon of the program.
*/
iconPath: string;
/**
* Path of the program to execute, usually you should specify `process.execPath`
* which opens the current program.
*/
program: string;
/**
* The string to be displayed in a JumpList.
*/
title: string;
/**
* The working directory. Default is empty.
*/
workingDirectory?: string;
}
interface ThumbarButton {
// Docs: https://electronjs.org/docs/api/structures/thumbar-button
click: () => void;
/**
* Control specific states and behaviors of the button. By default, it is
* `['enabled']`.
*/
flags?: string[];
/**
* The icon showing in thumbnail toolbar.
*/
icon: NativeImage;
/**
* The text of the button's tooltip.
*/
tooltip?: string;
}
class TouchBar {
// Docs: https://electronjs.org/docs/api/touch-bar
/**
* TouchBar
*/
constructor(options: TouchBarConstructorOptions);
/**
* A `TouchBarItem` that will replace the "esc" button on the touch bar when set.
* Setting to `null` restores the default "esc" button. Changing this value
* immediately updates the escape item in the touch bar.
*/
escapeItem: (TouchBarButton | TouchBarColorPicker | TouchBarGroup | TouchBarLabel | TouchBarPopover | TouchBarScrubber | TouchBarSegmentedControl | TouchBarSlider | TouchBarSpacer | null);
/**
* A `typeof TouchBarButton` reference to the `TouchBarButton` class.
*/
static TouchBarButton: typeof TouchBarButton;
/**
* A `typeof TouchBarColorPicker` reference to the `TouchBarColorPicker` class.
*/
static TouchBarColorPicker: typeof TouchBarColorPicker;
/**
* A `typeof TouchBarGroup` reference to the `TouchBarGroup` class.
*/
static TouchBarGroup: typeof TouchBarGroup;
/**
* A `typeof TouchBarLabel` reference to the `TouchBarLabel` class.
*/
static TouchBarLabel: typeof TouchBarLabel;
/**
* A `typeof TouchBarOtherItemsProxy` reference to the `TouchBarOtherItemsProxy`
* class.
*/
static TouchBarOtherItemsProxy: typeof TouchBarOtherItemsProxy;
/**
* A `typeof TouchBarPopover` reference to the `TouchBarPopover` class.
*/
static TouchBarPopover: typeof TouchBarPopover;
/**
* A `typeof TouchBarScrubber` reference to the `TouchBarScrubber` class.
*/
static TouchBarScrubber: typeof TouchBarScrubber;
/**
* A `typeof TouchBarSegmentedControl` reference to the `TouchBarSegmentedControl`
* class.
*/
static TouchBarSegmentedControl: typeof TouchBarSegmentedControl;
/**
* A `typeof TouchBarSlider` reference to the `TouchBarSlider` class.
*/
static TouchBarSlider: typeof TouchBarSlider;
/**
* A `typeof TouchBarSpacer` reference to the `TouchBarSpacer` class.
*/
static TouchBarSpacer: typeof TouchBarSpacer;
}
class TouchBarButton {
// Docs: https://electronjs.org/docs/api/touch-bar-button
/**
* TouchBarButton
*/
constructor(options: TouchBarButtonConstructorOptions);
/**
* A `string` representing the description of the button to be read by a screen
* reader. Will only be read by screen readers if no label is set.
*/
accessibilityLabel: string;
/**
* A `string` hex code representing the button's current background color. Changing
* this value immediately updates the button in the touch bar.
*/
backgroundColor: string;
/**
* A `boolean` representing whether the button is in an enabled state.
*/
enabled: boolean;
/**
* A `NativeImage` representing the button's current icon. Changing this value
* immediately updates the button in the touch bar.
*/
icon: NativeImage;
/**
* A `string` - Can be `left`, `right` or `overlay`. Defaults to `overlay`.
*/
iconPosition: ('left' | 'right' | 'overlay');
/**
* A `string` representing the button's current text. Changing this value
* immediately updates the button in the touch bar.
*/
label: string;
}
class TouchBarColorPicker extends NodeEventEmitter {
// Docs: https://electronjs.org/docs/api/touch-bar-color-picker
/**
* TouchBarColorPicker
*/
constructor(options: TouchBarColorPickerConstructorOptions);
/**
* A `string[]` array representing the color picker's available colors to select.
* Changing this value immediately updates the color picker in the touch bar.
*/
availableColors: string[];
/**
* A `string` hex code representing the color picker's currently selected color.
* Changing this value immediately updates the color picker in the touch bar.
*/
selectedColor: string;
}
class TouchBarGroup extends NodeEventEmitter {
// Docs: https://electronjs.org/docs/api/touch-bar-group
/**
* TouchBarGroup
*/
constructor(options: TouchBarGroupConstructorOptions);
}
class TouchBarLabel extends NodeEventEmitter {
// Docs: https://electronjs.org/docs/api/touch-bar-label
/**
* TouchBarLabel
*/
constructor(options: TouchBarLabelConstructorOptions);
/**
* A `string` representing the description of the label to be read by a screen
* reader.
*/
accessibilityLabel: string;
/**
* A `string` representing the label's current text. Changing this value
* immediately updates the label in the touch bar.
*/
label: string;
/**
* A `string` hex code representing the label's current text color. Changing this
* value immediately updates the label in the touch bar.
*/
textColor: string;
}
class TouchBarOtherItemsProxy extends NodeEventEmitter {
// Docs: https://electronjs.org/docs/api/touch-bar-other-items-proxy
/**
* TouchBarOtherItemsProxy
*/
constructor();
}
class TouchBarPopover extends NodeEventEmitter {
// Docs: https://electronjs.org/docs/api/touch-bar-popover
/**
* TouchBarPopover
*/
constructor(options: TouchBarPopoverConstructorOptions);
/**
* A `NativeImage` representing the popover's current button icon. Changing this
* value immediately updates the popover in the touch bar.
*/
icon: NativeImage;
/**
* A `string` representing the popover's current button text. Changing this value
* immediately updates the popover in the touch bar.
*/
label: string;
}
class TouchBarScrubber extends NodeEventEmitter {
// Docs: https://electronjs.org/docs/api/touch-bar-scrubber
/**
* TouchBarScrubber
*/
constructor(options: TouchBarScrubberConstructorOptions);
/**
* A `boolean` representing whether this scrubber is continuous or not. Updating
* this value immediately updates the control in the touch bar.
*/
continuous: boolean;
/**
* A `ScrubberItem[]` array representing the items in this scrubber. Updating this
* value immediately updates the control in the touch bar. Updating deep properties
* inside this array **does not update the touch bar**.
*/
items: ScrubberItem[];
/**
* A `string` representing the mode of this scrubber. Updating this value
* immediately updates the control in the touch bar. Possible values:
*
* * `fixed` - Maps to `NSScrubberModeFixed`.
* * `free` - Maps to `NSScrubberModeFree`.
*/
mode: ('fixed' | 'free');
/**
* A `string` representing the style that selected items in the scrubber should
* have. This style is overlayed on top of the scrubber item instead of being
* placed behind it. Updating this value immediately updates the control in the
* touch bar. Possible values:
*
* * `background` - Maps to `[NSScrubberSelectionStyle roundedBackgroundStyle]`.
* * `outline` - Maps to `[NSScrubberSelectionStyle outlineOverlayStyle]`.
* * `none` - Removes all styles.
*/
overlayStyle: ('background' | 'outline' | 'none');
/**
* A `string` representing the style that selected items in the scrubber should
* have. Updating this value immediately updates the control in the touch bar.
* Possible values:
*
* * `background` - Maps to `[NSScrubberSelectionStyle roundedBackgroundStyle]`.
* * `outline` - Maps to `[NSScrubberSelectionStyle outlineOverlayStyle]`.
* * `none` - Removes all styles.
*/
selectedStyle: ('background' | 'outline' | 'none');
/**
* A `boolean` representing whether to show the left / right selection arrows in
* this scrubber. Updating this value immediately updates the control in the touch
* bar.
*/
showArrowButtons: boolean;
}
class TouchBarSegmentedControl extends NodeEventEmitter {
// Docs: https://electronjs.org/docs/api/touch-bar-segmented-control
/**
* TouchBarSegmentedControl
*/
constructor(options: TouchBarSegmentedControlConstructorOptions);
/**
* A `string` representing the current selection mode of the control. Can be
* `single`, `multiple` or `buttons`.
*/
mode: ('single' | 'multiple' | 'buttons');
/**
* A `SegmentedControlSegment[]` array representing the segments in this control.
* Updating this value immediately updates the control in the touch bar. Updating
* deep properties inside this array **does not update the touch bar**.
*/
segments: SegmentedControlSegment[];
/**
* A `string` representing the controls current segment style. Updating this value
* immediately updates the control in the touch bar.
*/
segmentStyle: string;
/**
* An `Integer` representing the currently selected segment. Changing this value
* immediately updates the control in the touch bar. User interaction with the
* touch bar will update this value automatically.
*/
selectedIndex: number;
}
class TouchBarSlider extends NodeEventEmitter {
// Docs: https://electronjs.org/docs/api/touch-bar-slider
/**
* TouchBarSlider
*/
constructor(options: TouchBarSliderConstructorOptions);
/**
* A `string` representing the slider's current text. Changing this value
* immediately updates the slider in the touch bar.
*/
label: string;
/**
* A `number` representing the slider's current maximum value. Changing this value
* immediately updates the slider in the touch bar.
*/
maxValue: number;
/**
* A `number` representing the slider's current minimum value. Changing this value
* immediately updates the slider in the touch bar.
*/
minValue: number;
/**
* A `number` representing the slider's current value. Changing this value
* immediately updates the slider in the touch bar.
*/
value: number;
}
class TouchBarSpacer extends NodeEventEmitter {
// Docs: https://electronjs.org/docs/api/touch-bar-spacer
/**
* TouchBarSpacer
*/
constructor(options: TouchBarSpacerConstructorOptions);
/**
* A `string` representing the size of the spacer. Can be `small`, `large` or
* `flexible`.
*/
size: ('small' | 'large' | 'flexible');
}
interface TraceCategoriesAndOptions {
// Docs: https://electronjs.org/docs/api/structures/trace-categories-and-options
/**
* A filter to control what category groups should be traced. A filter can have an
* optional '-' prefix to exclude category groups that contain a matching category.
* Having both included and excluded category patterns in the same list is not
* supported. Examples: `test_MyTest*`, `test_MyTest*,test_OtherStuff`,
* `-excluded_category1,-excluded_category2`.
*/
categoryFilter: string;
/**
* Controls what kind of tracing is enabled, it is a comma-delimited sequence of
* the following strings: `record-until-full`, `record-continuously`,
* `trace-to-console`, `enable-sampling`, `enable-systrace`, e.g.
* `'record-until-full,enable-sampling'`. The first 3 options are trace recording
* modes and hence mutually exclusive. If more than one trace recording modes
* appear in the `traceOptions` string, the last one takes precedence. If none of
* the trace recording modes are specified, recording mode is `record-until-full`.
* The trace option will first be reset to the default option (`record_mode` set to
* `record-until-full`, `enable_sampling` and `enable_systrace` set to `false`)
* before options parsed from `traceOptions` are applied on it.
*/
traceOptions: string;
}
interface TraceConfig {
// Docs: https://electronjs.org/docs/api/structures/trace-config
/**
* if true, filter event data according to a specific list of events that have been
* manually vetted to not include any PII. See the implementation in Chromium for
* specifics.
*/
enable_argument_filter?: boolean;
/**
* a list of tracing categories to exclude. Can include glob-like patterns using
* `*` at the end of the category name. See tracing categories for the list of
* categories.
*/
excluded_categories?: string[];
/**
* a list of histogram names to report with the trace.
*/
histogram_names?: string[];
/**
* a list of tracing categories to include. Can include glob-like patterns using
* `*` at the end of the category name. See tracing categories for the list of
* categories.
*/
included_categories?: string[];
/**
* a list of process IDs to include in the trace. If not specified, trace all
* processes.
*/
included_process_ids?: number[];
/**
* if the `disabled-by-default-memory-infra` category is enabled, this contains
* optional additional configuration for data collection. See the Chromium
* memory-infra docs for more information.
*/
memory_dump_config?: Record<string, any>;
/**
* Can be `record-until-full`, `record-continuously`, `record-as-much-as-possible`
* or `trace-to-console`. Defaults to `record-until-full`.
*/
recording_mode?: ('record-until-full' | 'record-continuously' | 'record-as-much-as-possible' | 'trace-to-console');
/**
* maximum size of the trace recording buffer in events.
*/
trace_buffer_size_in_events?: number;
/**
* maximum size of the trace recording buffer in kilobytes. Defaults to 100MB.
*/
trace_buffer_size_in_kb?: number;
}
interface Transaction {
// Docs: https://electronjs.org/docs/api/structures/transaction
/**
* The error code if an error occurred while processing the transaction.
*/
errorCode: number;
/**
* The error message if an error occurred while processing the transaction.
*/
errorMessage: string;
/**
* The identifier of the restored transaction by the App Store.
*/
originalTransactionIdentifier: string;
payment: Payment;
/**
* The date the transaction was added to the App Store’s payment queue.
*/
transactionDate: string;
/**
* A string that uniquely identifies a successful payment transaction.
*/
transactionIdentifier: string;
/**
* The transaction state, can be `purchasing`, `purchased`, `failed`, `restored` or
* `deferred`.
*/
transactionState: ('purchasing' | 'purchased' | 'failed' | 'restored' | 'deferred');
}
class Tray extends NodeEventEmitter {
// Docs: https://electronjs.org/docs/api/tray
/**
* Emitted when the tray balloon is clicked.
*
* @platform win32
*/
on(event: 'balloon-click', listener: Function): this;
once(event: 'balloon-click', listener: Function): this;
addListener(event: 'balloon-click', listener: Function): this;
removeListener(event: 'balloon-click', listener: Function): this;
/**
* Emitted when the tray balloon is closed because of timeout or user manually
* closes it.
*
* @platform win32
*/
on(event: 'balloon-closed', listener: Function): this;
once(event: 'balloon-closed', listener: Function): this;
addListener(event: 'balloon-closed', listener: Function): this;
removeListener(event: 'balloon-closed', listener: Function): this;
/**
* Emitted when the tray balloon shows.
*
* @platform win32
*/
on(event: 'balloon-show', listener: Function): this;
once(event: 'balloon-show', listener: Function): this;
addListener(event: 'balloon-show', listener: Function): this;
removeListener(event: 'balloon-show', listener: Function): this;
/**
* Emitted when the tray icon is clicked.
*
* Note that on Linux this event is emitted when the tray icon receives an
* activation, which might not necessarily be left mouse click.
*/
on(event: 'click', listener: (event: KeyboardEvent,
/**
* The bounds of tray icon.
*/
bounds: Rectangle,
/**
* The position of the event.
*/
position: Point) => void): this;
once(event: 'click', listener: (event: KeyboardEvent,
/**
* The bounds of tray icon.
*/
bounds: Rectangle,
/**
* The position of the event.
*/
position: Point) => void): this;
addListener(event: 'click', listener: (event: KeyboardEvent,
/**
* The bounds of tray icon.
*/
bounds: Rectangle,
/**
* The position of the event.
*/
position: Point) => void): this;
removeListener(event: 'click', listener: (event: KeyboardEvent,
/**
* The bounds of tray icon.
*/
bounds: Rectangle,
/**
* The position of the event.
*/
position: Point) => void): this;
/**
* Emitted when the tray icon is double clicked.
*
* @platform darwin,win32
*/
on(event: 'double-click', listener: (event: KeyboardEvent,
/**
* The bounds of tray icon.
*/
bounds: Rectangle) => void): this;
once(event: 'double-click', listener: (event: KeyboardEvent,
/**
* The bounds of tray icon.
*/
bounds: Rectangle) => void): this;
addListener(event: 'double-click', listener: (event: KeyboardEvent,
/**
* The bounds of tray icon.
*/
bounds: Rectangle) => void): this;
removeListener(event: 'double-click', listener: (event: KeyboardEvent,
/**
* The bounds of tray icon.
*/
bounds: Rectangle) => void): this;
/**
* Emitted when a drag operation ends on the tray or ends at another location.
*
* @platform darwin
*/
on(event: 'drag-end', listener: Function): this;
once(event: 'drag-end', listener: Function): this;
addListener(event: 'drag-end', listener: Function): this;
removeListener(event: 'drag-end', listener: Function): this;
/**
* Emitted when a drag operation enters the tray icon.
*
* @platform darwin
*/
on(event: 'drag-enter', listener: Function): this;
once(event: 'drag-enter', listener: Function): this;
addListener(event: 'drag-enter', listener: Function): this;
removeListener(event: 'drag-enter', listener: Function): this;
/**
* Emitted when a drag operation exits the tray icon.
*
* @platform darwin
*/
on(event: 'drag-leave', listener: Function): this;
once(event: 'drag-leave', listener: Function): this;
addListener(event: 'drag-leave', listener: Function): this;
removeListener(event: 'drag-leave', listener: Function): this;
/**
* Emitted when any dragged items are dropped on the tray icon.
*
* @platform darwin
*/
on(event: 'drop', listener: Function): this;
once(event: 'drop', listener: Function): this;
addListener(event: 'drop', listener: Function): this;
removeListener(event: 'drop', listener: Function): this;
/**
* Emitted when dragged files are dropped in the tray icon.
*
* @platform darwin
*/
on(event: 'drop-files', listener: (event: Event,
/**
* The paths of the dropped files.
*/
files: string[]) => void): this;
once(event: 'drop-files', listener: (event: Event,
/**
* The paths of the dropped files.
*/
files: string[]) => void): this;
addListener(event: 'drop-files', listener: (event: Event,
/**
* The paths of the dropped files.
*/
files: string[]) => void): this;
removeListener(event: 'drop-files', listener: (event: Event,
/**
* The paths of the dropped files.
*/
files: string[]) => void): this;
/**
* Emitted when dragged text is dropped in the tray icon.
*
* @platform darwin
*/
on(event: 'drop-text', listener: (event: Event,
/**
* the dropped text string.
*/
text: string) => void): this;
once(event: 'drop-text', listener: (event: Event,
/**
* the dropped text string.
*/
text: string) => void): this;
addListener(event: 'drop-text', listener: (event: Event,
/**
* the dropped text string.
*/
text: string) => void): this;
removeListener(event: 'drop-text', listener: (event: Event,
/**
* the dropped text string.
*/
text: string) => void): this;
/**
* Emitted when the mouse clicks the tray icon.
*
* @platform darwin
*/
on(event: 'mouse-down', listener: (event: KeyboardEvent,
/**
* The position of the event.
*/
position: Point) => void): this;
once(event: 'mouse-down', listener: (event: KeyboardEvent,
/**
* The position of the event.
*/
position: Point) => void): this;
addListener(event: 'mouse-down', listener: (event: KeyboardEvent,
/**
* The position of the event.
*/
position: Point) => void): this;
removeListener(event: 'mouse-down', listener: (event: KeyboardEvent,
/**
* The position of the event.
*/
position: Point) => void): this;
/**
* Emitted when the mouse enters the tray icon.
*
* @platform darwin
*/
on(event: 'mouse-enter', listener: (event: KeyboardEvent,
/**
* The position of the event.
*/
position: Point) => void): this;
once(event: 'mouse-enter', listener: (event: KeyboardEvent,
/**
* The position of the event.
*/
position: Point) => void): this;
addListener(event: 'mouse-enter', listener: (event: KeyboardEvent,
/**
* The position of the event.
*/
position: Point) => void): this;
removeListener(event: 'mouse-enter', listener: (event: KeyboardEvent,
/**
* The position of the event.
*/
position: Point) => void): this;
/**
* Emitted when the mouse exits the tray icon.
*
* @platform darwin
*/
on(event: 'mouse-leave', listener: (event: KeyboardEvent,
/**
* The position of the event.
*/
position: Point) => void): this;
once(event: 'mouse-leave', listener: (event: KeyboardEvent,
/**
* The position of the event.
*/
position: Point) => void): this;
addListener(event: 'mouse-leave', listener: (event: KeyboardEvent,
/**
* The position of the event.
*/
position: Point) => void): this;
removeListener(event: 'mouse-leave', listener: (event: KeyboardEvent,
/**
* The position of the event.
*/
position: Point) => void): this;
/**
* Emitted when the mouse moves in the tray icon.
*
* @platform darwin,win32
*/
on(event: 'mouse-move', listener: (event: KeyboardEvent,
/**
* The position of the event.
*/
position: Point) => void): this;
once(event: 'mouse-move', listener: (event: KeyboardEvent,
/**
* The position of the event.
*/
position: Point) => void): this;
addListener(event: 'mouse-move', listener: (event: KeyboardEvent,
/**
* The position of the event.
*/
position: Point) => void): this;
removeListener(event: 'mouse-move', listener: (event: KeyboardEvent,
/**
* The position of the event.
*/
position: Point) => void): this;
/**
* Emitted when the mouse is released from clicking the tray icon.
*
* Note: This will not be emitted if you have set a context menu for your Tray
* using `tray.setContextMenu`, as a result of macOS-level constraints.
*
* @platform darwin
*/
on(event: 'mouse-up', listener: (event: KeyboardEvent,
/**
* The position of the event.
*/
position: Point) => void): this;
once(event: 'mouse-up', listener: (event: KeyboardEvent,
/**
* The position of the event.
*/
position: Point) => void): this;
addListener(event: 'mouse-up', listener: (event: KeyboardEvent,
/**
* The position of the event.
*/
position: Point) => void): this;
removeListener(event: 'mouse-up', listener: (event: KeyboardEvent,
/**
* The position of the event.
*/
position: Point) => void): this;
/**
* Emitted when the tray icon is right clicked.
*
* @platform darwin,win32
*/
on(event: 'right-click', listener: (event: KeyboardEvent,
/**
* The bounds of tray icon.
*/
bounds: Rectangle) => void): this;
once(event: 'right-click', listener: (event: KeyboardEvent,
/**
* The bounds of tray icon.
*/
bounds: Rectangle) => void): this;
addListener(event: 'right-click', listener: (event: KeyboardEvent,
/**
* The bounds of tray icon.
*/
bounds: Rectangle) => void): this;
removeListener(event: 'right-click', listener: (event: KeyboardEvent,
/**
* The bounds of tray icon.
*/
bounds: Rectangle) => void): this;
/**
* Tray
*/
constructor(image: (NativeImage) | (string), guid?: string);
/**
* Closes an open context menu, as set by `tray.setContextMenu()`.
*
* @platform darwin,win32
*/
closeContextMenu(): void;
/**
* Destroys the tray icon immediately.
*/
destroy(): void;
/**
* Displays a tray balloon.
*
* @platform win32
*/
displayBalloon(options: DisplayBalloonOptions): void;
/**
* Returns focus to the taskbar notification area. Notification area icons should
* use this message when they have completed their UI operation. For example, if
* the icon displays a shortcut menu, but the user presses ESC to cancel it, use
* `tray.focus()` to return focus to the notification area.
*
* @platform win32
*/
focus(): void;
/**
* The `bounds` of this tray icon as `Object`.
*
* @platform darwin,win32
*/
getBounds(): Rectangle;
/**
* Whether double click events will be ignored.
*
* @platform darwin
*/
getIgnoreDoubleClickEvents(): boolean;
/**
* the title displayed next to the tray icon in the status bar
*
* @platform darwin
*/
getTitle(): string;
/**
* Whether the tray icon is destroyed.
*/
isDestroyed(): boolean;
/**
* Pops up the context menu of the tray icon. When `menu` is passed, the `menu`
* will be shown instead of the tray icon's context menu.
*
* The `position` is only available on Windows, and it is (0, 0) by default.
*
* @platform darwin,win32
*/
popUpContextMenu(menu?: Menu, position?: Point): void;
/**
* Removes a tray balloon.
*
* @platform win32
*/
removeBalloon(): void;
/**
* Sets the context menu for this icon.
*/
setContextMenu(menu: (Menu) | (null)): void;
/**
* Sets the option to ignore double click events. Ignoring these events allows you
* to detect every individual click of the tray icon.
*
* This value is set to false by default.
*
* @platform darwin
*/
setIgnoreDoubleClickEvents(ignore: boolean): void;
/**
* Sets the `image` associated with this tray icon.
*/
setImage(image: (NativeImage) | (string)): void;
/**
* Sets the `image` associated with this tray icon when pressed on macOS.
*
* @platform darwin
*/
setPressedImage(image: (NativeImage) | (string)): void;
/**
* Sets the title displayed next to the tray icon in the status bar (Support ANSI
* colors).
*
* @platform darwin
*/
setTitle(title: string, options?: TitleOptions): void;
/**
* Sets the hover text for this tray icon.
*/
setToolTip(toolTip: string): void;
}
interface UploadData {
// Docs: https://electronjs.org/docs/api/structures/upload-data
/**
* UUID of blob data. Use ses.getBlobData method to retrieve the data.
*/
blobUUID?: string;
/**
* Content being sent.
*/
bytes: Buffer;
/**
* Path of file being uploaded.
*/
file?: string;
}
interface UploadFile {
// Docs: https://electronjs.org/docs/api/structures/upload-file
/**
* Path of file to be uploaded.
*/
filePath: string;
/**
* Number of bytes to read from `offset`. Defaults to `0`.
*/
length?: number;
/**
* Last Modification time in number of seconds since the UNIX epoch. Defaults to
* `0`.
*/
modificationTime?: number;
/**
* Defaults to `0`.
*/
offset?: number;
/**
* `file`.
*/
type: 'file';
}
interface UploadRawData {
// Docs: https://electronjs.org/docs/api/structures/upload-raw-data
/**
* Data to be uploaded.
*/
bytes: Buffer;
/**
* `rawData`.
*/
type: 'rawData';
}
interface USBDevice {
// Docs: https://electronjs.org/docs/api/structures/usb-device
/**
* The device class for the communication interface supported by the device
*/
deviceClass: number;
/**
* Unique identifier for the device.
*/
deviceId: string;
/**
* The device protocol for the communication interface supported by the device
*/
deviceProtocol: number;
/**
* The device subclass for the communication interface supported by the device
*/
deviceSubclass: number;
/**
* The major version number of the device as defined by the device manufacturer.
*/
deviceVersionMajor: number;
/**
* The minor version number of the device as defined by the device manufacturer.
*/
deviceVersionMinor: number;
/**
* The subminor version number of the device as defined by the device manufacturer.
*/
deviceVersionSubminor: number;
/**
* The manufacturer name of the device.
*/
manufacturerName?: string;
/**
* The USB product ID.
*/
productId: number;
/**
* Name of the device.
*/
productName?: string;
/**
* The USB device serial number.
*/
serialNumber?: string;
/**
* The USB protocol major version supported by the device
*/
usbVersionMajor: number;
/**
* The USB protocol minor version supported by the device
*/
usbVersionMinor: number;
/**
* The USB protocol subminor version supported by the device
*/
usbVersionSubminor: number;
/**
* The USB vendor ID.
*/
vendorId: number;
}
interface UserDefaultTypes {
// Docs: https://electronjs.org/docs/api/structures/user-default-types
array: Array<unknown>;
boolean: boolean;
dictionary: Record<string, unknown>;
double: number;
float: number;
integer: number;
string: string;
url: string;
}
class UtilityProcess extends NodeEventEmitter {
// Docs: https://electronjs.org/docs/api/utility-process
static fork(modulePath: string, args?: string[], options?: ForkOptions): UtilityProcess;
/**
* Emitted after the child process ends.
*/
on(event: 'exit', listener: (
/**
* Contains the exit code for the process obtained from waitpid on posix, or
* GetExitCodeProcess on windows.
*/
code: number) => void): this;
once(event: 'exit', listener: (
/**
* Contains the exit code for the process obtained from waitpid on posix, or
* GetExitCodeProcess on windows.
*/
code: number) => void): this;
addListener(event: 'exit', listener: (
/**
* Contains the exit code for the process obtained from waitpid on posix, or
* GetExitCodeProcess on windows.
*/
code: number) => void): this;
removeListener(event: 'exit', listener: (
/**
* Contains the exit code for the process obtained from waitpid on posix, or
* GetExitCodeProcess on windows.
*/
code: number) => void): this;
/**
* Emitted when the child process sends a message using
* `process.parentPort.postMessage()`.
*/
on(event: 'message', listener: (message: any) => void): this;
once(event: 'message', listener: (message: any) => void): this;
addListener(event: 'message', listener: (message: any) => void): this;
removeListener(event: 'message', listener: (message: any) => void): this;
/**
* Emitted once the child process has spawned successfully.
*/
on(event: 'spawn', listener: Function): this;
once(event: 'spawn', listener: Function): this;
addListener(event: 'spawn', listener: Function): this;
removeListener(event: 'spawn', listener: Function): this;
/**
* Terminates the process gracefully. On POSIX, it uses SIGTERM but will ensure the
* process is reaped on exit. This function returns true if the kill is successful,
* and false otherwise.
*/
kill(): boolean;
/**
* Send a message to the child process, optionally transferring ownership of zero
* or more `MessagePortMain` objects.
*
* For example:
*/
postMessage(message: any, transfer?: MessagePortMain[]): void;
/**
* A `Integer | undefined` representing the process identifier (PID) of the child
* process. If the child process fails to spawn due to errors, then the value is
* `undefined`. When the child process exits, then the value is `undefined` after
* the `exit` event is emitted.
*/
pid: (number) | (undefined);
/**
* A `NodeJS.ReadableStream | null` that represents the child process's stderr. If
* the child was spawned with options.stdio[2] set to anything other than 'pipe',
* then this will be `null`. When the child process exits, then the value is `null`
* after the `exit` event is emitted.
*/
stderr: (NodeJS.ReadableStream) | (null);
/**
* A `NodeJS.ReadableStream | null` that represents the child process's stdout. If
* the child was spawned with options.stdio[1] set to anything other than 'pipe',
* then this will be `null`. When the child process exits, then the value is `null`
* after the `exit` event is emitted.
*/
stdout: (NodeJS.ReadableStream) | (null);
}
class WebContents extends NodeEventEmitter {
// Docs: https://electronjs.org/docs/api/web-contents
/**
* A WebContents instance with the given TargetID, or `undefined` if there is no
* WebContents associated with the given TargetID.
*
* When communicating with the Chrome DevTools Protocol, it can be useful to lookup
* a WebContents instance based on its assigned TargetID.
*/
static fromDevToolsTargetId(targetId: string): (WebContents) | (undefined);
/**
* A WebContents instance with the given WebFrameMain, or `undefined` if there is
* no WebContents associated with the given WebFrameMain.
*/
static fromFrame(frame: WebFrameMain): (WebContents) | (undefined);
/**
* A WebContents instance with the given ID, or `undefined` if there is no
* WebContents associated with the given ID.
*/
static fromId(id: number): (WebContents) | (undefined);
/**
* An array of all `WebContents` instances. This will contain web contents for all
* windows, webviews, opened devtools, and devtools extension background pages.
*/
static getAllWebContents(): WebContents[];
/**
* The web contents that is focused in this application, otherwise returns `null`.
*/
static getFocusedWebContents(): (WebContents) | (null);
/**
* Emitted when media becomes audible or inaudible.
*/
on(event: 'audio-state-changed', listener: (event: Event<WebContentsAudioStateChangedEventParams>) => void): this;
once(event: 'audio-state-changed', listener: (event: Event<WebContentsAudioStateChangedEventParams>) => void): this;
addListener(event: 'audio-state-changed', listener: (event: Event<WebContentsAudioStateChangedEventParams>) => void): this;
removeListener(event: 'audio-state-changed', listener: (event: Event<WebContentsAudioStateChangedEventParams>) => void): this;
/**
* Emitted before dispatching the `keydown` and `keyup` events in the page. Calling
* `event.preventDefault` will prevent the page `keydown`/`keyup` events and the
* menu shortcuts.
*
* To only prevent the menu shortcuts, use `setIgnoreMenuShortcuts`:
*/
on(event: 'before-input-event', listener: (event: Event,
/**
* Input properties.
*/
input: Input) => void): this;
once(event: 'before-input-event', listener: (event: Event,
/**
* Input properties.
*/
input: Input) => void): this;
addListener(event: 'before-input-event', listener: (event: Event,
/**
* Input properties.
*/
input: Input) => void): this;
removeListener(event: 'before-input-event', listener: (event: Event,
/**
* Input properties.
*/
input: Input) => void): this;
/**
* Emitted when the `WebContents` loses focus.
*/
on(event: 'blur', listener: Function): this;
once(event: 'blur', listener: Function): this;
addListener(event: 'blur', listener: Function): this;
removeListener(event: 'blur', listener: Function): this;
/**
* Emitted when failed to verify the `certificate` for `url`.
*
* The usage is the same with the `certificate-error` event of `app`.
*/
on(event: 'certificate-error', listener: (event: Event,
url: string,
/**
* The error code.
*/
error: string,
certificate: Certificate,
callback: (isTrusted: boolean) => void,
isMainFrame: boolean) => void): this;
once(event: 'certificate-error', listener: (event: Event,
url: string,
/**
* The error code.
*/
error: string,
certificate: Certificate,
callback: (isTrusted: boolean) => void,
isMainFrame: boolean) => void): this;
addListener(event: 'certificate-error', listener: (event: Event,
url: string,
/**
* The error code.
*/
error: string,
certificate: Certificate,
callback: (isTrusted: boolean) => void,
isMainFrame: boolean) => void): this;
removeListener(event: 'certificate-error', listener: (event: Event,
url: string,
/**
* The error code.
*/
error: string,
certificate: Certificate,
callback: (isTrusted: boolean) => void,
isMainFrame: boolean) => void): this;
/**
* Emitted when the associated window logs a console message.
*/
on(event: 'console-message', listener: (event: Event,
/**
* The log level, from 0 to 3. In order it matches `verbose`, `info`, `warning` and
* `error`.
*/
level: number,
/**
* The actual console message
*/
message: string,
/**
* The line number of the source that triggered this console message
*/
line: number,
sourceId: string) => void): this;
once(event: 'console-message', listener: (event: Event,
/**
* The log level, from 0 to 3. In order it matches `verbose`, `info`, `warning` and
* `error`.
*/
level: number,
/**
* The actual console message
*/
message: string,
/**
* The line number of the source that triggered this console message
*/
line: number,
sourceId: string) => void): this;
addListener(event: 'console-message', listener: (event: Event,
/**
* The log level, from 0 to 3. In order it matches `verbose`, `info`, `warning` and
* `error`.
*/
level: number,
/**
* The actual console message
*/
message: string,
/**
* The line number of the source that triggered this console message
*/
line: number,
sourceId: string) => void): this;
removeListener(event: 'console-message', listener: (event: Event,
/**
* The log level, from 0 to 3. In order it matches `verbose`, `info`, `warning` and
* `error`.
*/
level: number,
/**
* The actual console message
*/
message: string,
/**
* The line number of the source that triggered this console message
*/
line: number,
sourceId: string) => void): this;
/**
* Emitted when the page calls `window.moveTo`, `window.resizeTo` or related APIs.
*
* By default, this will move the window. To prevent that behavior, call
* `event.preventDefault()`.
*/
on(event: 'content-bounds-updated', listener: (event: Event,
/**
* requested new content bounds
*/
bounds: Rectangle) => void): this;
once(event: 'content-bounds-updated', listener: (event: Event,
/**
* requested new content bounds
*/
bounds: Rectangle) => void): this;
addListener(event: 'content-bounds-updated', listener: (event: Event,
/**
* requested new content bounds
*/
bounds: Rectangle) => void): this;
removeListener(event: 'content-bounds-updated', listener: (event: Event,
/**
* requested new content bounds
*/
bounds: Rectangle) => void): this;
/**
* Emitted when there is a new context menu that needs to be handled.
*/
on(event: 'context-menu', listener: (event: Event,
params: ContextMenuParams) => void): this;
once(event: 'context-menu', listener: (event: Event,
params: ContextMenuParams) => void): this;
addListener(event: 'context-menu', listener: (event: Event,
params: ContextMenuParams) => void): this;
removeListener(event: 'context-menu', listener: (event: Event,
params: ContextMenuParams) => void): this;
/**
* Emitted when the renderer process crashes or is killed.
*
* **Deprecated:** This event is superceded by the `render-process-gone` event
* which contains more information about why the render process disappeared. It
* isn't always because it crashed. The `killed` boolean can be replaced by
* checking `reason === 'killed'` when you switch to that event.
*
* @deprecated
*/
on(event: 'crashed', listener: (event: Event,
killed: boolean) => void): this;
once(event: 'crashed', listener: (event: Event,
killed: boolean) => void): this;
addListener(event: 'crashed', listener: (event: Event,
killed: boolean) => void): this;
removeListener(event: 'crashed', listener: (event: Event,
killed: boolean) => void): this;
/**
* Emitted when the cursor's type changes. The `type` parameter can be `pointer`,
* `crosshair`, `hand`, `text`, `wait`, `help`, `e-resize`, `n-resize`,
* `ne-resize`, `nw-resize`, `s-resize`, `se-resize`, `sw-resize`, `w-resize`,
* `ns-resize`, `ew-resize`, `nesw-resize`, `nwse-resize`, `col-resize`,
* `row-resize`, `m-panning`, `m-panning-vertical`, `m-panning-horizontal`,
* `e-panning`, `n-panning`, `ne-panning`, `nw-panning`, `s-panning`, `se-panning`,
* `sw-panning`, `w-panning`, `move`, `vertical-text`, `cell`, `context-menu`,
* `alias`, `progress`, `nodrop`, `copy`, `none`, `not-allowed`, `zoom-in`,
* `zoom-out`, `grab`, `grabbing`, `custom`, `null`, `drag-drop-none`,
* `drag-drop-move`, `drag-drop-copy`, `drag-drop-link`, `ns-no-resize`,
* `ew-no-resize`, `nesw-no-resize`, `nwse-no-resize`, or `default`.
*
* If the `type` parameter is `custom`, the `image` parameter will hold the custom
* cursor image in a `NativeImage`, and `scale`, `size` and `hotspot` will hold
* additional information about the custom cursor.
*/
on(event: 'cursor-changed', listener: (event: Event,
type: string,
image: NativeImage,
/**
* scaling factor for the custom cursor.
*/
scale: number,
/**
* the size of the `image`.
*/
size: Size,
/**
* coordinates of the custom cursor's hotspot.
*/
hotspot: Point) => void): this;
once(event: 'cursor-changed', listener: (event: Event,
type: string,
image: NativeImage,
/**
* scaling factor for the custom cursor.
*/
scale: number,
/**
* the size of the `image`.
*/
size: Size,
/**
* coordinates of the custom cursor's hotspot.
*/
hotspot: Point) => void): this;
addListener(event: 'cursor-changed', listener: (event: Event,
type: string,
image: NativeImage,
/**
* scaling factor for the custom cursor.
*/
scale: number,
/**
* the size of the `image`.
*/
size: Size,
/**
* coordinates of the custom cursor's hotspot.
*/
hotspot: Point) => void): this;
removeListener(event: 'cursor-changed', listener: (event: Event,
type: string,
image: NativeImage,
/**
* scaling factor for the custom cursor.
*/
scale: number,
/**
* the size of the `image`.
*/
size: Size,
/**
* coordinates of the custom cursor's hotspot.
*/
hotspot: Point) => void): this;
/**
* Emitted when `webContents` is destroyed.
*/
on(event: 'destroyed', listener: Function): this;
once(event: 'destroyed', listener: Function): this;
addListener(event: 'destroyed', listener: Function): this;
removeListener(event: 'destroyed', listener: Function): this;
/**
* Emitted when DevTools is closed.
*/
on(event: 'devtools-closed', listener: Function): this;
once(event: 'devtools-closed', listener: Function): this;
addListener(event: 'devtools-closed', listener: Function): this;
removeListener(event: 'devtools-closed', listener: Function): this;
/**
* Emitted when DevTools is focused / opened.
*/
on(event: 'devtools-focused', listener: Function): this;
once(event: 'devtools-focused', listener: Function): this;
addListener(event: 'devtools-focused', listener: Function): this;
removeListener(event: 'devtools-focused', listener: Function): this;
/**
* Emitted when a link is clicked in DevTools or 'Open in new tab' is selected for
* a link in its context menu.
*/
on(event: 'devtools-open-url', listener: (event: Event,
/**
* URL of the link that was clicked or selected.
*/
url: string) => void): this;
once(event: 'devtools-open-url', listener: (event: Event,
/**
* URL of the link that was clicked or selected.
*/
url: string) => void): this;
addListener(event: 'devtools-open-url', listener: (event: Event,
/**
* URL of the link that was clicked or selected.
*/
url: string) => void): this;
removeListener(event: 'devtools-open-url', listener: (event: Event,
/**
* URL of the link that was clicked or selected.
*/
url: string) => void): this;
/**
* Emitted when DevTools is opened.
*/
on(event: 'devtools-opened', listener: Function): this;
once(event: 'devtools-opened', listener: Function): this;
addListener(event: 'devtools-opened', listener: Function): this;
removeListener(event: 'devtools-opened', listener: Function): this;
/**
* Emitted when the devtools window instructs the webContents to reload
*/
on(event: 'devtools-reload-page', listener: Function): this;
once(event: 'devtools-reload-page', listener: Function): this;
addListener(event: 'devtools-reload-page', listener: Function): this;
removeListener(event: 'devtools-reload-page', listener: Function): this;
/**
* Emitted when a `<webview>` has been attached to this web contents.
*/
on(event: 'did-attach-webview', listener: (event: Event,
/**
* The guest web contents that is used by the `<webview>`.
*/
webContents: WebContents) => void): this;
once(event: 'did-attach-webview', listener: (event: Event,
/**
* The guest web contents that is used by the `<webview>`.
*/
webContents: WebContents) => void): this;
addListener(event: 'did-attach-webview', listener: (event: Event,
/**
* The guest web contents that is used by the `<webview>`.
*/
webContents: WebContents) => void): this;
removeListener(event: 'did-attach-webview', listener: (event: Event,
/**
* The guest web contents that is used by the `<webview>`.
*/
webContents: WebContents) => void): this;
/**
* Emitted when a page's theme color changes. This is usually due to encountering a
* meta tag:
*/
on(event: 'did-change-theme-color', listener: (event: Event,
/**
* Theme color is in format of '#rrggbb'. It is `null` when no theme color is set.
*/
color: (string) | (null)) => void): this;
once(event: 'did-change-theme-color', listener: (event: Event,
/**
* Theme color is in format of '#rrggbb'. It is `null` when no theme color is set.
*/
color: (string) | (null)) => void): this;
addListener(event: 'did-change-theme-color', listener: (event: Event,
/**
* Theme color is in format of '#rrggbb'. It is `null` when no theme color is set.
*/
color: (string) | (null)) => void): this;
removeListener(event: 'did-change-theme-color', listener: (event: Event,
/**
* Theme color is in format of '#rrggbb'. It is `null` when no theme color is set.
*/
color: (string) | (null)) => void): this;
/**
* Emitted _after_ successful creation of a window via `window.open` in the
* renderer. Not emitted if the creation of the window is canceled from
* `webContents.setWindowOpenHandler`.
*
* See `window.open()` for more details and how to use this in conjunction with
* `webContents.setWindowOpenHandler`.
*/
on(event: 'did-create-window', listener: (window: BrowserWindow,
details: DidCreateWindowDetails) => void): this;
once(event: 'did-create-window', listener: (window: BrowserWindow,
details: DidCreateWindowDetails) => void): this;
addListener(event: 'did-create-window', listener: (window: BrowserWindow,
details: DidCreateWindowDetails) => void): this;
removeListener(event: 'did-create-window', listener: (window: BrowserWindow,
details: DidCreateWindowDetails) => void): this;
/**
* This event is like `did-finish-load` but emitted when the load failed. The full
* list of error codes and their meaning is available here.
*/
on(event: 'did-fail-load', listener: (event: Event,
errorCode: number,
errorDescription: string,
validatedURL: string,
isMainFrame: boolean,
frameProcessId: number,
frameRoutingId: number) => void): this;
once(event: 'did-fail-load', listener: (event: Event,
errorCode: number,
errorDescription: string,
validatedURL: string,
isMainFrame: boolean,
frameProcessId: number,
frameRoutingId: number) => void): this;
addListener(event: 'did-fail-load', listener: (event: Event,
errorCode: number,
errorDescription: string,
validatedURL: string,
isMainFrame: boolean,
frameProcessId: number,
frameRoutingId: number) => void): this;
removeListener(event: 'did-fail-load', listener: (event: Event,
errorCode: number,
errorDescription: string,
validatedURL: string,
isMainFrame: boolean,
frameProcessId: number,
frameRoutingId: number) => void): this;
/**
* This event is like `did-fail-load` but emitted when the load was cancelled (e.g.
* `window.stop()` was invoked).
*/
on(event: 'did-fail-provisional-load', listener: (event: Event,
errorCode: number,
errorDescription: string,
validatedURL: string,
isMainFrame: boolean,
frameProcessId: number,
frameRoutingId: number) => void): this;
once(event: 'did-fail-provisional-load', listener: (event: Event,
errorCode: number,
errorDescription: string,
validatedURL: string,
isMainFrame: boolean,
frameProcessId: number,
frameRoutingId: number) => void): this;
addListener(event: 'did-fail-provisional-load', listener: (event: Event,
errorCode: number,
errorDescription: string,
validatedURL: string,
isMainFrame: boolean,
frameProcessId: number,
frameRoutingId: number) => void): this;
removeListener(event: 'did-fail-provisional-load', listener: (event: Event,
errorCode: number,
errorDescription: string,
validatedURL: string,
isMainFrame: boolean,
frameProcessId: number,
frameRoutingId: number) => void): this;
/**
* Emitted when the navigation is done, i.e. the spinner of the tab has stopped
* spinning, and the `onload` event was dispatched.
*/
on(event: 'did-finish-load', listener: Function): this;
once(event: 'did-finish-load', listener: Function): this;
addListener(event: 'did-finish-load', listener: Function): this;
removeListener(event: 'did-finish-load', listener: Function): this;
/**
* Emitted when a frame has done navigation.
*/
on(event: 'did-frame-finish-load', listener: (event: Event,
isMainFrame: boolean,
frameProcessId: number,
frameRoutingId: number) => void): this;
once(event: 'did-frame-finish-load', listener: (event: Event,
isMainFrame: boolean,
frameProcessId: number,
frameRoutingId: number) => void): this;
addListener(event: 'did-frame-finish-load', listener: (event: Event,
isMainFrame: boolean,
frameProcessId: number,
frameRoutingId: number) => void): this;
removeListener(event: 'did-frame-finish-load', listener: (event: Event,
isMainFrame: boolean,
frameProcessId: number,
frameRoutingId: number) => void): this;
/**
* Emitted when any frame navigation is done.
*
* This event is not emitted for in-page navigations, such as clicking anchor links
* or updating the `window.location.hash`. Use `did-navigate-in-page` event for
* this purpose.
*/
on(event: 'did-frame-navigate', listener: (event: Event,
url: string,
/**
* -1 for non HTTP navigations
*/
httpResponseCode: number,
/**
* empty for non HTTP navigations,
*/
httpStatusText: string,
isMainFrame: boolean,
frameProcessId: number,
frameRoutingId: number) => void): this;
once(event: 'did-frame-navigate', listener: (event: Event,
url: string,
/**
* -1 for non HTTP navigations
*/
httpResponseCode: number,
/**
* empty for non HTTP navigations,
*/
httpStatusText: string,
isMainFrame: boolean,
frameProcessId: number,
frameRoutingId: number) => void): this;
addListener(event: 'did-frame-navigate', listener: (event: Event,
url: string,
/**
* -1 for non HTTP navigations
*/
httpResponseCode: number,
/**
* empty for non HTTP navigations,
*/
httpStatusText: string,
isMainFrame: boolean,
frameProcessId: number,
frameRoutingId: number) => void): this;
removeListener(event: 'did-frame-navigate', listener: (event: Event,
url: string,
/**
* -1 for non HTTP navigations
*/
httpResponseCode: number,
/**
* empty for non HTTP navigations,
*/
httpStatusText: string,
isMainFrame: boolean,
frameProcessId: number,
frameRoutingId: number) => void): this;
/**
* Emitted when a main frame navigation is done.
*
* This event is not emitted for in-page navigations, such as clicking anchor links
* or updating the `window.location.hash`. Use `did-navigate-in-page` event for
* this purpose.
*/
on(event: 'did-navigate', listener: (event: Event,
url: string,
/**
* -1 for non HTTP navigations
*/
httpResponseCode: number,
/**
* empty for non HTTP navigations
*/
httpStatusText: string) => void): this;
once(event: 'did-navigate', listener: (event: Event,
url: string,
/**
* -1 for non HTTP navigations
*/
httpResponseCode: number,
/**
* empty for non HTTP navigations
*/
httpStatusText: string) => void): this;
addListener(event: 'did-navigate', listener: (event: Event,
url: string,
/**
* -1 for non HTTP navigations
*/
httpResponseCode: number,
/**
* empty for non HTTP navigations
*/
httpStatusText: string) => void): this;
removeListener(event: 'did-navigate', listener: (event: Event,
url: string,
/**
* -1 for non HTTP navigations
*/
httpResponseCode: number,
/**
* empty for non HTTP navigations
*/
httpStatusText: string) => void): this;
/**
* Emitted when an in-page navigation happened in any frame.
*
* When in-page navigation happens, the page URL changes but does not cause
* navigation outside of the page. Examples of this occurring are when anchor links
* are clicked or when the DOM `hashchange` event is triggered.
*/
on(event: 'did-navigate-in-page', listener: (event: Event,
url: string,
isMainFrame: boolean,
frameProcessId: number,
frameRoutingId: number) => void): this;
once(event: 'did-navigate-in-page', listener: (event: Event,
url: string,
isMainFrame: boolean,
frameProcessId: number,
frameRoutingId: number) => void): this;
addListener(event: 'did-navigate-in-page', listener: (event: Event,
url: string,
isMainFrame: boolean,
frameProcessId: number,
frameRoutingId: number) => void): this;
removeListener(event: 'did-navigate-in-page', listener: (event: Event,
url: string,
isMainFrame: boolean,
frameProcessId: number,
frameRoutingId: number) => void): this;
/**
* Emitted after a server side redirect occurs during navigation. For example a
* 302 redirect.
*
* This event cannot be prevented, if you want to prevent redirects you should
* checkout out the `will-redirect` event above.
*/
on(event: 'did-redirect-navigation', listener: (details: Event<WebContentsDidRedirectNavigationEventParams>,
/**
* @deprecated
*/
url: string,
/**
* @deprecated
*/
isInPlace: boolean,
/**
* @deprecated
*/
isMainFrame: boolean,
/**
* @deprecated
*/
frameProcessId: number,
/**
* @deprecated
*/
frameRoutingId: number) => void): this;
once(event: 'did-redirect-navigation', listener: (details: Event<WebContentsDidRedirectNavigationEventParams>,
/**
* @deprecated
*/
url: string,
/**
* @deprecated
*/
isInPlace: boolean,
/**
* @deprecated
*/
isMainFrame: boolean,
/**
* @deprecated
*/
frameProcessId: number,
/**
* @deprecated
*/
frameRoutingId: number) => void): this;
addListener(event: 'did-redirect-navigation', listener: (details: Event<WebContentsDidRedirectNavigationEventParams>,
/**
* @deprecated
*/
url: string,
/**
* @deprecated
*/
isInPlace: boolean,
/**
* @deprecated
*/
isMainFrame: boolean,
/**
* @deprecated
*/
frameProcessId: number,
/**
* @deprecated
*/
frameRoutingId: number) => void): this;
removeListener(event: 'did-redirect-navigation', listener: (details: Event<WebContentsDidRedirectNavigationEventParams>,
/**
* @deprecated
*/
url: string,
/**
* @deprecated
*/
isInPlace: boolean,
/**
* @deprecated
*/
isMainFrame: boolean,
/**
* @deprecated
*/
frameProcessId: number,
/**
* @deprecated
*/
frameRoutingId: number) => void): this;
/**
* Corresponds to the points in time when the spinner of the tab started spinning.
*/
on(event: 'did-start-loading', listener: Function): this;
once(event: 'did-start-loading', listener: Function): this;
addListener(event: 'did-start-loading', listener: Function): this;
removeListener(event: 'did-start-loading', listener: Function): this;
/**
* Emitted when any frame (including main) starts navigating.
*/
on(event: 'did-start-navigation', listener: (details: Event<WebContentsDidStartNavigationEventParams>,
/**
* @deprecated
*/
url: string,
/**
* @deprecated
*/
isInPlace: boolean,
/**
* @deprecated
*/
isMainFrame: boolean,
/**
* @deprecated
*/
frameProcessId: number,
/**
* @deprecated
*/
frameRoutingId: number) => void): this;
once(event: 'did-start-navigation', listener: (details: Event<WebContentsDidStartNavigationEventParams>,
/**
* @deprecated
*/
url: string,
/**
* @deprecated
*/
isInPlace: boolean,
/**
* @deprecated
*/
isMainFrame: boolean,
/**
* @deprecated
*/
frameProcessId: number,
/**
* @deprecated
*/
frameRoutingId: number) => void): this;
addListener(event: 'did-start-navigation', listener: (details: Event<WebContentsDidStartNavigationEventParams>,
/**
* @deprecated
*/
url: string,
/**
* @deprecated
*/
isInPlace: boolean,
/**
* @deprecated
*/
isMainFrame: boolean,
/**
* @deprecated
*/
frameProcessId: number,
/**
* @deprecated
*/
frameRoutingId: number) => void): this;
removeListener(event: 'did-start-navigation', listener: (details: Event<WebContentsDidStartNavigationEventParams>,
/**
* @deprecated
*/
url: string,
/**
* @deprecated
*/
isInPlace: boolean,
/**
* @deprecated
*/
isMainFrame: boolean,
/**
* @deprecated
*/
frameProcessId: number,
/**
* @deprecated
*/
frameRoutingId: number) => void): this;
/**
* Corresponds to the points in time when the spinner of the tab stopped spinning.
*/
on(event: 'did-stop-loading', listener: Function): this;
once(event: 'did-stop-loading', listener: Function): this;
addListener(event: 'did-stop-loading', listener: Function): this;
removeListener(event: 'did-stop-loading', listener: Function): this;
/**
* Emitted when the document in the top-level frame is loaded.
*/
on(event: 'dom-ready', listener: Function): this;
once(event: 'dom-ready', listener: Function): this;
addListener(event: 'dom-ready', listener: Function): this;
removeListener(event: 'dom-ready', listener: Function): this;
/**
* Emitted when the window enters a full-screen state triggered by HTML API.
*/
on(event: 'enter-html-full-screen', listener: Function): this;
once(event: 'enter-html-full-screen', listener: Function): this;
addListener(event: 'enter-html-full-screen', listener: Function): this;
removeListener(event: 'enter-html-full-screen', listener: Function): this;
/**
* Emitted when the `WebContents` gains focus.
*
* Note that on macOS, having focus means the `WebContents` is the first responder
* of window, so switching focus between windows would not trigger the `focus` and
* `blur` events of `WebContents`, as the first responder of each window is not
* changed.
*
* The `focus` and `blur` events of `WebContents` should only be used to detect
* focus change between different `WebContents` and `BrowserView` in the same
* window.
*/
on(event: 'focus', listener: Function): this;
once(event: 'focus', listener: Function): this;
addListener(event: 'focus', listener: Function): this;
removeListener(event: 'focus', listener: Function): this;
/**
* Emitted when a result is available for `webContents.findInPage` request.
*/
on(event: 'found-in-page', listener: (event: Event,
result: Result) => void): this;
once(event: 'found-in-page', listener: (event: Event,
result: Result) => void): this;
addListener(event: 'found-in-page', listener: (event: Event,
result: Result) => void): this;
removeListener(event: 'found-in-page', listener: (event: Event,
result: Result) => void): this;
/**
* Emitted when the mainFrame, an `<iframe>`, or a nested `<iframe>` is loaded
* within the page.
*/
on(event: 'frame-created', listener: (event: Event,
details: FrameCreatedDetails) => void): this;
once(event: 'frame-created', listener: (event: Event,
details: FrameCreatedDetails) => void): this;
addListener(event: 'frame-created', listener: (event: Event,
details: FrameCreatedDetails) => void): this;
removeListener(event: 'frame-created', listener: (event: Event,
details: FrameCreatedDetails) => void): this;
/**
* Emitted when an input event is sent to the WebContents. See InputEvent for
* details.
*/
on(event: 'input-event', listener: (event: Event,
inputEvent: InputEvent) => void): this;
once(event: 'input-event', listener: (event: Event,
inputEvent: InputEvent) => void): this;
addListener(event: 'input-event', listener: (event: Event,
inputEvent: InputEvent) => void): this;
removeListener(event: 'input-event', listener: (event: Event,
inputEvent: InputEvent) => void): this;
/**
* Emitted when the renderer process sends an asynchronous message via
* `ipcRenderer.send()`.
*
* See also `webContents.ipc`, which provides an `IpcMain`-like interface for
* responding to IPC messages specifically from this WebContents.
*/
on(event: 'ipc-message', listener: (event: IpcMainEvent,
channel: string,
...args: any[]) => void): this;
once(event: 'ipc-message', listener: (event: IpcMainEvent,
channel: string,
...args: any[]) => void): this;
addListener(event: 'ipc-message', listener: (event: IpcMainEvent,
channel: string,
...args: any[]) => void): this;
removeListener(event: 'ipc-message', listener: (event: IpcMainEvent,
channel: string,
...args: any[]) => void): this;
/**
* Emitted when the renderer process sends a synchronous message via
* `ipcRenderer.sendSync()`.
*
* See also `webContents.ipc`, which provides an `IpcMain`-like interface for
* responding to IPC messages specifically from this WebContents.
*/
on(event: 'ipc-message-sync', listener: (event: IpcMainEvent,
channel: string,
...args: any[]) => void): this;
once(event: 'ipc-message-sync', listener: (event: IpcMainEvent,
channel: string,
...args: any[]) => void): this;
addListener(event: 'ipc-message-sync', listener: (event: IpcMainEvent,
channel: string,
...args: any[]) => void): this;
removeListener(event: 'ipc-message-sync', listener: (event: IpcMainEvent,
channel: string,
...args: any[]) => void): this;
/**
* Emitted when the window leaves a full-screen state triggered by HTML API.
*/
on(event: 'leave-html-full-screen', listener: Function): this;
once(event: 'leave-html-full-screen', listener: Function): this;
addListener(event: 'leave-html-full-screen', listener: Function): this;
removeListener(event: 'leave-html-full-screen', listener: Function): this;
/**
* Emitted when `webContents` wants to do basic auth.
*
* The usage is the same with the `login` event of `app`.
*/
on(event: 'login', listener: (event: Event,
authenticationResponseDetails: AuthenticationResponseDetails,
authInfo: AuthInfo,
callback: (username?: string, password?: string) => void) => void): this;
once(event: 'login', listener: (event: Event,
authenticationResponseDetails: AuthenticationResponseDetails,
authInfo: AuthInfo,
callback: (username?: string, password?: string) => void) => void): this;
addListener(event: 'login', listener: (event: Event,
authenticationResponseDetails: AuthenticationResponseDetails,
authInfo: AuthInfo,
callback: (username?: string, password?: string) => void) => void): this;
removeListener(event: 'login', listener: (event: Event,
authenticationResponseDetails: AuthenticationResponseDetails,
authInfo: AuthInfo,
callback: (username?: string, password?: string) => void) => void): this;
/**
* Emitted when media is paused or done playing.
*/
on(event: 'media-paused', listener: Function): this;
once(event: 'media-paused', listener: Function): this;
addListener(event: 'media-paused', listener: Function): this;
removeListener(event: 'media-paused', listener: Function): this;
/**
* Emitted when media starts playing.
*/
on(event: 'media-started-playing', listener: Function): this;
once(event: 'media-started-playing', listener: Function): this;
addListener(event: 'media-started-playing', listener: Function): this;
removeListener(event: 'media-started-playing', listener: Function): this;
/**
* Emitted when page receives favicon urls.
*/
on(event: 'page-favicon-updated', listener: (event: Event,
/**
* Array of URLs.
*/
favicons: string[]) => void): this;
once(event: 'page-favicon-updated', listener: (event: Event,
/**
* Array of URLs.
*/
favicons: string[]) => void): this;
addListener(event: 'page-favicon-updated', listener: (event: Event,
/**
* Array of URLs.
*/
favicons: string[]) => void): this;
removeListener(event: 'page-favicon-updated', listener: (event: Event,
/**
* Array of URLs.
*/
favicons: string[]) => void): this;
/**
* Fired when page title is set during navigation. `explicitSet` is false when
* title is synthesized from file url.
*/
on(event: 'page-title-updated', listener: (event: Event,
title: string,
explicitSet: boolean) => void): this;
once(event: 'page-title-updated', listener: (event: Event,
title: string,
explicitSet: boolean) => void): this;
addListener(event: 'page-title-updated', listener: (event: Event,
title: string,
explicitSet: boolean) => void): this;
removeListener(event: 'page-title-updated', listener: (event: Event,
title: string,
explicitSet: boolean) => void): this;
/**
* Emitted when a new frame is generated. Only the dirty area is passed in the
* buffer.
*/
on(event: 'paint', listener: (event: Event,
dirtyRect: Rectangle,
/**
* The image data of the whole frame.
*/
image: NativeImage) => void): this;
once(event: 'paint', listener: (event: Event,
dirtyRect: Rectangle,
/**
* The image data of the whole frame.
*/
image: NativeImage) => void): this;
addListener(event: 'paint', listener: (event: Event,
dirtyRect: Rectangle,
/**
* The image data of the whole frame.
*/
image: NativeImage) => void): this;
removeListener(event: 'paint', listener: (event: Event,
dirtyRect: Rectangle,
/**
* The image data of the whole frame.
*/
image: NativeImage) => void): this;
/**
* Emitted when a plugin process has crashed.
*/
on(event: 'plugin-crashed', listener: (event: Event,
name: string,
version: string) => void): this;
once(event: 'plugin-crashed', listener: (event: Event,
name: string,
version: string) => void): this;
addListener(event: 'plugin-crashed', listener: (event: Event,
name: string,
version: string) => void): this;
removeListener(event: 'plugin-crashed', listener: (event: Event,
name: string,
version: string) => void): this;
/**
* Emitted when the `WebContents` preferred size has changed.
*
* This event will only be emitted when `enablePreferredSizeMode` is set to `true`
* in `webPreferences`.
*/
on(event: 'preferred-size-changed', listener: (event: Event,
/**
* The minimum size needed to contain the layout of the document—without requiring
* scrolling.
*/
preferredSize: Size) => void): this;
once(event: 'preferred-size-changed', listener: (event: Event,
/**
* The minimum size needed to contain the layout of the document—without requiring
* scrolling.
*/
preferredSize: Size) => void): this;
addListener(event: 'preferred-size-changed', listener: (event: Event,
/**
* The minimum size needed to contain the layout of the document—without requiring
* scrolling.
*/
preferredSize: Size) => void): this;
removeListener(event: 'preferred-size-changed', listener: (event: Event,
/**
* The minimum size needed to contain the layout of the document—without requiring
* scrolling.
*/
preferredSize: Size) => void): this;
/**
* Emitted when the preload script `preloadPath` throws an unhandled exception
* `error`.
*/
on(event: 'preload-error', listener: (event: Event,
preloadPath: string,
error: Error) => void): this;
once(event: 'preload-error', listener: (event: Event,
preloadPath: string,
error: Error) => void): this;
addListener(event: 'preload-error', listener: (event: Event,
preloadPath: string,
error: Error) => void): this;
removeListener(event: 'preload-error', listener: (event: Event,
preloadPath: string,
error: Error) => void): this;
/**
* Emitted when the renderer process unexpectedly disappears. This is normally
* because it was crashed or killed.
*/
on(event: 'render-process-gone', listener: (event: Event,
details: RenderProcessGoneDetails) => void): this;
once(event: 'render-process-gone', listener: (event: Event,
details: RenderProcessGoneDetails) => void): this;
addListener(event: 'render-process-gone', listener: (event: Event,
details: RenderProcessGoneDetails) => void): this;
removeListener(event: 'render-process-gone', listener: (event: Event,
details: RenderProcessGoneDetails) => void): this;
/**
* Emitted when the unresponsive web page becomes responsive again.
*/
on(event: 'responsive', listener: Function): this;
once(event: 'responsive', listener: Function): this;
addListener(event: 'responsive', listener: Function): this;
removeListener(event: 'responsive', listener: Function): this;
/**
* Emitted when a bluetooth device needs to be selected when a call to
* `navigator.bluetooth.requestDevice` is made. `callback` should be called with
* the `deviceId` of the device to be selected. Passing an empty string to
* `callback` will cancel the request.
*
* If an event listener is not added for this event, or if `event.preventDefault`
* is not called when handling this event, the first available device will be
* automatically selected.
*
* Due to the nature of bluetooth, scanning for devices when
* `navigator.bluetooth.requestDevice` is called may take time and will cause
* `select-bluetooth-device` to fire multiple times until `callback` is called with
* either a device id or an empty string to cancel the request.
*/
on(event: 'select-bluetooth-device', listener: (event: Event,
devices: BluetoothDevice[],
callback: (deviceId: string) => void) => void): this;
once(event: 'select-bluetooth-device', listener: (event: Event,
devices: BluetoothDevice[],
callback: (deviceId: string) => void) => void): this;
addListener(event: 'select-bluetooth-device', listener: (event: Event,
devices: BluetoothDevice[],
callback: (deviceId: string) => void) => void): this;
removeListener(event: 'select-bluetooth-device', listener: (event: Event,
devices: BluetoothDevice[],
callback: (deviceId: string) => void) => void): this;
/**
* Emitted when a client certificate is requested.
*
* The usage is the same with the `select-client-certificate` event of `app`.
*/
on(event: 'select-client-certificate', listener: (event: Event,
url: string,
certificateList: Certificate[],
callback: (certificate: Certificate) => void) => void): this;
once(event: 'select-client-certificate', listener: (event: Event,
url: string,
certificateList: Certificate[],
callback: (certificate: Certificate) => void) => void): this;
addListener(event: 'select-client-certificate', listener: (event: Event,
url: string,
certificateList: Certificate[],
callback: (certificate: Certificate) => void) => void): this;
removeListener(event: 'select-client-certificate', listener: (event: Event,
url: string,
certificateList: Certificate[],
callback: (certificate: Certificate) => void) => void): this;
/**
* Emitted when the web page becomes unresponsive.
*/
on(event: 'unresponsive', listener: Function): this;
once(event: 'unresponsive', listener: Function): this;
addListener(event: 'unresponsive', listener: Function): this;
removeListener(event: 'unresponsive', listener: Function): this;
/**
* Emitted when mouse moves over a link or the keyboard moves the focus to a link.
*/
on(event: 'update-target-url', listener: (event: Event,
url: string) => void): this;
once(event: 'update-target-url', listener: (event: Event,
url: string) => void): this;
addListener(event: 'update-target-url', listener: (event: Event,
url: string) => void): this;
removeListener(event: 'update-target-url', listener: (event: Event,
url: string) => void): this;
/**
* Emitted when a `<webview>`'s web contents is being attached to this web
* contents. Calling `event.preventDefault()` will destroy the guest page.
*
* This event can be used to configure `webPreferences` for the `webContents` of a
* `<webview>` before it's loaded, and provides the ability to set settings that
* can't be set via `<webview>` attributes.
*/
on(event: 'will-attach-webview', listener: (event: Event,
/**
* The web preferences that will be used by the guest page. This object can be
* modified to adjust the preferences for the guest page.
*/
webPreferences: WebPreferences,
/**
* The other `<webview>` parameters such as the `src` URL. This object can be
* modified to adjust the parameters of the guest page.
*/
params: Record<string, string>) => void): this;
once(event: 'will-attach-webview', listener: (event: Event,
/**
* The web preferences that will be used by the guest page. This object can be
* modified to adjust the preferences for the guest page.
*/
webPreferences: WebPreferences,
/**
* The other `<webview>` parameters such as the `src` URL. This object can be
* modified to adjust the parameters of the guest page.
*/
params: Record<string, string>) => void): this;
addListener(event: 'will-attach-webview', listener: (event: Event,
/**
* The web preferences that will be used by the guest page. This object can be
* modified to adjust the preferences for the guest page.
*/
webPreferences: WebPreferences,
/**
* The other `<webview>` parameters such as the `src` URL. This object can be
* modified to adjust the parameters of the guest page.
*/
params: Record<string, string>) => void): this;
removeListener(event: 'will-attach-webview', listener: (event: Event,
/**
* The web preferences that will be used by the guest page. This object can be
* modified to adjust the preferences for the guest page.
*/
webPreferences: WebPreferences,
/**
* The other `<webview>` parameters such as the `src` URL. This object can be
* modified to adjust the parameters of the guest page.
*/
params: Record<string, string>) => void): this;
/**
* Emitted when a user or the page wants to start navigation in any frame. It can
* happen when the `window.location` object is changed or a user clicks a link in
* the page.
*
* Unlike `will-navigate`, `will-frame-navigate` is fired when the main frame or
* any of its subframes attempts to navigate. When the navigation event comes from
* the main frame, `isMainFrame` will be `true`.
*
* This event will not emit when the navigation is started programmatically with
* APIs like `webContents.loadURL` and `webContents.back`.
*
* It is also not emitted for in-page navigations, such as clicking anchor links or
* updating the `window.location.hash`. Use `did-navigate-in-page` event for this
* purpose.
*
* Calling `event.preventDefault()` will prevent the navigation.
*/
on(event: 'will-frame-navigate', listener: (details: Event<WebContentsWillFrameNavigateEventParams>) => void): this;
once(event: 'will-frame-navigate', listener: (details: Event<WebContentsWillFrameNavigateEventParams>) => void): this;
addListener(event: 'will-frame-navigate', listener: (details: Event<WebContentsWillFrameNavigateEventParams>) => void): this;
removeListener(event: 'will-frame-navigate', listener: (details: Event<WebContentsWillFrameNavigateEventParams>) => void): this;
/**
* Emitted when a user or the page wants to start navigation on the main frame. It
* can happen when the `window.location` object is changed or a user clicks a link
* in the page.
*
* This event will not emit when the navigation is started programmatically with
* APIs like `webContents.loadURL` and `webContents.back`.
*
* It is also not emitted for in-page navigations, such as clicking anchor links or
* updating the `window.location.hash`. Use `did-navigate-in-page` event for this
* purpose.
*
* Calling `event.preventDefault()` will prevent the navigation.
*/
on(event: 'will-navigate', listener: (details: Event<WebContentsWillNavigateEventParams>,
/**
* @deprecated
*/
url: string,
/**
* @deprecated
*/
isInPlace: boolean,
/**
* @deprecated
*/
isMainFrame: boolean,
/**
* @deprecated
*/
frameProcessId: number,
/**
* @deprecated
*/
frameRoutingId: number) => void): this;
once(event: 'will-navigate', listener: (details: Event<WebContentsWillNavigateEventParams>,
/**
* @deprecated
*/
url: string,
/**
* @deprecated
*/
isInPlace: boolean,
/**
* @deprecated
*/
isMainFrame: boolean,
/**
* @deprecated
*/
frameProcessId: number,
/**
* @deprecated
*/
frameRoutingId: number) => void): this;
addListener(event: 'will-navigate', listener: (details: Event<WebContentsWillNavigateEventParams>,
/**
* @deprecated
*/
url: string,
/**
* @deprecated
*/
isInPlace: boolean,
/**
* @deprecated
*/
isMainFrame: boolean,
/**
* @deprecated
*/
frameProcessId: number,
/**
* @deprecated
*/
frameRoutingId: number) => void): this;
removeListener(event: 'will-navigate', listener: (details: Event<WebContentsWillNavigateEventParams>,
/**
* @deprecated
*/
url: string,
/**
* @deprecated
*/
isInPlace: boolean,
/**
* @deprecated
*/
isMainFrame: boolean,
/**
* @deprecated
*/
frameProcessId: number,
/**
* @deprecated
*/
frameRoutingId: number) => void): this;
/**
* Emitted when a `beforeunload` event handler is attempting to cancel a page
* unload.
*
* Calling `event.preventDefault()` will ignore the `beforeunload` event handler
* and allow the page to be unloaded.
*
* **Note:** This will be emitted for `BrowserViews` but will _not_ be respected -
* this is because we have chosen not to tie the `BrowserView` lifecycle to its
* owning BrowserWindow should one exist per the specification.
*/
on(event: 'will-prevent-unload', listener: (event: Event) => void): this;
once(event: 'will-prevent-unload', listener: (event: Event) => void): this;
addListener(event: 'will-prevent-unload', listener: (event: Event) => void): this;
removeListener(event: 'will-prevent-unload', listener: (event: Event) => void): this;
/**
* Emitted when a server side redirect occurs during navigation. For example a 302
* redirect.
*
* This event will be emitted after `did-start-navigation` and always before the
* `did-redirect-navigation` event for the same navigation.
*
* Calling `event.preventDefault()` will prevent the navigation (not just the
* redirect).
*/
on(event: 'will-redirect', listener: (details: Event<WebContentsWillRedirectEventParams>,
/**
* @deprecated
*/
url: string,
/**
* @deprecated
*/
isInPlace: boolean,
/**
* @deprecated
*/
isMainFrame: boolean,
/**
* @deprecated
*/
frameProcessId: number,
/**
* @deprecated
*/
frameRoutingId: number) => void): this;
once(event: 'will-redirect', listener: (details: Event<WebContentsWillRedirectEventParams>,
/**
* @deprecated
*/
url: string,
/**
* @deprecated
*/
isInPlace: boolean,
/**
* @deprecated
*/
isMainFrame: boolean,
/**
* @deprecated
*/
frameProcessId: number,
/**
* @deprecated
*/
frameRoutingId: number) => void): this;
addListener(event: 'will-redirect', listener: (details: Event<WebContentsWillRedirectEventParams>,
/**
* @deprecated
*/
url: string,
/**
* @deprecated
*/
isInPlace: boolean,
/**
* @deprecated
*/
isMainFrame: boolean,
/**
* @deprecated
*/
frameProcessId: number,
/**
* @deprecated
*/
frameRoutingId: number) => void): this;
removeListener(event: 'will-redirect', listener: (details: Event<WebContentsWillRedirectEventParams>,
/**
* @deprecated
*/
url: string,
/**
* @deprecated
*/
isInPlace: boolean,
/**
* @deprecated
*/
isMainFrame: boolean,
/**
* @deprecated
*/
frameProcessId: number,
/**
* @deprecated
*/
frameRoutingId: number) => void): this;
/**
* Emitted when the user is requesting to change the zoom level using the mouse
* wheel.
*/
on(event: 'zoom-changed', listener: (event: Event,
/**
* Can be `in` or `out`.
*/
zoomDirection: ('in' | 'out')) => void): this;
once(event: 'zoom-changed', listener: (event: Event,
/**
* Can be `in` or `out`.
*/
zoomDirection: ('in' | 'out')) => void): this;
addListener(event: 'zoom-changed', listener: (event: Event,
/**
* Can be `in` or `out`.
*/
zoomDirection: ('in' | 'out')) => void): this;
removeListener(event: 'zoom-changed', listener: (event: Event,
/**
* Can be `in` or `out`.
*/
zoomDirection: ('in' | 'out')) => void): this;
/**
* Adds the specified path to DevTools workspace. Must be used after DevTools
* creation:
*/
addWorkSpace(path: string): void;
/**
* Adjusts the current text selection starting and ending points in the focused
* frame by the given amounts. A negative amount moves the selection towards the
* beginning of the document, and a positive amount moves the selection towards the
* end of the document.
*
* Example:
*
* For a call of `win.webContents.adjustSelection({ start: 1, end: 5 })`
*
* Before:
*
* <img width="487" alt="Image Before Text Selection Adjustment"
* src="../images/web-contents-text-selection-before.png"/>
*
* After:
*
* <img width="487" alt="Image After Text Selection Adjustment"
* src="../images/web-contents-text-selection-after.png"/>
*/
adjustSelection(options: AdjustSelectionOptions): void;
/**
* Begin subscribing for presentation events and captured frames, the `callback`
* will be called with `callback(image, dirtyRect)` when there is a presentation
* event.
*
* The `image` is an instance of NativeImage that stores the captured frame.
*
* The `dirtyRect` is an object with `x, y, width, height` properties that
* describes which part of the page was repainted. If `onlyDirty` is set to `true`,
* `image` will only contain the repainted area. `onlyDirty` defaults to `false`.
*/
beginFrameSubscription(onlyDirty: boolean, callback: (image: NativeImage, dirtyRect: Rectangle) => void): void;
/**
* Begin subscribing for presentation events and captured frames, the `callback`
* will be called with `callback(image, dirtyRect)` when there is a presentation
* event.
*
* The `image` is an instance of NativeImage that stores the captured frame.
*
* The `dirtyRect` is an object with `x, y, width, height` properties that
* describes which part of the page was repainted. If `onlyDirty` is set to `true`,
* `image` will only contain the repainted area. `onlyDirty` defaults to `false`.
*/
beginFrameSubscription(callback: (image: NativeImage, dirtyRect: Rectangle) => void): void;
/**
* Whether the browser can go back to previous web page.
*/
canGoBack(): boolean;
/**
* Whether the browser can go forward to next web page.
*/
canGoForward(): boolean;
/**
* Whether the web page can go to `offset`.
*/
canGoToOffset(offset: number): boolean;
/**
* Resolves with a NativeImage
*
* Captures a snapshot of the page within `rect`. Omitting `rect` will capture the
* whole visible page. The page is considered visible when its browser window is
* hidden and the capturer count is non-zero. If you would like the page to stay
* hidden, you should ensure that `stayHidden` is set to true.
*/
capturePage(rect?: Rectangle, opts?: Opts): Promise<Electron.NativeImage>;
/**
* Centers the current text selection in web page.
*/
centerSelection(): void;
/**
* Clears the navigation history.
*/
clearHistory(): void;
/**
* Closes the page, as if the web content had called `window.close()`.
*
* If the page is successfully closed (i.e. the unload is not prevented by the
* page, or `waitForBeforeUnload` is false or unspecified), the WebContents will be
* destroyed and no longer usable. The `destroyed` event will be emitted.
*/
close(opts?: CloseOpts): void;
/**
* Closes the devtools.
*/
closeDevTools(): void;
/**
* Executes the editing command `copy` in web page.
*/
copy(): void;
/**
* Copy the image at the given position to the clipboard.
*/
copyImageAt(x: number, y: number): void;
/**
* Executes the editing command `cut` in web page.
*/
cut(): void;
/**
* Executes the editing command `delete` in web page.
*/
delete(): void;
/**
* Disable device emulation enabled by `webContents.enableDeviceEmulation`.
*/
disableDeviceEmulation(): void;
/**
* Initiates a download of the resource at `url` without navigating. The
* `will-download` event of `session` will be triggered.
*/
downloadURL(url: string, options?: DownloadURLOptions): void;
/**
* Enable device emulation with the given parameters.
*/
enableDeviceEmulation(parameters: Parameters): void;
/**
* End subscribing for frame presentation events.
*/
endFrameSubscription(): void;
/**
* A promise that resolves with the result of the executed code or is rejected if
* the result of the code is a rejected promise.
*
* Evaluates `code` in page.
*
* In the browser window some HTML APIs like `requestFullScreen` can only be
* invoked by a gesture from the user. Setting `userGesture` to `true` will remove
* this limitation.
*
* Code execution will be suspended until web page stop loading.
*/
executeJavaScript(code: string, userGesture?: boolean): Promise<any>;
/**
* A promise that resolves with the result of the executed code or is rejected if
* the result of the code is a rejected promise.
*
* Works like `executeJavaScript` but evaluates `scripts` in an isolated context.
*/
executeJavaScriptInIsolatedWorld(worldId: number, scripts: WebSource[], userGesture?: boolean): Promise<any>;
/**
* The request id used for the request.
*
* Starts a request to find all matches for the `text` in the web page. The result
* of the request can be obtained by subscribing to `found-in-page` event.
*/
findInPage(text: string, options?: FindInPageOptions): number;
/**
* Focuses the web page.
*/
focus(): void;
/**
* Forcefully terminates the renderer process that is currently hosting this
* `webContents`. This will cause the `render-process-gone` event to be emitted
* with the `reason=killed || reason=crashed`. Please note that some webContents
* share renderer processes and therefore calling this method may also crash the
* host process for other webContents as well.
*
* Calling `reload()` immediately after calling this method will force the reload
* to occur in a new process. This should be used when this process is unstable or
* unusable, for instance in order to recover from the `unresponsive` event.
*/
forcefullyCrashRenderer(): void;
/**
* Information about all Shared Workers.
*/
getAllSharedWorkers(): SharedWorkerInfo[];
/**
* whether or not this WebContents will throttle animations and timers when the
* page becomes backgrounded. This also affects the Page Visibility API.
*/
getBackgroundThrottling(): boolean;
/**
* the current title of the DevTools window. This will only be visible if DevTools
* is opened in `undocked` or `detach` mode.
*/
getDevToolsTitle(): string;
/**
* If _offscreen rendering_ is enabled returns the current frame rate.
*/
getFrameRate(): number;
/**
* The identifier of a WebContents stream. This identifier can be used with
* `navigator.mediaDevices.getUserMedia` using a `chromeMediaSource` of `tab`. The
* identifier is restricted to the web contents that it is registered to and is
* only valid for 10 seconds.
*/
getMediaSourceId(requestWebContents: WebContents): string;
/**
* The operating system `pid` of the associated renderer process.
*/
getOSProcessId(): number;
/**
* Get the system printer list.
*
* Resolves with a `PrinterInfo[]`
*/
getPrintersAsync(): Promise<Electron.PrinterInfo[]>;
/**
* The Chromium internal `pid` of the associated renderer. Can be compared to the
* `frameProcessId` passed by frame specific navigation events (e.g.
* `did-frame-navigate`)
*/
getProcessId(): number;
/**
* The title of the current web page.
*/
getTitle(): string;
/**
* the type of the webContent. Can be `backgroundPage`, `window`, `browserView`,
* `remote`, `webview` or `offscreen`.
*/
getType(): ('backgroundPage' | 'window' | 'browserView' | 'remote' | 'webview' | 'offscreen');
/**
* The URL of the current web page.
*/
getURL(): string;
/**
* The user agent for this web page.
*/
getUserAgent(): string;
/**
* Returns the WebRTC IP Handling Policy.
*/
getWebRTCIPHandlingPolicy(): string;
/**
* the current zoom factor.
*/
getZoomFactor(): number;
/**
* the current zoom level.
*/
getZoomLevel(): number;
/**
* Makes the browser go back a web page.
*/
goBack(): void;
/**
* Makes the browser go forward a web page.
*/
goForward(): void;
/**
* Navigates browser to the specified absolute web page index.
*/
goToIndex(index: number): void;
/**
* Navigates to the specified offset from the "current entry".
*/
goToOffset(offset: number): void;
/**
* A promise that resolves with a key for the inserted CSS that can later be used
* to remove the CSS via `contents.removeInsertedCSS(key)`.
*
* Injects CSS into the current web page and returns a unique key for the inserted
* stylesheet.
*/
insertCSS(css: string, options?: InsertCSSOptions): Promise<string>;
/**
* Inserts `text` to the focused element.
*/
insertText(text: string): Promise<void>;
/**
* Starts inspecting element at position (`x`, `y`).
*/
inspectElement(x: number, y: number): void;
/**
* Opens the developer tools for the service worker context.
*/
inspectServiceWorker(): void;
/**
* Opens the developer tools for the shared worker context.
*/
inspectSharedWorker(): void;
/**
* Inspects the shared worker based on its ID.
*/
inspectSharedWorkerById(workerId: string): void;
/**
* Schedules a full repaint of the window this web contents is in.
*
* If _offscreen rendering_ is enabled invalidates the frame and generates a new
* one through the `'paint'` event.
*/
invalidate(): void;
/**
* Whether this page has been muted.
*/
isAudioMuted(): boolean;
/**
* Whether this page is being captured. It returns true when the capturer count is
* large then 0.
*/
isBeingCaptured(): boolean;
/**
* Whether the renderer process has crashed.
*/
isCrashed(): boolean;
/**
* Whether audio is currently playing.
*/
isCurrentlyAudible(): boolean;
/**
* Whether the web page is destroyed.
*/
isDestroyed(): boolean;
/**
* Whether the devtools view is focused .
*/
isDevToolsFocused(): boolean;
/**
* Whether the devtools is opened.
*/
isDevToolsOpened(): boolean;
/**
* Whether the web page is focused.
*/
isFocused(): boolean;
/**
* Whether web page is still loading resources.
*/
isLoading(): boolean;
/**
* Whether the main frame (and not just iframes or frames within it) is still
* loading.
*/
isLoadingMainFrame(): boolean;
/**
* Indicates whether _offscreen rendering_ is enabled.
*/
isOffscreen(): boolean;
/**
* If _offscreen rendering_ is enabled returns whether it is currently painting.
*/
isPainting(): boolean;
/**
* Whether the web page is waiting for a first-response from the main resource of
* the page.
*/
isWaitingForResponse(): boolean;
/**
* the promise will resolve when the page has finished loading (see
* `did-finish-load`), and rejects if the page fails to load (see `did-fail-load`).
*
* Loads the given file in the window, `filePath` should be a path to an HTML file
* relative to the root of your application. For instance an app structure like
* this:
*
* Would require code like this
*/
loadFile(filePath: string, options?: LoadFileOptions): Promise<void>;
/**
* the promise will resolve when the page has finished loading (see
* `did-finish-load`), and rejects if the page fails to load (see `did-fail-load`).
* A noop rejection handler is already attached, which avoids unhandled rejection
* errors.
*
* Loads the `url` in the window. The `url` must contain the protocol prefix, e.g.
* the `http://` or `file://`. If the load should bypass http cache then use the
* `pragma` header to achieve it.
*/
loadURL(url: string, options?: LoadURLOptions): Promise<void>;
/**
* Opens the devtools.
*
* When `contents` is a `<webview>` tag, the `mode` would be `detach` by default,
* explicitly passing an empty `mode` can force using last used dock state.
*
* On Windows, if Windows Control Overlay is enabled, Devtools will be opened with
* `mode: 'detach'`.
*/
openDevTools(options?: OpenDevToolsOptions): void;
/**
* Executes the editing command `paste` in web page.
*/
paste(): void;
/**
* Executes the editing command `pasteAndMatchStyle` in web page.
*/
pasteAndMatchStyle(): void;
/**
* Send a message to the renderer process, optionally transferring ownership of
* zero or more `MessagePortMain` objects.
*
* The transferred `MessagePortMain` objects will be available in the renderer
* process by accessing the `ports` property of the emitted event. When they arrive
* in the renderer, they will be native DOM `MessagePort` objects.
*
* For example:
*/
postMessage(channel: string, message: any, transfer?: MessagePortMain[]): void;
/**
* When a custom `pageSize` is passed, Chromium attempts to validate platform
* specific minimum values for `width_microns` and `height_microns`. Width and
* height must both be minimum 353 microns but may be higher on some operating
* systems.
*
* Prints window's web page. When `silent` is set to `true`, Electron will pick the
* system's default printer if `deviceName` is empty and the default settings for
* printing.
*
* Use `page-break-before: always;` CSS style to force to print to a new page.
*
* Example usage:
*/
print(options?: WebContentsPrintOptions, callback?: (success: boolean, failureReason: string) => void): void;
/**
* Resolves with the generated PDF data.
*
* Prints the window's web page as PDF.
*
* The `landscape` will be ignored if `@page` CSS at-rule is used in the web page.
*
* An example of `webContents.printToPDF`:
*
* See Page.printToPdf for more information.
*/
printToPDF(options: PrintToPDFOptions): Promise<Buffer>;
/**
* Executes the editing command `redo` in web page.
*/
redo(): void;
/**
* Reloads the current web page.
*/
reload(): void;
/**
* Reloads current page and ignores cache.
*/
reloadIgnoringCache(): void;
/**
* Resolves if the removal was successful.
*
* Removes the inserted CSS from the current web page. The stylesheet is identified
* by its key, which is returned from `contents.insertCSS(css)`.
*/
removeInsertedCSS(key: string): Promise<void>;
/**
* Removes the specified path from DevTools workspace.
*/
removeWorkSpace(path: string): void;
/**
* Executes the editing command `replace` in web page.
*/
replace(text: string): void;
/**
* Executes the editing command `replaceMisspelling` in web page.
*/
replaceMisspelling(text: string): void;
/**
* resolves if the page is saved.
*/
savePage(fullPath: string, saveType: 'HTMLOnly' | 'HTMLComplete' | 'MHTML'): Promise<void>;
/**
* Scrolls to the bottom of the current `webContents`.
*/
scrollToBottom(): void;
/**
* Scrolls to the top of the current `webContents`.
*/
scrollToTop(): void;
/**
* Executes the editing command `selectAll` in web page.
*/
selectAll(): void;
/**
* Send an asynchronous message to the renderer process via `channel`, along with
* arguments. Arguments will be serialized with the Structured Clone Algorithm,
* just like `postMessage`, so prototype chains will not be included. Sending
* Functions, Promises, Symbols, WeakMaps, or WeakSets will throw an exception.
*
* :::warning
*
* Sending non-standard JavaScript types such as DOM objects or special Electron
* objects will throw an exception.
*
* :::
*
* For additional reading, refer to Electron's IPC guide.
*/
send(channel: string, ...args: any[]): void;
/**
* Sends an input `event` to the page. **Note:** The `BrowserWindow` containing the
* contents needs to be focused for `sendInputEvent()` to work.
*/
sendInputEvent(inputEvent: (MouseInputEvent) | (MouseWheelInputEvent) | (KeyboardInputEvent)): void;
/**
* Send an asynchronous message to a specific frame in a renderer process via
* `channel`, along with arguments. Arguments will be serialized with the
* Structured Clone Algorithm, just like `postMessage`, so prototype chains will
* not be included. Sending Functions, Promises, Symbols, WeakMaps, or WeakSets
* will throw an exception.
*
* > **NOTE:** Sending non-standard JavaScript types such as DOM objects or special
* Electron objects will throw an exception.
*
* The renderer process can handle the message by listening to `channel` with the
* `ipcRenderer` module.
*
* If you want to get the `frameId` of a given renderer context you should use the
* `webFrame.routingId` value. E.g.
*
* You can also read `frameId` from all incoming IPC messages in the main process.
*/
sendToFrame(frameId: (number) | ([number, number]), channel: string, ...args: any[]): void;
/**
* Mute the audio on the current web page.
*/
setAudioMuted(muted: boolean): void;
/**
* Controls whether or not this WebContents will throttle animations and timers
* when the page becomes backgrounded. This also affects the Page Visibility API.
*/
setBackgroundThrottling(allowed: boolean): void;
/**
* Changes the title of the DevTools window to `title`. This will only be visible
* if DevTools is opened in `undocked` or `detach` mode.
*/
setDevToolsTitle(title: string): void;
/**
* Uses the `devToolsWebContents` as the target `WebContents` to show devtools.
*
* The `devToolsWebContents` must not have done any navigation, and it should not
* be used for other purposes after the call.
*
* By default Electron manages the devtools by creating an internal `WebContents`
* with native view, which developers have very limited control of. With the
* `setDevToolsWebContents` method, developers can use any `WebContents` to show
* the devtools in it, including `BrowserWindow`, `BrowserView` and `<webview>`
* tag.
*
* Note that closing the devtools does not destroy the `devToolsWebContents`, it is
* caller's responsibility to destroy `devToolsWebContents`.
*
* An example of showing devtools in a `<webview>` tag:
*
* An example of showing devtools in a `BrowserWindow`:
*/
setDevToolsWebContents(devToolsWebContents: WebContents): void;
/**
* If _offscreen rendering_ is enabled sets the frame rate to the specified number.
* Only values between 1 and 240 are accepted.
*/
setFrameRate(fps: number): void;
/**
* Ignore application menu shortcuts while this web contents is focused.
*/
setIgnoreMenuShortcuts(ignore: boolean): void;
/**
* Sets the image animation policy for this webContents. The policy only affects
* _new_ images, existing images that are currently being animated are unaffected.
* This is a known limitation in Chromium, you can force image animation to be
* recalculated with `img.src = img.src` which will result in no network traffic
* but will update the animation policy.
*
* This corresponds to the animationPolicy accessibility feature in Chromium.
*/
setImageAnimationPolicy(policy: 'animate' | 'animateOnce' | 'noAnimation'): void;
/**
* Overrides the user agent for this web page.
*/
setUserAgent(userAgent: string): void;
/**
* Sets the maximum and minimum pinch-to-zoom level.
*
* > **NOTE**: Visual zoom is disabled by default in Electron. To re-enable it,
* call:
*/
setVisualZoomLevelLimits(minimumLevel: number, maximumLevel: number): Promise<void>;
/**
* Setting the WebRTC IP handling policy allows you to control which IPs are
* exposed via WebRTC. See BrowserLeaks for more details.
*/
setWebRTCIPHandlingPolicy(policy: 'default' | 'default_public_interface_only' | 'default_public_and_private_interfaces' | 'disable_non_proxied_udp'): void;
/**
* Called before creating a window a new window is requested by the renderer, e.g.
* by `window.open()`, a link with `target="_blank"`, shift+clicking on a link, or
* submitting a form with `<form target="_blank">`. See `window.open()` for more
* details and how to use this in conjunction with `did-create-window`.
*/
setWindowOpenHandler(handler: (details: HandlerDetails) => ({action: 'deny'}) | ({action: 'allow', outlivesOpener?: boolean, overrideBrowserWindowOptions?: BrowserWindowConstructorOptions})): void;
/**
* Changes the zoom factor to the specified factor. Zoom factor is zoom percent
* divided by 100, so 300% = 3.0.
*
* The factor must be greater than 0.0.
*/
setZoomFactor(factor: number): void;
/**
* Changes the zoom level to the specified level. The original size is 0 and each
* increment above or below represents zooming 20% larger or smaller to default
* limits of 300% and 50% of original size, respectively. The formula for this is
* `scale := 1.2 ^ level`.
*
* > **NOTE**: The zoom policy at the Chromium level is same-origin, meaning that
* the zoom level for a specific domain propagates across all instances of windows
* with the same domain. Differentiating the window URLs will make zoom work
* per-window.
*/
setZoomLevel(level: number): void;
/**
* Shows pop-up dictionary that searches the selected word on the page.
*
* @platform darwin
*/
showDefinitionForSelection(): void;
/**
* Sets the `item` as dragging item for current drag-drop operation, `file` is the
* absolute path of the file to be dragged, and `icon` is the image showing under
* the cursor when dragging.
*/
startDrag(item: Item): void;
/**
* If _offscreen rendering_ is enabled and not painting, start painting.
*/
startPainting(): void;
/**
* Stops any pending navigation.
*/
stop(): void;
/**
* Stops any `findInPage` request for the `webContents` with the provided `action`.
*/
stopFindInPage(action: 'clearSelection' | 'keepSelection' | 'activateSelection'): void;
/**
* If _offscreen rendering_ is enabled and painting, stop painting.
*/
stopPainting(): void;
/**
* Indicates whether the snapshot has been created successfully.
*
* Takes a V8 heap snapshot and saves it to `filePath`.
*/
takeHeapSnapshot(filePath: string): Promise<void>;
/**
* Toggles the developer tools.
*/
toggleDevTools(): void;
/**
* Executes the editing command `undo` in web page.
*/
undo(): void;
/**
* Executes the editing command `unselect` in web page.
*/
unselect(): void;
/**
* A `boolean` property that determines whether this page is muted.
*/
audioMuted: boolean;
/**
* A `boolean` property that determines whether or not this WebContents will
* throttle animations and timers when the page becomes backgrounded. This also
* affects the Page Visibility API.
*/
backgroundThrottling: boolean;
/**
* A `Debugger` instance for this webContents.
*
*/
readonly debugger: Debugger;
/**
* A `WebContents | null` property that represents the of DevTools `WebContents`
* associated with a given `WebContents`.
*
* **Note:** Users should never store this object because it may become `null` when
* the DevTools has been closed.
*
*/
readonly devToolsWebContents: (WebContents) | (null);
/**
* An `Integer` property that sets the frame rate of the web contents to the
* specified number. Only values between 1 and 240 are accepted.
*
* Only applicable if _offscreen rendering_ is enabled.
*/
frameRate: number;
/**
* A `WebContents` instance that might own this `WebContents`.
*
*/
readonly hostWebContents: WebContents;
/**
* A `Integer` representing the unique ID of this WebContents. Each ID is unique
* among all `WebContents` instances of the entire Electron application.
*
*/
readonly id: number;
/**
* An `IpcMain` scoped to just IPC messages sent from this WebContents.
*
* IPC messages sent with `ipcRenderer.send`, `ipcRenderer.sendSync` or
* `ipcRenderer.postMessage` will be delivered in the following order:
*
* * `contents.on('ipc-message')`
* * `contents.mainFrame.on(channel)`
* * `contents.ipc.on(channel)`
* * `ipcMain.on(channel)`
*
* Handlers registered with `invoke` will be checked in the following order. The
* first one that is defined will be called, the rest will be ignored.
*
* * `contents.mainFrame.handle(channel)`
* * `contents.handle(channel)`
* * `ipcMain.handle(channel)`
*
* A handler or event listener registered on the WebContents will receive IPC
* messages sent from any frame, including child frames. In most cases, only the
* main frame can send IPC messages. However, if the `nodeIntegrationInSubFrames`
* option is enabled, it is possible for child frames to send IPC messages also. In
* that case, handlers should check the `senderFrame` property of the IPC event to
* ensure that the message is coming from the expected frame. Alternatively,
* register handlers on the appropriate frame directly using the `WebFrameMain.ipc`
* interface.
*
*/
readonly ipc: IpcMain;
/**
* A `WebFrameMain` property that represents the top frame of the page's frame
* hierarchy.
*
*/
readonly mainFrame: WebFrameMain;
/**
* A `WebFrameMain` property that represents the frame that opened this
* WebContents, either with open(), or by navigating a link with a target
* attribute.
*
*/
readonly opener: WebFrameMain;
/**
* A `Session` used by this webContents.
*
*/
readonly session: Session;
/**
* A `string` property that determines the user agent for this web page.
*/
userAgent: string;
/**
* A `number` property that determines the zoom factor for this web contents.
*
* The zoom factor is the zoom percent divided by 100, so 300% = 3.0.
*/
zoomFactor: number;
/**
* A `number` property that determines the zoom level for this web contents.
*
* The original size is 0 and each increment above or below represents zooming 20%
* larger or smaller to default limits of 300% and 50% of original size,
* respectively. The formula for this is `scale := 1.2 ^ level`.
*/
zoomLevel: number;
}
interface WebFrame {
// Docs: https://electronjs.org/docs/api/web-frame
/**
* Attempts to free memory that is no longer being used (like images from a
* previous navigation).
*
* Note that blindly calling this method probably makes Electron slower since it
* will have to refill these emptied caches, you should only call it if an event in
* your app has occurred that makes you think your page is actually using less
* memory (i.e. you have navigated from a super heavy page to a mostly empty one,
* and intend to stay there).
*/
clearCache(): void;
/**
* A promise that resolves with the result of the executed code or is rejected if
* execution throws or results in a rejected promise.
*
* Evaluates `code` in page.
*
* In the browser window some HTML APIs like `requestFullScreen` can only be
* invoked by a gesture from the user. Setting `userGesture` to `true` will remove
* this limitation.
*/
executeJavaScript(code: string, userGesture?: boolean, callback?: (result: any, error: Error) => void): Promise<any>;
/**
* A promise that resolves with the result of the executed code or is rejected if
* execution could not start.
*
* Works like `executeJavaScript` but evaluates `scripts` in an isolated context.
*
* Note that when the execution of script fails, the returned promise will not
* reject and the `result` would be `undefined`. This is because Chromium does not
* dispatch errors of isolated worlds to foreign worlds.
*/
executeJavaScriptInIsolatedWorld(worldId: number, scripts: WebSource[], userGesture?: boolean, callback?: (result: any, error: Error) => void): Promise<any>;
/**
* A child of `webFrame` with the supplied `name`, `null` would be returned if
* there's no such frame or if the frame is not in the current renderer process.
*/
findFrameByName(name: string): WebFrame;
/**
* that has the supplied `routingId`, `null` if not found.
*/
findFrameByRoutingId(routingId: number): WebFrame;
/**
* The frame element in `webFrame's` document selected by `selector`, `null` would
* be returned if `selector` does not select a frame or if the frame is not in the
* current renderer process.
*/
getFrameForSelector(selector: string): WebFrame;
/**
* * `images` MemoryUsageDetails
* * `scripts` MemoryUsageDetails
* * `cssStyleSheets` MemoryUsageDetails
* * `xslStyleSheets` MemoryUsageDetails
* * `fonts` MemoryUsageDetails
* * `other` MemoryUsageDetails
*
* Returns an object describing usage information of Blink's internal memory
* caches.
*
* This will generate:
*/
getResourceUsage(): ResourceUsage;
/**
* A list of suggested words for a given word. If the word is spelled correctly,
* the result will be empty.
*/
getWordSuggestions(word: string): string[];
/**
* The current zoom factor.
*/
getZoomFactor(): number;
/**
* The current zoom level.
*/
getZoomLevel(): number;
/**
* A key for the inserted CSS that can later be used to remove the CSS via
* `webFrame.removeInsertedCSS(key)`.
*
* Injects CSS into the current web page and returns a unique key for the inserted
* stylesheet.
*/
insertCSS(css: string, options?: InsertCSSOptions): string;
/**
* Inserts `text` to the focused element.
*/
insertText(text: string): void;
/**
* True if the word is misspelled according to the built in spellchecker, false
* otherwise. If no dictionary is loaded, always return false.
*/
isWordMisspelled(word: string): boolean;
/**
* Removes the inserted CSS from the current web page. The stylesheet is identified
* by its key, which is returned from `webFrame.insertCSS(css)`.
*/
removeInsertedCSS(key: string): void;
/**
* Set the security origin, content security policy and name of the isolated world.
* Note: If the `csp` is specified, then the `securityOrigin` also has to be
* specified.
*/
setIsolatedWorldInfo(worldId: number, info: Info): void;
/**
* Sets a provider for spell checking in input fields and text areas.
*
* If you want to use this method you must disable the builtin spellchecker when
* you construct the window.
*
* The `provider` must be an object that has a `spellCheck` method that accepts an
* array of individual words for spellchecking. The `spellCheck` function runs
* asynchronously and calls the `callback` function with an array of misspelt words
* when complete.
*
* An example of using node-spellchecker as provider:
*/
setSpellCheckProvider(language: string, provider: Provider): void;
/**
* Sets the maximum and minimum pinch-to-zoom level.
*
* > **NOTE**: Visual zoom is disabled by default in Electron. To re-enable it,
* call:
*
* > **NOTE**: Visual zoom only applies to pinch-to-zoom behavior. Cmd+/-/0 zoom
* shortcuts are controlled by the 'zoomIn', 'zoomOut', and 'resetZoom' MenuItem
* roles in the application Menu. To disable shortcuts, manually define the Menu
* and omit zoom roles from the definition.
*/
setVisualZoomLevelLimits(minimumLevel: number, maximumLevel: number): void;
/**
* Changes the zoom factor to the specified factor. Zoom factor is zoom percent
* divided by 100, so 300% = 3.0.
*
* The factor must be greater than 0.0.
*/
setZoomFactor(factor: number): void;
/**
* Changes the zoom level to the specified level. The original size is 0 and each
* increment above or below represents zooming 20% larger or smaller to default
* limits of 300% and 50% of original size, respectively.
*
* > **NOTE**: The zoom policy at the Chromium level is same-origin, meaning that
* the zoom level for a specific domain propagates across all instances of windows
* with the same domain. Differentiating the window URLs will make zoom work
* per-window.
*/
setZoomLevel(level: number): void;
/**
* A `WebFrame | null` representing the first child frame of `webFrame`, the
* property would be `null` if `webFrame` has no children or if first child is not
* in the current renderer process.
*
*/
readonly firstChild: (WebFrame) | (null);
/**
* A `WebFrame | null` representing next sibling frame, the property would be
* `null` if `webFrame` is the last frame in its parent or if the next sibling is
* not in the current renderer process.
*
*/
readonly nextSibling: (WebFrame) | (null);
/**
* A `WebFrame | null` representing the frame which opened `webFrame`, the property
* would be `null` if there's no opener or opener is not in the current renderer
* process.
*
*/
readonly opener: (WebFrame) | (null);
/**
* A `WebFrame | null` representing parent frame of `webFrame`, the property would
* be `null` if `webFrame` is top or parent is not in the current renderer process.
*
*/
readonly parent: (WebFrame) | (null);
/**
* An `Integer` representing the unique frame id in the current renderer process.
* Distinct WebFrame instances that refer to the same underlying frame will have
* the same `routingId`.
*
*/
readonly routingId: number;
/**
* A `WebFrame | null` representing top frame in frame hierarchy to which
* `webFrame` belongs, the property would be `null` if top frame is not in the
* current renderer process.
*
*/
readonly top: (WebFrame) | (null);
}
class WebFrameMain extends NodeEventEmitter {
// Docs: https://electronjs.org/docs/api/web-frame-main
/**
* A frame with the given process and routing IDs, or `undefined` if there is no
* WebFrameMain associated with the given IDs.
*/
static fromId(processId: number, routingId: number): (WebFrameMain) | (undefined);
/**
* Emitted when the document is loaded.
*/
on(event: 'dom-ready', listener: Function): this;
once(event: 'dom-ready', listener: Function): this;
addListener(event: 'dom-ready', listener: Function): this;
removeListener(event: 'dom-ready', listener: Function): this;
/**
* A promise that resolves with the result of the executed code or is rejected if
* execution throws or results in a rejected promise.
*
* Evaluates `code` in page.
*
* In the browser window some HTML APIs like `requestFullScreen` can only be
* invoked by a gesture from the user. Setting `userGesture` to `true` will remove
* this limitation.
*/
executeJavaScript(code: string, userGesture?: boolean): Promise<unknown>;
/**
* Send a message to the renderer process, optionally transferring ownership of
* zero or more `MessagePortMain` objects.
*
* The transferred `MessagePortMain` objects will be available in the renderer
* process by accessing the `ports` property of the emitted event. When they arrive
* in the renderer, they will be native DOM `MessagePort` objects.
*
* For example:
*/
postMessage(channel: string, message: any, transfer?: MessagePortMain[]): void;
/**
* Whether the reload was initiated successfully. Only results in `false` when the
* frame has no history.
*/
reload(): boolean;
/**
* Send an asynchronous message to the renderer process via `channel`, along with
* arguments. Arguments will be serialized with the Structured Clone Algorithm,
* just like `postMessage`, so prototype chains will not be included. Sending
* Functions, Promises, Symbols, WeakMaps, or WeakSets will throw an exception.
*
* The renderer process can handle the message by listening to `channel` with the
* `ipcRenderer` module.
*/
send(channel: string, ...args: any[]): void;
/**
* A `WebFrameMain[]` collection containing the direct descendents of `frame`.
*
*/
readonly frames: WebFrameMain[];
/**
* A `WebFrameMain[]` collection containing every frame in the subtree of `frame`,
* including itself. This can be useful when traversing through all frames.
*
*/
readonly framesInSubtree: WebFrameMain[];
/**
* An `Integer` representing the id of the frame's internal FrameTreeNode instance.
* This id is browser-global and uniquely identifies a frame that hosts content.
* The identifier is fixed at the creation of the frame and stays constant for the
* lifetime of the frame. When the frame is removed, the id is not used again.
*
*/
readonly frameTreeNodeId: number;
/**
* An `IpcMain` instance scoped to the frame.
*
* IPC messages sent with `ipcRenderer.send`, `ipcRenderer.sendSync` or
* `ipcRenderer.postMessage` will be delivered in the following order:
*
* * `contents.on('ipc-message')`
* * `contents.mainFrame.on(channel)`
* * `contents.ipc.on(channel)`
* * `ipcMain.on(channel)`
*
* Handlers registered with `invoke` will be checked in the following order. The
* first one that is defined will be called, the rest will be ignored.
*
* * `contents.mainFrame.handle(channel)`
* * `contents.handle(channel)`
* * `ipcMain.handle(channel)`
*
* In most cases, only the main frame of a WebContents can send or receive IPC
* messages. However, if the `nodeIntegrationInSubFrames` option is enabled, it is
* possible for child frames to send and receive IPC messages also. The
* `WebContents.ipc` interface may be more convenient when
* `nodeIntegrationInSubFrames` is not enabled.
*
*/
readonly ipc: IpcMain;
/**
* A `string` representing the frame name.
*
*/
readonly name: string;
/**
* A `string` representing the current origin of the frame, serialized according to
* RFC 6454. This may be different from the URL. For instance, if the frame is a
* child window opened to `about:blank`, then `frame.origin` will return the parent
* frame's origin, while `frame.url` will return the empty string. Pages without a
* scheme/host/port triple origin will have the serialized origin of `"null"` (that
* is, the string containing the letters n, u, l, l).
*
*/
readonly origin: string;
/**
* An `Integer` representing the operating system `pid` of the process which owns
* this frame.
*
*/
readonly osProcessId: number;
/**
* A `WebFrameMain | null` representing parent frame of `frame`, the property would
* be `null` if `frame` is the top frame in the frame hierarchy.
*
*/
readonly parent: (WebFrameMain) | (null);
/**
* An `Integer` representing the Chromium internal `pid` of the process which owns
* this frame. This is not the same as the OS process ID; to read that use
* `frame.osProcessId`.
*
*/
readonly processId: number;
/**
* An `Integer` representing the unique frame id in the current renderer process.
* Distinct `WebFrameMain` instances that refer to the same underlying frame will
* have the same `routingId`.
*
*/
readonly routingId: number;
/**
* A `WebFrameMain | null` representing top frame in the frame hierarchy to which
* `frame` belongs.
*
*/
readonly top: (WebFrameMain) | (null);
/**
* A `string` representing the current URL of the frame.
*
*/
readonly url: string;
/**
* A `string` representing the visibility state of the frame.
*
* See also how the Page Visibility API is affected by other Electron APIs.
*
*/
readonly visibilityState: string;
}
interface WebPreferences {
// Docs: https://electronjs.org/docs/api/structures/web-preferences
/**
* An alternative title string provided only to accessibility tools such as screen
* readers. This string is not directly visible to users.
*/
accessibleTitle?: string;
/**
* A list of strings that will be appended to `process.argv` in the renderer
* process of this app. Useful for passing small bits of data down to renderer
* process preload scripts.
*/
additionalArguments?: string[];
/**
* Allow an https page to run JavaScript, CSS or plugins from http URLs. Default is
* `false`.
*/
allowRunningInsecureContent?: boolean;
/**
* Autoplay policy to apply to content in the window, can be
* `no-user-gesture-required`, `user-gesture-required`,
* `document-user-activation-required`. Defaults to `no-user-gesture-required`.
*/
autoplayPolicy?: ('no-user-gesture-required' | 'user-gesture-required' | 'document-user-activation-required');
/**
* Whether to throttle animations and timers when the page becomes background. This
* also affects the Page Visibility API. Defaults to `true`.
*/
backgroundThrottling?: boolean;
/**
* Whether to run Electron APIs and the specified `preload` script in a separate
* JavaScript context. Defaults to `true`. The context that the `preload` script
* runs in will only have access to its own dedicated `document` and `window`
* globals, as well as its own set of JavaScript builtins (`Array`, `Object`,
* `JSON`, etc.), which are all invisible to the loaded content. The Electron API
* will only be available in the `preload` script and not the loaded page. This
* option should be used when loading potentially untrusted remote content to
* ensure the loaded content cannot tamper with the `preload` script and any
* Electron APIs being used. This option uses the same technique used by Chrome
* Content Scripts. You can access this context in the dev tools by selecting the
* 'Electron Isolated Context' entry in the combo box at the top of the Console
* tab.
*/
contextIsolation?: boolean;
/**
* Defaults to `ISO-8859-1`.
*/
defaultEncoding?: string;
/**
* Sets the default font for the font-family.
*/
defaultFontFamily?: DefaultFontFamily;
/**
* Defaults to `16`.
*/
defaultFontSize?: number;
/**
* Defaults to `13`.
*/
defaultMonospaceFontSize?: number;
/**
* Whether to enable DevTools. If it is set to `false`, can not use
* `BrowserWindow.webContents.openDevTools()` to open DevTools. Default is `true`.
*/
devTools?: boolean;
/**
* A list of feature strings separated by `,`, like `CSSVariables,KeyboardEventKey`
* to disable. The full list of supported feature strings can be found in the
* RuntimeEnabledFeatures.json5 file.
*/
disableBlinkFeatures?: string;
/**
* Whether to disable dialogs completely. Overrides `safeDialogs`. Default is
* `false`.
*/
disableDialogs?: boolean;
/**
* Whether to prevent the window from resizing when entering HTML Fullscreen.
* Default is `false`.
*/
disableHtmlFullscreenWindowResize?: boolean;
/**
* A list of feature strings separated by `,`, like `CSSVariables,KeyboardEventKey`
* to enable. The full list of supported feature strings can be found in the
* RuntimeEnabledFeatures.json5 file.
*/
enableBlinkFeatures?: string;
/**
* Whether to enable preferred size mode. The preferred size is the minimum size
* needed to contain the layout of the document—without requiring scrolling.
* Enabling this will cause the `preferred-size-changed` event to be emitted on the
* `WebContents` when the preferred size changes. Default is `false`.
*/
enablePreferredSizeMode?: boolean;
/**
* Whether to enable the WebSQL api. Default is `true`.
*/
enableWebSQL?: boolean;
/**
* Enables Chromium's experimental features. Default is `false`.
*/
experimentalFeatures?: boolean;
/**
* Specifies how to run image animations (E.g. GIFs). Can be `animate`,
* `animateOnce` or `noAnimation`. Default is `animate`.
*/
imageAnimationPolicy?: ('animate' | 'animateOnce' | 'noAnimation');
/**
* Enables image support. Default is `true`.
*/
images?: boolean;
/**
* Enables JavaScript support. Default is `true`.
*/
javascript?: boolean;
/**
* Defaults to `0`.
*/
minimumFontSize?: number;
/**
* Whether dragging and dropping a file or link onto the page causes a navigation.
* Default is `false`.
*/
navigateOnDragDrop?: boolean;
/**
* Whether node integration is enabled. Default is `false`.
*/
nodeIntegration?: boolean;
/**
* Experimental option for enabling Node.js support in sub-frames such as iframes
* and child windows. All your preloads will load for every iframe, you can use
* `process.isMainFrame` to determine if you are in the main frame or not.
*/
nodeIntegrationInSubFrames?: boolean;
/**
* Whether node integration is enabled in web workers. Default is `false`. More
* about this can be found in Multithreading.
*/
nodeIntegrationInWorker?: boolean;
/**
* Whether to enable offscreen rendering for the browser window. Defaults to
* `false`. See the offscreen rendering tutorial for more details.
*/
offscreen?: boolean;
/**
* Sets the session used by the page according to the session's partition string.
* If `partition` starts with `persist:`, the page will use a persistent session
* available to all pages in the app with the same `partition`. If there is no
* `persist:` prefix, the page will use an in-memory session. By assigning the same
* `partition`, multiple pages can share the same session. Default is the default
* session.
*/
partition?: string;
/**
* Whether plugins should be enabled. Default is `false`.
*/
plugins?: boolean;
/**
* Specifies a script that will be loaded before other scripts run in the page.
* This script will always have access to node APIs no matter whether node
* integration is turned on or off. The value should be the absolute file path to
* the script. When node integration is turned off, the preload script can
* reintroduce Node global symbols back to the global scope. See example here.
*/
preload?: string;
/**
* Whether to enable browser style consecutive dialog protection. Default is
* `false`.
*/
safeDialogs?: boolean;
/**
* The message to display when consecutive dialog protection is triggered. If not
* defined the default message would be used, note that currently the default
* message is in English and not localized.
*/
safeDialogsMessage?: string;
/**
* If set, this will sandbox the renderer associated with the window, making it
* compatible with the Chromium OS-level sandbox and disabling the Node.js engine.
* This is not the same as the `nodeIntegration` option and the APIs available to
* the preload script are more limited. Read more about the option here.
*/
sandbox?: boolean;
/**
* Enables scroll bounce (rubber banding) effect on macOS. Default is `false`.
*
* @platform darwin
*/
scrollBounce?: boolean;
/**
* Sets the session used by the page. Instead of passing the Session object
* directly, you can also choose to use the `partition` option instead, which
* accepts a partition string. When both `session` and `partition` are provided,
* `session` will be preferred. Default is the default session.
*/
session?: Session;
/**
* Whether to enable the builtin spellchecker. Default is `true`.
*/
spellcheck?: boolean;
/**
* Make TextArea elements resizable. Default is `true`.
*/
textAreasAreResizable?: boolean;
/**
* Enforces the v8 code caching policy used by blink. Accepted values are
*/
v8CacheOptions?: ('none' | 'code' | 'bypassHeatCheck' | 'bypassHeatCheckAndEagerCompile');
/**
* Enables WebGL support. Default is `true`.
*/
webgl?: boolean;
/**
* When `false`, it will disable the same-origin policy (usually using testing
* websites by people), and set `allowRunningInsecureContent` to `true` if this
* options has not been set by user. Default is `true`.
*/
webSecurity?: boolean;
/**
* Whether to enable the `<webview>` tag. Defaults to `false`. **Note:** The
* `preload` script configured for the `<webview>` will have node integration
* enabled when it is executed so you should ensure remote/untrusted content is not
* able to create a `<webview>` tag with a possibly malicious `preload` script. You
* can use the `will-attach-webview` event on webContents to strip away the
* `preload` script and to validate or alter the `<webview>`'s initial settings.
*/
webviewTag?: boolean;
/**
* The default zoom factor of the page, `3.0` represents `300%`. Default is `1.0`.
*/
zoomFactor?: number;
}
class WebRequest {
// Docs: https://electronjs.org/docs/api/web-request
/**
* The `listener` will be called with `listener(details)` when a server initiated
* redirect is about to occur.
*/
onBeforeRedirect(filter: WebRequestFilter, listener: ((details: OnBeforeRedirectListenerDetails) => void) | (null)): void;
/**
* The `listener` will be called with `listener(details)` when a server initiated
* redirect is about to occur.
*/
onBeforeRedirect(listener: ((details: OnBeforeRedirectListenerDetails) => void) | (null)): void;
/**
* The `listener` will be called with `listener(details, callback)` when a request
* is about to occur.
*
* The `uploadData` is an array of `UploadData` objects.
*
* The `callback` has to be called with an `response` object.
*
* Some examples of valid `urls`:
*/
onBeforeRequest(filter: WebRequestFilter, listener: ((details: OnBeforeRequestListenerDetails, callback: (response: CallbackResponse) => void) => void) | (null)): void;
/**
* The `listener` will be called with `listener(details, callback)` when a request
* is about to occur.
*
* The `uploadData` is an array of `UploadData` objects.
*
* The `callback` has to be called with an `response` object.
*
* Some examples of valid `urls`:
*/
onBeforeRequest(listener: ((details: OnBeforeRequestListenerDetails, callback: (response: CallbackResponse) => void) => void) | (null)): void;
/**
* The `listener` will be called with `listener(details, callback)` before sending
* an HTTP request, once the request headers are available. This may occur after a
* TCP connection is made to the server, but before any http data is sent.
*
* The `callback` has to be called with a `response` object.
*/
onBeforeSendHeaders(filter: WebRequestFilter, listener: ((details: OnBeforeSendHeadersListenerDetails, callback: (beforeSendResponse: BeforeSendResponse) => void) => void) | (null)): void;
/**
* The `listener` will be called with `listener(details, callback)` before sending
* an HTTP request, once the request headers are available. This may occur after a
* TCP connection is made to the server, but before any http data is sent.
*
* The `callback` has to be called with a `response` object.
*/
onBeforeSendHeaders(listener: ((details: OnBeforeSendHeadersListenerDetails, callback: (beforeSendResponse: BeforeSendResponse) => void) => void) | (null)): void;
/**
* The `listener` will be called with `listener(details)` when a request is
* completed.
*/
onCompleted(filter: WebRequestFilter, listener: ((details: OnCompletedListenerDetails) => void) | (null)): void;
/**
* The `listener` will be called with `listener(details)` when a request is
* completed.
*/
onCompleted(listener: ((details: OnCompletedListenerDetails) => void) | (null)): void;
/**
* The `listener` will be called with `listener(details)` when an error occurs.
*/
onErrorOccurred(filter: WebRequestFilter, listener: ((details: OnErrorOccurredListenerDetails) => void) | (null)): void;
/**
* The `listener` will be called with `listener(details)` when an error occurs.
*/
onErrorOccurred(listener: ((details: OnErrorOccurredListenerDetails) => void) | (null)): void;
/**
* The `listener` will be called with `listener(details, callback)` when HTTP
* response headers of a request have been received.
*
* The `callback` has to be called with a `response` object.
*/
onHeadersReceived(filter: WebRequestFilter, listener: ((details: OnHeadersReceivedListenerDetails, callback: (headersReceivedResponse: HeadersReceivedResponse) => void) => void) | (null)): void;
/**
* The `listener` will be called with `listener(details, callback)` when HTTP
* response headers of a request have been received.
*
* The `callback` has to be called with a `response` object.
*/
onHeadersReceived(listener: ((details: OnHeadersReceivedListenerDetails, callback: (headersReceivedResponse: HeadersReceivedResponse) => void) => void) | (null)): void;
/**
* The `listener` will be called with `listener(details)` when first byte of the
* response body is received. For HTTP requests, this means that the status line
* and response headers are available.
*/
onResponseStarted(filter: WebRequestFilter, listener: ((details: OnResponseStartedListenerDetails) => void) | (null)): void;
/**
* The `listener` will be called with `listener(details)` when first byte of the
* response body is received. For HTTP requests, this means that the status line
* and response headers are available.
*/
onResponseStarted(listener: ((details: OnResponseStartedListenerDetails) => void) | (null)): void;
/**
* The `listener` will be called with `listener(details)` just before a request is
* going to be sent to the server, modifications of previous `onBeforeSendHeaders`
* response are visible by the time this listener is fired.
*/
onSendHeaders(filter: WebRequestFilter, listener: ((details: OnSendHeadersListenerDetails) => void) | (null)): void;
/**
* The `listener` will be called with `listener(details)` just before a request is
* going to be sent to the server, modifications of previous `onBeforeSendHeaders`
* response are visible by the time this listener is fired.
*/
onSendHeaders(listener: ((details: OnSendHeadersListenerDetails) => void) | (null)): void;
}
interface WebRequestFilter {
// Docs: https://electronjs.org/docs/api/structures/web-request-filter
/**
* Array of types that will be used to filter out the requests that do not match
* the types. When not specified, all types will be matched. Can be `mainFrame`,
* `subFrame`, `stylesheet`, `script`, `image`, `font`, `object`, `xhr`, `ping`,
* `cspReport`, `media` or `webSocket`.
*/
types?: Array<'mainFrame' | 'subFrame' | 'stylesheet' | 'script' | 'image' | 'font' | 'object' | 'xhr' | 'ping' | 'cspReport' | 'media' | 'webSocket'>;
/**
* Array of URL patterns that will be used to filter out the requests that do not
* match the URL patterns.
*/
urls: string[];
}
interface WebSource {
// Docs: https://electronjs.org/docs/api/structures/web-source
code: string;
url?: string;
}
interface WebviewTag extends HTMLElement {
// Docs: https://electronjs.org/docs/api/webview-tag
/**
* Fired when a load has committed. This includes navigation within the current
* document as well as subframe document-level loads, but does not include
* asynchronous resource loads.
*/
addEventListener(event: 'load-commit', listener: (event: LoadCommitEvent) => void, useCapture?: boolean): this;
removeEventListener(event: 'load-commit', listener: (event: LoadCommitEvent) => void): this;
/**
* Fired when the navigation is done, i.e. the spinner of the tab will stop
* spinning, and the `onload` event is dispatched.
*/
addEventListener(event: 'did-finish-load', listener: (event: DOMEvent) => void, useCapture?: boolean): this;
removeEventListener(event: 'did-finish-load', listener: (event: DOMEvent) => void): this;
/**
* This event is like `did-finish-load`, but fired when the load failed or was
* cancelled, e.g. `window.stop()` is invoked.
*/
addEventListener(event: 'did-fail-load', listener: (event: DidFailLoadEvent) => void, useCapture?: boolean): this;
removeEventListener(event: 'did-fail-load', listener: (event: DidFailLoadEvent) => void): this;
/**
* Fired when a frame has done navigation.
*/
addEventListener(event: 'did-frame-finish-load', listener: (event: DidFrameFinishLoadEvent) => void, useCapture?: boolean): this;
removeEventListener(event: 'did-frame-finish-load', listener: (event: DidFrameFinishLoadEvent) => void): this;
/**
* Corresponds to the points in time when the spinner of the tab starts spinning.
*/
addEventListener(event: 'did-start-loading', listener: (event: DOMEvent) => void, useCapture?: boolean): this;
removeEventListener(event: 'did-start-loading', listener: (event: DOMEvent) => void): this;
/**
* Corresponds to the points in time when the spinner of the tab stops spinning.
*/
addEventListener(event: 'did-stop-loading', listener: (event: DOMEvent) => void, useCapture?: boolean): this;
removeEventListener(event: 'did-stop-loading', listener: (event: DOMEvent) => void): this;
/**
* Fired when attached to the embedder web contents.
*/
addEventListener(event: 'did-attach', listener: (event: DOMEvent) => void, useCapture?: boolean): this;
removeEventListener(event: 'did-attach', listener: (event: DOMEvent) => void): this;
/**
* Fired when document in the given frame is loaded.
*/
addEventListener(event: 'dom-ready', listener: (event: DOMEvent) => void, useCapture?: boolean): this;
removeEventListener(event: 'dom-ready', listener: (event: DOMEvent) => void): this;
/**
* Fired when page title is set during navigation. `explicitSet` is false when
* title is synthesized from file url.
*/
addEventListener(event: 'page-title-updated', listener: (event: PageTitleUpdatedEvent) => void, useCapture?: boolean): this;
removeEventListener(event: 'page-title-updated', listener: (event: PageTitleUpdatedEvent) => void): this;
/**
* Fired when page receives favicon urls.
*/
addEventListener(event: 'page-favicon-updated', listener: (event: PageFaviconUpdatedEvent) => void, useCapture?: boolean): this;
removeEventListener(event: 'page-favicon-updated', listener: (event: PageFaviconUpdatedEvent) => void): this;
/**
* Fired when page enters fullscreen triggered by HTML API.
*/
addEventListener(event: 'enter-html-full-screen', listener: (event: DOMEvent) => void, useCapture?: boolean): this;
removeEventListener(event: 'enter-html-full-screen', listener: (event: DOMEvent) => void): this;
/**
* Fired when page leaves fullscreen triggered by HTML API.
*/
addEventListener(event: 'leave-html-full-screen', listener: (event: DOMEvent) => void, useCapture?: boolean): this;
removeEventListener(event: 'leave-html-full-screen', listener: (event: DOMEvent) => void): this;
/**
* Fired when the guest window logs a console message.
*
* The following example code forwards all log messages to the embedder's console
* without regard for log level or other properties.
*/
addEventListener(event: 'console-message', listener: (event: ConsoleMessageEvent) => void, useCapture?: boolean): this;
removeEventListener(event: 'console-message', listener: (event: ConsoleMessageEvent) => void): this;
/**
* Fired when a result is available for `webview.findInPage` request.
*/
addEventListener(event: 'found-in-page', listener: (event: FoundInPageEvent) => void, useCapture?: boolean): this;
removeEventListener(event: 'found-in-page', listener: (event: FoundInPageEvent) => void): this;
/**
* Emitted when a user or the page wants to start navigation. It can happen when
* the `window.location` object is changed or a user clicks a link in the page.
*
* This event will not emit when the navigation is started programmatically with
* APIs like `<webview>.loadURL` and `<webview>.back`.
*
* It is also not emitted during in-page navigation, such as clicking anchor links
* or updating the `window.location.hash`. Use `did-navigate-in-page` event for
* this purpose.
*
* Calling `event.preventDefault()` does **NOT** have any effect.
*/
addEventListener(event: 'will-navigate', listener: (event: WillNavigateEvent) => void, useCapture?: boolean): this;
removeEventListener(event: 'will-navigate', listener: (event: WillNavigateEvent) => void): this;
/**
* Emitted when a user or the page wants to start navigation anywhere in the
* `<webview>` or any frames embedded within. It can happen when the
* `window.location` object is changed or a user clicks a link in the page.
*
* This event will not emit when the navigation is started programmatically with
* APIs like `<webview>.loadURL` and `<webview>.back`.
*
* It is also not emitted during in-page navigation, such as clicking anchor links
* or updating the `window.location.hash`. Use `did-navigate-in-page` event for
* this purpose.
*
* Calling `event.preventDefault()` does **NOT** have any effect.
*/
addEventListener(event: 'will-frame-navigate', listener: (event: WillFrameNavigateEvent) => void, useCapture?: boolean): this;
removeEventListener(event: 'will-frame-navigate', listener: (event: WillFrameNavigateEvent) => void): this;
/**
* Emitted when any frame (including main) starts navigating. `isInPlace` will be
* `true` for in-page navigations.
*/
addEventListener(event: 'did-start-navigation', listener: (event: DidStartNavigationEvent) => void, useCapture?: boolean): this;
removeEventListener(event: 'did-start-navigation', listener: (event: DidStartNavigationEvent) => void): this;
/**
* Emitted after a server side redirect occurs during navigation. For example a 302
* redirect.
*/
addEventListener(event: 'did-redirect-navigation', listener: (event: DidRedirectNavigationEvent) => void, useCapture?: boolean): this;
removeEventListener(event: 'did-redirect-navigation', listener: (event: DidRedirectNavigationEvent) => void): this;
/**
* Emitted when a navigation is done.
*
* This event is not emitted for in-page navigations, such as clicking anchor links
* or updating the `window.location.hash`. Use `did-navigate-in-page` event for
* this purpose.
*/
addEventListener(event: 'did-navigate', listener: (event: DidNavigateEvent) => void, useCapture?: boolean): this;
removeEventListener(event: 'did-navigate', listener: (event: DidNavigateEvent) => void): this;
/**
* Emitted when any frame navigation is done.
*
* This event is not emitted for in-page navigations, such as clicking anchor links
* or updating the `window.location.hash`. Use `did-navigate-in-page` event for
* this purpose.
*/
addEventListener(event: 'did-frame-navigate', listener: (event: DidFrameNavigateEvent) => void, useCapture?: boolean): this;
removeEventListener(event: 'did-frame-navigate', listener: (event: DidFrameNavigateEvent) => void): this;
/**
* Emitted when an in-page navigation happened.
*
* When in-page navigation happens, the page URL changes but does not cause
* navigation outside of the page. Examples of this occurring are when anchor links
* are clicked or when the DOM `hashchange` event is triggered.
*/
addEventListener(event: 'did-navigate-in-page', listener: (event: DidNavigateInPageEvent) => void, useCapture?: boolean): this;
removeEventListener(event: 'did-navigate-in-page', listener: (event: DidNavigateInPageEvent) => void): this;
/**
* Fired when the guest page attempts to close itself.
*
* The following example code navigates the `webview` to `about:blank` when the
* guest attempts to close itself.
*/
addEventListener(event: 'close', listener: (event: DOMEvent) => void, useCapture?: boolean): this;
removeEventListener(event: 'close', listener: (event: DOMEvent) => void): this;
/**
* Fired when the guest page has sent an asynchronous message to embedder page.
*
* With `sendToHost` method and `ipc-message` event you can communicate between
* guest page and embedder page:
*/
addEventListener(event: 'ipc-message', listener: (event: IpcMessageEvent) => void, useCapture?: boolean): this;
removeEventListener(event: 'ipc-message', listener: (event: IpcMessageEvent) => void): this;
/**
* Fired when the renderer process crashes or is killed.
*
* **Deprecated:** This event is superceded by the `render-process-gone` event
* which contains more information about why the render process disappeared. It
* isn't always because it crashed.
*
* @deprecated
*/
addEventListener(event: 'crashed', listener: (event: DOMEvent) => void, useCapture?: boolean): this;
removeEventListener(event: 'crashed', listener: (event: DOMEvent) => void): this;
/**
* Fired when the renderer process unexpectedly disappears. This is normally
* because it was crashed or killed.
*/
addEventListener(event: 'render-process-gone', listener: (event: RenderProcessGoneEvent) => void, useCapture?: boolean): this;
removeEventListener(event: 'render-process-gone', listener: (event: RenderProcessGoneEvent) => void): this;
/**
* Fired when a plugin process is crashed.
*/
addEventListener(event: 'plugin-crashed', listener: (event: PluginCrashedEvent) => void, useCapture?: boolean): this;
removeEventListener(event: 'plugin-crashed', listener: (event: PluginCrashedEvent) => void): this;
/**
* Fired when the WebContents is destroyed.
*/
addEventListener(event: 'destroyed', listener: (event: DOMEvent) => void, useCapture?: boolean): this;
removeEventListener(event: 'destroyed', listener: (event: DOMEvent) => void): this;
/**
* Emitted when media starts playing.
*/
addEventListener(event: 'media-started-playing', listener: (event: DOMEvent) => void, useCapture?: boolean): this;
removeEventListener(event: 'media-started-playing', listener: (event: DOMEvent) => void): this;
/**
* Emitted when media is paused or done playing.
*/
addEventListener(event: 'media-paused', listener: (event: DOMEvent) => void, useCapture?: boolean): this;
removeEventListener(event: 'media-paused', listener: (event: DOMEvent) => void): this;
/**
* Emitted when a page's theme color changes. This is usually due to encountering a
* meta tag:
*/
addEventListener(event: 'did-change-theme-color', listener: (event: DidChangeThemeColorEvent) => void, useCapture?: boolean): this;
removeEventListener(event: 'did-change-theme-color', listener: (event: DidChangeThemeColorEvent) => void): this;
/**
* Emitted when mouse moves over a link or the keyboard moves the focus to a link.
*/
addEventListener(event: 'update-target-url', listener: (event: UpdateTargetUrlEvent) => void, useCapture?: boolean): this;
removeEventListener(event: 'update-target-url', listener: (event: UpdateTargetUrlEvent) => void): this;
/**
* Emitted when a link is clicked in DevTools or 'Open in new tab' is selected for
* a link in its context menu.
*/
addEventListener(event: 'devtools-open-url', listener: (event: DevtoolsOpenUrlEvent) => void, useCapture?: boolean): this;
removeEventListener(event: 'devtools-open-url', listener: (event: DevtoolsOpenUrlEvent) => void): this;
/**
* Emitted when DevTools is opened.
*/
addEventListener(event: 'devtools-opened', listener: (event: DOMEvent) => void, useCapture?: boolean): this;
removeEventListener(event: 'devtools-opened', listener: (event: DOMEvent) => void): this;
/**
* Emitted when DevTools is closed.
*/
addEventListener(event: 'devtools-closed', listener: (event: DOMEvent) => void, useCapture?: boolean): this;
removeEventListener(event: 'devtools-closed', listener: (event: DOMEvent) => void): this;
/**
* Emitted when DevTools is focused / opened.
*/
addEventListener(event: 'devtools-focused', listener: (event: DOMEvent) => void, useCapture?: boolean): this;
removeEventListener(event: 'devtools-focused', listener: (event: DOMEvent) => void): this;
/**
* Emitted when there is a new context menu that needs to be handled.
*/
addEventListener(event: 'context-menu', listener: (event: ContextMenuEvent) => void, useCapture?: boolean): this;
removeEventListener(event: 'context-menu', listener: (event: ContextMenuEvent) => void): this;
addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void;
addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
removeEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void;
removeEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
/**
* Adjusts the current text selection starting and ending points in the focused
* frame by the given amounts. A negative amount moves the selection towards the
* beginning of the document, and a positive amount moves the selection towards the
* end of the document.
*
* See `webContents.adjustSelection` for examples.
*/
adjustSelection(options: AdjustSelectionOptions): void;
/**
* Whether the guest page can go back.
*/
canGoBack(): boolean;
/**
* Whether the guest page can go forward.
*/
canGoForward(): boolean;
/**
* Whether the guest page can go to `offset`.
*/
canGoToOffset(offset: number): boolean;
/**
* Resolves with a NativeImage
*
* Captures a snapshot of the page within `rect`. Omitting `rect` will capture the
* whole visible page.
*/
capturePage(rect?: Rectangle): Promise<Electron.NativeImage>;
/**
* Centers the current text selection in page.
*/
centerSelection(): void;
/**
* Clears the navigation history.
*/
clearHistory(): void;
/**
* Closes the DevTools window of guest page.
*/
closeDevTools(): void;
/**
* Executes editing command `copy` in page.
*/
copy(): void;
/**
* Executes editing command `cut` in page.
*/
cut(): void;
/**
* Executes editing command `delete` in page.
*/
delete(): void;
/**
* Initiates a download of the resource at `url` without navigating.
*/
downloadURL(url: string, options?: DownloadURLOptions): void;
/**
* A promise that resolves with the result of the executed code or is rejected if
* the result of the code is a rejected promise.
*
* Evaluates `code` in page. If `userGesture` is set, it will create the user
* gesture context in the page. HTML APIs like `requestFullScreen`, which require
* user action, can take advantage of this option for automation.
*/
executeJavaScript(code: string, userGesture?: boolean): Promise<any>;
/**
* The request id used for the request.
*
* Starts a request to find all matches for the `text` in the web page. The result
* of the request can be obtained by subscribing to `found-in-page` event.
*/
findInPage(text: string, options?: FindInPageOptions): number;
/**
* The title of guest page.
*/
getTitle(): string;
/**
* The URL of guest page.
*/
getURL(): string;
/**
* The user agent for guest page.
*/
getUserAgent(): string;
/**
* The WebContents ID of this `webview`.
*/
getWebContentsId(): number;
/**
* the current zoom factor.
*/
getZoomFactor(): number;
/**
* the current zoom level.
*/
getZoomLevel(): number;
/**
* Makes the guest page go back.
*/
goBack(): void;
/**
* Makes the guest page go forward.
*/
goForward(): void;
/**
* Navigates to the specified absolute index.
*/
goToIndex(index: number): void;
/**
* Navigates to the specified offset from the "current entry".
*/
goToOffset(offset: number): void;
/**
* A promise that resolves with a key for the inserted CSS that can later be used
* to remove the CSS via `<webview>.removeInsertedCSS(key)`.
*
* Injects CSS into the current web page and returns a unique key for the inserted
* stylesheet.
*/
insertCSS(css: string): Promise<string>;
/**
* Inserts `text` to the focused element.
*/
insertText(text: string): Promise<void>;
/**
* Starts inspecting element at position (`x`, `y`) of guest page.
*/
inspectElement(x: number, y: number): void;
/**
* Opens the DevTools for the service worker context present in the guest page.
*/
inspectServiceWorker(): void;
/**
* Opens the DevTools for the shared worker context present in the guest page.
*/
inspectSharedWorker(): void;
/**
* Whether guest page has been muted.
*/
isAudioMuted(): boolean;
/**
* Whether the renderer process has crashed.
*/
isCrashed(): boolean;
/**
* Whether audio is currently playing.
*/
isCurrentlyAudible(): boolean;
/**
* Whether DevTools window of guest page is focused.
*/
isDevToolsFocused(): boolean;
/**
* Whether guest page has a DevTools window attached.
*/
isDevToolsOpened(): boolean;
/**
* Whether guest page is still loading resources.
*/
isLoading(): boolean;
/**
* Whether the main frame (and not just iframes or frames within it) is still
* loading.
*/
isLoadingMainFrame(): boolean;
/**
* Whether the guest page is waiting for a first-response for the main resource of
* the page.
*/
isWaitingForResponse(): boolean;
/**
* The promise will resolve when the page has finished loading (see
* `did-finish-load`), and rejects if the page fails to load (see `did-fail-load`).
*
* Loads the `url` in the webview, the `url` must contain the protocol prefix, e.g.
* the `http://` or `file://`.
*/
loadURL(url: string, options?: LoadURLOptions): Promise<void>;
/**
* Opens a DevTools window for guest page.
*/
openDevTools(): void;
/**
* Executes editing command `paste` in page.
*/
paste(): void;
/**
* Executes editing command `pasteAndMatchStyle` in page.
*/
pasteAndMatchStyle(): void;
/**
* Prints `webview`'s web page. Same as `webContents.print([options])`.
*/
print(options?: WebviewTagPrintOptions): Promise<void>;
/**
* Resolves with the generated PDF data.
*
* Prints `webview`'s web page as PDF, Same as `webContents.printToPDF(options)`.
*/
printToPDF(options: PrintToPDFOptions): Promise<Uint8Array>;
/**
* Executes editing command `redo` in page.
*/
redo(): void;
/**
* Reloads the guest page.
*/
reload(): void;
/**
* Reloads the guest page and ignores cache.
*/
reloadIgnoringCache(): void;
/**
* Resolves if the removal was successful.
*
* Removes the inserted CSS from the current web page. The stylesheet is identified
* by its key, which is returned from `<webview>.insertCSS(css)`.
*/
removeInsertedCSS(key: string): Promise<void>;
/**
* Executes editing command `replace` in page.
*/
replace(text: string): void;
/**
* Executes editing command `replaceMisspelling` in page.
*/
replaceMisspelling(text: string): void;
/**
* Scrolls to the bottom of the current `<webview>`.
*/
scrollToBottom(): void;
/**
* Scrolls to the top of the current `<webview>`.
*/
scrollToTop(): void;
/**
* Executes editing command `selectAll` in page.
*/
selectAll(): void;
/**
* Send an asynchronous message to renderer process via `channel`, you can also
* send arbitrary arguments. The renderer process can handle the message by
* listening to the `channel` event with the `ipcRenderer` module.
*
* See webContents.send for examples.
*/
send(channel: string, ...args: any[]): Promise<void>;
/**
* Sends an input `event` to the page.
*
* See webContents.sendInputEvent for detailed description of `event` object.
*/
sendInputEvent(event: (MouseInputEvent) | (MouseWheelInputEvent) | (KeyboardInputEvent)): Promise<void>;
/**
* Send an asynchronous message to renderer process via `channel`, you can also
* send arbitrary arguments. The renderer process can handle the message by
* listening to the `channel` event with the `ipcRenderer` module.
*
* See webContents.sendToFrame for examples.
*/
sendToFrame(frameId: [number, number], channel: string, ...args: any[]): Promise<void>;
/**
* Set guest page muted.
*/
setAudioMuted(muted: boolean): void;
/**
* Overrides the user agent for the guest page.
*/
setUserAgent(userAgent: string): void;
/**
* Sets the maximum and minimum pinch-to-zoom level.
*/
setVisualZoomLevelLimits(minimumLevel: number, maximumLevel: number): Promise<void>;
/**
* Changes the zoom factor to the specified factor. Zoom factor is zoom percent
* divided by 100, so 300% = 3.0.
*/
setZoomFactor(factor: number): void;
/**
* Changes the zoom level to the specified level. The original size is 0 and each
* increment above or below represents zooming 20% larger or smaller to default
* limits of 300% and 50% of original size, respectively. The formula for this is
* `scale := 1.2 ^ level`.
*
* > **NOTE**: The zoom policy at the Chromium level is same-origin, meaning that
* the zoom level for a specific domain propagates across all instances of windows
* with the same domain. Differentiating the window URLs will make zoom work
* per-window.
*/
setZoomLevel(level: number): void;
/**
* Shows pop-up dictionary that searches the selected word on the page.
*
* @platform darwin
*/
showDefinitionForSelection(): void;
/**
* Stops any pending navigation.
*/
stop(): void;
/**
* Stops any `findInPage` request for the `webview` with the provided `action`.
*/
stopFindInPage(action: 'clearSelection' | 'keepSelection' | 'activateSelection'): void;
/**
* Executes editing command `undo` in page.
*/
undo(): void;
/**
* Executes editing command `unselect` in page.
*/
unselect(): void;
/**
* A `boolean`. When this attribute is present the guest page will be allowed to
* open new windows. Popups are disabled by default.
*/
allowpopups: boolean;
/**
* A `string` which is a list of strings which specifies the blink features to be
* disabled separated by `,`. The full list of supported feature strings can be
* found in the RuntimeEnabledFeatures.json5 file.
*/
disableblinkfeatures: string;
/**
* A `boolean`. When this attribute is present the guest page will have web
* security disabled. Web security is enabled by default.
*
* This value can only be modified before the first navigation.
*/
disablewebsecurity: boolean;
/**
* A `string` which is a list of strings which specifies the blink features to be
* enabled separated by `,`. The full list of supported feature strings can be
* found in the RuntimeEnabledFeatures.json5 file.
*/
enableblinkfeatures: string;
/**
* A `string` that sets the referrer URL for the guest page.
*/
httpreferrer: string;
/**
* A `boolean`. When this attribute is present the guest page in `webview` will
* have node integration and can use node APIs like `require` and `process` to
* access low level system resources. Node integration is disabled by default in
* the guest page.
*/
nodeintegration: boolean;
/**
* A `boolean` for the experimental option for enabling NodeJS support in
* sub-frames such as iframes inside the `webview`. All your preloads will load for
* every iframe, you can use `process.isMainFrame` to determine if you are in the
* main frame or not. This option is disabled by default in the guest page.
*/
nodeintegrationinsubframes: boolean;
/**
* A `string` that sets the session used by the page. If `partition` starts with
* `persist:`, the page will use a persistent session available to all pages in the
* app with the same `partition`. if there is no `persist:` prefix, the page will
* use an in-memory session. By assigning the same `partition`, multiple pages can
* share the same session. If the `partition` is unset then default session of the
* app will be used.
*
* This value can only be modified before the first navigation, since the session
* of an active renderer process cannot change. Subsequent attempts to modify the
* value will fail with a DOM exception.
*/
partition: string;
/**
* A `boolean`. When this attribute is present the guest page in `webview` will be
* able to use browser plugins. Plugins are disabled by default.
*/
plugins: boolean;
/**
* A `string` that specifies a script that will be loaded before other scripts run
* in the guest page. The protocol of script's URL must be `file:` (even when using
* `asar:` archives) because it will be loaded by Node's `require` under the hood,
* which treats `asar:` archives as virtual directories.
*
* When the guest page doesn't have node integration this script will still have
* access to all Node APIs, but global objects injected by Node will be deleted
* after this script has finished executing.
*/
preload: string;
/**
* A `string` representing the visible URL. Writing to this attribute initiates
* top-level navigation.
*
* Assigning `src` its own value will reload the current page.
*
* The `src` attribute can also accept data URLs, such as `data:text/plain,Hello,
* world!`.
*/
src: string;
/**
* A `string` that sets the user agent for the guest page before the page is
* navigated to. Once the page is loaded, use the `setUserAgent` method to change
* the user agent.
*/
useragent: string;
/**
* A `string` which is a comma separated list of strings which specifies the web
* preferences to be set on the webview. The full list of supported preference
* strings can be found in BrowserWindow.
*
* The string follows the same format as the features string in `window.open`. A
* name by itself is given a `true` boolean value. A preference can be set to
* another value by including an `=`, followed by the value. Special values `yes`
* and `1` are interpreted as `true`, while `no` and `0` are interpreted as
* `false`.
*/
webpreferences: string;
}
interface AboutPanelOptionsOptions {
/**
* The app's name.
*/
applicationName?: string;
/**
* The app's version.
*/
applicationVersion?: string;
/**
* Copyright information.
*/
copyright?: string;
/**
* The app's build version number.
*
* @platform darwin
*/
version?: string;
/**
* Credit information.
*
* @platform darwin,win32
*/
credits?: string;
/**
* List of app authors.
*
* @platform linux
*/
authors?: string[];
/**
* The app's website.
*
* @platform linux
*/
website?: string;
/**
* Path to the app's icon in a JPEG or PNG file format. On Linux, will be shown as
* 64x64 pixels while retaining aspect ratio.
*
* @platform linux,win32
*/
iconPath?: string;
}
interface AddRepresentationOptions {
/**
* The scale factor to add the image representation for.
*/
scaleFactor?: number;
/**
* Defaults to 0. Required if a bitmap buffer is specified as `buffer`.
*/
width?: number;
/**
* Defaults to 0. Required if a bitmap buffer is specified as `buffer`.
*/
height?: number;
/**
* The buffer containing the raw image data.
*/
buffer?: Buffer;
/**
* The data URL containing either a base 64 encoded PNG or JPEG image.
*/
dataURL?: string;
}
interface AdjustSelectionOptions {
/**
* Amount to shift the start index of the current selection.
*/
start?: number;
/**
* Amount to shift the end index of the current selection.
*/
end?: number;
}
interface AnimationSettings {
/**
* Returns true if rich animations should be rendered. Looks at session type (e.g.
* remote desktop) and accessibility settings to give guidance for heavy
* animations.
*/
shouldRenderRichAnimation: boolean;
/**
* Determines on a per-platform basis whether scroll animations (e.g. produced by
* home/end key) should be enabled.
*/
scrollAnimationsEnabledBySystem: boolean;
/**
* Determines whether the user desires reduced motion based on platform APIs.
*/
prefersReducedMotion: boolean;
}
interface AppDetailsOptions {
/**
* Window's App User Model ID. It has to be set, otherwise the other options will
* have no effect.
*/
appId?: string;
/**
* Window's Relaunch Icon.
*/
appIconPath?: string;
/**
* Index of the icon in `appIconPath`. Ignored when `appIconPath` is not set.
* Default is `0`.
*/
appIconIndex?: number;
/**
* Window's Relaunch Command.
*/
relaunchCommand?: string;
/**
* Window's Relaunch Display Name.
*/
relaunchDisplayName?: string;
}
interface ApplicationInfoForProtocolReturnValue {
/**
* the display icon of the app handling the protocol.
*/
icon: NativeImage;
/**
* installation path of the app handling the protocol.
*/
path: string;
/**
* display name of the app handling the protocol.
*/
name: string;
}
interface AuthenticationResponseDetails {
url: string;
}
interface AuthInfo {
isProxy: boolean;
scheme: string;
host: string;
port: number;
realm: string;
}
interface AutoResizeOptions {
/**
* If `true`, the view's width will grow and shrink together with the window.
* `false` by default.
*/
width?: boolean;
/**
* If `true`, the view's height will grow and shrink together with the window.
* `false` by default.
*/
height?: boolean;
/**
* If `true`, the view's x position and width will grow and shrink proportionally
* with the window. `false` by default.
*/
horizontal?: boolean;
/**
* If `true`, the view's y position and height will grow and shrink proportionally
* with the window. `false` by default.
*/
vertical?: boolean;
}
interface BeforeSendResponse {
cancel?: boolean;
/**
* When provided, request will be made with these headers.
*/
requestHeaders?: Record<string, (string) | (string[])>;
}
interface BitmapOptions {
/**
* Defaults to 1.0.
*/
scaleFactor?: number;
}
interface BlinkMemoryInfo {
/**
* Size of all allocated objects in Kilobytes.
*/
allocated: number;
/**
* Total allocated space in Kilobytes.
*/
total: number;
}
interface BluetoothPairingHandlerHandlerDetails {
deviceId: string;
/**
* The type of pairing prompt being requested. One of the following values:
*/
pairingKind: ('confirm' | 'confirmPin' | 'providePin');
frame: WebFrameMain;
/**
* The pin value to verify if `pairingKind` is `confirmPin`.
*/
pin?: string;
}
interface BrowserViewConstructorOptions {
/**
* Settings of web page's features.
*/
webPreferences?: WebPreferences;
}
interface CallbackResponse {
cancel?: boolean;
/**
* The original request is prevented from being sent or completed and is instead
* redirected to the given URL.
*/
redirectURL?: string;
}
interface CertificateTrustDialogOptions {
/**
* The certificate to trust/import.
*/
certificate: Certificate;
/**
* The message to display to the user.
*/
message: string;
}
interface ClearCodeCachesOptions {
/**
* An array of url corresponding to the resource whose generated code cache needs
* to be removed. If the list is empty then all entries in the cache directory will
* be removed.
*/
urls?: string[];
}
interface ClearStorageDataOptions {
/**
* Should follow `window.location.origin`’s representation `scheme://host:port`.
*/
origin?: string;
/**
* The types of storages to clear, can be `cookies`, `filesystem`, `indexdb`,
* `localstorage`, `shadercache`, `websql`, `serviceworkers`, `cachestorage`. If
* not specified, clear all storage types.
*/
storages?: Array<'cookies' | 'filesystem' | 'indexdb' | 'localstorage' | 'shadercache' | 'websql' | 'serviceworkers' | 'cachestorage'>;
/**
* The types of quotas to clear, can be `temporary`, `syncable`. If not specified,
* clear all quotas.
*/
quotas?: Array<'temporary' | 'syncable'>;
}
interface ClientRequestConstructorOptions {
/**
* The HTTP request method. Defaults to the GET method.
*/
method?: string;
/**
* The request URL. Must be provided in the absolute form with the protocol scheme
* specified as http or https.
*/
url?: string;
/**
* The `Session` instance with which the request is associated.
*/
session?: Session;
/**
* The name of the `partition` with which the request is associated. Defaults to
* the empty string. The `session` option supersedes `partition`. Thus if a
* `session` is explicitly specified, `partition` is ignored.
*/
partition?: string;
/**
* Can be `include`, `omit` or `same-origin`. Whether to send credentials with this
* request. If set to `include`, credentials from the session associated with the
* request will be used. If set to `omit`, credentials will not be sent with the
* request (and the `'login'` event will not be triggered in the event of a 401).
* If set to `same-origin`, `origin` must also be specified. This matches the
* behavior of the fetch option of the same name. If this option is not specified,
* authentication data from the session will be sent, and cookies will not be sent
* (unless `useSessionCookies` is set).
*/
credentials?: ('include' | 'omit' | 'same-origin');
/**
* Whether to send cookies with this request from the provided session. If
* `credentials` is specified, this option has no effect. Default is `false`.
*/
useSessionCookies?: boolean;
/**
* Can be `http:` or `https:`. The protocol scheme in the form 'scheme:'. Defaults
* to 'http:'.
*/
protocol?: ('http:' | 'https:');
/**
* The server host provided as a concatenation of the hostname and the port number
* 'hostname:port'.
*/
host?: string;
/**
* The server host name.
*/
hostname?: string;
/**
* The server's listening port number.
*/
port?: number;
/**
* The path part of the request URL.
*/
path?: string;
/**
* Can be `follow`, `error` or `manual`. The redirect mode for this request. When
* mode is `error`, any redirection will be aborted. When mode is `manual` the
* redirection will be cancelled unless `request.followRedirect` is invoked
* synchronously during the `redirect` event. Defaults to `follow`.
*/
redirect?: ('follow' | 'error' | 'manual');
/**
* The origin URL of the request.
*/
origin?: string;
/**
* can be `""`, `no-referrer`, `no-referrer-when-downgrade`, `origin`,
* `origin-when-cross-origin`, `unsafe-url`, `same-origin`, `strict-origin`, or
* `strict-origin-when-cross-origin`. Defaults to
* `strict-origin-when-cross-origin`.
*/
referrerPolicy?: string;
/**
* can be `default`, `no-store`, `reload`, `no-cache`, `force-cache` or
* `only-if-cached`.
*/
cache?: ('default' | 'no-store' | 'reload' | 'no-cache' | 'force-cache' | 'only-if-cached');
}
interface CloseOpts {
/**
* if true, fire the `beforeunload` event before closing the page. If the page
* prevents the unload, the WebContents will not be closed. The
* `will-prevent-unload` will be fired if the page requests prevention of unload.
*/
waitForBeforeUnload: boolean;
}
interface Config {
/**
* The proxy mode. Should be one of `direct`, `auto_detect`, `pac_script`,
* `fixed_servers` or `system`. If it's unspecified, it will be automatically
* determined based on other specified options.
*/
mode?: ('direct' | 'auto_detect' | 'pac_script' | 'fixed_servers' | 'system');
/**
* The URL associated with the PAC file.
*/
pacScript?: string;
/**
* Rules indicating which proxies to use.
*/
proxyRules?: string;
/**
* Rules indicating which URLs should bypass the proxy settings.
*/
proxyBypassRules?: string;
}
interface ConfigureHostResolverOptions {
/**
* Whether the built-in host resolver is used in preference to getaddrinfo. When
* enabled, the built-in resolver will attempt to use the system's DNS settings to
* do DNS lookups itself. Enabled by default on macOS, disabled by default on
* Windows and Linux.
*/
enableBuiltInResolver?: boolean;
/**
* Can be 'off', 'automatic' or 'secure'. Configures the DNS-over-HTTP mode. When
* 'off', no DoH lookups will be performed. When 'automatic', DoH lookups will be
* performed first if DoH is available, and insecure DNS lookups will be performed
* as a fallback. When 'secure', only DoH lookups will be performed. Defaults to
* 'automatic'.
*/
secureDnsMode?: ('off' | 'automatic' | 'secure');
/**
* A list of DNS-over-HTTP server templates. See RFC8484 § 3 for details on the
* template format. Most servers support the POST method; the template for such
* servers is simply a URI. Note that for some DNS providers, the resolver will
* automatically upgrade to DoH unless DoH is explicitly disabled, even if there
* are no DoH servers provided in this list.
*/
secureDnsServers?: string[];
/**
* Controls whether additional DNS query types, e.g. HTTPS (DNS type 65) will be
* allowed besides the traditional A and AAAA queries when a request is being made
* via insecure DNS. Has no effect on Secure DNS which always allows additional
* types. Defaults to true.
*/
enableAdditionalDnsQueryTypes?: boolean;
}
interface ConsoleMessageEvent extends DOMEvent {
/**
* The log level, from 0 to 3. In order it matches `verbose`, `info`, `warning` and
* `error`.
*/
level: number;
/**
* The actual console message
*/
message: string;
/**
* The line number of the source that triggered this console message
*/
line: number;
sourceId: string;
}
interface ContextMenuEvent extends DOMEvent {
params: Params;
}
interface ContextMenuParams {
/**
* x coordinate.
*/
x: number;
/**
* y coordinate.
*/
y: number;
/**
* Frame from which the context menu was invoked.
*/
frame: WebFrameMain;
/**
* URL of the link that encloses the node the context menu was invoked on.
*/
linkURL: string;
/**
* Text associated with the link. May be an empty string if the contents of the
* link are an image.
*/
linkText: string;
/**
* URL of the top level page that the context menu was invoked on.
*/
pageURL: string;
/**
* URL of the subframe that the context menu was invoked on.
*/
frameURL: string;
/**
* Source URL for the element that the context menu was invoked on. Elements with
* source URLs are images, audio and video.
*/
srcURL: string;
/**
* Type of the node the context menu was invoked on. Can be `none`, `image`,
* `audio`, `video`, `canvas`, `file` or `plugin`.
*/
mediaType: ('none' | 'image' | 'audio' | 'video' | 'canvas' | 'file' | 'plugin');
/**
* Whether the context menu was invoked on an image which has non-empty contents.
*/
hasImageContents: boolean;
/**
* Whether the context is editable.
*/
isEditable: boolean;
/**
* Text of the selection that the context menu was invoked on.
*/
selectionText: string;
/**
* Title text of the selection that the context menu was invoked on.
*/
titleText: string;
/**
* Alt text of the selection that the context menu was invoked on.
*/
altText: string;
/**
* Suggested filename to be used when saving file through 'Save Link As' option of
* context menu.
*/
suggestedFilename: string;
/**
* Rect representing the coordinates in the document space of the selection.
*/
selectionRect: Rectangle;
/**
* Start position of the selection text.
*/
selectionStartOffset: number;
/**
* The referrer policy of the frame on which the menu is invoked.
*/
referrerPolicy: Referrer;
/**
* The misspelled word under the cursor, if any.
*/
misspelledWord: string;
/**
* An array of suggested words to show the user to replace the `misspelledWord`.
* Only available if there is a misspelled word and spellchecker is enabled.
*/
dictionarySuggestions: string[];
/**
* The character encoding of the frame on which the menu was invoked.
*/
frameCharset: string;
/**
* If the context menu was invoked on an input field, the type of that field.
* Possible values include `none`, `plainText`, `password`, `other`.
*/
inputFieldType: ('none' | 'plainText' | 'password' | 'other');
/**
* If the context is editable, whether or not spellchecking is enabled.
*/
spellcheckEnabled: boolean;
/**
* Input source that invoked the context menu. Can be `none`, `mouse`, `keyboard`,
* `touch`, `touchMenu`, `longPress`, `longTap`, `touchHandle`, `stylus`,
* `adjustSelection`, or `adjustSelectionReset`.
*/
menuSourceType: ('none' | 'mouse' | 'keyboard' | 'touch' | 'touchMenu' | 'longPress' | 'longTap' | 'touchHandle' | 'stylus' | 'adjustSelection' | 'adjustSelectionReset');
/**
* The flags for the media element the context menu was invoked on.
*/
mediaFlags: MediaFlags;
/**
* These flags indicate whether the renderer believes it is able to perform the
* corresponding action.
*/
editFlags: EditFlags;
}
interface ContinueActivityDetails {
/**
* A string identifying the URL of the webpage accessed by the activity on another
* device, if available.
*/
webpageURL?: string;
}
interface CookiesGetFilter {
/**
* Retrieves cookies which are associated with `url`. Empty implies retrieving
* cookies of all URLs.
*/
url?: string;
/**
* Filters cookies by name.
*/
name?: string;
/**
* Retrieves cookies whose domains match or are subdomains of `domains`.
*/
domain?: string;
/**
* Retrieves cookies whose path matches `path`.
*/
path?: string;
/**
* Filters cookies by their Secure property.
*/
secure?: boolean;
/**
* Filters out session or persistent cookies.
*/
session?: boolean;
/**
* Filters cookies by httpOnly.
*/
httpOnly?: boolean;
}
interface CookiesSetDetails {
/**
* The URL to associate the cookie with. The promise will be rejected if the URL is
* invalid.
*/
url: string;
/**
* The name of the cookie. Empty by default if omitted.
*/
name?: string;
/**
* The value of the cookie. Empty by default if omitted.
*/
value?: string;
/**
* The domain of the cookie; this will be normalized with a preceding dot so that
* it's also valid for subdomains. Empty by default if omitted.
*/
domain?: string;
/**
* The path of the cookie. Empty by default if omitted.
*/
path?: string;
/**
* Whether the cookie should be marked as Secure. Defaults to false unless Same
* Site=None attribute is used.
*/
secure?: boolean;
/**
* Whether the cookie should be marked as HTTP only. Defaults to false.
*/
httpOnly?: boolean;
/**
* The expiration date of the cookie as the number of seconds since the UNIX epoch.
* If omitted then the cookie becomes a session cookie and will not be retained
* between sessions.
*/
expirationDate?: number;
/**
* The Same Site policy to apply to this cookie. Can be `unspecified`,
* `no_restriction`, `lax` or `strict`. Default is `lax`.
*/
sameSite?: ('unspecified' | 'no_restriction' | 'lax' | 'strict');
}
interface CrashReporterStartOptions {
/**
* URL that crash reports will be sent to as POST. Required unless `uploadToServer`
* is `false`.
*/
submitURL?: string;
/**
* Defaults to `app.name`.
*/
productName?: string;
/**
* Deprecated alias for `{ globalExtra: { _companyName: ... } }`.
*
* @deprecated
*/
companyName?: string;
/**
* Whether crash reports should be sent to the server. If false, crash reports will
* be collected and stored in the crashes directory, but not uploaded. Default is
* `true`.
*/
uploadToServer?: boolean;
/**
* If true, crashes generated in the main process will not be forwarded to the
* system crash handler. Default is `false`.
*/
ignoreSystemCrashHandler?: boolean;
/**
* If true, limit the number of crashes uploaded to 1/hour. Default is `false`.
*
* @platform darwin,win32
*/
rateLimit?: boolean;
/**
* If true, crash reports will be compressed and uploaded with `Content-Encoding:
* gzip`. Default is `true`.
*/
compress?: boolean;
/**
* Extra string key/value annotations that will be sent along with crash reports
* that are generated in the main process. Only string values are supported.
* Crashes generated in child processes will not contain these extra parameters to
* crash reports generated from child processes, call `addExtraParameter` from the
* child process.
*/
extra?: Record<string, string>;
/**
* Extra string key/value annotations that will be sent along with any crash
* reports generated in any process. These annotations cannot be changed once the
* crash reporter has been started. If a key is present in both the global extra
* parameters and the process-specific extra parameters, then the global one will
* take precedence. By default, `productName` and the app version are included, as
* well as the Electron version.
*/
globalExtra?: Record<string, string>;
}
interface CreateFromBitmapOptions {
width: number;
height: number;
/**
* Defaults to 1.0.
*/
scaleFactor?: number;
}
interface CreateFromBufferOptions {
/**
* Required for bitmap buffers.
*/
width?: number;
/**
* Required for bitmap buffers.
*/
height?: number;
/**
* Defaults to 1.0.
*/
scaleFactor?: number;
}
interface CreateInterruptedDownloadOptions {
/**
* Absolute path of the download.
*/
path: string;
/**
* Complete URL chain for the download.
*/
urlChain: string[];
mimeType?: string;
/**
* Start range for the download.
*/
offset: number;
/**
* Total length of the download.
*/
length: number;
/**
* Last-Modified header value.
*/
lastModified?: string;
/**
* ETag header value.
*/
eTag?: string;
/**
* Time when download was started in number of seconds since UNIX epoch.
*/
startTime?: number;
}
interface Data {
text?: string;
html?: string;
image?: NativeImage;
rtf?: string;
/**
* The title of the URL at `text`.
*/
bookmark?: string;
}
interface DefaultFontFamily {
/**
* Defaults to `Times New Roman`.
*/
standard?: string;
/**
* Defaults to `Times New Roman`.
*/
serif?: string;
/**
* Defaults to `Arial`.
*/
sansSerif?: string;
/**
* Defaults to `Courier New`.
*/
monospace?: string;
/**
* Defaults to `Script`.
*/
cursive?: string;
/**
* Defaults to `Impact`.
*/
fantasy?: string;
/**
* Defaults to `Latin Modern Math`.
*/
math?: string;
}
interface Details {
/**
* Process type. One of the following values:
*/
type: ('Utility' | 'Zygote' | 'Sandbox helper' | 'GPU' | 'Pepper Plugin' | 'Pepper Plugin Broker' | 'Unknown');
/**
* The reason the child process is gone. Possible values:
*/
reason: ('clean-exit' | 'abnormal-exit' | 'killed' | 'crashed' | 'oom' | 'launch-failed' | 'integrity-failure');
/**
* The exit code for the process (e.g. status from waitpid if on posix, from
* GetExitCodeProcess on Windows).
*/
exitCode: number;
/**
* The non-localized name of the process.
*/
serviceName?: string;
/**
* The name of the process. Examples for utility: `Audio Service`, `Content
* Decryption Module Service`, `Network Service`, `Video Capture`, etc.
*/
name?: string;
}
interface DevicePermissionHandlerHandlerDetails {
/**
* The type of device that permission is being requested on, can be `hid`,
* `serial`, or `usb`.
*/
deviceType: ('hid' | 'serial' | 'usb');
/**
* The origin URL of the device permission check.
*/
origin: string;
/**
* the device that permission is being requested for.
*/
device: (HIDDevice) | (SerialPort) | (USBDevice);
}
interface DevtoolsOpenUrlEvent extends DOMEvent {
/**
* URL of the link that was clicked or selected.
*/
url: string;
}
interface DidChangeThemeColorEvent extends DOMEvent {
themeColor: string;
}
interface DidCreateWindowDetails {
/**
* URL for the created window.
*/
url: string;
/**
* Name given to the created window in the `window.open()` call.
*/
frameName: string;
/**
* The options used to create the BrowserWindow. They are merged in increasing
* precedence: parsed options from the `features` string from `window.open()`,
* security-related webPreferences inherited from the parent, and options given by
* `webContents.setWindowOpenHandler`. Unrecognized options are not filtered out.
*/
options: BrowserWindowConstructorOptions;
/**
* The referrer that will be passed to the new window. May or may not result in the
* `Referer` header being sent, depending on the referrer policy.
*/
referrer: Referrer;
/**
* The post data that will be sent to the new window, along with the appropriate
* headers that will be set. If no post data is to be sent, the value will be
* `null`. Only defined when the window is being created by a form that set
* `target=_blank`.
*/
postBody?: PostBody;
/**
* Can be `default`, `foreground-tab`, `background-tab`, `new-window` or `other`.
*/
disposition: ('default' | 'foreground-tab' | 'background-tab' | 'new-window' | 'other');
}
interface DidFailLoadEvent extends DOMEvent {
errorCode: number;
errorDescription: string;
validatedURL: string;
isMainFrame: boolean;
}
interface DidFrameFinishLoadEvent extends DOMEvent {
isMainFrame: boolean;
}
interface DidFrameNavigateEvent extends DOMEvent {
url: string;
/**
* -1 for non HTTP navigations
*/
httpResponseCode: number;
/**
* empty for non HTTP navigations,
*/
httpStatusText: string;
isMainFrame: boolean;
frameProcessId: number;
frameRoutingId: number;
}
interface DidNavigateEvent extends DOMEvent {
url: string;
}
interface DidNavigateInPageEvent extends DOMEvent {
isMainFrame: boolean;
url: string;
}
interface DidRedirectNavigationEvent extends DOMEvent {
url: string;
isInPlace: boolean;
isMainFrame: boolean;
frameProcessId: number;
frameRoutingId: number;
}
interface DidStartNavigationEvent extends DOMEvent {
url: string;
isInPlace: boolean;
isMainFrame: boolean;
frameProcessId: number;
frameRoutingId: number;
}
interface DisplayBalloonOptions {
/**
* Icon to use when `iconType` is `custom`.
*/
icon?: (NativeImage) | (string);
/**
* Can be `none`, `info`, `warning`, `error` or `custom`. Default is `custom`.
*/
iconType?: ('none' | 'info' | 'warning' | 'error' | 'custom');
title: string;
content: string;
/**
* The large version of the icon should be used. Default is `true`. Maps to
* `NIIF_LARGE_ICON`.
*/
largeIcon?: boolean;
/**
* Do not play the associated sound. Default is `false`. Maps to `NIIF_NOSOUND`.
*/
noSound?: boolean;
/**
* Do not display the balloon notification if the current user is in "quiet time".
* Default is `false`. Maps to `NIIF_RESPECT_QUIET_TIME`.
*/
respectQuietTime?: boolean;
}
interface DisplayMediaRequestHandlerHandlerRequest {
/**
* Frame that is requesting access to media.
*/
frame: WebFrameMain;
/**
* Origin of the page making the request.
*/
securityOrigin: string;
/**
* true if the web content requested a video stream.
*/
videoRequested: boolean;
/**
* true if the web content requested an audio stream.
*/
audioRequested: boolean;
/**
* Whether a user gesture was active when this request was triggered.
*/
userGesture: boolean;
}
interface DownloadURLOptions {
/**
* HTTP request headers.
*/
headers?: Record<string, string>;
}
interface EnableNetworkEmulationOptions {
/**
* Whether to emulate network outage. Defaults to false.
*/
offline?: boolean;
/**
* RTT in ms. Defaults to 0 which will disable latency throttling.
*/
latency?: number;
/**
* Download rate in Bps. Defaults to 0 which will disable download throttling.
*/
downloadThroughput?: number;
/**
* Upload rate in Bps. Defaults to 0 which will disable upload throttling.
*/
uploadThroughput?: number;
}
interface FeedURLOptions {
url: string;
/**
* HTTP request headers.
*
* @platform darwin
*/
headers?: Record<string, string>;
/**
* Can be `json` or `default`, see the Squirrel.Mac README for more information.
*
* @platform darwin
*/
serverType?: ('json' | 'default');
}
interface FileIconOptions {
size: ('small' | 'normal' | 'large');
}
interface FindInPageOptions {
/**
* Whether to search forward or backward, defaults to `true`.
*/
forward?: boolean;
/**
* Whether to begin a new text finding session with this request. Should be `true`
* for initial requests, and `false` for follow-up requests. Defaults to `false`.
*/
findNext?: boolean;
/**
* Whether search should be case-sensitive, defaults to `false`.
*/
matchCase?: boolean;
}
interface FocusOptions {
/**
* Make the receiver the active app even if another app is currently active.
*
* @platform darwin
*/
steal: boolean;
}
interface ForkOptions {
/**
* Environment key-value pairs. Default is `process.env`.
*/
env?: Env;
/**
* List of string arguments passed to the executable.
*/
execArgv?: string[];
/**
* Current working directory of the child process.
*/
cwd?: string;
/**
* Allows configuring the mode for `stdout` and `stderr` of the child process.
* Default is `inherit`. String value can be one of `pipe`, `ignore`, `inherit`,
* for more details on these values you can refer to stdio documentation from
* Node.js. Currently this option only supports configuring `stdout` and `stderr`
* to either `pipe`, `inherit` or `ignore`. Configuring `stdin` is not supported;
* `stdin` will always be ignored. For example, the supported values will be
* processed as following:
*/
stdio?: (Array<'pipe' | 'ignore' | 'inherit'>) | (string);
/**
* Name of the process that will appear in `name` property of `child-process-gone`
* event of `app`. Default is `node.mojom.NodeService`.
*/
serviceName?: string;
/**
* With this flag, the utility process will be launched via the `Electron Helper
* (Plugin).app` helper executable on macOS, which can be codesigned with
* `com.apple.security.cs.disable-library-validation` and
* `com.apple.security.cs.allow-unsigned-executable-memory` entitlements. This will
* allow the utility process to load unsigned libraries. Unless you specifically
* need this capability, it is best to leave this disabled. Default is `false`.
*
* @platform darwin
*/
allowLoadingUnsignedLibraries?: boolean;
}
interface FoundInPageEvent extends DOMEvent {
result: FoundInPageResult;
}
interface FrameCreatedDetails {
frame: WebFrameMain;
}
interface FromPartitionOptions {
/**
* Whether to enable cache.
*/
cache: boolean;
}
interface FromPathOptions {
/**
* Whether to enable cache.
*/
cache: boolean;
}
interface HandlerDetails {
/**
* The _resolved_ version of the URL passed to `window.open()`. e.g. opening a
* window with `window.open('foo')` will yield something like
* `https://the-origin/the/current/path/foo`.
*/
url: string;
/**
* Name of the window provided in `window.open()`
*/
frameName: string;
/**
* Comma separated list of window features provided to `window.open()`.
*/
features: string;
/**
* Can be `default`, `foreground-tab`, `background-tab`, `new-window` or `other`.
*/
disposition: ('default' | 'foreground-tab' | 'background-tab' | 'new-window' | 'other');
/**
* The referrer that will be passed to the new window. May or may not result in the
* `Referer` header being sent, depending on the referrer policy.
*/
referrer: Referrer;
/**
* The post data that will be sent to the new window, along with the appropriate
* headers that will be set. If no post data is to be sent, the value will be
* `null`. Only defined when the window is being created by a form that set
* `target=_blank`.
*/
postBody?: PostBody;
}
interface HeadersReceivedResponse {
cancel?: boolean;
/**
* When provided, the server is assumed to have responded with these headers.
*/
responseHeaders?: Record<string, (string) | (string[])>;
/**
* Should be provided when overriding `responseHeaders` to change header status
* otherwise original response header's status will be used.
*/
statusLine?: string;
}
interface HeapStatistics {
totalHeapSize: number;
totalHeapSizeExecutable: number;
totalPhysicalSize: number;
totalAvailableSize: number;
usedHeapSize: number;
heapSizeLimit: number;
mallocedMemory: number;
peakMallocedMemory: number;
doesZapGarbage: boolean;
}
interface HidDeviceAddedDetails {
device: HIDDevice[];
frame: WebFrameMain;
}
interface HidDeviceRemovedDetails {
device: HIDDevice[];
frame: WebFrameMain;
}
interface HidDeviceRevokedDetails {
device: HIDDevice[];
/**
* The origin that the device has been revoked from.
*/
origin?: string;
}
interface IgnoreMouseEventsOptions {
/**
* If true, forwards mouse move messages to Chromium, enabling mouse related events
* such as `mouseleave`. Only used when `ignore` is true. If `ignore` is false,
* forwarding is always disabled regardless of this value.
*
* @platform darwin,win32
*/
forward?: boolean;
}
interface ImportCertificateOptions {
/**
* Path for the pkcs12 file.
*/
certificate: string;
/**
* Passphrase for the certificate.
*/
password: string;
}
interface Info {
/**
* Security origin for the isolated world.
*/
securityOrigin?: string;
/**
* Content Security Policy for the isolated world.
*/
csp?: string;
/**
* Name for isolated world. Useful in devtools.
*/
name?: string;
}
interface Input {
/**
* Either `keyUp` or `keyDown`.
*/
type: string;
/**
* Equivalent to KeyboardEvent.key.
*/
key: string;
/**
* Equivalent to KeyboardEvent.code.
*/
code: string;
/**
* Equivalent to KeyboardEvent.repeat.
*/
isAutoRepeat: boolean;
/**
* Equivalent to KeyboardEvent.isComposing.
*/
isComposing: boolean;
/**
* Equivalent to KeyboardEvent.shiftKey.
*/
shift: boolean;
/**
* Equivalent to KeyboardEvent.controlKey.
*/
control: boolean;
/**
* Equivalent to KeyboardEvent.altKey.
*/
alt: boolean;
/**
* Equivalent to KeyboardEvent.metaKey.
*/
meta: boolean;
/**
* Equivalent to KeyboardEvent.location.
*/
location: number;
/**
* See InputEvent.modifiers.
*/
modifiers: string[];
}
interface InsertCSSOptions {
/**
* Can be 'user' or 'author'. Sets the cascade origin of the inserted stylesheet.
* Default is 'author'.
*/
cssOrigin?: ('user' | 'author');
}
interface IpcMessageEvent extends DOMEvent {
/**
* pair of `[processId, frameId]`.
*/
frameId: [number, number];
channel: string;
args: any[];
}
interface Item {
/**
* The path to the file being dragged.
*/
file: string;
/**
* The paths to the files being dragged. (`files` will override `file` field)
*/
files?: string[];
/**
* The image must be non-empty on macOS.
*/
icon: (NativeImage) | (string);
}
interface JumpListSettings {
/**
* 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).
*/
minItems: number;
/**
* Array of `JumpListItem` 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 `app.setJumpList()`,
* Windows will not display any custom category that contains any of the removed
* items.
*/
removedItems: JumpListItem[];
}
interface LoadCommitEvent extends DOMEvent {
url: string;
isMainFrame: boolean;
}
interface LoadExtensionOptions {
/**
* Whether to allow the extension to read local files over `file://` protocol and
* inject content scripts into `file://` pages. This is required e.g. for loading
* devtools extensions on `file://` URLs. Defaults to false.
*/
allowFileAccess: boolean;
}
interface LoadFileOptions {
/**
* Passed to `url.format()`.
*/
query?: Record<string, string>;
/**
* Passed to `url.format()`.
*/
search?: string;
/**
* Passed to `url.format()`.
*/
hash?: string;
}
interface LoadURLOptions {
/**
* An HTTP Referrer url.
*/
httpReferrer?: (string) | (Referrer);
/**
* A user agent originating the request.
*/
userAgent?: string;
/**
* Extra headers separated by "\n"
*/
extraHeaders?: string;
postData?: Array<(UploadRawData) | (UploadFile)>;
/**
* Base url (with trailing path separator) for files to be loaded by the data url.
* This is needed only if the specified `url` is a data url and needs to load other
* files.
*/
baseURLForDataURL?: string;
}
interface LoginItemSettings {
/**
* `true` if the app is set to open at login.
*/
openAtLogin: boolean;
/**
* `true` if the app is set to open as hidden at login. This setting is not
* available on MAS builds.
*
* @platform darwin
*/
openAsHidden: boolean;
/**
* `true` if the app was opened at login automatically. This setting is not
* available on MAS builds.
*
* @platform darwin
*/
wasOpenedAtLogin: boolean;
/**
* `true` 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.
*
* @platform darwin
*/
wasOpenedAsHidden: boolean;
/**
* `true` 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.
*
* @platform darwin
*/
restoreState: boolean;
/**
* `true` if app is set to open at login and its run key is not deactivated. This
* differs from `openAtLogin` as it ignores the `args` option, this property will
* be true if the given executable would be launched at login with **any**
* arguments.
*
* @platform win32
*/
executableWillLaunchAtLogin: boolean;
launchItems: LaunchItems[];
}
interface LoginItemSettingsOptions {
/**
* The executable path to compare against. Defaults to `process.execPath`.
*
* @platform win32
*/
path?: string;
/**
* The command-line arguments to compare against. Defaults to an empty array.
*
* @platform win32
*/
args?: string[];
}
interface MenuItemConstructorOptions {
/**
* Will be called with `click(menuItem, browserWindow, event)` when the menu item
* is clicked.
*/
click?: (menuItem: MenuItem, browserWindow: (BrowserWindow) | (undefined), event: KeyboardEvent) => void;
/**
* Can be `undo`, `redo`, `cut`, `copy`, `paste`, `pasteAndMatchStyle`, `delete`,
* `selectAll`, `reload`, `forceReload`, `toggleDevTools`, `resetZoom`, `zoomIn`,
* `zoomOut`, `toggleSpellChecker`, `togglefullscreen`, `window`, `minimize`,
* `close`, `help`, `about`, `services`, `hide`, `hideOthers`, `unhide`, `quit`,
* `showSubstitutions`, `toggleSmartQuotes`, `toggleSmartDashes`,
* `toggleTextReplacement`, `startSpeaking`, `stopSpeaking`, `zoom`, `front`,
* `appMenu`, `fileMenu`, `editMenu`, `viewMenu`, `shareMenu`, `recentDocuments`,
* `toggleTabBar`, `selectNextTab`, `selectPreviousTab`, `showAllTabs`,
* `mergeAllWindows`, `clearRecentDocuments`, `moveTabToNewWindow` or `windowMenu`
* - Define the action of the menu item, when specified the `click` property will
* be ignored. See roles.
*/
role?: ('undo' | 'redo' | 'cut' | 'copy' | 'paste' | 'pasteAndMatchStyle' | 'delete' | 'selectAll' | 'reload' | 'forceReload' | 'toggleDevTools' | 'resetZoom' | 'zoomIn' | 'zoomOut' | 'toggleSpellChecker' | 'togglefullscreen' | 'window' | 'minimize' | 'close' | 'help' | 'about' | 'services' | 'hide' | 'hideOthers' | 'unhide' | 'quit' | 'showSubstitutions' | 'toggleSmartQuotes' | 'toggleSmartDashes' | 'toggleTextReplacement' | 'startSpeaking' | 'stopSpeaking' | 'zoom' | 'front' | 'appMenu' | 'fileMenu' | 'editMenu' | 'viewMenu' | 'shareMenu' | 'recentDocuments' | 'toggleTabBar' | 'selectNextTab' | 'selectPreviousTab' | 'showAllTabs' | 'mergeAllWindows' | 'clearRecentDocuments' | 'moveTabToNewWindow' | 'windowMenu');
/**
* Can be `normal`, `separator`, `submenu`, `checkbox` or `radio`.
*/
type?: ('normal' | 'separator' | 'submenu' | 'checkbox' | 'radio');
label?: string;
sublabel?: string;
/**
* Hover text for this menu item.
*
* @platform darwin
*/
toolTip?: string;
accelerator?: Accelerator;
icon?: (NativeImage) | (string);
/**
* If false, the menu item will be greyed out and unclickable.
*/
enabled?: boolean;
/**
* default is `true`, and when `false` will prevent the accelerator from triggering
* the item if the item is not visible.
*
* @platform darwin
*/
acceleratorWorksWhenHidden?: boolean;
/**
* If false, the menu item will be entirely hidden.
*/
visible?: boolean;
/**
* Should only be specified for `checkbox` or `radio` type menu items.
*/
checked?: boolean;
/**
* If false, the accelerator won't be registered with the system, but it will still
* be displayed. Defaults to true.
*
* @platform linux,win32
*/
registerAccelerator?: boolean;
/**
* The item to share when the `role` is `shareMenu`.
*
* @platform darwin
*/
sharingItem?: SharingItem;
/**
* Should be specified for `submenu` type menu items. If `submenu` is specified,
* the `type: 'submenu'` can be omitted. If the value is not a `Menu` then it will
* be automatically converted to one using `Menu.buildFromTemplate`.
*/
submenu?: (MenuItemConstructorOptions[]) | (Menu);
/**
* Unique within a single menu. If defined then it can be used as a reference to
* this item by the position attribute.
*/
id?: string;
/**
* Inserts this item before the item with the specified label. If the referenced
* item doesn't exist the item will be inserted at the end of the menu. Also
* implies that the menu item in question should be placed in the same “group” as
* the item.
*/
before?: string[];
/**
* Inserts this item after the item with the specified label. If the referenced
* item doesn't exist the item will be inserted at the end of the menu.
*/
after?: string[];
/**
* Provides a means for a single context menu to declare the placement of their
* containing group before the containing group of the item with the specified
* label.
*/
beforeGroupContaining?: string[];
/**
* Provides a means for a single context menu to declare the placement of their
* containing group after the containing group of the item with the specified
* label.
*/
afterGroupContaining?: string[];
}
interface MessageBoxOptions {
/**
* Content of the message box.
*/
message: string;
/**
* Can be `none`, `info`, `error`, `question` or `warning`. On Windows, `question`
* displays the same icon as `info`, unless you set an icon using the `icon`
* option. On macOS, both `warning` and `error` display the same warning icon.
*/
type?: ('none' | 'info' | 'error' | 'question' | 'warning');
/**
* Array of texts for buttons. On Windows, an empty array will result in one button
* labeled "OK".
*/
buttons?: string[];
/**
* Index of the button in the buttons array which will be selected by default when
* the message box opens.
*/
defaultId?: number;
/**
* Pass an instance of AbortSignal to optionally close the message box, the message
* box will behave as if it was cancelled by the user. On macOS, `signal` does not
* work with message boxes that do not have a parent window, since those message
* boxes run synchronously due to platform limitations.
*/
signal?: AbortSignal;
/**
* Title of the message box, some platforms will not show it.
*/
title?: string;
/**
* Extra information of the message.
*/
detail?: string;
/**
* If provided, the message box will include a checkbox with the given label.
*/
checkboxLabel?: string;
/**
* Initial checked state of the checkbox. `false` by default.
*/
checkboxChecked?: boolean;
icon?: (NativeImage) | (string);
/**
* Custom width of the text in the message box.
*
* @platform darwin
*/
textWidth?: number;
/**
* The index of the button to be used to cancel the dialog, via the `Esc` key. By
* default this is assigned to the first button with "cancel" or "no" as the label.
* If no such labeled buttons exist and this option is not set, `0` will be used as
* the return value.
*/
cancelId?: number;
/**
* On Windows Electron will try to figure out which one of the `buttons` are common
* buttons (like "Cancel" or "Yes"), and show the others as command links in the
* dialog. This can make the dialog appear in the style of modern Windows apps. If
* you don't like this behavior, you can set `noLink` to `true`.
*/
noLink?: boolean;
/**
* Normalize the keyboard access keys across platforms. Default is `false`.
* Enabling this assumes `&` is used in the button labels for the placement of the
* keyboard shortcut access key and labels will be converted so they work correctly
* on each platform, `&` characters are removed on macOS, converted to `_` on
* Linux, and left untouched on Windows. For example, a button label of `Vie&w`
* will be converted to `Vie_w` on Linux and `View` on macOS and can be selected
* via `Alt-W` on Windows and Linux.
*/
normalizeAccessKeys?: boolean;
}
interface MessageBoxReturnValue {
/**
* The index of the clicked button.
*/
response: number;
/**
* The checked state of the checkbox if `checkboxLabel` was set. Otherwise `false`.
*/
checkboxChecked: boolean;
}
interface MessageBoxSyncOptions {
/**
* Content of the message box.
*/
message: string;
/**
* Can be `none`, `info`, `error`, `question` or `warning`. On Windows, `question`
* displays the same icon as `info`, unless you set an icon using the `icon`
* option. On macOS, both `warning` and `error` display the same warning icon.
*/
type?: ('none' | 'info' | 'error' | 'question' | 'warning');
/**
* Array of texts for buttons. On Windows, an empty array will result in one button
* labeled "OK".
*/
buttons?: string[];
/**
* Index of the button in the buttons array which will be selected by default when
* the message box opens.
*/
defaultId?: number;
/**
* Title of the message box, some platforms will not show it.
*/
title?: string;
/**
* Extra information of the message.
*/
detail?: string;
icon?: (NativeImage) | (string);
/**
* Custom width of the text in the message box.
*
* @platform darwin
*/
textWidth?: number;
/**
* The index of the button to be used to cancel the dialog, via the `Esc` key. By
* default this is assigned to the first button with "cancel" or "no" as the label.
* If no such labeled buttons exist and this option is not set, `0` will be used as
* the return value.
*/
cancelId?: number;
/**
* On Windows Electron will try to figure out which one of the `buttons` are common
* buttons (like "Cancel" or "Yes"), and show the others as command links in the
* dialog. This can make the dialog appear in the style of modern Windows apps. If
* you don't like this behavior, you can set `noLink` to `true`.
*/
noLink?: boolean;
/**
* Normalize the keyboard access keys across platforms. Default is `false`.
* Enabling this assumes `&` is used in the button labels for the placement of the
* keyboard shortcut access key and labels will be converted so they work correctly
* on each platform, `&` characters are removed on macOS, converted to `_` on
* Linux, and left untouched on Windows. For example, a button label of `Vie&w`
* will be converted to `Vie_w` on Linux and `View` on macOS and can be selected
* via `Alt-W` on Windows and Linux.
*/
normalizeAccessKeys?: boolean;
}
interface MessageDetails {
/**
* The actual console message
*/
message: string;
/**
* The version ID of the service worker that sent the log message
*/
versionId: number;
/**
* The type of source for this message. Can be `javascript`, `xml`, `network`,
* `console-api`, `storage`, `rendering`, `security`, `deprecation`, `worker`,
* `violation`, `intervention`, `recommendation` or `other`.
*/
source: ('javascript' | 'xml' | 'network' | 'console-api' | 'storage' | 'rendering' | 'security' | 'deprecation' | 'worker' | 'violation' | 'intervention' | 'recommendation' | 'other');
/**
* The log level, from 0 to 3. In order it matches `verbose`, `info`, `warning` and
* `error`.
*/
level: number;
/**
* The URL the message came from
*/
sourceUrl: string;
/**
* The line number of the source that triggered this console message
*/
lineNumber: number;
}
interface MessageEvent {
data: any;
ports: MessagePortMain[];
}
interface MoveToApplicationsFolderOptions {
/**
* A handler for potential conflict in move failure.
*/
conflictHandler?: (conflictType: 'exists' | 'existsAndRunning') => boolean;
}
interface NotificationConstructorOptions {
/**
* A title for the notification, which will be displayed at the top of the
* notification window when it is shown.
*/
title?: string;
/**
* A subtitle for the notification, which will be displayed below the title.
*
* @platform darwin
*/
subtitle?: string;
/**
* The body text of the notification, which will be displayed below the title or
* subtitle.
*/
body?: string;
/**
* Whether or not to suppress the OS notification noise when showing the
* notification.
*/
silent?: boolean;
/**
* An icon to use in the notification.
*/
icon?: (string) | (NativeImage);
/**
* Whether or not to add an inline reply option to the notification.
*
* @platform darwin
*/
hasReply?: boolean;
/**
* The timeout duration of the notification. Can be 'default' or 'never'.
*
* @platform linux,win32
*/
timeoutType?: ('default' | 'never');
/**
* The placeholder to write in the inline reply input field.
*
* @platform darwin
*/
replyPlaceholder?: string;
/**
* The name of the sound file to play when the notification is shown.
*
* @platform darwin
*/
sound?: string;
/**
* The urgency level of the notification. Can be 'normal', 'critical', or 'low'.
*
* @platform linux
*/
urgency?: ('normal' | 'critical' | 'low');
/**
* Actions to add to the notification. Please read the available actions and
* limitations in the `NotificationAction` documentation.
*
* @platform darwin
*/
actions?: NotificationAction[];
/**
* A custom title for the close button of an alert. An empty string will cause the
* default localized text to be used.
*
* @platform darwin
*/
closeButtonText?: string;
/**
* A custom description of the Notification on Windows superseding all properties
* above. Provides full customization of design and behavior of the notification.
*
* @platform win32
*/
toastXml?: string;
}
interface OnBeforeRedirectListenerDetails {
id: number;
url: string;
method: string;
webContentsId?: number;
webContents?: WebContents;
frame?: WebFrameMain;
/**
* Can be `mainFrame`, `subFrame`, `stylesheet`, `script`, `image`, `font`,
* `object`, `xhr`, `ping`, `cspReport`, `media`, `webSocket` or `other`.
*/
resourceType: ('mainFrame' | 'subFrame' | 'stylesheet' | 'script' | 'image' | 'font' | 'object' | 'xhr' | 'ping' | 'cspReport' | 'media' | 'webSocket' | 'other');
referrer: string;
timestamp: number;
redirectURL: string;
statusCode: number;
statusLine: string;
/**
* The server IP address that the request was actually sent to.
*/
ip?: string;
fromCache: boolean;
responseHeaders?: Record<string, string[]>;
}
interface OnBeforeRequestListenerDetails {
id: number;
url: string;
method: string;
webContentsId?: number;
webContents?: WebContents;
frame?: WebFrameMain;
/**
* Can be `mainFrame`, `subFrame`, `stylesheet`, `script`, `image`, `font`,
* `object`, `xhr`, `ping`, `cspReport`, `media`, `webSocket` or `other`.
*/
resourceType: ('mainFrame' | 'subFrame' | 'stylesheet' | 'script' | 'image' | 'font' | 'object' | 'xhr' | 'ping' | 'cspReport' | 'media' | 'webSocket' | 'other');
referrer: string;
timestamp: number;
uploadData: UploadData[];
}
interface OnBeforeSendHeadersListenerDetails {
id: number;
url: string;
method: string;
webContentsId?: number;
webContents?: WebContents;
frame?: WebFrameMain;
/**
* Can be `mainFrame`, `subFrame`, `stylesheet`, `script`, `image`, `font`,
* `object`, `xhr`, `ping`, `cspReport`, `media`, `webSocket` or `other`.
*/
resourceType: ('mainFrame' | 'subFrame' | 'stylesheet' | 'script' | 'image' | 'font' | 'object' | 'xhr' | 'ping' | 'cspReport' | 'media' | 'webSocket' | 'other');
referrer: string;
timestamp: number;
uploadData?: UploadData[];
requestHeaders: Record<string, string>;
}
interface OnCompletedListenerDetails {
id: number;
url: string;
method: string;
webContentsId?: number;
webContents?: WebContents;
frame?: WebFrameMain;
/**
* Can be `mainFrame`, `subFrame`, `stylesheet`, `script`, `image`, `font`,
* `object`, `xhr`, `ping`, `cspReport`, `media`, `webSocket` or `other`.
*/
resourceType: ('mainFrame' | 'subFrame' | 'stylesheet' | 'script' | 'image' | 'font' | 'object' | 'xhr' | 'ping' | 'cspReport' | 'media' | 'webSocket' | 'other');
referrer: string;
timestamp: number;
responseHeaders?: Record<string, string[]>;
fromCache: boolean;
statusCode: number;
statusLine: string;
error: string;
}
interface OnErrorOccurredListenerDetails {
id: number;
url: string;
method: string;
webContentsId?: number;
webContents?: WebContents;
frame?: WebFrameMain;
/**
* Can be `mainFrame`, `subFrame`, `stylesheet`, `script`, `image`, `font`,
* `object`, `xhr`, `ping`, `cspReport`, `media`, `webSocket` or `other`.
*/
resourceType: ('mainFrame' | 'subFrame' | 'stylesheet' | 'script' | 'image' | 'font' | 'object' | 'xhr' | 'ping' | 'cspReport' | 'media' | 'webSocket' | 'other');
referrer: string;
timestamp: number;
fromCache: boolean;
/**
* The error description.
*/
error: string;
}
interface OnHeadersReceivedListenerDetails {
id: number;
url: string;
method: string;
webContentsId?: number;
webContents?: WebContents;
frame?: WebFrameMain;
/**
* Can be `mainFrame`, `subFrame`, `stylesheet`, `script`, `image`, `font`,
* `object`, `xhr`, `ping`, `cspReport`, `media`, `webSocket` or `other`.
*/
resourceType: ('mainFrame' | 'subFrame' | 'stylesheet' | 'script' | 'image' | 'font' | 'object' | 'xhr' | 'ping' | 'cspReport' | 'media' | 'webSocket' | 'other');
referrer: string;
timestamp: number;
statusLine: string;
statusCode: number;
responseHeaders?: Record<string, string[]>;
}
interface OnResponseStartedListenerDetails {
id: number;
url: string;
method: string;
webContentsId?: number;
webContents?: WebContents;
frame?: WebFrameMain;
/**
* Can be `mainFrame`, `subFrame`, `stylesheet`, `script`, `image`, `font`,
* `object`, `xhr`, `ping`, `cspReport`, `media`, `webSocket` or `other`.
*/
resourceType: ('mainFrame' | 'subFrame' | 'stylesheet' | 'script' | 'image' | 'font' | 'object' | 'xhr' | 'ping' | 'cspReport' | 'media' | 'webSocket' | 'other');
referrer: string;
timestamp: number;
responseHeaders?: Record<string, string[]>;
/**
* Indicates whether the response was fetched from disk cache.
*/
fromCache: boolean;
statusCode: number;
statusLine: string;
}
interface OnSendHeadersListenerDetails {
id: number;
url: string;
method: string;
webContentsId?: number;
webContents?: WebContents;
frame?: WebFrameMain;
/**
* Can be `mainFrame`, `subFrame`, `stylesheet`, `script`, `image`, `font`,
* `object`, `xhr`, `ping`, `cspReport`, `media`, `webSocket` or `other`.
*/
resourceType: ('mainFrame' | 'subFrame' | 'stylesheet' | 'script' | 'image' | 'font' | 'object' | 'xhr' | 'ping' | 'cspReport' | 'media' | 'webSocket' | 'other');
referrer: string;
timestamp: number;
requestHeaders: Record<string, string>;
}
interface OpenDevToolsOptions {
/**
* Opens the devtools with specified dock state, can be `left`, `right`, `bottom`,
* `undocked`, `detach`. Defaults to last used dock state. In `undocked` mode it's
* possible to dock back. In `detach` mode it's not.
*/
mode: ('left' | 'right' | 'bottom' | 'undocked' | 'detach');
/**
* Whether to bring the opened devtools window to the foreground. The default is
* `true`.
*/
activate?: boolean;
/**
* A title for the DevTools window (only in `undocked` or `detach` mode).
*/
title?: string;
}
interface OpenDialogOptions {
title?: string;
defaultPath?: string;
/**
* Custom label for the confirmation button, when left empty the default label will
* be used.
*/
buttonLabel?: string;
filters?: FileFilter[];
/**
* Contains which features the dialog should use. The following values are
* supported:
*/
properties?: Array<'openFile' | 'openDirectory' | 'multiSelections' | 'showHiddenFiles' | 'createDirectory' | 'promptToCreate' | 'noResolveAliases' | 'treatPackageAsDirectory' | 'dontAddToRecent'>;
/**
* Message to display above input boxes.
*
* @platform darwin
*/
message?: string;
/**
* Create security scoped bookmarks when packaged for the Mac App Store.
*
* @platform darwin,mas
*/
securityScopedBookmarks?: boolean;
}
interface OpenDialogReturnValue {
/**
* whether or not the dialog was canceled.
*/
canceled: boolean;
/**
* An array of file paths chosen by the user. If the dialog is cancelled this will
* be an empty array.
*/
filePaths: string[];
/**
* An array matching the `filePaths` array of base64 encoded strings which contains
* security scoped bookmark data. `securityScopedBookmarks` must be enabled for
* this to be populated. (For return values, see table here.)
*
* @platform darwin,mas
*/
bookmarks?: string[];
}
interface OpenDialogSyncOptions {
title?: string;
defaultPath?: string;
/**
* Custom label for the confirmation button, when left empty the default label will
* be used.
*/
buttonLabel?: string;
filters?: FileFilter[];
/**
* Contains which features the dialog should use. The following values are
* supported:
*/
properties?: Array<'openFile' | 'openDirectory' | 'multiSelections' | 'showHiddenFiles' | 'createDirectory' | 'promptToCreate' | 'noResolveAliases' | 'treatPackageAsDirectory' | 'dontAddToRecent'>;
/**
* Message to display above input boxes.
*
* @platform darwin
*/
message?: string;
/**
* Create security scoped bookmarks when packaged for the Mac App Store.
*
* @platform darwin,mas
*/
securityScopedBookmarks?: boolean;
}
interface OpenExternalOptions {
/**
* `true` to bring the opened application to the foreground. The default is `true`.
*
* @platform darwin
*/
activate?: boolean;
/**
* The working directory.
*
* @platform win32
*/
workingDirectory?: string;
/**
* Indicates a user initiated launch that enables tracking of frequently used
* programs and other behaviors. The default is `false`.
*
* @platform win32
*/
logUsage?: boolean;
}
interface Options {
}
interface Opts {
/**
* Keep the page hidden instead of visible. Default is `false`.
*/
stayHidden?: boolean;
/**
* Keep the system awake instead of allowing it to sleep. Default is `false`.
*/
stayAwake?: boolean;
}
interface PageFaviconUpdatedEvent extends DOMEvent {
/**
* Array of URLs.
*/
favicons: string[];
}
interface PageTitleUpdatedEvent extends DOMEvent {
title: string;
explicitSet: boolean;
}
interface Parameters {
/**
* Specify the screen type to emulate (default: `desktop`):
*/
screenPosition: ('desktop' | 'mobile');
/**
* Set the emulated screen size (screenPosition == mobile).
*/
screenSize: Size;
/**
* Position the view on the screen (screenPosition == mobile) (default: `{ x: 0, y:
* 0 }`).
*/
viewPosition: Point;
/**
* Set the device scale factor (if zero defaults to original device scale factor)
* (default: `0`).
*/
deviceScaleFactor: number;
/**
* Set the emulated view size (empty means no override)
*/
viewSize: Size;
/**
* Scale of emulated view inside available space (not in fit to view mode)
* (default: `1`).
*/
scale: number;
}
interface Payment {
/**
* The identifier of the purchased product.
*/
productIdentifier: string;
/**
* The quantity purchased.
*/
quantity: number;
/**
* An opaque identifier for the user’s account on your system.
*/
applicationUsername: string;
/**
* The details of the discount offer to apply to the payment.
*/
paymentDiscount?: PaymentDiscount;
}
interface PermissionCheckHandlerHandlerDetails {
/**
* The origin of the frame embedding the frame that made the permission check.
* Only set for cross-origin sub frames making permission checks.
*/
embeddingOrigin?: string;
/**
* The security origin of the `media` check.
*/
securityOrigin?: string;
/**
* The type of media access being requested, can be `video`, `audio` or `unknown`
*/
mediaType?: ('video' | 'audio' | 'unknown');
/**
* The last URL the requesting frame loaded. This is not provided for cross-origin
* sub frames making permission checks.
*/
requestingUrl?: string;
/**
* Whether the frame making the request is the main frame
*/
isMainFrame: boolean;
}
interface PermissionRequestHandlerHandlerDetails {
/**
* The url of the `openExternal` request.
*/
externalURL?: string;
/**
* The security origin of the `media` request.
*/
securityOrigin?: string;
/**
* The types of media access being requested, elements can be `video` or `audio`
*/
mediaTypes?: Array<'video' | 'audio'>;
/**
* The last URL the requesting frame loaded
*/
requestingUrl: string;
/**
* Whether the frame making the request is the main frame
*/
isMainFrame: boolean;
}
interface PluginCrashedEvent extends DOMEvent {
name: string;
version: string;
}
interface PopupOptions {
/**
* Default is the focused window.
*/
window?: BrowserWindow;
/**
* Default is the current mouse cursor position. Must be declared if `y` is
* declared.
*/
x?: number;
/**
* Default is the current mouse cursor position. Must be declared if `x` is
* declared.
*/
y?: number;
/**
* The index of the menu item to be positioned under the mouse cursor at the
* specified coordinates. Default is -1.
*
* @platform darwin
*/
positioningItem?: number;
/**
* This should map to the `menuSourceType` provided by the `context-menu` event. It
* is not recommended to set this value manually, only provide values you receive
* from other APIs or leave it `undefined`. Can be `none`, `mouse`, `keyboard`,
* `touch`, `touchMenu`, `longPress`, `longTap`, `touchHandle`, `stylus`,
* `adjustSelection`, or `adjustSelectionReset`.
*
* @platform win32,linux
*/
sourceType?: ('none' | 'mouse' | 'keyboard' | 'touch' | 'touchMenu' | 'longPress' | 'longTap' | 'touchHandle' | 'stylus' | 'adjustSelection' | 'adjustSelectionReset');
/**
* Called when menu is closed.
*/
callback?: () => void;
}
interface PreconnectOptions {
/**
* URL for preconnect. Only the origin is relevant for opening the socket.
*/
url: string;
/**
* number of sockets to preconnect. Must be between 1 and 6. Defaults to 1.
*/
numSockets?: number;
}
interface PrintToPDFOptions {
/**
* Paper orientation.`true` for landscape, `false` for portrait. Defaults to false.
*/
landscape?: boolean;
/**
* Whether to display header and footer. Defaults to false.
*/
displayHeaderFooter?: boolean;
/**
* Whether to print background graphics. Defaults to false.
*/
printBackground?: boolean;
/**
* Scale of the webpage rendering. Defaults to 1.
*/
scale?: number;
/**
* Specify page size of the generated PDF. Can be `A0`, `A1`, `A2`, `A3`, `A4`,
* `A5`, `A6`, `Legal`, `Letter`, `Tabloid`, `Ledger`, or an Object containing
* `height` and `width` in inches. Defaults to `Letter`.
*/
pageSize?: (('A0' | 'A1' | 'A2' | 'A3' | 'A4' | 'A5' | 'A6' | 'Legal' | 'Letter' | 'Tabloid' | 'Ledger')) | (Size);
margins?: Margins;
/**
* Page ranges to print, e.g., '1-5, 8, 11-13'. Defaults to the empty string, which
* means print all pages.
*/
pageRanges?: string;
/**
* HTML template for the print header. Should be valid HTML markup with following
* classes used to inject printing values into them: `date` (formatted print date),
* `title` (document title), `url` (document location), `pageNumber` (current page
* number) and `totalPages` (total pages in the document). For example, `<span
* class=title></span>` would generate span containing the title.
*/
headerTemplate?: string;
/**
* HTML template for the print footer. Should use the same format as the
* `headerTemplate`.
*/
footerTemplate?: string;
/**
* Whether or not to prefer page size as defined by css. Defaults to false, in
* which case the content will be scaled to fit the paper size.
*/
preferCSSPageSize?: boolean;
}
interface Privileges {
/**
* Default false.
*/
standard?: boolean;
/**
* Default false.
*/
secure?: boolean;
/**
* Default false.
*/
bypassCSP?: boolean;
/**
* Default false.
*/
allowServiceWorkers?: boolean;
/**
* Default false.
*/
supportFetchAPI?: boolean;
/**
* Default false.
*/
corsEnabled?: boolean;
/**
* Default false.
*/
stream?: boolean;
}
interface ProgressBarOptions {
/**
* Mode for the progress bar. Can be `none`, `normal`, `indeterminate`, `error` or
* `paused`.
*
* @platform win32
*/
mode: ('none' | 'normal' | 'indeterminate' | 'error' | 'paused');
}
interface Provider {
spellCheck: (words: string[], callback: (misspeltWords: string[]) => void) => void;
}
interface PurchaseProductOpts {
/**
* The number of items the user wants to purchase.
*/
quantity?: number;
/**
* The string that associates the transaction with a user account on your service
* (applicationUsername).
*/
username?: string;
}
interface ReadBookmark {
title: string;
url: string;
}
interface RegistrationCompletedDetails {
/**
* The base URL that a service worker is registered for
*/
scope: string;
}
interface RelaunchOptions {
args?: string[];
execPath?: string;
}
interface RenderProcessGoneEvent extends DOMEvent {
details: RenderProcessGoneDetails;
}
interface Request {
hostname: string;
certificate: Certificate;
validatedCertificate: Certificate;
/**
* `true` if Chromium recognises the root CA as a standard root. If it isn't then
* it's probably the case that this certificate was generated by a MITM proxy whose
* root has been installed locally (for example, by a corporate proxy). This should
* not be trusted if the `verificationResult` is not `OK`.
*/
isIssuedByKnownRoot: boolean;
/**
* `OK` if the certificate is trusted, otherwise an error like `CERT_REVOKED`.
*/
verificationResult: string;
/**
* Error code.
*/
errorCode: number;
}
interface ResizeOptions {
/**
* Defaults to the image's width.
*/
width?: number;
/**
* Defaults to the image's height.
*/
height?: number;
/**
* The desired quality of the resize image. Possible values include `good`,
* `better`, or `best`. The default is `best`. These values express a desired
* quality/speed tradeoff. They are translated into an algorithm-specific method
* that depends on the capabilities (CPU, GPU) of the underlying platform. It is
* possible for all three methods to be mapped to the same algorithm on a given
* platform.
*/
quality?: ('good' | 'better' | 'best');
}
interface ResolveHostOptions {
/**
* Requested DNS query type. If unspecified, resolver will pick A or AAAA (or both)
* based on IPv4/IPv6 settings:
*/
queryType?: ('A' | 'AAAA');
/**
* The source to use for resolved addresses. Default allows the resolver to pick an
* appropriate source. Only affects use of big external sources (e.g. calling the
* system for resolution or using DNS). Even if a source is specified, results can
* still come from cache, resolving "localhost" or IP literals, etc. One of the
* following values:
*/
source?: ('any' | 'system' | 'dns' | 'mdns' | 'localOnly');
/**
* Indicates what DNS cache entries, if any, can be used to provide a response. One
* of the following values:
*/
cacheUsage?: ('allowed' | 'staleAllowed' | 'disallowed');
/**
* Controls the resolver's Secure DNS behavior for this request. One of the
* following values:
*/
secureDnsPolicy?: ('allow' | 'disable');
}
interface ResourceUsage {
images: MemoryUsageDetails;
scripts: MemoryUsageDetails;
cssStyleSheets: MemoryUsageDetails;
xslStyleSheets: MemoryUsageDetails;
fonts: MemoryUsageDetails;
other: MemoryUsageDetails;
}
interface Response {
/**
* `false` should be passed in if the dialog is canceled. If the `pairingKind` is
* `confirm` or `confirmPin`, this value should indicate if the pairing is
* confirmed. If the `pairingKind` is `providePin` the value should be `true` when
* a value is provided.
*/
confirmed: boolean;
/**
* When the `pairingKind` is `providePin` this value should be the required pin for
* the Bluetooth device.
*/
pin?: (string) | (null);
}
interface Result {
requestId: number;
/**
* Position of the active match.
*/
activeMatchOrdinal: number;
/**
* Number of Matches.
*/
matches: number;
/**
* Coordinates of first match region.
*/
selectionArea: Rectangle;
finalUpdate: boolean;
}
interface SaveDialogOptions {
/**
* The dialog title. Cannot be displayed on some _Linux_ desktop environments.
*/
title?: string;
/**
* Absolute directory path, absolute file path, or file name to use by default.
*/
defaultPath?: string;
/**
* Custom label for the confirmation button, when left empty the default label will
* be used.
*/
buttonLabel?: string;
filters?: FileFilter[];
/**
* Message to display above text fields.
*
* @platform darwin
*/
message?: string;
/**
* Custom label for the text displayed in front of the filename text field.
*
* @platform darwin
*/
nameFieldLabel?: string;
/**
* Show the tags input box, defaults to `true`.
*
* @platform darwin
*/
showsTagField?: boolean;
properties?: Array<'showHiddenFiles' | 'createDirectory' | 'treatPackageAsDirectory' | 'showOverwriteConfirmation' | 'dontAddToRecent'>;
/**
* Create a security scoped bookmark when packaged for the Mac App Store. If this
* option is enabled and the file doesn't already exist a blank file will be
* created at the chosen path.
*
* @platform darwin,mas
*/
securityScopedBookmarks?: boolean;
}
interface SaveDialogReturnValue {
/**
* whether or not the dialog was canceled.
*/
canceled: boolean;
/**
* If the dialog is canceled, this will be `undefined`.
*/
filePath?: string;
/**
* Base64 encoded string which contains the security scoped bookmark data for the
* saved file. `securityScopedBookmarks` must be enabled for this to be present.
* (For return values, see table here.)
*
* @platform darwin,mas
*/
bookmark?: string;
}
interface SaveDialogSyncOptions {
/**
* The dialog title. Cannot be displayed on some _Linux_ desktop environments.
*/
title?: string;
/**
* Absolute directory path, absolute file path, or file name to use by default.
*/
defaultPath?: string;
/**
* Custom label for the confirmation button, when left empty the default label will
* be used.
*/
buttonLabel?: string;
filters?: FileFilter[];
/**
* Message to display above text fields.
*
* @platform darwin
*/
message?: string;
/**
* Custom label for the text displayed in front of the filename text field.
*
* @platform darwin
*/
nameFieldLabel?: string;
/**
* Show the tags input box, defaults to `true`.
*
* @platform darwin
*/
showsTagField?: boolean;
properties?: Array<'showHiddenFiles' | 'createDirectory' | 'treatPackageAsDirectory' | 'showOverwriteConfirmation' | 'dontAddToRecent'>;
/**
* Create a security scoped bookmark when packaged for the Mac App Store. If this
* option is enabled and the file doesn't already exist a blank file will be
* created at the chosen path.
*
* @platform darwin,mas
*/
securityScopedBookmarks?: boolean;
}
interface SelectHidDeviceDetails {
deviceList: HIDDevice[];
frame: WebFrameMain;
}
interface SelectUsbDeviceDetails {
deviceList: USBDevice[];
frame: WebFrameMain;
}
interface SerialPortRevokedDetails {
port: SerialPort;
frame: WebFrameMain;
/**
* The origin that the device has been revoked from.
*/
origin: string;
}
interface Settings {
/**
* `true` to open the app at login, `false` to remove the app as a login item.
* Defaults to `false`.
*/
openAtLogin?: boolean;
/**
* `true` to open the app as hidden. Defaults to `false`. The user can edit this
* setting from the System Preferences so
* `app.getLoginItemSettings().wasOpenedAsHidden` should be checked when the app is
* opened to know the current value. This setting is not available on MAS builds.
*
* @platform darwin
*/
openAsHidden?: boolean;
/**
* The executable to launch at login. Defaults to `process.execPath`.
*
* @platform win32
*/
path?: string;
/**
* The command-line arguments to pass to the executable. Defaults to an empty
* array. Take care to wrap paths in quotes.
*
* @platform win32
*/
args?: string[];
/**
* `true` will change the startup approved registry key and `enable / disable` the
* App in Task Manager and Windows Settings. Defaults to `true`.
*
* @platform win32
*/
enabled?: boolean;
/**
* value name to write into registry. Defaults to the app's AppUserModelId(). Set
* the app's login item settings.
*
* @platform win32
*/
name?: string;
}
interface SourcesOptions {
/**
* An array of strings that lists the types of desktop sources to be captured,
* available types can be `screen` and `window`.
*/
types: Array<'screen' | 'window'>;
/**
* The size that the media source thumbnail should be scaled to. Default is `150` x
* `150`. Set width or height to 0 when you do not need the thumbnails. This will
* save the processing time required for capturing the content of each window and
* screen.
*/
thumbnailSize?: Size;
/**
* Set to true to enable fetching window icons. The default value is false. When
* false the appIcon property of the sources return null. Same if a source has the
* type screen.
*/
fetchWindowIcons?: boolean;
}
interface SSLConfigConfig {
/**
* Can be `tls1`, `tls1.1`, `tls1.2` or `tls1.3`. The minimum SSL version to allow
* when connecting to remote servers. Defaults to `tls1`.
*/
minVersion?: ('tls1' | 'tls1.1' | 'tls1.2' | 'tls1.3');
/**
* Can be `tls1.2` or `tls1.3`. The maximum SSL version to allow when connecting to
* remote servers. Defaults to `tls1.3`.
*/
maxVersion?: ('tls1.2' | 'tls1.3');
/**
* List of cipher suites which should be explicitly prevented from being used in
* addition to those disabled by the net built-in policy. Supported literal forms:
* 0xAABB, where AA is `cipher_suite[0]` and BB is `cipher_suite[1]`, as defined in
* RFC 2246, Section 7.4.1.2. Unrecognized but parsable cipher suites in this form
* will not return an error. Ex: To disable TLS_RSA_WITH_RC4_128_MD5, specify
* 0x0004, while to disable TLS_ECDH_ECDSA_WITH_RC4_128_SHA, specify 0xC002. Note
* that TLSv1.3 ciphers cannot be disabled using this mechanism.
*/
disabledCipherSuites?: number[];
}
interface StartLoggingOptions {
/**
* What kinds of data should be captured. By default, only metadata about requests
* will be captured. Setting this to `includeSensitive` will include cookies and
* authentication data. Setting it to `everything` will include all bytes
* transferred on sockets. Can be `default`, `includeSensitive` or `everything`.
*/
captureMode?: ('default' | 'includeSensitive' | 'everything');
/**
* When the log grows beyond this size, logging will automatically stop. Defaults
* to unlimited.
*/
maxFileSize?: number;
}
interface Streams {
video?: (Video) | (WebFrameMain);
/**
* If a string is specified, can be `loopback` or `loopbackWithMute`. Specifying a
* loopback device will capture system audio, and is currently only supported on
* Windows. If a WebFrameMain is specified, will capture audio from that frame.
*/
audio?: (('loopback' | 'loopbackWithMute')) | (WebFrameMain);
/**
* If `audio` is a WebFrameMain and this is set to `true`, then local playback of
* audio will not be muted (e.g. using `MediaRecorder` to record `WebFrameMain`
* with this flag set to `true` will allow audio to pass through to the speakers
* while recording). Default is `false`.
*/
enableLocalEcho?: boolean;
}
interface SystemMemoryInfo {
/**
* The total amount of physical memory in Kilobytes available to the system.
*/
total: number;
/**
* The total amount of memory not being used by applications or disk cache.
*/
free: number;
/**
* The total amount of swap memory in Kilobytes available to the system.
*
* @platform win32,linux
*/
swapTotal: number;
/**
* The free amount of swap memory in Kilobytes available to the system.
*
* @platform win32,linux
*/
swapFree: number;
}
interface TitleBarOverlay {
/**
* The CSS color of the Window Controls Overlay when enabled. Default is the system
* color.
*
* @platform win32
*/
color?: string;
/**
* The CSS color of the symbols on the Window Controls Overlay when enabled.
* Default is the system color.
*
* @platform win32
*/
symbolColor?: string;
/**
* The height of the title bar and Window Controls Overlay in pixels. Default is
* system height.
*
* @platform darwin,win32
*/
height?: number;
}
interface TitleBarOverlayOptions {
/**
* The CSS color of the Window Controls Overlay when enabled.
*
* @platform win32
*/
color?: string;
/**
* The CSS color of the symbols on the Window Controls Overlay when enabled.
*
* @platform win32
*/
symbolColor?: string;
/**
* The height of the title bar and Window Controls Overlay in pixels.
*
* @platform win32
*/
height?: number;
}
interface TitleOptions {
/**
* The font family variant to display, can be `monospaced` or `monospacedDigit`.
* `monospaced` is available in macOS 10.15+ When left blank, the title uses the
* default system font.
*/
fontType?: ('monospaced' | 'monospacedDigit');
}
interface ToBitmapOptions {
/**
* Defaults to 1.0.
*/
scaleFactor?: number;
}
interface ToDataURLOptions {
/**
* Defaults to 1.0.
*/
scaleFactor?: number;
}
interface ToPNGOptions {
/**
* Defaults to 1.0.
*/
scaleFactor?: number;
}
interface TouchBarButtonConstructorOptions {
/**
* Button text.
*/
label?: string;
/**
* A short description of the button for use by screenreaders like VoiceOver.
*/
accessibilityLabel?: string;
/**
* Button background color in hex format, i.e `#ABCDEF`.
*/
backgroundColor?: string;
/**
* Button icon.
*/
icon?: (NativeImage) | (string);
/**
* Can be `left`, `right` or `overlay`. Defaults to `overlay`.
*/
iconPosition?: ('left' | 'right' | 'overlay');
/**
* Function to call when the button is clicked.
*/
click?: () => void;
/**
* Whether the button is in an enabled state. Default is `true`.
*/
enabled?: boolean;
}
interface TouchBarColorPickerConstructorOptions {
/**
* Array of hex color strings to appear as possible colors to select.
*/
availableColors?: string[];
/**
* The selected hex color in the picker, i.e `#ABCDEF`.
*/
selectedColor?: string;
/**
* Function to call when a color is selected.
*/
change?: (color: string) => void;
}
interface TouchBarConstructorOptions {
items?: Array<(TouchBarButton) | (TouchBarColorPicker) | (TouchBarGroup) | (TouchBarLabel) | (TouchBarPopover) | (TouchBarScrubber) | (TouchBarSegmentedControl) | (TouchBarSlider) | (TouchBarSpacer)>;
escapeItem?: (TouchBarButton) | (TouchBarColorPicker) | (TouchBarGroup) | (TouchBarLabel) | (TouchBarPopover) | (TouchBarScrubber) | (TouchBarSegmentedControl) | (TouchBarSlider) | (TouchBarSpacer) | (null);
}
interface TouchBarGroupConstructorOptions {
/**
* Items to display as a group.
*/
items: TouchBar;
}
interface TouchBarLabelConstructorOptions {
/**
* Text to display.
*/
label?: string;
/**
* A short description of the button for use by screenreaders like VoiceOver.
*/
accessibilityLabel?: string;
/**
* Hex color of text, i.e `#ABCDEF`.
*/
textColor?: string;
}
interface TouchBarPopoverConstructorOptions {
/**
* Popover button text.
*/
label?: string;
/**
* Popover button icon.
*/
icon?: NativeImage;
/**
* Items to display in the popover.
*/
items: TouchBar;
/**
* `true` to display a close button on the left of the popover, `false` to not show
* it. Default is `true`.
*/
showCloseButton?: boolean;
}
interface TouchBarScrubberConstructorOptions {
/**
* An array of items to place in this scrubber.
*/
items: ScrubberItem[];
/**
* Called when the user taps an item that was not the last tapped item.
*/
select?: (selectedIndex: number) => void;
/**
* Called when the user taps any item.
*/
highlight?: (highlightedIndex: number) => void;
/**
* Selected item style. Can be `background`, `outline` or `none`. Defaults to
* `none`.
*/
selectedStyle?: ('background' | 'outline' | 'none');
/**
* Selected overlay item style. Can be `background`, `outline` or `none`. Defaults
* to `none`.
*/
overlayStyle?: ('background' | 'outline' | 'none');
/**
* Whether to show arrow buttons. Defaults to `false` and is only shown if `items`
* is non-empty.
*/
showArrowButtons?: boolean;
/**
* Can be `fixed` or `free`. The default is `free`.
*/
mode?: ('fixed' | 'free');
/**
* Defaults to `true`.
*/
continuous?: boolean;
}
interface TouchBarSegmentedControlConstructorOptions {
/**
* Style of the segments:
*/
segmentStyle?: ('automatic' | 'rounded' | 'textured-rounded' | 'round-rect' | 'textured-square' | 'capsule' | 'small-square' | 'separated');
/**
* The selection mode of the control:
*/
mode?: ('single' | 'multiple' | 'buttons');
/**
* An array of segments to place in this control.
*/
segments: SegmentedControlSegment[];
/**
* The index of the currently selected segment, will update automatically with user
* interaction. When the mode is `multiple` it will be the last selected item.
*/
selectedIndex?: number;
/**
* Called when the user selects a new segment.
*/
change?: (selectedIndex: number, isSelected: boolean) => void;
}
interface TouchBarSliderConstructorOptions {
/**
* Label text.
*/
label?: string;
/**
* Selected value.
*/
value?: number;
/**
* Minimum value.
*/
minValue?: number;
/**
* Maximum value.
*/
maxValue?: number;
/**
* Function to call when the slider is changed.
*/
change?: (newValue: number) => void;
}
interface TouchBarSpacerConstructorOptions {
/**
* Size of spacer, possible values are:
*/
size?: ('small' | 'large' | 'flexible');
}
interface TraceBufferUsageReturnValue {
value: number;
percentage: number;
}
interface UpdateTargetUrlEvent extends DOMEvent {
url: string;
}
interface UploadProgress {
/**
* Whether the request is currently active. If this is false no other properties
* will be set
*/
active: boolean;
/**
* Whether the upload has started. If this is false both `current` and `total` will
* be set to 0.
*/
started: boolean;
/**
* The number of bytes that have been uploaded so far
*/
current: number;
/**
* The number of bytes that will be uploaded this request
*/
total: number;
}
interface UsbDeviceRevokedDetails {
device: USBDevice;
/**
* The origin that the device has been revoked from.
*/
origin?: string;
}
interface USBProtectedClassesHandlerHandlerDetails {
/**
* The current list of protected USB classes. Possible class values include:
*/
protectedClasses: Array<'audio' | 'audio-video' | 'hid' | 'mass-storage' | 'smart-card' | 'video' | 'wireless'>;
}
interface VisibleOnAllWorkspacesOptions {
/**
* Sets whether the window should be visible above fullscreen windows.
*
* @platform darwin
*/
visibleOnFullScreen?: boolean;
/**
* Calling setVisibleOnAllWorkspaces will by default transform the process type
* between UIElementApplication and ForegroundApplication to ensure the correct
* behavior. However, this will hide the window and dock for a short time every
* time it is called. If your window is already of type UIElementApplication, you
* can bypass this transformation by passing true to skipTransformProcessType.
*
* @platform darwin
*/
skipTransformProcessType?: boolean;
}
interface WebContentsAudioStateChangedEventParams {
/**
* True if one or more frames or child `webContents` are emitting audio.
*/
audible: boolean;
}
interface WebContentsDidRedirectNavigationEventParams {
/**
* The URL the frame is navigating to.
*/
url: string;
/**
* Whether the navigation happened without changing document. Examples of same
* document navigations are reference fragment navigations, pushState/replaceState,
* and same page history navigation.
*/
isSameDocument: boolean;
/**
* True if the navigation is taking place in a main frame.
*/
isMainFrame: boolean;
/**
* The frame to be navigated.
*/
frame: WebFrameMain;
/**
* The frame which initiated the navigation, which can be a parent frame (e.g. via
* `window.open` with a frame's name), or null if the navigation was not initiated
* by a frame. This can also be null if the initiating frame was deleted before the
* event was emitted.
*/
initiator?: WebFrameMain;
}
interface WebContentsDidStartNavigationEventParams {
/**
* The URL the frame is navigating to.
*/
url: string;
/**
* Whether the navigation happened without changing document. Examples of same
* document navigations are reference fragment navigations, pushState/replaceState,
* and same page history navigation.
*/
isSameDocument: boolean;
/**
* True if the navigation is taking place in a main frame.
*/
isMainFrame: boolean;
/**
* The frame to be navigated.
*/
frame: WebFrameMain;
/**
* The frame which initiated the navigation, which can be a parent frame (e.g. via
* `window.open` with a frame's name), or null if the navigation was not initiated
* by a frame. This can also be null if the initiating frame was deleted before the
* event was emitted.
*/
initiator?: WebFrameMain;
}
interface WebContentsPrintOptions {
/**
* Don't ask user for print settings. Default is `false`.
*/
silent?: boolean;
/**
* Prints the background color and image of the web page. Default is `false`.
*/
printBackground?: boolean;
/**
* Set the printer device name to use. Must be the system-defined name and not the
* 'friendly' name, e.g 'Brother_QL_820NWB' and not 'Brother QL-820NWB'.
*/
deviceName?: string;
/**
* Set whether the printed web page will be in color or grayscale. Default is
* `true`.
*/
color?: boolean;
margins?: Margins;
/**
* Whether the web page should be printed in landscape mode. Default is `false`.
*/
landscape?: boolean;
/**
* The scale factor of the web page.
*/
scaleFactor?: number;
/**
* The number of pages to print per page sheet.
*/
pagesPerSheet?: number;
/**
* Whether the web page should be collated.
*/
collate?: boolean;
/**
* The number of copies of the web page to print.
*/
copies?: number;
/**
* The page range to print. On macOS, only one range is honored.
*/
pageRanges?: PageRanges[];
/**
* Set the duplex mode of the printed web page. Can be `simplex`, `shortEdge`, or
* `longEdge`.
*/
duplexMode?: ('simplex' | 'shortEdge' | 'longEdge');
dpi?: Record<string, number>;
/**
* string to be printed as page header.
*/
header?: string;
/**
* string to be printed as page footer.
*/
footer?: string;
/**
* Specify page size of the printed document. Can be `A0`, `A1`, `A2`, `A3`, `A4`,
* `A5`, `A6`, `Legal`, `Letter`, `Tabloid` or an Object containing `height` and
* `width`.
*/
pageSize?: (('A0' | 'A1' | 'A2' | 'A3' | 'A4' | 'A5' | 'A6' | 'Legal' | 'Letter' | 'Tabloid')) | (Size);
}
interface WebContentsWillFrameNavigateEventParams {
/**
* The URL the frame is navigating to.
*/
url: string;
/**
* This event does not fire for same document navigations using window.history api
* and reference fragment navigations. This property is always set to `false` for
* this event.
*/
isSameDocument: boolean;
/**
* True if the navigation is taking place in a main frame.
*/
isMainFrame: boolean;
/**
* The frame to be navigated.
*/
frame: WebFrameMain;
/**
* The frame which initiated the navigation, which can be a parent frame (e.g. via
* `window.open` with a frame's name), or null if the navigation was not initiated
* by a frame. This can also be null if the initiating frame was deleted before the
* event was emitted.
*/
initiator?: WebFrameMain;
}
interface WebContentsWillNavigateEventParams {
/**
* The URL the frame is navigating to.
*/
url: string;
/**
* This event does not fire for same document navigations using window.history api
* and reference fragment navigations. This property is always set to `false` for
* this event.
*/
isSameDocument: boolean;
/**
* True if the navigation is taking place in a main frame.
*/
isMainFrame: boolean;
/**
* The frame to be navigated.
*/
frame: WebFrameMain;
/**
* The frame which initiated the navigation, which can be a parent frame (e.g. via
* `window.open` with a frame's name), or null if the navigation was not initiated
* by a frame. This can also be null if the initiating frame was deleted before the
* event was emitted.
*/
initiator?: WebFrameMain;
}
interface WebContentsWillRedirectEventParams {
/**
* The URL the frame is navigating to.
*/
url: string;
/**
* Whether the navigation happened without changing document. Examples of same
* document navigations are reference fragment navigations, pushState/replaceState,
* and same page history navigation.
*/
isSameDocument: boolean;
/**
* True if the navigation is taking place in a main frame.
*/
isMainFrame: boolean;
/**
* The frame to be navigated.
*/
frame: WebFrameMain;
/**
* The frame which initiated the navigation, which can be a parent frame (e.g. via
* `window.open` with a frame's name), or null if the navigation was not initiated
* by a frame. This can also be null if the initiating frame was deleted before the
* event was emitted.
*/
initiator?: WebFrameMain;
}
interface WebviewTagPrintOptions {
/**
* Don't ask user for print settings. Default is `false`.
*/
silent?: boolean;
/**
* Prints the background color and image of the web page. Default is `false`.
*/
printBackground?: boolean;
/**
* Set the printer device name to use. Must be the system-defined name and not the
* 'friendly' name, e.g 'Brother_QL_820NWB' and not 'Brother QL-820NWB'.
*/
deviceName?: string;
/**
* Set whether the printed web page will be in color or grayscale. Default is
* `true`.
*/
color?: boolean;
margins?: Margins;
/**
* Whether the web page should be printed in landscape mode. Default is `false`.
*/
landscape?: boolean;
/**
* The scale factor of the web page.
*/
scaleFactor?: number;
/**
* The number of pages to print per page sheet.
*/
pagesPerSheet?: number;
/**
* Whether the web page should be collated.
*/
collate?: boolean;
/**
* The number of copies of the web page to print.
*/
copies?: number;
/**
* The page range to print.
*/
pageRanges?: PageRanges[];
/**
* Set the duplex mode of the printed web page. Can be `simplex`, `shortEdge`, or
* `longEdge`.
*/
duplexMode?: ('simplex' | 'shortEdge' | 'longEdge');
dpi?: Record<string, number>;
/**
* string to be printed as page header.
*/
header?: string;
/**
* string to be printed as page footer.
*/
footer?: string;
/**
* Specify page size of the printed document. Can be `A3`, `A4`, `A5`, `Legal`,
* `Letter`, `Tabloid` or an Object containing `height` in microns.
*/
pageSize?: (('A3' | 'A4' | 'A5' | 'Legal' | 'Letter' | 'Tabloid')) | (Size);
}
interface WillFrameNavigateEvent extends DOMEvent {
url: string;
isMainFrame: boolean;
frameProcessId: number;
frameRoutingId: number;
}
interface WillNavigateEvent extends DOMEvent {
url: string;
}
interface WillResizeDetails {
/**
* The edge of the window being dragged for resizing. Can be `bottom`, `left`,
* `right`, `top-left`, `top-right`, `bottom-left` or `bottom-right`.
*/
edge: ('bottom' | 'left' | 'right' | 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right');
}
interface EditFlags {
/**
* Whether the renderer believes it can undo.
*/
canUndo: boolean;
/**
* Whether the renderer believes it can redo.
*/
canRedo: boolean;
/**
* Whether the renderer believes it can cut.
*/
canCut: boolean;
/**
* Whether the renderer believes it can copy.
*/
canCopy: boolean;
/**
* Whether the renderer believes it can paste.
*/
canPaste: boolean;
/**
* Whether the renderer believes it can delete.
*/
canDelete: boolean;
/**
* Whether the renderer believes it can select all.
*/
canSelectAll: boolean;
/**
* Whether the renderer believes it can edit text richly.
*/
canEditRichly: boolean;
}
interface Env {
}
interface FoundInPageResult {
requestId: number;
/**
* Position of the active match.
*/
activeMatchOrdinal: number;
/**
* Number of Matches.
*/
matches: number;
/**
* Coordinates of first match region.
*/
selectionArea: Rectangle;
finalUpdate: boolean;
}
interface LaunchItems {
/**
* name value of a registry entry.
*
* @platform win32
*/
name: string;
/**
* The executable to an app that corresponds to a registry entry.
*
* @platform win32
*/
path: string;
/**
* the command-line arguments to pass to the executable.
*
* @platform win32
*/
args: string[];
/**
* one of `user` or `machine`. Indicates whether the registry entry is under
* `HKEY_CURRENT USER` or `HKEY_LOCAL_MACHINE`.
*
* @platform win32
*/
scope: string;
/**
* `true` if the app registry key is startup approved and therefore shows as
* `enabled` in Task Manager and Windows settings.
*
* @platform win32
*/
enabled: boolean;
}
interface Margins {
/**
* Can be `default`, `none`, `printableArea`, or `custom`. If `custom` is chosen,
* you will also need to specify `top`, `bottom`, `left`, and `right`.
*/
marginType?: ('default' | 'none' | 'printableArea' | 'custom');
/**
* The top margin of the printed web page, in pixels.
*/
top?: number;
/**
* The bottom margin of the printed web page, in pixels.
*/
bottom?: number;
/**
* The left margin of the printed web page, in pixels.
*/
left?: number;
/**
* The right margin of the printed web page, in pixels.
*/
right?: number;
}
interface MediaFlags {
/**
* Whether the media element has crashed.
*/
inError: boolean;
/**
* Whether the media element is paused.
*/
isPaused: boolean;
/**
* Whether the media element is muted.
*/
isMuted: boolean;
/**
* Whether the media element has audio.
*/
hasAudio: boolean;
/**
* Whether the media element is looping.
*/
isLooping: boolean;
/**
* Whether the media element's controls are visible.
*/
isControlsVisible: boolean;
/**
* Whether the media element's controls are toggleable.
*/
canToggleControls: boolean;
/**
* Whether the media element can be printed.
*/
canPrint: boolean;
/**
* Whether or not the media element can be downloaded.
*/
canSave: boolean;
/**
* Whether the media element can show picture-in-picture.
*/
canShowPictureInPicture: boolean;
/**
* Whether the media element is currently showing picture-in-picture.
*/
isShowingPictureInPicture: boolean;
/**
* Whether the media element can be rotated.
*/
canRotate: boolean;
/**
* Whether the media element can be looped.
*/
canLoop: boolean;
}
interface PageRanges {
/**
* Index of the first page to print (0-based).
*/
from: number;
/**
* Index of the last page to print (inclusive) (0-based).
*/
to: number;
}
interface Params {
/**
* x coordinate.
*/
x: number;
/**
* y coordinate.
*/
y: number;
/**
* URL of the link that encloses the node the context menu was invoked on.
*/
linkURL: string;
/**
* Text associated with the link. May be an empty string if the contents of the
* link are an image.
*/
linkText: string;
/**
* URL of the top level page that the context menu was invoked on.
*/
pageURL: string;
/**
* URL of the subframe that the context menu was invoked on.
*/
frameURL: string;
/**
* Source URL for the element that the context menu was invoked on. Elements with
* source URLs are images, audio and video.
*/
srcURL: string;
/**
* Type of the node the context menu was invoked on. Can be `none`, `image`,
* `audio`, `video`, `canvas`, `file` or `plugin`.
*/
mediaType: ('none' | 'image' | 'audio' | 'video' | 'canvas' | 'file' | 'plugin');
/**
* Whether the context menu was invoked on an image which has non-empty contents.
*/
hasImageContents: boolean;
/**
* Whether the context is editable.
*/
isEditable: boolean;
/**
* Text of the selection that the context menu was invoked on.
*/
selectionText: string;
/**
* Title text of the selection that the context menu was invoked on.
*/
titleText: string;
/**
* Alt text of the selection that the context menu was invoked on.
*/
altText: string;
/**
* Suggested filename to be used when saving file through 'Save Link As' option of
* context menu.
*/
suggestedFilename: string;
/**
* Rect representing the coordinates in the document space of the selection.
*/
selectionRect: Rectangle;
/**
* Start position of the selection text.
*/
selectionStartOffset: number;
/**
* The referrer policy of the frame on which the menu is invoked.
*/
referrerPolicy: Referrer;
/**
* The misspelled word under the cursor, if any.
*/
misspelledWord: string;
/**
* An array of suggested words to show the user to replace the `misspelledWord`.
* Only available if there is a misspelled word and spellchecker is enabled.
*/
dictionarySuggestions: string[];
/**
* The character encoding of the frame on which the menu was invoked.
*/
frameCharset: string;
/**
* If the context menu was invoked on an input field, the type of that field.
* Possible values include `none`, `plainText`, `password`, `other`.
*/
inputFieldType: ('none' | 'plainText' | 'password' | 'other');
/**
* If the context is editable, whether or not spellchecking is enabled.
*/
spellcheckEnabled: boolean;
/**
* Input source that invoked the context menu. Can be `none`, `mouse`, `keyboard`,
* `touch`, `touchMenu`, `longPress`, `longTap`, `touchHandle`, `stylus`,
* `adjustSelection`, or `adjustSelectionReset`.
*/
menuSourceType: ('none' | 'mouse' | 'keyboard' | 'touch' | 'touchMenu' | 'longPress' | 'longTap' | 'touchHandle' | 'stylus' | 'adjustSelection' | 'adjustSelectionReset');
/**
* The flags for the media element the context menu was invoked on.
*/
mediaFlags: MediaFlags;
/**
* These flags indicate whether the renderer believes it is able to perform the
* corresponding action.
*/
editFlags: EditFlags;
}
interface Video {
/**
* The id of the stream being granted. This will usually come from a
* DesktopCapturerSource object.
*/
id: string;
/**
* The name of the stream being granted. This will usually come from a
* DesktopCapturerSource object.
*/
name: string;
}
interface RemoteMainInterface {
app: App;
autoUpdater: AutoUpdater;
BrowserView: typeof BrowserView;
BrowserWindow: typeof BrowserWindow;
clipboard: Clipboard;
contentTracing: ContentTracing;
crashReporter: CrashReporter;
desktopCapturer: DesktopCapturer;
dialog: Dialog;
globalShortcut: GlobalShortcut;
inAppPurchase: InAppPurchase;
ipcMain: IpcMain;
Menu: typeof Menu;
MenuItem: typeof MenuItem;
MessageChannelMain: typeof MessageChannelMain;
nativeImage: typeof NativeImage;
nativeTheme: NativeTheme;
net: Net;
netLog: NetLog;
Notification: typeof Notification;
powerMonitor: PowerMonitor;
powerSaveBlocker: PowerSaveBlocker;
protocol: Protocol;
pushNotifications: PushNotifications;
safeStorage: SafeStorage;
screen: Screen;
session: typeof Session;
ShareMenu: typeof ShareMenu;
shell: Shell;
systemPreferences: SystemPreferences;
TouchBar: typeof TouchBar;
Tray: typeof Tray;
utilityProcess: typeof UtilityProcess;
webContents: typeof WebContents;
webFrameMain: typeof WebFrameMain;
}
namespace Common {
type Event<Params extends object = {}> = Electron.Event<Params>;
const clipboard: Clipboard;
type Clipboard = Electron.Clipboard;
const crashReporter: CrashReporter;
type CrashReporter = Electron.CrashReporter;
const nativeImage: typeof NativeImage;
type NativeImage = Electron.NativeImage;
const shell: Shell;
type Shell = Electron.Shell;
type AboutPanelOptionsOptions = Electron.AboutPanelOptionsOptions;
type AddRepresentationOptions = Electron.AddRepresentationOptions;
type AdjustSelectionOptions = Electron.AdjustSelectionOptions;
type AnimationSettings = Electron.AnimationSettings;
type AppDetailsOptions = Electron.AppDetailsOptions;
type ApplicationInfoForProtocolReturnValue = Electron.ApplicationInfoForProtocolReturnValue;
type AuthenticationResponseDetails = Electron.AuthenticationResponseDetails;
type AuthInfo = Electron.AuthInfo;
type AutoResizeOptions = Electron.AutoResizeOptions;
type BeforeSendResponse = Electron.BeforeSendResponse;
type BitmapOptions = Electron.BitmapOptions;
type BlinkMemoryInfo = Electron.BlinkMemoryInfo;
type BluetoothPairingHandlerHandlerDetails = Electron.BluetoothPairingHandlerHandlerDetails;
type BrowserViewConstructorOptions = Electron.BrowserViewConstructorOptions;
type CallbackResponse = Electron.CallbackResponse;
type CertificateTrustDialogOptions = Electron.CertificateTrustDialogOptions;
type ClearCodeCachesOptions = Electron.ClearCodeCachesOptions;
type ClearStorageDataOptions = Electron.ClearStorageDataOptions;
type ClientRequestConstructorOptions = Electron.ClientRequestConstructorOptions;
type CloseOpts = Electron.CloseOpts;
type Config = Electron.Config;
type ConfigureHostResolverOptions = Electron.ConfigureHostResolverOptions;
type ConsoleMessageEvent = Electron.ConsoleMessageEvent;
type ContextMenuEvent = Electron.ContextMenuEvent;
type ContextMenuParams = Electron.ContextMenuParams;
type ContinueActivityDetails = Electron.ContinueActivityDetails;
type CookiesGetFilter = Electron.CookiesGetFilter;
type CookiesSetDetails = Electron.CookiesSetDetails;
type CrashReporterStartOptions = Electron.CrashReporterStartOptions;
type CreateFromBitmapOptions = Electron.CreateFromBitmapOptions;
type CreateFromBufferOptions = Electron.CreateFromBufferOptions;
type CreateInterruptedDownloadOptions = Electron.CreateInterruptedDownloadOptions;
type Data = Electron.Data;
type DefaultFontFamily = Electron.DefaultFontFamily;
type Details = Electron.Details;
type DevicePermissionHandlerHandlerDetails = Electron.DevicePermissionHandlerHandlerDetails;
type DevtoolsOpenUrlEvent = Electron.DevtoolsOpenUrlEvent;
type DidChangeThemeColorEvent = Electron.DidChangeThemeColorEvent;
type DidCreateWindowDetails = Electron.DidCreateWindowDetails;
type DidFailLoadEvent = Electron.DidFailLoadEvent;
type DidFrameFinishLoadEvent = Electron.DidFrameFinishLoadEvent;
type DidFrameNavigateEvent = Electron.DidFrameNavigateEvent;
type DidNavigateEvent = Electron.DidNavigateEvent;
type DidNavigateInPageEvent = Electron.DidNavigateInPageEvent;
type DidRedirectNavigationEvent = Electron.DidRedirectNavigationEvent;
type DidStartNavigationEvent = Electron.DidStartNavigationEvent;
type DisplayBalloonOptions = Electron.DisplayBalloonOptions;
type DisplayMediaRequestHandlerHandlerRequest = Electron.DisplayMediaRequestHandlerHandlerRequest;
type DownloadURLOptions = Electron.DownloadURLOptions;
type EnableNetworkEmulationOptions = Electron.EnableNetworkEmulationOptions;
type FeedURLOptions = Electron.FeedURLOptions;
type FileIconOptions = Electron.FileIconOptions;
type FindInPageOptions = Electron.FindInPageOptions;
type FocusOptions = Electron.FocusOptions;
type ForkOptions = Electron.ForkOptions;
type FoundInPageEvent = Electron.FoundInPageEvent;
type FrameCreatedDetails = Electron.FrameCreatedDetails;
type FromPartitionOptions = Electron.FromPartitionOptions;
type FromPathOptions = Electron.FromPathOptions;
type HandlerDetails = Electron.HandlerDetails;
type HeadersReceivedResponse = Electron.HeadersReceivedResponse;
type HeapStatistics = Electron.HeapStatistics;
type HidDeviceAddedDetails = Electron.HidDeviceAddedDetails;
type HidDeviceRemovedDetails = Electron.HidDeviceRemovedDetails;
type HidDeviceRevokedDetails = Electron.HidDeviceRevokedDetails;
type IgnoreMouseEventsOptions = Electron.IgnoreMouseEventsOptions;
type ImportCertificateOptions = Electron.ImportCertificateOptions;
type Info = Electron.Info;
type Input = Electron.Input;
type InsertCSSOptions = Electron.InsertCSSOptions;
type IpcMessageEvent = Electron.IpcMessageEvent;
type Item = Electron.Item;
type JumpListSettings = Electron.JumpListSettings;
type LoadCommitEvent = Electron.LoadCommitEvent;
type LoadExtensionOptions = Electron.LoadExtensionOptions;
type LoadFileOptions = Electron.LoadFileOptions;
type LoadURLOptions = Electron.LoadURLOptions;
type LoginItemSettings = Electron.LoginItemSettings;
type LoginItemSettingsOptions = Electron.LoginItemSettingsOptions;
type MenuItemConstructorOptions = Electron.MenuItemConstructorOptions;
type MessageBoxOptions = Electron.MessageBoxOptions;
type MessageBoxReturnValue = Electron.MessageBoxReturnValue;
type MessageBoxSyncOptions = Electron.MessageBoxSyncOptions;
type MessageDetails = Electron.MessageDetails;
type MessageEvent = Electron.MessageEvent;
type MoveToApplicationsFolderOptions = Electron.MoveToApplicationsFolderOptions;
type NotificationConstructorOptions = Electron.NotificationConstructorOptions;
type OnBeforeRedirectListenerDetails = Electron.OnBeforeRedirectListenerDetails;
type OnBeforeRequestListenerDetails = Electron.OnBeforeRequestListenerDetails;
type OnBeforeSendHeadersListenerDetails = Electron.OnBeforeSendHeadersListenerDetails;
type OnCompletedListenerDetails = Electron.OnCompletedListenerDetails;
type OnErrorOccurredListenerDetails = Electron.OnErrorOccurredListenerDetails;
type OnHeadersReceivedListenerDetails = Electron.OnHeadersReceivedListenerDetails;
type OnResponseStartedListenerDetails = Electron.OnResponseStartedListenerDetails;
type OnSendHeadersListenerDetails = Electron.OnSendHeadersListenerDetails;
type OpenDevToolsOptions = Electron.OpenDevToolsOptions;
type OpenDialogOptions = Electron.OpenDialogOptions;
type OpenDialogReturnValue = Electron.OpenDialogReturnValue;
type OpenDialogSyncOptions = Electron.OpenDialogSyncOptions;
type OpenExternalOptions = Electron.OpenExternalOptions;
type Options = Electron.Options;
type Opts = Electron.Opts;
type PageFaviconUpdatedEvent = Electron.PageFaviconUpdatedEvent;
type PageTitleUpdatedEvent = Electron.PageTitleUpdatedEvent;
type Parameters = Electron.Parameters;
type Payment = Electron.Payment;
type PermissionCheckHandlerHandlerDetails = Electron.PermissionCheckHandlerHandlerDetails;
type PermissionRequestHandlerHandlerDetails = Electron.PermissionRequestHandlerHandlerDetails;
type PluginCrashedEvent = Electron.PluginCrashedEvent;
type PopupOptions = Electron.PopupOptions;
type PreconnectOptions = Electron.PreconnectOptions;
type PrintToPDFOptions = Electron.PrintToPDFOptions;
type Privileges = Electron.Privileges;
type ProgressBarOptions = Electron.ProgressBarOptions;
type Provider = Electron.Provider;
type PurchaseProductOpts = Electron.PurchaseProductOpts;
type ReadBookmark = Electron.ReadBookmark;
type RegistrationCompletedDetails = Electron.RegistrationCompletedDetails;
type RelaunchOptions = Electron.RelaunchOptions;
type RenderProcessGoneEvent = Electron.RenderProcessGoneEvent;
type Request = Electron.Request;
type ResizeOptions = Electron.ResizeOptions;
type ResolveHostOptions = Electron.ResolveHostOptions;
type ResourceUsage = Electron.ResourceUsage;
type Response = Electron.Response;
type Result = Electron.Result;
type SaveDialogOptions = Electron.SaveDialogOptions;
type SaveDialogReturnValue = Electron.SaveDialogReturnValue;
type SaveDialogSyncOptions = Electron.SaveDialogSyncOptions;
type SelectHidDeviceDetails = Electron.SelectHidDeviceDetails;
type SelectUsbDeviceDetails = Electron.SelectUsbDeviceDetails;
type SerialPortRevokedDetails = Electron.SerialPortRevokedDetails;
type Settings = Electron.Settings;
type SourcesOptions = Electron.SourcesOptions;
type SSLConfigConfig = Electron.SSLConfigConfig;
type StartLoggingOptions = Electron.StartLoggingOptions;
type Streams = Electron.Streams;
type SystemMemoryInfo = Electron.SystemMemoryInfo;
type TitleBarOverlay = Electron.TitleBarOverlay;
type TitleBarOverlayOptions = Electron.TitleBarOverlayOptions;
type TitleOptions = Electron.TitleOptions;
type ToBitmapOptions = Electron.ToBitmapOptions;
type ToDataURLOptions = Electron.ToDataURLOptions;
type ToPNGOptions = Electron.ToPNGOptions;
type TouchBarButtonConstructorOptions = Electron.TouchBarButtonConstructorOptions;
type TouchBarColorPickerConstructorOptions = Electron.TouchBarColorPickerConstructorOptions;
type TouchBarConstructorOptions = Electron.TouchBarConstructorOptions;
type TouchBarGroupConstructorOptions = Electron.TouchBarGroupConstructorOptions;
type TouchBarLabelConstructorOptions = Electron.TouchBarLabelConstructorOptions;
type TouchBarPopoverConstructorOptions = Electron.TouchBarPopoverConstructorOptions;
type TouchBarScrubberConstructorOptions = Electron.TouchBarScrubberConstructorOptions;
type TouchBarSegmentedControlConstructorOptions = Electron.TouchBarSegmentedControlConstructorOptions;
type TouchBarSliderConstructorOptions = Electron.TouchBarSliderConstructorOptions;
type TouchBarSpacerConstructorOptions = Electron.TouchBarSpacerConstructorOptions;
type TraceBufferUsageReturnValue = Electron.TraceBufferUsageReturnValue;
type UpdateTargetUrlEvent = Electron.UpdateTargetUrlEvent;
type UploadProgress = Electron.UploadProgress;
type UsbDeviceRevokedDetails = Electron.UsbDeviceRevokedDetails;
type USBProtectedClassesHandlerHandlerDetails = Electron.USBProtectedClassesHandlerHandlerDetails;
type VisibleOnAllWorkspacesOptions = Electron.VisibleOnAllWorkspacesOptions;
type WebContentsAudioStateChangedEventParams = Electron.WebContentsAudioStateChangedEventParams;
type WebContentsDidRedirectNavigationEventParams = Electron.WebContentsDidRedirectNavigationEventParams;
type WebContentsDidStartNavigationEventParams = Electron.WebContentsDidStartNavigationEventParams;
type WebContentsPrintOptions = Electron.WebContentsPrintOptions;
type WebContentsWillFrameNavigateEventParams = Electron.WebContentsWillFrameNavigateEventParams;
type WebContentsWillNavigateEventParams = Electron.WebContentsWillNavigateEventParams;
type WebContentsWillRedirectEventParams = Electron.WebContentsWillRedirectEventParams;
type WebviewTagPrintOptions = Electron.WebviewTagPrintOptions;
type WillFrameNavigateEvent = Electron.WillFrameNavigateEvent;
type WillNavigateEvent = Electron.WillNavigateEvent;
type WillResizeDetails = Electron.WillResizeDetails;
type EditFlags = Electron.EditFlags;
type Env = Electron.Env;
type FoundInPageResult = Electron.FoundInPageResult;
type LaunchItems = Electron.LaunchItems;
type Margins = Electron.Margins;
type MediaFlags = Electron.MediaFlags;
type PageRanges = Electron.PageRanges;
type Params = Electron.Params;
type Video = Electron.Video;
type BluetoothDevice = Electron.BluetoothDevice;
type BrowserWindowConstructorOptions = Electron.BrowserWindowConstructorOptions;
type Certificate = Electron.Certificate;
type CertificatePrincipal = Electron.CertificatePrincipal;
type Cookie = Electron.Cookie;
type CPUUsage = Electron.CPUUsage;
type CrashReport = Electron.CrashReport;
type CustomScheme = Electron.CustomScheme;
type DesktopCapturerSource = Electron.DesktopCapturerSource;
type Display = Electron.Display;
type Extension = Electron.Extension;
type ExtensionInfo = Electron.ExtensionInfo;
type FileFilter = Electron.FileFilter;
type FilePathWithHeaders = Electron.FilePathWithHeaders;
type GPUFeatureStatus = Electron.GPUFeatureStatus;
type HIDDevice = Electron.HIDDevice;
type InputEvent = Electron.InputEvent;
type IOCounters = Electron.IOCounters;
type IpcMainEvent = Electron.IpcMainEvent;
type IpcMainInvokeEvent = Electron.IpcMainInvokeEvent;
type IpcRendererEvent = Electron.IpcRendererEvent;
type JumpListCategory = Electron.JumpListCategory;
type JumpListItem = Electron.JumpListItem;
type KeyboardEvent = Electron.KeyboardEvent;
type KeyboardInputEvent = Electron.KeyboardInputEvent;
type MemoryInfo = Electron.MemoryInfo;
type MemoryUsageDetails = Electron.MemoryUsageDetails;
type MimeTypedBuffer = Electron.MimeTypedBuffer;
type MouseInputEvent = Electron.MouseInputEvent;
type MouseWheelInputEvent = Electron.MouseWheelInputEvent;
type NotificationAction = Electron.NotificationAction;
type NotificationResponse = Electron.NotificationResponse;
type PaymentDiscount = Electron.PaymentDiscount;
type Point = Electron.Point;
type PostBody = Electron.PostBody;
type PrinterInfo = Electron.PrinterInfo;
type ProcessMemoryInfo = Electron.ProcessMemoryInfo;
type ProcessMetric = Electron.ProcessMetric;
type Product = Electron.Product;
type ProductDiscount = Electron.ProductDiscount;
type ProductSubscriptionPeriod = Electron.ProductSubscriptionPeriod;
type ProtocolRequest = Electron.ProtocolRequest;
type ProtocolResponse = Electron.ProtocolResponse;
type ProtocolResponseUploadData = Electron.ProtocolResponseUploadData;
type Rectangle = Electron.Rectangle;
type Referrer = Electron.Referrer;
type RenderProcessGoneDetails = Electron.RenderProcessGoneDetails;
type ResolvedEndpoint = Electron.ResolvedEndpoint;
type ResolvedHost = Electron.ResolvedHost;
type ScrubberItem = Electron.ScrubberItem;
type SegmentedControlSegment = Electron.SegmentedControlSegment;
type SerialPort = Electron.SerialPort;
type ServiceWorkerInfo = Electron.ServiceWorkerInfo;
type SharedWorkerInfo = Electron.SharedWorkerInfo;
type SharingItem = Electron.SharingItem;
type ShortcutDetails = Electron.ShortcutDetails;
type Size = Electron.Size;
type Task = Electron.Task;
type ThumbarButton = Electron.ThumbarButton;
type TraceCategoriesAndOptions = Electron.TraceCategoriesAndOptions;
type TraceConfig = Electron.TraceConfig;
type Transaction = Electron.Transaction;
type UploadData = Electron.UploadData;
type UploadFile = Electron.UploadFile;
type UploadRawData = Electron.UploadRawData;
type USBDevice = Electron.USBDevice;
type UserDefaultTypes = Electron.UserDefaultTypes;
type WebPreferences = Electron.WebPreferences;
type WebRequestFilter = Electron.WebRequestFilter;
type WebSource = Electron.WebSource;
}
namespace Main {
type Event<Params extends object = {}> = Electron.Event<Params>;
const app: App;
type App = Electron.App;
const autoUpdater: AutoUpdater;
type AutoUpdater = Electron.AutoUpdater;
class BrowserView extends Electron.BrowserView {}
class BrowserWindow extends Electron.BrowserWindow {}
type ClientRequest = Electron.ClientRequest;
type CommandLine = Electron.CommandLine;
const contentTracing: ContentTracing;
type ContentTracing = Electron.ContentTracing;
type Cookies = Electron.Cookies;
type Debugger = Electron.Debugger;
const desktopCapturer: DesktopCapturer;
type DesktopCapturer = Electron.DesktopCapturer;
const dialog: Dialog;
type Dialog = Electron.Dialog;
type Dock = Electron.Dock;
type DownloadItem = Electron.DownloadItem;
const globalShortcut: GlobalShortcut;
type GlobalShortcut = Electron.GlobalShortcut;
const inAppPurchase: InAppPurchase;
type InAppPurchase = Electron.InAppPurchase;
type IncomingMessage = Electron.IncomingMessage;
const ipcMain: IpcMain;
type IpcMain = Electron.IpcMain;
class Menu extends Electron.Menu {}
class MenuItem extends Electron.MenuItem {}
class MessageChannelMain extends Electron.MessageChannelMain {}
type MessagePortMain = Electron.MessagePortMain;
const nativeTheme: NativeTheme;
type NativeTheme = Electron.NativeTheme;
const net: Net;
type Net = Electron.Net;
const netLog: NetLog;
type NetLog = Electron.NetLog;
class Notification extends Electron.Notification {}
const powerMonitor: PowerMonitor;
type PowerMonitor = Electron.PowerMonitor;
const powerSaveBlocker: PowerSaveBlocker;
type PowerSaveBlocker = Electron.PowerSaveBlocker;
const protocol: Protocol;
type Protocol = Electron.Protocol;
const pushNotifications: PushNotifications;
type PushNotifications = Electron.PushNotifications;
const safeStorage: SafeStorage;
type SafeStorage = Electron.SafeStorage;
const screen: Screen;
type Screen = Electron.Screen;
type ServiceWorkers = Electron.ServiceWorkers;
const session: typeof Session;
type Session = Electron.Session;
class ShareMenu extends Electron.ShareMenu {}
const systemPreferences: SystemPreferences;
type SystemPreferences = Electron.SystemPreferences;
class TouchBar extends Electron.TouchBar {}
type TouchBarButton = Electron.TouchBarButton;
type TouchBarColorPicker = Electron.TouchBarColorPicker;
type TouchBarGroup = Electron.TouchBarGroup;
type TouchBarLabel = Electron.TouchBarLabel;
type TouchBarOtherItemsProxy = Electron.TouchBarOtherItemsProxy;
type TouchBarPopover = Electron.TouchBarPopover;
type TouchBarScrubber = Electron.TouchBarScrubber;
type TouchBarSegmentedControl = Electron.TouchBarSegmentedControl;
type TouchBarSlider = Electron.TouchBarSlider;
type TouchBarSpacer = Electron.TouchBarSpacer;
class Tray extends Electron.Tray {}
const utilityProcess: typeof UtilityProcess;
type UtilityProcess = Electron.UtilityProcess;
const webContents: typeof WebContents;
type WebContents = Electron.WebContents;
const webFrameMain: typeof WebFrameMain;
type WebFrameMain = Electron.WebFrameMain;
type WebRequest = Electron.WebRequest;
type AboutPanelOptionsOptions = Electron.AboutPanelOptionsOptions;
type AddRepresentationOptions = Electron.AddRepresentationOptions;
type AdjustSelectionOptions = Electron.AdjustSelectionOptions;
type AnimationSettings = Electron.AnimationSettings;
type AppDetailsOptions = Electron.AppDetailsOptions;
type ApplicationInfoForProtocolReturnValue = Electron.ApplicationInfoForProtocolReturnValue;
type AuthenticationResponseDetails = Electron.AuthenticationResponseDetails;
type AuthInfo = Electron.AuthInfo;
type AutoResizeOptions = Electron.AutoResizeOptions;
type BeforeSendResponse = Electron.BeforeSendResponse;
type BitmapOptions = Electron.BitmapOptions;
type BlinkMemoryInfo = Electron.BlinkMemoryInfo;
type BluetoothPairingHandlerHandlerDetails = Electron.BluetoothPairingHandlerHandlerDetails;
type BrowserViewConstructorOptions = Electron.BrowserViewConstructorOptions;
type CallbackResponse = Electron.CallbackResponse;
type CertificateTrustDialogOptions = Electron.CertificateTrustDialogOptions;
type ClearCodeCachesOptions = Electron.ClearCodeCachesOptions;
type ClearStorageDataOptions = Electron.ClearStorageDataOptions;
type ClientRequestConstructorOptions = Electron.ClientRequestConstructorOptions;
type CloseOpts = Electron.CloseOpts;
type Config = Electron.Config;
type ConfigureHostResolverOptions = Electron.ConfigureHostResolverOptions;
type ConsoleMessageEvent = Electron.ConsoleMessageEvent;
type ContextMenuEvent = Electron.ContextMenuEvent;
type ContextMenuParams = Electron.ContextMenuParams;
type ContinueActivityDetails = Electron.ContinueActivityDetails;
type CookiesGetFilter = Electron.CookiesGetFilter;
type CookiesSetDetails = Electron.CookiesSetDetails;
type CrashReporterStartOptions = Electron.CrashReporterStartOptions;
type CreateFromBitmapOptions = Electron.CreateFromBitmapOptions;
type CreateFromBufferOptions = Electron.CreateFromBufferOptions;
type CreateInterruptedDownloadOptions = Electron.CreateInterruptedDownloadOptions;
type Data = Electron.Data;
type DefaultFontFamily = Electron.DefaultFontFamily;
type Details = Electron.Details;
type DevicePermissionHandlerHandlerDetails = Electron.DevicePermissionHandlerHandlerDetails;
type DevtoolsOpenUrlEvent = Electron.DevtoolsOpenUrlEvent;
type DidChangeThemeColorEvent = Electron.DidChangeThemeColorEvent;
type DidCreateWindowDetails = Electron.DidCreateWindowDetails;
type DidFailLoadEvent = Electron.DidFailLoadEvent;
type DidFrameFinishLoadEvent = Electron.DidFrameFinishLoadEvent;
type DidFrameNavigateEvent = Electron.DidFrameNavigateEvent;
type DidNavigateEvent = Electron.DidNavigateEvent;
type DidNavigateInPageEvent = Electron.DidNavigateInPageEvent;
type DidRedirectNavigationEvent = Electron.DidRedirectNavigationEvent;
type DidStartNavigationEvent = Electron.DidStartNavigationEvent;
type DisplayBalloonOptions = Electron.DisplayBalloonOptions;
type DisplayMediaRequestHandlerHandlerRequest = Electron.DisplayMediaRequestHandlerHandlerRequest;
type DownloadURLOptions = Electron.DownloadURLOptions;
type EnableNetworkEmulationOptions = Electron.EnableNetworkEmulationOptions;
type FeedURLOptions = Electron.FeedURLOptions;
type FileIconOptions = Electron.FileIconOptions;
type FindInPageOptions = Electron.FindInPageOptions;
type FocusOptions = Electron.FocusOptions;
type ForkOptions = Electron.ForkOptions;
type FoundInPageEvent = Electron.FoundInPageEvent;
type FrameCreatedDetails = Electron.FrameCreatedDetails;
type FromPartitionOptions = Electron.FromPartitionOptions;
type FromPathOptions = Electron.FromPathOptions;
type HandlerDetails = Electron.HandlerDetails;
type HeadersReceivedResponse = Electron.HeadersReceivedResponse;
type HeapStatistics = Electron.HeapStatistics;
type HidDeviceAddedDetails = Electron.HidDeviceAddedDetails;
type HidDeviceRemovedDetails = Electron.HidDeviceRemovedDetails;
type HidDeviceRevokedDetails = Electron.HidDeviceRevokedDetails;
type IgnoreMouseEventsOptions = Electron.IgnoreMouseEventsOptions;
type ImportCertificateOptions = Electron.ImportCertificateOptions;
type Info = Electron.Info;
type Input = Electron.Input;
type InsertCSSOptions = Electron.InsertCSSOptions;
type IpcMessageEvent = Electron.IpcMessageEvent;
type Item = Electron.Item;
type JumpListSettings = Electron.JumpListSettings;
type LoadCommitEvent = Electron.LoadCommitEvent;
type LoadExtensionOptions = Electron.LoadExtensionOptions;
type LoadFileOptions = Electron.LoadFileOptions;
type LoadURLOptions = Electron.LoadURLOptions;
type LoginItemSettings = Electron.LoginItemSettings;
type LoginItemSettingsOptions = Electron.LoginItemSettingsOptions;
type MenuItemConstructorOptions = Electron.MenuItemConstructorOptions;
type MessageBoxOptions = Electron.MessageBoxOptions;
type MessageBoxReturnValue = Electron.MessageBoxReturnValue;
type MessageBoxSyncOptions = Electron.MessageBoxSyncOptions;
type MessageDetails = Electron.MessageDetails;
type MessageEvent = Electron.MessageEvent;
type MoveToApplicationsFolderOptions = Electron.MoveToApplicationsFolderOptions;
type NotificationConstructorOptions = Electron.NotificationConstructorOptions;
type OnBeforeRedirectListenerDetails = Electron.OnBeforeRedirectListenerDetails;
type OnBeforeRequestListenerDetails = Electron.OnBeforeRequestListenerDetails;
type OnBeforeSendHeadersListenerDetails = Electron.OnBeforeSendHeadersListenerDetails;
type OnCompletedListenerDetails = Electron.OnCompletedListenerDetails;
type OnErrorOccurredListenerDetails = Electron.OnErrorOccurredListenerDetails;
type OnHeadersReceivedListenerDetails = Electron.OnHeadersReceivedListenerDetails;
type OnResponseStartedListenerDetails = Electron.OnResponseStartedListenerDetails;
type OnSendHeadersListenerDetails = Electron.OnSendHeadersListenerDetails;
type OpenDevToolsOptions = Electron.OpenDevToolsOptions;
type OpenDialogOptions = Electron.OpenDialogOptions;
type OpenDialogReturnValue = Electron.OpenDialogReturnValue;
type OpenDialogSyncOptions = Electron.OpenDialogSyncOptions;
type OpenExternalOptions = Electron.OpenExternalOptions;
type Options = Electron.Options;
type Opts = Electron.Opts;
type PageFaviconUpdatedEvent = Electron.PageFaviconUpdatedEvent;
type PageTitleUpdatedEvent = Electron.PageTitleUpdatedEvent;
type Parameters = Electron.Parameters;
type Payment = Electron.Payment;
type PermissionCheckHandlerHandlerDetails = Electron.PermissionCheckHandlerHandlerDetails;
type PermissionRequestHandlerHandlerDetails = Electron.PermissionRequestHandlerHandlerDetails;
type PluginCrashedEvent = Electron.PluginCrashedEvent;
type PopupOptions = Electron.PopupOptions;
type PreconnectOptions = Electron.PreconnectOptions;
type PrintToPDFOptions = Electron.PrintToPDFOptions;
type Privileges = Electron.Privileges;
type ProgressBarOptions = Electron.ProgressBarOptions;
type Provider = Electron.Provider;
type PurchaseProductOpts = Electron.PurchaseProductOpts;
type ReadBookmark = Electron.ReadBookmark;
type RegistrationCompletedDetails = Electron.RegistrationCompletedDetails;
type RelaunchOptions = Electron.RelaunchOptions;
type RenderProcessGoneEvent = Electron.RenderProcessGoneEvent;
type Request = Electron.Request;
type ResizeOptions = Electron.ResizeOptions;
type ResolveHostOptions = Electron.ResolveHostOptions;
type ResourceUsage = Electron.ResourceUsage;
type Response = Electron.Response;
type Result = Electron.Result;
type SaveDialogOptions = Electron.SaveDialogOptions;
type SaveDialogReturnValue = Electron.SaveDialogReturnValue;
type SaveDialogSyncOptions = Electron.SaveDialogSyncOptions;
type SelectHidDeviceDetails = Electron.SelectHidDeviceDetails;
type SelectUsbDeviceDetails = Electron.SelectUsbDeviceDetails;
type SerialPortRevokedDetails = Electron.SerialPortRevokedDetails;
type Settings = Electron.Settings;
type SourcesOptions = Electron.SourcesOptions;
type SSLConfigConfig = Electron.SSLConfigConfig;
type StartLoggingOptions = Electron.StartLoggingOptions;
type Streams = Electron.Streams;
type SystemMemoryInfo = Electron.SystemMemoryInfo;
type TitleBarOverlay = Electron.TitleBarOverlay;
type TitleBarOverlayOptions = Electron.TitleBarOverlayOptions;
type TitleOptions = Electron.TitleOptions;
type ToBitmapOptions = Electron.ToBitmapOptions;
type ToDataURLOptions = Electron.ToDataURLOptions;
type ToPNGOptions = Electron.ToPNGOptions;
type TouchBarButtonConstructorOptions = Electron.TouchBarButtonConstructorOptions;
type TouchBarColorPickerConstructorOptions = Electron.TouchBarColorPickerConstructorOptions;
type TouchBarConstructorOptions = Electron.TouchBarConstructorOptions;
type TouchBarGroupConstructorOptions = Electron.TouchBarGroupConstructorOptions;
type TouchBarLabelConstructorOptions = Electron.TouchBarLabelConstructorOptions;
type TouchBarPopoverConstructorOptions = Electron.TouchBarPopoverConstructorOptions;
type TouchBarScrubberConstructorOptions = Electron.TouchBarScrubberConstructorOptions;
type TouchBarSegmentedControlConstructorOptions = Electron.TouchBarSegmentedControlConstructorOptions;
type TouchBarSliderConstructorOptions = Electron.TouchBarSliderConstructorOptions;
type TouchBarSpacerConstructorOptions = Electron.TouchBarSpacerConstructorOptions;
type TraceBufferUsageReturnValue = Electron.TraceBufferUsageReturnValue;
type UpdateTargetUrlEvent = Electron.UpdateTargetUrlEvent;
type UploadProgress = Electron.UploadProgress;
type UsbDeviceRevokedDetails = Electron.UsbDeviceRevokedDetails;
type USBProtectedClassesHandlerHandlerDetails = Electron.USBProtectedClassesHandlerHandlerDetails;
type VisibleOnAllWorkspacesOptions = Electron.VisibleOnAllWorkspacesOptions;
type WebContentsAudioStateChangedEventParams = Electron.WebContentsAudioStateChangedEventParams;
type WebContentsDidRedirectNavigationEventParams = Electron.WebContentsDidRedirectNavigationEventParams;
type WebContentsDidStartNavigationEventParams = Electron.WebContentsDidStartNavigationEventParams;
type WebContentsPrintOptions = Electron.WebContentsPrintOptions;
type WebContentsWillFrameNavigateEventParams = Electron.WebContentsWillFrameNavigateEventParams;
type WebContentsWillNavigateEventParams = Electron.WebContentsWillNavigateEventParams;
type WebContentsWillRedirectEventParams = Electron.WebContentsWillRedirectEventParams;
type WebviewTagPrintOptions = Electron.WebviewTagPrintOptions;
type WillFrameNavigateEvent = Electron.WillFrameNavigateEvent;
type WillNavigateEvent = Electron.WillNavigateEvent;
type WillResizeDetails = Electron.WillResizeDetails;
type EditFlags = Electron.EditFlags;
type Env = Electron.Env;
type FoundInPageResult = Electron.FoundInPageResult;
type LaunchItems = Electron.LaunchItems;
type Margins = Electron.Margins;
type MediaFlags = Electron.MediaFlags;
type PageRanges = Electron.PageRanges;
type Params = Electron.Params;
type Video = Electron.Video;
type BluetoothDevice = Electron.BluetoothDevice;
type BrowserWindowConstructorOptions = Electron.BrowserWindowConstructorOptions;
type Certificate = Electron.Certificate;
type CertificatePrincipal = Electron.CertificatePrincipal;
type Cookie = Electron.Cookie;
type CPUUsage = Electron.CPUUsage;
type CrashReport = Electron.CrashReport;
type CustomScheme = Electron.CustomScheme;
type DesktopCapturerSource = Electron.DesktopCapturerSource;
type Display = Electron.Display;
type Extension = Electron.Extension;
type ExtensionInfo = Electron.ExtensionInfo;
type FileFilter = Electron.FileFilter;
type FilePathWithHeaders = Electron.FilePathWithHeaders;
type GPUFeatureStatus = Electron.GPUFeatureStatus;
type HIDDevice = Electron.HIDDevice;
type InputEvent = Electron.InputEvent;
type IOCounters = Electron.IOCounters;
type IpcMainEvent = Electron.IpcMainEvent;
type IpcMainInvokeEvent = Electron.IpcMainInvokeEvent;
type IpcRendererEvent = Electron.IpcRendererEvent;
type JumpListCategory = Electron.JumpListCategory;
type JumpListItem = Electron.JumpListItem;
type KeyboardEvent = Electron.KeyboardEvent;
type KeyboardInputEvent = Electron.KeyboardInputEvent;
type MemoryInfo = Electron.MemoryInfo;
type MemoryUsageDetails = Electron.MemoryUsageDetails;
type MimeTypedBuffer = Electron.MimeTypedBuffer;
type MouseInputEvent = Electron.MouseInputEvent;
type MouseWheelInputEvent = Electron.MouseWheelInputEvent;
type NotificationAction = Electron.NotificationAction;
type NotificationResponse = Electron.NotificationResponse;
type PaymentDiscount = Electron.PaymentDiscount;
type Point = Electron.Point;
type PostBody = Electron.PostBody;
type PrinterInfo = Electron.PrinterInfo;
type ProcessMemoryInfo = Electron.ProcessMemoryInfo;
type ProcessMetric = Electron.ProcessMetric;
type Product = Electron.Product;
type ProductDiscount = Electron.ProductDiscount;
type ProductSubscriptionPeriod = Electron.ProductSubscriptionPeriod;
type ProtocolRequest = Electron.ProtocolRequest;
type ProtocolResponse = Electron.ProtocolResponse;
type ProtocolResponseUploadData = Electron.ProtocolResponseUploadData;
type Rectangle = Electron.Rectangle;
type Referrer = Electron.Referrer;
type RenderProcessGoneDetails = Electron.RenderProcessGoneDetails;
type ResolvedEndpoint = Electron.ResolvedEndpoint;
type ResolvedHost = Electron.ResolvedHost;
type ScrubberItem = Electron.ScrubberItem;
type SegmentedControlSegment = Electron.SegmentedControlSegment;
type SerialPort = Electron.SerialPort;
type ServiceWorkerInfo = Electron.ServiceWorkerInfo;
type SharedWorkerInfo = Electron.SharedWorkerInfo;
type SharingItem = Electron.SharingItem;
type ShortcutDetails = Electron.ShortcutDetails;
type Size = Electron.Size;
type Task = Electron.Task;
type ThumbarButton = Electron.ThumbarButton;
type TraceCategoriesAndOptions = Electron.TraceCategoriesAndOptions;
type TraceConfig = Electron.TraceConfig;
type Transaction = Electron.Transaction;
type UploadData = Electron.UploadData;
type UploadFile = Electron.UploadFile;
type UploadRawData = Electron.UploadRawData;
type USBDevice = Electron.USBDevice;
type UserDefaultTypes = Electron.UserDefaultTypes;
type WebPreferences = Electron.WebPreferences;
type WebRequestFilter = Electron.WebRequestFilter;
type WebSource = Electron.WebSource;
}
namespace Renderer {
type Event<Params extends object = {}> = Electron.Event<Params>;
const contextBridge: ContextBridge;
type ContextBridge = Electron.ContextBridge;
const ipcRenderer: IpcRenderer;
type IpcRenderer = Electron.IpcRenderer;
const webFrame: WebFrame;
type WebFrame = Electron.WebFrame;
type WebviewTag = Electron.WebviewTag;
type AboutPanelOptionsOptions = Electron.AboutPanelOptionsOptions;
type AddRepresentationOptions = Electron.AddRepresentationOptions;
type AdjustSelectionOptions = Electron.AdjustSelectionOptions;
type AnimationSettings = Electron.AnimationSettings;
type AppDetailsOptions = Electron.AppDetailsOptions;
type ApplicationInfoForProtocolReturnValue = Electron.ApplicationInfoForProtocolReturnValue;
type AuthenticationResponseDetails = Electron.AuthenticationResponseDetails;
type AuthInfo = Electron.AuthInfo;
type AutoResizeOptions = Electron.AutoResizeOptions;
type BeforeSendResponse = Electron.BeforeSendResponse;
type BitmapOptions = Electron.BitmapOptions;
type BlinkMemoryInfo = Electron.BlinkMemoryInfo;
type BluetoothPairingHandlerHandlerDetails = Electron.BluetoothPairingHandlerHandlerDetails;
type BrowserViewConstructorOptions = Electron.BrowserViewConstructorOptions;
type CallbackResponse = Electron.CallbackResponse;
type CertificateTrustDialogOptions = Electron.CertificateTrustDialogOptions;
type ClearCodeCachesOptions = Electron.ClearCodeCachesOptions;
type ClearStorageDataOptions = Electron.ClearStorageDataOptions;
type ClientRequestConstructorOptions = Electron.ClientRequestConstructorOptions;
type CloseOpts = Electron.CloseOpts;
type Config = Electron.Config;
type ConfigureHostResolverOptions = Electron.ConfigureHostResolverOptions;
type ConsoleMessageEvent = Electron.ConsoleMessageEvent;
type ContextMenuEvent = Electron.ContextMenuEvent;
type ContextMenuParams = Electron.ContextMenuParams;
type ContinueActivityDetails = Electron.ContinueActivityDetails;
type CookiesGetFilter = Electron.CookiesGetFilter;
type CookiesSetDetails = Electron.CookiesSetDetails;
type CrashReporterStartOptions = Electron.CrashReporterStartOptions;
type CreateFromBitmapOptions = Electron.CreateFromBitmapOptions;
type CreateFromBufferOptions = Electron.CreateFromBufferOptions;
type CreateInterruptedDownloadOptions = Electron.CreateInterruptedDownloadOptions;
type Data = Electron.Data;
type DefaultFontFamily = Electron.DefaultFontFamily;
type Details = Electron.Details;
type DevicePermissionHandlerHandlerDetails = Electron.DevicePermissionHandlerHandlerDetails;
type DevtoolsOpenUrlEvent = Electron.DevtoolsOpenUrlEvent;
type DidChangeThemeColorEvent = Electron.DidChangeThemeColorEvent;
type DidCreateWindowDetails = Electron.DidCreateWindowDetails;
type DidFailLoadEvent = Electron.DidFailLoadEvent;
type DidFrameFinishLoadEvent = Electron.DidFrameFinishLoadEvent;
type DidFrameNavigateEvent = Electron.DidFrameNavigateEvent;
type DidNavigateEvent = Electron.DidNavigateEvent;
type DidNavigateInPageEvent = Electron.DidNavigateInPageEvent;
type DidRedirectNavigationEvent = Electron.DidRedirectNavigationEvent;
type DidStartNavigationEvent = Electron.DidStartNavigationEvent;
type DisplayBalloonOptions = Electron.DisplayBalloonOptions;
type DisplayMediaRequestHandlerHandlerRequest = Electron.DisplayMediaRequestHandlerHandlerRequest;
type DownloadURLOptions = Electron.DownloadURLOptions;
type EnableNetworkEmulationOptions = Electron.EnableNetworkEmulationOptions;
type FeedURLOptions = Electron.FeedURLOptions;
type FileIconOptions = Electron.FileIconOptions;
type FindInPageOptions = Electron.FindInPageOptions;
type FocusOptions = Electron.FocusOptions;
type ForkOptions = Electron.ForkOptions;
type FoundInPageEvent = Electron.FoundInPageEvent;
type FrameCreatedDetails = Electron.FrameCreatedDetails;
type FromPartitionOptions = Electron.FromPartitionOptions;
type FromPathOptions = Electron.FromPathOptions;
type HandlerDetails = Electron.HandlerDetails;
type HeadersReceivedResponse = Electron.HeadersReceivedResponse;
type HeapStatistics = Electron.HeapStatistics;
type HidDeviceAddedDetails = Electron.HidDeviceAddedDetails;
type HidDeviceRemovedDetails = Electron.HidDeviceRemovedDetails;
type HidDeviceRevokedDetails = Electron.HidDeviceRevokedDetails;
type IgnoreMouseEventsOptions = Electron.IgnoreMouseEventsOptions;
type ImportCertificateOptions = Electron.ImportCertificateOptions;
type Info = Electron.Info;
type Input = Electron.Input;
type InsertCSSOptions = Electron.InsertCSSOptions;
type IpcMessageEvent = Electron.IpcMessageEvent;
type Item = Electron.Item;
type JumpListSettings = Electron.JumpListSettings;
type LoadCommitEvent = Electron.LoadCommitEvent;
type LoadExtensionOptions = Electron.LoadExtensionOptions;
type LoadFileOptions = Electron.LoadFileOptions;
type LoadURLOptions = Electron.LoadURLOptions;
type LoginItemSettings = Electron.LoginItemSettings;
type LoginItemSettingsOptions = Electron.LoginItemSettingsOptions;
type MenuItemConstructorOptions = Electron.MenuItemConstructorOptions;
type MessageBoxOptions = Electron.MessageBoxOptions;
type MessageBoxReturnValue = Electron.MessageBoxReturnValue;
type MessageBoxSyncOptions = Electron.MessageBoxSyncOptions;
type MessageDetails = Electron.MessageDetails;
type MessageEvent = Electron.MessageEvent;
type MoveToApplicationsFolderOptions = Electron.MoveToApplicationsFolderOptions;
type NotificationConstructorOptions = Electron.NotificationConstructorOptions;
type OnBeforeRedirectListenerDetails = Electron.OnBeforeRedirectListenerDetails;
type OnBeforeRequestListenerDetails = Electron.OnBeforeRequestListenerDetails;
type OnBeforeSendHeadersListenerDetails = Electron.OnBeforeSendHeadersListenerDetails;
type OnCompletedListenerDetails = Electron.OnCompletedListenerDetails;
type OnErrorOccurredListenerDetails = Electron.OnErrorOccurredListenerDetails;
type OnHeadersReceivedListenerDetails = Electron.OnHeadersReceivedListenerDetails;
type OnResponseStartedListenerDetails = Electron.OnResponseStartedListenerDetails;
type OnSendHeadersListenerDetails = Electron.OnSendHeadersListenerDetails;
type OpenDevToolsOptions = Electron.OpenDevToolsOptions;
type OpenDialogOptions = Electron.OpenDialogOptions;
type OpenDialogReturnValue = Electron.OpenDialogReturnValue;
type OpenDialogSyncOptions = Electron.OpenDialogSyncOptions;
type OpenExternalOptions = Electron.OpenExternalOptions;
type Options = Electron.Options;
type Opts = Electron.Opts;
type PageFaviconUpdatedEvent = Electron.PageFaviconUpdatedEvent;
type PageTitleUpdatedEvent = Electron.PageTitleUpdatedEvent;
type Parameters = Electron.Parameters;
type Payment = Electron.Payment;
type PermissionCheckHandlerHandlerDetails = Electron.PermissionCheckHandlerHandlerDetails;
type PermissionRequestHandlerHandlerDetails = Electron.PermissionRequestHandlerHandlerDetails;
type PluginCrashedEvent = Electron.PluginCrashedEvent;
type PopupOptions = Electron.PopupOptions;
type PreconnectOptions = Electron.PreconnectOptions;
type PrintToPDFOptions = Electron.PrintToPDFOptions;
type Privileges = Electron.Privileges;
type ProgressBarOptions = Electron.ProgressBarOptions;
type Provider = Electron.Provider;
type PurchaseProductOpts = Electron.PurchaseProductOpts;
type ReadBookmark = Electron.ReadBookmark;
type RegistrationCompletedDetails = Electron.RegistrationCompletedDetails;
type RelaunchOptions = Electron.RelaunchOptions;
type RenderProcessGoneEvent = Electron.RenderProcessGoneEvent;
type Request = Electron.Request;
type ResizeOptions = Electron.ResizeOptions;
type ResolveHostOptions = Electron.ResolveHostOptions;
type ResourceUsage = Electron.ResourceUsage;
type Response = Electron.Response;
type Result = Electron.Result;
type SaveDialogOptions = Electron.SaveDialogOptions;
type SaveDialogReturnValue = Electron.SaveDialogReturnValue;
type SaveDialogSyncOptions = Electron.SaveDialogSyncOptions;
type SelectHidDeviceDetails = Electron.SelectHidDeviceDetails;
type SelectUsbDeviceDetails = Electron.SelectUsbDeviceDetails;
type SerialPortRevokedDetails = Electron.SerialPortRevokedDetails;
type Settings = Electron.Settings;
type SourcesOptions = Electron.SourcesOptions;
type SSLConfigConfig = Electron.SSLConfigConfig;
type StartLoggingOptions = Electron.StartLoggingOptions;
type Streams = Electron.Streams;
type SystemMemoryInfo = Electron.SystemMemoryInfo;
type TitleBarOverlay = Electron.TitleBarOverlay;
type TitleBarOverlayOptions = Electron.TitleBarOverlayOptions;
type TitleOptions = Electron.TitleOptions;
type ToBitmapOptions = Electron.ToBitmapOptions;
type ToDataURLOptions = Electron.ToDataURLOptions;
type ToPNGOptions = Electron.ToPNGOptions;
type TouchBarButtonConstructorOptions = Electron.TouchBarButtonConstructorOptions;
type TouchBarColorPickerConstructorOptions = Electron.TouchBarColorPickerConstructorOptions;
type TouchBarConstructorOptions = Electron.TouchBarConstructorOptions;
type TouchBarGroupConstructorOptions = Electron.TouchBarGroupConstructorOptions;
type TouchBarLabelConstructorOptions = Electron.TouchBarLabelConstructorOptions;
type TouchBarPopoverConstructorOptions = Electron.TouchBarPopoverConstructorOptions;
type TouchBarScrubberConstructorOptions = Electron.TouchBarScrubberConstructorOptions;
type TouchBarSegmentedControlConstructorOptions = Electron.TouchBarSegmentedControlConstructorOptions;
type TouchBarSliderConstructorOptions = Electron.TouchBarSliderConstructorOptions;
type TouchBarSpacerConstructorOptions = Electron.TouchBarSpacerConstructorOptions;
type TraceBufferUsageReturnValue = Electron.TraceBufferUsageReturnValue;
type UpdateTargetUrlEvent = Electron.UpdateTargetUrlEvent;
type UploadProgress = Electron.UploadProgress;
type UsbDeviceRevokedDetails = Electron.UsbDeviceRevokedDetails;
type USBProtectedClassesHandlerHandlerDetails = Electron.USBProtectedClassesHandlerHandlerDetails;
type VisibleOnAllWorkspacesOptions = Electron.VisibleOnAllWorkspacesOptions;
type WebContentsAudioStateChangedEventParams = Electron.WebContentsAudioStateChangedEventParams;
type WebContentsDidRedirectNavigationEventParams = Electron.WebContentsDidRedirectNavigationEventParams;
type WebContentsDidStartNavigationEventParams = Electron.WebContentsDidStartNavigationEventParams;
type WebContentsPrintOptions = Electron.WebContentsPrintOptions;
type WebContentsWillFrameNavigateEventParams = Electron.WebContentsWillFrameNavigateEventParams;
type WebContentsWillNavigateEventParams = Electron.WebContentsWillNavigateEventParams;
type WebContentsWillRedirectEventParams = Electron.WebContentsWillRedirectEventParams;
type WebviewTagPrintOptions = Electron.WebviewTagPrintOptions;
type WillFrameNavigateEvent = Electron.WillFrameNavigateEvent;
type WillNavigateEvent = Electron.WillNavigateEvent;
type WillResizeDetails = Electron.WillResizeDetails;
type EditFlags = Electron.EditFlags;
type Env = Electron.Env;
type FoundInPageResult = Electron.FoundInPageResult;
type LaunchItems = Electron.LaunchItems;
type Margins = Electron.Margins;
type MediaFlags = Electron.MediaFlags;
type PageRanges = Electron.PageRanges;
type Params = Electron.Params;
type Video = Electron.Video;
type BluetoothDevice = Electron.BluetoothDevice;
type BrowserWindowConstructorOptions = Electron.BrowserWindowConstructorOptions;
type Certificate = Electron.Certificate;
type CertificatePrincipal = Electron.CertificatePrincipal;
type Cookie = Electron.Cookie;
type CPUUsage = Electron.CPUUsage;
type CrashReport = Electron.CrashReport;
type CustomScheme = Electron.CustomScheme;
type DesktopCapturerSource = Electron.DesktopCapturerSource;
type Display = Electron.Display;
type Extension = Electron.Extension;
type ExtensionInfo = Electron.ExtensionInfo;
type FileFilter = Electron.FileFilter;
type FilePathWithHeaders = Electron.FilePathWithHeaders;
type GPUFeatureStatus = Electron.GPUFeatureStatus;
type HIDDevice = Electron.HIDDevice;
type InputEvent = Electron.InputEvent;
type IOCounters = Electron.IOCounters;
type IpcMainEvent = Electron.IpcMainEvent;
type IpcMainInvokeEvent = Electron.IpcMainInvokeEvent;
type IpcRendererEvent = Electron.IpcRendererEvent;
type JumpListCategory = Electron.JumpListCategory;
type JumpListItem = Electron.JumpListItem;
type KeyboardEvent = Electron.KeyboardEvent;
type KeyboardInputEvent = Electron.KeyboardInputEvent;
type MemoryInfo = Electron.MemoryInfo;
type MemoryUsageDetails = Electron.MemoryUsageDetails;
type MimeTypedBuffer = Electron.MimeTypedBuffer;
type MouseInputEvent = Electron.MouseInputEvent;
type MouseWheelInputEvent = Electron.MouseWheelInputEvent;
type NotificationAction = Electron.NotificationAction;
type NotificationResponse = Electron.NotificationResponse;
type PaymentDiscount = Electron.PaymentDiscount;
type Point = Electron.Point;
type PostBody = Electron.PostBody;
type PrinterInfo = Electron.PrinterInfo;
type ProcessMemoryInfo = Electron.ProcessMemoryInfo;
type ProcessMetric = Electron.ProcessMetric;
type Product = Electron.Product;
type ProductDiscount = Electron.ProductDiscount;
type ProductSubscriptionPeriod = Electron.ProductSubscriptionPeriod;
type ProtocolRequest = Electron.ProtocolRequest;
type ProtocolResponse = Electron.ProtocolResponse;
type ProtocolResponseUploadData = Electron.ProtocolResponseUploadData;
type Rectangle = Electron.Rectangle;
type Referrer = Electron.Referrer;
type RenderProcessGoneDetails = Electron.RenderProcessGoneDetails;
type ResolvedEndpoint = Electron.ResolvedEndpoint;
type ResolvedHost = Electron.ResolvedHost;
type ScrubberItem = Electron.ScrubberItem;
type SegmentedControlSegment = Electron.SegmentedControlSegment;
type SerialPort = Electron.SerialPort;
type ServiceWorkerInfo = Electron.ServiceWorkerInfo;
type SharedWorkerInfo = Electron.SharedWorkerInfo;
type SharingItem = Electron.SharingItem;
type ShortcutDetails = Electron.ShortcutDetails;
type Size = Electron.Size;
type Task = Electron.Task;
type ThumbarButton = Electron.ThumbarButton;
type TraceCategoriesAndOptions = Electron.TraceCategoriesAndOptions;
type TraceConfig = Electron.TraceConfig;
type Transaction = Electron.Transaction;
type UploadData = Electron.UploadData;
type UploadFile = Electron.UploadFile;
type UploadRawData = Electron.UploadRawData;
type USBDevice = Electron.USBDevice;
type UserDefaultTypes = Electron.UserDefaultTypes;
type WebPreferences = Electron.WebPreferences;
type WebRequestFilter = Electron.WebRequestFilter;
type WebSource = Electron.WebSource;
}
namespace CrossProcessExports {
type Event<Params extends object = {}> = Electron.Event<Params>;
const app: App;
type App = Electron.App;
const autoUpdater: AutoUpdater;
type AutoUpdater = Electron.AutoUpdater;
class BrowserView extends Electron.BrowserView {}
class BrowserWindow extends Electron.BrowserWindow {}
type ClientRequest = Electron.ClientRequest;
const clipboard: Clipboard;
type Clipboard = Electron.Clipboard;
type CommandLine = Electron.CommandLine;
const contentTracing: ContentTracing;
type ContentTracing = Electron.ContentTracing;
const contextBridge: ContextBridge;
type ContextBridge = Electron.ContextBridge;
type Cookies = Electron.Cookies;
const crashReporter: CrashReporter;
type CrashReporter = Electron.CrashReporter;
type Debugger = Electron.Debugger;
const desktopCapturer: DesktopCapturer;
type DesktopCapturer = Electron.DesktopCapturer;
const dialog: Dialog;
type Dialog = Electron.Dialog;
type Dock = Electron.Dock;
type DownloadItem = Electron.DownloadItem;
const globalShortcut: GlobalShortcut;
type GlobalShortcut = Electron.GlobalShortcut;
const inAppPurchase: InAppPurchase;
type InAppPurchase = Electron.InAppPurchase;
type IncomingMessage = Electron.IncomingMessage;
const ipcMain: IpcMain;
type IpcMain = Electron.IpcMain;
const ipcRenderer: IpcRenderer;
type IpcRenderer = Electron.IpcRenderer;
class Menu extends Electron.Menu {}
class MenuItem extends Electron.MenuItem {}
class MessageChannelMain extends Electron.MessageChannelMain {}
type MessagePortMain = Electron.MessagePortMain;
const nativeImage: typeof NativeImage;
type NativeImage = Electron.NativeImage;
const nativeTheme: NativeTheme;
type NativeTheme = Electron.NativeTheme;
const net: Net;
type Net = Electron.Net;
const netLog: NetLog;
type NetLog = Electron.NetLog;
class Notification extends Electron.Notification {}
const powerMonitor: PowerMonitor;
type PowerMonitor = Electron.PowerMonitor;
const powerSaveBlocker: PowerSaveBlocker;
type PowerSaveBlocker = Electron.PowerSaveBlocker;
const protocol: Protocol;
type Protocol = Electron.Protocol;
const pushNotifications: PushNotifications;
type PushNotifications = Electron.PushNotifications;
const safeStorage: SafeStorage;
type SafeStorage = Electron.SafeStorage;
const screen: Screen;
type Screen = Electron.Screen;
type ServiceWorkers = Electron.ServiceWorkers;
const session: typeof Session;
type Session = Electron.Session;
class ShareMenu extends Electron.ShareMenu {}
const shell: Shell;
type Shell = Electron.Shell;
const systemPreferences: SystemPreferences;
type SystemPreferences = Electron.SystemPreferences;
class TouchBar extends Electron.TouchBar {}
type TouchBarButton = Electron.TouchBarButton;
type TouchBarColorPicker = Electron.TouchBarColorPicker;
type TouchBarGroup = Electron.TouchBarGroup;
type TouchBarLabel = Electron.TouchBarLabel;
type TouchBarOtherItemsProxy = Electron.TouchBarOtherItemsProxy;
type TouchBarPopover = Electron.TouchBarPopover;
type TouchBarScrubber = Electron.TouchBarScrubber;
type TouchBarSegmentedControl = Electron.TouchBarSegmentedControl;
type TouchBarSlider = Electron.TouchBarSlider;
type TouchBarSpacer = Electron.TouchBarSpacer;
class Tray extends Electron.Tray {}
const utilityProcess: typeof UtilityProcess;
type UtilityProcess = Electron.UtilityProcess;
const webContents: typeof WebContents;
type WebContents = Electron.WebContents;
const webFrame: WebFrame;
type WebFrame = Electron.WebFrame;
const webFrameMain: typeof WebFrameMain;
type WebFrameMain = Electron.WebFrameMain;
type WebRequest = Electron.WebRequest;
type WebviewTag = Electron.WebviewTag;
type AboutPanelOptionsOptions = Electron.AboutPanelOptionsOptions;
type AddRepresentationOptions = Electron.AddRepresentationOptions;
type AdjustSelectionOptions = Electron.AdjustSelectionOptions;
type AnimationSettings = Electron.AnimationSettings;
type AppDetailsOptions = Electron.AppDetailsOptions;
type ApplicationInfoForProtocolReturnValue = Electron.ApplicationInfoForProtocolReturnValue;
type AuthenticationResponseDetails = Electron.AuthenticationResponseDetails;
type AuthInfo = Electron.AuthInfo;
type AutoResizeOptions = Electron.AutoResizeOptions;
type BeforeSendResponse = Electron.BeforeSendResponse;
type BitmapOptions = Electron.BitmapOptions;
type BlinkMemoryInfo = Electron.BlinkMemoryInfo;
type BluetoothPairingHandlerHandlerDetails = Electron.BluetoothPairingHandlerHandlerDetails;
type BrowserViewConstructorOptions = Electron.BrowserViewConstructorOptions;
type CallbackResponse = Electron.CallbackResponse;
type CertificateTrustDialogOptions = Electron.CertificateTrustDialogOptions;
type ClearCodeCachesOptions = Electron.ClearCodeCachesOptions;
type ClearStorageDataOptions = Electron.ClearStorageDataOptions;
type ClientRequestConstructorOptions = Electron.ClientRequestConstructorOptions;
type CloseOpts = Electron.CloseOpts;
type Config = Electron.Config;
type ConfigureHostResolverOptions = Electron.ConfigureHostResolverOptions;
type ConsoleMessageEvent = Electron.ConsoleMessageEvent;
type ContextMenuEvent = Electron.ContextMenuEvent;
type ContextMenuParams = Electron.ContextMenuParams;
type ContinueActivityDetails = Electron.ContinueActivityDetails;
type CookiesGetFilter = Electron.CookiesGetFilter;
type CookiesSetDetails = Electron.CookiesSetDetails;
type CrashReporterStartOptions = Electron.CrashReporterStartOptions;
type CreateFromBitmapOptions = Electron.CreateFromBitmapOptions;
type CreateFromBufferOptions = Electron.CreateFromBufferOptions;
type CreateInterruptedDownloadOptions = Electron.CreateInterruptedDownloadOptions;
type Data = Electron.Data;
type DefaultFontFamily = Electron.DefaultFontFamily;
type Details = Electron.Details;
type DevicePermissionHandlerHandlerDetails = Electron.DevicePermissionHandlerHandlerDetails;
type DevtoolsOpenUrlEvent = Electron.DevtoolsOpenUrlEvent;
type DidChangeThemeColorEvent = Electron.DidChangeThemeColorEvent;
type DidCreateWindowDetails = Electron.DidCreateWindowDetails;
type DidFailLoadEvent = Electron.DidFailLoadEvent;
type DidFrameFinishLoadEvent = Electron.DidFrameFinishLoadEvent;
type DidFrameNavigateEvent = Electron.DidFrameNavigateEvent;
type DidNavigateEvent = Electron.DidNavigateEvent;
type DidNavigateInPageEvent = Electron.DidNavigateInPageEvent;
type DidRedirectNavigationEvent = Electron.DidRedirectNavigationEvent;
type DidStartNavigationEvent = Electron.DidStartNavigationEvent;
type DisplayBalloonOptions = Electron.DisplayBalloonOptions;
type DisplayMediaRequestHandlerHandlerRequest = Electron.DisplayMediaRequestHandlerHandlerRequest;
type DownloadURLOptions = Electron.DownloadURLOptions;
type EnableNetworkEmulationOptions = Electron.EnableNetworkEmulationOptions;
type FeedURLOptions = Electron.FeedURLOptions;
type FileIconOptions = Electron.FileIconOptions;
type FindInPageOptions = Electron.FindInPageOptions;
type FocusOptions = Electron.FocusOptions;
type ForkOptions = Electron.ForkOptions;
type FoundInPageEvent = Electron.FoundInPageEvent;
type FrameCreatedDetails = Electron.FrameCreatedDetails;
type FromPartitionOptions = Electron.FromPartitionOptions;
type FromPathOptions = Electron.FromPathOptions;
type HandlerDetails = Electron.HandlerDetails;
type HeadersReceivedResponse = Electron.HeadersReceivedResponse;
type HeapStatistics = Electron.HeapStatistics;
type HidDeviceAddedDetails = Electron.HidDeviceAddedDetails;
type HidDeviceRemovedDetails = Electron.HidDeviceRemovedDetails;
type HidDeviceRevokedDetails = Electron.HidDeviceRevokedDetails;
type IgnoreMouseEventsOptions = Electron.IgnoreMouseEventsOptions;
type ImportCertificateOptions = Electron.ImportCertificateOptions;
type Info = Electron.Info;
type Input = Electron.Input;
type InsertCSSOptions = Electron.InsertCSSOptions;
type IpcMessageEvent = Electron.IpcMessageEvent;
type Item = Electron.Item;
type JumpListSettings = Electron.JumpListSettings;
type LoadCommitEvent = Electron.LoadCommitEvent;
type LoadExtensionOptions = Electron.LoadExtensionOptions;
type LoadFileOptions = Electron.LoadFileOptions;
type LoadURLOptions = Electron.LoadURLOptions;
type LoginItemSettings = Electron.LoginItemSettings;
type LoginItemSettingsOptions = Electron.LoginItemSettingsOptions;
type MenuItemConstructorOptions = Electron.MenuItemConstructorOptions;
type MessageBoxOptions = Electron.MessageBoxOptions;
type MessageBoxReturnValue = Electron.MessageBoxReturnValue;
type MessageBoxSyncOptions = Electron.MessageBoxSyncOptions;
type MessageDetails = Electron.MessageDetails;
type MessageEvent = Electron.MessageEvent;
type MoveToApplicationsFolderOptions = Electron.MoveToApplicationsFolderOptions;
type NotificationConstructorOptions = Electron.NotificationConstructorOptions;
type OnBeforeRedirectListenerDetails = Electron.OnBeforeRedirectListenerDetails;
type OnBeforeRequestListenerDetails = Electron.OnBeforeRequestListenerDetails;
type OnBeforeSendHeadersListenerDetails = Electron.OnBeforeSendHeadersListenerDetails;
type OnCompletedListenerDetails = Electron.OnCompletedListenerDetails;
type OnErrorOccurredListenerDetails = Electron.OnErrorOccurredListenerDetails;
type OnHeadersReceivedListenerDetails = Electron.OnHeadersReceivedListenerDetails;
type OnResponseStartedListenerDetails = Electron.OnResponseStartedListenerDetails;
type OnSendHeadersListenerDetails = Electron.OnSendHeadersListenerDetails;
type OpenDevToolsOptions = Electron.OpenDevToolsOptions;
type OpenDialogOptions = Electron.OpenDialogOptions;
type OpenDialogReturnValue = Electron.OpenDialogReturnValue;
type OpenDialogSyncOptions = Electron.OpenDialogSyncOptions;
type OpenExternalOptions = Electron.OpenExternalOptions;
type Options = Electron.Options;
type Opts = Electron.Opts;
type PageFaviconUpdatedEvent = Electron.PageFaviconUpdatedEvent;
type PageTitleUpdatedEvent = Electron.PageTitleUpdatedEvent;
type Parameters = Electron.Parameters;
type Payment = Electron.Payment;
type PermissionCheckHandlerHandlerDetails = Electron.PermissionCheckHandlerHandlerDetails;
type PermissionRequestHandlerHandlerDetails = Electron.PermissionRequestHandlerHandlerDetails;
type PluginCrashedEvent = Electron.PluginCrashedEvent;
type PopupOptions = Electron.PopupOptions;
type PreconnectOptions = Electron.PreconnectOptions;
type PrintToPDFOptions = Electron.PrintToPDFOptions;
type Privileges = Electron.Privileges;
type ProgressBarOptions = Electron.ProgressBarOptions;
type Provider = Electron.Provider;
type PurchaseProductOpts = Electron.PurchaseProductOpts;
type ReadBookmark = Electron.ReadBookmark;
type RegistrationCompletedDetails = Electron.RegistrationCompletedDetails;
type RelaunchOptions = Electron.RelaunchOptions;
type RenderProcessGoneEvent = Electron.RenderProcessGoneEvent;
type Request = Electron.Request;
type ResizeOptions = Electron.ResizeOptions;
type ResolveHostOptions = Electron.ResolveHostOptions;
type ResourceUsage = Electron.ResourceUsage;
type Response = Electron.Response;
type Result = Electron.Result;
type SaveDialogOptions = Electron.SaveDialogOptions;
type SaveDialogReturnValue = Electron.SaveDialogReturnValue;
type SaveDialogSyncOptions = Electron.SaveDialogSyncOptions;
type SelectHidDeviceDetails = Electron.SelectHidDeviceDetails;
type SelectUsbDeviceDetails = Electron.SelectUsbDeviceDetails;
type SerialPortRevokedDetails = Electron.SerialPortRevokedDetails;
type Settings = Electron.Settings;
type SourcesOptions = Electron.SourcesOptions;
type SSLConfigConfig = Electron.SSLConfigConfig;
type StartLoggingOptions = Electron.StartLoggingOptions;
type Streams = Electron.Streams;
type SystemMemoryInfo = Electron.SystemMemoryInfo;
type TitleBarOverlay = Electron.TitleBarOverlay;
type TitleBarOverlayOptions = Electron.TitleBarOverlayOptions;
type TitleOptions = Electron.TitleOptions;
type ToBitmapOptions = Electron.ToBitmapOptions;
type ToDataURLOptions = Electron.ToDataURLOptions;
type ToPNGOptions = Electron.ToPNGOptions;
type TouchBarButtonConstructorOptions = Electron.TouchBarButtonConstructorOptions;
type TouchBarColorPickerConstructorOptions = Electron.TouchBarColorPickerConstructorOptions;
type TouchBarConstructorOptions = Electron.TouchBarConstructorOptions;
type TouchBarGroupConstructorOptions = Electron.TouchBarGroupConstructorOptions;
type TouchBarLabelConstructorOptions = Electron.TouchBarLabelConstructorOptions;
type TouchBarPopoverConstructorOptions = Electron.TouchBarPopoverConstructorOptions;
type TouchBarScrubberConstructorOptions = Electron.TouchBarScrubberConstructorOptions;
type TouchBarSegmentedControlConstructorOptions = Electron.TouchBarSegmentedControlConstructorOptions;
type TouchBarSliderConstructorOptions = Electron.TouchBarSliderConstructorOptions;
type TouchBarSpacerConstructorOptions = Electron.TouchBarSpacerConstructorOptions;
type TraceBufferUsageReturnValue = Electron.TraceBufferUsageReturnValue;
type UpdateTargetUrlEvent = Electron.UpdateTargetUrlEvent;
type UploadProgress = Electron.UploadProgress;
type UsbDeviceRevokedDetails = Electron.UsbDeviceRevokedDetails;
type USBProtectedClassesHandlerHandlerDetails = Electron.USBProtectedClassesHandlerHandlerDetails;
type VisibleOnAllWorkspacesOptions = Electron.VisibleOnAllWorkspacesOptions;
type WebContentsAudioStateChangedEventParams = Electron.WebContentsAudioStateChangedEventParams;
type WebContentsDidRedirectNavigationEventParams = Electron.WebContentsDidRedirectNavigationEventParams;
type WebContentsDidStartNavigationEventParams = Electron.WebContentsDidStartNavigationEventParams;
type WebContentsPrintOptions = Electron.WebContentsPrintOptions;
type WebContentsWillFrameNavigateEventParams = Electron.WebContentsWillFrameNavigateEventParams;
type WebContentsWillNavigateEventParams = Electron.WebContentsWillNavigateEventParams;
type WebContentsWillRedirectEventParams = Electron.WebContentsWillRedirectEventParams;
type WebviewTagPrintOptions = Electron.WebviewTagPrintOptions;
type WillFrameNavigateEvent = Electron.WillFrameNavigateEvent;
type WillNavigateEvent = Electron.WillNavigateEvent;
type WillResizeDetails = Electron.WillResizeDetails;
type EditFlags = Electron.EditFlags;
type Env = Electron.Env;
type FoundInPageResult = Electron.FoundInPageResult;
type LaunchItems = Electron.LaunchItems;
type Margins = Electron.Margins;
type MediaFlags = Electron.MediaFlags;
type PageRanges = Electron.PageRanges;
type Params = Electron.Params;
type Video = Electron.Video;
type BluetoothDevice = Electron.BluetoothDevice;
type BrowserWindowConstructorOptions = Electron.BrowserWindowConstructorOptions;
type Certificate = Electron.Certificate;
type CertificatePrincipal = Electron.CertificatePrincipal;
type Cookie = Electron.Cookie;
type CPUUsage = Electron.CPUUsage;
type CrashReport = Electron.CrashReport;
type CustomScheme = Electron.CustomScheme;
type DesktopCapturerSource = Electron.DesktopCapturerSource;
type Display = Electron.Display;
type Extension = Electron.Extension;
type ExtensionInfo = Electron.ExtensionInfo;
type FileFilter = Electron.FileFilter;
type FilePathWithHeaders = Electron.FilePathWithHeaders;
type GPUFeatureStatus = Electron.GPUFeatureStatus;
type HIDDevice = Electron.HIDDevice;
type InputEvent = Electron.InputEvent;
type IOCounters = Electron.IOCounters;
type IpcMainEvent = Electron.IpcMainEvent;
type IpcMainInvokeEvent = Electron.IpcMainInvokeEvent;
type IpcRendererEvent = Electron.IpcRendererEvent;
type JumpListCategory = Electron.JumpListCategory;
type JumpListItem = Electron.JumpListItem;
type KeyboardEvent = Electron.KeyboardEvent;
type KeyboardInputEvent = Electron.KeyboardInputEvent;
type MemoryInfo = Electron.MemoryInfo;
type MemoryUsageDetails = Electron.MemoryUsageDetails;
type MimeTypedBuffer = Electron.MimeTypedBuffer;
type MouseInputEvent = Electron.MouseInputEvent;
type MouseWheelInputEvent = Electron.MouseWheelInputEvent;
type NotificationAction = Electron.NotificationAction;
type NotificationResponse = Electron.NotificationResponse;
type PaymentDiscount = Electron.PaymentDiscount;
type Point = Electron.Point;
type PostBody = Electron.PostBody;
type PrinterInfo = Electron.PrinterInfo;
type ProcessMemoryInfo = Electron.ProcessMemoryInfo;
type ProcessMetric = Electron.ProcessMetric;
type Product = Electron.Product;
type ProductDiscount = Electron.ProductDiscount;
type ProductSubscriptionPeriod = Electron.ProductSubscriptionPeriod;
type ProtocolRequest = Electron.ProtocolRequest;
type ProtocolResponse = Electron.ProtocolResponse;
type ProtocolResponseUploadData = Electron.ProtocolResponseUploadData;
type Rectangle = Electron.Rectangle;
type Referrer = Electron.Referrer;
type RenderProcessGoneDetails = Electron.RenderProcessGoneDetails;
type ResolvedEndpoint = Electron.ResolvedEndpoint;
type ResolvedHost = Electron.ResolvedHost;
type ScrubberItem = Electron.ScrubberItem;
type SegmentedControlSegment = Electron.SegmentedControlSegment;
type SerialPort = Electron.SerialPort;
type ServiceWorkerInfo = Electron.ServiceWorkerInfo;
type SharedWorkerInfo = Electron.SharedWorkerInfo;
type SharingItem = Electron.SharingItem;
type ShortcutDetails = Electron.ShortcutDetails;
type Size = Electron.Size;
type Task = Electron.Task;
type ThumbarButton = Electron.ThumbarButton;
type TraceCategoriesAndOptions = Electron.TraceCategoriesAndOptions;
type TraceConfig = Electron.TraceConfig;
type Transaction = Electron.Transaction;
type UploadData = Electron.UploadData;
type UploadFile = Electron.UploadFile;
type UploadRawData = Electron.UploadRawData;
type USBDevice = Electron.USBDevice;
type UserDefaultTypes = Electron.UserDefaultTypes;
type WebPreferences = Electron.WebPreferences;
type WebRequestFilter = Electron.WebRequestFilter;
type WebSource = Electron.WebSource;
}
const app: App;
const autoUpdater: AutoUpdater;
const clipboard: Clipboard;
const contentTracing: ContentTracing;
const contextBridge: ContextBridge;
const crashReporter: CrashReporter;
const desktopCapturer: DesktopCapturer;
const dialog: Dialog;
const globalShortcut: GlobalShortcut;
const inAppPurchase: InAppPurchase;
const ipcMain: IpcMain;
const ipcRenderer: IpcRenderer;
const nativeImage: typeof NativeImage;
const nativeTheme: NativeTheme;
const net: Net;
const netLog: NetLog;
const parentPort: ParentPort;
const powerMonitor: PowerMonitor;
const powerSaveBlocker: PowerSaveBlocker;
const protocol: Protocol;
const pushNotifications: PushNotifications;
const safeStorage: SafeStorage;
const screen: Screen;
const session: typeof Session;
const shell: Shell;
const systemPreferences: SystemPreferences;
const utilityProcess: typeof UtilityProcess;
const webContents: typeof WebContents;
const webFrame: WebFrame;
const webFrameMain: typeof WebFrameMain;
}
declare module 'electron' {
export = Electron.CrossProcessExports;
}
declare module 'electron/main' {
export = Electron.Main;
}
declare module 'electron/common' {
export = Electron.Common;
}
declare module 'electron/renderer' {
export = Electron.Renderer;
}
interface NodeRequireFunction {
(moduleName: 'electron'): typeof Electron.CrossProcessExports;
(moduleName: 'electron/main'): typeof Electron.Main;
(moduleName: 'electron/common'): typeof Electron.Common;
(moduleName: 'electron/renderer'): typeof Electron.Renderer;
}
interface NodeRequire {
(moduleName: 'electron'): typeof Electron.CrossProcessExports;
(moduleName: 'electron/main'): typeof Electron.Main;
(moduleName: 'electron/common'): typeof Electron.Common;
(moduleName: 'electron/renderer'): typeof Electron.Renderer;
}
interface File {
/**
* The real path to the file on the users filesystem
*/
path: string;
}
declare module 'original-fs' {
import * as fs from 'fs';
export = fs;
}
declare module 'node:original-fs' {
import * as fs from 'fs';
export = fs;
}
interface Document {
createElement(tagName: 'webview'): Electron.WebviewTag;
}
declare namespace NodeJS {
interface Process extends NodeJS.EventEmitter {
// Docs: https://electronjs.org/docs/api/process
/**
* Emitted when Electron has loaded its internal initialization script and is
* beginning to load the web page or the main script.
*/
on(event: 'loaded', listener: Function): this;
once(event: 'loaded', listener: Function): this;
addListener(event: 'loaded', listener: Function): this;
removeListener(event: 'loaded', listener: Function): this;
/**
* Causes the main thread of the current process crash.
*/
crash(): void;
/**
* * `allocated` Integer - Size of all allocated objects in Kilobytes.
* * `total` Integer - Total allocated space in Kilobytes.
*
* Returns an object with Blink memory information. It can be useful for debugging
* rendering / DOM related memory issues. Note that all values are reported in
* Kilobytes.
*/
getBlinkMemoryInfo(): Electron.BlinkMemoryInfo;
getCPUUsage(): Electron.CPUUsage;
/**
* The number of milliseconds since epoch, or `null` if the information is
* unavailable
*
* Indicates the creation time of the application. The time is represented as
* number of milliseconds since epoch. It returns null if it is unable to get the
* process creation time.
*/
getCreationTime(): (number) | (null);
/**
* * `totalHeapSize` Integer
* * `totalHeapSizeExecutable` Integer
* * `totalPhysicalSize` Integer
* * `totalAvailableSize` Integer
* * `usedHeapSize` Integer
* * `heapSizeLimit` Integer
* * `mallocedMemory` Integer
* * `peakMallocedMemory` Integer
* * `doesZapGarbage` boolean
*
* Returns an object with V8 heap statistics. Note that all statistics are reported
* in Kilobytes.
*/
getHeapStatistics(): Electron.HeapStatistics;
/**
* @platform win32,linux
*/
getIOCounters(): Electron.IOCounters;
/**
* Resolves with a ProcessMemoryInfo
*
* Returns an object giving memory usage statistics about the current process. Note
* that all statistics are reported in Kilobytes. This api should be called after
* app ready.
*
* Chromium does not provide `residentSet` value for macOS. This is because macOS
* performs in-memory compression of pages that haven't been recently used. As a
* result the resident set size value is not what one would expect. `private`
* memory is more representative of the actual pre-compression memory usage of the
* process on macOS.
*/
getProcessMemoryInfo(): Promise<Electron.ProcessMemoryInfo>;
/**
* * `total` Integer - The total amount of physical memory in Kilobytes available
* to the system.
* * `free` Integer - The total amount of memory not being used by applications or
* disk cache.
* * `swapTotal` Integer _Windows_ _Linux_ - The total amount of swap memory in
* Kilobytes available to the system.
* * `swapFree` Integer _Windows_ _Linux_ - The free amount of swap memory in
* Kilobytes available to the system.
*
* Returns an object giving memory usage statistics about the entire system. Note
* that all statistics are reported in Kilobytes.
*/
getSystemMemoryInfo(): Electron.SystemMemoryInfo;
/**
* The version of the host operating system.
*
* Example:
*
* **Note:** It returns the actual operating system version instead of kernel
* version on macOS unlike `os.release()`.
*/
getSystemVersion(): string;
/**
* Causes the main thread of the current process hang.
*/
hang(): void;
/**
* Sets the file descriptor soft limit to `maxDescriptors` or the OS hard limit,
* whichever is lower for the current process.
*
* @platform darwin,linux
*/
setFdLimit(maxDescriptors: number): void;
/**
* Indicates whether the snapshot has been created successfully.
*
* Takes a V8 heap snapshot and saves it to `filePath`.
*/
takeHeapSnapshot(filePath: string): boolean;
/**
* A `string` representing Chrome's version string.
*
*/
readonly chrome: string;
/**
* A `string` (optional) representing a globally unique ID of the current
* JavaScript context. Each frame has its own JavaScript context. When
* contextIsolation is enabled, the isolated world also has a separate JavaScript
* context. This property is only available in the renderer process.
*
*/
readonly contextId?: string;
/**
* A `boolean` that indicates whether the current renderer context has
* `contextIsolation` enabled. It is `undefined` in the main process.
*
*/
readonly contextIsolated: boolean;
/**
* A `boolean`. When the app is started by being passed as parameter to the default
* Electron executable, this property is `true` in the main process, otherwise it
* is `undefined`. For example when running the app with `electron .`, it is
* `true`, even if the app is packaged (`isPackaged`) is `true`. This can be useful
* to determine how many arguments will need to be sliced off from `process.argv`.
*
*/
readonly defaultApp: boolean;
/**
* A `string` representing Electron's version string.
*
*/
readonly electron: string;
/**
* A `boolean`, `true` when the current renderer context is the "main" renderer
* frame. If you want the ID of the current frame you should use
* `webFrame.routingId`.
*
*/
readonly isMainFrame: boolean;
/**
* A `boolean`. For Mac App Store build, this property is `true`, for other builds
* it is `undefined`.
*
*/
readonly mas: boolean;
/**
* A `boolean` that controls ASAR support inside your application. Setting this to
* `true` will disable the support for `asar` archives in Node's built-in modules.
*/
noAsar: boolean;
/**
* A `boolean` that controls whether or not deprecation warnings are printed to
* `stderr`. Setting this to `true` will silence deprecation warnings. This
* property is used instead of the `--no-deprecation` command line flag.
*/
noDeprecation: boolean;
/**
* A `Electron.ParentPort` property if this is a `UtilityProcess` (or `null`
* otherwise) allowing communication with the parent process.
*/
parentPort: Electron.ParentPort;
/**
* A `string` representing the path to the resources directory.
*
*/
readonly resourcesPath: string;
/**
* A `boolean`. When the renderer process is sandboxed, this property is `true`,
* otherwise it is `undefined`.
*
*/
readonly sandboxed: boolean;
/**
* A `boolean` that controls whether or not deprecation warnings will be thrown as
* exceptions. Setting this to `true` will throw errors for deprecations. This
* property is used instead of the `--throw-deprecation` command line flag.
*/
throwDeprecation: boolean;
/**
* A `boolean` that controls whether or not deprecations printed to `stderr`
* include their stack trace. Setting this to `true` will print stack traces for
* deprecations. This property is instead of the `--trace-deprecation` command line
* flag.
*/
traceDeprecation: boolean;
/**
* A `boolean` that controls whether or not process warnings printed to `stderr`
* include their stack trace. Setting this to `true` will print stack traces for
* process warnings (including deprecations). This property is instead of the
* `--trace-warnings` command line flag.
*/
traceProcessWarnings: boolean;
/**
* A `string` representing the current process's type, can be:
*
* * `browser` - The main process
* * `renderer` - A renderer process
* * `worker` - In a web worker
* * `utility` - In a node process launched as a service
*
*/
readonly type: ('browser' | 'renderer' | 'worker' | 'utility');
/**
* A `boolean`. If the app is running as a Windows Store app (appx), this property
* is `true`, for otherwise it is `undefined`.
*
*/
readonly windowsStore: boolean;
}
interface ProcessVersions {
readonly electron: string;
readonly chrome: string;
}
}
|