electron 24.1.0 → 25.0.0-alpha.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/checksums.json +75 -75
  2. package/electron.d.ts +793 -118
  3. package/package.json +1 -1
package/electron.d.ts CHANGED
@@ -1,18 +1,23 @@
1
- // Type definitions for Electron 24.1.0
1
+ // Type definitions for Electron 25.0.0-alpha.2
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
@@ -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
@@ -1690,6 +1707,9 @@ declare namespace Electron {
1690
1707
  * @experimental
1691
1708
  */
1692
1709
  getBounds(): Rectangle;
1710
+ /**
1711
+ * @experimental
1712
+ */
1693
1713
  setAutoResize(options: AutoResizeOptions): void;
1694
1714
  /**
1695
1715
  * Examples of valid `color` values:
@@ -2377,11 +2397,22 @@ declare namespace Electron {
2377
2397
  */
2378
2398
  getTitle(): string;
2379
2399
  /**
2380
- * 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.
2381
2404
  *
2405
+ * @deprecated
2382
2406
  * @platform darwin
2383
2407
  */
2384
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);
2385
2416
  /**
2386
2417
  * Whether the window has a shadow.
2387
2418
  */
@@ -2626,6 +2657,9 @@ declare namespace Electron {
2626
2657
  * Same as `webContents.reload`.
2627
2658
  */
2628
2659
  reload(): void;
2660
+ /**
2661
+ * @experimental
2662
+ */
2629
2663
  removeBrowserView(browserView: BrowserView): void;
2630
2664
  /**
2631
2665
  * Remove the window's menu bar.
@@ -2737,6 +2771,9 @@ declare namespace Electron {
2737
2771
  * supplied will default to their current values.
2738
2772
  */
2739
2773
  setBounds(bounds: Partial<Rectangle>, animate?: boolean): void;
2774
+ /**
2775
+ * @experimental
2776
+ */
2740
2777
  setBrowserView(browserView: (BrowserView) | (null)): void;
2741
2778
  /**
2742
2779
  * Sets whether the window can be manually closed by user. On Linux does nothing.
@@ -3032,8 +3069,12 @@ declare namespace Electron {
3032
3069
  */
3033
3070
  setTouchBar(touchBar: (TouchBar) | (null)): void;
3034
3071
  /**
3035
- * 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.
3036
3074
  *
3075
+ * > **Note** This function is deprecated. Use setWindowButtonPosition instead.
3076
+ *
3077
+ * @deprecated
3037
3078
  * @platform darwin
3038
3079
  */
3039
3080
  setTrafficLightPosition(position: Point): void;
@@ -3055,6 +3096,13 @@ declare namespace Electron {
3055
3096
  * @platform darwin,linux
3056
3097
  */
3057
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;
3058
3106
  /**
3059
3107
  * Sets whether the window traffic light buttons should be visible.
3060
3108
  *
@@ -3451,7 +3499,7 @@ declare namespace Electron {
3451
3499
  * Sends the last chunk of the request data. Subsequent write or end operations
3452
3500
  * will not be allowed. The `finish` event is emitted just after the end operation.
3453
3501
  */
3454
- end(chunk?: (string) | (Buffer), encoding?: string, callback?: () => void): void;
3502
+ end(chunk?: (string) | (Buffer), encoding?: string, callback?: () => void): this;
3455
3503
  /**
3456
3504
  * Continues any pending redirection. Can only be called during a `'redirect'`
3457
3505
  * event.
@@ -4761,13 +4809,6 @@ declare namespace Electron {
4761
4809
  savePath: string;
4762
4810
  }
4763
4811
 
4764
- interface Event extends GlobalEvent {
4765
-
4766
- // Docs: https://electronjs.org/docs/api/structures/event
4767
-
4768
- preventDefault: (() => void);
4769
- }
4770
-
4771
4812
  interface Extension {
4772
4813
 
4773
4814
  // Docs: https://electronjs.org/docs/api/structures/extension
@@ -5247,7 +5288,7 @@ declare namespace Electron {
5247
5288
  * "reply" to the sent message in order to guarantee the reply will go to the
5248
5289
  * correct process and frame.
5249
5290
  */
5250
- reply: Function;
5291
+ reply: (channel: string, ...args: any[]) => void;
5251
5292
  /**
5252
5293
  * Set this to the value to be returned in a synchronous message
5253
5294
  */
@@ -5579,7 +5620,7 @@ declare namespace Electron {
5579
5620
  size: number;
5580
5621
  }
5581
5622
 
5582
- class Menu {
5623
+ class Menu extends NodeEventEmitter {
5583
5624
 
5584
5625
  // Docs: https://electronjs.org/docs/api/menu
5585
5626
 
@@ -6156,6 +6197,34 @@ declare namespace Electron {
6156
6197
 
6157
6198
  // Docs: https://electronjs.org/docs/api/net
6158
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>;
6159
6228
  /**
6160
6229
  * Whether there is currently internet connection.
6161
6230
  *
@@ -6213,6 +6282,9 @@ declare namespace Electron {
6213
6282
 
6214
6283
  // Docs: https://electronjs.org/docs/api/notification
6215
6284
 
6285
+ /**
6286
+ * @platform darwin
6287
+ */
6216
6288
  on(event: 'action', listener: (event: Event,
6217
6289
  /**
6218
6290
  * The index of the action that was activated.
@@ -6881,11 +6953,24 @@ declare namespace Electron {
6881
6953
 
6882
6954
  // Docs: https://electronjs.org/docs/api/protocol
6883
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;
6884
6967
  /**
6885
6968
  * Whether the protocol was successfully intercepted
6886
6969
  *
6887
6970
  * Intercepts `scheme` protocol and uses `handler` as the protocol's new handler
6888
6971
  * which sends a `Buffer` as a response.
6972
+ *
6973
+ * @deprecated
6889
6974
  */
6890
6975
  interceptBufferProtocol(scheme: string, handler: (request: ProtocolRequest, callback: (response: (Buffer) | (ProtocolResponse)) => void) => void): boolean;
6891
6976
  /**
@@ -6893,6 +6978,8 @@ declare namespace Electron {
6893
6978
  *
6894
6979
  * Intercepts `scheme` protocol and uses `handler` as the protocol's new handler
6895
6980
  * which sends a file as a response.
6981
+ *
6982
+ * @deprecated
6896
6983
  */
6897
6984
  interceptFileProtocol(scheme: string, handler: (request: ProtocolRequest, callback: (response: (string) | (ProtocolResponse)) => void) => void): boolean;
6898
6985
  /**
@@ -6900,6 +6987,8 @@ declare namespace Electron {
6900
6987
  *
6901
6988
  * Intercepts `scheme` protocol and uses `handler` as the protocol's new handler
6902
6989
  * which sends a new HTTP request as a response.
6990
+ *
6991
+ * @deprecated
6903
6992
  */
6904
6993
  interceptHttpProtocol(scheme: string, handler: (request: ProtocolRequest, callback: (response: ProtocolResponse) => void) => void): boolean;
6905
6994
  /**
@@ -6907,6 +6996,8 @@ declare namespace Electron {
6907
6996
  *
6908
6997
  * Same as `protocol.registerStreamProtocol`, except that it replaces an existing
6909
6998
  * protocol handler.
6999
+ *
7000
+ * @deprecated
6910
7001
  */
6911
7002
  interceptStreamProtocol(scheme: string, handler: (request: ProtocolRequest, callback: (response: (NodeJS.ReadableStream) | (ProtocolResponse)) => void) => void): boolean;
6912
7003
  /**
@@ -6914,14 +7005,24 @@ declare namespace Electron {
6914
7005
  *
6915
7006
  * Intercepts `scheme` protocol and uses `handler` as the protocol's new handler
6916
7007
  * which sends a `string` as a response.
7008
+ *
7009
+ * @deprecated
6917
7010
  */
6918
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;
6919
7016
  /**
6920
7017
  * Whether `scheme` is already intercepted.
7018
+ *
7019
+ * @deprecated
6921
7020
  */
6922
7021
  isProtocolIntercepted(scheme: string): boolean;
6923
7022
  /**
6924
7023
  * Whether `scheme` is already registered.
7024
+ *
7025
+ * @deprecated
6925
7026
  */
6926
7027
  isProtocolRegistered(scheme: string): boolean;
6927
7028
  /**
@@ -6934,6 +7035,8 @@ declare namespace Electron {
6934
7035
  * property.
6935
7036
  *
6936
7037
  * Example:
7038
+ *
7039
+ * @deprecated
6937
7040
  */
6938
7041
  registerBufferProtocol(scheme: string, handler: (request: ProtocolRequest, callback: (response: (Buffer) | (ProtocolResponse)) => void) => void): boolean;
6939
7042
  /**
@@ -6949,6 +7052,8 @@ declare namespace Electron {
6949
7052
  *
6950
7053
  * By default the `scheme` is treated like `http:`, which is parsed differently
6951
7054
  * from protocols that follow the "generic URI syntax" like `file:`.
7055
+ *
7056
+ * @deprecated
6952
7057
  */
6953
7058
  registerFileProtocol(scheme: string, handler: (request: ProtocolRequest, callback: (response: (string) | (ProtocolResponse)) => void) => void): boolean;
6954
7059
  /**
@@ -6958,6 +7063,8 @@ declare namespace Electron {
6958
7063
  *
6959
7064
  * The usage is the same with `registerFileProtocol`, except that the `callback`
6960
7065
  * should be called with an object that has the `url` property.
7066
+ *
7067
+ * @deprecated
6961
7068
  */
6962
7069
  registerHttpProtocol(scheme: string, handler: (request: ProtocolRequest, callback: (response: ProtocolResponse) => void) => void): boolean;
6963
7070
  /**
@@ -7011,6 +7118,8 @@ declare namespace Electron {
7011
7118
  *
7012
7119
  * It is possible to pass any object that implements the readable stream API (emits
7013
7120
  * `data`/`end`/`error` events). For example, here's how a file could be returned:
7121
+ *
7122
+ * @deprecated
7014
7123
  */
7015
7124
  registerStreamProtocol(scheme: string, handler: (request: ProtocolRequest, callback: (response: (NodeJS.ReadableStream) | (ProtocolResponse)) => void) => void): boolean;
7016
7125
  /**
@@ -7021,18 +7130,28 @@ declare namespace Electron {
7021
7130
  * The usage is the same with `registerFileProtocol`, except that the `callback`
7022
7131
  * should be called with either a `string` or an object that has the `data`
7023
7132
  * property.
7133
+ *
7134
+ * @deprecated
7024
7135
  */
7025
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;
7026
7141
  /**
7027
7142
  * Whether the protocol was successfully unintercepted
7028
7143
  *
7029
7144
  * Remove the interceptor installed for `scheme` and restore its original handler.
7145
+ *
7146
+ * @deprecated
7030
7147
  */
7031
7148
  uninterceptProtocol(scheme: string): boolean;
7032
7149
  /**
7033
7150
  * Whether the protocol was successfully unregistered
7034
7151
  *
7035
7152
  * Unregisters the custom protocol of `scheme`.
7153
+ *
7154
+ * @deprecated
7036
7155
  */
7037
7156
  unregisterProtocol(scheme: string): boolean;
7038
7157
  }
@@ -7621,6 +7740,18 @@ declare namespace Electron {
7621
7740
  * of an existing `Session` object.
7622
7741
  */
7623
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;
7624
7755
  /**
7625
7756
  * A `Session` object, the default session object of the app.
7626
7757
  */
@@ -8090,6 +8221,34 @@ declare namespace Electron {
8090
8221
  * Emulates network with the given configuration for the `session`.
8091
8222
  */
8092
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>;
8093
8252
  /**
8094
8253
  * Writes any unwritten DOMStorage data to disk.
8095
8254
  */
@@ -8617,6 +8776,9 @@ declare namespace Electron {
8617
8776
 
8618
8777
  // Docs: https://electronjs.org/docs/api/system-preferences
8619
8778
 
8779
+ /**
8780
+ * @platform win32
8781
+ */
8620
8782
  on(event: 'accent-color-changed', listener: (event: Event,
8621
8783
  /**
8622
8784
  * The new RGBA color the user assigned to be their system accent color.
@@ -8637,6 +8799,9 @@ declare namespace Electron {
8637
8799
  * The new RGBA color the user assigned to be their system accent color.
8638
8800
  */
8639
8801
  newColor: string) => void): this;
8802
+ /**
8803
+ * @platform win32
8804
+ */
8640
8805
  on(event: 'color-changed', listener: (event: Event) => void): this;
8641
8806
  once(event: 'color-changed', listener: (event: Event) => void): this;
8642
8807
  addListener(event: 'color-changed', listener: (event: Event) => void): this;
@@ -9078,7 +9243,7 @@ declare namespace Electron {
9078
9243
 
9079
9244
  // Docs: https://electronjs.org/docs/api/structures/thumbar-button
9080
9245
 
9081
- click: Function;
9246
+ click: () => void;
9082
9247
  /**
9083
9248
  * Control specific states and behaviors of the button. By default, it is
9084
9249
  * `['enabled']`.
@@ -9988,15 +10153,16 @@ declare namespace Electron {
9988
10153
  /**
9989
10154
  * Number of bytes to read from `offset`. Defaults to `0`.
9990
10155
  */
9991
- length: number;
10156
+ length?: number;
9992
10157
  /**
9993
- * 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`.
9994
10160
  */
9995
- modificationTime: number;
10161
+ modificationTime?: number;
9996
10162
  /**
9997
10163
  * Defaults to `0`.
9998
10164
  */
9999
- offset: number;
10165
+ offset?: number;
10000
10166
  /**
10001
10167
  * `file`.
10002
10168
  */
@@ -10212,6 +10378,13 @@ declare namespace Electron {
10212
10378
  * `null`.
10213
10379
  */
10214
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;
10215
10388
  /**
10216
10389
  * Emitted before dispatching the `keydown` and `keyup` events in the page. Calling
10217
10390
  * `event.preventDefault` will prevent the page `keydown`/`keyup` events and the
@@ -10832,29 +11005,89 @@ declare namespace Electron {
10832
11005
  * This event cannot be prevented, if you want to prevent redirects you should
10833
11006
  * checkout out the `will-redirect` event above.
10834
11007
  */
10835
- on(event: 'did-redirect-navigation', listener: (event: Event,
11008
+ on(event: 'did-redirect-navigation', listener: (details: Event<WebContentsDidRedirectNavigationEventParams>,
11009
+ /**
11010
+ * @deprecated
11011
+ */
10836
11012
  url: string,
11013
+ /**
11014
+ * @deprecated
11015
+ */
10837
11016
  isInPlace: boolean,
11017
+ /**
11018
+ * @deprecated
11019
+ */
10838
11020
  isMainFrame: boolean,
11021
+ /**
11022
+ * @deprecated
11023
+ */
10839
11024
  frameProcessId: number,
11025
+ /**
11026
+ * @deprecated
11027
+ */
10840
11028
  frameRoutingId: number) => void): this;
10841
- once(event: 'did-redirect-navigation', listener: (event: Event,
11029
+ once(event: 'did-redirect-navigation', listener: (details: Event<WebContentsDidRedirectNavigationEventParams>,
11030
+ /**
11031
+ * @deprecated
11032
+ */
10842
11033
  url: string,
11034
+ /**
11035
+ * @deprecated
11036
+ */
10843
11037
  isInPlace: boolean,
11038
+ /**
11039
+ * @deprecated
11040
+ */
10844
11041
  isMainFrame: boolean,
11042
+ /**
11043
+ * @deprecated
11044
+ */
10845
11045
  frameProcessId: number,
11046
+ /**
11047
+ * @deprecated
11048
+ */
10846
11049
  frameRoutingId: number) => void): this;
10847
- addListener(event: 'did-redirect-navigation', listener: (event: Event,
11050
+ addListener(event: 'did-redirect-navigation', listener: (details: Event<WebContentsDidRedirectNavigationEventParams>,
11051
+ /**
11052
+ * @deprecated
11053
+ */
10848
11054
  url: string,
11055
+ /**
11056
+ * @deprecated
11057
+ */
10849
11058
  isInPlace: boolean,
11059
+ /**
11060
+ * @deprecated
11061
+ */
10850
11062
  isMainFrame: boolean,
11063
+ /**
11064
+ * @deprecated
11065
+ */
10851
11066
  frameProcessId: number,
11067
+ /**
11068
+ * @deprecated
11069
+ */
10852
11070
  frameRoutingId: number) => void): this;
10853
- removeListener(event: 'did-redirect-navigation', listener: (event: Event,
11071
+ removeListener(event: 'did-redirect-navigation', listener: (details: Event<WebContentsDidRedirectNavigationEventParams>,
11072
+ /**
11073
+ * @deprecated
11074
+ */
10854
11075
  url: string,
11076
+ /**
11077
+ * @deprecated
11078
+ */
10855
11079
  isInPlace: boolean,
11080
+ /**
11081
+ * @deprecated
11082
+ */
10856
11083
  isMainFrame: boolean,
11084
+ /**
11085
+ * @deprecated
11086
+ */
10857
11087
  frameProcessId: number,
11088
+ /**
11089
+ * @deprecated
11090
+ */
10858
11091
  frameRoutingId: number) => void): this;
10859
11092
  /**
10860
11093
  * Corresponds to the points in time when the spinner of the tab started spinning.
@@ -10864,32 +11097,91 @@ declare namespace Electron {
10864
11097
  addListener(event: 'did-start-loading', listener: Function): this;
10865
11098
  removeListener(event: 'did-start-loading', listener: Function): this;
10866
11099
  /**
10867
- * Emitted when any frame (including main) starts navigating. `isInPlace` will be
10868
- * `true` for in-page navigations.
11100
+ * Emitted when any frame (including main) starts navigating.
10869
11101
  */
10870
- on(event: 'did-start-navigation', listener: (event: Event,
11102
+ on(event: 'did-start-navigation', listener: (details: Event<WebContentsDidStartNavigationEventParams>,
11103
+ /**
11104
+ * @deprecated
11105
+ */
10871
11106
  url: string,
11107
+ /**
11108
+ * @deprecated
11109
+ */
10872
11110
  isInPlace: boolean,
11111
+ /**
11112
+ * @deprecated
11113
+ */
10873
11114
  isMainFrame: boolean,
11115
+ /**
11116
+ * @deprecated
11117
+ */
10874
11118
  frameProcessId: number,
11119
+ /**
11120
+ * @deprecated
11121
+ */
10875
11122
  frameRoutingId: number) => void): this;
10876
- once(event: 'did-start-navigation', listener: (event: Event,
11123
+ once(event: 'did-start-navigation', listener: (details: Event<WebContentsDidStartNavigationEventParams>,
11124
+ /**
11125
+ * @deprecated
11126
+ */
10877
11127
  url: string,
11128
+ /**
11129
+ * @deprecated
11130
+ */
10878
11131
  isInPlace: boolean,
11132
+ /**
11133
+ * @deprecated
11134
+ */
10879
11135
  isMainFrame: boolean,
11136
+ /**
11137
+ * @deprecated
11138
+ */
10880
11139
  frameProcessId: number,
11140
+ /**
11141
+ * @deprecated
11142
+ */
10881
11143
  frameRoutingId: number) => void): this;
10882
- addListener(event: 'did-start-navigation', listener: (event: Event,
11144
+ addListener(event: 'did-start-navigation', listener: (details: Event<WebContentsDidStartNavigationEventParams>,
11145
+ /**
11146
+ * @deprecated
11147
+ */
10883
11148
  url: string,
11149
+ /**
11150
+ * @deprecated
11151
+ */
10884
11152
  isInPlace: boolean,
11153
+ /**
11154
+ * @deprecated
11155
+ */
10885
11156
  isMainFrame: boolean,
11157
+ /**
11158
+ * @deprecated
11159
+ */
10886
11160
  frameProcessId: number,
11161
+ /**
11162
+ * @deprecated
11163
+ */
10887
11164
  frameRoutingId: number) => void): this;
10888
- removeListener(event: 'did-start-navigation', listener: (event: Event,
11165
+ removeListener(event: 'did-start-navigation', listener: (details: Event<WebContentsDidStartNavigationEventParams>,
11166
+ /**
11167
+ * @deprecated
11168
+ */
10889
11169
  url: string,
11170
+ /**
11171
+ * @deprecated
11172
+ */
10890
11173
  isInPlace: boolean,
11174
+ /**
11175
+ * @deprecated
11176
+ */
10891
11177
  isMainFrame: boolean,
11178
+ /**
11179
+ * @deprecated
11180
+ */
10892
11181
  frameProcessId: number,
11182
+ /**
11183
+ * @deprecated
11184
+ */
10893
11185
  frameRoutingId: number) => void): this;
10894
11186
  /**
10895
11187
  * Corresponds to the points in time when the spinner of the tab stopped spinning.
@@ -10970,16 +11262,16 @@ declare namespace Electron {
10970
11262
  * See also `webContents.ipc`, which provides an `IpcMain`-like interface for
10971
11263
  * responding to IPC messages specifically from this WebContents.
10972
11264
  */
10973
- on(event: 'ipc-message', listener: (event: Event,
11265
+ on(event: 'ipc-message', listener: (event: IpcMainEvent,
10974
11266
  channel: string,
10975
11267
  ...args: any[]) => void): this;
10976
- once(event: 'ipc-message', listener: (event: Event,
11268
+ once(event: 'ipc-message', listener: (event: IpcMainEvent,
10977
11269
  channel: string,
10978
11270
  ...args: any[]) => void): this;
10979
- addListener(event: 'ipc-message', listener: (event: Event,
11271
+ addListener(event: 'ipc-message', listener: (event: IpcMainEvent,
10980
11272
  channel: string,
10981
11273
  ...args: any[]) => void): this;
10982
- removeListener(event: 'ipc-message', listener: (event: Event,
11274
+ removeListener(event: 'ipc-message', listener: (event: IpcMainEvent,
10983
11275
  channel: string,
10984
11276
  ...args: any[]) => void): this;
10985
11277
  /**
@@ -10989,16 +11281,16 @@ declare namespace Electron {
10989
11281
  * See also `webContents.ipc`, which provides an `IpcMain`-like interface for
10990
11282
  * responding to IPC messages specifically from this WebContents.
10991
11283
  */
10992
- on(event: 'ipc-message-sync', listener: (event: Event,
11284
+ on(event: 'ipc-message-sync', listener: (event: IpcMainEvent,
10993
11285
  channel: string,
10994
11286
  ...args: any[]) => void): this;
10995
- once(event: 'ipc-message-sync', listener: (event: Event,
11287
+ once(event: 'ipc-message-sync', listener: (event: IpcMainEvent,
10996
11288
  channel: string,
10997
11289
  ...args: any[]) => void): this;
10998
- addListener(event: 'ipc-message-sync', listener: (event: Event,
11290
+ addListener(event: 'ipc-message-sync', listener: (event: IpcMainEvent,
10999
11291
  channel: string,
11000
11292
  ...args: any[]) => void): this;
11001
- removeListener(event: 'ipc-message-sync', listener: (event: Event,
11293
+ removeListener(event: 'ipc-message-sync', listener: (event: IpcMainEvent,
11002
11294
  channel: string,
11003
11295
  ...args: any[]) => void): this;
11004
11296
  /**
@@ -11309,8 +11601,13 @@ declare namespace Electron {
11309
11601
  */
11310
11602
  params: Record<string, string>) => void): this;
11311
11603
  /**
11312
- * Emitted when a user or the page wants to start navigation. It can happen when
11313
- * 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`.
11314
11611
  *
11315
11612
  * This event will not emit when the navigation is started programmatically with
11316
11613
  * APIs like `webContents.loadURL` and `webContents.back`.
@@ -11321,14 +11618,108 @@ declare namespace Electron {
11321
11618
  *
11322
11619
  * Calling `event.preventDefault()` will prevent the navigation.
11323
11620
  */
11324
- on(event: 'will-navigate', listener: (event: Event,
11325
- url: string) => void): this;
11326
- once(event: 'will-navigate', listener: (event: Event,
11327
- url: string) => void): this;
11328
- addListener(event: 'will-navigate', listener: (event: Event,
11329
- url: string) => void): this;
11330
- removeListener(event: 'will-navigate', listener: (event: Event,
11331
- url: string) => void): this;
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.
11629
+ *
11630
+ * This event will not emit when the navigation is started programmatically with
11631
+ * APIs like `webContents.loadURL` and `webContents.back`.
11632
+ *
11633
+ * It is also not emitted for in-page navigations, such as clicking anchor links or
11634
+ * updating the `window.location.hash`. Use `did-navigate-in-page` event for this
11635
+ * purpose.
11636
+ *
11637
+ * Calling `event.preventDefault()` will prevent the navigation.
11638
+ */
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;
11332
11723
  /**
11333
11724
  * Emitted when a `beforeunload` event handler is attempting to cancel a page
11334
11725
  * unload.
@@ -11354,29 +11745,89 @@ declare namespace Electron {
11354
11745
  * Calling `event.preventDefault()` will prevent the navigation (not just the
11355
11746
  * redirect).
11356
11747
  */
11357
- on(event: 'will-redirect', listener: (event: Event,
11748
+ on(event: 'will-redirect', listener: (details: Event<WebContentsWillRedirectEventParams>,
11749
+ /**
11750
+ * @deprecated
11751
+ */
11358
11752
  url: string,
11753
+ /**
11754
+ * @deprecated
11755
+ */
11359
11756
  isInPlace: boolean,
11757
+ /**
11758
+ * @deprecated
11759
+ */
11360
11760
  isMainFrame: boolean,
11761
+ /**
11762
+ * @deprecated
11763
+ */
11361
11764
  frameProcessId: number,
11765
+ /**
11766
+ * @deprecated
11767
+ */
11362
11768
  frameRoutingId: number) => void): this;
11363
- once(event: 'will-redirect', listener: (event: Event,
11769
+ once(event: 'will-redirect', listener: (details: Event<WebContentsWillRedirectEventParams>,
11770
+ /**
11771
+ * @deprecated
11772
+ */
11364
11773
  url: string,
11774
+ /**
11775
+ * @deprecated
11776
+ */
11365
11777
  isInPlace: boolean,
11778
+ /**
11779
+ * @deprecated
11780
+ */
11366
11781
  isMainFrame: boolean,
11782
+ /**
11783
+ * @deprecated
11784
+ */
11367
11785
  frameProcessId: number,
11786
+ /**
11787
+ * @deprecated
11788
+ */
11368
11789
  frameRoutingId: number) => void): this;
11369
- addListener(event: 'will-redirect', listener: (event: Event,
11790
+ addListener(event: 'will-redirect', listener: (details: Event<WebContentsWillRedirectEventParams>,
11791
+ /**
11792
+ * @deprecated
11793
+ */
11370
11794
  url: string,
11795
+ /**
11796
+ * @deprecated
11797
+ */
11371
11798
  isInPlace: boolean,
11799
+ /**
11800
+ * @deprecated
11801
+ */
11372
11802
  isMainFrame: boolean,
11803
+ /**
11804
+ * @deprecated
11805
+ */
11373
11806
  frameProcessId: number,
11807
+ /**
11808
+ * @deprecated
11809
+ */
11374
11810
  frameRoutingId: number) => void): this;
11375
- removeListener(event: 'will-redirect', listener: (event: Event,
11811
+ removeListener(event: 'will-redirect', listener: (details: Event<WebContentsWillRedirectEventParams>,
11812
+ /**
11813
+ * @deprecated
11814
+ */
11376
11815
  url: string,
11816
+ /**
11817
+ * @deprecated
11818
+ */
11377
11819
  isInPlace: boolean,
11820
+ /**
11821
+ * @deprecated
11822
+ */
11378
11823
  isMainFrame: boolean,
11824
+ /**
11825
+ * @deprecated
11826
+ */
11379
11827
  frameProcessId: number,
11828
+ /**
11829
+ * @deprecated
11830
+ */
11380
11831
  frameRoutingId: number) => void): this;
11381
11832
  /**
11382
11833
  * Emitted when the user is requesting to change the zoom level using the mouse
@@ -12126,7 +12577,7 @@ declare namespace Electron {
12126
12577
  zoomLevel: number;
12127
12578
  }
12128
12579
 
12129
- interface WebFrame extends NodeJS.EventEmitter {
12580
+ interface WebFrame {
12130
12581
 
12131
12582
  // Docs: https://electronjs.org/docs/api/web-frame
12132
12583
 
@@ -12630,8 +13081,8 @@ declare namespace Electron {
12630
13081
  * Fired when the navigation is done, i.e. the spinner of the tab will stop
12631
13082
  * spinning, and the `onload` event is dispatched.
12632
13083
  */
12633
- addEventListener(event: 'did-finish-load', listener: (event: Event) => void, useCapture?: boolean): this;
12634
- 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;
12635
13086
  /**
12636
13087
  * This event is like `did-finish-load`, but fired when the load failed or was
12637
13088
  * cancelled, e.g. `window.stop()` is invoked.
@@ -12646,23 +13097,23 @@ declare namespace Electron {
12646
13097
  /**
12647
13098
  * Corresponds to the points in time when the spinner of the tab starts spinning.
12648
13099
  */
12649
- addEventListener(event: 'did-start-loading', listener: (event: Event) => void, useCapture?: boolean): this;
12650
- 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;
12651
13102
  /**
12652
13103
  * Corresponds to the points in time when the spinner of the tab stops spinning.
12653
13104
  */
12654
- addEventListener(event: 'did-stop-loading', listener: (event: Event) => void, useCapture?: boolean): this;
12655
- 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;
12656
13107
  /**
12657
13108
  * Fired when attached to the embedder web contents.
12658
13109
  */
12659
- addEventListener(event: 'did-attach', listener: (event: Event) => void, useCapture?: boolean): this;
12660
- 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;
12661
13112
  /**
12662
13113
  * Fired when document in the given frame is loaded.
12663
13114
  */
12664
- addEventListener(event: 'dom-ready', listener: (event: Event) => void, useCapture?: boolean): this;
12665
- 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;
12666
13117
  /**
12667
13118
  * Fired when page title is set during navigation. `explicitSet` is false when
12668
13119
  * title is synthesized from file url.
@@ -12677,13 +13128,13 @@ declare namespace Electron {
12677
13128
  /**
12678
13129
  * Fired when page enters fullscreen triggered by HTML API.
12679
13130
  */
12680
- addEventListener(event: 'enter-html-full-screen', listener: (event: Event) => void, useCapture?: boolean): this;
12681
- 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;
12682
13133
  /**
12683
13134
  * Fired when page leaves fullscreen triggered by HTML API.
12684
13135
  */
12685
- addEventListener(event: 'leave-html-full-screen', listener: (event: Event) => void, useCapture?: boolean): this;
12686
- 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;
12687
13138
  /**
12688
13139
  * Fired when the guest window logs a console message.
12689
13140
  *
@@ -12712,6 +13163,22 @@ declare namespace Electron {
12712
13163
  */
12713
13164
  addEventListener(event: 'will-navigate', listener: (event: WillNavigateEvent) => void, useCapture?: boolean): this;
12714
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;
12715
13182
  /**
12716
13183
  * Emitted when any frame (including main) starts navigating. `isInPlace` will be
12717
13184
  * `true` for in-page navigations.
@@ -12757,8 +13224,8 @@ declare namespace Electron {
12757
13224
  * The following example code navigates the `webview` to `about:blank` when the
12758
13225
  * guest attempts to close itself.
12759
13226
  */
12760
- addEventListener(event: 'close', listener: (event: Event) => void, useCapture?: boolean): this;
12761
- 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;
12762
13229
  /**
12763
13230
  * Fired when the guest page has sent an asynchronous message to embedder page.
12764
13231
  *
@@ -12770,8 +13237,8 @@ declare namespace Electron {
12770
13237
  /**
12771
13238
  * Fired when the renderer process is crashed.
12772
13239
  */
12773
- addEventListener(event: 'crashed', listener: (event: Event) => void, useCapture?: boolean): this;
12774
- 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;
12775
13242
  /**
12776
13243
  * Fired when a plugin process is crashed.
12777
13244
  */
@@ -12780,18 +13247,18 @@ declare namespace Electron {
12780
13247
  /**
12781
13248
  * Fired when the WebContents is destroyed.
12782
13249
  */
12783
- addEventListener(event: 'destroyed', listener: (event: Event) => void, useCapture?: boolean): this;
12784
- 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;
12785
13252
  /**
12786
13253
  * Emitted when media starts playing.
12787
13254
  */
12788
- addEventListener(event: 'media-started-playing', listener: (event: Event) => void, useCapture?: boolean): this;
12789
- 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;
12790
13257
  /**
12791
13258
  * Emitted when media is paused or done playing.
12792
13259
  */
12793
- addEventListener(event: 'media-paused', listener: (event: Event) => void, useCapture?: boolean): this;
12794
- 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;
12795
13262
  /**
12796
13263
  * Emitted when a page's theme color changes. This is usually due to encountering a
12797
13264
  * meta tag:
@@ -12812,18 +13279,18 @@ declare namespace Electron {
12812
13279
  /**
12813
13280
  * Emitted when DevTools is opened.
12814
13281
  */
12815
- addEventListener(event: 'devtools-opened', listener: (event: Event) => void, useCapture?: boolean): this;
12816
- 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;
12817
13284
  /**
12818
13285
  * Emitted when DevTools is closed.
12819
13286
  */
12820
- addEventListener(event: 'devtools-closed', listener: (event: Event) => void, useCapture?: boolean): this;
12821
- 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;
12822
13289
  /**
12823
13290
  * Emitted when DevTools is focused / opened.
12824
13291
  */
12825
- addEventListener(event: 'devtools-focused', listener: (event: Event) => void, useCapture?: boolean): this;
12826
- 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;
12827
13294
  /**
12828
13295
  * Emitted when there is a new context menu that needs to be handled.
12829
13296
  */
@@ -13794,15 +14261,16 @@ declare namespace Electron {
13794
14261
  */
13795
14262
  partition?: string;
13796
14263
  /**
13797
- * Can be `include` or `omit`. Whether to send credentials with this request. If
13798
- * set to `include`, credentials from the session associated with the request will
13799
- * be used. If set to `omit`, credentials will not be sent with the request (and
13800
- * the `'login'` event will not be triggered in the event of a 401). This matches
13801
- * the behavior of the fetch option of the same name. If this option is not
13802
- * specified, authentication data from the session will be sent, and cookies will
13803
- * 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).
13804
14272
  */
13805
- credentials?: ('include' | 'omit');
14273
+ credentials?: ('include' | 'omit' | 'same-origin');
13806
14274
  /**
13807
14275
  * Whether to send cookies with this request from the provided session. If
13808
14276
  * `credentials` is specified, this option has no effect. Default is `false`.
@@ -13841,6 +14309,18 @@ declare namespace Electron {
13841
14309
  * The origin URL of the request.
13842
14310
  */
13843
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');
13844
14324
  }
13845
14325
 
13846
14326
  interface CloseOpts {
@@ -13906,7 +14386,7 @@ declare namespace Electron {
13906
14386
  enableAdditionalDnsQueryTypes?: boolean;
13907
14387
  }
13908
14388
 
13909
- interface ConsoleMessageEvent extends Event {
14389
+ interface ConsoleMessageEvent extends DOMEvent {
13910
14390
  /**
13911
14391
  * The log level, from 0 to 3. In order it matches `verbose`, `info`, `warning` and
13912
14392
  * `error`.
@@ -13923,7 +14403,7 @@ declare namespace Electron {
13923
14403
  sourceId: string;
13924
14404
  }
13925
14405
 
13926
- interface ContextMenuEvent extends Event {
14406
+ interface ContextMenuEvent extends DOMEvent {
13927
14407
  params: Params;
13928
14408
  }
13929
14409
 
@@ -14293,14 +14773,14 @@ declare namespace Electron {
14293
14773
  device: (HIDDevice) | (SerialPort);
14294
14774
  }
14295
14775
 
14296
- interface DevtoolsOpenUrlEvent extends Event {
14776
+ interface DevtoolsOpenUrlEvent extends DOMEvent {
14297
14777
  /**
14298
14778
  * URL of the link that was clicked or selected.
14299
14779
  */
14300
14780
  url: string;
14301
14781
  }
14302
14782
 
14303
- interface DidChangeThemeColorEvent extends Event {
14783
+ interface DidChangeThemeColorEvent extends DOMEvent {
14304
14784
  themeColor: string;
14305
14785
  }
14306
14786
 
@@ -14338,18 +14818,18 @@ declare namespace Electron {
14338
14818
  disposition: ('default' | 'foreground-tab' | 'background-tab' | 'new-window' | 'other');
14339
14819
  }
14340
14820
 
14341
- interface DidFailLoadEvent extends Event {
14821
+ interface DidFailLoadEvent extends DOMEvent {
14342
14822
  errorCode: number;
14343
14823
  errorDescription: string;
14344
14824
  validatedURL: string;
14345
14825
  isMainFrame: boolean;
14346
14826
  }
14347
14827
 
14348
- interface DidFrameFinishLoadEvent extends Event {
14828
+ interface DidFrameFinishLoadEvent extends DOMEvent {
14349
14829
  isMainFrame: boolean;
14350
14830
  }
14351
14831
 
14352
- interface DidFrameNavigateEvent extends Event {
14832
+ interface DidFrameNavigateEvent extends DOMEvent {
14353
14833
  url: string;
14354
14834
  /**
14355
14835
  * -1 for non HTTP navigations
@@ -14364,16 +14844,16 @@ declare namespace Electron {
14364
14844
  frameRoutingId: number;
14365
14845
  }
14366
14846
 
14367
- interface DidNavigateEvent extends Event {
14847
+ interface DidNavigateEvent extends DOMEvent {
14368
14848
  url: string;
14369
14849
  }
14370
14850
 
14371
- interface DidNavigateInPageEvent extends Event {
14851
+ interface DidNavigateInPageEvent extends DOMEvent {
14372
14852
  isMainFrame: boolean;
14373
14853
  url: string;
14374
14854
  }
14375
14855
 
14376
- interface DidRedirectNavigationEvent extends Event {
14856
+ interface DidRedirectNavigationEvent extends DOMEvent {
14377
14857
  url: string;
14378
14858
  isInPlace: boolean;
14379
14859
  isMainFrame: boolean;
@@ -14381,7 +14861,7 @@ declare namespace Electron {
14381
14861
  frameRoutingId: number;
14382
14862
  }
14383
14863
 
14384
- interface DidStartNavigationEvent extends Event {
14864
+ interface DidStartNavigationEvent extends DOMEvent {
14385
14865
  url: string;
14386
14866
  isInPlace: boolean;
14387
14867
  isMainFrame: boolean;
@@ -14544,7 +15024,7 @@ declare namespace Electron {
14544
15024
  allowLoadingUnsignedLibraries?: boolean;
14545
15025
  }
14546
15026
 
14547
- interface FoundInPageEvent extends Event {
15027
+ interface FoundInPageEvent extends DOMEvent {
14548
15028
  result: FoundInPageResult;
14549
15029
  }
14550
15030
 
@@ -14559,6 +15039,13 @@ declare namespace Electron {
14559
15039
  cache: boolean;
14560
15040
  }
14561
15041
 
15042
+ interface FromPathOptions {
15043
+ /**
15044
+ * Whether to enable cache.
15045
+ */
15046
+ cache: boolean;
15047
+ }
15048
+
14562
15049
  interface HandlerDetails {
14563
15050
  /**
14564
15051
  * The _resolved_ version of the URL passed to `window.open()`. e.g. opening a
@@ -14727,7 +15214,7 @@ declare namespace Electron {
14727
15214
  cssOrigin?: string;
14728
15215
  }
14729
15216
 
14730
- interface IpcMessageEvent extends Event {
15217
+ interface IpcMessageEvent extends DOMEvent {
14731
15218
  /**
14732
15219
  * pair of `[processId, frameId]`.
14733
15220
  */
@@ -14767,7 +15254,7 @@ declare namespace Electron {
14767
15254
  removedItems: JumpListItem[];
14768
15255
  }
14769
15256
 
14770
- interface LoadCommitEvent extends Event {
15257
+ interface LoadCommitEvent extends DOMEvent {
14771
15258
  url: string;
14772
15259
  isMainFrame: boolean;
14773
15260
  }
@@ -15544,14 +16031,14 @@ declare namespace Electron {
15544
16031
  stayAwake?: boolean;
15545
16032
  }
15546
16033
 
15547
- interface PageFaviconUpdatedEvent extends Event {
16034
+ interface PageFaviconUpdatedEvent extends DOMEvent {
15548
16035
  /**
15549
16036
  * Array of URLs.
15550
16037
  */
15551
16038
  favicons: string[];
15552
16039
  }
15553
16040
 
15554
- interface PageTitleUpdatedEvent extends Event {
16041
+ interface PageTitleUpdatedEvent extends DOMEvent {
15555
16042
  title: string;
15556
16043
  explicitSet: boolean;
15557
16044
  }
@@ -15653,7 +16140,7 @@ declare namespace Electron {
15653
16140
  isMainFrame: boolean;
15654
16141
  }
15655
16142
 
15656
- interface PluginCrashedEvent extends Event {
16143
+ interface PluginCrashedEvent extends DOMEvent {
15657
16144
  name: string;
15658
16145
  version: string;
15659
16146
  }
@@ -16449,7 +16936,7 @@ declare namespace Electron {
16449
16936
  percentage: number;
16450
16937
  }
16451
16938
 
16452
- interface UpdateTargetUrlEvent extends Event {
16939
+ interface UpdateTargetUrlEvent extends DOMEvent {
16453
16940
  url: string;
16454
16941
  }
16455
16942
 
@@ -16511,6 +16998,69 @@ declare namespace Electron {
16511
16998
  skipTransformProcessType?: boolean;
16512
16999
  }
16513
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
+
16514
17064
  interface WebContentsPrintOptions {
16515
17065
  /**
16516
17066
  * Don't ask user for print settings. Default is `false`.
@@ -16577,6 +17127,84 @@ declare namespace Electron {
16577
17127
  pageSize?: (string) | (Size);
16578
17128
  }
16579
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
+
16580
17208
  interface WebviewTagPrintOptions {
16581
17209
  /**
16582
17210
  * Don't ask user for print settings. Default is `false`.
@@ -16642,7 +17270,14 @@ declare namespace Electron {
16642
17270
  pageSize?: (string) | (Size);
16643
17271
  }
16644
17272
 
16645
- 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 {
16646
17281
  url: string;
16647
17282
  }
16648
17283
 
@@ -17283,6 +17918,7 @@ declare namespace Electron {
17283
17918
 
17284
17919
 
17285
17920
  namespace Common {
17921
+ type Event<Params extends object = {}> = Electron.Event<Params>;
17286
17922
  const clipboard: Clipboard;
17287
17923
  type Clipboard = Electron.Clipboard;
17288
17924
  const crashReporter: CrashReporter;
@@ -17347,6 +17983,7 @@ declare namespace Electron {
17347
17983
  type FoundInPageEvent = Electron.FoundInPageEvent;
17348
17984
  type FrameCreatedDetails = Electron.FrameCreatedDetails;
17349
17985
  type FromPartitionOptions = Electron.FromPartitionOptions;
17986
+ type FromPathOptions = Electron.FromPathOptions;
17350
17987
  type HandlerDetails = Electron.HandlerDetails;
17351
17988
  type HeadersReceivedResponse = Electron.HeadersReceivedResponse;
17352
17989
  type HeapStatistics = Electron.HeapStatistics;
@@ -17448,8 +18085,15 @@ declare namespace Electron {
17448
18085
  type UsbDeviceRemovedDetails = Electron.UsbDeviceRemovedDetails;
17449
18086
  type UsbDeviceRevokedDetails = Electron.UsbDeviceRevokedDetails;
17450
18087
  type VisibleOnAllWorkspacesOptions = Electron.VisibleOnAllWorkspacesOptions;
18088
+ type WebContentsAudioStateChangedEventParams = Electron.WebContentsAudioStateChangedEventParams;
18089
+ type WebContentsDidRedirectNavigationEventParams = Electron.WebContentsDidRedirectNavigationEventParams;
18090
+ type WebContentsDidStartNavigationEventParams = Electron.WebContentsDidStartNavigationEventParams;
17451
18091
  type WebContentsPrintOptions = Electron.WebContentsPrintOptions;
18092
+ type WebContentsWillFrameNavigateEventParams = Electron.WebContentsWillFrameNavigateEventParams;
18093
+ type WebContentsWillNavigateEventParams = Electron.WebContentsWillNavigateEventParams;
18094
+ type WebContentsWillRedirectEventParams = Electron.WebContentsWillRedirectEventParams;
17452
18095
  type WebviewTagPrintOptions = Electron.WebviewTagPrintOptions;
18096
+ type WillFrameNavigateEvent = Electron.WillFrameNavigateEvent;
17453
18097
  type WillNavigateEvent = Electron.WillNavigateEvent;
17454
18098
  type WillResizeDetails = Electron.WillResizeDetails;
17455
18099
  type EditFlags = Electron.EditFlags;
@@ -17473,7 +18117,6 @@ declare namespace Electron {
17473
18117
  type CustomScheme = Electron.CustomScheme;
17474
18118
  type DesktopCapturerSource = Electron.DesktopCapturerSource;
17475
18119
  type Display = Electron.Display;
17476
- type Event = Electron.Event;
17477
18120
  type Extension = Electron.Extension;
17478
18121
  type ExtensionInfo = Electron.ExtensionInfo;
17479
18122
  type FileFilter = Electron.FileFilter;
@@ -17535,6 +18178,7 @@ declare namespace Electron {
17535
18178
  }
17536
18179
 
17537
18180
  namespace Main {
18181
+ type Event<Params extends object = {}> = Electron.Event<Params>;
17538
18182
  const app: App;
17539
18183
  type App = Electron.App;
17540
18184
  const autoUpdater: AutoUpdater;
@@ -17664,6 +18308,7 @@ declare namespace Electron {
17664
18308
  type FoundInPageEvent = Electron.FoundInPageEvent;
17665
18309
  type FrameCreatedDetails = Electron.FrameCreatedDetails;
17666
18310
  type FromPartitionOptions = Electron.FromPartitionOptions;
18311
+ type FromPathOptions = Electron.FromPathOptions;
17667
18312
  type HandlerDetails = Electron.HandlerDetails;
17668
18313
  type HeadersReceivedResponse = Electron.HeadersReceivedResponse;
17669
18314
  type HeapStatistics = Electron.HeapStatistics;
@@ -17765,8 +18410,15 @@ declare namespace Electron {
17765
18410
  type UsbDeviceRemovedDetails = Electron.UsbDeviceRemovedDetails;
17766
18411
  type UsbDeviceRevokedDetails = Electron.UsbDeviceRevokedDetails;
17767
18412
  type VisibleOnAllWorkspacesOptions = Electron.VisibleOnAllWorkspacesOptions;
18413
+ type WebContentsAudioStateChangedEventParams = Electron.WebContentsAudioStateChangedEventParams;
18414
+ type WebContentsDidRedirectNavigationEventParams = Electron.WebContentsDidRedirectNavigationEventParams;
18415
+ type WebContentsDidStartNavigationEventParams = Electron.WebContentsDidStartNavigationEventParams;
17768
18416
  type WebContentsPrintOptions = Electron.WebContentsPrintOptions;
18417
+ type WebContentsWillFrameNavigateEventParams = Electron.WebContentsWillFrameNavigateEventParams;
18418
+ type WebContentsWillNavigateEventParams = Electron.WebContentsWillNavigateEventParams;
18419
+ type WebContentsWillRedirectEventParams = Electron.WebContentsWillRedirectEventParams;
17769
18420
  type WebviewTagPrintOptions = Electron.WebviewTagPrintOptions;
18421
+ type WillFrameNavigateEvent = Electron.WillFrameNavigateEvent;
17770
18422
  type WillNavigateEvent = Electron.WillNavigateEvent;
17771
18423
  type WillResizeDetails = Electron.WillResizeDetails;
17772
18424
  type EditFlags = Electron.EditFlags;
@@ -17790,7 +18442,6 @@ declare namespace Electron {
17790
18442
  type CustomScheme = Electron.CustomScheme;
17791
18443
  type DesktopCapturerSource = Electron.DesktopCapturerSource;
17792
18444
  type Display = Electron.Display;
17793
- type Event = Electron.Event;
17794
18445
  type Extension = Electron.Extension;
17795
18446
  type ExtensionInfo = Electron.ExtensionInfo;
17796
18447
  type FileFilter = Electron.FileFilter;
@@ -17852,12 +18503,14 @@ declare namespace Electron {
17852
18503
  }
17853
18504
 
17854
18505
  namespace Renderer {
18506
+ type Event<Params extends object = {}> = Electron.Event<Params>;
17855
18507
  const contextBridge: ContextBridge;
17856
18508
  type ContextBridge = Electron.ContextBridge;
17857
18509
  const ipcRenderer: IpcRenderer;
17858
18510
  type IpcRenderer = Electron.IpcRenderer;
17859
18511
  const webFrame: WebFrame;
17860
18512
  type WebFrame = Electron.WebFrame;
18513
+ type WebviewTag = Electron.WebviewTag;
17861
18514
  type AboutPanelOptionsOptions = Electron.AboutPanelOptionsOptions;
17862
18515
  type AddRepresentationOptions = Electron.AddRepresentationOptions;
17863
18516
  type AnimationSettings = Electron.AnimationSettings;
@@ -17914,6 +18567,7 @@ declare namespace Electron {
17914
18567
  type FoundInPageEvent = Electron.FoundInPageEvent;
17915
18568
  type FrameCreatedDetails = Electron.FrameCreatedDetails;
17916
18569
  type FromPartitionOptions = Electron.FromPartitionOptions;
18570
+ type FromPathOptions = Electron.FromPathOptions;
17917
18571
  type HandlerDetails = Electron.HandlerDetails;
17918
18572
  type HeadersReceivedResponse = Electron.HeadersReceivedResponse;
17919
18573
  type HeapStatistics = Electron.HeapStatistics;
@@ -18015,8 +18669,15 @@ declare namespace Electron {
18015
18669
  type UsbDeviceRemovedDetails = Electron.UsbDeviceRemovedDetails;
18016
18670
  type UsbDeviceRevokedDetails = Electron.UsbDeviceRevokedDetails;
18017
18671
  type VisibleOnAllWorkspacesOptions = Electron.VisibleOnAllWorkspacesOptions;
18672
+ type WebContentsAudioStateChangedEventParams = Electron.WebContentsAudioStateChangedEventParams;
18673
+ type WebContentsDidRedirectNavigationEventParams = Electron.WebContentsDidRedirectNavigationEventParams;
18674
+ type WebContentsDidStartNavigationEventParams = Electron.WebContentsDidStartNavigationEventParams;
18018
18675
  type WebContentsPrintOptions = Electron.WebContentsPrintOptions;
18676
+ type WebContentsWillFrameNavigateEventParams = Electron.WebContentsWillFrameNavigateEventParams;
18677
+ type WebContentsWillNavigateEventParams = Electron.WebContentsWillNavigateEventParams;
18678
+ type WebContentsWillRedirectEventParams = Electron.WebContentsWillRedirectEventParams;
18019
18679
  type WebviewTagPrintOptions = Electron.WebviewTagPrintOptions;
18680
+ type WillFrameNavigateEvent = Electron.WillFrameNavigateEvent;
18020
18681
  type WillNavigateEvent = Electron.WillNavigateEvent;
18021
18682
  type WillResizeDetails = Electron.WillResizeDetails;
18022
18683
  type EditFlags = Electron.EditFlags;
@@ -18040,7 +18701,6 @@ declare namespace Electron {
18040
18701
  type CustomScheme = Electron.CustomScheme;
18041
18702
  type DesktopCapturerSource = Electron.DesktopCapturerSource;
18042
18703
  type Display = Electron.Display;
18043
- type Event = Electron.Event;
18044
18704
  type Extension = Electron.Extension;
18045
18705
  type ExtensionInfo = Electron.ExtensionInfo;
18046
18706
  type FileFilter = Electron.FileFilter;
@@ -18102,6 +18762,7 @@ declare namespace Electron {
18102
18762
  }
18103
18763
 
18104
18764
  namespace CrossProcessExports {
18765
+ type Event<Params extends object = {}> = Electron.Event<Params>;
18105
18766
  const app: App;
18106
18767
  type App = Electron.App;
18107
18768
  const autoUpdater: AutoUpdater;
@@ -18189,6 +18850,7 @@ declare namespace Electron {
18189
18850
  const webFrameMain: typeof WebFrameMain;
18190
18851
  type WebFrameMain = Electron.WebFrameMain;
18191
18852
  type WebRequest = Electron.WebRequest;
18853
+ type WebviewTag = Electron.WebviewTag;
18192
18854
  type AboutPanelOptionsOptions = Electron.AboutPanelOptionsOptions;
18193
18855
  type AddRepresentationOptions = Electron.AddRepresentationOptions;
18194
18856
  type AnimationSettings = Electron.AnimationSettings;
@@ -18245,6 +18907,7 @@ declare namespace Electron {
18245
18907
  type FoundInPageEvent = Electron.FoundInPageEvent;
18246
18908
  type FrameCreatedDetails = Electron.FrameCreatedDetails;
18247
18909
  type FromPartitionOptions = Electron.FromPartitionOptions;
18910
+ type FromPathOptions = Electron.FromPathOptions;
18248
18911
  type HandlerDetails = Electron.HandlerDetails;
18249
18912
  type HeadersReceivedResponse = Electron.HeadersReceivedResponse;
18250
18913
  type HeapStatistics = Electron.HeapStatistics;
@@ -18346,8 +19009,15 @@ declare namespace Electron {
18346
19009
  type UsbDeviceRemovedDetails = Electron.UsbDeviceRemovedDetails;
18347
19010
  type UsbDeviceRevokedDetails = Electron.UsbDeviceRevokedDetails;
18348
19011
  type VisibleOnAllWorkspacesOptions = Electron.VisibleOnAllWorkspacesOptions;
19012
+ type WebContentsAudioStateChangedEventParams = Electron.WebContentsAudioStateChangedEventParams;
19013
+ type WebContentsDidRedirectNavigationEventParams = Electron.WebContentsDidRedirectNavigationEventParams;
19014
+ type WebContentsDidStartNavigationEventParams = Electron.WebContentsDidStartNavigationEventParams;
18349
19015
  type WebContentsPrintOptions = Electron.WebContentsPrintOptions;
19016
+ type WebContentsWillFrameNavigateEventParams = Electron.WebContentsWillFrameNavigateEventParams;
19017
+ type WebContentsWillNavigateEventParams = Electron.WebContentsWillNavigateEventParams;
19018
+ type WebContentsWillRedirectEventParams = Electron.WebContentsWillRedirectEventParams;
18350
19019
  type WebviewTagPrintOptions = Electron.WebviewTagPrintOptions;
19020
+ type WillFrameNavigateEvent = Electron.WillFrameNavigateEvent;
18351
19021
  type WillNavigateEvent = Electron.WillNavigateEvent;
18352
19022
  type WillResizeDetails = Electron.WillResizeDetails;
18353
19023
  type EditFlags = Electron.EditFlags;
@@ -18371,7 +19041,6 @@ declare namespace Electron {
18371
19041
  type CustomScheme = Electron.CustomScheme;
18372
19042
  type DesktopCapturerSource = Electron.DesktopCapturerSource;
18373
19043
  type Display = Electron.Display;
18374
- type Event = Electron.Event;
18375
19044
  type Extension = Electron.Extension;
18376
19045
  type ExtensionInfo = Electron.ExtensionInfo;
18377
19046
  type FileFilter = Electron.FileFilter;
@@ -18562,6 +19231,9 @@ declare namespace NodeJS {
18562
19231
  * in Kilobytes.
18563
19232
  */
18564
19233
  getHeapStatistics(): Electron.HeapStatistics;
19234
+ /**
19235
+ * @platform win32,linux
19236
+ */
18565
19237
  getIOCounters(): Electron.IOCounters;
18566
19238
  /**
18567
19239
  * Resolves with a ProcessMemoryInfo
@@ -18637,8 +19309,11 @@ declare namespace NodeJS {
18637
19309
  */
18638
19310
  readonly contextIsolated: boolean;
18639
19311
  /**
18640
- * A `boolean`. When app is started by being passed as parameter to the default
18641
- * 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`.
18642
19317
  *
18643
19318
  */
18644
19319
  readonly defaultApp: boolean;