electron-types 42.8.1 → 42.9.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 +116 -70
- 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@42.
|
|
17
|
+
npm install -D electron-types@42.9.0
|
|
18
18
|
# or
|
|
19
|
-
yarn add -D electron-types@42.
|
|
19
|
+
yarn add -D electron-types@42.9.0
|
|
20
20
|
# or
|
|
21
|
-
pnpm add -D electron-types@42.
|
|
21
|
+
pnpm add -D electron-types@42.9.0
|
|
22
22
|
```
|
|
23
23
|
|
|
24
24
|
## Usage
|
package/dist/electron.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Type definitions for Electron 42.
|
|
1
|
+
// Type definitions for Electron 42.9.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
|
|
@@ -11169,6 +11169,95 @@ declare namespace Electron {
|
|
|
11169
11169
|
options: Options;
|
|
11170
11170
|
}
|
|
11171
11171
|
|
|
11172
|
+
interface PrintToPDFMargins {
|
|
11173
|
+
|
|
11174
|
+
// Docs: https://electronjs.org/docs/api/structures/print-to-pdf-margins
|
|
11175
|
+
|
|
11176
|
+
/**
|
|
11177
|
+
* Bottom margin in inches. Defaults to 1cm (~0.4 inches).
|
|
11178
|
+
*/
|
|
11179
|
+
bottom?: number;
|
|
11180
|
+
/**
|
|
11181
|
+
* Left margin in inches. Defaults to 1cm (~0.4 inches).
|
|
11182
|
+
*/
|
|
11183
|
+
left?: number;
|
|
11184
|
+
/**
|
|
11185
|
+
* Right margin in inches. Defaults to 1cm (~0.4 inches).
|
|
11186
|
+
*/
|
|
11187
|
+
right?: number;
|
|
11188
|
+
/**
|
|
11189
|
+
* Top margin in inches. Defaults to 1cm (~0.4 inches).
|
|
11190
|
+
*/
|
|
11191
|
+
top?: number;
|
|
11192
|
+
}
|
|
11193
|
+
|
|
11194
|
+
interface PrintToPDFOptions {
|
|
11195
|
+
|
|
11196
|
+
// Docs: https://electronjs.org/docs/api/structures/print-to-pdf-options
|
|
11197
|
+
|
|
11198
|
+
/**
|
|
11199
|
+
* Whether to display header and footer. Defaults to false.
|
|
11200
|
+
*/
|
|
11201
|
+
displayHeaderFooter?: boolean;
|
|
11202
|
+
/**
|
|
11203
|
+
* HTML template for the print footer. Should use the same format as the
|
|
11204
|
+
* `headerTemplate`.
|
|
11205
|
+
*/
|
|
11206
|
+
footerTemplate?: string;
|
|
11207
|
+
/**
|
|
11208
|
+
* Whether or not to generate a PDF document outline from content headers. Defaults
|
|
11209
|
+
* to false.
|
|
11210
|
+
*
|
|
11211
|
+
* @experimental
|
|
11212
|
+
*/
|
|
11213
|
+
generateDocumentOutline?: boolean;
|
|
11214
|
+
/**
|
|
11215
|
+
* Whether or not to generate a tagged (accessible) PDF. Defaults to false. As this
|
|
11216
|
+
* property is experimental, the generated PDF may not adhere fully to PDF/UA and
|
|
11217
|
+
* WCAG standards.
|
|
11218
|
+
*
|
|
11219
|
+
* @experimental
|
|
11220
|
+
*/
|
|
11221
|
+
generateTaggedPDF?: boolean;
|
|
11222
|
+
/**
|
|
11223
|
+
* HTML template for the print header. Should be valid HTML markup with following
|
|
11224
|
+
* classes used to inject printing values into them: `date` (formatted print date),
|
|
11225
|
+
* `title` (document title), `url` (document location), `pageNumber` (current page
|
|
11226
|
+
* number) and `totalPages` (total pages in the document). For example, `<span
|
|
11227
|
+
* class=title></span>` would generate span containing the title.
|
|
11228
|
+
*/
|
|
11229
|
+
headerTemplate?: string;
|
|
11230
|
+
/**
|
|
11231
|
+
* Paper orientation.`true` for landscape, `false` for portrait. Defaults to false.
|
|
11232
|
+
*/
|
|
11233
|
+
landscape?: boolean;
|
|
11234
|
+
margins?: PrintToPDFMargins;
|
|
11235
|
+
/**
|
|
11236
|
+
* Page ranges to print, e.g., '1-5, 8, 11-13'. Defaults to the empty string, which
|
|
11237
|
+
* means print all pages.
|
|
11238
|
+
*/
|
|
11239
|
+
pageRanges?: string;
|
|
11240
|
+
/**
|
|
11241
|
+
* Specify page size of the generated PDF. Can be `A0`, `A1`, `A2`, `A3`, `A4`,
|
|
11242
|
+
* `A5`, `A6`, `Legal`, `Letter`, `Tabloid`, `Ledger`, or an Object containing
|
|
11243
|
+
* `height` and `width` in inches. Defaults to `Letter`.
|
|
11244
|
+
*/
|
|
11245
|
+
pageSize?: (('A0' | 'A1' | 'A2' | 'A3' | 'A4' | 'A5' | 'A6' | 'Legal' | 'Letter' | 'Tabloid' | 'Ledger')) | (Size);
|
|
11246
|
+
/**
|
|
11247
|
+
* Whether or not to prefer page size as defined by css. Defaults to false, in
|
|
11248
|
+
* which case the content will be scaled to fit the paper size.
|
|
11249
|
+
*/
|
|
11250
|
+
preferCSSPageSize?: boolean;
|
|
11251
|
+
/**
|
|
11252
|
+
* Whether to print background graphics. Defaults to false.
|
|
11253
|
+
*/
|
|
11254
|
+
printBackground?: boolean;
|
|
11255
|
+
/**
|
|
11256
|
+
* Scale of the webpage rendering. Defaults to 1.
|
|
11257
|
+
*/
|
|
11258
|
+
scale?: number;
|
|
11259
|
+
}
|
|
11260
|
+
|
|
11172
11261
|
interface ProcessMemoryInfo {
|
|
11173
11262
|
|
|
11174
11263
|
// Docs: https://electronjs.org/docs/api/structures/process-memory-info
|
|
@@ -18869,6 +18958,22 @@ declare namespace Electron {
|
|
|
18869
18958
|
* For example:
|
|
18870
18959
|
*/
|
|
18871
18960
|
postMessage(channel: string, message: any, transfer?: MessagePortMain[]): void;
|
|
18961
|
+
/**
|
|
18962
|
+
* Resolves with the generated PDF data.
|
|
18963
|
+
*
|
|
18964
|
+
* Prints the frame's web page as PDF.
|
|
18965
|
+
*
|
|
18966
|
+
* Unlike `webContents.printToPDF`, this method prints only the contents of the
|
|
18967
|
+
* frame it is called on. This can be used to print an individual `<iframe>` from
|
|
18968
|
+
* the main process.
|
|
18969
|
+
*
|
|
18970
|
+
* The `landscape` will be ignored if `@page` CSS at-rule is used in the web page.
|
|
18971
|
+
*
|
|
18972
|
+
* An example of printing an iframe to PDF:
|
|
18973
|
+
*
|
|
18974
|
+
* See Page.printToPdf for more information.
|
|
18975
|
+
*/
|
|
18976
|
+
printToPDF(options: PrintToPDFOptions): Promise<Buffer>;
|
|
18872
18977
|
/**
|
|
18873
18978
|
* Whether the reload was initiated successfully. Only results in `false` when the
|
|
18874
18979
|
* frame has no history.
|
|
@@ -22990,70 +23095,6 @@ declare namespace Electron {
|
|
|
22990
23095
|
numSockets?: number;
|
|
22991
23096
|
}
|
|
22992
23097
|
|
|
22993
|
-
interface PrintToPDFOptions {
|
|
22994
|
-
/**
|
|
22995
|
-
* Paper orientation.`true` for landscape, `false` for portrait. Defaults to false.
|
|
22996
|
-
*/
|
|
22997
|
-
landscape?: boolean;
|
|
22998
|
-
/**
|
|
22999
|
-
* Whether to display header and footer. Defaults to false.
|
|
23000
|
-
*/
|
|
23001
|
-
displayHeaderFooter?: boolean;
|
|
23002
|
-
/**
|
|
23003
|
-
* Whether to print background graphics. Defaults to false.
|
|
23004
|
-
*/
|
|
23005
|
-
printBackground?: boolean;
|
|
23006
|
-
/**
|
|
23007
|
-
* Scale of the webpage rendering. Defaults to 1.
|
|
23008
|
-
*/
|
|
23009
|
-
scale?: number;
|
|
23010
|
-
/**
|
|
23011
|
-
* Specify page size of the generated PDF. Can be `A0`, `A1`, `A2`, `A3`, `A4`,
|
|
23012
|
-
* `A5`, `A6`, `Legal`, `Letter`, `Tabloid`, `Ledger`, or an Object containing
|
|
23013
|
-
* `height` and `width` in inches. Defaults to `Letter`.
|
|
23014
|
-
*/
|
|
23015
|
-
pageSize?: (('A0' | 'A1' | 'A2' | 'A3' | 'A4' | 'A5' | 'A6' | 'Legal' | 'Letter' | 'Tabloid' | 'Ledger')) | (Size);
|
|
23016
|
-
margins?: Margins;
|
|
23017
|
-
/**
|
|
23018
|
-
* Page ranges to print, e.g., '1-5, 8, 11-13'. Defaults to the empty string, which
|
|
23019
|
-
* means print all pages.
|
|
23020
|
-
*/
|
|
23021
|
-
pageRanges?: string;
|
|
23022
|
-
/**
|
|
23023
|
-
* HTML template for the print header. Should be valid HTML markup with following
|
|
23024
|
-
* classes used to inject printing values into them: `date` (formatted print date),
|
|
23025
|
-
* `title` (document title), `url` (document location), `pageNumber` (current page
|
|
23026
|
-
* number) and `totalPages` (total pages in the document). For example, `<span
|
|
23027
|
-
* class=title></span>` would generate span containing the title.
|
|
23028
|
-
*/
|
|
23029
|
-
headerTemplate?: string;
|
|
23030
|
-
/**
|
|
23031
|
-
* HTML template for the print footer. Should use the same format as the
|
|
23032
|
-
* `headerTemplate`.
|
|
23033
|
-
*/
|
|
23034
|
-
footerTemplate?: string;
|
|
23035
|
-
/**
|
|
23036
|
-
* Whether or not to prefer page size as defined by css. Defaults to false, in
|
|
23037
|
-
* which case the content will be scaled to fit the paper size.
|
|
23038
|
-
*/
|
|
23039
|
-
preferCSSPageSize?: boolean;
|
|
23040
|
-
/**
|
|
23041
|
-
* Whether or not to generate a tagged (accessible) PDF. Defaults to false. As this
|
|
23042
|
-
* property is experimental, the generated PDF may not adhere fully to PDF/UA and
|
|
23043
|
-
* WCAG standards.
|
|
23044
|
-
*
|
|
23045
|
-
* @experimental
|
|
23046
|
-
*/
|
|
23047
|
-
generateTaggedPDF?: boolean;
|
|
23048
|
-
/**
|
|
23049
|
-
* Whether or not to generate a PDF document outline from content headers. Defaults
|
|
23050
|
-
* to false.
|
|
23051
|
-
*
|
|
23052
|
-
* @experimental
|
|
23053
|
-
*/
|
|
23054
|
-
generateDocumentOutline?: boolean;
|
|
23055
|
-
}
|
|
23056
|
-
|
|
23057
23098
|
interface Privileges {
|
|
23058
23099
|
/**
|
|
23059
23100
|
* Default false.
|
|
@@ -24985,7 +25026,6 @@ declare namespace Electron {
|
|
|
24985
25026
|
type PowerMonitorSpeedLimitChangeEventParams = Electron.PowerMonitorSpeedLimitChangeEventParams;
|
|
24986
25027
|
type PowerMonitorThermalStateChangeEventParams = Electron.PowerMonitorThermalStateChangeEventParams;
|
|
24987
25028
|
type PreconnectOptions = Electron.PreconnectOptions;
|
|
24988
|
-
type PrintToPDFOptions = Electron.PrintToPDFOptions;
|
|
24989
25029
|
type Privileges = Electron.Privileges;
|
|
24990
25030
|
type ProgressBarOptions = Electron.ProgressBarOptions;
|
|
24991
25031
|
type Provider = Electron.Provider;
|
|
@@ -25128,6 +25168,8 @@ declare namespace Electron {
|
|
|
25128
25168
|
type PreloadScript = Electron.PreloadScript;
|
|
25129
25169
|
type PreloadScriptRegistration = Electron.PreloadScriptRegistration;
|
|
25130
25170
|
type PrinterInfo = Electron.PrinterInfo;
|
|
25171
|
+
type PrintToPDFMargins = Electron.PrintToPDFMargins;
|
|
25172
|
+
type PrintToPDFOptions = Electron.PrintToPDFOptions;
|
|
25131
25173
|
type ProcessMemoryInfo = Electron.ProcessMemoryInfo;
|
|
25132
25174
|
type ProcessMetric = Electron.ProcessMetric;
|
|
25133
25175
|
type Product = Electron.Product;
|
|
@@ -25392,7 +25434,6 @@ declare namespace Electron {
|
|
|
25392
25434
|
type PowerMonitorSpeedLimitChangeEventParams = Electron.PowerMonitorSpeedLimitChangeEventParams;
|
|
25393
25435
|
type PowerMonitorThermalStateChangeEventParams = Electron.PowerMonitorThermalStateChangeEventParams;
|
|
25394
25436
|
type PreconnectOptions = Electron.PreconnectOptions;
|
|
25395
|
-
type PrintToPDFOptions = Electron.PrintToPDFOptions;
|
|
25396
25437
|
type Privileges = Electron.Privileges;
|
|
25397
25438
|
type ProgressBarOptions = Electron.ProgressBarOptions;
|
|
25398
25439
|
type Provider = Electron.Provider;
|
|
@@ -25535,6 +25576,8 @@ declare namespace Electron {
|
|
|
25535
25576
|
type PreloadScript = Electron.PreloadScript;
|
|
25536
25577
|
type PreloadScriptRegistration = Electron.PreloadScriptRegistration;
|
|
25537
25578
|
type PrinterInfo = Electron.PrinterInfo;
|
|
25579
|
+
type PrintToPDFMargins = Electron.PrintToPDFMargins;
|
|
25580
|
+
type PrintToPDFOptions = Electron.PrintToPDFOptions;
|
|
25538
25581
|
type ProcessMemoryInfo = Electron.ProcessMemoryInfo;
|
|
25539
25582
|
type ProcessMetric = Electron.ProcessMetric;
|
|
25540
25583
|
type Product = Electron.Product;
|
|
@@ -25726,7 +25769,6 @@ declare namespace Electron {
|
|
|
25726
25769
|
type PowerMonitorSpeedLimitChangeEventParams = Electron.PowerMonitorSpeedLimitChangeEventParams;
|
|
25727
25770
|
type PowerMonitorThermalStateChangeEventParams = Electron.PowerMonitorThermalStateChangeEventParams;
|
|
25728
25771
|
type PreconnectOptions = Electron.PreconnectOptions;
|
|
25729
|
-
type PrintToPDFOptions = Electron.PrintToPDFOptions;
|
|
25730
25772
|
type Privileges = Electron.Privileges;
|
|
25731
25773
|
type ProgressBarOptions = Electron.ProgressBarOptions;
|
|
25732
25774
|
type Provider = Electron.Provider;
|
|
@@ -25869,6 +25911,8 @@ declare namespace Electron {
|
|
|
25869
25911
|
type PreloadScript = Electron.PreloadScript;
|
|
25870
25912
|
type PreloadScriptRegistration = Electron.PreloadScriptRegistration;
|
|
25871
25913
|
type PrinterInfo = Electron.PrinterInfo;
|
|
25914
|
+
type PrintToPDFMargins = Electron.PrintToPDFMargins;
|
|
25915
|
+
type PrintToPDFOptions = Electron.PrintToPDFOptions;
|
|
25872
25916
|
type ProcessMemoryInfo = Electron.ProcessMemoryInfo;
|
|
25873
25917
|
type ProcessMetric = Electron.ProcessMetric;
|
|
25874
25918
|
type Product = Electron.Product;
|
|
@@ -26059,7 +26103,6 @@ declare namespace Electron {
|
|
|
26059
26103
|
type PowerMonitorSpeedLimitChangeEventParams = Electron.PowerMonitorSpeedLimitChangeEventParams;
|
|
26060
26104
|
type PowerMonitorThermalStateChangeEventParams = Electron.PowerMonitorThermalStateChangeEventParams;
|
|
26061
26105
|
type PreconnectOptions = Electron.PreconnectOptions;
|
|
26062
|
-
type PrintToPDFOptions = Electron.PrintToPDFOptions;
|
|
26063
26106
|
type Privileges = Electron.Privileges;
|
|
26064
26107
|
type ProgressBarOptions = Electron.ProgressBarOptions;
|
|
26065
26108
|
type Provider = Electron.Provider;
|
|
@@ -26202,6 +26245,8 @@ declare namespace Electron {
|
|
|
26202
26245
|
type PreloadScript = Electron.PreloadScript;
|
|
26203
26246
|
type PreloadScriptRegistration = Electron.PreloadScriptRegistration;
|
|
26204
26247
|
type PrinterInfo = Electron.PrinterInfo;
|
|
26248
|
+
type PrintToPDFMargins = Electron.PrintToPDFMargins;
|
|
26249
|
+
type PrintToPDFOptions = Electron.PrintToPDFOptions;
|
|
26205
26250
|
type ProcessMemoryInfo = Electron.ProcessMemoryInfo;
|
|
26206
26251
|
type ProcessMetric = Electron.ProcessMetric;
|
|
26207
26252
|
type Product = Electron.Product;
|
|
@@ -26487,7 +26532,6 @@ declare namespace Electron {
|
|
|
26487
26532
|
type PowerMonitorSpeedLimitChangeEventParams = Electron.PowerMonitorSpeedLimitChangeEventParams;
|
|
26488
26533
|
type PowerMonitorThermalStateChangeEventParams = Electron.PowerMonitorThermalStateChangeEventParams;
|
|
26489
26534
|
type PreconnectOptions = Electron.PreconnectOptions;
|
|
26490
|
-
type PrintToPDFOptions = Electron.PrintToPDFOptions;
|
|
26491
26535
|
type Privileges = Electron.Privileges;
|
|
26492
26536
|
type ProgressBarOptions = Electron.ProgressBarOptions;
|
|
26493
26537
|
type Provider = Electron.Provider;
|
|
@@ -26630,6 +26674,8 @@ declare namespace Electron {
|
|
|
26630
26674
|
type PreloadScript = Electron.PreloadScript;
|
|
26631
26675
|
type PreloadScriptRegistration = Electron.PreloadScriptRegistration;
|
|
26632
26676
|
type PrinterInfo = Electron.PrinterInfo;
|
|
26677
|
+
type PrintToPDFMargins = Electron.PrintToPDFMargins;
|
|
26678
|
+
type PrintToPDFOptions = Electron.PrintToPDFOptions;
|
|
26633
26679
|
type ProcessMemoryInfo = Electron.ProcessMemoryInfo;
|
|
26634
26680
|
type ProcessMetric = Electron.ProcessMetric;
|
|
26635
26681
|
type Product = Electron.Product;
|
package/dist/version.json
CHANGED