electron 24.0.0 → 25.0.0-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/checksums.json +75 -75
  2. package/electron.d.ts +875 -144
  3. package/package.json +1 -1
package/electron.d.ts CHANGED
@@ -1,18 +1,23 @@
1
- // Type definitions for Electron 24.0.0
1
+ // Type definitions for Electron 25.0.0-alpha.1
2
2
  // Project: http://electronjs.org/
3
3
  // Definitions by: The Electron Team <https://github.com/electron/electron>
4
- // Definitions: https://github.com/electron/electron-typescript-definitions
4
+ // Definitions: https://github.com/electron/typescript-definitions
5
5
 
6
6
  /// <reference types="node" />
7
7
 
8
- type GlobalEvent = Event & { returnValue: any };
8
+ type DOMEvent = Event;
9
+ type GlobalResponse = Response;
10
+ type GlobalRequest = Request;
9
11
 
10
12
  declare namespace Electron {
11
13
  const NodeEventEmitter: typeof import('events').EventEmitter;
12
14
 
13
- class Accelerator extends String {
15
+ type Accelerator = string;
16
+ type Event<Params extends object = {}> = {
17
+ preventDefault: () => void;
18
+ readonly defaultPrevented: boolean;
19
+ } & Params;
14
20
 
15
- }
16
21
  interface App extends NodeJS.EventEmitter {
17
22
 
18
23
  // Docs: https://electronjs.org/docs/api/app
@@ -109,7 +114,7 @@ declare namespace Electron {
109
114
  * the application.
110
115
  *
111
116
  * **Note:** If application quit was initiated by `autoUpdater.quitAndInstall()`,
112
- * then `before-quit` is emitted *after* emitting `close` event on all windows and
117
+ * then `before-quit` is emitted _after_ emitting `close` event on all windows and
113
118
  * closing them.
114
119
  *
115
120
  * **Note:** On Windows, this event will not be emitted if the app is closed due to
@@ -446,12 +451,24 @@ declare namespace Electron {
446
451
  * fulfilled when Electron is initialized.
447
452
  */
448
453
  on(event: 'ready', listener: (event: Event,
454
+ /**
455
+ * @platform darwin
456
+ */
449
457
  launchInfo: (Record<string, any>) | (NotificationResponse)) => void): this;
450
458
  once(event: 'ready', listener: (event: Event,
459
+ /**
460
+ * @platform darwin
461
+ */
451
462
  launchInfo: (Record<string, any>) | (NotificationResponse)) => void): this;
452
463
  addListener(event: 'ready', listener: (event: Event,
464
+ /**
465
+ * @platform darwin
466
+ */
453
467
  launchInfo: (Record<string, any>) | (NotificationResponse)) => void): this;
454
468
  removeListener(event: 'ready', listener: (event: Event,
469
+ /**
470
+ * @platform darwin
471
+ */
455
472
  launchInfo: (Record<string, any>) | (NotificationResponse)) => void): this;
456
473
  /**
457
474
  * Emitted when the renderer process unexpectedly disappears. This is normally
@@ -978,21 +995,14 @@ declare namespace Electron {
978
995
  * Here are some examples of return values of the various language and locale APIs
979
996
  * with different configurations:
980
997
  *
981
- * * For Windows, where the application locale is German, the regional format is
982
- * Finnish (Finland), and the preferred system languages from most to least
983
- * preferred are French (Canada), English (US), Simplified Chinese (China),
984
- * Finnish, and Spanish (Latin America):
985
- * * `app.getLocale()` returns `'de'`
986
- * * `app.getSystemLocale()` returns `'fi-FI'`
987
- * * `app.getPreferredSystemLanguages()` returns `['fr-CA', 'en-US',
988
- * 'zh-Hans-CN', 'fi', 'es-419']`
989
- * * On macOS, where the application locale is German, the region is Finland, and
990
- * the preferred system languages from most to least preferred are French (Canada),
998
+ * On Windows, given application locale is German, the regional format is Finnish
999
+ * (Finland), and the preferred system languages from most to least preferred are
1000
+ * French (Canada), English (US), Simplified Chinese (China), Finnish, and Spanish
1001
+ * (Latin America):
1002
+ *
1003
+ * On macOS, given the application locale is German, the region is Finland, and the
1004
+ * preferred system languages from most to least preferred are French (Canada),
991
1005
  * English (US), Simplified Chinese, and Spanish (Latin America):
992
- * * `app.getLocale()` returns `'de'`
993
- * * `app.getSystemLocale()` returns `'fr-FI'`
994
- * * `app.getPreferredSystemLanguages()` returns `['fr-CA', 'en-US',
995
- * 'zh-Hans-FI', 'es-419']`
996
1006
  *
997
1007
  * Both the available languages and regions and the possible return values differ
998
1008
  * between the two operating systems.
@@ -1005,7 +1015,7 @@ declare namespace Electron {
1005
1015
  * country code `FI` is used as the country code for preferred system languages
1006
1016
  * that do not have associated countries in the language name.
1007
1017
  */
1008
- getPreferredSystemLanguages(): Array<'app.getLocale()' | 'app.getSystemLocale()' | 'app.getPreferredSystemLanguages()' | 'app.getLocale()' | 'app.getSystemLocale()' | 'app.getPreferredSystemLanguages()'>;
1018
+ getPreferredSystemLanguages(): string[];
1009
1019
  /**
1010
1020
  * The current system locale. On Windows and Linux, it is fetched using Chromium's
1011
1021
  * `i18n` library. On macOS, `[NSLocale currentLocale]` is used instead. To get the
@@ -1697,6 +1707,9 @@ declare namespace Electron {
1697
1707
  * @experimental
1698
1708
  */
1699
1709
  getBounds(): Rectangle;
1710
+ /**
1711
+ * @experimental
1712
+ */
1700
1713
  setAutoResize(options: AutoResizeOptions): void;
1701
1714
  /**
1702
1715
  * Examples of valid `color` values:
@@ -1883,7 +1896,7 @@ declare namespace Electron {
1883
1896
  /**
1884
1897
  * Emitted once when the window is moved to a new position.
1885
1898
  *
1886
- * __Note__: On macOS this event is an alias of `move`.
1899
+ * **Note**: On macOS this event is an alias of `move`.
1887
1900
  *
1888
1901
  * @platform darwin,win32
1889
1902
  */
@@ -2384,11 +2397,22 @@ declare namespace Electron {
2384
2397
  */
2385
2398
  getTitle(): string;
2386
2399
  /**
2387
- * The custom position for the traffic light buttons in frameless window.
2400
+ * The custom position for the traffic light buttons in frameless window, `{ x: 0,
2401
+ * y: 0 }` will be returned when there is no custom position.
2402
+ *
2403
+ * > **Note** This function is deprecated. Use getWindowButtonPosition instead.
2388
2404
  *
2405
+ * @deprecated
2389
2406
  * @platform darwin
2390
2407
  */
2391
2408
  getTrafficLightPosition(): Point;
2409
+ /**
2410
+ * The custom position for the traffic light buttons in frameless window, `null`
2411
+ * will be returned when there is no custom position.
2412
+ *
2413
+ * @platform darwin
2414
+ */
2415
+ getWindowButtonPosition(): (Point) | (null);
2392
2416
  /**
2393
2417
  * Whether the window has a shadow.
2394
2418
  */
@@ -2633,6 +2657,9 @@ declare namespace Electron {
2633
2657
  * Same as `webContents.reload`.
2634
2658
  */
2635
2659
  reload(): void;
2660
+ /**
2661
+ * @experimental
2662
+ */
2636
2663
  removeBrowserView(browserView: BrowserView): void;
2637
2664
  /**
2638
2665
  * Remove the window's menu bar.
@@ -2744,6 +2771,9 @@ declare namespace Electron {
2744
2771
  * supplied will default to their current values.
2745
2772
  */
2746
2773
  setBounds(bounds: Partial<Rectangle>, animate?: boolean): void;
2774
+ /**
2775
+ * @experimental
2776
+ */
2747
2777
  setBrowserView(browserView: (BrowserView) | (null)): void;
2748
2778
  /**
2749
2779
  * Sets whether the window can be manually closed by user. On Linux does nothing.
@@ -3039,8 +3069,12 @@ declare namespace Electron {
3039
3069
  */
3040
3070
  setTouchBar(touchBar: (TouchBar) | (null)): void;
3041
3071
  /**
3042
- * Set a custom position for the traffic light buttons in frameless window.
3072
+ * Set a custom position for the traffic light buttons in frameless window. Passing
3073
+ * `{ x: 0, y: 0 }` will reset the position to default.
3074
+ *
3075
+ * > **Note** This function is deprecated. Use setWindowButtonPosition instead.
3043
3076
  *
3077
+ * @deprecated
3044
3078
  * @platform darwin
3045
3079
  */
3046
3080
  setTrafficLightPosition(position: Point): void;
@@ -3062,6 +3096,13 @@ declare namespace Electron {
3062
3096
  * @platform darwin,linux
3063
3097
  */
3064
3098
  setVisibleOnAllWorkspaces(visible: boolean, options?: VisibleOnAllWorkspacesOptions): void;
3099
+ /**
3100
+ * Set a custom position for the traffic light buttons in frameless window. Passing
3101
+ * `null` will reset the position to default.
3102
+ *
3103
+ * @platform darwin
3104
+ */
3105
+ setWindowButtonPosition(position: (Point) | (null)): void;
3065
3106
  /**
3066
3107
  * Sets whether the window traffic light buttons should be visible.
3067
3108
  *
@@ -3458,7 +3499,7 @@ declare namespace Electron {
3458
3499
  * Sends the last chunk of the request data. Subsequent write or end operations
3459
3500
  * will not be allowed. The `finish` event is emitted just after the end operation.
3460
3501
  */
3461
- end(chunk?: (string) | (Buffer), encoding?: string, callback?: () => void): void;
3502
+ end(chunk?: (string) | (Buffer), encoding?: string, callback?: () => void): this;
3462
3503
  /**
3463
3504
  * Continues any pending redirection. Can only be called during a `'redirect'`
3464
3505
  * event.
@@ -4768,13 +4809,6 @@ declare namespace Electron {
4768
4809
  savePath: string;
4769
4810
  }
4770
4811
 
4771
- interface Event extends GlobalEvent {
4772
-
4773
- // Docs: https://electronjs.org/docs/api/structures/event
4774
-
4775
- preventDefault: (() => void);
4776
- }
4777
-
4778
4812
  interface Extension {
4779
4813
 
4780
4814
  // Docs: https://electronjs.org/docs/api/structures/extension
@@ -5254,7 +5288,7 @@ declare namespace Electron {
5254
5288
  * "reply" to the sent message in order to guarantee the reply will go to the
5255
5289
  * correct process and frame.
5256
5290
  */
5257
- reply: Function;
5291
+ reply: (channel: string, ...args: any[]) => void;
5258
5292
  /**
5259
5293
  * Set this to the value to be returned in a synchronous message
5260
5294
  */
@@ -5586,7 +5620,7 @@ declare namespace Electron {
5586
5620
  size: number;
5587
5621
  }
5588
5622
 
5589
- class Menu {
5623
+ class Menu extends NodeEventEmitter {
5590
5624
 
5591
5625
  // Docs: https://electronjs.org/docs/api/menu
5592
5626
 
@@ -6163,6 +6197,34 @@ declare namespace Electron {
6163
6197
 
6164
6198
  // Docs: https://electronjs.org/docs/api/net
6165
6199
 
6200
+ /**
6201
+ * see Response.
6202
+ *
6203
+ * Sends a request, similarly to how `fetch()` works in the renderer, using
6204
+ * Chrome's network stack. This differs from Node's `fetch()`, which uses Node.js's
6205
+ * HTTP stack.
6206
+ *
6207
+ * Example:
6208
+ *
6209
+ * This method will issue requests from the default session. To send a `fetch`
6210
+ * request from another session, use ses.fetch().
6211
+ *
6212
+ * See the MDN documentation for `fetch()` for more details.
6213
+ *
6214
+ * Limitations:
6215
+ *
6216
+ * * `net.fetch()` does not support the `data:` or `blob:` schemes.
6217
+ * * The value of the `integrity` option is ignored.
6218
+ * * The `.type` and `.url` values of the returned `Response` object are incorrect.
6219
+ *
6220
+ * By default, requests made with `net.fetch` can be made to custom protocols as
6221
+ * well as `file:`, and will trigger webRequest handlers if present. When the
6222
+ * non-standard `bypassCustomProtocolHandlers` option is set in RequestInit, custom
6223
+ * protocol handlers will not be called for this request. This allows forwarding an
6224
+ * intercepted request to the built-in handler. webRequest handlers will still be
6225
+ * triggered when bypassing custom protocols.
6226
+ */
6227
+ fetch(input: (string) | (GlobalRequest), init?: RequestInit & { bypassCustomProtocolHandlers?: boolean }): Promise<GlobalResponse>;
6166
6228
  /**
6167
6229
  * Whether there is currently internet connection.
6168
6230
  *
@@ -6220,6 +6282,9 @@ declare namespace Electron {
6220
6282
 
6221
6283
  // Docs: https://electronjs.org/docs/api/notification
6222
6284
 
6285
+ /**
6286
+ * @platform darwin
6287
+ */
6223
6288
  on(event: 'action', listener: (event: Event,
6224
6289
  /**
6225
6290
  * The index of the action that was activated.
@@ -6888,11 +6953,24 @@ declare namespace Electron {
6888
6953
 
6889
6954
  // Docs: https://electronjs.org/docs/api/protocol
6890
6955
 
6956
+ /**
6957
+ * Register a protocol handler for `scheme`. Requests made to URLs with this scheme
6958
+ * will delegate to this handler to determine what response should be sent.
6959
+ *
6960
+ * Either a `Response` or a `Promise<Response>` can be returned.
6961
+ *
6962
+ * Example:
6963
+ *
6964
+ * See the MDN docs for `Request` and `Response` for more details.
6965
+ */
6966
+ handle(scheme: string, handler: (request: GlobalRequest) => (GlobalResponse) | (Promise<GlobalResponse>)): void;
6891
6967
  /**
6892
6968
  * Whether the protocol was successfully intercepted
6893
6969
  *
6894
6970
  * Intercepts `scheme` protocol and uses `handler` as the protocol's new handler
6895
6971
  * which sends a `Buffer` as a response.
6972
+ *
6973
+ * @deprecated
6896
6974
  */
6897
6975
  interceptBufferProtocol(scheme: string, handler: (request: ProtocolRequest, callback: (response: (Buffer) | (ProtocolResponse)) => void) => void): boolean;
6898
6976
  /**
@@ -6900,6 +6978,8 @@ declare namespace Electron {
6900
6978
  *
6901
6979
  * Intercepts `scheme` protocol and uses `handler` as the protocol's new handler
6902
6980
  * which sends a file as a response.
6981
+ *
6982
+ * @deprecated
6903
6983
  */
6904
6984
  interceptFileProtocol(scheme: string, handler: (request: ProtocolRequest, callback: (response: (string) | (ProtocolResponse)) => void) => void): boolean;
6905
6985
  /**
@@ -6907,6 +6987,8 @@ declare namespace Electron {
6907
6987
  *
6908
6988
  * Intercepts `scheme` protocol and uses `handler` as the protocol's new handler
6909
6989
  * which sends a new HTTP request as a response.
6990
+ *
6991
+ * @deprecated
6910
6992
  */
6911
6993
  interceptHttpProtocol(scheme: string, handler: (request: ProtocolRequest, callback: (response: ProtocolResponse) => void) => void): boolean;
6912
6994
  /**
@@ -6914,6 +6996,8 @@ declare namespace Electron {
6914
6996
  *
6915
6997
  * Same as `protocol.registerStreamProtocol`, except that it replaces an existing
6916
6998
  * protocol handler.
6999
+ *
7000
+ * @deprecated
6917
7001
  */
6918
7002
  interceptStreamProtocol(scheme: string, handler: (request: ProtocolRequest, callback: (response: (NodeJS.ReadableStream) | (ProtocolResponse)) => void) => void): boolean;
6919
7003
  /**
@@ -6921,14 +7005,24 @@ declare namespace Electron {
6921
7005
  *
6922
7006
  * Intercepts `scheme` protocol and uses `handler` as the protocol's new handler
6923
7007
  * which sends a `string` as a response.
7008
+ *
7009
+ * @deprecated
6924
7010
  */
6925
7011
  interceptStringProtocol(scheme: string, handler: (request: ProtocolRequest, callback: (response: (string) | (ProtocolResponse)) => void) => void): boolean;
7012
+ /**
7013
+ * Whether `scheme` is already handled.
7014
+ */
7015
+ isProtocolHandled(scheme: string): boolean;
6926
7016
  /**
6927
7017
  * Whether `scheme` is already intercepted.
7018
+ *
7019
+ * @deprecated
6928
7020
  */
6929
7021
  isProtocolIntercepted(scheme: string): boolean;
6930
7022
  /**
6931
7023
  * Whether `scheme` is already registered.
7024
+ *
7025
+ * @deprecated
6932
7026
  */
6933
7027
  isProtocolRegistered(scheme: string): boolean;
6934
7028
  /**
@@ -6941,6 +7035,8 @@ declare namespace Electron {
6941
7035
  * property.
6942
7036
  *
6943
7037
  * Example:
7038
+ *
7039
+ * @deprecated
6944
7040
  */
6945
7041
  registerBufferProtocol(scheme: string, handler: (request: ProtocolRequest, callback: (response: (Buffer) | (ProtocolResponse)) => void) => void): boolean;
6946
7042
  /**
@@ -6956,6 +7052,8 @@ declare namespace Electron {
6956
7052
  *
6957
7053
  * By default the `scheme` is treated like `http:`, which is parsed differently
6958
7054
  * from protocols that follow the "generic URI syntax" like `file:`.
7055
+ *
7056
+ * @deprecated
6959
7057
  */
6960
7058
  registerFileProtocol(scheme: string, handler: (request: ProtocolRequest, callback: (response: (string) | (ProtocolResponse)) => void) => void): boolean;
6961
7059
  /**
@@ -6965,6 +7063,8 @@ declare namespace Electron {
6965
7063
  *
6966
7064
  * The usage is the same with `registerFileProtocol`, except that the `callback`
6967
7065
  * should be called with an object that has the `url` property.
7066
+ *
7067
+ * @deprecated
6968
7068
  */
6969
7069
  registerHttpProtocol(scheme: string, handler: (request: ProtocolRequest, callback: (response: ProtocolResponse) => void) => void): boolean;
6970
7070
  /**
@@ -7018,6 +7118,8 @@ declare namespace Electron {
7018
7118
  *
7019
7119
  * It is possible to pass any object that implements the readable stream API (emits
7020
7120
  * `data`/`end`/`error` events). For example, here's how a file could be returned:
7121
+ *
7122
+ * @deprecated
7021
7123
  */
7022
7124
  registerStreamProtocol(scheme: string, handler: (request: ProtocolRequest, callback: (response: (NodeJS.ReadableStream) | (ProtocolResponse)) => void) => void): boolean;
7023
7125
  /**
@@ -7028,18 +7130,28 @@ declare namespace Electron {
7028
7130
  * The usage is the same with `registerFileProtocol`, except that the `callback`
7029
7131
  * should be called with either a `string` or an object that has the `data`
7030
7132
  * property.
7133
+ *
7134
+ * @deprecated
7031
7135
  */
7032
7136
  registerStringProtocol(scheme: string, handler: (request: ProtocolRequest, callback: (response: (string) | (ProtocolResponse)) => void) => void): boolean;
7137
+ /**
7138
+ * Removes a protocol handler registered with `protocol.handle`.
7139
+ */
7140
+ unhandle(scheme: string): void;
7033
7141
  /**
7034
7142
  * Whether the protocol was successfully unintercepted
7035
7143
  *
7036
7144
  * Remove the interceptor installed for `scheme` and restore its original handler.
7145
+ *
7146
+ * @deprecated
7037
7147
  */
7038
7148
  uninterceptProtocol(scheme: string): boolean;
7039
7149
  /**
7040
7150
  * Whether the protocol was successfully unregistered
7041
7151
  *
7042
7152
  * Unregisters the custom protocol of `scheme`.
7153
+ *
7154
+ * @deprecated
7043
7155
  */
7044
7156
  unregisterProtocol(scheme: string): boolean;
7045
7157
  }
@@ -7308,6 +7420,27 @@ declare namespace Electron {
7308
7420
  url: string;
7309
7421
  }
7310
7422
 
7423
+ interface ResolvedEndpoint {
7424
+
7425
+ // Docs: https://electronjs.org/docs/api/structures/resolved-endpoint
7426
+
7427
+ address: string;
7428
+ /**
7429
+ * One of the following:
7430
+ */
7431
+ family: ('ipv4' | 'ipv6' | 'unspec');
7432
+ }
7433
+
7434
+ interface ResolvedHost {
7435
+
7436
+ // Docs: https://electronjs.org/docs/api/structures/resolved-host
7437
+
7438
+ /**
7439
+ * resolved DNS entries for the hostname
7440
+ */
7441
+ endpoints: ResolvedEndpoint[];
7442
+ }
7443
+
7311
7444
  interface SafeStorage extends NodeJS.EventEmitter {
7312
7445
 
7313
7446
  // Docs: https://electronjs.org/docs/api/safe-storage
@@ -7607,6 +7740,18 @@ declare namespace Electron {
7607
7740
  * of an existing `Session` object.
7608
7741
  */
7609
7742
  static fromPartition(partition: string, options?: FromPartitionOptions): Session;
7743
+ /**
7744
+ * A session instance from the absolute path as specified by the `path` string.
7745
+ * When there is an existing `Session` with the same absolute path, it will be
7746
+ * returned; otherwise a new `Session` instance will be created with `options`. The
7747
+ * call will throw an error if the path is not an absolute path. Additionally, an
7748
+ * error will be thrown if an empty string is provided.
7749
+ *
7750
+ * To create a `Session` with `options`, you have to ensure the `Session` with the
7751
+ * `path` has never been used before. There is no way to change the `options` of an
7752
+ * existing `Session` object.
7753
+ */
7754
+ static fromPath(path: string, options?: FromPathOptions): Session;
7610
7755
  /**
7611
7756
  * A `Session` object, the default session object of the app.
7612
7757
  */
@@ -8076,6 +8221,34 @@ declare namespace Electron {
8076
8221
  * Emulates network with the given configuration for the `session`.
8077
8222
  */
8078
8223
  enableNetworkEmulation(options: EnableNetworkEmulationOptions): void;
8224
+ /**
8225
+ * see Response.
8226
+ *
8227
+ * Sends a request, similarly to how `fetch()` works in the renderer, using
8228
+ * Chrome's network stack. This differs from Node's `fetch()`, which uses Node.js's
8229
+ * HTTP stack.
8230
+ *
8231
+ * Example:
8232
+ *
8233
+ * See also `net.fetch()`, a convenience method which issues requests from the
8234
+ * default session.
8235
+ *
8236
+ * See the MDN documentation for `fetch()` for more details.
8237
+ *
8238
+ * Limitations:
8239
+ *
8240
+ * * `net.fetch()` does not support the `data:` or `blob:` schemes.
8241
+ * * The value of the `integrity` option is ignored.
8242
+ * * The `.type` and `.url` values of the returned `Response` object are incorrect.
8243
+ *
8244
+ * By default, requests made with `net.fetch` can be made to custom protocols as
8245
+ * well as `file:`, and will trigger webRequest handlers if present. When the
8246
+ * non-standard `bypassCustomProtocolHandlers` option is set in RequestInit, custom
8247
+ * protocol handlers will not be called for this request. This allows forwarding an
8248
+ * intercepted request to the built-in handler. webRequest handlers will still be
8249
+ * triggered when bypassing custom protocols.
8250
+ */
8251
+ fetch(input: (string) | (GlobalRequest), init?: RequestInit): Promise<GlobalResponse>;
8079
8252
  /**
8080
8253
  * Writes any unwritten DOMStorage data to disk.
8081
8254
  */
@@ -8191,6 +8364,10 @@ declare namespace Electron {
8191
8364
  * dictionary as well
8192
8365
  */
8193
8366
  removeWordFromSpellCheckerDictionary(word: string): boolean;
8367
+ /**
8368
+ * Resolves with the resolved IP addresses for the `host`.
8369
+ */
8370
+ resolveHost(host: string, options?: ResolveHostOptions): Promise<Electron.ResolvedHost>;
8194
8371
  /**
8195
8372
  * Resolves with the proxy information for `url`.
8196
8373
  */
@@ -8599,6 +8776,9 @@ declare namespace Electron {
8599
8776
 
8600
8777
  // Docs: https://electronjs.org/docs/api/system-preferences
8601
8778
 
8779
+ /**
8780
+ * @platform win32
8781
+ */
8602
8782
  on(event: 'accent-color-changed', listener: (event: Event,
8603
8783
  /**
8604
8784
  * The new RGBA color the user assigned to be their system accent color.
@@ -8619,6 +8799,9 @@ declare namespace Electron {
8619
8799
  * The new RGBA color the user assigned to be their system accent color.
8620
8800
  */
8621
8801
  newColor: string) => void): this;
8802
+ /**
8803
+ * @platform win32
8804
+ */
8622
8805
  on(event: 'color-changed', listener: (event: Event) => void): this;
8623
8806
  once(event: 'color-changed', listener: (event: Event) => void): this;
8624
8807
  addListener(event: 'color-changed', listener: (event: Event) => void): this;
@@ -9060,7 +9243,7 @@ declare namespace Electron {
9060
9243
 
9061
9244
  // Docs: https://electronjs.org/docs/api/structures/thumbar-button
9062
9245
 
9063
- click: Function;
9246
+ click: () => void;
9064
9247
  /**
9065
9248
  * Control specific states and behaviors of the button. By default, it is
9066
9249
  * `['enabled']`.
@@ -9970,15 +10153,16 @@ declare namespace Electron {
9970
10153
  /**
9971
10154
  * Number of bytes to read from `offset`. Defaults to `0`.
9972
10155
  */
9973
- length: number;
10156
+ length?: number;
9974
10157
  /**
9975
- * Last Modification time in number of seconds since the UNIX epoch.
10158
+ * Last Modification time in number of seconds since the UNIX epoch. Defaults to
10159
+ * `0`.
9976
10160
  */
9977
- modificationTime: number;
10161
+ modificationTime?: number;
9978
10162
  /**
9979
10163
  * Defaults to `0`.
9980
10164
  */
9981
- offset: number;
10165
+ offset?: number;
9982
10166
  /**
9983
10167
  * `file`.
9984
10168
  */
@@ -10194,6 +10378,13 @@ declare namespace Electron {
10194
10378
  * `null`.
10195
10379
  */
10196
10380
  static getFocusedWebContents(): WebContents;
10381
+ /**
10382
+ * Emitted when media becomes audible or inaudible.
10383
+ */
10384
+ on(event: 'audio-state-changed', listener: (event: Event<WebContentsAudioStateChangedEventParams>) => void): this;
10385
+ once(event: 'audio-state-changed', listener: (event: Event<WebContentsAudioStateChangedEventParams>) => void): this;
10386
+ addListener(event: 'audio-state-changed', listener: (event: Event<WebContentsAudioStateChangedEventParams>) => void): this;
10387
+ removeListener(event: 'audio-state-changed', listener: (event: Event<WebContentsAudioStateChangedEventParams>) => void): this;
10197
10388
  /**
10198
10389
  * Emitted before dispatching the `keydown` and `keyup` events in the page. Calling
10199
10390
  * `event.preventDefault` will prevent the page `keydown`/`keyup` events and the
@@ -10814,29 +11005,89 @@ declare namespace Electron {
10814
11005
  * This event cannot be prevented, if you want to prevent redirects you should
10815
11006
  * checkout out the `will-redirect` event above.
10816
11007
  */
10817
- on(event: 'did-redirect-navigation', listener: (event: Event,
11008
+ on(event: 'did-redirect-navigation', listener: (details: Event<WebContentsDidRedirectNavigationEventParams>,
11009
+ /**
11010
+ * @deprecated
11011
+ */
10818
11012
  url: string,
11013
+ /**
11014
+ * @deprecated
11015
+ */
10819
11016
  isInPlace: boolean,
11017
+ /**
11018
+ * @deprecated
11019
+ */
10820
11020
  isMainFrame: boolean,
11021
+ /**
11022
+ * @deprecated
11023
+ */
10821
11024
  frameProcessId: number,
11025
+ /**
11026
+ * @deprecated
11027
+ */
10822
11028
  frameRoutingId: number) => void): this;
10823
- once(event: 'did-redirect-navigation', listener: (event: Event,
11029
+ once(event: 'did-redirect-navigation', listener: (details: Event<WebContentsDidRedirectNavigationEventParams>,
11030
+ /**
11031
+ * @deprecated
11032
+ */
10824
11033
  url: string,
11034
+ /**
11035
+ * @deprecated
11036
+ */
10825
11037
  isInPlace: boolean,
11038
+ /**
11039
+ * @deprecated
11040
+ */
10826
11041
  isMainFrame: boolean,
11042
+ /**
11043
+ * @deprecated
11044
+ */
10827
11045
  frameProcessId: number,
11046
+ /**
11047
+ * @deprecated
11048
+ */
10828
11049
  frameRoutingId: number) => void): this;
10829
- addListener(event: 'did-redirect-navigation', listener: (event: Event,
11050
+ addListener(event: 'did-redirect-navigation', listener: (details: Event<WebContentsDidRedirectNavigationEventParams>,
11051
+ /**
11052
+ * @deprecated
11053
+ */
10830
11054
  url: string,
11055
+ /**
11056
+ * @deprecated
11057
+ */
10831
11058
  isInPlace: boolean,
11059
+ /**
11060
+ * @deprecated
11061
+ */
10832
11062
  isMainFrame: boolean,
11063
+ /**
11064
+ * @deprecated
11065
+ */
10833
11066
  frameProcessId: number,
11067
+ /**
11068
+ * @deprecated
11069
+ */
10834
11070
  frameRoutingId: number) => void): this;
10835
- removeListener(event: 'did-redirect-navigation', listener: (event: Event,
11071
+ removeListener(event: 'did-redirect-navigation', listener: (details: Event<WebContentsDidRedirectNavigationEventParams>,
11072
+ /**
11073
+ * @deprecated
11074
+ */
10836
11075
  url: string,
11076
+ /**
11077
+ * @deprecated
11078
+ */
10837
11079
  isInPlace: boolean,
11080
+ /**
11081
+ * @deprecated
11082
+ */
10838
11083
  isMainFrame: boolean,
11084
+ /**
11085
+ * @deprecated
11086
+ */
10839
11087
  frameProcessId: number,
11088
+ /**
11089
+ * @deprecated
11090
+ */
10840
11091
  frameRoutingId: number) => void): this;
10841
11092
  /**
10842
11093
  * Corresponds to the points in time when the spinner of the tab started spinning.
@@ -10846,32 +11097,91 @@ declare namespace Electron {
10846
11097
  addListener(event: 'did-start-loading', listener: Function): this;
10847
11098
  removeListener(event: 'did-start-loading', listener: Function): this;
10848
11099
  /**
10849
- * Emitted when any frame (including main) starts navigating. `isInPlace` will be
10850
- * `true` for in-page navigations.
11100
+ * Emitted when any frame (including main) starts navigating.
10851
11101
  */
10852
- on(event: 'did-start-navigation', listener: (event: Event,
11102
+ on(event: 'did-start-navigation', listener: (details: Event<WebContentsDidStartNavigationEventParams>,
11103
+ /**
11104
+ * @deprecated
11105
+ */
10853
11106
  url: string,
11107
+ /**
11108
+ * @deprecated
11109
+ */
10854
11110
  isInPlace: boolean,
11111
+ /**
11112
+ * @deprecated
11113
+ */
10855
11114
  isMainFrame: boolean,
11115
+ /**
11116
+ * @deprecated
11117
+ */
10856
11118
  frameProcessId: number,
11119
+ /**
11120
+ * @deprecated
11121
+ */
10857
11122
  frameRoutingId: number) => void): this;
10858
- once(event: 'did-start-navigation', listener: (event: Event,
11123
+ once(event: 'did-start-navigation', listener: (details: Event<WebContentsDidStartNavigationEventParams>,
11124
+ /**
11125
+ * @deprecated
11126
+ */
10859
11127
  url: string,
11128
+ /**
11129
+ * @deprecated
11130
+ */
10860
11131
  isInPlace: boolean,
11132
+ /**
11133
+ * @deprecated
11134
+ */
10861
11135
  isMainFrame: boolean,
11136
+ /**
11137
+ * @deprecated
11138
+ */
10862
11139
  frameProcessId: number,
11140
+ /**
11141
+ * @deprecated
11142
+ */
10863
11143
  frameRoutingId: number) => void): this;
10864
- addListener(event: 'did-start-navigation', listener: (event: Event,
11144
+ addListener(event: 'did-start-navigation', listener: (details: Event<WebContentsDidStartNavigationEventParams>,
11145
+ /**
11146
+ * @deprecated
11147
+ */
10865
11148
  url: string,
11149
+ /**
11150
+ * @deprecated
11151
+ */
10866
11152
  isInPlace: boolean,
11153
+ /**
11154
+ * @deprecated
11155
+ */
10867
11156
  isMainFrame: boolean,
11157
+ /**
11158
+ * @deprecated
11159
+ */
10868
11160
  frameProcessId: number,
11161
+ /**
11162
+ * @deprecated
11163
+ */
10869
11164
  frameRoutingId: number) => void): this;
10870
- removeListener(event: 'did-start-navigation', listener: (event: Event,
11165
+ removeListener(event: 'did-start-navigation', listener: (details: Event<WebContentsDidStartNavigationEventParams>,
11166
+ /**
11167
+ * @deprecated
11168
+ */
10871
11169
  url: string,
11170
+ /**
11171
+ * @deprecated
11172
+ */
10872
11173
  isInPlace: boolean,
11174
+ /**
11175
+ * @deprecated
11176
+ */
10873
11177
  isMainFrame: boolean,
11178
+ /**
11179
+ * @deprecated
11180
+ */
10874
11181
  frameProcessId: number,
11182
+ /**
11183
+ * @deprecated
11184
+ */
10875
11185
  frameRoutingId: number) => void): this;
10876
11186
  /**
10877
11187
  * Corresponds to the points in time when the spinner of the tab stopped spinning.
@@ -10952,16 +11262,16 @@ declare namespace Electron {
10952
11262
  * See also `webContents.ipc`, which provides an `IpcMain`-like interface for
10953
11263
  * responding to IPC messages specifically from this WebContents.
10954
11264
  */
10955
- on(event: 'ipc-message', listener: (event: Event,
11265
+ on(event: 'ipc-message', listener: (event: IpcMainEvent,
10956
11266
  channel: string,
10957
11267
  ...args: any[]) => void): this;
10958
- once(event: 'ipc-message', listener: (event: Event,
11268
+ once(event: 'ipc-message', listener: (event: IpcMainEvent,
10959
11269
  channel: string,
10960
11270
  ...args: any[]) => void): this;
10961
- addListener(event: 'ipc-message', listener: (event: Event,
11271
+ addListener(event: 'ipc-message', listener: (event: IpcMainEvent,
10962
11272
  channel: string,
10963
11273
  ...args: any[]) => void): this;
10964
- removeListener(event: 'ipc-message', listener: (event: Event,
11274
+ removeListener(event: 'ipc-message', listener: (event: IpcMainEvent,
10965
11275
  channel: string,
10966
11276
  ...args: any[]) => void): this;
10967
11277
  /**
@@ -10971,16 +11281,16 @@ declare namespace Electron {
10971
11281
  * See also `webContents.ipc`, which provides an `IpcMain`-like interface for
10972
11282
  * responding to IPC messages specifically from this WebContents.
10973
11283
  */
10974
- on(event: 'ipc-message-sync', listener: (event: Event,
11284
+ on(event: 'ipc-message-sync', listener: (event: IpcMainEvent,
10975
11285
  channel: string,
10976
11286
  ...args: any[]) => void): this;
10977
- once(event: 'ipc-message-sync', listener: (event: Event,
11287
+ once(event: 'ipc-message-sync', listener: (event: IpcMainEvent,
10978
11288
  channel: string,
10979
11289
  ...args: any[]) => void): this;
10980
- addListener(event: 'ipc-message-sync', listener: (event: Event,
11290
+ addListener(event: 'ipc-message-sync', listener: (event: IpcMainEvent,
10981
11291
  channel: string,
10982
11292
  ...args: any[]) => void): this;
10983
- removeListener(event: 'ipc-message-sync', listener: (event: Event,
11293
+ removeListener(event: 'ipc-message-sync', listener: (event: IpcMainEvent,
10984
11294
  channel: string,
10985
11295
  ...args: any[]) => void): this;
10986
11296
  /**
@@ -11291,8 +11601,31 @@ declare namespace Electron {
11291
11601
  */
11292
11602
  params: Record<string, string>) => void): this;
11293
11603
  /**
11294
- * Emitted when a user or the page wants to start navigation. It can happen when
11295
- * the `window.location` object is changed or a user clicks a link in the page.
11604
+ * Emitted when a user or the page wants to start navigation in any frame. It can
11605
+ * happen when the `window.location` object is changed or a user clicks a link in
11606
+ * the page.
11607
+ *
11608
+ * Unlike `will-navigate`, `will-frame-navigate` is fired when the main frame or
11609
+ * any of its subframes attempts to navigate. When the navigation event comes from
11610
+ * the main frame, `isMainFrame` will be `true`.
11611
+ *
11612
+ * This event will not emit when the navigation is started programmatically with
11613
+ * APIs like `webContents.loadURL` and `webContents.back`.
11614
+ *
11615
+ * It is also not emitted for in-page navigations, such as clicking anchor links or
11616
+ * updating the `window.location.hash`. Use `did-navigate-in-page` event for this
11617
+ * purpose.
11618
+ *
11619
+ * Calling `event.preventDefault()` will prevent the navigation.
11620
+ */
11621
+ on(event: 'will-frame-navigate', listener: (details: Event<WebContentsWillFrameNavigateEventParams>) => void): this;
11622
+ once(event: 'will-frame-navigate', listener: (details: Event<WebContentsWillFrameNavigateEventParams>) => void): this;
11623
+ addListener(event: 'will-frame-navigate', listener: (details: Event<WebContentsWillFrameNavigateEventParams>) => void): this;
11624
+ removeListener(event: 'will-frame-navigate', listener: (details: Event<WebContentsWillFrameNavigateEventParams>) => void): this;
11625
+ /**
11626
+ * Emitted when a user or the page wants to start navigation on the main frame. It
11627
+ * can happen when the `window.location` object is changed or a user clicks a link
11628
+ * in the page.
11296
11629
  *
11297
11630
  * This event will not emit when the navigation is started programmatically with
11298
11631
  * APIs like `webContents.loadURL` and `webContents.back`.
@@ -11303,14 +11636,90 @@ declare namespace Electron {
11303
11636
  *
11304
11637
  * Calling `event.preventDefault()` will prevent the navigation.
11305
11638
  */
11306
- on(event: 'will-navigate', listener: (event: Event,
11307
- url: string) => void): this;
11308
- once(event: 'will-navigate', listener: (event: Event,
11309
- url: string) => void): this;
11310
- addListener(event: 'will-navigate', listener: (event: Event,
11311
- url: string) => void): this;
11312
- removeListener(event: 'will-navigate', listener: (event: Event,
11313
- url: string) => void): this;
11639
+ on(event: 'will-navigate', listener: (details: Event<WebContentsWillNavigateEventParams>,
11640
+ /**
11641
+ * @deprecated
11642
+ */
11643
+ url: string,
11644
+ /**
11645
+ * @deprecated
11646
+ */
11647
+ isInPlace: boolean,
11648
+ /**
11649
+ * @deprecated
11650
+ */
11651
+ isMainFrame: boolean,
11652
+ /**
11653
+ * @deprecated
11654
+ */
11655
+ frameProcessId: number,
11656
+ /**
11657
+ * @deprecated
11658
+ */
11659
+ frameRoutingId: number) => void): this;
11660
+ once(event: 'will-navigate', listener: (details: Event<WebContentsWillNavigateEventParams>,
11661
+ /**
11662
+ * @deprecated
11663
+ */
11664
+ url: string,
11665
+ /**
11666
+ * @deprecated
11667
+ */
11668
+ isInPlace: boolean,
11669
+ /**
11670
+ * @deprecated
11671
+ */
11672
+ isMainFrame: boolean,
11673
+ /**
11674
+ * @deprecated
11675
+ */
11676
+ frameProcessId: number,
11677
+ /**
11678
+ * @deprecated
11679
+ */
11680
+ frameRoutingId: number) => void): this;
11681
+ addListener(event: 'will-navigate', listener: (details: Event<WebContentsWillNavigateEventParams>,
11682
+ /**
11683
+ * @deprecated
11684
+ */
11685
+ url: string,
11686
+ /**
11687
+ * @deprecated
11688
+ */
11689
+ isInPlace: boolean,
11690
+ /**
11691
+ * @deprecated
11692
+ */
11693
+ isMainFrame: boolean,
11694
+ /**
11695
+ * @deprecated
11696
+ */
11697
+ frameProcessId: number,
11698
+ /**
11699
+ * @deprecated
11700
+ */
11701
+ frameRoutingId: number) => void): this;
11702
+ removeListener(event: 'will-navigate', listener: (details: Event<WebContentsWillNavigateEventParams>,
11703
+ /**
11704
+ * @deprecated
11705
+ */
11706
+ url: string,
11707
+ /**
11708
+ * @deprecated
11709
+ */
11710
+ isInPlace: boolean,
11711
+ /**
11712
+ * @deprecated
11713
+ */
11714
+ isMainFrame: boolean,
11715
+ /**
11716
+ * @deprecated
11717
+ */
11718
+ frameProcessId: number,
11719
+ /**
11720
+ * @deprecated
11721
+ */
11722
+ frameRoutingId: number) => void): this;
11314
11723
  /**
11315
11724
  * Emitted when a `beforeunload` event handler is attempting to cancel a page
11316
11725
  * unload.
@@ -11336,29 +11745,89 @@ declare namespace Electron {
11336
11745
  * Calling `event.preventDefault()` will prevent the navigation (not just the
11337
11746
  * redirect).
11338
11747
  */
11339
- on(event: 'will-redirect', listener: (event: Event,
11748
+ on(event: 'will-redirect', listener: (details: Event<WebContentsWillRedirectEventParams>,
11749
+ /**
11750
+ * @deprecated
11751
+ */
11340
11752
  url: string,
11753
+ /**
11754
+ * @deprecated
11755
+ */
11341
11756
  isInPlace: boolean,
11757
+ /**
11758
+ * @deprecated
11759
+ */
11342
11760
  isMainFrame: boolean,
11761
+ /**
11762
+ * @deprecated
11763
+ */
11343
11764
  frameProcessId: number,
11765
+ /**
11766
+ * @deprecated
11767
+ */
11344
11768
  frameRoutingId: number) => void): this;
11345
- once(event: 'will-redirect', listener: (event: Event,
11769
+ once(event: 'will-redirect', listener: (details: Event<WebContentsWillRedirectEventParams>,
11770
+ /**
11771
+ * @deprecated
11772
+ */
11346
11773
  url: string,
11774
+ /**
11775
+ * @deprecated
11776
+ */
11347
11777
  isInPlace: boolean,
11778
+ /**
11779
+ * @deprecated
11780
+ */
11348
11781
  isMainFrame: boolean,
11782
+ /**
11783
+ * @deprecated
11784
+ */
11349
11785
  frameProcessId: number,
11786
+ /**
11787
+ * @deprecated
11788
+ */
11350
11789
  frameRoutingId: number) => void): this;
11351
- addListener(event: 'will-redirect', listener: (event: Event,
11790
+ addListener(event: 'will-redirect', listener: (details: Event<WebContentsWillRedirectEventParams>,
11791
+ /**
11792
+ * @deprecated
11793
+ */
11352
11794
  url: string,
11795
+ /**
11796
+ * @deprecated
11797
+ */
11353
11798
  isInPlace: boolean,
11799
+ /**
11800
+ * @deprecated
11801
+ */
11354
11802
  isMainFrame: boolean,
11803
+ /**
11804
+ * @deprecated
11805
+ */
11355
11806
  frameProcessId: number,
11807
+ /**
11808
+ * @deprecated
11809
+ */
11356
11810
  frameRoutingId: number) => void): this;
11357
- removeListener(event: 'will-redirect', listener: (event: Event,
11811
+ removeListener(event: 'will-redirect', listener: (details: Event<WebContentsWillRedirectEventParams>,
11812
+ /**
11813
+ * @deprecated
11814
+ */
11358
11815
  url: string,
11816
+ /**
11817
+ * @deprecated
11818
+ */
11359
11819
  isInPlace: boolean,
11820
+ /**
11821
+ * @deprecated
11822
+ */
11360
11823
  isMainFrame: boolean,
11824
+ /**
11825
+ * @deprecated
11826
+ */
11361
11827
  frameProcessId: number,
11828
+ /**
11829
+ * @deprecated
11830
+ */
11362
11831
  frameRoutingId: number) => void): this;
11363
11832
  /**
11364
11833
  * Emitted when the user is requesting to change the zoom level using the mouse
@@ -11536,7 +12005,7 @@ declare namespace Electron {
11536
12005
  */
11537
12006
  getBackgroundThrottling(): boolean;
11538
12007
  /**
11539
- * If *offscreen rendering* is enabled returns the current frame rate.
12008
+ * If _offscreen rendering_ is enabled returns the current frame rate.
11540
12009
  */
11541
12010
  getFrameRate(): number;
11542
12011
  /**
@@ -11647,7 +12116,7 @@ declare namespace Electron {
11647
12116
  /**
11648
12117
  * Schedules a full repaint of the window this web contents is in.
11649
12118
  *
11650
- * If *offscreen rendering* is enabled invalidates the frame and generates a new
12119
+ * If _offscreen rendering_ is enabled invalidates the frame and generates a new
11651
12120
  * one through the `'paint'` event.
11652
12121
  */
11653
12122
  invalidate(): void;
@@ -11694,11 +12163,11 @@ declare namespace Electron {
11694
12163
  */
11695
12164
  isLoadingMainFrame(): boolean;
11696
12165
  /**
11697
- * Indicates whether *offscreen rendering* is enabled.
12166
+ * Indicates whether _offscreen rendering_ is enabled.
11698
12167
  */
11699
12168
  isOffscreen(): boolean;
11700
12169
  /**
11701
- * If *offscreen rendering* is enabled returns whether it is currently painting.
12170
+ * If _offscreen rendering_ is enabled returns whether it is currently painting.
11702
12171
  */
11703
12172
  isPainting(): boolean;
11704
12173
  /**
@@ -11893,7 +12362,7 @@ declare namespace Electron {
11893
12362
  */
11894
12363
  setDevToolsWebContents(devToolsWebContents: WebContents): void;
11895
12364
  /**
11896
- * If *offscreen rendering* is enabled sets the frame rate to the specified number.
12365
+ * If _offscreen rendering_ is enabled sets the frame rate to the specified number.
11897
12366
  * Only values between 1 and 240 are accepted.
11898
12367
  */
11899
12368
  setFrameRate(fps: number): void;
@@ -11966,7 +12435,7 @@ declare namespace Electron {
11966
12435
  */
11967
12436
  startDrag(item: Item): void;
11968
12437
  /**
11969
- * If *offscreen rendering* is enabled and not painting, start painting.
12438
+ * If _offscreen rendering_ is enabled and not painting, start painting.
11970
12439
  */
11971
12440
  startPainting(): void;
11972
12441
  /**
@@ -11978,7 +12447,7 @@ declare namespace Electron {
11978
12447
  */
11979
12448
  stopFindInPage(action: 'clearSelection' | 'keepSelection' | 'activateSelection'): void;
11980
12449
  /**
11981
- * If *offscreen rendering* is enabled and painting, stop painting.
12450
+ * If _offscreen rendering_ is enabled and painting, stop painting.
11982
12451
  */
11983
12452
  stopPainting(): void;
11984
12453
  /**
@@ -12027,7 +12496,7 @@ declare namespace Electron {
12027
12496
  * An `Integer` property that sets the frame rate of the web contents to the
12028
12497
  * specified number. Only values between 1 and 240 are accepted.
12029
12498
  *
12030
- * Only applicable if *offscreen rendering* is enabled.
12499
+ * Only applicable if _offscreen rendering_ is enabled.
12031
12500
  */
12032
12501
  frameRate: number;
12033
12502
  /**
@@ -12108,7 +12577,7 @@ declare namespace Electron {
12108
12577
  zoomLevel: number;
12109
12578
  }
12110
12579
 
12111
- interface WebFrame extends NodeJS.EventEmitter {
12580
+ interface WebFrame {
12112
12581
 
12113
12582
  // Docs: https://electronjs.org/docs/api/web-frame
12114
12583
 
@@ -12612,8 +13081,8 @@ declare namespace Electron {
12612
13081
  * Fired when the navigation is done, i.e. the spinner of the tab will stop
12613
13082
  * spinning, and the `onload` event is dispatched.
12614
13083
  */
12615
- addEventListener(event: 'did-finish-load', listener: (event: Event) => void, useCapture?: boolean): this;
12616
- removeEventListener(event: 'did-finish-load', listener: (event: Event) => void): this;
13084
+ addEventListener(event: 'did-finish-load', listener: (event: DOMEvent) => void, useCapture?: boolean): this;
13085
+ removeEventListener(event: 'did-finish-load', listener: (event: DOMEvent) => void): this;
12617
13086
  /**
12618
13087
  * This event is like `did-finish-load`, but fired when the load failed or was
12619
13088
  * cancelled, e.g. `window.stop()` is invoked.
@@ -12628,23 +13097,23 @@ declare namespace Electron {
12628
13097
  /**
12629
13098
  * Corresponds to the points in time when the spinner of the tab starts spinning.
12630
13099
  */
12631
- addEventListener(event: 'did-start-loading', listener: (event: Event) => void, useCapture?: boolean): this;
12632
- removeEventListener(event: 'did-start-loading', listener: (event: Event) => void): this;
13100
+ addEventListener(event: 'did-start-loading', listener: (event: DOMEvent) => void, useCapture?: boolean): this;
13101
+ removeEventListener(event: 'did-start-loading', listener: (event: DOMEvent) => void): this;
12633
13102
  /**
12634
13103
  * Corresponds to the points in time when the spinner of the tab stops spinning.
12635
13104
  */
12636
- addEventListener(event: 'did-stop-loading', listener: (event: Event) => void, useCapture?: boolean): this;
12637
- removeEventListener(event: 'did-stop-loading', listener: (event: Event) => void): this;
13105
+ addEventListener(event: 'did-stop-loading', listener: (event: DOMEvent) => void, useCapture?: boolean): this;
13106
+ removeEventListener(event: 'did-stop-loading', listener: (event: DOMEvent) => void): this;
12638
13107
  /**
12639
13108
  * Fired when attached to the embedder web contents.
12640
13109
  */
12641
- addEventListener(event: 'did-attach', listener: (event: Event) => void, useCapture?: boolean): this;
12642
- removeEventListener(event: 'did-attach', listener: (event: Event) => void): this;
13110
+ addEventListener(event: 'did-attach', listener: (event: DOMEvent) => void, useCapture?: boolean): this;
13111
+ removeEventListener(event: 'did-attach', listener: (event: DOMEvent) => void): this;
12643
13112
  /**
12644
13113
  * Fired when document in the given frame is loaded.
12645
13114
  */
12646
- addEventListener(event: 'dom-ready', listener: (event: Event) => void, useCapture?: boolean): this;
12647
- removeEventListener(event: 'dom-ready', listener: (event: Event) => void): this;
13115
+ addEventListener(event: 'dom-ready', listener: (event: DOMEvent) => void, useCapture?: boolean): this;
13116
+ removeEventListener(event: 'dom-ready', listener: (event: DOMEvent) => void): this;
12648
13117
  /**
12649
13118
  * Fired when page title is set during navigation. `explicitSet` is false when
12650
13119
  * title is synthesized from file url.
@@ -12659,13 +13128,13 @@ declare namespace Electron {
12659
13128
  /**
12660
13129
  * Fired when page enters fullscreen triggered by HTML API.
12661
13130
  */
12662
- addEventListener(event: 'enter-html-full-screen', listener: (event: Event) => void, useCapture?: boolean): this;
12663
- removeEventListener(event: 'enter-html-full-screen', listener: (event: Event) => void): this;
13131
+ addEventListener(event: 'enter-html-full-screen', listener: (event: DOMEvent) => void, useCapture?: boolean): this;
13132
+ removeEventListener(event: 'enter-html-full-screen', listener: (event: DOMEvent) => void): this;
12664
13133
  /**
12665
13134
  * Fired when page leaves fullscreen triggered by HTML API.
12666
13135
  */
12667
- addEventListener(event: 'leave-html-full-screen', listener: (event: Event) => void, useCapture?: boolean): this;
12668
- removeEventListener(event: 'leave-html-full-screen', listener: (event: Event) => void): this;
13136
+ addEventListener(event: 'leave-html-full-screen', listener: (event: DOMEvent) => void, useCapture?: boolean): this;
13137
+ removeEventListener(event: 'leave-html-full-screen', listener: (event: DOMEvent) => void): this;
12669
13138
  /**
12670
13139
  * Fired when the guest window logs a console message.
12671
13140
  *
@@ -12690,10 +13159,26 @@ declare namespace Electron {
12690
13159
  * or updating the `window.location.hash`. Use `did-navigate-in-page` event for
12691
13160
  * this purpose.
12692
13161
  *
12693
- * Calling `event.preventDefault()` does __NOT__ have any effect.
13162
+ * Calling `event.preventDefault()` does **NOT** have any effect.
12694
13163
  */
12695
13164
  addEventListener(event: 'will-navigate', listener: (event: WillNavigateEvent) => void, useCapture?: boolean): this;
12696
13165
  removeEventListener(event: 'will-navigate', listener: (event: WillNavigateEvent) => void): this;
13166
+ /**
13167
+ * Emitted when a user or the page wants to start navigation anywhere in the
13168
+ * `<webview>` or any frames embedded within. It can happen when the
13169
+ * `window.location` object is changed or a user clicks a link in the page.
13170
+ *
13171
+ * This event will not emit when the navigation is started programmatically with
13172
+ * APIs like `<webview>.loadURL` and `<webview>.back`.
13173
+ *
13174
+ * It is also not emitted during in-page navigation, such as clicking anchor links
13175
+ * or updating the `window.location.hash`. Use `did-navigate-in-page` event for
13176
+ * this purpose.
13177
+ *
13178
+ * Calling `event.preventDefault()` does **NOT** have any effect.
13179
+ */
13180
+ addEventListener(event: 'will-frame-navigate', listener: (event: WillFrameNavigateEvent) => void, useCapture?: boolean): this;
13181
+ removeEventListener(event: 'will-frame-navigate', listener: (event: WillFrameNavigateEvent) => void): this;
12697
13182
  /**
12698
13183
  * Emitted when any frame (including main) starts navigating. `isInPlace` will be
12699
13184
  * `true` for in-page navigations.
@@ -12739,8 +13224,8 @@ declare namespace Electron {
12739
13224
  * The following example code navigates the `webview` to `about:blank` when the
12740
13225
  * guest attempts to close itself.
12741
13226
  */
12742
- addEventListener(event: 'close', listener: (event: Event) => void, useCapture?: boolean): this;
12743
- removeEventListener(event: 'close', listener: (event: Event) => void): this;
13227
+ addEventListener(event: 'close', listener: (event: DOMEvent) => void, useCapture?: boolean): this;
13228
+ removeEventListener(event: 'close', listener: (event: DOMEvent) => void): this;
12744
13229
  /**
12745
13230
  * Fired when the guest page has sent an asynchronous message to embedder page.
12746
13231
  *
@@ -12752,8 +13237,8 @@ declare namespace Electron {
12752
13237
  /**
12753
13238
  * Fired when the renderer process is crashed.
12754
13239
  */
12755
- addEventListener(event: 'crashed', listener: (event: Event) => void, useCapture?: boolean): this;
12756
- removeEventListener(event: 'crashed', listener: (event: Event) => void): this;
13240
+ addEventListener(event: 'crashed', listener: (event: DOMEvent) => void, useCapture?: boolean): this;
13241
+ removeEventListener(event: 'crashed', listener: (event: DOMEvent) => void): this;
12757
13242
  /**
12758
13243
  * Fired when a plugin process is crashed.
12759
13244
  */
@@ -12762,18 +13247,18 @@ declare namespace Electron {
12762
13247
  /**
12763
13248
  * Fired when the WebContents is destroyed.
12764
13249
  */
12765
- addEventListener(event: 'destroyed', listener: (event: Event) => void, useCapture?: boolean): this;
12766
- removeEventListener(event: 'destroyed', listener: (event: Event) => void): this;
13250
+ addEventListener(event: 'destroyed', listener: (event: DOMEvent) => void, useCapture?: boolean): this;
13251
+ removeEventListener(event: 'destroyed', listener: (event: DOMEvent) => void): this;
12767
13252
  /**
12768
13253
  * Emitted when media starts playing.
12769
13254
  */
12770
- addEventListener(event: 'media-started-playing', listener: (event: Event) => void, useCapture?: boolean): this;
12771
- removeEventListener(event: 'media-started-playing', listener: (event: Event) => void): this;
13255
+ addEventListener(event: 'media-started-playing', listener: (event: DOMEvent) => void, useCapture?: boolean): this;
13256
+ removeEventListener(event: 'media-started-playing', listener: (event: DOMEvent) => void): this;
12772
13257
  /**
12773
13258
  * Emitted when media is paused or done playing.
12774
13259
  */
12775
- addEventListener(event: 'media-paused', listener: (event: Event) => void, useCapture?: boolean): this;
12776
- removeEventListener(event: 'media-paused', listener: (event: Event) => void): this;
13260
+ addEventListener(event: 'media-paused', listener: (event: DOMEvent) => void, useCapture?: boolean): this;
13261
+ removeEventListener(event: 'media-paused', listener: (event: DOMEvent) => void): this;
12777
13262
  /**
12778
13263
  * Emitted when a page's theme color changes. This is usually due to encountering a
12779
13264
  * meta tag:
@@ -12794,18 +13279,18 @@ declare namespace Electron {
12794
13279
  /**
12795
13280
  * Emitted when DevTools is opened.
12796
13281
  */
12797
- addEventListener(event: 'devtools-opened', listener: (event: Event) => void, useCapture?: boolean): this;
12798
- removeEventListener(event: 'devtools-opened', listener: (event: Event) => void): this;
13282
+ addEventListener(event: 'devtools-opened', listener: (event: DOMEvent) => void, useCapture?: boolean): this;
13283
+ removeEventListener(event: 'devtools-opened', listener: (event: DOMEvent) => void): this;
12799
13284
  /**
12800
13285
  * Emitted when DevTools is closed.
12801
13286
  */
12802
- addEventListener(event: 'devtools-closed', listener: (event: Event) => void, useCapture?: boolean): this;
12803
- removeEventListener(event: 'devtools-closed', listener: (event: Event) => void): this;
13287
+ addEventListener(event: 'devtools-closed', listener: (event: DOMEvent) => void, useCapture?: boolean): this;
13288
+ removeEventListener(event: 'devtools-closed', listener: (event: DOMEvent) => void): this;
12804
13289
  /**
12805
13290
  * Emitted when DevTools is focused / opened.
12806
13291
  */
12807
- addEventListener(event: 'devtools-focused', listener: (event: Event) => void, useCapture?: boolean): this;
12808
- removeEventListener(event: 'devtools-focused', listener: (event: Event) => void): this;
13292
+ addEventListener(event: 'devtools-focused', listener: (event: DOMEvent) => void, useCapture?: boolean): this;
13293
+ removeEventListener(event: 'devtools-focused', listener: (event: DOMEvent) => void): this;
12809
13294
  /**
12810
13295
  * Emitted when there is a new context menu that needs to be handled.
12811
13296
  */
@@ -13776,15 +14261,16 @@ declare namespace Electron {
13776
14261
  */
13777
14262
  partition?: string;
13778
14263
  /**
13779
- * Can be `include` or `omit`. Whether to send credentials with this request. If
13780
- * set to `include`, credentials from the session associated with the request will
13781
- * be used. If set to `omit`, credentials will not be sent with the request (and
13782
- * the `'login'` event will not be triggered in the event of a 401). This matches
13783
- * the behavior of the fetch option of the same name. If this option is not
13784
- * specified, authentication data from the session will be sent, and cookies will
13785
- * not be sent (unless `useSessionCookies` is set).
14264
+ * Can be `include`, `omit` or `same-origin`. Whether to send credentials with this
14265
+ * request. If set to `include`, credentials from the session associated with the
14266
+ * request will be used. If set to `omit`, credentials will not be sent with the
14267
+ * request (and the `'login'` event will not be triggered in the event of a 401).
14268
+ * If set to `same-origin`, `origin` must also be specified. This matches the
14269
+ * behavior of the fetch option of the same name. If this option is not specified,
14270
+ * authentication data from the session will be sent, and cookies will not be sent
14271
+ * (unless `useSessionCookies` is set).
13786
14272
  */
13787
- credentials?: ('include' | 'omit');
14273
+ credentials?: ('include' | 'omit' | 'same-origin');
13788
14274
  /**
13789
14275
  * Whether to send cookies with this request from the provided session. If
13790
14276
  * `credentials` is specified, this option has no effect. Default is `false`.
@@ -13823,6 +14309,18 @@ declare namespace Electron {
13823
14309
  * The origin URL of the request.
13824
14310
  */
13825
14311
  origin?: string;
14312
+ /**
14313
+ * can be `""`, `no-referrer`, `no-referrer-when-downgrade`, `origin`,
14314
+ * `origin-when-cross-origin`, `unsafe-url`, `same-origin`, `strict-origin`, or
14315
+ * `strict-origin-when-cross-origin`. Defaults to
14316
+ * `strict-origin-when-cross-origin`.
14317
+ */
14318
+ referrerPolicy?: string;
14319
+ /**
14320
+ * can be `default`, `no-store`, `reload`, `no-cache`, `force-cache` or
14321
+ * `only-if-cached`.
14322
+ */
14323
+ cache?: ('default' | 'no-store' | 'reload' | 'no-cache' | 'force-cache' | 'only-if-cached');
13826
14324
  }
13827
14325
 
13828
14326
  interface CloseOpts {
@@ -13888,7 +14386,7 @@ declare namespace Electron {
13888
14386
  enableAdditionalDnsQueryTypes?: boolean;
13889
14387
  }
13890
14388
 
13891
- interface ConsoleMessageEvent extends Event {
14389
+ interface ConsoleMessageEvent extends DOMEvent {
13892
14390
  /**
13893
14391
  * The log level, from 0 to 3. In order it matches `verbose`, `info`, `warning` and
13894
14392
  * `error`.
@@ -13905,7 +14403,7 @@ declare namespace Electron {
13905
14403
  sourceId: string;
13906
14404
  }
13907
14405
 
13908
- interface ContextMenuEvent extends Event {
14406
+ interface ContextMenuEvent extends DOMEvent {
13909
14407
  params: Params;
13910
14408
  }
13911
14409
 
@@ -14275,14 +14773,14 @@ declare namespace Electron {
14275
14773
  device: (HIDDevice) | (SerialPort);
14276
14774
  }
14277
14775
 
14278
- interface DevtoolsOpenUrlEvent extends Event {
14776
+ interface DevtoolsOpenUrlEvent extends DOMEvent {
14279
14777
  /**
14280
14778
  * URL of the link that was clicked or selected.
14281
14779
  */
14282
14780
  url: string;
14283
14781
  }
14284
14782
 
14285
- interface DidChangeThemeColorEvent extends Event {
14783
+ interface DidChangeThemeColorEvent extends DOMEvent {
14286
14784
  themeColor: string;
14287
14785
  }
14288
14786
 
@@ -14320,18 +14818,18 @@ declare namespace Electron {
14320
14818
  disposition: ('default' | 'foreground-tab' | 'background-tab' | 'new-window' | 'other');
14321
14819
  }
14322
14820
 
14323
- interface DidFailLoadEvent extends Event {
14821
+ interface DidFailLoadEvent extends DOMEvent {
14324
14822
  errorCode: number;
14325
14823
  errorDescription: string;
14326
14824
  validatedURL: string;
14327
14825
  isMainFrame: boolean;
14328
14826
  }
14329
14827
 
14330
- interface DidFrameFinishLoadEvent extends Event {
14828
+ interface DidFrameFinishLoadEvent extends DOMEvent {
14331
14829
  isMainFrame: boolean;
14332
14830
  }
14333
14831
 
14334
- interface DidFrameNavigateEvent extends Event {
14832
+ interface DidFrameNavigateEvent extends DOMEvent {
14335
14833
  url: string;
14336
14834
  /**
14337
14835
  * -1 for non HTTP navigations
@@ -14346,16 +14844,16 @@ declare namespace Electron {
14346
14844
  frameRoutingId: number;
14347
14845
  }
14348
14846
 
14349
- interface DidNavigateEvent extends Event {
14847
+ interface DidNavigateEvent extends DOMEvent {
14350
14848
  url: string;
14351
14849
  }
14352
14850
 
14353
- interface DidNavigateInPageEvent extends Event {
14851
+ interface DidNavigateInPageEvent extends DOMEvent {
14354
14852
  isMainFrame: boolean;
14355
14853
  url: string;
14356
14854
  }
14357
14855
 
14358
- interface DidRedirectNavigationEvent extends Event {
14856
+ interface DidRedirectNavigationEvent extends DOMEvent {
14359
14857
  url: string;
14360
14858
  isInPlace: boolean;
14361
14859
  isMainFrame: boolean;
@@ -14363,7 +14861,7 @@ declare namespace Electron {
14363
14861
  frameRoutingId: number;
14364
14862
  }
14365
14863
 
14366
- interface DidStartNavigationEvent extends Event {
14864
+ interface DidStartNavigationEvent extends DOMEvent {
14367
14865
  url: string;
14368
14866
  isInPlace: boolean;
14369
14867
  isMainFrame: boolean;
@@ -14526,7 +15024,7 @@ declare namespace Electron {
14526
15024
  allowLoadingUnsignedLibraries?: boolean;
14527
15025
  }
14528
15026
 
14529
- interface FoundInPageEvent extends Event {
15027
+ interface FoundInPageEvent extends DOMEvent {
14530
15028
  result: FoundInPageResult;
14531
15029
  }
14532
15030
 
@@ -14541,6 +15039,13 @@ declare namespace Electron {
14541
15039
  cache: boolean;
14542
15040
  }
14543
15041
 
15042
+ interface FromPathOptions {
15043
+ /**
15044
+ * Whether to enable cache.
15045
+ */
15046
+ cache: boolean;
15047
+ }
15048
+
14544
15049
  interface HandlerDetails {
14545
15050
  /**
14546
15051
  * The _resolved_ version of the URL passed to `window.open()`. e.g. opening a
@@ -14709,7 +15214,7 @@ declare namespace Electron {
14709
15214
  cssOrigin?: string;
14710
15215
  }
14711
15216
 
14712
- interface IpcMessageEvent extends Event {
15217
+ interface IpcMessageEvent extends DOMEvent {
14713
15218
  /**
14714
15219
  * pair of `[processId, frameId]`.
14715
15220
  */
@@ -14749,7 +15254,7 @@ declare namespace Electron {
14749
15254
  removedItems: JumpListItem[];
14750
15255
  }
14751
15256
 
14752
- interface LoadCommitEvent extends Event {
15257
+ interface LoadCommitEvent extends DOMEvent {
14753
15258
  url: string;
14754
15259
  isMainFrame: boolean;
14755
15260
  }
@@ -15526,14 +16031,14 @@ declare namespace Electron {
15526
16031
  stayAwake?: boolean;
15527
16032
  }
15528
16033
 
15529
- interface PageFaviconUpdatedEvent extends Event {
16034
+ interface PageFaviconUpdatedEvent extends DOMEvent {
15530
16035
  /**
15531
16036
  * Array of URLs.
15532
16037
  */
15533
16038
  favicons: string[];
15534
16039
  }
15535
16040
 
15536
- interface PageTitleUpdatedEvent extends Event {
16041
+ interface PageTitleUpdatedEvent extends DOMEvent {
15537
16042
  title: string;
15538
16043
  explicitSet: boolean;
15539
16044
  }
@@ -15635,7 +16140,7 @@ declare namespace Electron {
15635
16140
  isMainFrame: boolean;
15636
16141
  }
15637
16142
 
15638
- interface PluginCrashedEvent extends Event {
16143
+ interface PluginCrashedEvent extends DOMEvent {
15639
16144
  name: string;
15640
16145
  version: string;
15641
16146
  }
@@ -15854,6 +16359,32 @@ declare namespace Electron {
15854
16359
  quality?: string;
15855
16360
  }
15856
16361
 
16362
+ interface ResolveHostOptions {
16363
+ /**
16364
+ * Requested DNS query type. If unspecified, resolver will pick A or AAAA (or both)
16365
+ * based on IPv4/IPv6 settings:
16366
+ */
16367
+ queryType?: ('A' | 'AAAA');
16368
+ /**
16369
+ * The source to use for resolved addresses. Default allows the resolver to pick an
16370
+ * appropriate source. Only affects use of big external sources (e.g. calling the
16371
+ * system for resolution or using DNS). Even if a source is specified, results can
16372
+ * still come from cache, resolving "localhost" or IP literals, etc. One of the
16373
+ * following values:
16374
+ */
16375
+ source?: ('any' | 'system' | 'dns' | 'mdns' | 'localOnly');
16376
+ /**
16377
+ * Indicates what DNS cache entries, if any, can be used to provide a response. One
16378
+ * of the following values:
16379
+ */
16380
+ cacheUsage?: ('allowed' | 'staleAllowed' | 'disallowed');
16381
+ /**
16382
+ * Controls the resolver's Secure DNS behavior for this request. One of the
16383
+ * following values:
16384
+ */
16385
+ secureDnsPolicy?: ('allow' | 'disable');
16386
+ }
16387
+
15857
16388
  interface ResourceUsage {
15858
16389
  images: MemoryUsageDetails;
15859
16390
  scripts: MemoryUsageDetails;
@@ -16405,7 +16936,7 @@ declare namespace Electron {
16405
16936
  percentage: number;
16406
16937
  }
16407
16938
 
16408
- interface UpdateTargetUrlEvent extends Event {
16939
+ interface UpdateTargetUrlEvent extends DOMEvent {
16409
16940
  url: string;
16410
16941
  }
16411
16942
 
@@ -16467,6 +16998,69 @@ declare namespace Electron {
16467
16998
  skipTransformProcessType?: boolean;
16468
16999
  }
16469
17000
 
17001
+ interface WebContentsAudioStateChangedEventParams {
17002
+ /**
17003
+ * True if one or more frames or child `webContents` are emitting audio.
17004
+ */
17005
+ audible: boolean;
17006
+ }
17007
+
17008
+ interface WebContentsDidRedirectNavigationEventParams {
17009
+ /**
17010
+ * The URL the frame is navigating to.
17011
+ */
17012
+ url: string;
17013
+ /**
17014
+ * Whether the navigation happened without changing document. Examples of same
17015
+ * document navigations are reference fragment navigations, pushState/replaceState,
17016
+ * and same page history navigation.
17017
+ */
17018
+ isSameDocument: boolean;
17019
+ /**
17020
+ * True if the navigation is taking place in a main frame.
17021
+ */
17022
+ isMainFrame: boolean;
17023
+ /**
17024
+ * The frame to be navigated.
17025
+ */
17026
+ frame: WebFrameMain;
17027
+ /**
17028
+ * The frame which initiated the navigation, which can be a parent frame (e.g. via
17029
+ * `window.open` with a frame's name), or null if the navigation was not initiated
17030
+ * by a frame. This can also be null if the initiating frame was deleted before the
17031
+ * event was emitted.
17032
+ */
17033
+ initiator?: WebFrameMain;
17034
+ }
17035
+
17036
+ interface WebContentsDidStartNavigationEventParams {
17037
+ /**
17038
+ * The URL the frame is navigating to.
17039
+ */
17040
+ url: string;
17041
+ /**
17042
+ * Whether the navigation happened without changing document. Examples of same
17043
+ * document navigations are reference fragment navigations, pushState/replaceState,
17044
+ * and same page history navigation.
17045
+ */
17046
+ isSameDocument: boolean;
17047
+ /**
17048
+ * True if the navigation is taking place in a main frame.
17049
+ */
17050
+ isMainFrame: boolean;
17051
+ /**
17052
+ * The frame to be navigated.
17053
+ */
17054
+ frame: WebFrameMain;
17055
+ /**
17056
+ * The frame which initiated the navigation, which can be a parent frame (e.g. via
17057
+ * `window.open` with a frame's name), or null if the navigation was not initiated
17058
+ * by a frame. This can also be null if the initiating frame was deleted before the
17059
+ * event was emitted.
17060
+ */
17061
+ initiator?: WebFrameMain;
17062
+ }
17063
+
16470
17064
  interface WebContentsPrintOptions {
16471
17065
  /**
16472
17066
  * Don't ask user for print settings. Default is `false`.
@@ -16533,6 +17127,84 @@ declare namespace Electron {
16533
17127
  pageSize?: (string) | (Size);
16534
17128
  }
16535
17129
 
17130
+ interface WebContentsWillFrameNavigateEventParams {
17131
+ /**
17132
+ * The URL the frame is navigating to.
17133
+ */
17134
+ url: string;
17135
+ /**
17136
+ * True if the navigation is taking place in a main frame.
17137
+ */
17138
+ isMainFrame: boolean;
17139
+ /**
17140
+ * The frame to be navigated.
17141
+ */
17142
+ frame: WebFrameMain;
17143
+ /**
17144
+ * The frame which initiated the navigation, which can be a parent frame (e.g. via
17145
+ * `window.open` with a frame's name), or null if the navigation was not initiated
17146
+ * by a frame. This can also be null if the initiating frame was deleted before the
17147
+ * event was emitted.
17148
+ */
17149
+ initiator?: WebFrameMain;
17150
+ }
17151
+
17152
+ interface WebContentsWillNavigateEventParams {
17153
+ /**
17154
+ * The URL the frame is navigating to.
17155
+ */
17156
+ url: string;
17157
+ /**
17158
+ * Whether the navigation happened without changing document. Examples of same
17159
+ * document navigations are reference fragment navigations, pushState/replaceState,
17160
+ * and same page history navigation.
17161
+ */
17162
+ isSameDocument: boolean;
17163
+ /**
17164
+ * True if the navigation is taking place in a main frame.
17165
+ */
17166
+ isMainFrame: boolean;
17167
+ /**
17168
+ * The frame to be navigated.
17169
+ */
17170
+ frame: WebFrameMain;
17171
+ /**
17172
+ * The frame which initiated the navigation, which can be a parent frame (e.g. via
17173
+ * `window.open` with a frame's name), or null if the navigation was not initiated
17174
+ * by a frame. This can also be null if the initiating frame was deleted before the
17175
+ * event was emitted.
17176
+ */
17177
+ initiator?: WebFrameMain;
17178
+ }
17179
+
17180
+ interface WebContentsWillRedirectEventParams {
17181
+ /**
17182
+ * The URL the frame is navigating to.
17183
+ */
17184
+ url: string;
17185
+ /**
17186
+ * Whether the navigation happened without changing document. Examples of same
17187
+ * document navigations are reference fragment navigations, pushState/replaceState,
17188
+ * and same page history navigation.
17189
+ */
17190
+ isSameDocument: boolean;
17191
+ /**
17192
+ * True if the navigation is taking place in a main frame.
17193
+ */
17194
+ isMainFrame: boolean;
17195
+ /**
17196
+ * The frame to be navigated.
17197
+ */
17198
+ frame: WebFrameMain;
17199
+ /**
17200
+ * The frame which initiated the navigation, which can be a parent frame (e.g. via
17201
+ * `window.open` with a frame's name), or null if the navigation was not initiated
17202
+ * by a frame. This can also be null if the initiating frame was deleted before the
17203
+ * event was emitted.
17204
+ */
17205
+ initiator?: WebFrameMain;
17206
+ }
17207
+
16536
17208
  interface WebviewTagPrintOptions {
16537
17209
  /**
16538
17210
  * Don't ask user for print settings. Default is `false`.
@@ -16598,7 +17270,14 @@ declare namespace Electron {
16598
17270
  pageSize?: (string) | (Size);
16599
17271
  }
16600
17272
 
16601
- interface WillNavigateEvent extends Event {
17273
+ interface WillFrameNavigateEvent extends DOMEvent {
17274
+ url: string;
17275
+ isMainFrame: boolean;
17276
+ frameProcessId: number;
17277
+ frameRoutingId: number;
17278
+ }
17279
+
17280
+ interface WillNavigateEvent extends DOMEvent {
16602
17281
  url: string;
16603
17282
  }
16604
17283
 
@@ -17239,6 +17918,7 @@ declare namespace Electron {
17239
17918
 
17240
17919
 
17241
17920
  namespace Common {
17921
+ type Event<Params extends object = {}> = Electron.Event<Params>;
17242
17922
  const clipboard: Clipboard;
17243
17923
  type Clipboard = Electron.Clipboard;
17244
17924
  const crashReporter: CrashReporter;
@@ -17303,6 +17983,7 @@ declare namespace Electron {
17303
17983
  type FoundInPageEvent = Electron.FoundInPageEvent;
17304
17984
  type FrameCreatedDetails = Electron.FrameCreatedDetails;
17305
17985
  type FromPartitionOptions = Electron.FromPartitionOptions;
17986
+ type FromPathOptions = Electron.FromPathOptions;
17306
17987
  type HandlerDetails = Electron.HandlerDetails;
17307
17988
  type HeadersReceivedResponse = Electron.HeadersReceivedResponse;
17308
17989
  type HeapStatistics = Electron.HeapStatistics;
@@ -17366,6 +18047,7 @@ declare namespace Electron {
17366
18047
  type RenderProcessGoneDetails = Electron.RenderProcessGoneDetails;
17367
18048
  type Request = Electron.Request;
17368
18049
  type ResizeOptions = Electron.ResizeOptions;
18050
+ type ResolveHostOptions = Electron.ResolveHostOptions;
17369
18051
  type ResourceUsage = Electron.ResourceUsage;
17370
18052
  type Response = Electron.Response;
17371
18053
  type Result = Electron.Result;
@@ -17403,8 +18085,15 @@ declare namespace Electron {
17403
18085
  type UsbDeviceRemovedDetails = Electron.UsbDeviceRemovedDetails;
17404
18086
  type UsbDeviceRevokedDetails = Electron.UsbDeviceRevokedDetails;
17405
18087
  type VisibleOnAllWorkspacesOptions = Electron.VisibleOnAllWorkspacesOptions;
18088
+ type WebContentsAudioStateChangedEventParams = Electron.WebContentsAudioStateChangedEventParams;
18089
+ type WebContentsDidRedirectNavigationEventParams = Electron.WebContentsDidRedirectNavigationEventParams;
18090
+ type WebContentsDidStartNavigationEventParams = Electron.WebContentsDidStartNavigationEventParams;
17406
18091
  type WebContentsPrintOptions = Electron.WebContentsPrintOptions;
18092
+ type WebContentsWillFrameNavigateEventParams = Electron.WebContentsWillFrameNavigateEventParams;
18093
+ type WebContentsWillNavigateEventParams = Electron.WebContentsWillNavigateEventParams;
18094
+ type WebContentsWillRedirectEventParams = Electron.WebContentsWillRedirectEventParams;
17407
18095
  type WebviewTagPrintOptions = Electron.WebviewTagPrintOptions;
18096
+ type WillFrameNavigateEvent = Electron.WillFrameNavigateEvent;
17408
18097
  type WillNavigateEvent = Electron.WillNavigateEvent;
17409
18098
  type WillResizeDetails = Electron.WillResizeDetails;
17410
18099
  type EditFlags = Electron.EditFlags;
@@ -17428,7 +18117,6 @@ declare namespace Electron {
17428
18117
  type CustomScheme = Electron.CustomScheme;
17429
18118
  type DesktopCapturerSource = Electron.DesktopCapturerSource;
17430
18119
  type Display = Electron.Display;
17431
- type Event = Electron.Event;
17432
18120
  type Extension = Electron.Extension;
17433
18121
  type ExtensionInfo = Electron.ExtensionInfo;
17434
18122
  type FileFilter = Electron.FileFilter;
@@ -17465,6 +18153,8 @@ declare namespace Electron {
17465
18153
  type ProtocolResponseUploadData = Electron.ProtocolResponseUploadData;
17466
18154
  type Rectangle = Electron.Rectangle;
17467
18155
  type Referrer = Electron.Referrer;
18156
+ type ResolvedEndpoint = Electron.ResolvedEndpoint;
18157
+ type ResolvedHost = Electron.ResolvedHost;
17468
18158
  type ScrubberItem = Electron.ScrubberItem;
17469
18159
  type SegmentedControlSegment = Electron.SegmentedControlSegment;
17470
18160
  type SerialPort = Electron.SerialPort;
@@ -17488,6 +18178,7 @@ declare namespace Electron {
17488
18178
  }
17489
18179
 
17490
18180
  namespace Main {
18181
+ type Event<Params extends object = {}> = Electron.Event<Params>;
17491
18182
  const app: App;
17492
18183
  type App = Electron.App;
17493
18184
  const autoUpdater: AutoUpdater;
@@ -17617,6 +18308,7 @@ declare namespace Electron {
17617
18308
  type FoundInPageEvent = Electron.FoundInPageEvent;
17618
18309
  type FrameCreatedDetails = Electron.FrameCreatedDetails;
17619
18310
  type FromPartitionOptions = Electron.FromPartitionOptions;
18311
+ type FromPathOptions = Electron.FromPathOptions;
17620
18312
  type HandlerDetails = Electron.HandlerDetails;
17621
18313
  type HeadersReceivedResponse = Electron.HeadersReceivedResponse;
17622
18314
  type HeapStatistics = Electron.HeapStatistics;
@@ -17680,6 +18372,7 @@ declare namespace Electron {
17680
18372
  type RenderProcessGoneDetails = Electron.RenderProcessGoneDetails;
17681
18373
  type Request = Electron.Request;
17682
18374
  type ResizeOptions = Electron.ResizeOptions;
18375
+ type ResolveHostOptions = Electron.ResolveHostOptions;
17683
18376
  type ResourceUsage = Electron.ResourceUsage;
17684
18377
  type Response = Electron.Response;
17685
18378
  type Result = Electron.Result;
@@ -17717,8 +18410,15 @@ declare namespace Electron {
17717
18410
  type UsbDeviceRemovedDetails = Electron.UsbDeviceRemovedDetails;
17718
18411
  type UsbDeviceRevokedDetails = Electron.UsbDeviceRevokedDetails;
17719
18412
  type VisibleOnAllWorkspacesOptions = Electron.VisibleOnAllWorkspacesOptions;
18413
+ type WebContentsAudioStateChangedEventParams = Electron.WebContentsAudioStateChangedEventParams;
18414
+ type WebContentsDidRedirectNavigationEventParams = Electron.WebContentsDidRedirectNavigationEventParams;
18415
+ type WebContentsDidStartNavigationEventParams = Electron.WebContentsDidStartNavigationEventParams;
17720
18416
  type WebContentsPrintOptions = Electron.WebContentsPrintOptions;
18417
+ type WebContentsWillFrameNavigateEventParams = Electron.WebContentsWillFrameNavigateEventParams;
18418
+ type WebContentsWillNavigateEventParams = Electron.WebContentsWillNavigateEventParams;
18419
+ type WebContentsWillRedirectEventParams = Electron.WebContentsWillRedirectEventParams;
17721
18420
  type WebviewTagPrintOptions = Electron.WebviewTagPrintOptions;
18421
+ type WillFrameNavigateEvent = Electron.WillFrameNavigateEvent;
17722
18422
  type WillNavigateEvent = Electron.WillNavigateEvent;
17723
18423
  type WillResizeDetails = Electron.WillResizeDetails;
17724
18424
  type EditFlags = Electron.EditFlags;
@@ -17742,7 +18442,6 @@ declare namespace Electron {
17742
18442
  type CustomScheme = Electron.CustomScheme;
17743
18443
  type DesktopCapturerSource = Electron.DesktopCapturerSource;
17744
18444
  type Display = Electron.Display;
17745
- type Event = Electron.Event;
17746
18445
  type Extension = Electron.Extension;
17747
18446
  type ExtensionInfo = Electron.ExtensionInfo;
17748
18447
  type FileFilter = Electron.FileFilter;
@@ -17779,6 +18478,8 @@ declare namespace Electron {
17779
18478
  type ProtocolResponseUploadData = Electron.ProtocolResponseUploadData;
17780
18479
  type Rectangle = Electron.Rectangle;
17781
18480
  type Referrer = Electron.Referrer;
18481
+ type ResolvedEndpoint = Electron.ResolvedEndpoint;
18482
+ type ResolvedHost = Electron.ResolvedHost;
17782
18483
  type ScrubberItem = Electron.ScrubberItem;
17783
18484
  type SegmentedControlSegment = Electron.SegmentedControlSegment;
17784
18485
  type SerialPort = Electron.SerialPort;
@@ -17802,12 +18503,14 @@ declare namespace Electron {
17802
18503
  }
17803
18504
 
17804
18505
  namespace Renderer {
18506
+ type Event<Params extends object = {}> = Electron.Event<Params>;
17805
18507
  const contextBridge: ContextBridge;
17806
18508
  type ContextBridge = Electron.ContextBridge;
17807
18509
  const ipcRenderer: IpcRenderer;
17808
18510
  type IpcRenderer = Electron.IpcRenderer;
17809
18511
  const webFrame: WebFrame;
17810
18512
  type WebFrame = Electron.WebFrame;
18513
+ type WebviewTag = Electron.WebviewTag;
17811
18514
  type AboutPanelOptionsOptions = Electron.AboutPanelOptionsOptions;
17812
18515
  type AddRepresentationOptions = Electron.AddRepresentationOptions;
17813
18516
  type AnimationSettings = Electron.AnimationSettings;
@@ -17864,6 +18567,7 @@ declare namespace Electron {
17864
18567
  type FoundInPageEvent = Electron.FoundInPageEvent;
17865
18568
  type FrameCreatedDetails = Electron.FrameCreatedDetails;
17866
18569
  type FromPartitionOptions = Electron.FromPartitionOptions;
18570
+ type FromPathOptions = Electron.FromPathOptions;
17867
18571
  type HandlerDetails = Electron.HandlerDetails;
17868
18572
  type HeadersReceivedResponse = Electron.HeadersReceivedResponse;
17869
18573
  type HeapStatistics = Electron.HeapStatistics;
@@ -17927,6 +18631,7 @@ declare namespace Electron {
17927
18631
  type RenderProcessGoneDetails = Electron.RenderProcessGoneDetails;
17928
18632
  type Request = Electron.Request;
17929
18633
  type ResizeOptions = Electron.ResizeOptions;
18634
+ type ResolveHostOptions = Electron.ResolveHostOptions;
17930
18635
  type ResourceUsage = Electron.ResourceUsage;
17931
18636
  type Response = Electron.Response;
17932
18637
  type Result = Electron.Result;
@@ -17964,8 +18669,15 @@ declare namespace Electron {
17964
18669
  type UsbDeviceRemovedDetails = Electron.UsbDeviceRemovedDetails;
17965
18670
  type UsbDeviceRevokedDetails = Electron.UsbDeviceRevokedDetails;
17966
18671
  type VisibleOnAllWorkspacesOptions = Electron.VisibleOnAllWorkspacesOptions;
18672
+ type WebContentsAudioStateChangedEventParams = Electron.WebContentsAudioStateChangedEventParams;
18673
+ type WebContentsDidRedirectNavigationEventParams = Electron.WebContentsDidRedirectNavigationEventParams;
18674
+ type WebContentsDidStartNavigationEventParams = Electron.WebContentsDidStartNavigationEventParams;
17967
18675
  type WebContentsPrintOptions = Electron.WebContentsPrintOptions;
18676
+ type WebContentsWillFrameNavigateEventParams = Electron.WebContentsWillFrameNavigateEventParams;
18677
+ type WebContentsWillNavigateEventParams = Electron.WebContentsWillNavigateEventParams;
18678
+ type WebContentsWillRedirectEventParams = Electron.WebContentsWillRedirectEventParams;
17968
18679
  type WebviewTagPrintOptions = Electron.WebviewTagPrintOptions;
18680
+ type WillFrameNavigateEvent = Electron.WillFrameNavigateEvent;
17969
18681
  type WillNavigateEvent = Electron.WillNavigateEvent;
17970
18682
  type WillResizeDetails = Electron.WillResizeDetails;
17971
18683
  type EditFlags = Electron.EditFlags;
@@ -17989,7 +18701,6 @@ declare namespace Electron {
17989
18701
  type CustomScheme = Electron.CustomScheme;
17990
18702
  type DesktopCapturerSource = Electron.DesktopCapturerSource;
17991
18703
  type Display = Electron.Display;
17992
- type Event = Electron.Event;
17993
18704
  type Extension = Electron.Extension;
17994
18705
  type ExtensionInfo = Electron.ExtensionInfo;
17995
18706
  type FileFilter = Electron.FileFilter;
@@ -18026,6 +18737,8 @@ declare namespace Electron {
18026
18737
  type ProtocolResponseUploadData = Electron.ProtocolResponseUploadData;
18027
18738
  type Rectangle = Electron.Rectangle;
18028
18739
  type Referrer = Electron.Referrer;
18740
+ type ResolvedEndpoint = Electron.ResolvedEndpoint;
18741
+ type ResolvedHost = Electron.ResolvedHost;
18029
18742
  type ScrubberItem = Electron.ScrubberItem;
18030
18743
  type SegmentedControlSegment = Electron.SegmentedControlSegment;
18031
18744
  type SerialPort = Electron.SerialPort;
@@ -18049,6 +18762,7 @@ declare namespace Electron {
18049
18762
  }
18050
18763
 
18051
18764
  namespace CrossProcessExports {
18765
+ type Event<Params extends object = {}> = Electron.Event<Params>;
18052
18766
  const app: App;
18053
18767
  type App = Electron.App;
18054
18768
  const autoUpdater: AutoUpdater;
@@ -18136,6 +18850,7 @@ declare namespace Electron {
18136
18850
  const webFrameMain: typeof WebFrameMain;
18137
18851
  type WebFrameMain = Electron.WebFrameMain;
18138
18852
  type WebRequest = Electron.WebRequest;
18853
+ type WebviewTag = Electron.WebviewTag;
18139
18854
  type AboutPanelOptionsOptions = Electron.AboutPanelOptionsOptions;
18140
18855
  type AddRepresentationOptions = Electron.AddRepresentationOptions;
18141
18856
  type AnimationSettings = Electron.AnimationSettings;
@@ -18192,6 +18907,7 @@ declare namespace Electron {
18192
18907
  type FoundInPageEvent = Electron.FoundInPageEvent;
18193
18908
  type FrameCreatedDetails = Electron.FrameCreatedDetails;
18194
18909
  type FromPartitionOptions = Electron.FromPartitionOptions;
18910
+ type FromPathOptions = Electron.FromPathOptions;
18195
18911
  type HandlerDetails = Electron.HandlerDetails;
18196
18912
  type HeadersReceivedResponse = Electron.HeadersReceivedResponse;
18197
18913
  type HeapStatistics = Electron.HeapStatistics;
@@ -18255,6 +18971,7 @@ declare namespace Electron {
18255
18971
  type RenderProcessGoneDetails = Electron.RenderProcessGoneDetails;
18256
18972
  type Request = Electron.Request;
18257
18973
  type ResizeOptions = Electron.ResizeOptions;
18974
+ type ResolveHostOptions = Electron.ResolveHostOptions;
18258
18975
  type ResourceUsage = Electron.ResourceUsage;
18259
18976
  type Response = Electron.Response;
18260
18977
  type Result = Electron.Result;
@@ -18292,8 +19009,15 @@ declare namespace Electron {
18292
19009
  type UsbDeviceRemovedDetails = Electron.UsbDeviceRemovedDetails;
18293
19010
  type UsbDeviceRevokedDetails = Electron.UsbDeviceRevokedDetails;
18294
19011
  type VisibleOnAllWorkspacesOptions = Electron.VisibleOnAllWorkspacesOptions;
19012
+ type WebContentsAudioStateChangedEventParams = Electron.WebContentsAudioStateChangedEventParams;
19013
+ type WebContentsDidRedirectNavigationEventParams = Electron.WebContentsDidRedirectNavigationEventParams;
19014
+ type WebContentsDidStartNavigationEventParams = Electron.WebContentsDidStartNavigationEventParams;
18295
19015
  type WebContentsPrintOptions = Electron.WebContentsPrintOptions;
19016
+ type WebContentsWillFrameNavigateEventParams = Electron.WebContentsWillFrameNavigateEventParams;
19017
+ type WebContentsWillNavigateEventParams = Electron.WebContentsWillNavigateEventParams;
19018
+ type WebContentsWillRedirectEventParams = Electron.WebContentsWillRedirectEventParams;
18296
19019
  type WebviewTagPrintOptions = Electron.WebviewTagPrintOptions;
19020
+ type WillFrameNavigateEvent = Electron.WillFrameNavigateEvent;
18297
19021
  type WillNavigateEvent = Electron.WillNavigateEvent;
18298
19022
  type WillResizeDetails = Electron.WillResizeDetails;
18299
19023
  type EditFlags = Electron.EditFlags;
@@ -18317,7 +19041,6 @@ declare namespace Electron {
18317
19041
  type CustomScheme = Electron.CustomScheme;
18318
19042
  type DesktopCapturerSource = Electron.DesktopCapturerSource;
18319
19043
  type Display = Electron.Display;
18320
- type Event = Electron.Event;
18321
19044
  type Extension = Electron.Extension;
18322
19045
  type ExtensionInfo = Electron.ExtensionInfo;
18323
19046
  type FileFilter = Electron.FileFilter;
@@ -18354,6 +19077,8 @@ declare namespace Electron {
18354
19077
  type ProtocolResponseUploadData = Electron.ProtocolResponseUploadData;
18355
19078
  type Rectangle = Electron.Rectangle;
18356
19079
  type Referrer = Electron.Referrer;
19080
+ type ResolvedEndpoint = Electron.ResolvedEndpoint;
19081
+ type ResolvedHost = Electron.ResolvedHost;
18357
19082
  type ScrubberItem = Electron.ScrubberItem;
18358
19083
  type SegmentedControlSegment = Electron.SegmentedControlSegment;
18359
19084
  type SerialPort = Electron.SerialPort;
@@ -18506,6 +19231,9 @@ declare namespace NodeJS {
18506
19231
  * in Kilobytes.
18507
19232
  */
18508
19233
  getHeapStatistics(): Electron.HeapStatistics;
19234
+ /**
19235
+ * @platform win32,linux
19236
+ */
18509
19237
  getIOCounters(): Electron.IOCounters;
18510
19238
  /**
18511
19239
  * Resolves with a ProcessMemoryInfo
@@ -18581,8 +19309,11 @@ declare namespace NodeJS {
18581
19309
  */
18582
19310
  readonly contextIsolated: boolean;
18583
19311
  /**
18584
- * A `boolean`. When app is started by being passed as parameter to the default
18585
- * app, this property is `true` in the main process, otherwise it is `undefined`.
19312
+ * A `boolean`. When the app is started by being passed as parameter to the default
19313
+ * Electron executable, this property is `true` in the main process, otherwise it
19314
+ * is `undefined`. For example when running the app with `electron .`, it is
19315
+ * `true`, even if the app is packaged (`isPackaged`) is `true`. This can be useful
19316
+ * to determine how many arguments will need to be sliced off from `process.argv`.
18586
19317
  *
18587
19318
  */
18588
19319
  readonly defaultApp: boolean;