electron-types 45.0.0-beta.2 → 45.0.0-beta.4
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 +93 -38
- 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.0.0-beta.
|
|
17
|
+
npm install -D electron-types@45.0.0-beta.4
|
|
18
18
|
# or
|
|
19
|
-
yarn add -D electron-types@45.0.0-beta.
|
|
19
|
+
yarn add -D electron-types@45.0.0-beta.4
|
|
20
20
|
# or
|
|
21
|
-
pnpm add -D electron-types@45.0.0-beta.
|
|
21
|
+
pnpm add -D electron-types@45.0.0-beta.4
|
|
22
22
|
```
|
|
23
23
|
|
|
24
24
|
## Usage
|
package/dist/electron.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Type definitions for Electron 45.0.0-beta.
|
|
1
|
+
// Type definitions for Electron 45.0.0-beta.4
|
|
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
|
|
@@ -1353,6 +1353,13 @@ declare namespace Electron {
|
|
|
1353
1353
|
* to the npm modules spec. You should usually also specify a `productName` field,
|
|
1354
1354
|
* which is your application's full capitalized name, and which will be preferred
|
|
1355
1355
|
* over `name` by Electron.
|
|
1356
|
+
*
|
|
1357
|
+
* Electron uses the application's name to construct the default `userData`
|
|
1358
|
+
* directory. On Windows, neither `productName` nor `name` should contain the
|
|
1359
|
+
* following special characters, which cannot be used in directory or file names:
|
|
1360
|
+
* `<`, `>`, `:`, `"`, `\`, `/`, `|`, `?`, `*`. Using these characters in the
|
|
1361
|
+
* application's name can prevent Electron from creating the default `userData`
|
|
1362
|
+
* directory and cause the application to crash on startup.
|
|
1356
1363
|
*/
|
|
1357
1364
|
getName(): string;
|
|
1358
1365
|
/**
|
|
@@ -1857,6 +1864,8 @@ declare namespace Electron {
|
|
|
1857
1864
|
/**
|
|
1858
1865
|
* Overrides the current application's name.
|
|
1859
1866
|
*
|
|
1867
|
+
* On Windows, avoid the reserved filename characters in `name`.
|
|
1868
|
+
*
|
|
1860
1869
|
* > [!NOTE] This function overrides the name used internally by Electron; it does
|
|
1861
1870
|
* not affect the name that the OS uses.
|
|
1862
1871
|
*/
|
|
@@ -2044,6 +2053,9 @@ declare namespace Electron {
|
|
|
2044
2053
|
* to the npm modules spec. You should usually also specify a `productName` field,
|
|
2045
2054
|
* which is your application's full capitalized name, and which will be preferred
|
|
2046
2055
|
* over `name` by Electron.
|
|
2056
|
+
*
|
|
2057
|
+
* On Windows, the application's name must not contain reserved filename
|
|
2058
|
+
* characters, because it is used to construct the default `userData` directory.
|
|
2047
2059
|
*/
|
|
2048
2060
|
name: string;
|
|
2049
2061
|
/**
|
|
@@ -7267,7 +7279,10 @@ declare namespace Electron {
|
|
|
7267
7279
|
* soon as they receive the EnableRecording request.
|
|
7268
7280
|
*
|
|
7269
7281
|
* If a recording is already running, the promise will be immediately resolved, as
|
|
7270
|
-
* only one trace operation can be in progress at a time.
|
|
7282
|
+
* only one trace operation can be in progress at a time. If
|
|
7283
|
+
* `options.nativeHeapProfiling` is set while a recording is already running, the
|
|
7284
|
+
* promise is rejected instead, since the already-running recording's options can't
|
|
7285
|
+
* be changed to turn on heap profiling.
|
|
7271
7286
|
*/
|
|
7272
7287
|
startRecording(options: (TraceConfig) | (TraceCategoriesAndOptions)): Promise<void>;
|
|
7273
7288
|
/**
|
|
@@ -7285,6 +7300,12 @@ declare namespace Electron {
|
|
|
7285
7300
|
* Trace data will be written into `resultFilePath`. If `resultFilePath` is empty
|
|
7286
7301
|
* or not provided, trace data will be written to a temporary file, and the path
|
|
7287
7302
|
* will be returned in the promise.
|
|
7303
|
+
*
|
|
7304
|
+
* Trace data is written in the Perfetto protobuf format.
|
|
7305
|
+
*
|
|
7306
|
+
* Heap profiling samples record instruction addresses and module build IDs rather
|
|
7307
|
+
* than function names. To symbolize them, use the symbols published for the
|
|
7308
|
+
* matching Electron release with Chromium's `symbolize_trace` tool.
|
|
7288
7309
|
*/
|
|
7289
7310
|
stopRecording(resultFilePath?: string): Promise<string>;
|
|
7290
7311
|
}
|
|
@@ -10142,6 +10163,25 @@ declare namespace Electron {
|
|
|
10142
10163
|
wheelTicksY?: number;
|
|
10143
10164
|
}
|
|
10144
10165
|
|
|
10166
|
+
interface NativeHeapProfilerOptions {
|
|
10167
|
+
|
|
10168
|
+
// Docs: https://electronjs.org/docs/api/structures/native-heap-profiler-options
|
|
10169
|
+
|
|
10170
|
+
/**
|
|
10171
|
+
* The interval in milliseconds at which samples are written to the trace. Each
|
|
10172
|
+
* write is a full snapshot of every sampled allocation that is still live, so
|
|
10173
|
+
* short intervals can fill the trace buffer quickly in long recordings. Defaults
|
|
10174
|
+
* to `0`, which writes a single snapshot when tracing stops.
|
|
10175
|
+
*/
|
|
10176
|
+
dumpInterval?: number;
|
|
10177
|
+
/**
|
|
10178
|
+
* The average number of bytes allocated between samples. Lower values give a more
|
|
10179
|
+
* precise profile at a higher performance cost. Must be greater than `0`. Defaults
|
|
10180
|
+
* to Chromium's default, currently `131072` (128 KiB).
|
|
10181
|
+
*/
|
|
10182
|
+
samplingInterval?: number;
|
|
10183
|
+
}
|
|
10184
|
+
|
|
10145
10185
|
class NativeImage {
|
|
10146
10186
|
|
|
10147
10187
|
// Docs: https://electronjs.org/docs/api/native-image
|
|
@@ -10612,9 +10652,6 @@ declare namespace Electron {
|
|
|
10612
10652
|
|
|
10613
10653
|
// Docs: https://electronjs.org/docs/api/notification
|
|
10614
10654
|
|
|
10615
|
-
/**
|
|
10616
|
-
* @platform darwin,win32
|
|
10617
|
-
*/
|
|
10618
10655
|
on(event: 'action', listener: (details: Event<NotificationActionEventParams>,
|
|
10619
10656
|
/**
|
|
10620
10657
|
* @deprecated
|
|
@@ -10625,9 +10662,6 @@ declare namespace Electron {
|
|
|
10625
10662
|
* @platform win32
|
|
10626
10663
|
*/
|
|
10627
10664
|
selectionIndex: number) => void): this;
|
|
10628
|
-
/**
|
|
10629
|
-
* @platform darwin,win32
|
|
10630
|
-
*/
|
|
10631
10665
|
off(event: 'action', listener: (details: Event<NotificationActionEventParams>,
|
|
10632
10666
|
/**
|
|
10633
10667
|
* @deprecated
|
|
@@ -10638,9 +10672,6 @@ declare namespace Electron {
|
|
|
10638
10672
|
* @platform win32
|
|
10639
10673
|
*/
|
|
10640
10674
|
selectionIndex: number) => void): this;
|
|
10641
|
-
/**
|
|
10642
|
-
* @platform darwin,win32
|
|
10643
|
-
*/
|
|
10644
10675
|
once(event: 'action', listener: (details: Event<NotificationActionEventParams>,
|
|
10645
10676
|
/**
|
|
10646
10677
|
* @deprecated
|
|
@@ -10651,9 +10682,6 @@ declare namespace Electron {
|
|
|
10651
10682
|
* @platform win32
|
|
10652
10683
|
*/
|
|
10653
10684
|
selectionIndex: number) => void): this;
|
|
10654
|
-
/**
|
|
10655
|
-
* @platform darwin,win32
|
|
10656
|
-
*/
|
|
10657
10685
|
addListener(event: 'action', listener: (details: Event<NotificationActionEventParams>,
|
|
10658
10686
|
/**
|
|
10659
10687
|
* @deprecated
|
|
@@ -10664,9 +10692,6 @@ declare namespace Electron {
|
|
|
10664
10692
|
* @platform win32
|
|
10665
10693
|
*/
|
|
10666
10694
|
selectionIndex: number) => void): this;
|
|
10667
|
-
/**
|
|
10668
|
-
* @platform darwin,win32
|
|
10669
|
-
*/
|
|
10670
10695
|
removeListener(event: 'action', listener: (details: Event<NotificationActionEventParams>,
|
|
10671
10696
|
/**
|
|
10672
10697
|
* @deprecated
|
|
@@ -15197,6 +15222,17 @@ declare namespace Electron {
|
|
|
15197
15222
|
* `-excluded_category1,-excluded_category2`.
|
|
15198
15223
|
*/
|
|
15199
15224
|
categoryFilter: string;
|
|
15225
|
+
/**
|
|
15226
|
+
* **Electron extension; not part of Chromium's TraceCategoriesAndOptions schema.**
|
|
15227
|
+
* Enables native (C/C++) heap allocation profiling for this recording. This is
|
|
15228
|
+
* distinct from JavaScript heap profiling (see `contents.takeHeapSnapshot()`); it
|
|
15229
|
+
* samples allocations made by Chromium and native modules. Unlike `TraceConfig`,
|
|
15230
|
+
* this object has no `included_process_ids` field, so every traced process is
|
|
15231
|
+
* profiled.
|
|
15232
|
+
*
|
|
15233
|
+
* @experimental
|
|
15234
|
+
*/
|
|
15235
|
+
nativeHeapProfiling?: NativeHeapProfilerOptions;
|
|
15200
15236
|
/**
|
|
15201
15237
|
* Controls what kind of tracing is enabled, it is a comma-delimited sequence of
|
|
15202
15238
|
* the following strings: `record-until-full`, `record-continuously`,
|
|
@@ -15249,6 +15285,17 @@ declare namespace Electron {
|
|
|
15249
15285
|
* memory-infra docs for more information.
|
|
15250
15286
|
*/
|
|
15251
15287
|
memory_dump_config?: Record<string, any>;
|
|
15288
|
+
/**
|
|
15289
|
+
* **Electron extension; not part of Chromium's TraceConfig schema.** Enables
|
|
15290
|
+
* native (C/C++) heap allocation profiling for this recording. This is distinct
|
|
15291
|
+
* from JavaScript heap profiling (see `process.takeHeapSnapshot()` or
|
|
15292
|
+
* `contents.takeHeapSnapshot()`); it samples allocations made by Chromium and
|
|
15293
|
+
* native modules. `included_process_ids` above also limits which processes are
|
|
15294
|
+
* profiled when this is enabled.
|
|
15295
|
+
*
|
|
15296
|
+
* @experimental
|
|
15297
|
+
*/
|
|
15298
|
+
nativeHeapProfiling?: NativeHeapProfilerOptions;
|
|
15252
15299
|
/**
|
|
15253
15300
|
* Can be `record-until-full`, `record-continuously`, `record-as-much-as-possible`
|
|
15254
15301
|
* or `trace-to-console`. Defaults to `record-until-full`.
|
|
@@ -16318,26 +16365,34 @@ declare namespace Electron {
|
|
|
16318
16365
|
/**
|
|
16319
16366
|
* Emitted when the utility process encounters an HTTP 401 or 407 authentication
|
|
16320
16367
|
* challenge, if the process was created with both
|
|
16321
|
-
* `respondToAuthRequestsFromMainProcess: true` and a `session` option.
|
|
16322
|
-
*
|
|
16323
|
-
*
|
|
16368
|
+
* `respondToAuthRequestsFromMainProcess: true` and a `session` option.
|
|
16369
|
+
*
|
|
16370
|
+
* The default behavior is to cancel the authentication. To override this you
|
|
16371
|
+
* should prevent the default behavior with `event.preventDefault()` and call
|
|
16372
|
+
* `callback(username, password)` with the credentials. Calling `callback` without
|
|
16373
|
+
* arguments will cancel the request.
|
|
16324
16374
|
*
|
|
16325
16375
|
* This behaves the same as the `login` event on `app` but is scoped to the
|
|
16326
16376
|
* individual utility process instance.
|
|
16327
16377
|
*/
|
|
16328
|
-
on(event: 'login', listener: (
|
|
16378
|
+
on(event: 'login', listener: (event: Event,
|
|
16379
|
+
authenticationResponseDetails: AuthenticationResponseDetails,
|
|
16329
16380
|
authInfo: AuthInfo,
|
|
16330
16381
|
callback: (username?: string, password?: string) => void) => void): this;
|
|
16331
|
-
off(event: 'login', listener: (
|
|
16382
|
+
off(event: 'login', listener: (event: Event,
|
|
16383
|
+
authenticationResponseDetails: AuthenticationResponseDetails,
|
|
16332
16384
|
authInfo: AuthInfo,
|
|
16333
16385
|
callback: (username?: string, password?: string) => void) => void): this;
|
|
16334
|
-
once(event: 'login', listener: (
|
|
16386
|
+
once(event: 'login', listener: (event: Event,
|
|
16387
|
+
authenticationResponseDetails: AuthenticationResponseDetails,
|
|
16335
16388
|
authInfo: AuthInfo,
|
|
16336
16389
|
callback: (username?: string, password?: string) => void) => void): this;
|
|
16337
|
-
addListener(event: 'login', listener: (
|
|
16390
|
+
addListener(event: 'login', listener: (event: Event,
|
|
16391
|
+
authenticationResponseDetails: AuthenticationResponseDetails,
|
|
16338
16392
|
authInfo: AuthInfo,
|
|
16339
16393
|
callback: (username?: string, password?: string) => void) => void): this;
|
|
16340
|
-
removeListener(event: 'login', listener: (
|
|
16394
|
+
removeListener(event: 'login', listener: (event: Event,
|
|
16395
|
+
authenticationResponseDetails: AuthenticationResponseDetails,
|
|
16341
16396
|
authInfo: AuthInfo,
|
|
16342
16397
|
callback: (username?: string, password?: string) => void) => void): this;
|
|
16343
16398
|
/**
|
|
@@ -16593,6 +16648,9 @@ declare namespace Electron {
|
|
|
16593
16648
|
mouse: MouseInputEvent) => void): this;
|
|
16594
16649
|
/**
|
|
16595
16650
|
* Emitted when the `WebContents` loses focus.
|
|
16651
|
+
*
|
|
16652
|
+
* The `blur` event is also emitted when switching between windows or apps for the
|
|
16653
|
+
* `WebContents` that has focus within its window.
|
|
16596
16654
|
*/
|
|
16597
16655
|
on(event: 'blur', listener: () => void): this;
|
|
16598
16656
|
off(event: 'blur', listener: () => void): this;
|
|
@@ -17606,14 +17664,8 @@ declare namespace Electron {
|
|
|
17606
17664
|
/**
|
|
17607
17665
|
* Emitted when the `WebContents` gains focus.
|
|
17608
17666
|
*
|
|
17609
|
-
*
|
|
17610
|
-
*
|
|
17611
|
-
* `blur` events of `WebContents`, as the first responder of each window is not
|
|
17612
|
-
* changed.
|
|
17613
|
-
*
|
|
17614
|
-
* The `focus` and `blur` events of `WebContents` should only be used to detect
|
|
17615
|
-
* focus change between different `WebContents` and `BrowserView` in the same
|
|
17616
|
-
* window.
|
|
17667
|
+
* The `focus` event is also emitted when switching between windows or apps for the
|
|
17668
|
+
* `WebContents` that has focus within its window.
|
|
17617
17669
|
*/
|
|
17618
17670
|
on(event: 'focus', listener: () => void): this;
|
|
17619
17671
|
off(event: 'focus', listener: () => void): this;
|
|
@@ -21572,10 +21624,10 @@ declare namespace Electron {
|
|
|
21572
21624
|
|
|
21573
21625
|
interface Config {
|
|
21574
21626
|
/**
|
|
21575
|
-
* Can be `tls1
|
|
21576
|
-
*
|
|
21627
|
+
* Can be `tls1.2` or `tls1.3`. The minimum SSL version to allow when connecting to
|
|
21628
|
+
* remote servers. Defaults to `tls1.2`.
|
|
21577
21629
|
*/
|
|
21578
|
-
minVersion?: ('tls1
|
|
21630
|
+
minVersion?: ('tls1.2' | 'tls1.3');
|
|
21579
21631
|
/**
|
|
21580
21632
|
* Can be `tls1.2` or `tls1.3`. The maximum SSL version to allow when connecting to
|
|
21581
21633
|
* remote servers. Defaults to `tls1.3`.
|
|
@@ -23316,8 +23368,6 @@ declare namespace Electron {
|
|
|
23316
23368
|
/**
|
|
23317
23369
|
* Actions to add to the notification. Please read the available actions and
|
|
23318
23370
|
* limitations in the `NotificationAction` documentation.
|
|
23319
|
-
*
|
|
23320
|
-
* @platform darwin,win32
|
|
23321
23371
|
*/
|
|
23322
23372
|
actions?: NotificationAction[];
|
|
23323
23373
|
/**
|
|
@@ -26055,6 +26105,7 @@ declare namespace Electron {
|
|
|
26055
26105
|
type MimeTypedBuffer = Electron.MimeTypedBuffer;
|
|
26056
26106
|
type MouseInputEvent = Electron.MouseInputEvent;
|
|
26057
26107
|
type MouseWheelInputEvent = Electron.MouseWheelInputEvent;
|
|
26108
|
+
type NativeHeapProfilerOptions = Electron.NativeHeapProfilerOptions;
|
|
26058
26109
|
type NavigationEntry = Electron.NavigationEntry;
|
|
26059
26110
|
type NotificationAction = Electron.NotificationAction;
|
|
26060
26111
|
type NotificationResponse = Electron.NotificationResponse;
|
|
@@ -26483,6 +26534,7 @@ declare namespace Electron {
|
|
|
26483
26534
|
type MimeTypedBuffer = Electron.MimeTypedBuffer;
|
|
26484
26535
|
type MouseInputEvent = Electron.MouseInputEvent;
|
|
26485
26536
|
type MouseWheelInputEvent = Electron.MouseWheelInputEvent;
|
|
26537
|
+
type NativeHeapProfilerOptions = Electron.NativeHeapProfilerOptions;
|
|
26486
26538
|
type NavigationEntry = Electron.NavigationEntry;
|
|
26487
26539
|
type NotificationAction = Electron.NotificationAction;
|
|
26488
26540
|
type NotificationResponse = Electron.NotificationResponse;
|
|
@@ -26835,6 +26887,7 @@ declare namespace Electron {
|
|
|
26835
26887
|
type MimeTypedBuffer = Electron.MimeTypedBuffer;
|
|
26836
26888
|
type MouseInputEvent = Electron.MouseInputEvent;
|
|
26837
26889
|
type MouseWheelInputEvent = Electron.MouseWheelInputEvent;
|
|
26890
|
+
type NativeHeapProfilerOptions = Electron.NativeHeapProfilerOptions;
|
|
26838
26891
|
type NavigationEntry = Electron.NavigationEntry;
|
|
26839
26892
|
type NotificationAction = Electron.NotificationAction;
|
|
26840
26893
|
type NotificationResponse = Electron.NotificationResponse;
|
|
@@ -27189,6 +27242,7 @@ declare namespace Electron {
|
|
|
27189
27242
|
type MimeTypedBuffer = Electron.MimeTypedBuffer;
|
|
27190
27243
|
type MouseInputEvent = Electron.MouseInputEvent;
|
|
27191
27244
|
type MouseWheelInputEvent = Electron.MouseWheelInputEvent;
|
|
27245
|
+
type NativeHeapProfilerOptions = Electron.NativeHeapProfilerOptions;
|
|
27192
27246
|
type NavigationEntry = Electron.NavigationEntry;
|
|
27193
27247
|
type NotificationAction = Electron.NotificationAction;
|
|
27194
27248
|
type NotificationResponse = Electron.NotificationResponse;
|
|
@@ -27639,6 +27693,7 @@ declare namespace Electron {
|
|
|
27639
27693
|
type MimeTypedBuffer = Electron.MimeTypedBuffer;
|
|
27640
27694
|
type MouseInputEvent = Electron.MouseInputEvent;
|
|
27641
27695
|
type MouseWheelInputEvent = Electron.MouseWheelInputEvent;
|
|
27696
|
+
type NativeHeapProfilerOptions = Electron.NativeHeapProfilerOptions;
|
|
27642
27697
|
type NavigationEntry = Electron.NavigationEntry;
|
|
27643
27698
|
type NotificationAction = Electron.NotificationAction;
|
|
27644
27699
|
type NotificationResponse = Electron.NotificationResponse;
|
package/dist/version.json
CHANGED