electron-types 43.1.1 → 43.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 +157 -1
- 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@43.
|
|
17
|
+
npm install -D electron-types@43.2.0
|
|
18
18
|
# or
|
|
19
|
-
yarn add -D electron-types@43.
|
|
19
|
+
yarn add -D electron-types@43.2.0
|
|
20
20
|
# or
|
|
21
|
-
pnpm add -D electron-types@43.
|
|
21
|
+
pnpm add -D electron-types@43.2.0
|
|
22
22
|
```
|
|
23
23
|
|
|
24
24
|
## Usage
|
package/dist/electron.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Type definitions for Electron 43.
|
|
1
|
+
// Type definitions for Electron 43.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
|
|
@@ -10241,6 +10241,14 @@ declare namespace Electron {
|
|
|
10241
10241
|
*
|
|
10242
10242
|
*/
|
|
10243
10243
|
readonly online: boolean;
|
|
10244
|
+
/**
|
|
10245
|
+
* > [!NOTE] This property is only available in the main process.
|
|
10246
|
+
*
|
|
10247
|
+
* A `typeof WebSocket` reference to the `WebSocket` class, which can be used to
|
|
10248
|
+
* create WHATWG-compatible WebSocket connections through Chromium's network stack
|
|
10249
|
+
* from the main process.
|
|
10250
|
+
*/
|
|
10251
|
+
WebSocket: typeof WebSocket;
|
|
10244
10252
|
}
|
|
10245
10253
|
|
|
10246
10254
|
interface NetLog {
|
|
@@ -19455,6 +19463,147 @@ declare namespace Electron {
|
|
|
19455
19463
|
urls: string[];
|
|
19456
19464
|
}
|
|
19457
19465
|
|
|
19466
|
+
class WebSocket extends EventTarget {
|
|
19467
|
+
|
|
19468
|
+
// Docs: https://electronjs.org/docs/api/web-socket
|
|
19469
|
+
|
|
19470
|
+
/**
|
|
19471
|
+
* WebSocket
|
|
19472
|
+
*/
|
|
19473
|
+
constructor(url: string, protocols?: (string) | (string[]) | (WebSocketOptions));
|
|
19474
|
+
/**
|
|
19475
|
+
* Closes the connection. Calling `close()` while still `CONNECTING` aborts the
|
|
19476
|
+
* handshake.
|
|
19477
|
+
*/
|
|
19478
|
+
close(code?: number, reason?: string): void;
|
|
19479
|
+
/**
|
|
19480
|
+
* Enqueues `data` to be transmitted to the server. Throws an `InvalidStateError`
|
|
19481
|
+
* `DOMException` if `readyState` is `CONNECTING`.
|
|
19482
|
+
*/
|
|
19483
|
+
send(data: (string) | (ArrayBufferLike) | (ArrayBufferView) | (Blob)): void;
|
|
19484
|
+
/**
|
|
19485
|
+
* A `string` controlling how incoming binary messages are exposed on the `message`
|
|
19486
|
+
* event. Can be `nodebuffer`, `arraybuffer`, or `blob`. The default is
|
|
19487
|
+
* `nodebuffer`.
|
|
19488
|
+
*
|
|
19489
|
+
* `'nodebuffer'` is an Electron extension that delivers binary messages as
|
|
19490
|
+
* `Buffer` objects, which is generally the most convenient representation in the
|
|
19491
|
+
* main process. Set `binaryType` to `'arraybuffer'` or `'blob'` for behavior
|
|
19492
|
+
* identical to the renderer `WebSocket`.
|
|
19493
|
+
*/
|
|
19494
|
+
binaryType: ('nodebuffer' | 'arraybuffer' | 'blob');
|
|
19495
|
+
/**
|
|
19496
|
+
* An `Integer` representing the number of bytes of application data that have been
|
|
19497
|
+
* queued via `send()` but not yet handed off to the network.
|
|
19498
|
+
*
|
|
19499
|
+
*/
|
|
19500
|
+
readonly bufferedAmount: number;
|
|
19501
|
+
/**
|
|
19502
|
+
* A `string` containing the extensions negotiated by the server (for example
|
|
19503
|
+
* `permessage-deflate`).
|
|
19504
|
+
*
|
|
19505
|
+
*/
|
|
19506
|
+
readonly extensions: string;
|
|
19507
|
+
/**
|
|
19508
|
+
* A `Function | null` event handler for the `close` event. Equivalent to calling
|
|
19509
|
+
* `addEventListener('close', ...)`.
|
|
19510
|
+
*/
|
|
19511
|
+
onclose: (Function) | (null);
|
|
19512
|
+
/**
|
|
19513
|
+
* A `Function | null` event handler for the `error` event. Equivalent to calling
|
|
19514
|
+
* `addEventListener('error', ...)`.
|
|
19515
|
+
*/
|
|
19516
|
+
onerror: (Function) | (null);
|
|
19517
|
+
/**
|
|
19518
|
+
* A `Function | null` event handler for the `message` event. Equivalent to calling
|
|
19519
|
+
* `addEventListener('message', ...)`.
|
|
19520
|
+
*/
|
|
19521
|
+
onmessage: (Function) | (null);
|
|
19522
|
+
/**
|
|
19523
|
+
* A `Function | null` event handler for the `open` event. Equivalent to calling
|
|
19524
|
+
* `addEventListener('open', ...)`.
|
|
19525
|
+
*/
|
|
19526
|
+
onopen: (Function) | (null);
|
|
19527
|
+
/**
|
|
19528
|
+
* A `string` containing the subprotocol selected by the server. The empty string
|
|
19529
|
+
* until the connection is open or if the server did not select a subprotocol.
|
|
19530
|
+
*
|
|
19531
|
+
*/
|
|
19532
|
+
readonly protocol: string;
|
|
19533
|
+
/**
|
|
19534
|
+
* An `Integer` representing the current state of the connection: one of
|
|
19535
|
+
* `WebSocket.CONNECTING` (`0`), `WebSocket.OPEN` (`1`), `WebSocket.CLOSING` (`2`),
|
|
19536
|
+
* or `WebSocket.CLOSED` (`3`).
|
|
19537
|
+
*
|
|
19538
|
+
*/
|
|
19539
|
+
readonly readyState: number;
|
|
19540
|
+
/**
|
|
19541
|
+
* A `string` representing the resolved URL of the connection.
|
|
19542
|
+
*
|
|
19543
|
+
*/
|
|
19544
|
+
readonly url: string;
|
|
19545
|
+
/**
|
|
19546
|
+
* An `Integer` constant equal to `3`, the `readyState` value once the connection
|
|
19547
|
+
* is closed.
|
|
19548
|
+
*
|
|
19549
|
+
*/
|
|
19550
|
+
static readonly CLOSED: number;
|
|
19551
|
+
/**
|
|
19552
|
+
* An `Integer` constant equal to `2`, the `readyState` value while the closing
|
|
19553
|
+
* handshake is in progress.
|
|
19554
|
+
*
|
|
19555
|
+
*/
|
|
19556
|
+
static readonly CLOSING: number;
|
|
19557
|
+
/**
|
|
19558
|
+
* An `Integer` constant equal to `0`, the `readyState` value while the opening
|
|
19559
|
+
* handshake is in progress.
|
|
19560
|
+
*
|
|
19561
|
+
*/
|
|
19562
|
+
static readonly CONNECTING: number;
|
|
19563
|
+
/**
|
|
19564
|
+
* An `Integer` constant equal to `1`, the `readyState` value once the connection
|
|
19565
|
+
* is established.
|
|
19566
|
+
*
|
|
19567
|
+
*/
|
|
19568
|
+
static readonly OPEN: number;
|
|
19569
|
+
}
|
|
19570
|
+
|
|
19571
|
+
interface WebSocketOptions {
|
|
19572
|
+
|
|
19573
|
+
// Docs: https://electronjs.org/docs/api/structures/web-socket-options
|
|
19574
|
+
|
|
19575
|
+
/**
|
|
19576
|
+
* Extra HTTP headers to send with the opening handshake.
|
|
19577
|
+
*/
|
|
19578
|
+
headers?: Record<string, string>;
|
|
19579
|
+
/**
|
|
19580
|
+
* Value of the `Origin` header to send with the opening handshake. Defaults to the
|
|
19581
|
+
* `http(s)` equivalent of the WebSocket URL's origin (e.g. connecting to
|
|
19582
|
+
* `wss://api.example.com` sends `Origin: https://api.example.com`), so that the
|
|
19583
|
+
* connection is treated as same-origin by the server and by SameSite cookie rules.
|
|
19584
|
+
*/
|
|
19585
|
+
origin?: string;
|
|
19586
|
+
/**
|
|
19587
|
+
* The name of the `partition` the connection is associated with. Defaults to the
|
|
19588
|
+
* empty string, which corresponds to the default session. If `session` is
|
|
19589
|
+
* provided, `partition` is ignored.
|
|
19590
|
+
*/
|
|
19591
|
+
partition?: string;
|
|
19592
|
+
/**
|
|
19593
|
+
* Requested WebSocket subprotocols.
|
|
19594
|
+
*/
|
|
19595
|
+
protocols?: (string) | (string[]);
|
|
19596
|
+
/**
|
|
19597
|
+
* The `Session` the connection is associated with.
|
|
19598
|
+
*/
|
|
19599
|
+
session?: Session;
|
|
19600
|
+
/**
|
|
19601
|
+
* Whether to send cookies from the session with the opening handshake and store
|
|
19602
|
+
* cookies received in the handshake response. Default is `false`.
|
|
19603
|
+
*/
|
|
19604
|
+
useSessionCookies?: boolean;
|
|
19605
|
+
}
|
|
19606
|
+
|
|
19458
19607
|
interface WebSource {
|
|
19459
19608
|
|
|
19460
19609
|
// Docs: https://electronjs.org/docs/api/structures/web-source
|
|
@@ -25121,6 +25270,7 @@ declare namespace Electron {
|
|
|
25121
25270
|
type WebAuthnAccount = Electron.WebAuthnAccount;
|
|
25122
25271
|
type WebPreferences = Electron.WebPreferences;
|
|
25123
25272
|
type WebRequestFilter = Electron.WebRequestFilter;
|
|
25273
|
+
type WebSocketOptions = Electron.WebSocketOptions;
|
|
25124
25274
|
type WebSource = Electron.WebSource;
|
|
25125
25275
|
type WindowOpenHandlerResponse = Electron.WindowOpenHandlerResponse;
|
|
25126
25276
|
type WindowSessionEndEvent = Electron.WindowSessionEndEvent;
|
|
@@ -25209,6 +25359,7 @@ declare namespace Electron {
|
|
|
25209
25359
|
const webFrameMain: typeof WebFrameMain;
|
|
25210
25360
|
type WebFrameMain = Electron.WebFrameMain;
|
|
25211
25361
|
type WebRequest = Electron.WebRequest;
|
|
25362
|
+
class WebSocket extends Electron.WebSocket {}
|
|
25212
25363
|
type AboutPanelOptionsOptions = Electron.AboutPanelOptionsOptions;
|
|
25213
25364
|
type AddRepresentationOptions = Electron.AddRepresentationOptions;
|
|
25214
25365
|
type AdjustSelectionOptions = Electron.AdjustSelectionOptions;
|
|
@@ -25528,6 +25679,7 @@ declare namespace Electron {
|
|
|
25528
25679
|
type WebAuthnAccount = Electron.WebAuthnAccount;
|
|
25529
25680
|
type WebPreferences = Electron.WebPreferences;
|
|
25530
25681
|
type WebRequestFilter = Electron.WebRequestFilter;
|
|
25682
|
+
type WebSocketOptions = Electron.WebSocketOptions;
|
|
25531
25683
|
type WebSource = Electron.WebSource;
|
|
25532
25684
|
type WindowOpenHandlerResponse = Electron.WindowOpenHandlerResponse;
|
|
25533
25685
|
type WindowSessionEndEvent = Electron.WindowSessionEndEvent;
|
|
@@ -25863,6 +26015,7 @@ declare namespace Electron {
|
|
|
25863
26015
|
type WebAuthnAccount = Electron.WebAuthnAccount;
|
|
25864
26016
|
type WebPreferences = Electron.WebPreferences;
|
|
25865
26017
|
type WebRequestFilter = Electron.WebRequestFilter;
|
|
26018
|
+
type WebSocketOptions = Electron.WebSocketOptions;
|
|
25866
26019
|
type WebSource = Electron.WebSource;
|
|
25867
26020
|
type WindowOpenHandlerResponse = Electron.WindowOpenHandlerResponse;
|
|
25868
26021
|
type WindowSessionEndEvent = Electron.WindowSessionEndEvent;
|
|
@@ -26197,6 +26350,7 @@ declare namespace Electron {
|
|
|
26197
26350
|
type WebAuthnAccount = Electron.WebAuthnAccount;
|
|
26198
26351
|
type WebPreferences = Electron.WebPreferences;
|
|
26199
26352
|
type WebRequestFilter = Electron.WebRequestFilter;
|
|
26353
|
+
type WebSocketOptions = Electron.WebSocketOptions;
|
|
26200
26354
|
type WebSource = Electron.WebSource;
|
|
26201
26355
|
type WindowOpenHandlerResponse = Electron.WindowOpenHandlerResponse;
|
|
26202
26356
|
type WindowSessionEndEvent = Electron.WindowSessionEndEvent;
|
|
@@ -26303,6 +26457,7 @@ declare namespace Electron {
|
|
|
26303
26457
|
const webFrameMain: typeof WebFrameMain;
|
|
26304
26458
|
type WebFrameMain = Electron.WebFrameMain;
|
|
26305
26459
|
type WebRequest = Electron.WebRequest;
|
|
26460
|
+
class WebSocket extends Electron.WebSocket {}
|
|
26306
26461
|
const webUtils: WebUtils;
|
|
26307
26462
|
type WebUtils = Electron.WebUtils;
|
|
26308
26463
|
type WebviewTag = Electron.WebviewTag;
|
|
@@ -26625,6 +26780,7 @@ declare namespace Electron {
|
|
|
26625
26780
|
type WebAuthnAccount = Electron.WebAuthnAccount;
|
|
26626
26781
|
type WebPreferences = Electron.WebPreferences;
|
|
26627
26782
|
type WebRequestFilter = Electron.WebRequestFilter;
|
|
26783
|
+
type WebSocketOptions = Electron.WebSocketOptions;
|
|
26628
26784
|
type WebSource = Electron.WebSource;
|
|
26629
26785
|
type WindowOpenHandlerResponse = Electron.WindowOpenHandlerResponse;
|
|
26630
26786
|
type WindowSessionEndEvent = Electron.WindowSessionEndEvent;
|
package/dist/version.json
CHANGED