electron-types 40.2.1 → 40.4.0
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.
- package/README.md +3 -3
- package/dist/electron.d.ts +47 -34
- package/dist/version.json +2 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -11,11 +11,11 @@ The official `electron` package is ~200MB because it includes the Electron binar
|
|
|
11
11
|
Since this package only provides TypeScript types, install it as a dev dependency. **Install the version that matches your Electron version** (see [Version Matching](#version-matching)):
|
|
12
12
|
|
|
13
13
|
```bash
|
|
14
|
-
npm install -D electron-types@40.
|
|
14
|
+
npm install -D electron-types@40.4.0
|
|
15
15
|
# or
|
|
16
|
-
yarn add -D electron-types@40.
|
|
16
|
+
yarn add -D electron-types@40.4.0
|
|
17
17
|
# or
|
|
18
|
-
pnpm add -D electron-types@40.
|
|
18
|
+
pnpm add -D electron-types@40.4.0
|
|
19
19
|
```
|
|
20
20
|
|
|
21
21
|
## Usage
|
package/dist/electron.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Type definitions for Electron 40.
|
|
1
|
+
// Type definitions for Electron 40.4.0
|
|
2
2
|
// Project: http://electronjs.org/
|
|
3
3
|
// Definitions by: The Electron Team <https://github.com/electron/electron>
|
|
4
4
|
// Definitions: https://github.com/electron/typescript-definitions
|
|
@@ -1014,7 +1014,7 @@ declare namespace Electron {
|
|
|
1014
1014
|
configureHostResolver(options: ConfigureHostResolverOptions): void;
|
|
1015
1015
|
/**
|
|
1016
1016
|
* By default, Chromium disables 3D APIs (e.g. WebGL) until restart on a per domain
|
|
1017
|
-
* basis if the GPU
|
|
1017
|
+
* basis if the GPU process crashes too frequently. This function disables that
|
|
1018
1018
|
* behavior.
|
|
1019
1019
|
*
|
|
1020
1020
|
* This method can only be called before app is ready.
|
|
@@ -1122,7 +1122,7 @@ declare namespace Electron {
|
|
|
1122
1122
|
*
|
|
1123
1123
|
* Fetches a path's associated icon.
|
|
1124
1124
|
*
|
|
1125
|
-
* On _Windows_, there
|
|
1125
|
+
* On _Windows_, there are 2 kinds of icons:
|
|
1126
1126
|
*
|
|
1127
1127
|
* * Icons associated with certain file extensions, like `.mp3`, `.png`, etc.
|
|
1128
1128
|
* * Icons inside the file itself, like `.exe`, `.dll`, `.ico`.
|
|
@@ -1242,7 +1242,7 @@ declare namespace Electron {
|
|
|
1242
1242
|
* A path to a special directory or file associated with `name`. On failure, an
|
|
1243
1243
|
* `Error` is thrown.
|
|
1244
1244
|
*
|
|
1245
|
-
* If `app.getPath('logs')` is called without
|
|
1245
|
+
* If `app.getPath('logs')` is called without calling `app.setAppLogsPath()` being
|
|
1246
1246
|
* called first, a default log directory will be created equivalent to calling
|
|
1247
1247
|
* `app.setAppLogsPath()` without a `path` parameter.
|
|
1248
1248
|
*/
|
|
@@ -1278,7 +1278,7 @@ declare namespace Electron {
|
|
|
1278
1278
|
* preferred system language has no country code, and that one of the preferred
|
|
1279
1279
|
* system languages corresponds with the language used for the regional format. On
|
|
1280
1280
|
* macOS, the region serves more as a default country code: the user doesn't need
|
|
1281
|
-
* to have Finnish as a preferred language to use Finland as the region,and the
|
|
1281
|
+
* to have Finnish as a preferred language to use Finland as the region, and the
|
|
1282
1282
|
* country code `FI` is used as the country code for preferred system languages
|
|
1283
1283
|
* that do not have associated countries in the language name.
|
|
1284
1284
|
*/
|
|
@@ -2928,7 +2928,7 @@ declare namespace Electron {
|
|
|
2928
2928
|
* hiding titlebar buttons.
|
|
2929
2929
|
*
|
|
2930
2930
|
* This API returns whether the window is in tablet mode, and the `resize` event
|
|
2931
|
-
* can be
|
|
2931
|
+
* can be used to listen to changes to tablet mode.
|
|
2932
2932
|
*
|
|
2933
2933
|
* @platform win32
|
|
2934
2934
|
*/
|
|
@@ -5637,7 +5637,7 @@ declare namespace Electron {
|
|
|
5637
5637
|
* hiding titlebar buttons.
|
|
5638
5638
|
*
|
|
5639
5639
|
* This API returns whether the window is in tablet mode, and the `resize` event
|
|
5640
|
-
* can be
|
|
5640
|
+
* can be used to listen to changes to tablet mode.
|
|
5641
5641
|
*
|
|
5642
5642
|
* @platform win32
|
|
5643
5643
|
*/
|
|
@@ -6674,7 +6674,7 @@ declare namespace Electron {
|
|
|
6674
6674
|
* Cancels an ongoing HTTP transaction. If the request has already emitted the
|
|
6675
6675
|
* `close` event, the abort operation will have no effect. Otherwise an ongoing
|
|
6676
6676
|
* event will emit `abort` and `close` events. Additionally, if there is an ongoing
|
|
6677
|
-
* response object,it will emit the `aborted` event.
|
|
6677
|
+
* response object, it will emit the `aborted` event.
|
|
6678
6678
|
*/
|
|
6679
6679
|
abort(): void;
|
|
6680
6680
|
/**
|
|
@@ -7531,8 +7531,8 @@ declare namespace Electron {
|
|
|
7531
7531
|
*
|
|
7532
7532
|
* This API can be called safely before the `ready` event the `app` module emits,
|
|
7533
7533
|
* it is usually used to report errors in early stage of startup. If called before
|
|
7534
|
-
* the app `ready`event on Linux, the message will be emitted to stderr, and no
|
|
7535
|
-
* dialog will appear.
|
|
7534
|
+
* the app `ready` event on Linux, the message will be emitted to stderr, and no
|
|
7535
|
+
* GUI dialog will appear.
|
|
7536
7536
|
*/
|
|
7537
7537
|
showErrorBox(title: string, content: string): void;
|
|
7538
7538
|
/**
|
|
@@ -7787,9 +7787,9 @@ declare namespace Electron {
|
|
|
7787
7787
|
*/
|
|
7788
7788
|
displayFrequency: number;
|
|
7789
7789
|
/**
|
|
7790
|
-
* Unique identifier associated with the display. A value of
|
|
7791
|
-
*
|
|
7792
|
-
*
|
|
7790
|
+
* Unique identifier associated with the display. A value of -1 means the display
|
|
7791
|
+
* is invalid or the correct `id` is not yet known, and a value of -10 means the
|
|
7792
|
+
* display is a virtual display assigned to a unified desktop.
|
|
7793
7793
|
*/
|
|
7794
7794
|
id: number;
|
|
7795
7795
|
/**
|
|
@@ -8592,9 +8592,9 @@ declare namespace Electron {
|
|
|
8592
8592
|
removeListener(event: 'end', listener: () => void): this;
|
|
8593
8593
|
/**
|
|
8594
8594
|
* Emitted when an error was encountered while streaming response data events. For
|
|
8595
|
-
* instance, if the server closes the underlying while the response is
|
|
8596
|
-
* streaming, an `error` event will be emitted on the response object and a
|
|
8597
|
-
* event will subsequently follow on the request object.
|
|
8595
|
+
* instance, if the server closes the underlying connection while the response is
|
|
8596
|
+
* still streaming, an `error` event will be emitted on the response object and a
|
|
8597
|
+
* `close` event will subsequently follow on the request object.
|
|
8598
8598
|
*/
|
|
8599
8599
|
on(event: 'error', listener: (
|
|
8600
8600
|
/**
|
|
@@ -9291,7 +9291,7 @@ declare namespace Electron {
|
|
|
9291
9291
|
* opens the associated menu. The indicated character in the button label then gets
|
|
9292
9292
|
* an underline, and the `&` character is not displayed on the button label.
|
|
9293
9293
|
*
|
|
9294
|
-
* In order to escape the `&` character in an item name, add a
|
|
9294
|
+
* In order to escape the `&` character in an item name, add a preceding `&`. For
|
|
9295
9295
|
* example, `&&File` would result in `&File` displayed on the button label.
|
|
9296
9296
|
*
|
|
9297
9297
|
* Passing `null` will suppress the default menu. On Windows and Linux, this has
|
|
@@ -9342,9 +9342,9 @@ declare namespace Electron {
|
|
|
9342
9342
|
*/
|
|
9343
9343
|
constructor(options: MenuItemConstructorOptions);
|
|
9344
9344
|
/**
|
|
9345
|
-
* An `Accelerator`
|
|
9345
|
+
* An `Accelerator | null` indicating the item's accelerator, if set.
|
|
9346
9346
|
*/
|
|
9347
|
-
accelerator
|
|
9347
|
+
accelerator: (Accelerator) | (null);
|
|
9348
9348
|
/**
|
|
9349
9349
|
* A `boolean` indicating whether the item is checked. This property can be
|
|
9350
9350
|
* dynamically changed.
|
|
@@ -9754,8 +9754,8 @@ declare namespace Electron {
|
|
|
9754
9754
|
*/
|
|
9755
9755
|
readonly inForcedColorsMode: boolean;
|
|
9756
9756
|
/**
|
|
9757
|
-
* A `boolean` that indicates
|
|
9758
|
-
*
|
|
9757
|
+
* A `boolean` that indicates whether the user has chosen via system accessibility
|
|
9758
|
+
* settings to reduce transparency at the OS level.
|
|
9759
9759
|
*
|
|
9760
9760
|
*/
|
|
9761
9761
|
readonly prefersReducedTransparency: boolean;
|
|
@@ -12884,8 +12884,8 @@ declare namespace Electron {
|
|
|
12884
12884
|
/**
|
|
12885
12885
|
* Overrides the `userAgent` and `acceptLanguages` for this session.
|
|
12886
12886
|
*
|
|
12887
|
-
* The `acceptLanguages` must a comma separated ordered list of language codes,
|
|
12888
|
-
* example `"en-US,fr,de,ko,zh-CN,ja"`.
|
|
12887
|
+
* The `acceptLanguages` must be a comma separated ordered list of language codes,
|
|
12888
|
+
* for example `"en-US,fr,de,ko,zh-CN,ja"`.
|
|
12889
12889
|
*
|
|
12890
12890
|
* This doesn't affect existing `WebContents`, and each `WebContents` can use
|
|
12891
12891
|
* `webContents.setUserAgent` to override the session-wide user agent.
|
|
@@ -16236,7 +16236,7 @@ declare namespace Electron {
|
|
|
16236
16236
|
* 302 redirect.
|
|
16237
16237
|
*
|
|
16238
16238
|
* This event cannot be prevented, if you want to prevent redirects you should
|
|
16239
|
-
*
|
|
16239
|
+
* check out the `will-redirect` event above.
|
|
16240
16240
|
*/
|
|
16241
16241
|
on(event: 'did-redirect-navigation', listener: (details: Event<WebContentsDidRedirectNavigationEventParams>,
|
|
16242
16242
|
/**
|
|
@@ -17836,7 +17836,8 @@ declare namespace Electron {
|
|
|
17836
17836
|
setDevToolsWebContents(devToolsWebContents: WebContents): void;
|
|
17837
17837
|
/**
|
|
17838
17838
|
* If _offscreen rendering_ is enabled sets the frame rate to the specified number.
|
|
17839
|
-
*
|
|
17839
|
+
* When `webPreferences.offscreen.useSharedTexture` is `false` only values between
|
|
17840
|
+
* 1 and 240 are accepted.
|
|
17840
17841
|
*/
|
|
17841
17842
|
setFrameRate(fps: number): void;
|
|
17842
17843
|
/**
|
|
@@ -17877,10 +17878,10 @@ declare namespace Electron {
|
|
|
17877
17878
|
*/
|
|
17878
17879
|
setWebRTCUDPPortRange(udpPortRange: UdpPortRange): void;
|
|
17879
17880
|
/**
|
|
17880
|
-
* Called before creating a window a new window is requested by the renderer,
|
|
17881
|
-
* by `window.open()`, a link with `target="_blank"`, shift+clicking on a
|
|
17882
|
-
* submitting a form with `<form target="_blank">`. See `window.open()`
|
|
17883
|
-
* details and how to use this in conjunction with `did-create-window`.
|
|
17881
|
+
* Called before creating a window when a new window is requested by the renderer,
|
|
17882
|
+
* e.g. by `window.open()`, a link with `target="_blank"`, shift+clicking on a
|
|
17883
|
+
* link, or submitting a form with `<form target="_blank">`. See `window.open()`
|
|
17884
|
+
* for more details and how to use this in conjunction with `did-create-window`.
|
|
17884
17885
|
*
|
|
17885
17886
|
* An example showing how to customize the process of new `BrowserWindow` creation
|
|
17886
17887
|
* to be `BrowserView` attached to main window instead:
|
|
@@ -17966,7 +17967,7 @@ declare namespace Electron {
|
|
|
17966
17967
|
*/
|
|
17967
17968
|
readonly debugger: Debugger;
|
|
17968
17969
|
/**
|
|
17969
|
-
* A `WebContents | null` property that represents the
|
|
17970
|
+
* A `WebContents | null` property that represents the DevTools `WebContents`
|
|
17970
17971
|
* associated with a given `WebContents`.
|
|
17971
17972
|
*
|
|
17972
17973
|
* > [!NOTE] Users should never store this object because it may become `null` when
|
|
@@ -18738,7 +18739,7 @@ declare namespace Electron {
|
|
|
18738
18739
|
/**
|
|
18739
18740
|
* When `false`, it will disable the same-origin policy (usually using testing
|
|
18740
18741
|
* websites by people), and set `allowRunningInsecureContent` to `true` if this
|
|
18741
|
-
*
|
|
18742
|
+
* option has not been set by user. Default is `true`.
|
|
18742
18743
|
*/
|
|
18743
18744
|
webSecurity?: boolean;
|
|
18744
18745
|
/**
|
|
@@ -20893,6 +20894,18 @@ declare namespace Electron {
|
|
|
20893
20894
|
* @platform darwin
|
|
20894
20895
|
*/
|
|
20895
20896
|
allowLoadingUnsignedLibraries?: boolean;
|
|
20897
|
+
/**
|
|
20898
|
+
* With this flag, the utility process will disclaim responsibility for the child
|
|
20899
|
+
* process. This causes the operating system to consider the child process as a
|
|
20900
|
+
* separate entity for purposes of security policies like Transparency, Consent,
|
|
20901
|
+
* and Control (TCC). When responsibility is disclaimed, the parent process will
|
|
20902
|
+
* not be attributed for any TCC requests initiated by the child process. This is
|
|
20903
|
+
* useful when launching processes that run third-party or otherwise untrusted
|
|
20904
|
+
* code. Default is `false`.
|
|
20905
|
+
*
|
|
20906
|
+
* @platform darwin
|
|
20907
|
+
*/
|
|
20908
|
+
disclaim?: boolean;
|
|
20896
20909
|
/**
|
|
20897
20910
|
* With this flag, all HTTP 401 and 407 network requests created via the net module
|
|
20898
20911
|
* will allow responding to them via the `app#login` event in the main process
|
|
@@ -26052,14 +26065,14 @@ declare namespace NodeJS {
|
|
|
26052
26065
|
/**
|
|
26053
26066
|
* A `boolean` that controls whether or not deprecations printed to `stderr`
|
|
26054
26067
|
* include their stack trace. Setting this to `true` will print stack traces for
|
|
26055
|
-
* deprecations. This property is instead of the `--trace-deprecation` command
|
|
26056
|
-
* flag.
|
|
26068
|
+
* deprecations. This property is used instead of the `--trace-deprecation` command
|
|
26069
|
+
* line flag.
|
|
26057
26070
|
*/
|
|
26058
26071
|
traceDeprecation: boolean;
|
|
26059
26072
|
/**
|
|
26060
26073
|
* A `boolean` that controls whether or not process warnings printed to `stderr`
|
|
26061
26074
|
* include their stack trace. Setting this to `true` will print stack traces for
|
|
26062
|
-
* process warnings (including deprecations). This property is instead of the
|
|
26075
|
+
* process warnings (including deprecations). This property is used instead of the
|
|
26063
26076
|
* `--trace-warnings` command line flag.
|
|
26064
26077
|
*/
|
|
26065
26078
|
traceProcessWarnings: boolean;
|
package/dist/version.json
CHANGED