electron-types 45.0.0 → 45.2.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 +161 -2
- package/dist/version.json +2 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -14,11 +14,11 @@ The official `electron` package is ~200MB because it includes the Electron binar
|
|
|
14
14
|
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)):
|
|
15
15
|
|
|
16
16
|
```bash
|
|
17
|
-
npm install -D electron-types@45.
|
|
17
|
+
npm install -D electron-types@45.2.0
|
|
18
18
|
# or
|
|
19
|
-
yarn add -D electron-types@45.
|
|
19
|
+
yarn add -D electron-types@45.2.0
|
|
20
20
|
# or
|
|
21
|
-
pnpm add -D electron-types@45.
|
|
21
|
+
pnpm add -D electron-types@45.2.0
|
|
22
22
|
```
|
|
23
23
|
|
|
24
24
|
## Usage
|
package/dist/electron.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Type definitions for Electron 45.
|
|
1
|
+
// Type definitions for Electron 45.2.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
|
|
@@ -10208,6 +10208,22 @@ declare namespace Electron {
|
|
|
10208
10208
|
* one. It contains standard items such as `File`, `Edit`, `View`, and `Window`.
|
|
10209
10209
|
*/
|
|
10210
10210
|
static setApplicationMenu(menu: (Menu) | (null)): void;
|
|
10211
|
+
/**
|
|
10212
|
+
* Sets the colors used to highlight the hovered or keyboard-focused item in every
|
|
10213
|
+
* menu the app shows, including context menus and the menu bar's dropdowns. Light
|
|
10214
|
+
* and dark colors are set separately, and any color left unset keeps the default
|
|
10215
|
+
* for that mode. Each call replaces the colors set by any previous call. Passing
|
|
10216
|
+
* `null` restores the defaults.
|
|
10217
|
+
*
|
|
10218
|
+
* Menus opened after the call use the new colors. The colors are not applied while
|
|
10219
|
+
* Windows high contrast mode or forced colors are active, so the user's system
|
|
10220
|
+
* colors take priority.
|
|
10221
|
+
*
|
|
10222
|
+
* This method has no effect on macOS and Linux.
|
|
10223
|
+
*
|
|
10224
|
+
* @platform win32
|
|
10225
|
+
*/
|
|
10226
|
+
static setHighlightColors(options: (HighlightColorsOptions) | (null)): void;
|
|
10211
10227
|
/**
|
|
10212
10228
|
* Appends the `menuItem` to the menu.
|
|
10213
10229
|
*/
|
|
@@ -11855,6 +11871,14 @@ declare namespace Electron {
|
|
|
11855
11871
|
|
|
11856
11872
|
// Docs: https://electronjs.org/docs/api/structures/preload-script
|
|
11857
11873
|
|
|
11874
|
+
/**
|
|
11875
|
+
* Glob patterns for URLs the script will not run in.
|
|
11876
|
+
*/
|
|
11877
|
+
excludeGlobs?: string[];
|
|
11878
|
+
/**
|
|
11879
|
+
* Match patterns for URLs the script will not run in.
|
|
11880
|
+
*/
|
|
11881
|
+
excludeMatches?: string[];
|
|
11858
11882
|
/**
|
|
11859
11883
|
* Path of the script file. Must be an absolute path.
|
|
11860
11884
|
*/
|
|
@@ -11863,6 +11887,29 @@ declare namespace Electron {
|
|
|
11863
11887
|
* Unique ID of preload script.
|
|
11864
11888
|
*/
|
|
11865
11889
|
id: string;
|
|
11890
|
+
/**
|
|
11891
|
+
* Glob patterns applied after `matches`. A URL must also match one of these globs.
|
|
11892
|
+
* `*` matches any sequence of characters and `?` matches any single character.
|
|
11893
|
+
*/
|
|
11894
|
+
includeGlobs?: string[];
|
|
11895
|
+
/**
|
|
11896
|
+
* Match patterns for URLs the script runs in. A custom protocol can be used if its
|
|
11897
|
+
* scheme is registered as `standard` with `protocol.registerSchemesAsPrivileged`.
|
|
11898
|
+
* To filter documents served from a non-standard scheme, use `includeGlobs` or
|
|
11899
|
+
* `excludeGlobs`, which match against the whole URL. If omitted, the script runs
|
|
11900
|
+
* for all URLs not excluded by other filters.
|
|
11901
|
+
*/
|
|
11902
|
+
matches?: string[];
|
|
11903
|
+
/**
|
|
11904
|
+
* Whether a document whose URL has no origin of its own (`about:`, `blob:`,
|
|
11905
|
+
* `data:` or `filesystem:`) is matched by the origin of the frame that created it
|
|
11906
|
+
* instead of by its URL. This includes documents with an opaque origin, such as a
|
|
11907
|
+
* `data:` frame or a sandboxed `<iframe srcdoc>`. For example, an `about:blank`
|
|
11908
|
+
* popup opened by `https://example.com/page` is matched as `https://example.com/`.
|
|
11909
|
+
* When set, every pattern in `matches` must have a path of `/*`. Only applies to
|
|
11910
|
+
* `frame` contexts. Default is `false`.
|
|
11911
|
+
*/
|
|
11912
|
+
matchOriginAsFallback?: boolean;
|
|
11866
11913
|
/**
|
|
11867
11914
|
* Context type where the preload script will be executed. Possible values include
|
|
11868
11915
|
* `frame` or `service-worker`.
|
|
@@ -11874,6 +11921,14 @@ declare namespace Electron {
|
|
|
11874
11921
|
|
|
11875
11922
|
// Docs: https://electronjs.org/docs/api/structures/preload-script-registration
|
|
11876
11923
|
|
|
11924
|
+
/**
|
|
11925
|
+
* Glob patterns for URLs the script will not run in.
|
|
11926
|
+
*/
|
|
11927
|
+
excludeGlobs?: string[];
|
|
11928
|
+
/**
|
|
11929
|
+
* Match patterns for URLs the script will not run in.
|
|
11930
|
+
*/
|
|
11931
|
+
excludeMatches?: string[];
|
|
11877
11932
|
/**
|
|
11878
11933
|
* Path of the script file. Must be an absolute path.
|
|
11879
11934
|
*/
|
|
@@ -11882,6 +11937,30 @@ declare namespace Electron {
|
|
|
11882
11937
|
* Unique ID of preload script. Defaults to a random UUID.
|
|
11883
11938
|
*/
|
|
11884
11939
|
id?: string;
|
|
11940
|
+
/**
|
|
11941
|
+
* Glob patterns applied after `matches`. A URL must also match one of these globs.
|
|
11942
|
+
* `*` matches any sequence of characters and `?` matches zero or one character.
|
|
11943
|
+
* Must not be empty.
|
|
11944
|
+
*/
|
|
11945
|
+
includeGlobs?: string[];
|
|
11946
|
+
/**
|
|
11947
|
+
* Match patterns for URLs the script runs in. A custom protocol can be used if its
|
|
11948
|
+
* scheme is registered as `standard` with `protocol.registerSchemesAsPrivileged`.
|
|
11949
|
+
* To filter documents served from a non-standard scheme, use `includeGlobs` or
|
|
11950
|
+
* `excludeGlobs`, which match against the whole URL. If omitted, the script runs
|
|
11951
|
+
* for all URLs not excluded by other filters. Must not be empty.
|
|
11952
|
+
*/
|
|
11953
|
+
matches?: string[];
|
|
11954
|
+
/**
|
|
11955
|
+
* Whether a document whose URL has no origin of its own (`about:`, `blob:`,
|
|
11956
|
+
* `data:` or `filesystem:`) is matched by the origin of the frame that created it
|
|
11957
|
+
* instead of by its URL. This includes documents with an opaque origin, such as a
|
|
11958
|
+
* `data:` frame or a sandboxed `<iframe srcdoc>`. For example, an `about:blank`
|
|
11959
|
+
* popup opened by `https://example.com/page` is matched as `https://example.com/`.
|
|
11960
|
+
* When set, every pattern in `matches` must have a path of `/*`. Only applies to
|
|
11961
|
+
* `frame` contexts. Default is `false`.
|
|
11962
|
+
*/
|
|
11963
|
+
matchOriginAsFallback?: boolean;
|
|
11885
11964
|
/**
|
|
11886
11965
|
* Context type where the preload script will be executed. Possible values include
|
|
11887
11966
|
* `frame` or `service-worker`.
|
|
@@ -14112,7 +14191,33 @@ declare namespace Electron {
|
|
|
14112
14191
|
/**
|
|
14113
14192
|
* Registers preload script that will be executed in its associated context type in
|
|
14114
14193
|
* this session. For `frame` contexts, this will run prior to any preload defined
|
|
14115
|
-
* in the web preferences of a WebContents.
|
|
14194
|
+
* in the web preferences of a WebContents. In-page navigations do not rerun the
|
|
14195
|
+
* preload script.
|
|
14196
|
+
*
|
|
14197
|
+
* URL filters can limit which documents or service workers a script runs in. They
|
|
14198
|
+
* behave like content script URL matching. A script runs for a URL that meets all
|
|
14199
|
+
* of these conditions:
|
|
14200
|
+
*
|
|
14201
|
+
* * It matches at least one pattern in `matches`, if set.
|
|
14202
|
+
* * It matches at least one glob in `includeGlobs`, if set.
|
|
14203
|
+
* * It does not match any pattern in `excludeMatches`.
|
|
14204
|
+
* * It does not match any glob in `excludeGlobs`.
|
|
14205
|
+
*
|
|
14206
|
+
* The URL that the filters are matched against depends on the context type:
|
|
14207
|
+
*
|
|
14208
|
+
* * For `service-worker` contexts, it is the service worker's scope.
|
|
14209
|
+
* * For `frame` contexts, it is the URL of the document being loaded, with these
|
|
14210
|
+
* special cases:
|
|
14211
|
+
* * The initial empty document of a frame or popup is matched as `about:blank`.
|
|
14212
|
+
* Set `matchOriginAsFallback` to match such documents by the origin of the frame
|
|
14213
|
+
* that created them instead, for example to keep a script out of the `about:blank`
|
|
14214
|
+
* popups of an excluded site.
|
|
14215
|
+
* * A `data:` URL loaded with `baseURLForDataURL` is matched by its base URL.
|
|
14216
|
+
* * The error page of a failed navigation is matched by the URL that failed to
|
|
14217
|
+
* load.
|
|
14218
|
+
*
|
|
14219
|
+
* Throws an error if any of the URL patterns are invalid, or if `matches` or
|
|
14220
|
+
* `includeGlobs` is an empty array.
|
|
14116
14221
|
*
|
|
14117
14222
|
* The ID of the registered preload script.
|
|
14118
14223
|
*/
|
|
@@ -20981,6 +21086,10 @@ declare namespace Electron {
|
|
|
20981
21086
|
*/
|
|
20982
21087
|
addEventListener(event: 'update-target-url', listener: (event: UpdateTargetUrlEvent) => void, useCapture?: boolean): this;
|
|
20983
21088
|
removeEventListener(event: 'update-target-url', listener: (event: UpdateTargetUrlEvent) => void): this;
|
|
21089
|
+
/**
|
|
21090
|
+
* Emitted when a link is clicked in DevTools or 'Open in new tab' is selected for
|
|
21091
|
+
* a link in its context menu.
|
|
21092
|
+
*/
|
|
20984
21093
|
addEventListener(event: 'devtools-open-url', listener: (event: DevtoolsOpenUrlEvent) => void, useCapture?: boolean): this;
|
|
20985
21094
|
removeEventListener(event: 'devtools-open-url', listener: (event: DevtoolsOpenUrlEvent) => void): this;
|
|
20986
21095
|
/**
|
|
@@ -23020,6 +23129,17 @@ declare namespace Electron {
|
|
|
23020
23129
|
origin?: string;
|
|
23021
23130
|
}
|
|
23022
23131
|
|
|
23132
|
+
interface HighlightColorsOptions {
|
|
23133
|
+
/**
|
|
23134
|
+
* Colors used when menus are drawn with light colors.
|
|
23135
|
+
*/
|
|
23136
|
+
light?: Light;
|
|
23137
|
+
/**
|
|
23138
|
+
* Colors used when menus are drawn with dark colors.
|
|
23139
|
+
*/
|
|
23140
|
+
dark?: Dark;
|
|
23141
|
+
}
|
|
23142
|
+
|
|
23023
23143
|
interface IgnoreMouseEventsOptions {
|
|
23024
23144
|
/**
|
|
23025
23145
|
* If true, forwards mouse move messages to Chromium, enabling mouse related events
|
|
@@ -25747,6 +25867,18 @@ declare namespace Electron {
|
|
|
25747
25867
|
interface Children {
|
|
25748
25868
|
}
|
|
25749
25869
|
|
|
25870
|
+
interface Dark {
|
|
25871
|
+
/**
|
|
25872
|
+
* Background color of the hovered or keyboard-focused menu item, as a CSS color
|
|
25873
|
+
* string.
|
|
25874
|
+
*/
|
|
25875
|
+
background?: string;
|
|
25876
|
+
/**
|
|
25877
|
+
* Text color of the hovered or keyboard-focused menu item, as a CSS color string.
|
|
25878
|
+
*/
|
|
25879
|
+
foreground?: string;
|
|
25880
|
+
}
|
|
25881
|
+
|
|
25750
25882
|
interface EditFlags {
|
|
25751
25883
|
/**
|
|
25752
25884
|
* Whether the renderer believes it can undo.
|
|
@@ -25859,6 +25991,18 @@ declare namespace Electron {
|
|
|
25859
25991
|
enabled: boolean;
|
|
25860
25992
|
}
|
|
25861
25993
|
|
|
25994
|
+
interface Light {
|
|
25995
|
+
/**
|
|
25996
|
+
* Background color of the hovered or keyboard-focused menu item, as a CSS color
|
|
25997
|
+
* string (e.g. `#0067c0`).
|
|
25998
|
+
*/
|
|
25999
|
+
background?: string;
|
|
26000
|
+
/**
|
|
26001
|
+
* Text color of the hovered or keyboard-focused menu item, as a CSS color string.
|
|
26002
|
+
*/
|
|
26003
|
+
foreground?: string;
|
|
26004
|
+
}
|
|
26005
|
+
|
|
25862
26006
|
interface Margins {
|
|
25863
26007
|
/**
|
|
25864
26008
|
* Can be `default`, `none`, `printableArea`, or `custom`. If `custom` is chosen,
|
|
@@ -26284,6 +26428,7 @@ declare namespace Electron {
|
|
|
26284
26428
|
type HidDeviceAddedDetails = Electron.HidDeviceAddedDetails;
|
|
26285
26429
|
type HidDeviceRemovedDetails = Electron.HidDeviceRemovedDetails;
|
|
26286
26430
|
type HidDeviceRevokedDetails = Electron.HidDeviceRevokedDetails;
|
|
26431
|
+
type HighlightColorsOptions = Electron.HighlightColorsOptions;
|
|
26287
26432
|
type IgnoreMouseEventsOptions = Electron.IgnoreMouseEventsOptions;
|
|
26288
26433
|
type ImportCertificateOptions = Electron.ImportCertificateOptions;
|
|
26289
26434
|
type ImportSharedTextureOptions = Electron.ImportSharedTextureOptions;
|
|
@@ -26416,6 +26561,7 @@ declare namespace Electron {
|
|
|
26416
26561
|
type WillResizeDetails = Electron.WillResizeDetails;
|
|
26417
26562
|
type Animate = Electron.Animate;
|
|
26418
26563
|
type Children = Electron.Children;
|
|
26564
|
+
type Dark = Electron.Dark;
|
|
26419
26565
|
type EditFlags = Electron.EditFlags;
|
|
26420
26566
|
type Env = Electron.Env;
|
|
26421
26567
|
type FeatureReports = Electron.FeatureReports;
|
|
@@ -26423,6 +26569,7 @@ declare namespace Electron {
|
|
|
26423
26569
|
type InputReports = Electron.InputReports;
|
|
26424
26570
|
type Interfaces = Electron.Interfaces;
|
|
26425
26571
|
type LaunchItems = Electron.LaunchItems;
|
|
26572
|
+
type Light = Electron.Light;
|
|
26426
26573
|
type Margins = Electron.Margins;
|
|
26427
26574
|
type MediaFlags = Electron.MediaFlags;
|
|
26428
26575
|
type Metadata = Electron.Metadata;
|
|
@@ -26715,6 +26862,7 @@ declare namespace Electron {
|
|
|
26715
26862
|
type HidDeviceAddedDetails = Electron.HidDeviceAddedDetails;
|
|
26716
26863
|
type HidDeviceRemovedDetails = Electron.HidDeviceRemovedDetails;
|
|
26717
26864
|
type HidDeviceRevokedDetails = Electron.HidDeviceRevokedDetails;
|
|
26865
|
+
type HighlightColorsOptions = Electron.HighlightColorsOptions;
|
|
26718
26866
|
type IgnoreMouseEventsOptions = Electron.IgnoreMouseEventsOptions;
|
|
26719
26867
|
type ImportCertificateOptions = Electron.ImportCertificateOptions;
|
|
26720
26868
|
type ImportSharedTextureOptions = Electron.ImportSharedTextureOptions;
|
|
@@ -26847,6 +26995,7 @@ declare namespace Electron {
|
|
|
26847
26995
|
type WillResizeDetails = Electron.WillResizeDetails;
|
|
26848
26996
|
type Animate = Electron.Animate;
|
|
26849
26997
|
type Children = Electron.Children;
|
|
26998
|
+
type Dark = Electron.Dark;
|
|
26850
26999
|
type EditFlags = Electron.EditFlags;
|
|
26851
27000
|
type Env = Electron.Env;
|
|
26852
27001
|
type FeatureReports = Electron.FeatureReports;
|
|
@@ -26854,6 +27003,7 @@ declare namespace Electron {
|
|
|
26854
27003
|
type InputReports = Electron.InputReports;
|
|
26855
27004
|
type Interfaces = Electron.Interfaces;
|
|
26856
27005
|
type LaunchItems = Electron.LaunchItems;
|
|
27006
|
+
type Light = Electron.Light;
|
|
26857
27007
|
type Margins = Electron.Margins;
|
|
26858
27008
|
type MediaFlags = Electron.MediaFlags;
|
|
26859
27009
|
type Metadata = Electron.Metadata;
|
|
@@ -27069,6 +27219,7 @@ declare namespace Electron {
|
|
|
27069
27219
|
type HidDeviceAddedDetails = Electron.HidDeviceAddedDetails;
|
|
27070
27220
|
type HidDeviceRemovedDetails = Electron.HidDeviceRemovedDetails;
|
|
27071
27221
|
type HidDeviceRevokedDetails = Electron.HidDeviceRevokedDetails;
|
|
27222
|
+
type HighlightColorsOptions = Electron.HighlightColorsOptions;
|
|
27072
27223
|
type IgnoreMouseEventsOptions = Electron.IgnoreMouseEventsOptions;
|
|
27073
27224
|
type ImportCertificateOptions = Electron.ImportCertificateOptions;
|
|
27074
27225
|
type ImportSharedTextureOptions = Electron.ImportSharedTextureOptions;
|
|
@@ -27201,6 +27352,7 @@ declare namespace Electron {
|
|
|
27201
27352
|
type WillResizeDetails = Electron.WillResizeDetails;
|
|
27202
27353
|
type Animate = Electron.Animate;
|
|
27203
27354
|
type Children = Electron.Children;
|
|
27355
|
+
type Dark = Electron.Dark;
|
|
27204
27356
|
type EditFlags = Electron.EditFlags;
|
|
27205
27357
|
type Env = Electron.Env;
|
|
27206
27358
|
type FeatureReports = Electron.FeatureReports;
|
|
@@ -27208,6 +27360,7 @@ declare namespace Electron {
|
|
|
27208
27360
|
type InputReports = Electron.InputReports;
|
|
27209
27361
|
type Interfaces = Electron.Interfaces;
|
|
27210
27362
|
type LaunchItems = Electron.LaunchItems;
|
|
27363
|
+
type Light = Electron.Light;
|
|
27211
27364
|
type Margins = Electron.Margins;
|
|
27212
27365
|
type MediaFlags = Electron.MediaFlags;
|
|
27213
27366
|
type Metadata = Electron.Metadata;
|
|
@@ -27425,6 +27578,7 @@ declare namespace Electron {
|
|
|
27425
27578
|
type HidDeviceAddedDetails = Electron.HidDeviceAddedDetails;
|
|
27426
27579
|
type HidDeviceRemovedDetails = Electron.HidDeviceRemovedDetails;
|
|
27427
27580
|
type HidDeviceRevokedDetails = Electron.HidDeviceRevokedDetails;
|
|
27581
|
+
type HighlightColorsOptions = Electron.HighlightColorsOptions;
|
|
27428
27582
|
type IgnoreMouseEventsOptions = Electron.IgnoreMouseEventsOptions;
|
|
27429
27583
|
type ImportCertificateOptions = Electron.ImportCertificateOptions;
|
|
27430
27584
|
type ImportSharedTextureOptions = Electron.ImportSharedTextureOptions;
|
|
@@ -27557,6 +27711,7 @@ declare namespace Electron {
|
|
|
27557
27711
|
type WillResizeDetails = Electron.WillResizeDetails;
|
|
27558
27712
|
type Animate = Electron.Animate;
|
|
27559
27713
|
type Children = Electron.Children;
|
|
27714
|
+
type Dark = Electron.Dark;
|
|
27560
27715
|
type EditFlags = Electron.EditFlags;
|
|
27561
27716
|
type Env = Electron.Env;
|
|
27562
27717
|
type FeatureReports = Electron.FeatureReports;
|
|
@@ -27564,6 +27719,7 @@ declare namespace Electron {
|
|
|
27564
27719
|
type InputReports = Electron.InputReports;
|
|
27565
27720
|
type Interfaces = Electron.Interfaces;
|
|
27566
27721
|
type LaunchItems = Electron.LaunchItems;
|
|
27722
|
+
type Light = Electron.Light;
|
|
27567
27723
|
type Margins = Electron.Margins;
|
|
27568
27724
|
type MediaFlags = Electron.MediaFlags;
|
|
27569
27725
|
type Metadata = Electron.Metadata;
|
|
@@ -27878,6 +28034,7 @@ declare namespace Electron {
|
|
|
27878
28034
|
type HidDeviceAddedDetails = Electron.HidDeviceAddedDetails;
|
|
27879
28035
|
type HidDeviceRemovedDetails = Electron.HidDeviceRemovedDetails;
|
|
27880
28036
|
type HidDeviceRevokedDetails = Electron.HidDeviceRevokedDetails;
|
|
28037
|
+
type HighlightColorsOptions = Electron.HighlightColorsOptions;
|
|
27881
28038
|
type IgnoreMouseEventsOptions = Electron.IgnoreMouseEventsOptions;
|
|
27882
28039
|
type ImportCertificateOptions = Electron.ImportCertificateOptions;
|
|
27883
28040
|
type ImportSharedTextureOptions = Electron.ImportSharedTextureOptions;
|
|
@@ -28010,6 +28167,7 @@ declare namespace Electron {
|
|
|
28010
28167
|
type WillResizeDetails = Electron.WillResizeDetails;
|
|
28011
28168
|
type Animate = Electron.Animate;
|
|
28012
28169
|
type Children = Electron.Children;
|
|
28170
|
+
type Dark = Electron.Dark;
|
|
28013
28171
|
type EditFlags = Electron.EditFlags;
|
|
28014
28172
|
type Env = Electron.Env;
|
|
28015
28173
|
type FeatureReports = Electron.FeatureReports;
|
|
@@ -28017,6 +28175,7 @@ declare namespace Electron {
|
|
|
28017
28175
|
type InputReports = Electron.InputReports;
|
|
28018
28176
|
type Interfaces = Electron.Interfaces;
|
|
28019
28177
|
type LaunchItems = Electron.LaunchItems;
|
|
28178
|
+
type Light = Electron.Light;
|
|
28020
28179
|
type Margins = Electron.Margins;
|
|
28021
28180
|
type MediaFlags = Electron.MediaFlags;
|
|
28022
28181
|
type Metadata = Electron.Metadata;
|
package/dist/version.json
CHANGED