1 | // Type definitions for Electron 33.0.2
|
2 | // Project: http://electronjs.org/
|
3 | // Definitions by: The Electron Team <https://github.com/electron/electron>
|
4 | // Definitions: https://github.com/electron/typescript-definitions
|
5 |
|
6 | /// <reference types="node" />
|
7 |
|
8 | type DOMEvent = Event;
|
9 | type GlobalResponse = Response;
|
10 | type GlobalRequest = Request;
|
11 |
|
12 | declare namespace Electron {
|
13 | const NodeEventEmitter: typeof import('events').EventEmitter;
|
14 |
|
15 | type Accelerator = string;
|
16 | type Event<Params extends object = {}> = {
|
17 | preventDefault: () => void;
|
18 | readonly defaultPrevented: boolean;
|
19 | } & Params;
|
20 |
|
21 | interface App extends NodeJS.EventEmitter {
|
22 |
|
23 | // Docs: https://electronjs.org/docs/api/app
|
24 |
|
25 | /**
|
26 | * Emitted when Chrome's accessibility support changes. This event fires when
|
27 | * assistive technologies, such as screen readers, are enabled or disabled. See
|
28 | * https://www.chromium.org/developers/design-documents/accessibility for more
|
29 | * details.
|
30 | *
|
31 | * @platform darwin,win32
|
32 | */
|
33 | on(event: 'accessibility-support-changed', listener: (event: Event,
|
34 | /**
|
35 | * `true` when Chrome's accessibility support is enabled, `false` otherwise.
|
36 | */
|
37 | accessibilitySupportEnabled: boolean) => void): this;
|
38 | /**
|
39 | * @platform darwin,win32
|
40 | */
|
41 | off(event: 'accessibility-support-changed', listener: (event: Event,
|
42 | /**
|
43 | * `true` when Chrome's accessibility support is enabled, `false` otherwise.
|
44 | */
|
45 | accessibilitySupportEnabled: boolean) => void): this;
|
46 | /**
|
47 | * @platform darwin,win32
|
48 | */
|
49 | once(event: 'accessibility-support-changed', listener: (event: Event,
|
50 | /**
|
51 | * `true` when Chrome's accessibility support is enabled, `false` otherwise.
|
52 | */
|
53 | accessibilitySupportEnabled: boolean) => void): this;
|
54 | /**
|
55 | * @platform darwin,win32
|
56 | */
|
57 | addListener(event: 'accessibility-support-changed', listener: (event: Event,
|
58 | /**
|
59 | * `true` when Chrome's accessibility support is enabled, `false` otherwise.
|
60 | */
|
61 | accessibilitySupportEnabled: boolean) => void): this;
|
62 | /**
|
63 | * @platform darwin,win32
|
64 | */
|
65 | removeListener(event: 'accessibility-support-changed', listener: (event: Event,
|
66 | /**
|
67 | * `true` when Chrome's accessibility support is enabled, `false` otherwise.
|
68 | */
|
69 | accessibilitySupportEnabled: boolean) => void): this;
|
70 | /**
|
71 | * Emitted when the application is activated. Various actions can trigger this
|
72 | * event, such as launching the application for the first time, attempting to
|
73 | * re-launch the application when it's already running, or clicking on the
|
74 | * application's dock or taskbar icon.
|
75 | *
|
76 | * @platform darwin
|
77 | */
|
78 | on(event: 'activate', listener: (event: Event,
|
79 | hasVisibleWindows: boolean) => void): this;
|
80 | /**
|
81 | * @platform darwin
|
82 | */
|
83 | off(event: 'activate', listener: (event: Event,
|
84 | hasVisibleWindows: boolean) => void): this;
|
85 | /**
|
86 | * @platform darwin
|
87 | */
|
88 | once(event: 'activate', listener: (event: Event,
|
89 | hasVisibleWindows: boolean) => void): this;
|
90 | /**
|
91 | * @platform darwin
|
92 | */
|
93 | addListener(event: 'activate', listener: (event: Event,
|
94 | hasVisibleWindows: boolean) => void): this;
|
95 | /**
|
96 | * @platform darwin
|
97 | */
|
98 | removeListener(event: 'activate', listener: (event: Event,
|
99 | hasVisibleWindows: boolean) => void): this;
|
100 | /**
|
101 | * Emitted during Handoff after an activity from this device was successfully
|
102 | * resumed on another one.
|
103 | *
|
104 | * @platform darwin
|
105 | */
|
106 | on(event: 'activity-was-continued', listener: (event: Event,
|
107 | /**
|
108 | * A string identifying the activity. Maps to `NSUserActivity.activityType`.
|
109 | */
|
110 | type: string,
|
111 | /**
|
112 | * Contains app-specific state stored by the activity.
|
113 | */
|
114 | userInfo: unknown) => void): this;
|
115 | /**
|
116 | * @platform darwin
|
117 | */
|
118 | off(event: 'activity-was-continued', listener: (event: Event,
|
119 | /**
|
120 | * A string identifying the activity. Maps to `NSUserActivity.activityType`.
|
121 | */
|
122 | type: string,
|
123 | /**
|
124 | * Contains app-specific state stored by the activity.
|
125 | */
|
126 | userInfo: unknown) => void): this;
|
127 | /**
|
128 | * @platform darwin
|
129 | */
|
130 | once(event: 'activity-was-continued', listener: (event: Event,
|
131 | /**
|
132 | * A string identifying the activity. Maps to `NSUserActivity.activityType`.
|
133 | */
|
134 | type: string,
|
135 | /**
|
136 | * Contains app-specific state stored by the activity.
|
137 | */
|
138 | userInfo: unknown) => void): this;
|
139 | /**
|
140 | * @platform darwin
|
141 | */
|
142 | addListener(event: 'activity-was-continued', listener: (event: Event,
|
143 | /**
|
144 | * A string identifying the activity. Maps to `NSUserActivity.activityType`.
|
145 | */
|
146 | type: string,
|
147 | /**
|
148 | * Contains app-specific state stored by the activity.
|
149 | */
|
150 | userInfo: unknown) => void): this;
|
151 | /**
|
152 | * @platform darwin
|
153 | */
|
154 | removeListener(event: 'activity-was-continued', listener: (event: Event,
|
155 | /**
|
156 | * A string identifying the activity. Maps to `NSUserActivity.activityType`.
|
157 | */
|
158 | type: string,
|
159 | /**
|
160 | * Contains app-specific state stored by the activity.
|
161 | */
|
162 | userInfo: unknown) => void): this;
|
163 | /**
|
164 | * Emitted before the application starts closing its windows. Calling
|
165 | * `event.preventDefault()` will prevent the default behavior, which is terminating
|
166 | * the application.
|
167 | *
|
168 | * **Note:** If application quit was initiated by `autoUpdater.quitAndInstall()`,
|
169 | * then `before-quit` is emitted _after_ emitting `close` event on all windows and
|
170 | * closing them.
|
171 | *
|
172 | * **Note:** On Windows, this event will not be emitted if the app is closed due to
|
173 | * a shutdown/restart of the system or a user logout.
|
174 | */
|
175 | on(event: 'before-quit', listener: (event: Event) => void): this;
|
176 | off(event: 'before-quit', listener: (event: Event) => void): this;
|
177 | once(event: 'before-quit', listener: (event: Event) => void): this;
|
178 | addListener(event: 'before-quit', listener: (event: Event) => void): this;
|
179 | removeListener(event: 'before-quit', listener: (event: Event) => void): this;
|
180 | /**
|
181 | * Emitted when a browserWindow gets blurred.
|
182 | */
|
183 | on(event: 'browser-window-blur', listener: (event: Event,
|
184 | window: BrowserWindow) => void): this;
|
185 | off(event: 'browser-window-blur', listener: (event: Event,
|
186 | window: BrowserWindow) => void): this;
|
187 | once(event: 'browser-window-blur', listener: (event: Event,
|
188 | window: BrowserWindow) => void): this;
|
189 | addListener(event: 'browser-window-blur', listener: (event: Event,
|
190 | window: BrowserWindow) => void): this;
|
191 | removeListener(event: 'browser-window-blur', listener: (event: Event,
|
192 | window: BrowserWindow) => void): this;
|
193 | /**
|
194 | * Emitted when a new browserWindow is created.
|
195 | */
|
196 | on(event: 'browser-window-created', listener: (event: Event,
|
197 | window: BrowserWindow) => void): this;
|
198 | off(event: 'browser-window-created', listener: (event: Event,
|
199 | window: BrowserWindow) => void): this;
|
200 | once(event: 'browser-window-created', listener: (event: Event,
|
201 | window: BrowserWindow) => void): this;
|
202 | addListener(event: 'browser-window-created', listener: (event: Event,
|
203 | window: BrowserWindow) => void): this;
|
204 | removeListener(event: 'browser-window-created', listener: (event: Event,
|
205 | window: BrowserWindow) => void): this;
|
206 | /**
|
207 | * Emitted when a browserWindow gets focused.
|
208 | */
|
209 | on(event: 'browser-window-focus', listener: (event: Event,
|
210 | window: BrowserWindow) => void): this;
|
211 | off(event: 'browser-window-focus', listener: (event: Event,
|
212 | window: BrowserWindow) => void): this;
|
213 | once(event: 'browser-window-focus', listener: (event: Event,
|
214 | window: BrowserWindow) => void): this;
|
215 | addListener(event: 'browser-window-focus', listener: (event: Event,
|
216 | window: BrowserWindow) => void): this;
|
217 | removeListener(event: 'browser-window-focus', listener: (event: Event,
|
218 | window: BrowserWindow) => void): this;
|
219 | /**
|
220 | * Emitted when failed to verify the `certificate` for `url`, to trust the
|
221 | * certificate you should prevent the default behavior with
|
222 | * `event.preventDefault()` and call `callback(true)`.
|
223 | */
|
224 | on(event: 'certificate-error', listener: (event: Event,
|
225 | webContents: WebContents,
|
226 | url: string,
|
227 | /**
|
228 | * The error code
|
229 | */
|
230 | error: string,
|
231 | certificate: Certificate,
|
232 | callback: (isTrusted: boolean) => void,
|
233 | isMainFrame: boolean) => void): this;
|
234 | off(event: 'certificate-error', listener: (event: Event,
|
235 | webContents: WebContents,
|
236 | url: string,
|
237 | /**
|
238 | * The error code
|
239 | */
|
240 | error: string,
|
241 | certificate: Certificate,
|
242 | callback: (isTrusted: boolean) => void,
|
243 | isMainFrame: boolean) => void): this;
|
244 | once(event: 'certificate-error', listener: (event: Event,
|
245 | webContents: WebContents,
|
246 | url: string,
|
247 | /**
|
248 | * The error code
|
249 | */
|
250 | error: string,
|
251 | certificate: Certificate,
|
252 | callback: (isTrusted: boolean) => void,
|
253 | isMainFrame: boolean) => void): this;
|
254 | addListener(event: 'certificate-error', listener: (event: Event,
|
255 | webContents: WebContents,
|
256 | url: string,
|
257 | /**
|
258 | * The error code
|
259 | */
|
260 | error: string,
|
261 | certificate: Certificate,
|
262 | callback: (isTrusted: boolean) => void,
|
263 | isMainFrame: boolean) => void): this;
|
264 | removeListener(event: 'certificate-error', listener: (event: Event,
|
265 | webContents: WebContents,
|
266 | url: string,
|
267 | /**
|
268 | * The error code
|
269 | */
|
270 | error: string,
|
271 | certificate: Certificate,
|
272 | callback: (isTrusted: boolean) => void,
|
273 | isMainFrame: boolean) => void): this;
|
274 | /**
|
275 | * Emitted when the child process unexpectedly disappears. This is normally because
|
276 | * it was crashed or killed. It does not include renderer processes.
|
277 | */
|
278 | on(event: 'child-process-gone', listener: (event: Event,
|
279 | details: Details) => void): this;
|
280 | off(event: 'child-process-gone', listener: (event: Event,
|
281 | details: Details) => void): this;
|
282 | once(event: 'child-process-gone', listener: (event: Event,
|
283 | details: Details) => void): this;
|
284 | addListener(event: 'child-process-gone', listener: (event: Event,
|
285 | details: Details) => void): this;
|
286 | removeListener(event: 'child-process-gone', listener: (event: Event,
|
287 | details: Details) => void): this;
|
288 | /**
|
289 | * Emitted during Handoff when an activity from a different device wants to be
|
290 | * resumed. You should call `event.preventDefault()` if you want to handle this
|
291 | * event.
|
292 | *
|
293 | * A user activity can be continued only in an app that has the same developer Team
|
294 | * ID as the activity's source app and that supports the activity's type. Supported
|
295 | * activity types are specified in the app's `Info.plist` under the
|
296 | * `NSUserActivityTypes` key.
|
297 | *
|
298 | * @platform darwin
|
299 | */
|
300 | on(event: 'continue-activity', listener: (event: Event,
|
301 | /**
|
302 | * A string identifying the activity. Maps to `NSUserActivity.activityType`.
|
303 | */
|
304 | type: string,
|
305 | /**
|
306 | * Contains app-specific state stored by the activity on another device.
|
307 | */
|
308 | userInfo: unknown,
|
309 | details: ContinueActivityDetails) => void): this;
|
310 | /**
|
311 | * @platform darwin
|
312 | */
|
313 | off(event: 'continue-activity', listener: (event: Event,
|
314 | /**
|
315 | * A string identifying the activity. Maps to `NSUserActivity.activityType`.
|
316 | */
|
317 | type: string,
|
318 | /**
|
319 | * Contains app-specific state stored by the activity on another device.
|
320 | */
|
321 | userInfo: unknown,
|
322 | details: ContinueActivityDetails) => void): this;
|
323 | /**
|
324 | * @platform darwin
|
325 | */
|
326 | once(event: 'continue-activity', listener: (event: Event,
|
327 | /**
|
328 | * A string identifying the activity. Maps to `NSUserActivity.activityType`.
|
329 | */
|
330 | type: string,
|
331 | /**
|
332 | * Contains app-specific state stored by the activity on another device.
|
333 | */
|
334 | userInfo: unknown,
|
335 | details: ContinueActivityDetails) => void): this;
|
336 | /**
|
337 | * @platform darwin
|
338 | */
|
339 | addListener(event: 'continue-activity', listener: (event: Event,
|
340 | /**
|
341 | * A string identifying the activity. Maps to `NSUserActivity.activityType`.
|
342 | */
|
343 | type: string,
|
344 | /**
|
345 | * Contains app-specific state stored by the activity on another device.
|
346 | */
|
347 | userInfo: unknown,
|
348 | details: ContinueActivityDetails) => void): this;
|
349 | /**
|
350 | * @platform darwin
|
351 | */
|
352 | removeListener(event: 'continue-activity', listener: (event: Event,
|
353 | /**
|
354 | * A string identifying the activity. Maps to `NSUserActivity.activityType`.
|
355 | */
|
356 | type: string,
|
357 | /**
|
358 | * Contains app-specific state stored by the activity on another device.
|
359 | */
|
360 | userInfo: unknown,
|
361 | details: ContinueActivityDetails) => void): this;
|
362 | /**
|
363 | * Emitted during Handoff when an activity from a different device fails to be
|
364 | * resumed.
|
365 | *
|
366 | * @platform darwin
|
367 | */
|
368 | on(event: 'continue-activity-error', listener: (event: Event,
|
369 | /**
|
370 | * A string identifying the activity. Maps to `NSUserActivity.activityType`.
|
371 | */
|
372 | type: string,
|
373 | /**
|
374 | * A string with the error's localized description.
|
375 | */
|
376 | error: string) => void): this;
|
377 | /**
|
378 | * @platform darwin
|
379 | */
|
380 | off(event: 'continue-activity-error', listener: (event: Event,
|
381 | /**
|
382 | * A string identifying the activity. Maps to `NSUserActivity.activityType`.
|
383 | */
|
384 | type: string,
|
385 | /**
|
386 | * A string with the error's localized description.
|
387 | */
|
388 | error: string) => void): this;
|
389 | /**
|
390 | * @platform darwin
|
391 | */
|
392 | once(event: 'continue-activity-error', listener: (event: Event,
|
393 | /**
|
394 | * A string identifying the activity. Maps to `NSUserActivity.activityType`.
|
395 | */
|
396 | type: string,
|
397 | /**
|
398 | * A string with the error's localized description.
|
399 | */
|
400 | error: string) => void): this;
|
401 | /**
|
402 | * @platform darwin
|
403 | */
|
404 | addListener(event: 'continue-activity-error', listener: (event: Event,
|
405 | /**
|
406 | * A string identifying the activity. Maps to `NSUserActivity.activityType`.
|
407 | */
|
408 | type: string,
|
409 | /**
|
410 | * A string with the error's localized description.
|
411 | */
|
412 | error: string) => void): this;
|
413 | /**
|
414 | * @platform darwin
|
415 | */
|
416 | removeListener(event: 'continue-activity-error', listener: (event: Event,
|
417 | /**
|
418 | * A string identifying the activity. Maps to `NSUserActivity.activityType`.
|
419 | */
|
420 | type: string,
|
421 | /**
|
422 | * A string with the error's localized description.
|
423 | */
|
424 | error: string) => void): this;
|
425 | /**
|
426 | * Emitted when the application becomes active. This differs from the `activate`
|
427 | * event in that `did-become-active` is emitted every time the app becomes active,
|
428 | * not only when Dock icon is clicked or application is re-launched. It is also
|
429 | * emitted when a user switches to the app via the macOS App Switcher.
|
430 | *
|
431 | * @platform darwin
|
432 | */
|
433 | on(event: 'did-become-active', listener: (event: Event) => void): this;
|
434 | /**
|
435 | * @platform darwin
|
436 | */
|
437 | off(event: 'did-become-active', listener: (event: Event) => void): this;
|
438 | /**
|
439 | * @platform darwin
|
440 | */
|
441 | once(event: 'did-become-active', listener: (event: Event) => void): this;
|
442 | /**
|
443 | * @platform darwin
|
444 | */
|
445 | addListener(event: 'did-become-active', listener: (event: Event) => void): this;
|
446 | /**
|
447 | * @platform darwin
|
448 | */
|
449 | removeListener(event: 'did-become-active', listener: (event: Event) => void): this;
|
450 | /**
|
451 | * Emitted when the app is no longer active and doesn’t have focus. This can be
|
452 | * triggered, for example, by clicking on another application or by using the macOS
|
453 | * App Switcher to switch to another application.
|
454 | *
|
455 | * @platform darwin
|
456 | */
|
457 | on(event: 'did-resign-active', listener: (event: Event) => void): this;
|
458 | /**
|
459 | * @platform darwin
|
460 | */
|
461 | off(event: 'did-resign-active', listener: (event: Event) => void): this;
|
462 | /**
|
463 | * @platform darwin
|
464 | */
|
465 | once(event: 'did-resign-active', listener: (event: Event) => void): this;
|
466 | /**
|
467 | * @platform darwin
|
468 | */
|
469 | addListener(event: 'did-resign-active', listener: (event: Event) => void): this;
|
470 | /**
|
471 | * @platform darwin
|
472 | */
|
473 | removeListener(event: 'did-resign-active', listener: (event: Event) => void): this;
|
474 | /**
|
475 | * Emitted whenever there is a GPU info update.
|
476 | */
|
477 | on(event: 'gpu-info-update', listener: () => void): this;
|
478 | off(event: 'gpu-info-update', listener: () => void): this;
|
479 | once(event: 'gpu-info-update', listener: () => void): this;
|
480 | addListener(event: 'gpu-info-update', listener: () => void): this;
|
481 | removeListener(event: 'gpu-info-update', listener: () => void): this;
|
482 | /**
|
483 | * Emitted when `webContents` or Utility process wants to do basic auth.
|
484 | *
|
485 | * The default behavior is to cancel all authentications. To override this you
|
486 | * should prevent the default behavior with `event.preventDefault()` and call
|
487 | * `callback(username, password)` with the credentials.
|
488 | *
|
489 | * If `callback` is called without a username or password, the authentication
|
490 | * request will be cancelled and the authentication error will be returned to the
|
491 | * page.
|
492 | */
|
493 | on(event: 'login', listener: (event: Event,
|
494 | webContents: WebContents,
|
495 | authenticationResponseDetails: AuthenticationResponseDetails,
|
496 | authInfo: AuthInfo,
|
497 | callback: (username?: string, password?: string) => void) => void): this;
|
498 | off(event: 'login', listener: (event: Event,
|
499 | webContents: WebContents,
|
500 | authenticationResponseDetails: AuthenticationResponseDetails,
|
501 | authInfo: AuthInfo,
|
502 | callback: (username?: string, password?: string) => void) => void): this;
|
503 | once(event: 'login', listener: (event: Event,
|
504 | webContents: WebContents,
|
505 | authenticationResponseDetails: AuthenticationResponseDetails,
|
506 | authInfo: AuthInfo,
|
507 | callback: (username?: string, password?: string) => void) => void): this;
|
508 | addListener(event: 'login', listener: (event: Event,
|
509 | webContents: WebContents,
|
510 | authenticationResponseDetails: AuthenticationResponseDetails,
|
511 | authInfo: AuthInfo,
|
512 | callback: (username?: string, password?: string) => void) => void): this;
|
513 | removeListener(event: 'login', listener: (event: Event,
|
514 | webContents: WebContents,
|
515 | authenticationResponseDetails: AuthenticationResponseDetails,
|
516 | authInfo: AuthInfo,
|
517 | callback: (username?: string, password?: string) => void) => void): this;
|
518 | /**
|
519 | * Emitted when the user clicks the native macOS new tab button. The new tab button
|
520 | * is only visible if the current `BrowserWindow` has a `tabbingIdentifier`
|
521 | *
|
522 | * @platform darwin
|
523 | */
|
524 | on(event: 'new-window-for-tab', listener: (event: Event) => void): this;
|
525 | /**
|
526 | * @platform darwin
|
527 | */
|
528 | off(event: 'new-window-for-tab', listener: (event: Event) => void): this;
|
529 | /**
|
530 | * @platform darwin
|
531 | */
|
532 | once(event: 'new-window-for-tab', listener: (event: Event) => void): this;
|
533 | /**
|
534 | * @platform darwin
|
535 | */
|
536 | addListener(event: 'new-window-for-tab', listener: (event: Event) => void): this;
|
537 | /**
|
538 | * @platform darwin
|
539 | */
|
540 | removeListener(event: 'new-window-for-tab', listener: (event: Event) => void): this;
|
541 | /**
|
542 | * Emitted when the user wants to open a file with the application. The `open-file`
|
543 | * event is usually emitted when the application is already open and the OS wants
|
544 | * to reuse the application to open the file. `open-file` is also emitted when a
|
545 | * file is dropped onto the dock and the application is not yet running. Make sure
|
546 | * to listen for the `open-file` event very early in your application startup to
|
547 | * handle this case (even before the `ready` event is emitted).
|
548 | *
|
549 | * You should call `event.preventDefault()` if you want to handle this event.
|
550 | *
|
551 | * On Windows, you have to parse `process.argv` (in the main process) to get the
|
552 | * filepath.
|
553 | *
|
554 | * @platform darwin
|
555 | */
|
556 | on(event: 'open-file', listener: (event: Event,
|
557 | path: string) => void): this;
|
558 | /**
|
559 | * @platform darwin
|
560 | */
|
561 | off(event: 'open-file', listener: (event: Event,
|
562 | path: string) => void): this;
|
563 | /**
|
564 | * @platform darwin
|
565 | */
|
566 | once(event: 'open-file', listener: (event: Event,
|
567 | path: string) => void): this;
|
568 | /**
|
569 | * @platform darwin
|
570 | */
|
571 | addListener(event: 'open-file', listener: (event: Event,
|
572 | path: string) => void): this;
|
573 | /**
|
574 | * @platform darwin
|
575 | */
|
576 | removeListener(event: 'open-file', listener: (event: Event,
|
577 | path: string) => void): this;
|
578 | /**
|
579 | * Emitted when the user wants to open a URL with the application. Your
|
580 | * application's `Info.plist` file must define the URL scheme within the
|
581 | * `CFBundleURLTypes` key, and set `NSPrincipalClass` to `AtomApplication`.
|
582 | *
|
583 | * As with the `open-file` event, be sure to register a listener for the `open-url`
|
584 | * event early in your application startup to detect if the application is being
|
585 | * opened to handle a URL. If you register the listener in response to a `ready`
|
586 | * event, you'll miss URLs that trigger the launch of your application.
|
587 | *
|
588 | * @platform darwin
|
589 | */
|
590 | on(event: 'open-url', listener: (event: Event,
|
591 | url: string) => void): this;
|
592 | /**
|
593 | * @platform darwin
|
594 | */
|
595 | off(event: 'open-url', listener: (event: Event,
|
596 | url: string) => void): this;
|
597 | /**
|
598 | * @platform darwin
|
599 | */
|
600 | once(event: 'open-url', listener: (event: Event,
|
601 | url: string) => void): this;
|
602 | /**
|
603 | * @platform darwin
|
604 | */
|
605 | addListener(event: 'open-url', listener: (event: Event,
|
606 | url: string) => void): this;
|
607 | /**
|
608 | * @platform darwin
|
609 | */
|
610 | removeListener(event: 'open-url', listener: (event: Event,
|
611 | url: string) => void): this;
|
612 | /**
|
613 | * Emitted when the application is quitting.
|
614 | *
|
615 | * **Note:** On Windows, this event will not be emitted if the app is closed due to
|
616 | * a shutdown/restart of the system or a user logout.
|
617 | */
|
618 | on(event: 'quit', listener: (event: Event,
|
619 | exitCode: number) => void): this;
|
620 | off(event: 'quit', listener: (event: Event,
|
621 | exitCode: number) => void): this;
|
622 | once(event: 'quit', listener: (event: Event,
|
623 | exitCode: number) => void): this;
|
624 | addListener(event: 'quit', listener: (event: Event,
|
625 | exitCode: number) => void): this;
|
626 | removeListener(event: 'quit', listener: (event: Event,
|
627 | exitCode: number) => void): this;
|
628 | /**
|
629 | * Emitted once, when Electron has finished initializing. On macOS, `launchInfo`
|
630 | * holds the `userInfo` of the `NSUserNotification` or information from
|
631 | * `UNNotificationResponse` that was used to open the application, if it was
|
632 | * launched from Notification Center. You can also call `app.isReady()` to check if
|
633 | * this event has already fired and `app.whenReady()` to get a Promise that is
|
634 | * fulfilled when Electron is initialized.
|
635 | *
|
636 | * **Note**: The `ready` event is only fired after the main process has finished
|
637 | * running the first tick of the event loop. If an Electron API needs to be called
|
638 | * before the `ready` event, ensure that it is called synchronously in the
|
639 | * top-level context of the main process.
|
640 | */
|
641 | on(event: 'ready', listener: (event: Event,
|
642 | /**
|
643 | * @platform darwin
|
644 | */
|
645 | launchInfo: (Record<string, any>) | (NotificationResponse)) => void): this;
|
646 | off(event: 'ready', listener: (event: Event,
|
647 | /**
|
648 | * @platform darwin
|
649 | */
|
650 | launchInfo: (Record<string, any>) | (NotificationResponse)) => void): this;
|
651 | once(event: 'ready', listener: (event: Event,
|
652 | /**
|
653 | * @platform darwin
|
654 | */
|
655 | launchInfo: (Record<string, any>) | (NotificationResponse)) => void): this;
|
656 | addListener(event: 'ready', listener: (event: Event,
|
657 | /**
|
658 | * @platform darwin
|
659 | */
|
660 | launchInfo: (Record<string, any>) | (NotificationResponse)) => void): this;
|
661 | removeListener(event: 'ready', listener: (event: Event,
|
662 | /**
|
663 | * @platform darwin
|
664 | */
|
665 | launchInfo: (Record<string, any>) | (NotificationResponse)) => void): this;
|
666 | /**
|
667 | * Emitted when the renderer process unexpectedly disappears. This is normally
|
668 | * because it was crashed or killed.
|
669 | */
|
670 | on(event: 'render-process-gone', listener: (event: Event,
|
671 | webContents: WebContents,
|
672 | details: RenderProcessGoneDetails) => void): this;
|
673 | off(event: 'render-process-gone', listener: (event: Event,
|
674 | webContents: WebContents,
|
675 | details: RenderProcessGoneDetails) => void): this;
|
676 | once(event: 'render-process-gone', listener: (event: Event,
|
677 | webContents: WebContents,
|
678 | details: RenderProcessGoneDetails) => void): this;
|
679 | addListener(event: 'render-process-gone', listener: (event: Event,
|
680 | webContents: WebContents,
|
681 | details: RenderProcessGoneDetails) => void): this;
|
682 | removeListener(event: 'render-process-gone', listener: (event: Event,
|
683 | webContents: WebContents,
|
684 | details: RenderProcessGoneDetails) => void): this;
|
685 | /**
|
686 | * This event will be emitted inside the primary instance of your application when
|
687 | * a second instance has been executed and calls `app.requestSingleInstanceLock()`.
|
688 | *
|
689 | * `argv` is an Array of the second instance's command line arguments, and
|
690 | * `workingDirectory` is its current working directory. Usually applications
|
691 | * respond to this by making their primary window focused and non-minimized.
|
692 | *
|
693 | * **Note:** `argv` will not be exactly the same list of arguments as those passed
|
694 | * to the second instance. The order might change and additional arguments might be
|
695 | * appended. If you need to maintain the exact same arguments, it's advised to use
|
696 | * `additionalData` instead.
|
697 | *
|
698 | * **Note:** If the second instance is started by a different user than the first,
|
699 | * the `argv` array will not include the arguments.
|
700 | *
|
701 | * This event is guaranteed to be emitted after the `ready` event of `app` gets
|
702 | * emitted.
|
703 | *
|
704 | * **Note:** Extra command line arguments might be added by Chromium, such as
|
705 | * `--original-process-start-time`.
|
706 | */
|
707 | on(event: 'second-instance', listener: (event: Event,
|
708 | /**
|
709 | * An array of the second instance's command line arguments
|
710 | */
|
711 | argv: string[],
|
712 | /**
|
713 | * The second instance's working directory
|
714 | */
|
715 | workingDirectory: string,
|
716 | /**
|
717 | * A JSON object of additional data passed from the second instance
|
718 | */
|
719 | additionalData: unknown) => void): this;
|
720 | off(event: 'second-instance', listener: (event: Event,
|
721 | /**
|
722 | * An array of the second instance's command line arguments
|
723 | */
|
724 | argv: string[],
|
725 | /**
|
726 | * The second instance's working directory
|
727 | */
|
728 | workingDirectory: string,
|
729 | /**
|
730 | * A JSON object of additional data passed from the second instance
|
731 | */
|
732 | additionalData: unknown) => void): this;
|
733 | once(event: 'second-instance', listener: (event: Event,
|
734 | /**
|
735 | * An array of the second instance's command line arguments
|
736 | */
|
737 | argv: string[],
|
738 | /**
|
739 | * The second instance's working directory
|
740 | */
|
741 | workingDirectory: string,
|
742 | /**
|
743 | * A JSON object of additional data passed from the second instance
|
744 | */
|
745 | additionalData: unknown) => void): this;
|
746 | addListener(event: 'second-instance', listener: (event: Event,
|
747 | /**
|
748 | * An array of the second instance's command line arguments
|
749 | */
|
750 | argv: string[],
|
751 | /**
|
752 | * The second instance's working directory
|
753 | */
|
754 | workingDirectory: string,
|
755 | /**
|
756 | * A JSON object of additional data passed from the second instance
|
757 | */
|
758 | additionalData: unknown) => void): this;
|
759 | removeListener(event: 'second-instance', listener: (event: Event,
|
760 | /**
|
761 | * An array of the second instance's command line arguments
|
762 | */
|
763 | argv: string[],
|
764 | /**
|
765 | * The second instance's working directory
|
766 | */
|
767 | workingDirectory: string,
|
768 | /**
|
769 | * A JSON object of additional data passed from the second instance
|
770 | */
|
771 | additionalData: unknown) => void): this;
|
772 | /**
|
773 | * Emitted when a client certificate is requested.
|
774 | *
|
775 | * The `url` corresponds to the navigation entry requesting the client certificate
|
776 | * and `callback` can be called with an entry filtered from the list. Using
|
777 | * `event.preventDefault()` prevents the application from using the first
|
778 | * certificate from the store.
|
779 | */
|
780 | on(event: 'select-client-certificate', listener: (event: Event,
|
781 | webContents: WebContents,
|
782 | url: string,
|
783 | certificateList: Certificate[],
|
784 | callback: (certificate?: Certificate) => void) => void): this;
|
785 | off(event: 'select-client-certificate', listener: (event: Event,
|
786 | webContents: WebContents,
|
787 | url: string,
|
788 | certificateList: Certificate[],
|
789 | callback: (certificate?: Certificate) => void) => void): this;
|
790 | once(event: 'select-client-certificate', listener: (event: Event,
|
791 | webContents: WebContents,
|
792 | url: string,
|
793 | certificateList: Certificate[],
|
794 | callback: (certificate?: Certificate) => void) => void): this;
|
795 | addListener(event: 'select-client-certificate', listener: (event: Event,
|
796 | webContents: WebContents,
|
797 | url: string,
|
798 | certificateList: Certificate[],
|
799 | callback: (certificate?: Certificate) => void) => void): this;
|
800 | removeListener(event: 'select-client-certificate', listener: (event: Event,
|
801 | webContents: WebContents,
|
802 | url: string,
|
803 | certificateList: Certificate[],
|
804 | callback: (certificate?: Certificate) => void) => void): this;
|
805 | /**
|
806 | * Emitted when Electron has created a new `session`.
|
807 | */
|
808 | on(event: 'session-created', listener: (session: Session) => void): this;
|
809 | off(event: 'session-created', listener: (session: Session) => void): this;
|
810 | once(event: 'session-created', listener: (session: Session) => void): this;
|
811 | addListener(event: 'session-created', listener: (session: Session) => void): this;
|
812 | removeListener(event: 'session-created', listener: (session: Session) => void): this;
|
813 | /**
|
814 | * Emitted when Handoff is about to be resumed on another device. If you need to
|
815 | * update the state to be transferred, you should call `event.preventDefault()`
|
816 | * immediately, construct a new `userInfo` dictionary and call
|
817 | * `app.updateCurrentActivity()` in a timely manner. Otherwise, the operation will
|
818 | * fail and `continue-activity-error` will be called.
|
819 | *
|
820 | * @platform darwin
|
821 | */
|
822 | on(event: 'update-activity-state', listener: (event: Event,
|
823 | /**
|
824 | * A string identifying the activity. Maps to `NSUserActivity.activityType`.
|
825 | */
|
826 | type: string,
|
827 | /**
|
828 | * Contains app-specific state stored by the activity.
|
829 | */
|
830 | userInfo: unknown) => void): this;
|
831 | /**
|
832 | * @platform darwin
|
833 | */
|
834 | off(event: 'update-activity-state', listener: (event: Event,
|
835 | /**
|
836 | * A string identifying the activity. Maps to `NSUserActivity.activityType`.
|
837 | */
|
838 | type: string,
|
839 | /**
|
840 | * Contains app-specific state stored by the activity.
|
841 | */
|
842 | userInfo: unknown) => void): this;
|
843 | /**
|
844 | * @platform darwin
|
845 | */
|
846 | once(event: 'update-activity-state', listener: (event: Event,
|
847 | /**
|
848 | * A string identifying the activity. Maps to `NSUserActivity.activityType`.
|
849 | */
|
850 | type: string,
|
851 | /**
|
852 | * Contains app-specific state stored by the activity.
|
853 | */
|
854 | userInfo: unknown) => void): this;
|
855 | /**
|
856 | * @platform darwin
|
857 | */
|
858 | addListener(event: 'update-activity-state', listener: (event: Event,
|
859 | /**
|
860 | * A string identifying the activity. Maps to `NSUserActivity.activityType`.
|
861 | */
|
862 | type: string,
|
863 | /**
|
864 | * Contains app-specific state stored by the activity.
|
865 | */
|
866 | userInfo: unknown) => void): this;
|
867 | /**
|
868 | * @platform darwin
|
869 | */
|
870 | removeListener(event: 'update-activity-state', listener: (event: Event,
|
871 | /**
|
872 | * A string identifying the activity. Maps to `NSUserActivity.activityType`.
|
873 | */
|
874 | type: string,
|
875 | /**
|
876 | * Contains app-specific state stored by the activity.
|
877 | */
|
878 | userInfo: unknown) => void): this;
|
879 | /**
|
880 | * Emitted when a new webContents is created.
|
881 | */
|
882 | on(event: 'web-contents-created', listener: (event: Event,
|
883 | webContents: WebContents) => void): this;
|
884 | off(event: 'web-contents-created', listener: (event: Event,
|
885 | webContents: WebContents) => void): this;
|
886 | once(event: 'web-contents-created', listener: (event: Event,
|
887 | webContents: WebContents) => void): this;
|
888 | addListener(event: 'web-contents-created', listener: (event: Event,
|
889 | webContents: WebContents) => void): this;
|
890 | removeListener(event: 'web-contents-created', listener: (event: Event,
|
891 | webContents: WebContents) => void): this;
|
892 | /**
|
893 | * Emitted during Handoff before an activity from a different device wants to be
|
894 | * resumed. You should call `event.preventDefault()` if you want to handle this
|
895 | * event.
|
896 | *
|
897 | * @platform darwin
|
898 | */
|
899 | on(event: 'will-continue-activity', listener: (event: Event,
|
900 | /**
|
901 | * A string identifying the activity. Maps to `NSUserActivity.activityType`.
|
902 | */
|
903 | type: string) => void): this;
|
904 | /**
|
905 | * @platform darwin
|
906 | */
|
907 | off(event: 'will-continue-activity', listener: (event: Event,
|
908 | /**
|
909 | * A string identifying the activity. Maps to `NSUserActivity.activityType`.
|
910 | */
|
911 | type: string) => void): this;
|
912 | /**
|
913 | * @platform darwin
|
914 | */
|
915 | once(event: 'will-continue-activity', listener: (event: Event,
|
916 | /**
|
917 | * A string identifying the activity. Maps to `NSUserActivity.activityType`.
|
918 | */
|
919 | type: string) => void): this;
|
920 | /**
|
921 | * @platform darwin
|
922 | */
|
923 | addListener(event: 'will-continue-activity', listener: (event: Event,
|
924 | /**
|
925 | * A string identifying the activity. Maps to `NSUserActivity.activityType`.
|
926 | */
|
927 | type: string) => void): this;
|
928 | /**
|
929 | * @platform darwin
|
930 | */
|
931 | removeListener(event: 'will-continue-activity', listener: (event: Event,
|
932 | /**
|
933 | * A string identifying the activity. Maps to `NSUserActivity.activityType`.
|
934 | */
|
935 | type: string) => void): this;
|
936 | /**
|
937 | * Emitted when the application has finished basic startup. On Windows and Linux,
|
938 | * the `will-finish-launching` event is the same as the `ready` event; on macOS,
|
939 | * this event represents the `applicationWillFinishLaunching` notification of
|
940 | * `NSApplication`.
|
941 | *
|
942 | * In most cases, you should do everything in the `ready` event handler.
|
943 | */
|
944 | on(event: 'will-finish-launching', listener: () => void): this;
|
945 | off(event: 'will-finish-launching', listener: () => void): this;
|
946 | once(event: 'will-finish-launching', listener: () => void): this;
|
947 | addListener(event: 'will-finish-launching', listener: () => void): this;
|
948 | removeListener(event: 'will-finish-launching', listener: () => void): this;
|
949 | /**
|
950 | * Emitted when all windows have been closed and the application will quit. Calling
|
951 | * `event.preventDefault()` will prevent the default behavior, which is terminating
|
952 | * the application.
|
953 | *
|
954 | * See the description of the `window-all-closed` event for the differences between
|
955 | * the `will-quit` and `window-all-closed` events.
|
956 | *
|
957 | * **Note:** On Windows, this event will not be emitted if the app is closed due to
|
958 | * a shutdown/restart of the system or a user logout.
|
959 | */
|
960 | on(event: 'will-quit', listener: (event: Event) => void): this;
|
961 | off(event: 'will-quit', listener: (event: Event) => void): this;
|
962 | once(event: 'will-quit', listener: (event: Event) => void): this;
|
963 | addListener(event: 'will-quit', listener: (event: Event) => void): this;
|
964 | removeListener(event: 'will-quit', listener: (event: Event) => void): this;
|
965 | /**
|
966 | * Emitted when all windows have been closed.
|
967 | *
|
968 | * If you do not subscribe to this event and all windows are closed, the default
|
969 | * behavior is to quit the app; however, if you subscribe, you control whether the
|
970 | * app quits or not. If the user pressed `Cmd + Q`, or the developer called
|
971 | * `app.quit()`, Electron will first try to close all the windows and then emit the
|
972 | * `will-quit` event, and in this case the `window-all-closed` event would not be
|
973 | * emitted.
|
974 | */
|
975 | on(event: 'window-all-closed', listener: () => void): this;
|
976 | off(event: 'window-all-closed', listener: () => void): this;
|
977 | once(event: 'window-all-closed', listener: () => void): this;
|
978 | addListener(event: 'window-all-closed', listener: () => void): this;
|
979 | removeListener(event: 'window-all-closed', listener: () => void): this;
|
980 | /**
|
981 | * Adds `path` to the recent documents list.
|
982 | *
|
983 | * This list is managed by the OS. On Windows, you can visit the list from the task
|
984 | * bar, and on macOS, you can visit it from dock menu.
|
985 | *
|
986 | * @platform darwin,win32
|
987 | */
|
988 | addRecentDocument(path: string): void;
|
989 | /**
|
990 | * Clears the recent documents list.
|
991 | *
|
992 | * @platform darwin,win32
|
993 | */
|
994 | clearRecentDocuments(): void;
|
995 | /**
|
996 | * Configures host resolution (DNS and DNS-over-HTTPS). By default, the following
|
997 | * resolvers will be used, in order:
|
998 | *
|
999 | * * DNS-over-HTTPS, if the DNS provider supports it, then
|
1000 | * * the built-in resolver (enabled on macOS only by default), then
|
1001 | * * the system's resolver (e.g. `getaddrinfo`).
|
1002 | *
|
1003 | * This can be configured to either restrict usage of non-encrypted DNS
|
1004 | * (`secureDnsMode: "secure"`), or disable DNS-over-HTTPS (`secureDnsMode: "off"`).
|
1005 | * It is also possible to enable or disable the built-in resolver.
|
1006 | *
|
1007 | * To disable insecure DNS, you can specify a `secureDnsMode` of `"secure"`. If you
|
1008 | * do so, you should make sure to provide a list of DNS-over-HTTPS servers to use,
|
1009 | * in case the user's DNS configuration does not include a provider that supports
|
1010 | * DoH.
|
1011 | *
|
1012 | * This API must be called after the `ready` event is emitted.
|
1013 | */
|
1014 | configureHostResolver(options: ConfigureHostResolverOptions): void;
|
1015 | /**
|
1016 | * By default, Chromium disables 3D APIs (e.g. WebGL) until restart on a per domain
|
1017 | * basis if the GPU processes crashes too frequently. This function disables that
|
1018 | * behavior.
|
1019 | *
|
1020 | * This method can only be called before app is ready.
|
1021 | */
|
1022 | disableDomainBlockingFor3DAPIs(): void;
|
1023 | /**
|
1024 | * Disables hardware acceleration for current app.
|
1025 | *
|
1026 | * This method can only be called before app is ready.
|
1027 | */
|
1028 | disableHardwareAcceleration(): void;
|
1029 | /**
|
1030 | * Enables full sandbox mode on the app. This means that all renderers will be
|
1031 | * launched sandboxed, regardless of the value of the `sandbox` flag in
|
1032 | * `WebPreferences`.
|
1033 | *
|
1034 | * This method can only be called before app is ready.
|
1035 | */
|
1036 | enableSandbox(): void;
|
1037 | /**
|
1038 | * Exits immediately with `exitCode`. `exitCode` defaults to 0.
|
1039 | *
|
1040 | * All windows will be closed immediately without asking the user, and the
|
1041 | * `before-quit` and `will-quit` events will not be emitted.
|
1042 | */
|
1043 | exit(exitCode?: number): void;
|
1044 | /**
|
1045 | * On Linux, focuses on the first visible window. On macOS, makes the application
|
1046 | * the active app. On Windows, focuses on the application's first window.
|
1047 | *
|
1048 | * You should seek to use the `steal` option as sparingly as possible.
|
1049 | */
|
1050 | focus(options?: FocusOptions): void;
|
1051 | /**
|
1052 | * Resolve with an object containing the following:
|
1053 | *
|
1054 | * * `icon` NativeImage - the display icon of the app handling the protocol.
|
1055 | * * `path` string - installation path of the app handling the protocol.
|
1056 | * * `name` string - display name of the app handling the protocol.
|
1057 | *
|
1058 | * This method returns a promise that contains the application name, icon and path
|
1059 | * of the default handler for the protocol (aka URI scheme) of a URL.
|
1060 | *
|
1061 | * @platform darwin,win32
|
1062 | */
|
1063 | getApplicationInfoForProtocol(url: string): Promise<Electron.ApplicationInfoForProtocolReturnValue>;
|
1064 | /**
|
1065 | * Name of the application handling the protocol, or an empty string if there is no
|
1066 | * handler. For instance, if Electron is the default handler of the URL, this could
|
1067 | * be `Electron` on Windows and Mac. However, don't rely on the precise format
|
1068 | * which is not guaranteed to remain unchanged. Expect a different format on Linux,
|
1069 | * possibly with a `.desktop` suffix.
|
1070 | *
|
1071 | * This method returns the application name of the default handler for the protocol
|
1072 | * (aka URI scheme) of a URL.
|
1073 | */
|
1074 | getApplicationNameForProtocol(url: string): string;
|
1075 | /**
|
1076 | * Array of `ProcessMetric` objects that correspond to memory and CPU usage
|
1077 | * statistics of all the processes associated with the app.
|
1078 | */
|
1079 | getAppMetrics(): ProcessMetric[];
|
1080 | /**
|
1081 | * The current application directory.
|
1082 | */
|
1083 | getAppPath(): string;
|
1084 | /**
|
1085 | * The current value displayed in the counter badge.
|
1086 | *
|
1087 | * @platform linux,darwin
|
1088 | */
|
1089 | getBadgeCount(): number;
|
1090 | /**
|
1091 | * The type of the currently running activity.
|
1092 | *
|
1093 | * @platform darwin
|
1094 | */
|
1095 | getCurrentActivityType(): string;
|
1096 | /**
|
1097 | * fulfilled with the app's icon, which is a NativeImage.
|
1098 | *
|
1099 | * Fetches a path's associated icon.
|
1100 | *
|
1101 | * On _Windows_, there a 2 kinds of icons:
|
1102 | *
|
1103 | * * Icons associated with certain file extensions, like `.mp3`, `.png`, etc.
|
1104 | * * Icons inside the file itself, like `.exe`, `.dll`, `.ico`.
|
1105 | *
|
1106 | * On _Linux_ and _macOS_, icons depend on the application associated with file
|
1107 | * mime type.
|
1108 | */
|
1109 | getFileIcon(path: string, options?: FileIconOptions): Promise<Electron.NativeImage>;
|
1110 | /**
|
1111 | * The Graphics Feature Status from `chrome://gpu/`.
|
1112 | *
|
1113 | * **Note:** This information is only usable after the `gpu-info-update` event is
|
1114 | * emitted.
|
1115 | */
|
1116 | getGPUFeatureStatus(): GPUFeatureStatus;
|
1117 | /**
|
1118 | * For `infoType` equal to `complete`: Promise is fulfilled with `Object`
|
1119 | * containing all the GPU Information as in chromium's GPUInfo object. This
|
1120 | * includes the version and driver information that's shown on `chrome://gpu` page.
|
1121 | *
|
1122 | * For `infoType` equal to `basic`: Promise is fulfilled with `Object` containing
|
1123 | * fewer attributes than when requested with `complete`. Here's an example of basic
|
1124 | * response:
|
1125 | *
|
1126 | * Using `basic` should be preferred if only basic information like `vendorId` or
|
1127 | * `deviceId` is needed.
|
1128 | */
|
1129 | getGPUInfo(infoType: 'basic' | 'complete'): Promise<unknown>;
|
1130 | /**
|
1131 | * * `minItems` Integer - The minimum number of items that will be shown in the
|
1132 | * Jump List (for a more detailed description of this value see the MSDN docs).
|
1133 | * * `removedItems` JumpListItem[] - Array of `JumpListItem` objects that
|
1134 | * correspond to items that the user has explicitly removed from custom categories
|
1135 | * in the Jump List. These items must not be re-added to the Jump List in the
|
1136 | * **next** call to `app.setJumpList()`, Windows will not display any custom
|
1137 | * category that contains any of the removed items.
|
1138 | *
|
1139 | * @platform win32
|
1140 | */
|
1141 | getJumpListSettings(): JumpListSettings;
|
1142 | /**
|
1143 | * The current application locale, fetched using Chromium's `l10n_util` library.
|
1144 | * Possible return values are documented here.
|
1145 | *
|
1146 | * To set the locale, you'll want to use a command line switch at app startup,
|
1147 | * which may be found here.
|
1148 | *
|
1149 | * **Note:** When distributing your packaged app, you have to also ship the
|
1150 | * `locales` folder.
|
1151 | *
|
1152 | * **Note:** This API must be called after the `ready` event is emitted.
|
1153 | *
|
1154 | * **Note:** To see example return values of this API compared to other locale and
|
1155 | * language APIs, see `app.getPreferredSystemLanguages()`.
|
1156 | */
|
1157 | getLocale(): string;
|
1158 | /**
|
1159 | * User operating system's locale two-letter ISO 3166 country code. The value is
|
1160 | * taken from native OS APIs.
|
1161 | *
|
1162 | * **Note:** When unable to detect locale country code, it returns empty string.
|
1163 | */
|
1164 | getLocaleCountryCode(): string;
|
1165 | /**
|
1166 | * If you provided `path` and `args` options to `app.setLoginItemSettings`, then
|
1167 | * you need to pass the same arguments here for `openAtLogin` to be set correctly.
|
1168 | *
|
1169 | *
|
1170 | * * `openAtLogin` boolean - `true` if the app is set to open at login.
|
1171 | * * `openAsHidden` boolean _macOS_ _Deprecated_ - `true` if the app is set to open
|
1172 | * as hidden at login. This does not work on macOS 13 and up.
|
1173 | * * `wasOpenedAtLogin` boolean _macOS_ - `true` if the app was opened at login
|
1174 | * automatically.
|
1175 | * * `wasOpenedAsHidden` boolean _macOS_ _Deprecated_ - `true` if the app was
|
1176 | * opened as a hidden login item. This indicates that the app should not open any
|
1177 | * windows at startup. This setting is not available on MAS builds or on macOS 13
|
1178 | * and up.
|
1179 | * * `restoreState` boolean _macOS_ _Deprecated_ - `true` if the app was opened as
|
1180 | * a login item that should restore the state from the previous session. This
|
1181 | * indicates that the app should restore the windows that were open the last time
|
1182 | * the app was closed. This setting is not available on MAS builds or on macOS 13
|
1183 | * and up.
|
1184 | * * `status` string _macOS_ - can be one of `not-registered`, `enabled`,
|
1185 | * `requires-approval`, or `not-found`.
|
1186 | * * `executableWillLaunchAtLogin` boolean _Windows_ - `true` if app is set to open
|
1187 | * at login and its run key is not deactivated. This differs from `openAtLogin` as
|
1188 | * it ignores the `args` option, this property will be true if the given executable
|
1189 | * would be launched at login with **any** arguments.
|
1190 | * * `launchItems` Object[] _Windows_
|
1191 | * * `name` string _Windows_ - name value of a registry entry.
|
1192 | * * `path` string _Windows_ - The executable to an app that corresponds to a
|
1193 | * registry entry.
|
1194 | * * `args` string[] _Windows_ - the command-line arguments to pass to the
|
1195 | * executable.
|
1196 | * * `scope` string _Windows_ - one of `user` or `machine`. Indicates whether the
|
1197 | * registry entry is under `HKEY_CURRENT USER` or `HKEY_LOCAL_MACHINE`.
|
1198 | * * `enabled` boolean _Windows_ - `true` if the app registry key is startup
|
1199 | * approved and therefore shows as `enabled` in Task Manager and Windows settings.
|
1200 | *
|
1201 | * @platform darwin,win32
|
1202 | */
|
1203 | getLoginItemSettings(options?: LoginItemSettingsOptions): LoginItemSettings;
|
1204 | /**
|
1205 | * The current application's name, which is the name in the application's
|
1206 | * `package.json` file.
|
1207 | *
|
1208 | * Usually the `name` field of `package.json` is a short lowercase name, according
|
1209 | * to the npm modules spec. You should usually also specify a `productName` field,
|
1210 | * which is your application's full capitalized name, and which will be preferred
|
1211 | * over `name` by Electron.
|
1212 | */
|
1213 | getName(): string;
|
1214 | /**
|
1215 | * A path to a special directory or file associated with `name`. On failure, an
|
1216 | * `Error` is thrown.
|
1217 | *
|
1218 | * If `app.getPath('logs')` is called without called `app.setAppLogsPath()` being
|
1219 | * called first, a default log directory will be created equivalent to calling
|
1220 | * `app.setAppLogsPath()` without a `path` parameter.
|
1221 | */
|
1222 | getPath(name: 'home' | 'appData' | 'userData' | 'sessionData' | 'temp' | 'exe' | 'module' | 'desktop' | 'documents' | 'downloads' | 'music' | 'pictures' | 'videos' | 'recent' | 'logs' | 'crashDumps'): string;
|
1223 | /**
|
1224 | * The user's preferred system languages from most preferred to least preferred,
|
1225 | * including the country codes if applicable. A user can modify and add to this
|
1226 | * list on Windows or macOS through the Language and Region settings.
|
1227 | *
|
1228 | * The API uses `GlobalizationPreferences` (with a fallback to
|
1229 | * `GetSystemPreferredUILanguages`) on Windows, `\[NSLocale preferredLanguages\]`
|
1230 | * on macOS, and `g_get_language_names` on Linux.
|
1231 | *
|
1232 | * This API can be used for purposes such as deciding what language to present the
|
1233 | * application in.
|
1234 | *
|
1235 | * Here are some examples of return values of the various language and locale APIs
|
1236 | * with different configurations:
|
1237 | *
|
1238 | * On Windows, given application locale is German, the regional format is Finnish
|
1239 | * (Finland), and the preferred system languages from most to least preferred are
|
1240 | * French (Canada), English (US), Simplified Chinese (China), Finnish, and Spanish
|
1241 | * (Latin America):
|
1242 | *
|
1243 | * On macOS, given the application locale is German, the region is Finland, and the
|
1244 | * preferred system languages from most to least preferred are French (Canada),
|
1245 | * English (US), Simplified Chinese, and Spanish (Latin America):
|
1246 | *
|
1247 | * Both the available languages and regions and the possible return values differ
|
1248 | * between the two operating systems.
|
1249 | *
|
1250 | * As can be seen with the example above, on Windows, it is possible that a
|
1251 | * preferred system language has no country code, and that one of the preferred
|
1252 | * system languages corresponds with the language used for the regional format. On
|
1253 | * macOS, the region serves more as a default country code: the user doesn't need
|
1254 | * to have Finnish as a preferred language to use Finland as the region,and the
|
1255 | * country code `FI` is used as the country code for preferred system languages
|
1256 | * that do not have associated countries in the language name.
|
1257 | */
|
1258 | getPreferredSystemLanguages(): string[];
|
1259 | /**
|
1260 | * The current system locale. On Windows and Linux, it is fetched using Chromium's
|
1261 | * `i18n` library. On macOS, `[NSLocale currentLocale]` is used instead. To get the
|
1262 | * user's current system language, which is not always the same as the locale, it
|
1263 | * is better to use `app.getPreferredSystemLanguages()`.
|
1264 | *
|
1265 | * Different operating systems also use the regional data differently:
|
1266 | *
|
1267 | * * Windows 11 uses the regional format for numbers, dates, and times.
|
1268 | * * macOS Monterey uses the region for formatting numbers, dates, times, and for
|
1269 | * selecting the currency symbol to use.
|
1270 | *
|
1271 | * Therefore, this API can be used for purposes such as choosing a format for
|
1272 | * rendering dates and times in a calendar app, especially when the developer wants
|
1273 | * the format to be consistent with the OS.
|
1274 | *
|
1275 | * **Note:** This API must be called after the `ready` event is emitted.
|
1276 | *
|
1277 | * **Note:** To see example return values of this API compared to other locale and
|
1278 | * language APIs, see `app.getPreferredSystemLanguages()`.
|
1279 | */
|
1280 | getSystemLocale(): string;
|
1281 | /**
|
1282 | * The version of the loaded application. If no version is found in the
|
1283 | * application's `package.json` file, the version of the current bundle or
|
1284 | * executable is returned.
|
1285 | */
|
1286 | getVersion(): string;
|
1287 | /**
|
1288 | * This method returns whether or not this instance of your app is currently
|
1289 | * holding the single instance lock. You can request the lock with
|
1290 | * `app.requestSingleInstanceLock()` and release with
|
1291 | * `app.releaseSingleInstanceLock()`
|
1292 | */
|
1293 | hasSingleInstanceLock(): boolean;
|
1294 | /**
|
1295 | * Hides all application windows without minimizing them.
|
1296 | *
|
1297 | * @platform darwin
|
1298 | */
|
1299 | hide(): void;
|
1300 | /**
|
1301 | * Imports the certificate in pkcs12 format into the platform certificate store.
|
1302 | * `callback` is called with the `result` of import operation, a value of `0`
|
1303 | * indicates success while any other value indicates failure according to Chromium
|
1304 | * net_error_list.
|
1305 | *
|
1306 | * @platform linux
|
1307 | */
|
1308 | importCertificate(options: ImportCertificateOptions, callback: (result: number) => void): void;
|
1309 | /**
|
1310 | * Invalidates the current Handoff user activity.
|
1311 | *
|
1312 | * @platform darwin
|
1313 | */
|
1314 | invalidateCurrentActivity(): void;
|
1315 | /**
|
1316 | * `true` if Chrome's accessibility support is enabled, `false` otherwise. This API
|
1317 | * will return `true` if the use of assistive technologies, such as screen readers,
|
1318 | * has been detected. See
|
1319 | * https://www.chromium.org/developers/design-documents/accessibility for more
|
1320 | * details.
|
1321 | *
|
1322 | * @platform darwin,win32
|
1323 | */
|
1324 | isAccessibilitySupportEnabled(): boolean;
|
1325 | /**
|
1326 | * Whether the current executable is the default handler for a protocol (aka URI
|
1327 | * scheme).
|
1328 | *
|
1329 | * **Note:** On macOS, you can use this method to check if the app has been
|
1330 | * registered as the default protocol handler for a protocol. You can also verify
|
1331 | * this by checking `~/Library/Preferences/com.apple.LaunchServices.plist` on the
|
1332 | * macOS machine. Please refer to Apple's documentation for details.
|
1333 | *
|
1334 | * The API uses the Windows Registry and `LSCopyDefaultHandlerForURLScheme`
|
1335 | * internally.
|
1336 | */
|
1337 | isDefaultProtocolClient(protocol: string, path?: string, args?: string[]): boolean;
|
1338 | /**
|
1339 | * whether or not the current OS version allows for native emoji pickers.
|
1340 | */
|
1341 | isEmojiPanelSupported(): boolean;
|
1342 | /**
|
1343 | * `true` if the application—including all of its windows—is hidden (e.g. with
|
1344 | * `Command-H`), `false` otherwise.
|
1345 | *
|
1346 | * @platform darwin
|
1347 | */
|
1348 | isHidden(): boolean;
|
1349 | /**
|
1350 | * Whether the application is currently running from the systems Application
|
1351 | * folder. Use in combination with `app.moveToApplicationsFolder()`
|
1352 | *
|
1353 | * @platform darwin
|
1354 | */
|
1355 | isInApplicationsFolder(): boolean;
|
1356 | /**
|
1357 | * `true` if Electron has finished initializing, `false` otherwise. See also
|
1358 | * `app.whenReady()`.
|
1359 | */
|
1360 | isReady(): boolean;
|
1361 | /**
|
1362 | * whether `Secure Keyboard Entry` is enabled.
|
1363 | *
|
1364 | * By default this API will return `false`.
|
1365 | *
|
1366 | * @platform darwin
|
1367 | */
|
1368 | isSecureKeyboardEntryEnabled(): boolean;
|
1369 | /**
|
1370 | * Whether the current desktop environment is Unity launcher.
|
1371 | *
|
1372 | * @platform linux
|
1373 | */
|
1374 | isUnityRunning(): boolean;
|
1375 | /**
|
1376 | * Whether the move was successful. Please note that if the move is successful,
|
1377 | * your application will quit and relaunch.
|
1378 | *
|
1379 | * No confirmation dialog will be presented by default. If you wish to allow the
|
1380 | * user to confirm the operation, you may do so using the `dialog` API.
|
1381 | *
|
1382 | * **NOTE:** This method throws errors if anything other than the user causes the
|
1383 | * move to fail. For instance if the user cancels the authorization dialog, this
|
1384 | * method returns false. If we fail to perform the copy, then this method will
|
1385 | * throw an error. The message in the error should be informative and tell you
|
1386 | * exactly what went wrong.
|
1387 | *
|
1388 | * By default, if an app of the same name as the one being moved exists in the
|
1389 | * Applications directory and is _not_ running, the existing app will be trashed
|
1390 | * and the active app moved into its place. If it _is_ running, the preexisting
|
1391 | * running app will assume focus and the previously active app will quit itself.
|
1392 | * This behavior can be changed by providing the optional conflict handler, where
|
1393 | * the boolean returned by the handler determines whether or not the move conflict
|
1394 | * is resolved with default behavior. i.e. returning `false` will ensure no
|
1395 | * further action is taken, returning `true` will result in the default behavior
|
1396 | * and the method continuing.
|
1397 | *
|
1398 | * For example:
|
1399 | *
|
1400 | * Would mean that if an app already exists in the user directory, if the user
|
1401 | * chooses to 'Continue Move' then the function would continue with its default
|
1402 | * behavior and the existing app will be trashed and the active app moved into its
|
1403 | * place.
|
1404 | *
|
1405 | * @platform darwin
|
1406 | */
|
1407 | moveToApplicationsFolder(options?: MoveToApplicationsFolderOptions): boolean;
|
1408 | /**
|
1409 | * Try to close all windows. The `before-quit` event will be emitted first. If all
|
1410 | * windows are successfully closed, the `will-quit` event will be emitted and by
|
1411 | * default the application will terminate.
|
1412 | *
|
1413 | * This method guarantees that all `beforeunload` and `unload` event handlers are
|
1414 | * correctly executed. It is possible that a window cancels the quitting by
|
1415 | * returning `false` in the `beforeunload` event handler.
|
1416 | */
|
1417 | quit(): void;
|
1418 | /**
|
1419 | * Relaunches the app when current instance exits.
|
1420 | *
|
1421 | * By default, the new instance will use the same working directory and command
|
1422 | * line arguments with current instance. When `args` is specified, the `args` will
|
1423 | * be passed as command line arguments instead. When `execPath` is specified, the
|
1424 | * `execPath` will be executed for relaunch instead of current app.
|
1425 | *
|
1426 | * Note that this method does not quit the app when executed, you have to call
|
1427 | * `app.quit` or `app.exit` after calling `app.relaunch` to make the app restart.
|
1428 | *
|
1429 | * When `app.relaunch` is called for multiple times, multiple instances will be
|
1430 | * started after current instance exited.
|
1431 | *
|
1432 | * An example of restarting current instance immediately and adding a new command
|
1433 | * line argument to the new instance:
|
1434 | */
|
1435 | relaunch(options?: RelaunchOptions): void;
|
1436 | /**
|
1437 | * Releases all locks that were created by `requestSingleInstanceLock`. This will
|
1438 | * allow multiple instances of the application to once again run side by side.
|
1439 | */
|
1440 | releaseSingleInstanceLock(): void;
|
1441 | /**
|
1442 | * Whether the call succeeded.
|
1443 | *
|
1444 | * This method checks if the current executable as the default handler for a
|
1445 | * protocol (aka URI scheme). If so, it will remove the app as the default handler.
|
1446 | *
|
1447 | * @platform darwin,win32
|
1448 | */
|
1449 | removeAsDefaultProtocolClient(protocol: string, path?: string, args?: string[]): boolean;
|
1450 | /**
|
1451 | * The return value of this method indicates whether or not this instance of your
|
1452 | * application successfully obtained the lock. If it failed to obtain the lock,
|
1453 | * you can assume that another instance of your application is already running with
|
1454 | * the lock and exit immediately.
|
1455 | *
|
1456 | * I.e. This method returns `true` if your process is the primary instance of your
|
1457 | * application and your app should continue loading. It returns `false` if your
|
1458 | * process should immediately quit as it has sent its parameters to another
|
1459 | * instance that has already acquired the lock.
|
1460 | *
|
1461 | * On macOS, the system enforces single instance automatically when users try to
|
1462 | * open a second instance of your app in Finder, and the `open-file` and `open-url`
|
1463 | * events will be emitted for that. However when users start your app in command
|
1464 | * line, the system's single instance mechanism will be bypassed, and you have to
|
1465 | * use this method to ensure single instance.
|
1466 | *
|
1467 | * An example of activating the window of primary instance when a second instance
|
1468 | * starts:
|
1469 | */
|
1470 | requestSingleInstanceLock(additionalData?: Record<any, any>): boolean;
|
1471 | /**
|
1472 | * Marks the current Handoff user activity as inactive without invalidating it.
|
1473 | *
|
1474 | * @platform darwin
|
1475 | */
|
1476 | resignCurrentActivity(): void;
|
1477 | /**
|
1478 | * Resolves with the proxy information for `url` that will be used when attempting
|
1479 | * to make requests using Net in the utility process.
|
1480 | */
|
1481 | resolveProxy(url: string): Promise<string>;
|
1482 | /**
|
1483 | * Set the about panel options. This will override the values defined in the app's
|
1484 | * `.plist` file on macOS. See the Apple docs for more details. On Linux, values
|
1485 | * must be set in order to be shown; there are no defaults.
|
1486 | *
|
1487 | * If you do not set `credits` but still wish to surface them in your app, AppKit
|
1488 | * will look for a file named "Credits.html", "Credits.rtf", and "Credits.rtfd", in
|
1489 | * that order, in the bundle returned by the NSBundle class method main. The first
|
1490 | * file found is used, and if none is found, the info area is left blank. See Apple
|
1491 | * documentation for more information.
|
1492 | */
|
1493 | setAboutPanelOptions(options: AboutPanelOptionsOptions): void;
|
1494 | /**
|
1495 | * Manually enables Chrome's accessibility support, allowing to expose
|
1496 | * accessibility switch to users in application settings. See Chromium's
|
1497 | * accessibility docs for more details. Disabled by default.
|
1498 | *
|
1499 | * This API must be called after the `ready` event is emitted.
|
1500 | *
|
1501 | * **Note:** Rendering accessibility tree can significantly affect the performance
|
1502 | * of your app. It should not be enabled by default.
|
1503 | *
|
1504 | * @platform darwin,win32
|
1505 | */
|
1506 | setAccessibilitySupportEnabled(enabled: boolean): void;
|
1507 | /**
|
1508 | * Sets the activation policy for a given app.
|
1509 | *
|
1510 | * Activation policy types:
|
1511 | *
|
1512 | * * 'regular' - The application is an ordinary app that appears in the Dock and
|
1513 | * may have a user interface.
|
1514 | * * 'accessory' - The application doesn’t appear in the Dock and doesn’t have a
|
1515 | * menu bar, but it may be activated programmatically or by clicking on one of its
|
1516 | * windows.
|
1517 | * * 'prohibited' - The application doesn’t appear in the Dock and may not create
|
1518 | * windows or be activated.
|
1519 | *
|
1520 | * @platform darwin
|
1521 | */
|
1522 | setActivationPolicy(policy: 'regular' | 'accessory' | 'prohibited'): void;
|
1523 | /**
|
1524 | * Sets or creates a directory your app's logs which can then be manipulated with
|
1525 | * `app.getPath()` or `app.setPath(pathName, newPath)`.
|
1526 | *
|
1527 | * Calling `app.setAppLogsPath()` without a `path` parameter will result in this
|
1528 | * directory being set to `~/Library/Logs/YourAppName` on _macOS_, and inside the
|
1529 | * `userData` directory on _Linux_ and _Windows_.
|
1530 | */
|
1531 | setAppLogsPath(path?: string): void;
|
1532 | /**
|
1533 | * Changes the Application User Model ID to `id`.
|
1534 | *
|
1535 | * @platform win32
|
1536 | */
|
1537 | setAppUserModelId(id: string): void;
|
1538 | /**
|
1539 | * Whether the call succeeded.
|
1540 | *
|
1541 | * Sets the current executable as the default handler for a protocol (aka URI
|
1542 | * scheme). It allows you to integrate your app deeper into the operating system.
|
1543 | * Once registered, all links with `your-protocol://` will be opened with the
|
1544 | * current executable. The whole link, including protocol, will be passed to your
|
1545 | * application as a parameter.
|
1546 | *
|
1547 | * **Note:** On macOS, you can only register protocols that have been added to your
|
1548 | * app's `info.plist`, which cannot be modified at runtime. However, you can change
|
1549 | * the file during build time via Electron Forge, Electron Packager, or by editing
|
1550 | * `info.plist` with a text editor. Please refer to Apple's documentation for
|
1551 | * details.
|
1552 | *
|
1553 | * **Note:** In a Windows Store environment (when packaged as an `appx`) this API
|
1554 | * will return `true` for all calls but the registry key it sets won't be
|
1555 | * accessible by other applications. In order to register your Windows Store
|
1556 | * application as a default protocol handler you must declare the protocol in your
|
1557 | * manifest.
|
1558 | *
|
1559 | * The API uses the Windows Registry and `LSSetDefaultHandlerForURLScheme`
|
1560 | * internally.
|
1561 | */
|
1562 | setAsDefaultProtocolClient(protocol: string, path?: string, args?: string[]): boolean;
|
1563 | /**
|
1564 | * Whether the call succeeded.
|
1565 | *
|
1566 | * Sets the counter badge for current app. Setting the count to `0` will hide the
|
1567 | * badge.
|
1568 | *
|
1569 | * On macOS, it shows on the dock icon. On Linux, it only works for Unity launcher.
|
1570 | *
|
1571 | * **Note:** Unity launcher requires a `.desktop` file to work. For more
|
1572 | * information, please read the Unity integration documentation.
|
1573 | *
|
1574 | * **Note:** On macOS, you need to ensure that your application has the permission
|
1575 | * to display notifications for this method to work.
|
1576 | *
|
1577 | * @platform linux,darwin
|
1578 | */
|
1579 | setBadgeCount(count?: number): boolean;
|
1580 | /**
|
1581 | * The handler is called when a password is needed to unlock a client certificate
|
1582 | * for `hostname`.
|
1583 | */
|
1584 | setClientCertRequestPasswordHandler(handler: (clientCertRequestParams: ClientCertRequestParams) => Promise<string>): void;
|
1585 | /**
|
1586 | * Sets or removes a custom Jump List for the application, and returns one of the
|
1587 | * following strings:
|
1588 | *
|
1589 | * * `ok` - Nothing went wrong.
|
1590 | * * `error` - One or more errors occurred, enable runtime logging to figure out
|
1591 | * the likely cause.
|
1592 | * * `invalidSeparatorError` - An attempt was made to add a separator to a custom
|
1593 | * category in the Jump List. Separators are only allowed in the standard `Tasks`
|
1594 | * category.
|
1595 | * * `fileTypeRegistrationError` - An attempt was made to add a file link to the
|
1596 | * Jump List for a file type the app isn't registered to handle.
|
1597 | * * `customCategoryAccessDeniedError` - Custom categories can't be added to the
|
1598 | * Jump List due to user privacy or group policy settings.
|
1599 | *
|
1600 | * If `categories` is `null` the previously set custom Jump List (if any) will be
|
1601 | * replaced by the standard Jump List for the app (managed by Windows).
|
1602 | *
|
1603 | * **Note:** If a `JumpListCategory` object has neither the `type` nor the `name`
|
1604 | * property set then its `type` is assumed to be `tasks`. If the `name` property is
|
1605 | * set but the `type` property is omitted then the `type` is assumed to be
|
1606 | * `custom`.
|
1607 | *
|
1608 | * **Note:** Users can remove items from custom categories, and Windows will not
|
1609 | * allow a removed item to be added back into a custom category until **after** the
|
1610 | * next successful call to `app.setJumpList(categories)`. Any attempt to re-add a
|
1611 | * removed item to a custom category earlier than that will result in the entire
|
1612 | * custom category being omitted from the Jump List. The list of removed items can
|
1613 | * be obtained using `app.getJumpListSettings()`.
|
1614 | *
|
1615 | * **Note:** The maximum length of a Jump List item's `description` property is 260
|
1616 | * characters. Beyond this limit, the item will not be added to the Jump List, nor
|
1617 | * will it be displayed.
|
1618 | *
|
1619 | * Here's a very simple example of creating a custom Jump List:
|
1620 | *
|
1621 | * @platform win32
|
1622 | */
|
1623 | setJumpList(categories: (JumpListCategory[]) | (null)): ('ok' | 'error' | 'invalidSeparatorError' | 'fileTypeRegistrationError' | 'customCategoryAccessDeniedError');
|
1624 | /**
|
1625 | * Set the app's login item settings.
|
1626 | *
|
1627 | * To work with Electron's `autoUpdater` on Windows, which uses Squirrel, you'll
|
1628 | * want to set the launch path to Update.exe, and pass arguments that specify your
|
1629 | * application name. For example:
|
1630 | *
|
1631 | * For more information about setting different services as login items on macOS 13
|
1632 | * and up, see `SMAppService`.
|
1633 | *
|
1634 | * @platform darwin,win32
|
1635 | */
|
1636 | setLoginItemSettings(settings: Settings): void;
|
1637 | /**
|
1638 | * Overrides the current application's name.
|
1639 | *
|
1640 | * **Note:** This function overrides the name used internally by Electron; it does
|
1641 | * not affect the name that the OS uses.
|
1642 | */
|
1643 | setName(name: string): void;
|
1644 | /**
|
1645 | * Overrides the `path` to a special directory or file associated with `name`. If
|
1646 | * the path specifies a directory that does not exist, an `Error` is thrown. In
|
1647 | * that case, the directory should be created with `fs.mkdirSync` or similar.
|
1648 | *
|
1649 | * You can only override paths of a `name` defined in `app.getPath`.
|
1650 | *
|
1651 | * By default, web pages' cookies and caches will be stored under the `sessionData`
|
1652 | * directory. If you want to change this location, you have to override the
|
1653 | * `sessionData` path before the `ready` event of the `app` module is emitted.
|
1654 | */
|
1655 | setPath(name: string, path: string): void;
|
1656 | setProxy(config: ProxyConfig): void;
|
1657 | /**
|
1658 | * Set the `Secure Keyboard Entry` is enabled in your application.
|
1659 | *
|
1660 | * By using this API, important information such as password and other sensitive
|
1661 | * information can be prevented from being intercepted by other processes.
|
1662 | *
|
1663 | * See Apple's documentation for more details.
|
1664 | *
|
1665 | * **Note:** Enable `Secure Keyboard Entry` only when it is needed and disable it
|
1666 | * when it is no longer needed.
|
1667 | *
|
1668 | * @platform darwin
|
1669 | */
|
1670 | setSecureKeyboardEntryEnabled(enabled: boolean): void;
|
1671 | /**
|
1672 | * Creates an `NSUserActivity` and sets it as the current activity. The activity is
|
1673 | * eligible for Handoff to another device afterward.
|
1674 | *
|
1675 | * @platform darwin
|
1676 | */
|
1677 | setUserActivity(type: string, userInfo: any, webpageURL?: string): void;
|
1678 | /**
|
1679 | * Adds `tasks` to the Tasks category of the Jump List on Windows.
|
1680 | *
|
1681 | * `tasks` is an array of `Task` objects.
|
1682 | *
|
1683 | * Whether the call succeeded.
|
1684 | *
|
1685 | * **Note:** If you'd like to customize the Jump List even more use
|
1686 | * `app.setJumpList(categories)` instead.
|
1687 | *
|
1688 | * @platform win32
|
1689 | */
|
1690 | setUserTasks(tasks: Task[]): boolean;
|
1691 | /**
|
1692 | * Shows application windows after they were hidden. Does not automatically focus
|
1693 | * them.
|
1694 | *
|
1695 | * @platform darwin
|
1696 | */
|
1697 | show(): void;
|
1698 | /**
|
1699 | * Show the app's about panel options. These options can be overridden with
|
1700 | * `app.setAboutPanelOptions(options)`. This function runs asynchronously.
|
1701 | */
|
1702 | showAboutPanel(): void;
|
1703 | /**
|
1704 | * Show the platform's native emoji picker.
|
1705 | *
|
1706 | * @platform darwin,win32
|
1707 | */
|
1708 | showEmojiPanel(): void;
|
1709 | /**
|
1710 | * This function **must** be called once you have finished accessing the security
|
1711 | * scoped file. If you do not remember to stop accessing the bookmark, kernel
|
1712 | * resources will be leaked and your app will lose its ability to reach outside the
|
1713 | * sandbox completely, until your app is restarted.
|
1714 | *
|
1715 | * Start accessing a security scoped resource. With this method Electron
|
1716 | * applications that are packaged for the Mac App Store may reach outside their
|
1717 | * sandbox to access files chosen by the user. See Apple's documentation for a
|
1718 | * description of how this system works.
|
1719 | *
|
1720 | * @platform mas
|
1721 | */
|
1722 | startAccessingSecurityScopedResource(bookmarkData: string): Function;
|
1723 | /**
|
1724 | * Updates the current activity if its type matches `type`, merging the entries
|
1725 | * from `userInfo` into its current `userInfo` dictionary.
|
1726 | *
|
1727 | * @platform darwin
|
1728 | */
|
1729 | updateCurrentActivity(type: string, userInfo: any): void;
|
1730 | /**
|
1731 | * fulfilled when Electron is initialized. May be used as a convenient alternative
|
1732 | * to checking `app.isReady()` and subscribing to the `ready` event if the app is
|
1733 | * not ready yet.
|
1734 | */
|
1735 | whenReady(): Promise<void>;
|
1736 | /**
|
1737 | * A `boolean` property that's `true` if Chrome's accessibility support is enabled,
|
1738 | * `false` otherwise. This property will be `true` if the use of assistive
|
1739 | * technologies, such as screen readers, has been detected. Setting this property
|
1740 | * to `true` manually enables Chrome's accessibility support, allowing developers
|
1741 | * to expose accessibility switch to users in application settings.
|
1742 | *
|
1743 | * See Chromium's accessibility docs for more details. Disabled by default.
|
1744 | *
|
1745 | * This API must be called after the `ready` event is emitted.
|
1746 | *
|
1747 | * **Note:** Rendering accessibility tree can significantly affect the performance
|
1748 | * of your app. It should not be enabled by default.
|
1749 | *
|
1750 | * @platform darwin,win32
|
1751 | */
|
1752 | accessibilitySupportEnabled: boolean;
|
1753 | /**
|
1754 | * A `Menu | null` property that returns `Menu` if one has been set and `null`
|
1755 | * otherwise. Users can pass a Menu to set this property.
|
1756 | */
|
1757 | applicationMenu: (Menu) | (null);
|
1758 | /**
|
1759 | * An `Integer` property that returns the badge count for current app. Setting the
|
1760 | * count to `0` will hide the badge.
|
1761 | *
|
1762 | * On macOS, setting this with any nonzero integer shows on the dock icon. On
|
1763 | * Linux, this property only works for Unity launcher.
|
1764 | *
|
1765 | * **Note:** Unity launcher requires a `.desktop` file to work. For more
|
1766 | * information, please read the Unity integration documentation.
|
1767 | *
|
1768 | * **Note:** On macOS, you need to ensure that your application has the permission
|
1769 | * to display notifications for this property to take effect.
|
1770 | *
|
1771 | * @platform linux,darwin
|
1772 | */
|
1773 | badgeCount: number;
|
1774 | /**
|
1775 | * A `CommandLine` object that allows you to read and manipulate the command line
|
1776 | * arguments that Chromium uses.
|
1777 | *
|
1778 | */
|
1779 | readonly commandLine: CommandLine;
|
1780 | /**
|
1781 | * A `Dock` `| undefined` object that allows you to perform actions on your app
|
1782 | * icon in the user's dock on macOS.
|
1783 | *
|
1784 | * @platform darwin
|
1785 | */
|
1786 | readonly dock: Dock;
|
1787 | /**
|
1788 | * A `boolean` property that returns `true` if the app is packaged, `false`
|
1789 | * otherwise. For many apps, this property can be used to distinguish development
|
1790 | * and production environments.
|
1791 | *
|
1792 | */
|
1793 | readonly isPackaged: boolean;
|
1794 | /**
|
1795 | * A `string` property that indicates the current application's name, which is the
|
1796 | * name in the application's `package.json` file.
|
1797 | *
|
1798 | * Usually the `name` field of `package.json` is a short lowercase name, according
|
1799 | * to the npm modules spec. You should usually also specify a `productName` field,
|
1800 | * which is your application's full capitalized name, and which will be preferred
|
1801 | * over `name` by Electron.
|
1802 | */
|
1803 | name: string;
|
1804 | /**
|
1805 | * A `boolean` which when `true` indicates that the app is currently running under
|
1806 | * an ARM64 translator (like the macOS Rosetta Translator Environment or Windows
|
1807 | * WOW).
|
1808 | *
|
1809 | * You can use this property to prompt users to download the arm64 version of your
|
1810 | * application when they are mistakenly running the x64 version under Rosetta or
|
1811 | * WOW.
|
1812 | *
|
1813 | * @platform darwin,win32
|
1814 | */
|
1815 | readonly runningUnderARM64Translation: boolean;
|
1816 | /**
|
1817 | * A `string` which is the user agent string Electron will use as a global
|
1818 | * fallback.
|
1819 | *
|
1820 | * This is the user agent that will be used when no user agent is set at the
|
1821 | * `webContents` or `session` level. It is useful for ensuring that your entire
|
1822 | * app has the same user agent. Set to a custom value as early as possible in your
|
1823 | * app's initialization to ensure that your overridden value is used.
|
1824 | */
|
1825 | userAgentFallback: string;
|
1826 | }
|
1827 |
|
1828 | interface AutoUpdater extends NodeJS.EventEmitter {
|
1829 |
|
1830 | // Docs: https://electronjs.org/docs/api/auto-updater
|
1831 |
|
1832 | /**
|
1833 | * This event is emitted after a user calls `quitAndInstall()`.
|
1834 | *
|
1835 | * When this API is called, the `before-quit` event is not emitted before all
|
1836 | * windows are closed. As a result you should listen to this event if you wish to
|
1837 | * perform actions before the windows are closed while a process is quitting, as
|
1838 | * well as listening to `before-quit`.
|
1839 | */
|
1840 | on(event: 'before-quit-for-update', listener: () => void): this;
|
1841 | off(event: 'before-quit-for-update', listener: () => void): this;
|
1842 | once(event: 'before-quit-for-update', listener: () => void): this;
|
1843 | addListener(event: 'before-quit-for-update', listener: () => void): this;
|
1844 | removeListener(event: 'before-quit-for-update', listener: () => void): this;
|
1845 | /**
|
1846 | * Emitted when checking if an update has started.
|
1847 | */
|
1848 | on(event: 'checking-for-update', listener: () => void): this;
|
1849 | off(event: 'checking-for-update', listener: () => void): this;
|
1850 | once(event: 'checking-for-update', listener: () => void): this;
|
1851 | addListener(event: 'checking-for-update', listener: () => void): this;
|
1852 | removeListener(event: 'checking-for-update', listener: () => void): this;
|
1853 | /**
|
1854 | * Emitted when there is an error while updating.
|
1855 | */
|
1856 | on(event: 'error', listener: (error: Error) => void): this;
|
1857 | off(event: 'error', listener: (error: Error) => void): this;
|
1858 | once(event: 'error', listener: (error: Error) => void): this;
|
1859 | addListener(event: 'error', listener: (error: Error) => void): this;
|
1860 | removeListener(event: 'error', listener: (error: Error) => void): this;
|
1861 | /**
|
1862 | * Emitted when there is an available update. The update is downloaded
|
1863 | * automatically.
|
1864 | */
|
1865 | on(event: 'update-available', listener: () => void): this;
|
1866 | off(event: 'update-available', listener: () => void): this;
|
1867 | once(event: 'update-available', listener: () => void): this;
|
1868 | addListener(event: 'update-available', listener: () => void): this;
|
1869 | removeListener(event: 'update-available', listener: () => void): this;
|
1870 | /**
|
1871 | * Emitted when an update has been downloaded.
|
1872 | *
|
1873 | * On Windows only `releaseName` is available.
|
1874 | *
|
1875 | * **Note:** It is not strictly necessary to handle this event. A successfully
|
1876 | * downloaded update will still be applied the next time the application starts.
|
1877 | */
|
1878 | on(event: 'update-downloaded', listener: (event: Event,
|
1879 | releaseNotes: string,
|
1880 | releaseName: string,
|
1881 | releaseDate: Date,
|
1882 | updateURL: string) => void): this;
|
1883 | off(event: 'update-downloaded', listener: (event: Event,
|
1884 | releaseNotes: string,
|
1885 | releaseName: string,
|
1886 | releaseDate: Date,
|
1887 | updateURL: string) => void): this;
|
1888 | once(event: 'update-downloaded', listener: (event: Event,
|
1889 | releaseNotes: string,
|
1890 | releaseName: string,
|
1891 | releaseDate: Date,
|
1892 | updateURL: string) => void): this;
|
1893 | addListener(event: 'update-downloaded', listener: (event: Event,
|
1894 | releaseNotes: string,
|
1895 | releaseName: string,
|
1896 | releaseDate: Date,
|
1897 | updateURL: string) => void): this;
|
1898 | removeListener(event: 'update-downloaded', listener: (event: Event,
|
1899 | releaseNotes: string,
|
1900 | releaseName: string,
|
1901 | releaseDate: Date,
|
1902 | updateURL: string) => void): this;
|
1903 | /**
|
1904 | * Emitted when there is no available update.
|
1905 | */
|
1906 | on(event: 'update-not-available', listener: () => void): this;
|
1907 | off(event: 'update-not-available', listener: () => void): this;
|
1908 | once(event: 'update-not-available', listener: () => void): this;
|
1909 | addListener(event: 'update-not-available', listener: () => void): this;
|
1910 | removeListener(event: 'update-not-available', listener: () => void): this;
|
1911 | /**
|
1912 | * Asks the server whether there is an update. You must call `setFeedURL` before
|
1913 | * using this API.
|
1914 | *
|
1915 | * **Note:** If an update is available it will be downloaded automatically. Calling
|
1916 | * `autoUpdater.checkForUpdates()` twice will download the update two times.
|
1917 | */
|
1918 | checkForUpdates(): void;
|
1919 | /**
|
1920 | * The current update feed URL.
|
1921 | */
|
1922 | getFeedURL(): string;
|
1923 | /**
|
1924 | * Restarts the app and installs the update after it has been downloaded. It should
|
1925 | * only be called after `update-downloaded` has been emitted.
|
1926 | *
|
1927 | * Under the hood calling `autoUpdater.quitAndInstall()` will close all application
|
1928 | * windows first, and automatically call `app.quit()` after all windows have been
|
1929 | * closed.
|
1930 | *
|
1931 | * **Note:** It is not strictly necessary to call this function to apply an update,
|
1932 | * as a successfully downloaded update will always be applied the next time the
|
1933 | * application starts.
|
1934 | */
|
1935 | quitAndInstall(): void;
|
1936 | /**
|
1937 | * Sets the `url` and initialize the auto updater.
|
1938 | */
|
1939 | setFeedURL(options: FeedURLOptions): void;
|
1940 | }
|
1941 |
|
1942 | class BaseWindow extends NodeEventEmitter {
|
1943 |
|
1944 | // Docs: https://electronjs.org/docs/api/base-window
|
1945 |
|
1946 | /**
|
1947 | * Emitted when the window is set or unset to show always on top of other windows.
|
1948 | */
|
1949 | on(event: 'always-on-top-changed', listener: (event: Event,
|
1950 | isAlwaysOnTop: boolean) => void): this;
|
1951 | off(event: 'always-on-top-changed', listener: (event: Event,
|
1952 | isAlwaysOnTop: boolean) => void): this;
|
1953 | once(event: 'always-on-top-changed', listener: (event: Event,
|
1954 | isAlwaysOnTop: boolean) => void): this;
|
1955 | addListener(event: 'always-on-top-changed', listener: (event: Event,
|
1956 | isAlwaysOnTop: boolean) => void): this;
|
1957 | removeListener(event: 'always-on-top-changed', listener: (event: Event,
|
1958 | isAlwaysOnTop: boolean) => void): this;
|
1959 | /**
|
1960 | * Emitted when an App Command is invoked. These are typically related to keyboard
|
1961 | * media keys or browser commands, as well as the "Back" button built into some
|
1962 | * mice on Windows.
|
1963 | *
|
1964 | * Commands are lowercased, underscores are replaced with hyphens, and the
|
1965 | * `APPCOMMAND_` prefix is stripped off. e.g. `APPCOMMAND_BROWSER_BACKWARD` is
|
1966 | * emitted as `browser-backward`.
|
1967 | *
|
1968 | * The following app commands are explicitly supported on Linux:
|
1969 | *
|
1970 | * * `browser-backward`
|
1971 | * * `browser-forward`
|
1972 | *
|
1973 | * @platform win32,linux
|
1974 | */
|
1975 | on(event: 'app-command', listener: (event: Event,
|
1976 | command: string) => void): this;
|
1977 | /**
|
1978 | * @platform win32,linux
|
1979 | */
|
1980 | off(event: 'app-command', listener: (event: Event,
|
1981 | command: string) => void): this;
|
1982 | /**
|
1983 | * @platform win32,linux
|
1984 | */
|
1985 | once(event: 'app-command', listener: (event: Event,
|
1986 | command: string) => void): this;
|
1987 | /**
|
1988 | * @platform win32,linux
|
1989 | */
|
1990 | addListener(event: 'app-command', listener: (event: Event,
|
1991 | command: string) => void): this;
|
1992 | /**
|
1993 | * @platform win32,linux
|
1994 | */
|
1995 | removeListener(event: 'app-command', listener: (event: Event,
|
1996 | command: string) => void): this;
|
1997 | /**
|
1998 | * Emitted when the window loses focus.
|
1999 | */
|
2000 | on(event: 'blur', listener: (event: Event) => void): this;
|
2001 | off(event: 'blur', listener: (event: Event) => void): this;
|
2002 | once(event: 'blur', listener: (event: Event) => void): this;
|
2003 | addListener(event: 'blur', listener: (event: Event) => void): this;
|
2004 | removeListener(event: 'blur', listener: (event: Event) => void): this;
|
2005 | /**
|
2006 | * Emitted when the window is going to be closed. It's emitted before the
|
2007 | * `beforeunload` and `unload` event of the DOM. Calling `event.preventDefault()`
|
2008 | * will cancel the close.
|
2009 | *
|
2010 | * Usually you would want to use the `beforeunload` handler to decide whether the
|
2011 | * window should be closed, which will also be called when the window is reloaded.
|
2012 | * In Electron, returning any value other than `undefined` would cancel the close.
|
2013 | * For example:
|
2014 | *
|
2015 | * _**Note**: There is a subtle difference between the behaviors of
|
2016 | * `window.onbeforeunload = handler` and `window.addEventListener('beforeunload',
|
2017 | * handler)`. It is recommended to always set the `event.returnValue` explicitly,
|
2018 | * instead of only returning a value, as the former works more consistently within
|
2019 | * Electron._
|
2020 | */
|
2021 | on(event: 'close', listener: (event: Event) => void): this;
|
2022 | off(event: 'close', listener: (event: Event) => void): this;
|
2023 | once(event: 'close', listener: (event: Event) => void): this;
|
2024 | addListener(event: 'close', listener: (event: Event) => void): this;
|
2025 | removeListener(event: 'close', listener: (event: Event) => void): this;
|
2026 | /**
|
2027 | * Emitted when the window is closed. After you have received this event you should
|
2028 | * remove the reference to the window and avoid using it any more.
|
2029 | */
|
2030 | on(event: 'closed', listener: () => void): this;
|
2031 | off(event: 'closed', listener: () => void): this;
|
2032 | once(event: 'closed', listener: () => void): this;
|
2033 | addListener(event: 'closed', listener: () => void): this;
|
2034 | removeListener(event: 'closed', listener: () => void): this;
|
2035 | /**
|
2036 | * Emitted when the window enters a full-screen state.
|
2037 | */
|
2038 | on(event: 'enter-full-screen', listener: () => void): this;
|
2039 | off(event: 'enter-full-screen', listener: () => void): this;
|
2040 | once(event: 'enter-full-screen', listener: () => void): this;
|
2041 | addListener(event: 'enter-full-screen', listener: () => void): this;
|
2042 | removeListener(event: 'enter-full-screen', listener: () => void): this;
|
2043 | /**
|
2044 | * Emitted when the window gains focus.
|
2045 | */
|
2046 | on(event: 'focus', listener: (event: Event) => void): this;
|
2047 | off(event: 'focus', listener: (event: Event) => void): this;
|
2048 | once(event: 'focus', listener: (event: Event) => void): this;
|
2049 | addListener(event: 'focus', listener: (event: Event) => void): this;
|
2050 | removeListener(event: 'focus', listener: (event: Event) => void): this;
|
2051 | /**
|
2052 | * Emitted when the window is hidden.
|
2053 | */
|
2054 | on(event: 'hide', listener: () => void): this;
|
2055 | off(event: 'hide', listener: () => void): this;
|
2056 | once(event: 'hide', listener: () => void): this;
|
2057 | addListener(event: 'hide', listener: () => void): this;
|
2058 | removeListener(event: 'hide', listener: () => void): this;
|
2059 | /**
|
2060 | * Emitted when the window leaves a full-screen state.
|
2061 | */
|
2062 | on(event: 'leave-full-screen', listener: () => void): this;
|
2063 | off(event: 'leave-full-screen', listener: () => void): this;
|
2064 | once(event: 'leave-full-screen', listener: () => void): this;
|
2065 | addListener(event: 'leave-full-screen', listener: () => void): this;
|
2066 | removeListener(event: 'leave-full-screen', listener: () => void): this;
|
2067 | /**
|
2068 | * Emitted when window is maximized.
|
2069 | */
|
2070 | on(event: 'maximize', listener: () => void): this;
|
2071 | off(event: 'maximize', listener: () => void): this;
|
2072 | once(event: 'maximize', listener: () => void): this;
|
2073 | addListener(event: 'maximize', listener: () => void): this;
|
2074 | removeListener(event: 'maximize', listener: () => void): this;
|
2075 | /**
|
2076 | * Emitted when the window is minimized.
|
2077 | */
|
2078 | on(event: 'minimize', listener: () => void): this;
|
2079 | off(event: 'minimize', listener: () => void): this;
|
2080 | once(event: 'minimize', listener: () => void): this;
|
2081 | addListener(event: 'minimize', listener: () => void): this;
|
2082 | removeListener(event: 'minimize', listener: () => void): this;
|
2083 | /**
|
2084 | * Emitted when the window is being moved to a new position.
|
2085 | */
|
2086 | on(event: 'move', listener: () => void): this;
|
2087 | off(event: 'move', listener: () => void): this;
|
2088 | once(event: 'move', listener: () => void): this;
|
2089 | addListener(event: 'move', listener: () => void): this;
|
2090 | removeListener(event: 'move', listener: () => void): this;
|
2091 | /**
|
2092 | * Emitted once when the window is moved to a new position.
|
2093 | *
|
2094 | * **Note**: On macOS this event is an alias of `move`.
|
2095 | *
|
2096 | * @platform darwin,win32
|
2097 | */
|
2098 | on(event: 'moved', listener: () => void): this;
|
2099 | /**
|
2100 | * @platform darwin,win32
|
2101 | */
|
2102 | off(event: 'moved', listener: () => void): this;
|
2103 | /**
|
2104 | * @platform darwin,win32
|
2105 | */
|
2106 | once(event: 'moved', listener: () => void): this;
|
2107 | /**
|
2108 | * @platform darwin,win32
|
2109 | */
|
2110 | addListener(event: 'moved', listener: () => void): this;
|
2111 | /**
|
2112 | * @platform darwin,win32
|
2113 | */
|
2114 | removeListener(event: 'moved', listener: () => void): this;
|
2115 | /**
|
2116 | * Emitted when the native new tab button is clicked.
|
2117 | *
|
2118 | * @platform darwin
|
2119 | */
|
2120 | on(event: 'new-window-for-tab', listener: () => void): this;
|
2121 | /**
|
2122 | * @platform darwin
|
2123 | */
|
2124 | off(event: 'new-window-for-tab', listener: () => void): this;
|
2125 | /**
|
2126 | * @platform darwin
|
2127 | */
|
2128 | once(event: 'new-window-for-tab', listener: () => void): this;
|
2129 | /**
|
2130 | * @platform darwin
|
2131 | */
|
2132 | addListener(event: 'new-window-for-tab', listener: () => void): this;
|
2133 | /**
|
2134 | * @platform darwin
|
2135 | */
|
2136 | removeListener(event: 'new-window-for-tab', listener: () => void): this;
|
2137 | /**
|
2138 | * Emitted after the window has been resized.
|
2139 | */
|
2140 | on(event: 'resize', listener: () => void): this;
|
2141 | off(event: 'resize', listener: () => void): this;
|
2142 | once(event: 'resize', listener: () => void): this;
|
2143 | addListener(event: 'resize', listener: () => void): this;
|
2144 | removeListener(event: 'resize', listener: () => void): this;
|
2145 | /**
|
2146 | * Emitted once when the window has finished being resized.
|
2147 | *
|
2148 | * This is usually emitted when the window has been resized manually. On macOS,
|
2149 | * resizing the window with `setBounds`/`setSize` and setting the `animate`
|
2150 | * parameter to `true` will also emit this event once resizing has finished.
|
2151 | *
|
2152 | * @platform darwin,win32
|
2153 | */
|
2154 | on(event: 'resized', listener: () => void): this;
|
2155 | /**
|
2156 | * @platform darwin,win32
|
2157 | */
|
2158 | off(event: 'resized', listener: () => void): this;
|
2159 | /**
|
2160 | * @platform darwin,win32
|
2161 | */
|
2162 | once(event: 'resized', listener: () => void): this;
|
2163 | /**
|
2164 | * @platform darwin,win32
|
2165 | */
|
2166 | addListener(event: 'resized', listener: () => void): this;
|
2167 | /**
|
2168 | * @platform darwin,win32
|
2169 | */
|
2170 | removeListener(event: 'resized', listener: () => void): this;
|
2171 | /**
|
2172 | * Emitted when the window is restored from a minimized state.
|
2173 | */
|
2174 | on(event: 'restore', listener: () => void): this;
|
2175 | off(event: 'restore', listener: () => void): this;
|
2176 | once(event: 'restore', listener: () => void): this;
|
2177 | addListener(event: 'restore', listener: () => void): this;
|
2178 | removeListener(event: 'restore', listener: () => void): this;
|
2179 | /**
|
2180 | * Emitted on trackpad rotation gesture. Continually emitted until rotation gesture
|
2181 | * is ended. The `rotation` value on each emission is the angle in degrees rotated
|
2182 | * since the last emission. The last emitted event upon a rotation gesture will
|
2183 | * always be of value `0`. Counter-clockwise rotation values are positive, while
|
2184 | * clockwise ones are negative.
|
2185 | *
|
2186 | * @platform darwin
|
2187 | */
|
2188 | on(event: 'rotate-gesture', listener: (event: Event,
|
2189 | rotation: number) => void): this;
|
2190 | /**
|
2191 | * @platform darwin
|
2192 | */
|
2193 | off(event: 'rotate-gesture', listener: (event: Event,
|
2194 | rotation: number) => void): this;
|
2195 | /**
|
2196 | * @platform darwin
|
2197 | */
|
2198 | once(event: 'rotate-gesture', listener: (event: Event,
|
2199 | rotation: number) => void): this;
|
2200 | /**
|
2201 | * @platform darwin
|
2202 | */
|
2203 | addListener(event: 'rotate-gesture', listener: (event: Event,
|
2204 | rotation: number) => void): this;
|
2205 | /**
|
2206 | * @platform darwin
|
2207 | */
|
2208 | removeListener(event: 'rotate-gesture', listener: (event: Event,
|
2209 | rotation: number) => void): this;
|
2210 | /**
|
2211 | * Emitted when window session is going to end due to force shutdown or machine
|
2212 | * restart or session log off.
|
2213 | *
|
2214 | * @platform win32
|
2215 | */
|
2216 | on(event: 'session-end', listener: () => void): this;
|
2217 | /**
|
2218 | * @platform win32
|
2219 | */
|
2220 | off(event: 'session-end', listener: () => void): this;
|
2221 | /**
|
2222 | * @platform win32
|
2223 | */
|
2224 | once(event: 'session-end', listener: () => void): this;
|
2225 | /**
|
2226 | * @platform win32
|
2227 | */
|
2228 | addListener(event: 'session-end', listener: () => void): this;
|
2229 | /**
|
2230 | * @platform win32
|
2231 | */
|
2232 | removeListener(event: 'session-end', listener: () => void): this;
|
2233 | /**
|
2234 | * Emitted when the window opens a sheet.
|
2235 | *
|
2236 | * @platform darwin
|
2237 | */
|
2238 | on(event: 'sheet-begin', listener: () => void): this;
|
2239 | /**
|
2240 | * @platform darwin
|
2241 | */
|
2242 | off(event: 'sheet-begin', listener: () => void): this;
|
2243 | /**
|
2244 | * @platform darwin
|
2245 | */
|
2246 | once(event: 'sheet-begin', listener: () => void): this;
|
2247 | /**
|
2248 | * @platform darwin
|
2249 | */
|
2250 | addListener(event: 'sheet-begin', listener: () => void): this;
|
2251 | /**
|
2252 | * @platform darwin
|
2253 | */
|
2254 | removeListener(event: 'sheet-begin', listener: () => void): this;
|
2255 | /**
|
2256 | * Emitted when the window has closed a sheet.
|
2257 | *
|
2258 | * @platform darwin
|
2259 | */
|
2260 | on(event: 'sheet-end', listener: () => void): this;
|
2261 | /**
|
2262 | * @platform darwin
|
2263 | */
|
2264 | off(event: 'sheet-end', listener: () => void): this;
|
2265 | /**
|
2266 | * @platform darwin
|
2267 | */
|
2268 | once(event: 'sheet-end', listener: () => void): this;
|
2269 | /**
|
2270 | * @platform darwin
|
2271 | */
|
2272 | addListener(event: 'sheet-end', listener: () => void): this;
|
2273 | /**
|
2274 | * @platform darwin
|
2275 | */
|
2276 | removeListener(event: 'sheet-end', listener: () => void): this;
|
2277 | /**
|
2278 | * Emitted when the window is shown.
|
2279 | */
|
2280 | on(event: 'show', listener: () => void): this;
|
2281 | off(event: 'show', listener: () => void): this;
|
2282 | once(event: 'show', listener: () => void): this;
|
2283 | addListener(event: 'show', listener: () => void): this;
|
2284 | removeListener(event: 'show', listener: () => void): this;
|
2285 | /**
|
2286 | * Emitted on 3-finger swipe. Possible directions are `up`, `right`, `down`,
|
2287 | * `left`.
|
2288 | *
|
2289 | * The method underlying this event is built to handle older macOS-style trackpad
|
2290 | * swiping, where the content on the screen doesn't move with the swipe. Most macOS
|
2291 | * trackpads are not configured to allow this kind of swiping anymore, so in order
|
2292 | * for it to emit properly the 'Swipe between pages' preference in `System
|
2293 | * Preferences > Trackpad > More Gestures` must be set to 'Swipe with two or three
|
2294 | * fingers'.
|
2295 | *
|
2296 | * @platform darwin
|
2297 | */
|
2298 | on(event: 'swipe', listener: (event: Event,
|
2299 | direction: string) => void): this;
|
2300 | /**
|
2301 | * @platform darwin
|
2302 | */
|
2303 | off(event: 'swipe', listener: (event: Event,
|
2304 | direction: string) => void): this;
|
2305 | /**
|
2306 | * @platform darwin
|
2307 | */
|
2308 | once(event: 'swipe', listener: (event: Event,
|
2309 | direction: string) => void): this;
|
2310 | /**
|
2311 | * @platform darwin
|
2312 | */
|
2313 | addListener(event: 'swipe', listener: (event: Event,
|
2314 | direction: string) => void): this;
|
2315 | /**
|
2316 | * @platform darwin
|
2317 | */
|
2318 | removeListener(event: 'swipe', listener: (event: Event,
|
2319 | direction: string) => void): this;
|
2320 | /**
|
2321 | * Emitted when the system context menu is triggered on the window, this is
|
2322 | * normally only triggered when the user right clicks on the non-client area of
|
2323 | * your window. This is the window titlebar or any area you have declared as
|
2324 | * `-webkit-app-region: drag` in a frameless window.
|
2325 | *
|
2326 | * Calling `event.preventDefault()` will prevent the menu from being displayed.
|
2327 | *
|
2328 | * @platform win32
|
2329 | */
|
2330 | on(event: 'system-context-menu', listener: (event: Event,
|
2331 | /**
|
2332 | * The screen coordinates the context menu was triggered at
|
2333 | */
|
2334 | point: Point) => void): this;
|
2335 | /**
|
2336 | * @platform win32
|
2337 | */
|
2338 | off(event: 'system-context-menu', listener: (event: Event,
|
2339 | /**
|
2340 | * The screen coordinates the context menu was triggered at
|
2341 | */
|
2342 | point: Point) => void): this;
|
2343 | /**
|
2344 | * @platform win32
|
2345 | */
|
2346 | once(event: 'system-context-menu', listener: (event: Event,
|
2347 | /**
|
2348 | * The screen coordinates the context menu was triggered at
|
2349 | */
|
2350 | point: Point) => void): this;
|
2351 | /**
|
2352 | * @platform win32
|
2353 | */
|
2354 | addListener(event: 'system-context-menu', listener: (event: Event,
|
2355 | /**
|
2356 | * The screen coordinates the context menu was triggered at
|
2357 | */
|
2358 | point: Point) => void): this;
|
2359 | /**
|
2360 | * @platform win32
|
2361 | */
|
2362 | removeListener(event: 'system-context-menu', listener: (event: Event,
|
2363 | /**
|
2364 | * The screen coordinates the context menu was triggered at
|
2365 | */
|
2366 | point: Point) => void): this;
|
2367 | /**
|
2368 | * Emitted when the window exits from a maximized state.
|
2369 | */
|
2370 | on(event: 'unmaximize', listener: () => void): this;
|
2371 | off(event: 'unmaximize', listener: () => void): this;
|
2372 | once(event: 'unmaximize', listener: () => void): this;
|
2373 | addListener(event: 'unmaximize', listener: () => void): this;
|
2374 | removeListener(event: 'unmaximize', listener: () => void): this;
|
2375 | /**
|
2376 | * Emitted before the window is moved. On Windows, calling `event.preventDefault()`
|
2377 | * will prevent the window from being moved.
|
2378 | *
|
2379 | * Note that this is only emitted when the window is being moved manually. Moving
|
2380 | * the window with `setPosition`/`setBounds`/`center` will not emit this event.
|
2381 | *
|
2382 | * @platform darwin,win32
|
2383 | */
|
2384 | on(event: 'will-move', listener: (event: Event,
|
2385 | /**
|
2386 | * Location the window is being moved to.
|
2387 | */
|
2388 | newBounds: Rectangle) => void): this;
|
2389 | /**
|
2390 | * @platform darwin,win32
|
2391 | */
|
2392 | off(event: 'will-move', listener: (event: Event,
|
2393 | /**
|
2394 | * Location the window is being moved to.
|
2395 | */
|
2396 | newBounds: Rectangle) => void): this;
|
2397 | /**
|
2398 | * @platform darwin,win32
|
2399 | */
|
2400 | once(event: 'will-move', listener: (event: Event,
|
2401 | /**
|
2402 | * Location the window is being moved to.
|
2403 | */
|
2404 | newBounds: Rectangle) => void): this;
|
2405 | /**
|
2406 | * @platform darwin,win32
|
2407 | */
|
2408 | addListener(event: 'will-move', listener: (event: Event,
|
2409 | /**
|
2410 | * Location the window is being moved to.
|
2411 | */
|
2412 | newBounds: Rectangle) => void): this;
|
2413 | /**
|
2414 | * @platform darwin,win32
|
2415 | */
|
2416 | removeListener(event: 'will-move', listener: (event: Event,
|
2417 | /**
|
2418 | * Location the window is being moved to.
|
2419 | */
|
2420 | newBounds: Rectangle) => void): this;
|
2421 | /**
|
2422 | * Emitted before the window is resized. Calling `event.preventDefault()` will
|
2423 | * prevent the window from being resized.
|
2424 | *
|
2425 | * Note that this is only emitted when the window is being resized manually.
|
2426 | * Resizing the window with `setBounds`/`setSize` will not emit this event.
|
2427 | *
|
2428 | * The possible values and behaviors of the `edge` option are platform dependent.
|
2429 | * Possible values are:
|
2430 | *
|
2431 | * * On Windows, possible values are `bottom`, `top`, `left`, `right`, `top-left`,
|
2432 | * `top-right`, `bottom-left`, `bottom-right`.
|
2433 | * * On macOS, possible values are `bottom` and `right`.
|
2434 | * * The value `bottom` is used to denote vertical resizing.
|
2435 | * * The value `right` is used to denote horizontal resizing.
|
2436 | *
|
2437 | * @platform darwin,win32
|
2438 | */
|
2439 | on(event: 'will-resize', listener: (event: Event,
|
2440 | /**
|
2441 | * Size the window is being resized to.
|
2442 | */
|
2443 | newBounds: Rectangle,
|
2444 | details: WillResizeDetails) => void): this;
|
2445 | /**
|
2446 | * @platform darwin,win32
|
2447 | */
|
2448 | off(event: 'will-resize', listener: (event: Event,
|
2449 | /**
|
2450 | * Size the window is being resized to.
|
2451 | */
|
2452 | newBounds: Rectangle,
|
2453 | details: WillResizeDetails) => void): this;
|
2454 | /**
|
2455 | * @platform darwin,win32
|
2456 | */
|
2457 | once(event: 'will-resize', listener: (event: Event,
|
2458 | /**
|
2459 | * Size the window is being resized to.
|
2460 | */
|
2461 | newBounds: Rectangle,
|
2462 | details: WillResizeDetails) => void): this;
|
2463 | /**
|
2464 | * @platform darwin,win32
|
2465 | */
|
2466 | addListener(event: 'will-resize', listener: (event: Event,
|
2467 | /**
|
2468 | * Size the window is being resized to.
|
2469 | */
|
2470 | newBounds: Rectangle,
|
2471 | details: WillResizeDetails) => void): this;
|
2472 | /**
|
2473 | * @platform darwin,win32
|
2474 | */
|
2475 | removeListener(event: 'will-resize', listener: (event: Event,
|
2476 | /**
|
2477 | * Size the window is being resized to.
|
2478 | */
|
2479 | newBounds: Rectangle,
|
2480 | details: WillResizeDetails) => void): this;
|
2481 | /**
|
2482 | * BaseWindow
|
2483 | */
|
2484 | constructor(options?: BaseWindowConstructorOptions);
|
2485 | /**
|
2486 | * The window with the given `id`.
|
2487 | */
|
2488 | static fromId(id: number): (BaseWindow) | (null);
|
2489 | /**
|
2490 | * An array of all opened browser windows.
|
2491 | */
|
2492 | static getAllWindows(): BaseWindow[];
|
2493 | /**
|
2494 | * The window that is focused in this application, otherwise returns `null`.
|
2495 | */
|
2496 | static getFocusedWindow(): (BaseWindow) | (null);
|
2497 | /**
|
2498 | * Adds a window as a tab on this window, after the tab for the window instance.
|
2499 | *
|
2500 | * @platform darwin
|
2501 | */
|
2502 | addTabbedWindow(baseWindow: BaseWindow): void;
|
2503 | /**
|
2504 | * Removes focus from the window.
|
2505 | */
|
2506 | blur(): void;
|
2507 | /**
|
2508 | * Moves window to the center of the screen.
|
2509 | */
|
2510 | center(): void;
|
2511 | /**
|
2512 | * Try to close the window. This has the same effect as a user manually clicking
|
2513 | * the close button of the window. The web page may cancel the close though. See
|
2514 | * the close event.
|
2515 | */
|
2516 | close(): void;
|
2517 | /**
|
2518 | * Closes the currently open Quick Look panel.
|
2519 | *
|
2520 | * @platform darwin
|
2521 | */
|
2522 | closeFilePreview(): void;
|
2523 | /**
|
2524 | * Force closing the window, the `unload` and `beforeunload` event won't be emitted
|
2525 | * for the web page, and `close` event will also not be emitted for this window,
|
2526 | * but it guarantees the `closed` event will be emitted.
|
2527 | */
|
2528 | destroy(): void;
|
2529 | /**
|
2530 | * Starts or stops flashing the window to attract user's attention.
|
2531 | */
|
2532 | flashFrame(flag: boolean): void;
|
2533 | /**
|
2534 | * Focuses on the window.
|
2535 | */
|
2536 | focus(): void;
|
2537 | /**
|
2538 | * Gets the background color of the window in Hex (`#RRGGBB`) format.
|
2539 | *
|
2540 | * See Setting `backgroundColor`.
|
2541 | *
|
2542 | * **Note:** The alpha value is _not_ returned alongside the red, green, and blue
|
2543 | * values.
|
2544 | */
|
2545 | getBackgroundColor(): string;
|
2546 | /**
|
2547 | * The `bounds` of the window as `Object`.
|
2548 | *
|
2549 | * **Note:** On macOS, the y-coordinate value returned will be at minimum the Tray
|
2550 | * height. For example, calling `win.setBounds({ x: 25, y: 20, width: 800, height:
|
2551 | * 600 })` with a tray height of 38 means that `win.getBounds()` will return `{ x:
|
2552 | * 25, y: 38, width: 800, height: 600 }`.
|
2553 | */
|
2554 | getBounds(): Rectangle;
|
2555 | /**
|
2556 | * All child windows.
|
2557 | */
|
2558 | getChildWindows(): BaseWindow[];
|
2559 | /**
|
2560 | * The `bounds` of the window's client area as `Object`.
|
2561 | */
|
2562 | getContentBounds(): Rectangle;
|
2563 | /**
|
2564 | * Contains the window's client area's width and height.
|
2565 | */
|
2566 | getContentSize(): number[];
|
2567 | /**
|
2568 | * Returns View - The content view of the window.
|
2569 | */
|
2570 | getContentView(): void;
|
2571 | /**
|
2572 | * Contains the window's maximum width and height.
|
2573 | */
|
2574 | getMaximumSize(): number[];
|
2575 | /**
|
2576 | * Window id in the format of DesktopCapturerSource's id. For example
|
2577 | * "window:1324:0".
|
2578 | *
|
2579 | * More precisely the format is `window:id:other_id` where `id` is `HWND` on
|
2580 | * Windows, `CGWindowID` (`uint64_t`) on macOS and `Window` (`unsigned long`) on
|
2581 | * Linux. `other_id` is used to identify web contents (tabs) so within the same top
|
2582 | * level window.
|
2583 | */
|
2584 | getMediaSourceId(): string;
|
2585 | /**
|
2586 | * Contains the window's minimum width and height.
|
2587 | */
|
2588 | getMinimumSize(): number[];
|
2589 | /**
|
2590 | * The platform-specific handle of the window.
|
2591 | *
|
2592 | * The native type of the handle is `HWND` on Windows, `NSView*` on macOS, and
|
2593 | * `Window` (`unsigned long`) on Linux.
|
2594 | */
|
2595 | getNativeWindowHandle(): Buffer;
|
2596 | /**
|
2597 | * Contains the window bounds of the normal state
|
2598 | *
|
2599 | * **Note:** whatever the current state of the window : maximized, minimized or in
|
2600 | * fullscreen, this function always returns the position and size of the window in
|
2601 | * normal state. In normal state, getBounds and getNormalBounds returns the same
|
2602 | * `Rectangle`.
|
2603 | */
|
2604 | getNormalBounds(): Rectangle;
|
2605 | /**
|
2606 | * between 0.0 (fully transparent) and 1.0 (fully opaque). On Linux, always returns
|
2607 | * 1.
|
2608 | */
|
2609 | getOpacity(): number;
|
2610 | /**
|
2611 | * The parent window or `null` if there is no parent.
|
2612 | */
|
2613 | getParentWindow(): (BaseWindow) | (null);
|
2614 | /**
|
2615 | * Contains the window's current position.
|
2616 | */
|
2617 | getPosition(): number[];
|
2618 | /**
|
2619 | * The pathname of the file the window represents.
|
2620 | *
|
2621 | * @platform darwin
|
2622 | */
|
2623 | getRepresentedFilename(): string;
|
2624 | /**
|
2625 | * Contains the window's width and height.
|
2626 | */
|
2627 | getSize(): number[];
|
2628 | /**
|
2629 | * The title of the native window.
|
2630 | *
|
2631 | * **Note:** The title of the web page can be different from the title of the
|
2632 | * native window.
|
2633 | */
|
2634 | getTitle(): string;
|
2635 | /**
|
2636 | * The custom position for the traffic light buttons in frameless window, `null`
|
2637 | * will be returned when there is no custom position.
|
2638 | *
|
2639 | * @platform darwin
|
2640 | */
|
2641 | getWindowButtonPosition(): (Point) | (null);
|
2642 | /**
|
2643 | * Whether the window has a shadow.
|
2644 | */
|
2645 | hasShadow(): boolean;
|
2646 | /**
|
2647 | * Hides the window.
|
2648 | */
|
2649 | hide(): void;
|
2650 | /**
|
2651 | * Hooks a windows message. The `callback` is called when the message is received
|
2652 | * in the WndProc.
|
2653 | *
|
2654 | * @platform win32
|
2655 | */
|
2656 | hookWindowMessage(message: number, callback: (wParam: Buffer, lParam: Buffer) => void): void;
|
2657 | /**
|
2658 | * Invalidates the window shadow so that it is recomputed based on the current
|
2659 | * window shape.
|
2660 | *
|
2661 | * `BaseWindow`s that are transparent can sometimes leave behind visual artifacts
|
2662 | * on macOS. This method can be used to clear these artifacts when, for example,
|
2663 | * performing an animation.
|
2664 | *
|
2665 | * @platform darwin
|
2666 | */
|
2667 | invalidateShadow(): void;
|
2668 | /**
|
2669 | * Whether the window is always on top of other windows.
|
2670 | */
|
2671 | isAlwaysOnTop(): boolean;
|
2672 | /**
|
2673 | * Whether the window can be manually closed by user.
|
2674 | *
|
2675 | * On Linux always returns `true`.
|
2676 | *
|
2677 | * @platform darwin,win32
|
2678 | */
|
2679 | isClosable(): boolean;
|
2680 | /**
|
2681 | * Whether the window is destroyed.
|
2682 | */
|
2683 | isDestroyed(): boolean;
|
2684 | /**
|
2685 | * Whether the window's document has been edited.
|
2686 | *
|
2687 | * @platform darwin
|
2688 | */
|
2689 | isDocumentEdited(): boolean;
|
2690 | /**
|
2691 | * whether the window is enabled.
|
2692 | */
|
2693 | isEnabled(): boolean;
|
2694 | /**
|
2695 | * Whether the window can be focused.
|
2696 | *
|
2697 | * @platform darwin,win32
|
2698 | */
|
2699 | isFocusable(): boolean;
|
2700 | /**
|
2701 | * Whether the window is focused.
|
2702 | */
|
2703 | isFocused(): boolean;
|
2704 | /**
|
2705 | * Whether the window is in fullscreen mode.
|
2706 | */
|
2707 | isFullScreen(): boolean;
|
2708 | /**
|
2709 | * Whether the maximize/zoom window button toggles fullscreen mode or maximizes the
|
2710 | * window.
|
2711 | */
|
2712 | isFullScreenable(): boolean;
|
2713 | /**
|
2714 | * Whether the window will be hidden when the user toggles into mission control.
|
2715 | *
|
2716 | * @platform darwin
|
2717 | */
|
2718 | isHiddenInMissionControl(): boolean;
|
2719 | /**
|
2720 | * Whether the window is in kiosk mode.
|
2721 | */
|
2722 | isKiosk(): boolean;
|
2723 | /**
|
2724 | * Whether the window can be manually maximized by user.
|
2725 | *
|
2726 | * On Linux always returns `true`.
|
2727 | *
|
2728 | * @platform darwin,win32
|
2729 | */
|
2730 | isMaximizable(): boolean;
|
2731 | /**
|
2732 | * Whether the window is maximized.
|
2733 | */
|
2734 | isMaximized(): boolean;
|
2735 | /**
|
2736 | * Whether menu bar automatically hides itself.
|
2737 | *
|
2738 | * @platform win32,linux
|
2739 | */
|
2740 | isMenuBarAutoHide(): boolean;
|
2741 | /**
|
2742 | * Whether the menu bar is visible.
|
2743 | *
|
2744 | * @platform win32,linux
|
2745 | */
|
2746 | isMenuBarVisible(): boolean;
|
2747 | /**
|
2748 | * Whether the window can be manually minimized by the user.
|
2749 | *
|
2750 | * On Linux always returns `true`.
|
2751 | *
|
2752 | * @platform darwin,win32
|
2753 | */
|
2754 | isMinimizable(): boolean;
|
2755 | /**
|
2756 | * Whether the window is minimized.
|
2757 | */
|
2758 | isMinimized(): boolean;
|
2759 | /**
|
2760 | * Whether current window is a modal window.
|
2761 | */
|
2762 | isModal(): boolean;
|
2763 | /**
|
2764 | * Whether the window can be moved by user.
|
2765 | *
|
2766 | * On Linux always returns `true`.
|
2767 | *
|
2768 | * @platform darwin,win32
|
2769 | */
|
2770 | isMovable(): boolean;
|
2771 | /**
|
2772 | * Whether the window is in normal state (not maximized, not minimized, not in
|
2773 | * fullscreen mode).
|
2774 | */
|
2775 | isNormal(): boolean;
|
2776 | /**
|
2777 | * Whether the window can be manually resized by the user.
|
2778 | */
|
2779 | isResizable(): boolean;
|
2780 | /**
|
2781 | * Whether the window is in simple (pre-Lion) fullscreen mode.
|
2782 | *
|
2783 | * @platform darwin
|
2784 | */
|
2785 | isSimpleFullScreen(): boolean;
|
2786 | /**
|
2787 | * Whether the window is in Windows 10 tablet mode.
|
2788 | *
|
2789 | * Since Windows 10 users can use their PC as tablet, under this mode apps can
|
2790 | * choose to optimize their UI for tablets, such as enlarging the titlebar and
|
2791 | * hiding titlebar buttons.
|
2792 | *
|
2793 | * This API returns whether the window is in tablet mode, and the `resize` event
|
2794 | * can be be used to listen to changes to tablet mode.
|
2795 | *
|
2796 | * @platform win32
|
2797 | */
|
2798 | isTabletMode(): boolean;
|
2799 | /**
|
2800 | * Whether the window is visible to the user in the foreground of the app.
|
2801 | */
|
2802 | isVisible(): boolean;
|
2803 | /**
|
2804 | * Whether the window is visible on all workspaces.
|
2805 | *
|
2806 | * **Note:** This API always returns false on Windows.
|
2807 | *
|
2808 | * @platform darwin,linux
|
2809 | */
|
2810 | isVisibleOnAllWorkspaces(): boolean;
|
2811 | /**
|
2812 | * `true` or `false` depending on whether the message is hooked.
|
2813 | *
|
2814 | * @platform win32
|
2815 | */
|
2816 | isWindowMessageHooked(message: number): boolean;
|
2817 | /**
|
2818 | * Maximizes the window. This will also show (but not focus) the window if it isn't
|
2819 | * being displayed already.
|
2820 | */
|
2821 | maximize(): void;
|
2822 | /**
|
2823 | * Merges all windows into one window with multiple tabs when native tabs are
|
2824 | * enabled and there is more than one open window.
|
2825 | *
|
2826 | * @platform darwin
|
2827 | */
|
2828 | mergeAllWindows(): void;
|
2829 | /**
|
2830 | * Minimizes the window. On some platforms the minimized window will be shown in
|
2831 | * the Dock.
|
2832 | */
|
2833 | minimize(): void;
|
2834 | /**
|
2835 | * Moves window above the source window in the sense of z-order. If the
|
2836 | * `mediaSourceId` is not of type window or if the window does not exist then this
|
2837 | * method throws an error.
|
2838 | */
|
2839 | moveAbove(mediaSourceId: string): void;
|
2840 | /**
|
2841 | * Moves the current tab into a new window if native tabs are enabled and there is
|
2842 | * more than one tab in the current window.
|
2843 | *
|
2844 | * @platform darwin
|
2845 | */
|
2846 | moveTabToNewWindow(): void;
|
2847 | /**
|
2848 | * Moves window to top(z-order) regardless of focus
|
2849 | */
|
2850 | moveTop(): void;
|
2851 | /**
|
2852 | * Uses Quick Look to preview a file at a given path.
|
2853 | *
|
2854 | * @platform darwin
|
2855 | */
|
2856 | previewFile(path: string, displayName?: string): void;
|
2857 | /**
|
2858 | * Remove the window's menu bar.
|
2859 | *
|
2860 | * @platform linux,win32
|
2861 | */
|
2862 | removeMenu(): void;
|
2863 | /**
|
2864 | * Restores the window from minimized state to its previous state.
|
2865 | */
|
2866 | restore(): void;
|
2867 | /**
|
2868 | * Selects the next tab when native tabs are enabled and there are other tabs in
|
2869 | * the window.
|
2870 | *
|
2871 | * @platform darwin
|
2872 | */
|
2873 | selectNextTab(): void;
|
2874 | /**
|
2875 | * Selects the previous tab when native tabs are enabled and there are other tabs
|
2876 | * in the window.
|
2877 | *
|
2878 | * @platform darwin
|
2879 | */
|
2880 | selectPreviousTab(): void;
|
2881 | /**
|
2882 | * Sets whether the window should show always on top of other windows. After
|
2883 | * setting this, the window is still a normal window, not a toolbox window which
|
2884 | * can not be focused on.
|
2885 | */
|
2886 | setAlwaysOnTop(flag: boolean, level?: 'normal' | 'floating' | 'torn-off-menu' | 'modal-panel' | 'main-menu' | 'status' | 'pop-up-menu' | 'screen-saver' | 'dock', relativeLevel?: number): void;
|
2887 | /**
|
2888 | * Sets the properties for the window's taskbar button.
|
2889 | *
|
2890 | * **Note:** `relaunchCommand` and `relaunchDisplayName` must always be set
|
2891 | * together. If one of those properties is not set, then neither will be used.
|
2892 | *
|
2893 | * @platform win32
|
2894 | */
|
2895 | setAppDetails(options: AppDetailsOptions): void;
|
2896 | /**
|
2897 | * This will make a window maintain an aspect ratio. The extra size allows a
|
2898 | * developer to have space, specified in pixels, not included within the aspect
|
2899 | * ratio calculations. This API already takes into account the difference between a
|
2900 | * window's size and its content size.
|
2901 | *
|
2902 | * Consider a normal window with an HD video player and associated controls.
|
2903 | * Perhaps there are 15 pixels of controls on the left edge, 25 pixels of controls
|
2904 | * on the right edge and 50 pixels of controls below the player. In order to
|
2905 | * maintain a 16:9 aspect ratio (standard aspect ratio for HD @1920x1080) within
|
2906 | * the player itself we would call this function with arguments of 16/9 and {
|
2907 | * width: 40, height: 50 }. The second argument doesn't care where the extra width
|
2908 | * and height are within the content view--only that they exist. Sum any extra
|
2909 | * width and height areas you have within the overall content view.
|
2910 | *
|
2911 | * The aspect ratio is not respected when window is resized programmatically with
|
2912 | * APIs like `win.setSize`.
|
2913 | *
|
2914 | * To reset an aspect ratio, pass 0 as the `aspectRatio` value:
|
2915 | * `win.setAspectRatio(0)`.
|
2916 | */
|
2917 | setAspectRatio(aspectRatio: number, extraSize?: Size): void;
|
2918 | /**
|
2919 | * Controls whether to hide cursor when typing.
|
2920 | *
|
2921 | * @platform darwin
|
2922 | */
|
2923 | setAutoHideCursor(autoHide: boolean): void;
|
2924 | /**
|
2925 | * Sets whether the window menu bar should hide itself automatically. Once set the
|
2926 | * menu bar will only show when users press the single `Alt` key.
|
2927 | *
|
2928 | * If the menu bar is already visible, calling `setAutoHideMenuBar(true)` won't
|
2929 | * hide it immediately.
|
2930 | *
|
2931 | * @platform win32,linux
|
2932 | */
|
2933 | setAutoHideMenuBar(hide: boolean): void;
|
2934 | /**
|
2935 | * Examples of valid `backgroundColor` values:
|
2936 | *
|
2937 | * * Hex
|
2938 | * * #fff (shorthand RGB)
|
2939 | * * #ffff (shorthand ARGB)
|
2940 | * * #ffffff (RGB)
|
2941 | * * #ffffffff (ARGB)
|
2942 | * * RGB
|
2943 | * * `rgb\(([\d]+),\s*([\d]+),\s*([\d]+)\)`
|
2944 | * * e.g. rgb(255, 255, 255)
|
2945 | * * RGBA
|
2946 | * * `rgba\(([\d]+),\s*([\d]+),\s*([\d]+),\s*([\d.]+)\)`
|
2947 | * * e.g. rgba(255, 255, 255, 1.0)
|
2948 | * * HSL
|
2949 | * * `hsl\((-?[\d.]+),\s*([\d.]+)%,\s*([\d.]+)%\)`
|
2950 | * * e.g. hsl(200, 20%, 50%)
|
2951 | * * HSLA
|
2952 | * * `hsla\((-?[\d.]+),\s*([\d.]+)%,\s*([\d.]+)%,\s*([\d.]+)\)`
|
2953 | * * e.g. hsla(200, 20%, 50%, 0.5)
|
2954 | * * Color name
|
2955 | * * Options are listed in SkParseColor.cpp
|
2956 | * * Similar to CSS Color Module Level 3 keywords, but case-sensitive.
|
2957 | * * e.g. `blueviolet` or `red`
|
2958 | *
|
2959 | * Sets the background color of the window. See Setting `backgroundColor`.
|
2960 | */
|
2961 | setBackgroundColor(backgroundColor: string): void;
|
2962 | /**
|
2963 | * This method sets the browser window's system-drawn background material,
|
2964 | * including behind the non-client area.
|
2965 | *
|
2966 | * See the Windows documentation for more details.
|
2967 | *
|
2968 | * **Note:** This method is only supported on Windows 11 22H2 and up.
|
2969 | *
|
2970 | * @platform win32
|
2971 | */
|
2972 | setBackgroundMaterial(material: 'auto' | 'none' | 'mica' | 'acrylic' | 'tabbed'): void;
|
2973 | /**
|
2974 | * Resizes and moves the window to the supplied bounds. Any properties that are not
|
2975 | * supplied will default to their current values.
|
2976 | *
|
2977 | * **Note:** On macOS, the y-coordinate value cannot be smaller than the Tray
|
2978 | * height. The tray height has changed over time and depends on the operating
|
2979 | * system, but is between 20-40px. Passing a value lower than the tray height will
|
2980 | * result in a window that is flush to the tray.
|
2981 | */
|
2982 | setBounds(bounds: Partial<Rectangle>, animate?: boolean): void;
|
2983 | /**
|
2984 | * Sets whether the window can be manually closed by user. On Linux does nothing.
|
2985 | *
|
2986 | * @platform darwin,win32
|
2987 | */
|
2988 | setClosable(closable: boolean): void;
|
2989 | /**
|
2990 | * Resizes and moves the window's client area (e.g. the web page) to the supplied
|
2991 | * bounds.
|
2992 | */
|
2993 | setContentBounds(bounds: Rectangle, animate?: boolean): void;
|
2994 | /**
|
2995 | * Prevents the window contents from being captured by other apps.
|
2996 | *
|
2997 | * On macOS it sets the NSWindow's sharingType to NSWindowSharingNone. On Windows
|
2998 | * it calls SetWindowDisplayAffinity with `WDA_EXCLUDEFROMCAPTURE`. For Windows 10
|
2999 | * version 2004 and up the window will be removed from capture entirely, older
|
3000 | * Windows versions behave as if `WDA_MONITOR` is applied capturing a black window.
|
3001 | *
|
3002 | * @platform darwin,win32
|
3003 | */
|
3004 | setContentProtection(enable: boolean): void;
|
3005 | /**
|
3006 | * Resizes the window's client area (e.g. the web page) to `width` and `height`.
|
3007 | */
|
3008 | setContentSize(width: number, height: number, animate?: boolean): void;
|
3009 | /**
|
3010 | * Sets the content view of the window.
|
3011 | */
|
3012 | setContentView(view: View): void;
|
3013 | /**
|
3014 | * Specifies whether the window’s document has been edited, and the icon in title
|
3015 | * bar will become gray when set to `true`.
|
3016 | *
|
3017 | * @platform darwin
|
3018 | */
|
3019 | setDocumentEdited(edited: boolean): void;
|
3020 | /**
|
3021 | * Disable or enable the window.
|
3022 | */
|
3023 | setEnabled(enable: boolean): void;
|
3024 | /**
|
3025 | * Changes whether the window can be focused.
|
3026 | *
|
3027 | * On macOS it does not remove the focus from the window.
|
3028 | *
|
3029 | * @platform darwin,win32
|
3030 | */
|
3031 | setFocusable(focusable: boolean): void;
|
3032 | /**
|
3033 | * Sets whether the window should be in fullscreen mode.
|
3034 | *
|
3035 | * **Note:** On macOS, fullscreen transitions take place asynchronously. If further
|
3036 | * actions depend on the fullscreen state, use the 'enter-full-screen' or
|
3037 | * 'leave-full-screen' events.
|
3038 | */
|
3039 | setFullScreen(flag: boolean): void;
|
3040 | /**
|
3041 | * Sets whether the maximize/zoom window button toggles fullscreen mode or
|
3042 | * maximizes the window.
|
3043 | */
|
3044 | setFullScreenable(fullscreenable: boolean): void;
|
3045 | /**
|
3046 | * Sets whether the window should have a shadow.
|
3047 | */
|
3048 | setHasShadow(hasShadow: boolean): void;
|
3049 | /**
|
3050 | * Sets whether the window will be hidden when the user toggles into mission
|
3051 | * control.
|
3052 | *
|
3053 | * @platform darwin
|
3054 | */
|
3055 | setHiddenInMissionControl(hidden: boolean): void;
|
3056 | /**
|
3057 | * Changes window icon.
|
3058 | *
|
3059 | * @platform win32,linux
|
3060 | */
|
3061 | setIcon(icon: (NativeImage) | (string)): void;
|
3062 | /**
|
3063 | * Makes the window ignore all mouse events.
|
3064 | *
|
3065 | * All mouse events happened in this window will be passed to the window below this
|
3066 | * window, but if this window has focus, it will still receive keyboard events.
|
3067 | */
|
3068 | setIgnoreMouseEvents(ignore: boolean, options?: IgnoreMouseEventsOptions): void;
|
3069 | /**
|
3070 | * Enters or leaves kiosk mode.
|
3071 | */
|
3072 | setKiosk(flag: boolean): void;
|
3073 | /**
|
3074 | * Sets whether the window can be manually maximized by user. On Linux does
|
3075 | * nothing.
|
3076 | *
|
3077 | * @platform darwin,win32
|
3078 | */
|
3079 | setMaximizable(maximizable: boolean): void;
|
3080 | /**
|
3081 | * Sets the maximum size of window to `width` and `height`.
|
3082 | */
|
3083 | setMaximumSize(width: number, height: number): void;
|
3084 | /**
|
3085 | * Sets the `menu` as the window's menu bar.
|
3086 | *
|
3087 | * @platform linux,win32
|
3088 | */
|
3089 | setMenu(menu: (Menu) | (null)): void;
|
3090 | /**
|
3091 | * Sets whether the menu bar should be visible. If the menu bar is auto-hide, users
|
3092 | * can still bring up the menu bar by pressing the single `Alt` key.
|
3093 | *
|
3094 | * @platform win32,linux
|
3095 | */
|
3096 | setMenuBarVisibility(visible: boolean): void;
|
3097 | /**
|
3098 | * Sets whether the window can be manually minimized by user. On Linux does
|
3099 | * nothing.
|
3100 | *
|
3101 | * @platform darwin,win32
|
3102 | */
|
3103 | setMinimizable(minimizable: boolean): void;
|
3104 | /**
|
3105 | * Sets the minimum size of window to `width` and `height`.
|
3106 | */
|
3107 | setMinimumSize(width: number, height: number): void;
|
3108 | /**
|
3109 | * Sets whether the window can be moved by user. On Linux does nothing.
|
3110 | *
|
3111 | * @platform darwin,win32
|
3112 | */
|
3113 | setMovable(movable: boolean): void;
|
3114 | /**
|
3115 | * Sets the opacity of the window. On Linux, does nothing. Out of bound number
|
3116 | * values are clamped to the [0, 1] range.
|
3117 | *
|
3118 | * @platform win32,darwin
|
3119 | */
|
3120 | setOpacity(opacity: number): void;
|
3121 | /**
|
3122 | * Sets a 16 x 16 pixel overlay onto the current taskbar icon, usually used to
|
3123 | * convey some sort of application status or to passively notify the user.
|
3124 | *
|
3125 | * @platform win32
|
3126 | */
|
3127 | setOverlayIcon(overlay: (NativeImage) | (null), description: string): void;
|
3128 | /**
|
3129 | * Sets `parent` as current window's parent window, passing `null` will turn
|
3130 | * current window into a top-level window.
|
3131 | */
|
3132 | setParentWindow(parent: (BaseWindow) | (null)): void;
|
3133 | /**
|
3134 | * Moves window to `x` and `y`.
|
3135 | */
|
3136 | setPosition(x: number, y: number, animate?: boolean): void;
|
3137 | /**
|
3138 | * Sets progress value in progress bar. Valid range is [0, 1.0].
|
3139 | *
|
3140 | * Remove progress bar when progress < 0; Change to indeterminate mode when
|
3141 | * progress > 1.
|
3142 | *
|
3143 | * On Linux platform, only supports Unity desktop environment, you need to specify
|
3144 | * the `*.desktop` file name to `desktopName` field in `package.json`. By default,
|
3145 | * it will assume `{app.name}.desktop`.
|
3146 | *
|
3147 | * On Windows, a mode can be passed. Accepted values are `none`, `normal`,
|
3148 | * `indeterminate`, `error`, and `paused`. If you call `setProgressBar` without a
|
3149 | * mode set (but with a value within the valid range), `normal` will be assumed.
|
3150 | */
|
3151 | setProgressBar(progress: number, options?: ProgressBarOptions): void;
|
3152 | /**
|
3153 | * Sets the pathname of the file the window represents, and the icon of the file
|
3154 | * will show in window's title bar.
|
3155 | *
|
3156 | * @platform darwin
|
3157 | */
|
3158 | setRepresentedFilename(filename: string): void;
|
3159 | /**
|
3160 | * Sets whether the window can be manually resized by the user.
|
3161 | */
|
3162 | setResizable(resizable: boolean): void;
|
3163 | /**
|
3164 | * Setting a window shape determines the area within the window where the system
|
3165 | * permits drawing and user interaction. Outside of the given region, no pixels
|
3166 | * will be drawn and no mouse events will be registered. Mouse events outside of
|
3167 | * the region will not be received by that window, but will fall through to
|
3168 | * whatever is behind the window.
|
3169 | *
|
3170 | * @experimental
|
3171 | * @platform win32,linux
|
3172 | */
|
3173 | setShape(rects: Rectangle[]): void;
|
3174 | /**
|
3175 | * Changes the attachment point for sheets on macOS. By default, sheets are
|
3176 | * attached just below the window frame, but you may want to display them beneath a
|
3177 | * HTML-rendered toolbar. For example:
|
3178 | *
|
3179 | * @platform darwin
|
3180 | */
|
3181 | setSheetOffset(offsetY: number, offsetX?: number): void;
|
3182 | /**
|
3183 | * Enters or leaves simple fullscreen mode.
|
3184 | *
|
3185 | * Simple fullscreen mode emulates the native fullscreen behavior found in versions
|
3186 | * of macOS prior to Lion (10.7).
|
3187 | *
|
3188 | * @platform darwin
|
3189 | */
|
3190 | setSimpleFullScreen(flag: boolean): void;
|
3191 | /**
|
3192 | * Resizes the window to `width` and `height`. If `width` or `height` are below any
|
3193 | * set minimum size constraints the window will snap to its minimum size.
|
3194 | */
|
3195 | setSize(width: number, height: number, animate?: boolean): void;
|
3196 | /**
|
3197 | * Makes the window not show in the taskbar.
|
3198 | *
|
3199 | * @platform darwin,win32
|
3200 | */
|
3201 | setSkipTaskbar(skip: boolean): void;
|
3202 | /**
|
3203 | * Whether the buttons were added successfully
|
3204 | *
|
3205 | * Add a thumbnail toolbar with a specified set of buttons to the thumbnail image
|
3206 | * of a window in a taskbar button layout. Returns a `boolean` object indicates
|
3207 | * whether the thumbnail has been added successfully.
|
3208 | *
|
3209 | * The number of buttons in thumbnail toolbar should be no greater than 7 due to
|
3210 | * the limited room. Once you setup the thumbnail toolbar, the toolbar cannot be
|
3211 | * removed due to the platform's limitation. But you can call the API with an empty
|
3212 | * array to clean the buttons.
|
3213 | *
|
3214 | * The `buttons` is an array of `Button` objects:
|
3215 | *
|
3216 | * * `Button` Object
|
3217 | * * `icon` NativeImage - The icon showing in thumbnail toolbar.
|
3218 | * * `click` Function
|
3219 | * * `tooltip` string (optional) - The text of the button's tooltip.
|
3220 | * * `flags` string[] (optional) - Control specific states and behaviors of the
|
3221 | * button. By default, it is `['enabled']`.
|
3222 | *
|
3223 | * The `flags` is an array that can include following `string`s:
|
3224 | *
|
3225 | * * `enabled` - The button is active and available to the user.
|
3226 | * * `disabled` - The button is disabled. It is present, but has a visual state
|
3227 | * indicating it will not respond to user action.
|
3228 | * * `dismissonclick` - When the button is clicked, the thumbnail window closes
|
3229 | * immediately.
|
3230 | * * `nobackground` - Do not draw a button border, use only the image.
|
3231 | * * `hidden` - The button is not shown to the user.
|
3232 | * * `noninteractive` - The button is enabled but not interactive; no pressed
|
3233 | * button state is drawn. This value is intended for instances where the button is
|
3234 | * used in a notification.
|
3235 | *
|
3236 | * @platform win32
|
3237 | */
|
3238 | setThumbarButtons(buttons: ThumbarButton[]): boolean;
|
3239 | /**
|
3240 | * Sets the region of the window to show as the thumbnail image displayed when
|
3241 | * hovering over the window in the taskbar. You can reset the thumbnail to be the
|
3242 | * entire window by specifying an empty region: `{ x: 0, y: 0, width: 0, height: 0
|
3243 | * }`.
|
3244 | *
|
3245 | * @platform win32
|
3246 | */
|
3247 | setThumbnailClip(region: Rectangle): void;
|
3248 | /**
|
3249 | * Sets the toolTip that is displayed when hovering over the window thumbnail in
|
3250 | * the taskbar.
|
3251 | *
|
3252 | * @platform win32
|
3253 | */
|
3254 | setThumbnailToolTip(toolTip: string): void;
|
3255 | /**
|
3256 | * Changes the title of native window to `title`.
|
3257 | */
|
3258 | setTitle(title: string): void;
|
3259 | /**
|
3260 | * On a Window with Window Controls Overlay already enabled, this method updates
|
3261 | * the style of the title bar overlay.
|
3262 | *
|
3263 | * On Linux, the `symbolColor` is automatically calculated to have minimum
|
3264 | * accessible contrast to the `color` if not explicitly set.
|
3265 | *
|
3266 | * @platform win32,linux
|
3267 | */
|
3268 | setTitleBarOverlay(options: TitleBarOverlayOptions): void;
|
3269 | /**
|
3270 | * Sets the touchBar layout for the current window. Specifying `null` or
|
3271 | * `undefined` clears the touch bar. This method only has an effect if the machine
|
3272 | * has a touch bar.
|
3273 | *
|
3274 | * **Note:** The TouchBar API is currently experimental and may change or be
|
3275 | * removed in future Electron releases.
|
3276 | *
|
3277 | * @platform darwin
|
3278 | */
|
3279 | setTouchBar(touchBar: (TouchBar) | (null)): void;
|
3280 | /**
|
3281 | * Adds a vibrancy effect to the window. Passing `null` or an empty string will
|
3282 | * remove the vibrancy effect on the window.
|
3283 | *
|
3284 | * @platform darwin
|
3285 | */
|
3286 | setVibrancy(type: (('titlebar' | 'selection' | 'menu' | 'popover' | 'sidebar' | 'header' | 'sheet' | 'window' | 'hud' | 'fullscreen-ui' | 'tooltip' | 'content' | 'under-window' | 'under-page')) | (null)): void;
|
3287 | /**
|
3288 | * Sets whether the window should be visible on all workspaces.
|
3289 | *
|
3290 | * **Note:** This API does nothing on Windows.
|
3291 | *
|
3292 | * @platform darwin,linux
|
3293 | */
|
3294 | setVisibleOnAllWorkspaces(visible: boolean, options?: VisibleOnAllWorkspacesOptions): void;
|
3295 | /**
|
3296 | * Set a custom position for the traffic light buttons in frameless window. Passing
|
3297 | * `null` will reset the position to default.
|
3298 | *
|
3299 | * @platform darwin
|
3300 | */
|
3301 | setWindowButtonPosition(position: (Point) | (null)): void;
|
3302 | /**
|
3303 | * Sets whether the window traffic light buttons should be visible.
|
3304 | *
|
3305 | * @platform darwin
|
3306 | */
|
3307 | setWindowButtonVisibility(visible: boolean): void;
|
3308 | /**
|
3309 | * Shows and gives focus to the window.
|
3310 | */
|
3311 | show(): void;
|
3312 | /**
|
3313 | * Shows or hides the tab overview when native tabs are enabled.
|
3314 | *
|
3315 | * @platform darwin
|
3316 | */
|
3317 | showAllTabs(): void;
|
3318 | /**
|
3319 | * Shows the window but doesn't focus on it.
|
3320 | */
|
3321 | showInactive(): void;
|
3322 | /**
|
3323 | * Toggles the visibility of the tab bar if native tabs are enabled and there is
|
3324 | * only one tab in the current window.
|
3325 | *
|
3326 | * @platform darwin
|
3327 | */
|
3328 | toggleTabBar(): void;
|
3329 | /**
|
3330 | * Unhooks all of the window messages.
|
3331 | *
|
3332 | * @platform win32
|
3333 | */
|
3334 | unhookAllWindowMessages(): void;
|
3335 | /**
|
3336 | * Unhook the window message.
|
3337 | *
|
3338 | * @platform win32
|
3339 | */
|
3340 | unhookWindowMessage(message: number): void;
|
3341 | /**
|
3342 | * Unmaximizes the window.
|
3343 | */
|
3344 | unmaximize(): void;
|
3345 | /**
|
3346 | * A `string` property that defines an alternative title provided only to
|
3347 | * accessibility tools such as screen readers. This string is not directly visible
|
3348 | * to users.
|
3349 | */
|
3350 | accessibleTitle: string;
|
3351 | /**
|
3352 | * A `boolean` property that determines whether the window menu bar should hide
|
3353 | * itself automatically. Once set, the menu bar will only show when users press the
|
3354 | * single `Alt` key.
|
3355 | *
|
3356 | * If the menu bar is already visible, setting this property to `true` won't hide
|
3357 | * it immediately.
|
3358 | */
|
3359 | autoHideMenuBar: boolean;
|
3360 | /**
|
3361 | * A `boolean` property that determines whether the window can be manually closed
|
3362 | * by user.
|
3363 | *
|
3364 | * On Linux the setter is a no-op, although the getter returns `true`.
|
3365 | *
|
3366 | * @platform darwin,win32
|
3367 | */
|
3368 | closable: boolean;
|
3369 | /**
|
3370 | * A `View` property for the content view of the window.
|
3371 | */
|
3372 | contentView: View;
|
3373 | /**
|
3374 | * A `boolean` property that specifies whether the window’s document has been
|
3375 | * edited.
|
3376 | *
|
3377 | * The icon in title bar will become gray when set to `true`.
|
3378 | *
|
3379 | * @platform darwin
|
3380 | */
|
3381 | documentEdited: boolean;
|
3382 | /**
|
3383 | * A `boolean` property that determines whether the window is excluded from the
|
3384 | * application’s Windows menu. `false` by default.
|
3385 | *
|
3386 | * @platform darwin
|
3387 | */
|
3388 | excludedFromShownWindowsMenu: boolean;
|
3389 | /**
|
3390 | * A `boolean` property that determines whether the window is focusable.
|
3391 | *
|
3392 | * @platform win32,darwin
|
3393 | */
|
3394 | focusable: boolean;
|
3395 | /**
|
3396 | * A `boolean` property that determines whether the window is in fullscreen mode.
|
3397 | */
|
3398 | fullScreen: boolean;
|
3399 | /**
|
3400 | * A `boolean` property that determines whether the maximize/zoom window button
|
3401 | * toggles fullscreen mode or maximizes the window.
|
3402 | */
|
3403 | fullScreenable: boolean;
|
3404 | /**
|
3405 | * A `Integer` property representing the unique ID of the window. Each ID is unique
|
3406 | * among all `BaseWindow` instances of the entire Electron application.
|
3407 | *
|
3408 | */
|
3409 | readonly id: number;
|
3410 | /**
|
3411 | * A `boolean` property that determines whether the window is in kiosk mode.
|
3412 | */
|
3413 | kiosk: boolean;
|
3414 | /**
|
3415 | * A `boolean` property that determines whether the window can be manually
|
3416 | * maximized by user.
|
3417 | *
|
3418 | * On Linux the setter is a no-op, although the getter returns `true`.
|
3419 | *
|
3420 | * @platform darwin,win32
|
3421 | */
|
3422 | maximizable: boolean;
|
3423 | /**
|
3424 | * A `boolean` property that determines whether the menu bar should be visible.
|
3425 | *
|
3426 | * **Note:** If the menu bar is auto-hide, users can still bring up the menu bar by
|
3427 | * pressing the single `Alt` key.
|
3428 | *
|
3429 | * @platform win32,linux
|
3430 | */
|
3431 | menuBarVisible: boolean;
|
3432 | /**
|
3433 | * A `boolean` property that determines whether the window can be manually
|
3434 | * minimized by user.
|
3435 | *
|
3436 | * On Linux the setter is a no-op, although the getter returns `true`.
|
3437 | *
|
3438 | * @platform darwin,win32
|
3439 | */
|
3440 | minimizable: boolean;
|
3441 | /**
|
3442 | * A `boolean` property that determines Whether the window can be moved by user.
|
3443 | *
|
3444 | * On Linux the setter is a no-op, although the getter returns `true`.
|
3445 | *
|
3446 | * @platform darwin,win32
|
3447 | */
|
3448 | movable: boolean;
|
3449 | /**
|
3450 | * A `string` property that determines the pathname of the file the window
|
3451 | * represents, and the icon of the file will show in window's title bar.
|
3452 | *
|
3453 | * @platform darwin
|
3454 | */
|
3455 | representedFilename: string;
|
3456 | /**
|
3457 | * A `boolean` property that determines whether the window can be manually resized
|
3458 | * by user.
|
3459 | */
|
3460 | resizable: boolean;
|
3461 | /**
|
3462 | * A `boolean` property that determines whether the window has a shadow.
|
3463 | */
|
3464 | shadow: boolean;
|
3465 | /**
|
3466 | * A `boolean` property that determines whether the window is in simple (pre-Lion)
|
3467 | * fullscreen mode.
|
3468 | */
|
3469 | simpleFullScreen: boolean;
|
3470 | /**
|
3471 | * A `string` (optional) property that is equal to the `tabbingIdentifier` passed
|
3472 | * to the `BrowserWindow` constructor or `undefined` if none was set.
|
3473 | *
|
3474 | * @platform darwin
|
3475 | */
|
3476 | readonly tabbingIdentifier?: string;
|
3477 | /**
|
3478 | * A `string` property that determines the title of the native window.
|
3479 | *
|
3480 | * **Note:** The title of the web page can be different from the title of the
|
3481 | * native window.
|
3482 | */
|
3483 | title: string;
|
3484 | /**
|
3485 | * A `boolean` property that determines whether the window is visible on all
|
3486 | * workspaces.
|
3487 | *
|
3488 | * **Note:** Always returns false on Windows.
|
3489 | *
|
3490 | * @platform darwin,linux
|
3491 | */
|
3492 | visibleOnAllWorkspaces: boolean;
|
3493 | }
|
3494 |
|
3495 | interface BaseWindowConstructorOptions {
|
3496 |
|
3497 | // Docs: https://electronjs.org/docs/api/structures/base-window-options
|
3498 |
|
3499 | /**
|
3500 | * Whether clicking an inactive window will also click through to the web contents.
|
3501 | * Default is `false` on macOS. This option is not configurable on other platforms.
|
3502 | *
|
3503 | * @platform darwin
|
3504 | */
|
3505 | acceptFirstMouse?: boolean;
|
3506 | /**
|
3507 | * Whether the window should always stay on top of other windows. Default is
|
3508 | * `false`.
|
3509 | */
|
3510 | alwaysOnTop?: boolean;
|
3511 | /**
|
3512 | * Auto hide the menu bar unless the `Alt` key is pressed. Default is `false`.
|
3513 | */
|
3514 | autoHideMenuBar?: boolean;
|
3515 | /**
|
3516 | * The window's background color in Hex, RGB, RGBA, HSL, HSLA or named CSS color
|
3517 | * format. Alpha in #AARRGGBB format is supported if `transparent` is set to
|
3518 | * `true`. Default is `#FFF` (white). See win.setBackgroundColor for more
|
3519 | * information.
|
3520 | */
|
3521 | backgroundColor?: string;
|
3522 | /**
|
3523 | * Set the window's system-drawn background material, including behind the
|
3524 | * non-client area. Can be `auto`, `none`, `mica`, `acrylic` or `tabbed`. See
|
3525 | * win.setBackgroundMaterial for more information.
|
3526 | *
|
3527 | * @platform win32
|
3528 | */
|
3529 | backgroundMaterial?: ('auto' | 'none' | 'mica' | 'acrylic' | 'tabbed');
|
3530 | /**
|
3531 | * Show window in the center of the screen. Default is `false`.
|
3532 | */
|
3533 | center?: boolean;
|
3534 | /**
|
3535 | * Whether window is closable. This is not implemented on Linux. Default is `true`.
|
3536 | *
|
3537 | * @platform darwin,win32
|
3538 | */
|
3539 | closable?: boolean;
|
3540 | /**
|
3541 | * Forces using dark theme for the window, only works on some GTK+3 desktop
|
3542 | * environments. Default is `false`.
|
3543 | */
|
3544 | darkTheme?: boolean;
|
3545 | /**
|
3546 | * Whether to hide cursor when typing. Default is `false`.
|
3547 | */
|
3548 | disableAutoHideCursor?: boolean;
|
3549 | /**
|
3550 | * Enable the window to be resized larger than screen. Only relevant for macOS, as
|
3551 | * other OSes allow larger-than-screen windows by default. Default is `false`.
|
3552 | *
|
3553 | * @platform darwin
|
3554 | */
|
3555 | enableLargerThanScreen?: boolean;
|
3556 | /**
|
3557 | * Whether the window can be focused. Default is `true`. On Windows setting
|
3558 | * `focusable: false` also implies setting `skipTaskbar: true`. On Linux setting
|
3559 | * `focusable: false` makes the window stop interacting with wm, so the window will
|
3560 | * always stay on top in all workspaces.
|
3561 | */
|
3562 | focusable?: boolean;
|
3563 | /**
|
3564 | * Specify `false` to create a frameless window. Default is `true`.
|
3565 | */
|
3566 | frame?: boolean;
|
3567 | /**
|
3568 | * Whether the window should show in fullscreen. When explicitly set to `false` the
|
3569 | * fullscreen button will be hidden or disabled on macOS. Default is `false`.
|
3570 | */
|
3571 | fullscreen?: boolean;
|
3572 | /**
|
3573 | * Whether the window can be put into fullscreen mode. On macOS, also whether the
|
3574 | * maximize/zoom button should toggle full screen mode or maximize window. Default
|
3575 | * is `true`.
|
3576 | */
|
3577 | fullscreenable?: boolean;
|
3578 | /**
|
3579 | * Whether window should have a shadow. Default is `true`.
|
3580 | */
|
3581 | hasShadow?: boolean;
|
3582 | /**
|
3583 | * Window's height in pixels. Default is `600`.
|
3584 | */
|
3585 | height?: number;
|
3586 | /**
|
3587 | * Whether window should be hidden when the user toggles into mission control.
|
3588 | *
|
3589 | * @platform darwin
|
3590 | */
|
3591 | hiddenInMissionControl?: boolean;
|
3592 | /**
|
3593 | * The window icon. On Windows it is recommended to use `ICO` icons to get best
|
3594 | * visual effects, you can also leave it undefined so the executable's icon will be
|
3595 | * used.
|
3596 | */
|
3597 | icon?: (NativeImage) | (string);
|
3598 | /**
|
3599 | * Whether the window is in kiosk mode. Default is `false`.
|
3600 | */
|
3601 | kiosk?: boolean;
|
3602 | /**
|
3603 | * Window's maximum height. Default is no limit.
|
3604 | */
|
3605 | maxHeight?: number;
|
3606 | /**
|
3607 | * Whether window is maximizable. This is not implemented on Linux. Default is
|
3608 | * `true`.
|
3609 | *
|
3610 | * @platform darwin,win32
|
3611 | */
|
3612 | maximizable?: boolean;
|
3613 | /**
|
3614 | * Window's maximum width. Default is no limit.
|
3615 | */
|
3616 | maxWidth?: number;
|
3617 | /**
|
3618 | * Window's minimum height. Default is `0`.
|
3619 | */
|
3620 | minHeight?: number;
|
3621 | /**
|
3622 | * Whether window is minimizable. This is not implemented on Linux. Default is
|
3623 | * `true`.
|
3624 | *
|
3625 | * @platform darwin,win32
|
3626 | */
|
3627 | minimizable?: boolean;
|
3628 | /**
|
3629 | * Window's minimum width. Default is `0`.
|
3630 | */
|
3631 | minWidth?: number;
|
3632 | /**
|
3633 | * Whether this is a modal window. This only works when the window is a child
|
3634 | * window. Default is `false`.
|
3635 | */
|
3636 | modal?: boolean;
|
3637 | /**
|
3638 | * Whether window is movable. This is not implemented on Linux. Default is `true`.
|
3639 | *
|
3640 | * @platform darwin,win32
|
3641 | */
|
3642 | movable?: boolean;
|
3643 | /**
|
3644 | * Set the initial opacity of the window, between 0.0 (fully transparent) and 1.0
|
3645 | * (fully opaque). This is only implemented on Windows and macOS.
|
3646 | *
|
3647 | * @platform darwin,win32
|
3648 | */
|
3649 | opacity?: number;
|
3650 | /**
|
3651 | * Specify parent window. Default is `null`.
|
3652 | */
|
3653 | parent?: BaseWindow;
|
3654 | /**
|
3655 | * Whether window is resizable. Default is `true`.
|
3656 | */
|
3657 | resizable?: boolean;
|
3658 | /**
|
3659 | * Whether frameless window should have rounded corners on macOS. Default is
|
3660 | * `true`. Setting this property to `false` will prevent the window from being
|
3661 | * fullscreenable.
|
3662 | *
|
3663 | * @platform darwin
|
3664 | */
|
3665 | roundedCorners?: boolean;
|
3666 | /**
|
3667 | * Whether window should be shown when created. Default is `true`.
|
3668 | */
|
3669 | show?: boolean;
|
3670 | /**
|
3671 | * Use pre-Lion fullscreen on macOS. Default is `false`.
|
3672 | *
|
3673 | * @platform darwin
|
3674 | */
|
3675 | simpleFullscreen?: boolean;
|
3676 | /**
|
3677 | * Whether to show the window in taskbar. Default is `false`.
|
3678 | *
|
3679 | * @platform darwin,win32
|
3680 | */
|
3681 | skipTaskbar?: boolean;
|
3682 | /**
|
3683 | * Tab group name, allows opening the window as a native tab. Windows with the same
|
3684 | * tabbing identifier will be grouped together. This also adds a native new tab
|
3685 | * button to your window's tab bar and allows your `app` and window to receive the
|
3686 | * `new-window-for-tab` event.
|
3687 | *
|
3688 | * @platform darwin
|
3689 | */
|
3690 | tabbingIdentifier?: string;
|
3691 | /**
|
3692 | * Use `WS_THICKFRAME` style for frameless windows on Windows, which adds standard
|
3693 | * window frame. Setting it to `false` will remove window shadow and window
|
3694 | * animations. Default is `true`.
|
3695 | */
|
3696 | thickFrame?: boolean;
|
3697 | /**
|
3698 | * Default window title. Default is `"Electron"`. If the HTML tag `<title>` is
|
3699 | * defined in the HTML file loaded by `loadURL()`, this property will be ignored.
|
3700 | */
|
3701 | title?: string;
|
3702 | /**
|
3703 | * When using a frameless window in conjunction with
|
3704 | * `win.setWindowButtonVisibility(true)` on macOS or using a `titleBarStyle` so
|
3705 | * that the standard window controls ("traffic lights" on macOS) are visible, this
|
3706 | * property enables the Window Controls Overlay JavaScript APIs and CSS Environment
|
3707 | * Variables. Specifying `true` will result in an overlay with default system
|
3708 | * colors. Default is `false`.
|
3709 | */
|
3710 | titleBarOverlay?: (TitleBarOverlay) | (boolean);
|
3711 | /**
|
3712 | * The style of window title bar. Default is `default`. Possible values are:
|
3713 | */
|
3714 | titleBarStyle?: ('default' | 'hidden' | 'hiddenInset' | 'customButtonsOnHover');
|
3715 | /**
|
3716 | * Set a custom position for the traffic light buttons in frameless windows.
|
3717 | *
|
3718 | * @platform darwin
|
3719 | */
|
3720 | trafficLightPosition?: Point;
|
3721 | /**
|
3722 | * Makes the window transparent. Default is `false`. On Windows, does not work
|
3723 | * unless the window is frameless.
|
3724 | */
|
3725 | transparent?: boolean;
|
3726 | /**
|
3727 | * The type of window, default is normal window. See more about this below.
|
3728 | */
|
3729 | type?: string;
|
3730 | /**
|
3731 | * The `width` and `height` would be used as web page's size, which means the
|
3732 | * actual window's size will include window frame's size and be slightly larger.
|
3733 | * Default is `false`.
|
3734 | */
|
3735 | useContentSize?: boolean;
|
3736 | /**
|
3737 | * Add a type of vibrancy effect to the window, only on macOS. Can be
|
3738 | * `appearance-based`, `titlebar`, `selection`, `menu`, `popover`, `sidebar`,
|
3739 | * `header`, `sheet`, `window`, `hud`, `fullscreen-ui`, `tooltip`, `content`,
|
3740 | * `under-window`, or `under-page`.
|
3741 | *
|
3742 | * @platform darwin
|
3743 | */
|
3744 | vibrancy?: ('appearance-based' | 'titlebar' | 'selection' | 'menu' | 'popover' | 'sidebar' | 'header' | 'sheet' | 'window' | 'hud' | 'fullscreen-ui' | 'tooltip' | 'content' | 'under-window' | 'under-page');
|
3745 | /**
|
3746 | * Specify how the material appearance should reflect window activity state on
|
3747 | * macOS. Must be used with the `vibrancy` property. Possible values are:
|
3748 | *
|
3749 | * @platform darwin
|
3750 | */
|
3751 | visualEffectState?: ('followWindow' | 'active' | 'inactive');
|
3752 | /**
|
3753 | * Window's width in pixels. Default is `800`.
|
3754 | */
|
3755 | width?: number;
|
3756 | /**
|
3757 | * (**required** if y is used) Window's left offset from screen. Default is to
|
3758 | * center the window.
|
3759 | */
|
3760 | x?: number;
|
3761 | /**
|
3762 | * (**required** if x is used) Window's top offset from screen. Default is to
|
3763 | * center the window.
|
3764 | */
|
3765 | y?: number;
|
3766 | /**
|
3767 | * Controls the behavior on macOS when option-clicking the green stoplight button
|
3768 | * on the toolbar or by clicking the Window > Zoom menu item. If `true`, the window
|
3769 | * will grow to the preferred width of the web page when zoomed, `false` will cause
|
3770 | * it to zoom to the width of the screen. This will also affect the behavior when
|
3771 | * calling `maximize()` directly. Default is `false`.
|
3772 | *
|
3773 | * @platform darwin
|
3774 | */
|
3775 | zoomToPageWidth?: boolean;
|
3776 | }
|
3777 |
|
3778 | interface BluetoothDevice {
|
3779 |
|
3780 | // Docs: https://electronjs.org/docs/api/structures/bluetooth-device
|
3781 |
|
3782 | deviceId: string;
|
3783 | deviceName: string;
|
3784 | }
|
3785 |
|
3786 | class BrowserView {
|
3787 |
|
3788 | // Docs: https://electronjs.org/docs/api/browser-view
|
3789 |
|
3790 | /**
|
3791 | * BrowserView
|
3792 | */
|
3793 | constructor(options?: BrowserViewConstructorOptions);
|
3794 | /**
|
3795 | * The `bounds` of this BrowserView instance as `Object`.
|
3796 | *
|
3797 | * @experimental
|
3798 | * @deprecated
|
3799 | */
|
3800 | getBounds(): Rectangle;
|
3801 | /**
|
3802 | * @experimental
|
3803 | * @deprecated
|
3804 | */
|
3805 | setAutoResize(options: AutoResizeOptions): void;
|
3806 | /**
|
3807 | * Examples of valid `color` values:
|
3808 | *
|
3809 | * * Hex
|
3810 | * * `#fff` (RGB)
|
3811 | * * `#ffff` (ARGB)
|
3812 | * * `#ffffff` (RRGGBB)
|
3813 | * * `#ffffffff` (AARRGGBB)
|
3814 | * * RGB
|
3815 | * * `rgb\(([\d]+),\s*([\d]+),\s*([\d]+)\)`
|
3816 | * * e.g. `rgb(255, 255, 255)`
|
3817 | * * RGBA
|
3818 | * * `rgba\(([\d]+),\s*([\d]+),\s*([\d]+),\s*([\d.]+)\)`
|
3819 | * * e.g. `rgba(255, 255, 255, 1.0)`
|
3820 | * * HSL
|
3821 | * * `hsl\((-?[\d.]+),\s*([\d.]+)%,\s*([\d.]+)%\)`
|
3822 | * * e.g. `hsl(200, 20%, 50%)`
|
3823 | * * HSLA
|
3824 | * * `hsla\((-?[\d.]+),\s*([\d.]+)%,\s*([\d.]+)%,\s*([\d.]+)\)`
|
3825 | * * e.g. `hsla(200, 20%, 50%, 0.5)`
|
3826 | * * Color name
|
3827 | * * Options are listed in SkParseColor.cpp
|
3828 | * * Similar to CSS Color Module Level 3 keywords, but case-sensitive.
|
3829 | * * e.g. `blueviolet` or `red`
|
3830 | *
|
3831 | * **Note:** Hex format with alpha takes `AARRGGBB` or `ARGB`, _not_ `RRGGBBAA` or
|
3832 | * `RGB`.
|
3833 | *
|
3834 | * @experimental
|
3835 | * @deprecated
|
3836 | */
|
3837 | setBackgroundColor(color: string): void;
|
3838 | /**
|
3839 | * Resizes and moves the view to the supplied bounds relative to the window.
|
3840 | *
|
3841 | * @experimental
|
3842 | * @deprecated
|
3843 | */
|
3844 | setBounds(bounds: Rectangle): void;
|
3845 | /**
|
3846 | * A `WebContents` object owned by this view.
|
3847 | *
|
3848 | * @experimental
|
3849 | * @deprecated
|
3850 | */
|
3851 | webContents: WebContents;
|
3852 | }
|
3853 |
|
3854 | class BrowserWindow extends BaseWindow {
|
3855 |
|
3856 | // Docs: https://electronjs.org/docs/api/browser-window
|
3857 |
|
3858 | /**
|
3859 | * Emitted when the window is set or unset to show always on top of other windows.
|
3860 | */
|
3861 | on(event: 'always-on-top-changed', listener: (event: Event,
|
3862 | isAlwaysOnTop: boolean) => void): this;
|
3863 | off(event: 'always-on-top-changed', listener: (event: Event,
|
3864 | isAlwaysOnTop: boolean) => void): this;
|
3865 | once(event: 'always-on-top-changed', listener: (event: Event,
|
3866 | isAlwaysOnTop: boolean) => void): this;
|
3867 | addListener(event: 'always-on-top-changed', listener: (event: Event,
|
3868 | isAlwaysOnTop: boolean) => void): this;
|
3869 | removeListener(event: 'always-on-top-changed', listener: (event: Event,
|
3870 | isAlwaysOnTop: boolean) => void): this;
|
3871 | /**
|
3872 | * Emitted when the window is set or unset to show always on top of other windows.
|
3873 | */
|
3874 | on(event: 'always-on-top-changed', listener: (event: Event,
|
3875 | isAlwaysOnTop: boolean) => void): this;
|
3876 | off(event: 'always-on-top-changed', listener: (event: Event,
|
3877 | isAlwaysOnTop: boolean) => void): this;
|
3878 | once(event: 'always-on-top-changed', listener: (event: Event,
|
3879 | isAlwaysOnTop: boolean) => void): this;
|
3880 | addListener(event: 'always-on-top-changed', listener: (event: Event,
|
3881 | isAlwaysOnTop: boolean) => void): this;
|
3882 | removeListener(event: 'always-on-top-changed', listener: (event: Event,
|
3883 | isAlwaysOnTop: boolean) => void): this;
|
3884 | /**
|
3885 | * Emitted when an App Command is invoked. These are typically related to keyboard
|
3886 | * media keys or browser commands, as well as the "Back" button built into some
|
3887 | * mice on Windows.
|
3888 | *
|
3889 | * Commands are lowercased, underscores are replaced with hyphens, and the
|
3890 | * `APPCOMMAND_` prefix is stripped off. e.g. `APPCOMMAND_BROWSER_BACKWARD` is
|
3891 | * emitted as `browser-backward`.
|
3892 | *
|
3893 | * The following app commands are explicitly supported on Linux:
|
3894 | *
|
3895 | * * `browser-backward`
|
3896 | * * `browser-forward`
|
3897 | *
|
3898 | * @platform win32,linux
|
3899 | */
|
3900 | on(event: 'app-command', listener: (event: Event,
|
3901 | command: string) => void): this;
|
3902 | /**
|
3903 | * @platform win32,linux
|
3904 | */
|
3905 | off(event: 'app-command', listener: (event: Event,
|
3906 | command: string) => void): this;
|
3907 | /**
|
3908 | * @platform win32,linux
|
3909 | */
|
3910 | once(event: 'app-command', listener: (event: Event,
|
3911 | command: string) => void): this;
|
3912 | /**
|
3913 | * @platform win32,linux
|
3914 | */
|
3915 | addListener(event: 'app-command', listener: (event: Event,
|
3916 | command: string) => void): this;
|
3917 | /**
|
3918 | * @platform win32,linux
|
3919 | */
|
3920 | removeListener(event: 'app-command', listener: (event: Event,
|
3921 | command: string) => void): this;
|
3922 | /**
|
3923 | * Emitted when an App Command is invoked. These are typically related to keyboard
|
3924 | * media keys or browser commands, as well as the "Back" button built into some
|
3925 | * mice on Windows.
|
3926 | *
|
3927 | * Commands are lowercased, underscores are replaced with hyphens, and the
|
3928 | * `APPCOMMAND_` prefix is stripped off. e.g. `APPCOMMAND_BROWSER_BACKWARD` is
|
3929 | * emitted as `browser-backward`.
|
3930 | *
|
3931 | * The following app commands are explicitly supported on Linux:
|
3932 | *
|
3933 | * * `browser-backward`
|
3934 | * * `browser-forward`
|
3935 | *
|
3936 | * @platform win32,linux
|
3937 | */
|
3938 | on(event: 'app-command', listener: (event: Event,
|
3939 | command: string) => void): this;
|
3940 | /**
|
3941 | * @platform win32,linux
|
3942 | */
|
3943 | off(event: 'app-command', listener: (event: Event,
|
3944 | command: string) => void): this;
|
3945 | /**
|
3946 | * @platform win32,linux
|
3947 | */
|
3948 | once(event: 'app-command', listener: (event: Event,
|
3949 | command: string) => void): this;
|
3950 | /**
|
3951 | * @platform win32,linux
|
3952 | */
|
3953 | addListener(event: 'app-command', listener: (event: Event,
|
3954 | command: string) => void): this;
|
3955 | /**
|
3956 | * @platform win32,linux
|
3957 | */
|
3958 | removeListener(event: 'app-command', listener: (event: Event,
|
3959 | command: string) => void): this;
|
3960 | /**
|
3961 | * Emitted when the window loses focus.
|
3962 | */
|
3963 | on(event: 'blur', listener: () => void): this;
|
3964 | off(event: 'blur', listener: () => void): this;
|
3965 | once(event: 'blur', listener: () => void): this;
|
3966 | addListener(event: 'blur', listener: () => void): this;
|
3967 | removeListener(event: 'blur', listener: () => void): this;
|
3968 | /**
|
3969 | * Emitted when the window loses focus.
|
3970 | */
|
3971 | on(event: 'blur', listener: (event: Event) => void): this;
|
3972 | off(event: 'blur', listener: (event: Event) => void): this;
|
3973 | once(event: 'blur', listener: (event: Event) => void): this;
|
3974 | addListener(event: 'blur', listener: (event: Event) => void): this;
|
3975 | removeListener(event: 'blur', listener: (event: Event) => void): this;
|
3976 | /**
|
3977 | * Emitted when the window is going to be closed. It's emitted before the
|
3978 | * `beforeunload` and `unload` event of the DOM. Calling `event.preventDefault()`
|
3979 | * will cancel the close.
|
3980 | *
|
3981 | * Usually you would want to use the `beforeunload` handler to decide whether the
|
3982 | * window should be closed, which will also be called when the window is reloaded.
|
3983 | * In Electron, returning any value other than `undefined` would cancel the close.
|
3984 | * For example:
|
3985 | *
|
3986 | * _**Note**: There is a subtle difference between the behaviors of
|
3987 | * `window.onbeforeunload = handler` and `window.addEventListener('beforeunload',
|
3988 | * handler)`. It is recommended to always set the `event.returnValue` explicitly,
|
3989 | * instead of only returning a value, as the former works more consistently within
|
3990 | * Electron._
|
3991 | */
|
3992 | on(event: 'close', listener: (event: Event) => void): this;
|
3993 | off(event: 'close', listener: (event: Event) => void): this;
|
3994 | once(event: 'close', listener: (event: Event) => void): this;
|
3995 | addListener(event: 'close', listener: (event: Event) => void): this;
|
3996 | removeListener(event: 'close', listener: (event: Event) => void): this;
|
3997 | /**
|
3998 | * Emitted when the window is going to be closed. It's emitted before the
|
3999 | * `beforeunload` and `unload` event of the DOM. Calling `event.preventDefault()`
|
4000 | * will cancel the close.
|
4001 | *
|
4002 | * Usually you would want to use the `beforeunload` handler to decide whether the
|
4003 | * window should be closed, which will also be called when the window is reloaded.
|
4004 | * In Electron, returning any value other than `undefined` would cancel the close.
|
4005 | * For example:
|
4006 | *
|
4007 | * _**Note**: There is a subtle difference between the behaviors of
|
4008 | * `window.onbeforeunload = handler` and `window.addEventListener('beforeunload',
|
4009 | * handler)`. It is recommended to always set the `event.returnValue` explicitly,
|
4010 | * instead of only returning a value, as the former works more consistently within
|
4011 | * Electron._
|
4012 | */
|
4013 | on(event: 'close', listener: (event: Event) => void): this;
|
4014 | off(event: 'close', listener: (event: Event) => void): this;
|
4015 | once(event: 'close', listener: (event: Event) => void): this;
|
4016 | addListener(event: 'close', listener: (event: Event) => void): this;
|
4017 | removeListener(event: 'close', listener: (event: Event) => void): this;
|
4018 | /**
|
4019 | * Emitted when the window is closed. After you have received this event you should
|
4020 | * remove the reference to the window and avoid using it any more.
|
4021 | */
|
4022 | on(event: 'closed', listener: () => void): this;
|
4023 | off(event: 'closed', listener: () => void): this;
|
4024 | once(event: 'closed', listener: () => void): this;
|
4025 | addListener(event: 'closed', listener: () => void): this;
|
4026 | removeListener(event: 'closed', listener: () => void): this;
|
4027 | /**
|
4028 | * Emitted when the window is closed. After you have received this event you should
|
4029 | * remove the reference to the window and avoid using it any more.
|
4030 | */
|
4031 | on(event: 'closed', listener: () => void): this;
|
4032 | off(event: 'closed', listener: () => void): this;
|
4033 | once(event: 'closed', listener: () => void): this;
|
4034 | addListener(event: 'closed', listener: () => void): this;
|
4035 | removeListener(event: 'closed', listener: () => void): this;
|
4036 | /**
|
4037 | * Emitted when the window enters a full-screen state.
|
4038 | */
|
4039 | on(event: 'enter-full-screen', listener: () => void): this;
|
4040 | off(event: 'enter-full-screen', listener: () => void): this;
|
4041 | once(event: 'enter-full-screen', listener: () => void): this;
|
4042 | addListener(event: 'enter-full-screen', listener: () => void): this;
|
4043 | removeListener(event: 'enter-full-screen', listener: () => void): this;
|
4044 | /**
|
4045 | * Emitted when the window enters a full-screen state.
|
4046 | */
|
4047 | on(event: 'enter-full-screen', listener: () => void): this;
|
4048 | off(event: 'enter-full-screen', listener: () => void): this;
|
4049 | once(event: 'enter-full-screen', listener: () => void): this;
|
4050 | addListener(event: 'enter-full-screen', listener: () => void): this;
|
4051 | removeListener(event: 'enter-full-screen', listener: () => void): this;
|
4052 | /**
|
4053 | * Emitted when the window enters a full-screen state triggered by HTML API.
|
4054 | */
|
4055 | on(event: 'enter-html-full-screen', listener: () => void): this;
|
4056 | off(event: 'enter-html-full-screen', listener: () => void): this;
|
4057 | once(event: 'enter-html-full-screen', listener: () => void): this;
|
4058 | addListener(event: 'enter-html-full-screen', listener: () => void): this;
|
4059 | removeListener(event: 'enter-html-full-screen', listener: () => void): this;
|
4060 | /**
|
4061 | * Emitted when the window gains focus.
|
4062 | */
|
4063 | on(event: 'focus', listener: () => void): this;
|
4064 | off(event: 'focus', listener: () => void): this;
|
4065 | once(event: 'focus', listener: () => void): this;
|
4066 | addListener(event: 'focus', listener: () => void): this;
|
4067 | removeListener(event: 'focus', listener: () => void): this;
|
4068 | /**
|
4069 | * Emitted when the window gains focus.
|
4070 | */
|
4071 | on(event: 'focus', listener: (event: Event) => void): this;
|
4072 | off(event: 'focus', listener: (event: Event) => void): this;
|
4073 | once(event: 'focus', listener: (event: Event) => void): this;
|
4074 | addListener(event: 'focus', listener: (event: Event) => void): this;
|
4075 | removeListener(event: 'focus', listener: (event: Event) => void): this;
|
4076 | /**
|
4077 | * Emitted when the window is hidden.
|
4078 | */
|
4079 | on(event: 'hide', listener: () => void): this;
|
4080 | off(event: 'hide', listener: () => void): this;
|
4081 | once(event: 'hide', listener: () => void): this;
|
4082 | addListener(event: 'hide', listener: () => void): this;
|
4083 | removeListener(event: 'hide', listener: () => void): this;
|
4084 | /**
|
4085 | * Emitted when the window is hidden.
|
4086 | */
|
4087 | on(event: 'hide', listener: () => void): this;
|
4088 | off(event: 'hide', listener: () => void): this;
|
4089 | once(event: 'hide', listener: () => void): this;
|
4090 | addListener(event: 'hide', listener: () => void): this;
|
4091 | removeListener(event: 'hide', listener: () => void): this;
|
4092 | /**
|
4093 | * Emitted when the window leaves a full-screen state.
|
4094 | */
|
4095 | on(event: 'leave-full-screen', listener: () => void): this;
|
4096 | off(event: 'leave-full-screen', listener: () => void): this;
|
4097 | once(event: 'leave-full-screen', listener: () => void): this;
|
4098 | addListener(event: 'leave-full-screen', listener: () => void): this;
|
4099 | removeListener(event: 'leave-full-screen', listener: () => void): this;
|
4100 | /**
|
4101 | * Emitted when the window leaves a full-screen state.
|
4102 | */
|
4103 | on(event: 'leave-full-screen', listener: () => void): this;
|
4104 | off(event: 'leave-full-screen', listener: () => void): this;
|
4105 | once(event: 'leave-full-screen', listener: () => void): this;
|
4106 | addListener(event: 'leave-full-screen', listener: () => void): this;
|
4107 | removeListener(event: 'leave-full-screen', listener: () => void): this;
|
4108 | /**
|
4109 | * Emitted when the window leaves a full-screen state triggered by HTML API.
|
4110 | */
|
4111 | on(event: 'leave-html-full-screen', listener: () => void): this;
|
4112 | off(event: 'leave-html-full-screen', listener: () => void): this;
|
4113 | once(event: 'leave-html-full-screen', listener: () => void): this;
|
4114 | addListener(event: 'leave-html-full-screen', listener: () => void): this;
|
4115 | removeListener(event: 'leave-html-full-screen', listener: () => void): this;
|
4116 | /**
|
4117 | * Emitted when window is maximized.
|
4118 | */
|
4119 | on(event: 'maximize', listener: () => void): this;
|
4120 | off(event: 'maximize', listener: () => void): this;
|
4121 | once(event: 'maximize', listener: () => void): this;
|
4122 | addListener(event: 'maximize', listener: () => void): this;
|
4123 | removeListener(event: 'maximize', listener: () => void): this;
|
4124 | /**
|
4125 | * Emitted when window is maximized.
|
4126 | */
|
4127 | on(event: 'maximize', listener: () => void): this;
|
4128 | off(event: 'maximize', listener: () => void): this;
|
4129 | once(event: 'maximize', listener: () => void): this;
|
4130 | addListener(event: 'maximize', listener: () => void): this;
|
4131 | removeListener(event: 'maximize', listener: () => void): this;
|
4132 | /**
|
4133 | * Emitted when the window is minimized.
|
4134 | */
|
4135 | on(event: 'minimize', listener: () => void): this;
|
4136 | off(event: 'minimize', listener: () => void): this;
|
4137 | once(event: 'minimize', listener: () => void): this;
|
4138 | addListener(event: 'minimize', listener: () => void): this;
|
4139 | removeListener(event: 'minimize', listener: () => void): this;
|
4140 | /**
|
4141 | * Emitted when the window is minimized.
|
4142 | */
|
4143 | on(event: 'minimize', listener: () => void): this;
|
4144 | off(event: 'minimize', listener: () => void): this;
|
4145 | once(event: 'minimize', listener: () => void): this;
|
4146 | addListener(event: 'minimize', listener: () => void): this;
|
4147 | removeListener(event: 'minimize', listener: () => void): this;
|
4148 | /**
|
4149 | * Emitted when the window is being moved to a new position.
|
4150 | */
|
4151 | on(event: 'move', listener: () => void): this;
|
4152 | off(event: 'move', listener: () => void): this;
|
4153 | once(event: 'move', listener: () => void): this;
|
4154 | addListener(event: 'move', listener: () => void): this;
|
4155 | removeListener(event: 'move', listener: () => void): this;
|
4156 | /**
|
4157 | * Emitted when the window is being moved to a new position.
|
4158 | */
|
4159 | on(event: 'move', listener: () => void): this;
|
4160 | off(event: 'move', listener: () => void): this;
|
4161 | once(event: 'move', listener: () => void): this;
|
4162 | addListener(event: 'move', listener: () => void): this;
|
4163 | removeListener(event: 'move', listener: () => void): this;
|
4164 | /**
|
4165 | * Emitted once when the window is moved to a new position.
|
4166 | *
|
4167 | * **Note**: On macOS this event is an alias of `move`.
|
4168 | *
|
4169 | * @platform darwin,win32
|
4170 | */
|
4171 | on(event: 'moved', listener: () => void): this;
|
4172 | /**
|
4173 | * @platform darwin,win32
|
4174 | */
|
4175 | off(event: 'moved', listener: () => void): this;
|
4176 | /**
|
4177 | * @platform darwin,win32
|
4178 | */
|
4179 | once(event: 'moved', listener: () => void): this;
|
4180 | /**
|
4181 | * @platform darwin,win32
|
4182 | */
|
4183 | addListener(event: 'moved', listener: () => void): this;
|
4184 | /**
|
4185 | * @platform darwin,win32
|
4186 | */
|
4187 | removeListener(event: 'moved', listener: () => void): this;
|
4188 | /**
|
4189 | * Emitted once when the window is moved to a new position.
|
4190 | *
|
4191 | * **Note**: On macOS this event is an alias of `move`.
|
4192 | *
|
4193 | * @platform darwin,win32
|
4194 | */
|
4195 | on(event: 'moved', listener: () => void): this;
|
4196 | /**
|
4197 | * @platform darwin,win32
|
4198 | */
|
4199 | off(event: 'moved', listener: () => void): this;
|
4200 | /**
|
4201 | * @platform darwin,win32
|
4202 | */
|
4203 | once(event: 'moved', listener: () => void): this;
|
4204 | /**
|
4205 | * @platform darwin,win32
|
4206 | */
|
4207 | addListener(event: 'moved', listener: () => void): this;
|
4208 | /**
|
4209 | * @platform darwin,win32
|
4210 | */
|
4211 | removeListener(event: 'moved', listener: () => void): this;
|
4212 | /**
|
4213 | * Emitted when the native new tab button is clicked.
|
4214 | *
|
4215 | * @platform darwin
|
4216 | */
|
4217 | on(event: 'new-window-for-tab', listener: () => void): this;
|
4218 | /**
|
4219 | * @platform darwin
|
4220 | */
|
4221 | off(event: 'new-window-for-tab', listener: () => void): this;
|
4222 | /**
|
4223 | * @platform darwin
|
4224 | */
|
4225 | once(event: 'new-window-for-tab', listener: () => void): this;
|
4226 | /**
|
4227 | * @platform darwin
|
4228 | */
|
4229 | addListener(event: 'new-window-for-tab', listener: () => void): this;
|
4230 | /**
|
4231 | * @platform darwin
|
4232 | */
|
4233 | removeListener(event: 'new-window-for-tab', listener: () => void): this;
|
4234 | /**
|
4235 | * Emitted when the native new tab button is clicked.
|
4236 | *
|
4237 | * @platform darwin
|
4238 | */
|
4239 | on(event: 'new-window-for-tab', listener: () => void): this;
|
4240 | /**
|
4241 | * @platform darwin
|
4242 | */
|
4243 | off(event: 'new-window-for-tab', listener: () => void): this;
|
4244 | /**
|
4245 | * @platform darwin
|
4246 | */
|
4247 | once(event: 'new-window-for-tab', listener: () => void): this;
|
4248 | /**
|
4249 | * @platform darwin
|
4250 | */
|
4251 | addListener(event: 'new-window-for-tab', listener: () => void): this;
|
4252 | /**
|
4253 | * @platform darwin
|
4254 | */
|
4255 | removeListener(event: 'new-window-for-tab', listener: () => void): this;
|
4256 | /**
|
4257 | * Emitted when the document changed its title, calling `event.preventDefault()`
|
4258 | * will prevent the native window's title from changing. `explicitSet` is false
|
4259 | * when title is synthesized from file URL.
|
4260 | */
|
4261 | on(event: 'page-title-updated', listener: (event: Event,
|
4262 | title: string,
|
4263 | explicitSet: boolean) => void): this;
|
4264 | off(event: 'page-title-updated', listener: (event: Event,
|
4265 | title: string,
|
4266 | explicitSet: boolean) => void): this;
|
4267 | once(event: 'page-title-updated', listener: (event: Event,
|
4268 | title: string,
|
4269 | explicitSet: boolean) => void): this;
|
4270 | addListener(event: 'page-title-updated', listener: (event: Event,
|
4271 | title: string,
|
4272 | explicitSet: boolean) => void): this;
|
4273 | removeListener(event: 'page-title-updated', listener: (event: Event,
|
4274 | title: string,
|
4275 | explicitSet: boolean) => void): this;
|
4276 | /**
|
4277 | * Emitted when the web page has been rendered (while not being shown) and window
|
4278 | * can be displayed without a visual flash.
|
4279 | *
|
4280 | * Please note that using this event implies that the renderer will be considered
|
4281 | * "visible" and paint even though `show` is false. This event will never fire if
|
4282 | * you use `paintWhenInitiallyHidden: false`
|
4283 | */
|
4284 | on(event: 'ready-to-show', listener: () => void): this;
|
4285 | off(event: 'ready-to-show', listener: () => void): this;
|
4286 | once(event: 'ready-to-show', listener: () => void): this;
|
4287 | addListener(event: 'ready-to-show', listener: () => void): this;
|
4288 | removeListener(event: 'ready-to-show', listener: () => void): this;
|
4289 | /**
|
4290 | * Emitted after the window has been resized.
|
4291 | */
|
4292 | on(event: 'resize', listener: () => void): this;
|
4293 | off(event: 'resize', listener: () => void): this;
|
4294 | once(event: 'resize', listener: () => void): this;
|
4295 | addListener(event: 'resize', listener: () => void): this;
|
4296 | removeListener(event: 'resize', listener: () => void): this;
|
4297 | /**
|
4298 | * Emitted after the window has been resized.
|
4299 | */
|
4300 | on(event: 'resize', listener: () => void): this;
|
4301 | off(event: 'resize', listener: () => void): this;
|
4302 | once(event: 'resize', listener: () => void): this;
|
4303 | addListener(event: 'resize', listener: () => void): this;
|
4304 | removeListener(event: 'resize', listener: () => void): this;
|
4305 | /**
|
4306 | * Emitted once when the window has finished being resized.
|
4307 | *
|
4308 | * This is usually emitted when the window has been resized manually. On macOS,
|
4309 | * resizing the window with `setBounds`/`setSize` and setting the `animate`
|
4310 | * parameter to `true` will also emit this event once resizing has finished.
|
4311 | *
|
4312 | * @platform darwin,win32
|
4313 | */
|
4314 | on(event: 'resized', listener: () => void): this;
|
4315 | /**
|
4316 | * @platform darwin,win32
|
4317 | */
|
4318 | off(event: 'resized', listener: () => void): this;
|
4319 | /**
|
4320 | * @platform darwin,win32
|
4321 | */
|
4322 | once(event: 'resized', listener: () => void): this;
|
4323 | /**
|
4324 | * @platform darwin,win32
|
4325 | */
|
4326 | addListener(event: 'resized', listener: () => void): this;
|
4327 | /**
|
4328 | * @platform darwin,win32
|
4329 | */
|
4330 | removeListener(event: 'resized', listener: () => void): this;
|
4331 | /**
|
4332 | * Emitted once when the window has finished being resized.
|
4333 | *
|
4334 | * This is usually emitted when the window has been resized manually. On macOS,
|
4335 | * resizing the window with `setBounds`/`setSize` and setting the `animate`
|
4336 | * parameter to `true` will also emit this event once resizing has finished.
|
4337 | *
|
4338 | * @platform darwin,win32
|
4339 | */
|
4340 | on(event: 'resized', listener: () => void): this;
|
4341 | /**
|
4342 | * @platform darwin,win32
|
4343 | */
|
4344 | off(event: 'resized', listener: () => void): this;
|
4345 | /**
|
4346 | * @platform darwin,win32
|
4347 | */
|
4348 | once(event: 'resized', listener: () => void): this;
|
4349 | /**
|
4350 | * @platform darwin,win32
|
4351 | */
|
4352 | addListener(event: 'resized', listener: () => void): this;
|
4353 | /**
|
4354 | * @platform darwin,win32
|
4355 | */
|
4356 | removeListener(event: 'resized', listener: () => void): this;
|
4357 | /**
|
4358 | * Emitted when the unresponsive web page becomes responsive again.
|
4359 | */
|
4360 | on(event: 'responsive', listener: () => void): this;
|
4361 | off(event: 'responsive', listener: () => void): this;
|
4362 | once(event: 'responsive', listener: () => void): this;
|
4363 | addListener(event: 'responsive', listener: () => void): this;
|
4364 | removeListener(event: 'responsive', listener: () => void): this;
|
4365 | /**
|
4366 | * Emitted when the window is restored from a minimized state.
|
4367 | */
|
4368 | on(event: 'restore', listener: () => void): this;
|
4369 | off(event: 'restore', listener: () => void): this;
|
4370 | once(event: 'restore', listener: () => void): this;
|
4371 | addListener(event: 'restore', listener: () => void): this;
|
4372 | removeListener(event: 'restore', listener: () => void): this;
|
4373 | /**
|
4374 | * Emitted when the window is restored from a minimized state.
|
4375 | */
|
4376 | on(event: 'restore', listener: () => void): this;
|
4377 | off(event: 'restore', listener: () => void): this;
|
4378 | once(event: 'restore', listener: () => void): this;
|
4379 | addListener(event: 'restore', listener: () => void): this;
|
4380 | removeListener(event: 'restore', listener: () => void): this;
|
4381 | /**
|
4382 | * Emitted on trackpad rotation gesture. Continually emitted until rotation gesture
|
4383 | * is ended. The `rotation` value on each emission is the angle in degrees rotated
|
4384 | * since the last emission. The last emitted event upon a rotation gesture will
|
4385 | * always be of value `0`. Counter-clockwise rotation values are positive, while
|
4386 | * clockwise ones are negative.
|
4387 | *
|
4388 | * @platform darwin
|
4389 | */
|
4390 | on(event: 'rotate-gesture', listener: (event: Event,
|
4391 | rotation: number) => void): this;
|
4392 | /**
|
4393 | * @platform darwin
|
4394 | */
|
4395 | off(event: 'rotate-gesture', listener: (event: Event,
|
4396 | rotation: number) => void): this;
|
4397 | /**
|
4398 | * @platform darwin
|
4399 | */
|
4400 | once(event: 'rotate-gesture', listener: (event: Event,
|
4401 | rotation: number) => void): this;
|
4402 | /**
|
4403 | * @platform darwin
|
4404 | */
|
4405 | addListener(event: 'rotate-gesture', listener: (event: Event,
|
4406 | rotation: number) => void): this;
|
4407 | /**
|
4408 | * @platform darwin
|
4409 | */
|
4410 | removeListener(event: 'rotate-gesture', listener: (event: Event,
|
4411 | rotation: number) => void): this;
|
4412 | /**
|
4413 | * Emitted on trackpad rotation gesture. Continually emitted until rotation gesture
|
4414 | * is ended. The `rotation` value on each emission is the angle in degrees rotated
|
4415 | * since the last emission. The last emitted event upon a rotation gesture will
|
4416 | * always be of value `0`. Counter-clockwise rotation values are positive, while
|
4417 | * clockwise ones are negative.
|
4418 | *
|
4419 | * @platform darwin
|
4420 | */
|
4421 | on(event: 'rotate-gesture', listener: (event: Event,
|
4422 | rotation: number) => void): this;
|
4423 | /**
|
4424 | * @platform darwin
|
4425 | */
|
4426 | off(event: 'rotate-gesture', listener: (event: Event,
|
4427 | rotation: number) => void): this;
|
4428 | /**
|
4429 | * @platform darwin
|
4430 | */
|
4431 | once(event: 'rotate-gesture', listener: (event: Event,
|
4432 | rotation: number) => void): this;
|
4433 | /**
|
4434 | * @platform darwin
|
4435 | */
|
4436 | addListener(event: 'rotate-gesture', listener: (event: Event,
|
4437 | rotation: number) => void): this;
|
4438 | /**
|
4439 | * @platform darwin
|
4440 | */
|
4441 | removeListener(event: 'rotate-gesture', listener: (event: Event,
|
4442 | rotation: number) => void): this;
|
4443 | /**
|
4444 | * Emitted when window session is going to end due to force shutdown or machine
|
4445 | * restart or session log off.
|
4446 | *
|
4447 | * @platform win32
|
4448 | */
|
4449 | on(event: 'session-end', listener: () => void): this;
|
4450 | /**
|
4451 | * @platform win32
|
4452 | */
|
4453 | off(event: 'session-end', listener: () => void): this;
|
4454 | /**
|
4455 | * @platform win32
|
4456 | */
|
4457 | once(event: 'session-end', listener: () => void): this;
|
4458 | /**
|
4459 | * @platform win32
|
4460 | */
|
4461 | addListener(event: 'session-end', listener: () => void): this;
|
4462 | /**
|
4463 | * @platform win32
|
4464 | */
|
4465 | removeListener(event: 'session-end', listener: () => void): this;
|
4466 | /**
|
4467 | * Emitted when window session is going to end due to force shutdown or machine
|
4468 | * restart or session log off.
|
4469 | *
|
4470 | * @platform win32
|
4471 | */
|
4472 | on(event: 'session-end', listener: () => void): this;
|
4473 | /**
|
4474 | * @platform win32
|
4475 | */
|
4476 | off(event: 'session-end', listener: () => void): this;
|
4477 | /**
|
4478 | * @platform win32
|
4479 | */
|
4480 | once(event: 'session-end', listener: () => void): this;
|
4481 | /**
|
4482 | * @platform win32
|
4483 | */
|
4484 | addListener(event: 'session-end', listener: () => void): this;
|
4485 | /**
|
4486 | * @platform win32
|
4487 | */
|
4488 | removeListener(event: 'session-end', listener: () => void): this;
|
4489 | /**
|
4490 | * Emitted when the window opens a sheet.
|
4491 | *
|
4492 | * @platform darwin
|
4493 | */
|
4494 | on(event: 'sheet-begin', listener: () => void): this;
|
4495 | /**
|
4496 | * @platform darwin
|
4497 | */
|
4498 | off(event: 'sheet-begin', listener: () => void): this;
|
4499 | /**
|
4500 | * @platform darwin
|
4501 | */
|
4502 | once(event: 'sheet-begin', listener: () => void): this;
|
4503 | /**
|
4504 | * @platform darwin
|
4505 | */
|
4506 | addListener(event: 'sheet-begin', listener: () => void): this;
|
4507 | /**
|
4508 | * @platform darwin
|
4509 | */
|
4510 | removeListener(event: 'sheet-begin', listener: () => void): this;
|
4511 | /**
|
4512 | * Emitted when the window opens a sheet.
|
4513 | *
|
4514 | * @platform darwin
|
4515 | */
|
4516 | on(event: 'sheet-begin', listener: () => void): this;
|
4517 | /**
|
4518 | * @platform darwin
|
4519 | */
|
4520 | off(event: 'sheet-begin', listener: () => void): this;
|
4521 | /**
|
4522 | * @platform darwin
|
4523 | */
|
4524 | once(event: 'sheet-begin', listener: () => void): this;
|
4525 | /**
|
4526 | * @platform darwin
|
4527 | */
|
4528 | addListener(event: 'sheet-begin', listener: () => void): this;
|
4529 | /**
|
4530 | * @platform darwin
|
4531 | */
|
4532 | removeListener(event: 'sheet-begin', listener: () => void): this;
|
4533 | /**
|
4534 | * Emitted when the window has closed a sheet.
|
4535 | *
|
4536 | * @platform darwin
|
4537 | */
|
4538 | on(event: 'sheet-end', listener: () => void): this;
|
4539 | /**
|
4540 | * @platform darwin
|
4541 | */
|
4542 | off(event: 'sheet-end', listener: () => void): this;
|
4543 | /**
|
4544 | * @platform darwin
|
4545 | */
|
4546 | once(event: 'sheet-end', listener: () => void): this;
|
4547 | /**
|
4548 | * @platform darwin
|
4549 | */
|
4550 | addListener(event: 'sheet-end', listener: () => void): this;
|
4551 | /**
|
4552 | * @platform darwin
|
4553 | */
|
4554 | removeListener(event: 'sheet-end', listener: () => void): this;
|
4555 | /**
|
4556 | * Emitted when the window has closed a sheet.
|
4557 | *
|
4558 | * @platform darwin
|
4559 | */
|
4560 | on(event: 'sheet-end', listener: () => void): this;
|
4561 | /**
|
4562 | * @platform darwin
|
4563 | */
|
4564 | off(event: 'sheet-end', listener: () => void): this;
|
4565 | /**
|
4566 | * @platform darwin
|
4567 | */
|
4568 | once(event: 'sheet-end', listener: () => void): this;
|
4569 | /**
|
4570 | * @platform darwin
|
4571 | */
|
4572 | addListener(event: 'sheet-end', listener: () => void): this;
|
4573 | /**
|
4574 | * @platform darwin
|
4575 | */
|
4576 | removeListener(event: 'sheet-end', listener: () => void): this;
|
4577 | /**
|
4578 | * Emitted when the window is shown.
|
4579 | */
|
4580 | on(event: 'show', listener: () => void): this;
|
4581 | off(event: 'show', listener: () => void): this;
|
4582 | once(event: 'show', listener: () => void): this;
|
4583 | addListener(event: 'show', listener: () => void): this;
|
4584 | removeListener(event: 'show', listener: () => void): this;
|
4585 | /**
|
4586 | * Emitted when the window is shown.
|
4587 | */
|
4588 | on(event: 'show', listener: () => void): this;
|
4589 | off(event: 'show', listener: () => void): this;
|
4590 | once(event: 'show', listener: () => void): this;
|
4591 | addListener(event: 'show', listener: () => void): this;
|
4592 | removeListener(event: 'show', listener: () => void): this;
|
4593 | /**
|
4594 | * Emitted on 3-finger swipe. Possible directions are `up`, `right`, `down`,
|
4595 | * `left`.
|
4596 | *
|
4597 | * The method underlying this event is built to handle older macOS-style trackpad
|
4598 | * swiping, where the content on the screen doesn't move with the swipe. Most macOS
|
4599 | * trackpads are not configured to allow this kind of swiping anymore, so in order
|
4600 | * for it to emit properly the 'Swipe between pages' preference in `System
|
4601 | * Preferences > Trackpad > More Gestures` must be set to 'Swipe with two or three
|
4602 | * fingers'.
|
4603 | *
|
4604 | * @platform darwin
|
4605 | */
|
4606 | on(event: 'swipe', listener: (event: Event,
|
4607 | direction: string) => void): this;
|
4608 | /**
|
4609 | * @platform darwin
|
4610 | */
|
4611 | off(event: 'swipe', listener: (event: Event,
|
4612 | direction: string) => void): this;
|
4613 | /**
|
4614 | * @platform darwin
|
4615 | */
|
4616 | once(event: 'swipe', listener: (event: Event,
|
4617 | direction: string) => void): this;
|
4618 | /**
|
4619 | * @platform darwin
|
4620 | */
|
4621 | addListener(event: 'swipe', listener: (event: Event,
|
4622 | direction: string) => void): this;
|
4623 | /**
|
4624 | * @platform darwin
|
4625 | */
|
4626 | removeListener(event: 'swipe', listener: (event: Event,
|
4627 | direction: string) => void): this;
|
4628 | /**
|
4629 | * Emitted on 3-finger swipe. Possible directions are `up`, `right`, `down`,
|
4630 | * `left`.
|
4631 | *
|
4632 | * The method underlying this event is built to handle older macOS-style trackpad
|
4633 | * swiping, where the content on the screen doesn't move with the swipe. Most macOS
|
4634 | * trackpads are not configured to allow this kind of swiping anymore, so in order
|
4635 | * for it to emit properly the 'Swipe between pages' preference in `System
|
4636 | * Preferences > Trackpad > More Gestures` must be set to 'Swipe with two or three
|
4637 | * fingers'.
|
4638 | *
|
4639 | * @platform darwin
|
4640 | */
|
4641 | on(event: 'swipe', listener: (event: Event,
|
4642 | direction: string) => void): this;
|
4643 | /**
|
4644 | * @platform darwin
|
4645 | */
|
4646 | off(event: 'swipe', listener: (event: Event,
|
4647 | direction: string) => void): this;
|
4648 | /**
|
4649 | * @platform darwin
|
4650 | */
|
4651 | once(event: 'swipe', listener: (event: Event,
|
4652 | direction: string) => void): this;
|
4653 | /**
|
4654 | * @platform darwin
|
4655 | */
|
4656 | addListener(event: 'swipe', listener: (event: Event,
|
4657 | direction: string) => void): this;
|
4658 | /**
|
4659 | * @platform darwin
|
4660 | */
|
4661 | removeListener(event: 'swipe', listener: (event: Event,
|
4662 | direction: string) => void): this;
|
4663 | /**
|
4664 | * Emitted when the system context menu is triggered on the window, this is
|
4665 | * normally only triggered when the user right clicks on the non-client area of
|
4666 | * your window. This is the window titlebar or any area you have declared as
|
4667 | * `-webkit-app-region: drag` in a frameless window.
|
4668 | *
|
4669 | * Calling `event.preventDefault()` will prevent the menu from being displayed.
|
4670 | *
|
4671 | * @platform win32
|
4672 | */
|
4673 | on(event: 'system-context-menu', listener: (event: Event,
|
4674 | /**
|
4675 | * The screen coordinates the context menu was triggered at
|
4676 | */
|
4677 | point: Point) => void): this;
|
4678 | /**
|
4679 | * @platform win32
|
4680 | */
|
4681 | off(event: 'system-context-menu', listener: (event: Event,
|
4682 | /**
|
4683 | * The screen coordinates the context menu was triggered at
|
4684 | */
|
4685 | point: Point) => void): this;
|
4686 | /**
|
4687 | * @platform win32
|
4688 | */
|
4689 | once(event: 'system-context-menu', listener: (event: Event,
|
4690 | /**
|
4691 | * The screen coordinates the context menu was triggered at
|
4692 | */
|
4693 | point: Point) => void): this;
|
4694 | /**
|
4695 | * @platform win32
|
4696 | */
|
4697 | addListener(event: 'system-context-menu', listener: (event: Event,
|
4698 | /**
|
4699 | * The screen coordinates the context menu was triggered at
|
4700 | */
|
4701 | point: Point) => void): this;
|
4702 | /**
|
4703 | * @platform win32
|
4704 | */
|
4705 | removeListener(event: 'system-context-menu', listener: (event: Event,
|
4706 | /**
|
4707 | * The screen coordinates the context menu was triggered at
|
4708 | */
|
4709 | point: Point) => void): this;
|
4710 | /**
|
4711 | * Emitted when the system context menu is triggered on the window, this is
|
4712 | * normally only triggered when the user right clicks on the non-client area of
|
4713 | * your window. This is the window titlebar or any area you have declared as
|
4714 | * `-webkit-app-region: drag` in a frameless window.
|
4715 | *
|
4716 | * Calling `event.preventDefault()` will prevent the menu from being displayed.
|
4717 | *
|
4718 | * @platform win32
|
4719 | */
|
4720 | on(event: 'system-context-menu', listener: (event: Event,
|
4721 | /**
|
4722 | * The screen coordinates the context menu was triggered at
|
4723 | */
|
4724 | point: Point) => void): this;
|
4725 | /**
|
4726 | * @platform win32
|
4727 | */
|
4728 | off(event: 'system-context-menu', listener: (event: Event,
|
4729 | /**
|
4730 | * The screen coordinates the context menu was triggered at
|
4731 | */
|
4732 | point: Point) => void): this;
|
4733 | /**
|
4734 | * @platform win32
|
4735 | */
|
4736 | once(event: 'system-context-menu', listener: (event: Event,
|
4737 | /**
|
4738 | * The screen coordinates the context menu was triggered at
|
4739 | */
|
4740 | point: Point) => void): this;
|
4741 | /**
|
4742 | * @platform win32
|
4743 | */
|
4744 | addListener(event: 'system-context-menu', listener: (event: Event,
|
4745 | /**
|
4746 | * The screen coordinates the context menu was triggered at
|
4747 | */
|
4748 | point: Point) => void): this;
|
4749 | /**
|
4750 | * @platform win32
|
4751 | */
|
4752 | removeListener(event: 'system-context-menu', listener: (event: Event,
|
4753 | /**
|
4754 | * The screen coordinates the context menu was triggered at
|
4755 | */
|
4756 | point: Point) => void): this;
|
4757 | /**
|
4758 | * Emitted when the window exits from a maximized state.
|
4759 | */
|
4760 | on(event: 'unmaximize', listener: () => void): this;
|
4761 | off(event: 'unmaximize', listener: () => void): this;
|
4762 | once(event: 'unmaximize', listener: () => void): this;
|
4763 | addListener(event: 'unmaximize', listener: () => void): this;
|
4764 | removeListener(event: 'unmaximize', listener: () => void): this;
|
4765 | /**
|
4766 | * Emitted when the window exits from a maximized state.
|
4767 | */
|
4768 | on(event: 'unmaximize', listener: () => void): this;
|
4769 | off(event: 'unmaximize', listener: () => void): this;
|
4770 | once(event: 'unmaximize', listener: () => void): this;
|
4771 | addListener(event: 'unmaximize', listener: () => void): this;
|
4772 | removeListener(event: 'unmaximize', listener: () => void): this;
|
4773 | /**
|
4774 | * Emitted when the web page becomes unresponsive.
|
4775 | */
|
4776 | on(event: 'unresponsive', listener: () => void): this;
|
4777 | off(event: 'unresponsive', listener: () => void): this;
|
4778 | once(event: 'unresponsive', listener: () => void): this;
|
4779 | addListener(event: 'unresponsive', listener: () => void): this;
|
4780 | removeListener(event: 'unresponsive', listener: () => void): this;
|
4781 | /**
|
4782 | * Emitted before the window is moved. On Windows, calling `event.preventDefault()`
|
4783 | * will prevent the window from being moved.
|
4784 | *
|
4785 | * Note that this is only emitted when the window is being moved manually. Moving
|
4786 | * the window with `setPosition`/`setBounds`/`center` will not emit this event.
|
4787 | *
|
4788 | * @platform darwin,win32
|
4789 | */
|
4790 | on(event: 'will-move', listener: (event: Event,
|
4791 | /**
|
4792 | * Location the window is being moved to.
|
4793 | */
|
4794 | newBounds: Rectangle) => void): this;
|
4795 | /**
|
4796 | * @platform darwin,win32
|
4797 | */
|
4798 | off(event: 'will-move', listener: (event: Event,
|
4799 | /**
|
4800 | * Location the window is being moved to.
|
4801 | */
|
4802 | newBounds: Rectangle) => void): this;
|
4803 | /**
|
4804 | * @platform darwin,win32
|
4805 | */
|
4806 | once(event: 'will-move', listener: (event: Event,
|
4807 | /**
|
4808 | * Location the window is being moved to.
|
4809 | */
|
4810 | newBounds: Rectangle) => void): this;
|
4811 | /**
|
4812 | * @platform darwin,win32
|
4813 | */
|
4814 | addListener(event: 'will-move', listener: (event: Event,
|
4815 | /**
|
4816 | * Location the window is being moved to.
|
4817 | */
|
4818 | newBounds: Rectangle) => void): this;
|
4819 | /**
|
4820 | * @platform darwin,win32
|
4821 | */
|
4822 | removeListener(event: 'will-move', listener: (event: Event,
|
4823 | /**
|
4824 | * Location the window is being moved to.
|
4825 | */
|
4826 | newBounds: Rectangle) => void): this;
|
4827 | /**
|
4828 | * Emitted before the window is moved. On Windows, calling `event.preventDefault()`
|
4829 | * will prevent the window from being moved.
|
4830 | *
|
4831 | * Note that this is only emitted when the window is being moved manually. Moving
|
4832 | * the window with `setPosition`/`setBounds`/`center` will not emit this event.
|
4833 | *
|
4834 | * @platform darwin,win32
|
4835 | */
|
4836 | on(event: 'will-move', listener: (event: Event,
|
4837 | /**
|
4838 | * Location the window is being moved to.
|
4839 | */
|
4840 | newBounds: Rectangle) => void): this;
|
4841 | /**
|
4842 | * @platform darwin,win32
|
4843 | */
|
4844 | off(event: 'will-move', listener: (event: Event,
|
4845 | /**
|
4846 | * Location the window is being moved to.
|
4847 | */
|
4848 | newBounds: Rectangle) => void): this;
|
4849 | /**
|
4850 | * @platform darwin,win32
|
4851 | */
|
4852 | once(event: 'will-move', listener: (event: Event,
|
4853 | /**
|
4854 | * Location the window is being moved to.
|
4855 | */
|
4856 | newBounds: Rectangle) => void): this;
|
4857 | /**
|
4858 | * @platform darwin,win32
|
4859 | */
|
4860 | addListener(event: 'will-move', listener: (event: Event,
|
4861 | /**
|
4862 | * Location the window is being moved to.
|
4863 | */
|
4864 | newBounds: Rectangle) => void): this;
|
4865 | /**
|
4866 | * @platform darwin,win32
|
4867 | */
|
4868 | removeListener(event: 'will-move', listener: (event: Event,
|
4869 | /**
|
4870 | * Location the window is being moved to.
|
4871 | */
|
4872 | newBounds: Rectangle) => void): this;
|
4873 | /**
|
4874 | * Emitted before the window is resized. Calling `event.preventDefault()` will
|
4875 | * prevent the window from being resized.
|
4876 | *
|
4877 | * Note that this is only emitted when the window is being resized manually.
|
4878 | * Resizing the window with `setBounds`/`setSize` will not emit this event.
|
4879 | *
|
4880 | * The possible values and behaviors of the `edge` option are platform dependent.
|
4881 | * Possible values are:
|
4882 | *
|
4883 | * * On Windows, possible values are `bottom`, `top`, `left`, `right`, `top-left`,
|
4884 | * `top-right`, `bottom-left`, `bottom-right`.
|
4885 | * * On macOS, possible values are `bottom` and `right`.
|
4886 | * * The value `bottom` is used to denote vertical resizing.
|
4887 | * * The value `right` is used to denote horizontal resizing.
|
4888 | *
|
4889 | * @platform darwin,win32
|
4890 | */
|
4891 | on(event: 'will-resize', listener: (event: Event,
|
4892 | /**
|
4893 | * Size the window is being resized to.
|
4894 | */
|
4895 | newBounds: Rectangle,
|
4896 | details: WillResizeDetails) => void): this;
|
4897 | /**
|
4898 | * @platform darwin,win32
|
4899 | */
|
4900 | off(event: 'will-resize', listener: (event: Event,
|
4901 | /**
|
4902 | * Size the window is being resized to.
|
4903 | */
|
4904 | newBounds: Rectangle,
|
4905 | details: WillResizeDetails) => void): this;
|
4906 | /**
|
4907 | * @platform darwin,win32
|
4908 | */
|
4909 | once(event: 'will-resize', listener: (event: Event,
|
4910 | /**
|
4911 | * Size the window is being resized to.
|
4912 | */
|
4913 | newBounds: Rectangle,
|
4914 | details: WillResizeDetails) => void): this;
|
4915 | /**
|
4916 | * @platform darwin,win32
|
4917 | */
|
4918 | addListener(event: 'will-resize', listener: (event: Event,
|
4919 | /**
|
4920 | * Size the window is being resized to.
|
4921 | */
|
4922 | newBounds: Rectangle,
|
4923 | details: WillResizeDetails) => void): this;
|
4924 | /**
|
4925 | * @platform darwin,win32
|
4926 | */
|
4927 | removeListener(event: 'will-resize', listener: (event: Event,
|
4928 | /**
|
4929 | * Size the window is being resized to.
|
4930 | */
|
4931 | newBounds: Rectangle,
|
4932 | details: WillResizeDetails) => void): this;
|
4933 | /**
|
4934 | * Emitted before the window is resized. Calling `event.preventDefault()` will
|
4935 | * prevent the window from being resized.
|
4936 | *
|
4937 | * Note that this is only emitted when the window is being resized manually.
|
4938 | * Resizing the window with `setBounds`/`setSize` will not emit this event.
|
4939 | *
|
4940 | * The possible values and behaviors of the `edge` option are platform dependent.
|
4941 | * Possible values are:
|
4942 | *
|
4943 | * * On Windows, possible values are `bottom`, `top`, `left`, `right`, `top-left`,
|
4944 | * `top-right`, `bottom-left`, `bottom-right`.
|
4945 | * * On macOS, possible values are `bottom` and `right`.
|
4946 | * * The value `bottom` is used to denote vertical resizing.
|
4947 | * * The value `right` is used to denote horizontal resizing.
|
4948 | *
|
4949 | * @platform darwin,win32
|
4950 | */
|
4951 | on(event: 'will-resize', listener: (event: Event,
|
4952 | /**
|
4953 | * Size the window is being resized to.
|
4954 | */
|
4955 | newBounds: Rectangle,
|
4956 | details: WillResizeDetails) => void): this;
|
4957 | /**
|
4958 | * @platform darwin,win32
|
4959 | */
|
4960 | off(event: 'will-resize', listener: (event: Event,
|
4961 | /**
|
4962 | * Size the window is being resized to.
|
4963 | */
|
4964 | newBounds: Rectangle,
|
4965 | details: WillResizeDetails) => void): this;
|
4966 | /**
|
4967 | * @platform darwin,win32
|
4968 | */
|
4969 | once(event: 'will-resize', listener: (event: Event,
|
4970 | /**
|
4971 | * Size the window is being resized to.
|
4972 | */
|
4973 | newBounds: Rectangle,
|
4974 | details: WillResizeDetails) => void): this;
|
4975 | /**
|
4976 | * @platform darwin,win32
|
4977 | */
|
4978 | addListener(event: 'will-resize', listener: (event: Event,
|
4979 | /**
|
4980 | * Size the window is being resized to.
|
4981 | */
|
4982 | newBounds: Rectangle,
|
4983 | details: WillResizeDetails) => void): this;
|
4984 | /**
|
4985 | * @platform darwin,win32
|
4986 | */
|
4987 | removeListener(event: 'will-resize', listener: (event: Event,
|
4988 | /**
|
4989 | * Size the window is being resized to.
|
4990 | */
|
4991 | newBounds: Rectangle,
|
4992 | details: WillResizeDetails) => void): this;
|
4993 | /**
|
4994 | * BrowserWindow
|
4995 | */
|
4996 | constructor(options?: BrowserWindowConstructorOptions);
|
4997 | /**
|
4998 | * > **Note** The `BrowserView` class is deprecated, and replaced by the new
|
4999 | * `WebContentsView` class.
|
5000 | *
|
5001 | * The window that owns the given `browserView`. If the given view is not attached
|
5002 | * to any window, returns `null`.
|
5003 | *
|
5004 | * @deprecated
|
5005 | */
|
5006 | static fromBrowserView(browserView: BrowserView): (BrowserWindow) | (null);
|
5007 | /**
|
5008 | * The window with the given `id`.
|
5009 | */
|
5010 | static fromId(id: number): (BrowserWindow) | (null);
|
5011 | /**
|
5012 | * The window that owns the given `webContents` or `null` if the contents are not
|
5013 | * owned by a window.
|
5014 | */
|
5015 | static fromWebContents(webContents: WebContents): (BrowserWindow) | (null);
|
5016 | /**
|
5017 | * An array of all opened browser windows.
|
5018 | */
|
5019 | static getAllWindows(): BrowserWindow[];
|
5020 | /**
|
5021 | * The window that is focused in this application, otherwise returns `null`.
|
5022 | */
|
5023 | static getFocusedWindow(): (BrowserWindow) | (null);
|
5024 | /**
|
5025 | * Replacement API for setBrowserView supporting work with multi browser views.
|
5026 | *
|
5027 | * > **Note** The `BrowserView` class is deprecated, and replaced by the new
|
5028 | * `WebContentsView` class.
|
5029 | *
|
5030 | * @experimental
|
5031 | * @deprecated
|
5032 | */
|
5033 | addBrowserView(browserView: BrowserView): void;
|
5034 | /**
|
5035 | * Adds a window as a tab on this window, after the tab for the window instance.
|
5036 | *
|
5037 | * @platform darwin
|
5038 | */
|
5039 | addTabbedWindow(browserWindow: BrowserWindow): void;
|
5040 | /**
|
5041 | * Removes focus from the window.
|
5042 | */
|
5043 | blur(): void;
|
5044 | blurWebView(): void;
|
5045 | /**
|
5046 | * Resolves with a NativeImage
|
5047 | *
|
5048 | * Captures a snapshot of the page within `rect`. Omitting `rect` will capture the
|
5049 | * whole visible page. If the page is not visible, `rect` may be empty. The page is
|
5050 | * considered visible when its browser window is hidden and the capturer count is
|
5051 | * non-zero. If you would like the page to stay hidden, you should ensure that
|
5052 | * `stayHidden` is set to true.
|
5053 | */
|
5054 | capturePage(rect?: Rectangle, opts?: Opts): Promise<Electron.NativeImage>;
|
5055 | /**
|
5056 | * Moves window to the center of the screen.
|
5057 | */
|
5058 | center(): void;
|
5059 | /**
|
5060 | * Try to close the window. This has the same effect as a user manually clicking
|
5061 | * the close button of the window. The web page may cancel the close though. See
|
5062 | * the close event.
|
5063 | */
|
5064 | close(): void;
|
5065 | /**
|
5066 | * Closes the currently open Quick Look panel.
|
5067 | *
|
5068 | * @platform darwin
|
5069 | */
|
5070 | closeFilePreview(): void;
|
5071 | /**
|
5072 | * Force closing the window, the `unload` and `beforeunload` event won't be emitted
|
5073 | * for the web page, and `close` event will also not be emitted for this window,
|
5074 | * but it guarantees the `closed` event will be emitted.
|
5075 | */
|
5076 | destroy(): void;
|
5077 | /**
|
5078 | * Starts or stops flashing the window to attract user's attention.
|
5079 | */
|
5080 | flashFrame(flag: boolean): void;
|
5081 | /**
|
5082 | * Focuses on the window.
|
5083 | */
|
5084 | focus(): void;
|
5085 | focusOnWebView(): void;
|
5086 | /**
|
5087 | * Gets the background color of the window in Hex (`#RRGGBB`) format.
|
5088 | *
|
5089 | * See Setting `backgroundColor`.
|
5090 | *
|
5091 | * **Note:** The alpha value is _not_ returned alongside the red, green, and blue
|
5092 | * values.
|
5093 | */
|
5094 | getBackgroundColor(): string;
|
5095 | /**
|
5096 | * The `bounds` of the window as `Object`.
|
5097 | *
|
5098 | * **Note:** On macOS, the y-coordinate value returned will be at minimum the Tray
|
5099 | * height. For example, calling `win.setBounds({ x: 25, y: 20, width: 800, height:
|
5100 | * 600 })` with a tray height of 38 means that `win.getBounds()` will return `{ x:
|
5101 | * 25, y: 38, width: 800, height: 600 }`.
|
5102 | */
|
5103 | getBounds(): Rectangle;
|
5104 | /**
|
5105 | * The `BrowserView` attached to `win`. Returns `null` if one is not attached.
|
5106 | * Throws an error if multiple `BrowserView`s are attached.
|
5107 | *
|
5108 | * > **Note** The `BrowserView` class is deprecated, and replaced by the new
|
5109 | * `WebContentsView` class.
|
5110 | *
|
5111 | * @experimental
|
5112 | * @deprecated
|
5113 | */
|
5114 | getBrowserView(): (BrowserView) | (null);
|
5115 | /**
|
5116 | * a sorted by z-index array of all BrowserViews that have been attached with
|
5117 | * `addBrowserView` or `setBrowserView`. The top-most BrowserView is the last
|
5118 | * element of the array.
|
5119 | *
|
5120 | * > **Note** The `BrowserView` class is deprecated, and replaced by the new
|
5121 | * `WebContentsView` class.
|
5122 | *
|
5123 | * @experimental
|
5124 | * @deprecated
|
5125 | */
|
5126 | getBrowserViews(): BrowserView[];
|
5127 | /**
|
5128 | * All child windows.
|
5129 | */
|
5130 | getChildWindows(): BrowserWindow[];
|
5131 | /**
|
5132 | * The `bounds` of the window's client area as `Object`.
|
5133 | */
|
5134 | getContentBounds(): Rectangle;
|
5135 | /**
|
5136 | * Contains the window's client area's width and height.
|
5137 | */
|
5138 | getContentSize(): number[];
|
5139 | /**
|
5140 | * Contains the window's maximum width and height.
|
5141 | */
|
5142 | getMaximumSize(): number[];
|
5143 | /**
|
5144 | * Window id in the format of DesktopCapturerSource's id. For example
|
5145 | * "window:1324:0".
|
5146 | *
|
5147 | * More precisely the format is `window:id:other_id` where `id` is `HWND` on
|
5148 | * Windows, `CGWindowID` (`uint64_t`) on macOS and `Window` (`unsigned long`) on
|
5149 | * Linux. `other_id` is used to identify web contents (tabs) so within the same top
|
5150 | * level window.
|
5151 | */
|
5152 | getMediaSourceId(): string;
|
5153 | /**
|
5154 | * Contains the window's minimum width and height.
|
5155 | */
|
5156 | getMinimumSize(): number[];
|
5157 | /**
|
5158 | * The platform-specific handle of the window.
|
5159 | *
|
5160 | * The native type of the handle is `HWND` on Windows, `NSView*` on macOS, and
|
5161 | * `Window` (`unsigned long`) on Linux.
|
5162 | */
|
5163 | getNativeWindowHandle(): Buffer;
|
5164 | /**
|
5165 | * Contains the window bounds of the normal state
|
5166 | *
|
5167 | * **Note:** whatever the current state of the window : maximized, minimized or in
|
5168 | * fullscreen, this function always returns the position and size of the window in
|
5169 | * normal state. In normal state, getBounds and getNormalBounds returns the same
|
5170 | * `Rectangle`.
|
5171 | */
|
5172 | getNormalBounds(): Rectangle;
|
5173 | /**
|
5174 | * between 0.0 (fully transparent) and 1.0 (fully opaque). On Linux, always returns
|
5175 | * 1.
|
5176 | */
|
5177 | getOpacity(): number;
|
5178 | /**
|
5179 | * The parent window or `null` if there is no parent.
|
5180 | */
|
5181 | getParentWindow(): (BrowserWindow) | (null);
|
5182 | /**
|
5183 | * Contains the window's current position.
|
5184 | */
|
5185 | getPosition(): number[];
|
5186 | /**
|
5187 | * The pathname of the file the window represents.
|
5188 | *
|
5189 | * @platform darwin
|
5190 | */
|
5191 | getRepresentedFilename(): string;
|
5192 | /**
|
5193 | * Contains the window's width and height.
|
5194 | */
|
5195 | getSize(): number[];
|
5196 | /**
|
5197 | * The title of the native window.
|
5198 | *
|
5199 | * **Note:** The title of the web page can be different from the title of the
|
5200 | * native window.
|
5201 | */
|
5202 | getTitle(): string;
|
5203 | /**
|
5204 | * The custom position for the traffic light buttons in frameless window, `null`
|
5205 | * will be returned when there is no custom position.
|
5206 | *
|
5207 | * @platform darwin
|
5208 | */
|
5209 | getWindowButtonPosition(): (Point) | (null);
|
5210 | /**
|
5211 | * Whether the window has a shadow.
|
5212 | */
|
5213 | hasShadow(): boolean;
|
5214 | /**
|
5215 | * Hides the window.
|
5216 | */
|
5217 | hide(): void;
|
5218 | /**
|
5219 | * Hooks a windows message. The `callback` is called when the message is received
|
5220 | * in the WndProc.
|
5221 | *
|
5222 | * @platform win32
|
5223 | */
|
5224 | hookWindowMessage(message: number, callback: (wParam: Buffer, lParam: Buffer) => void): void;
|
5225 | /**
|
5226 | * Invalidates the window shadow so that it is recomputed based on the current
|
5227 | * window shape.
|
5228 | *
|
5229 | * `BrowserWindows` that are transparent can sometimes leave behind visual
|
5230 | * artifacts on macOS. This method can be used to clear these artifacts when, for
|
5231 | * example, performing an animation.
|
5232 | *
|
5233 | * @platform darwin
|
5234 | */
|
5235 | invalidateShadow(): void;
|
5236 | /**
|
5237 | * Whether the window is always on top of other windows.
|
5238 | */
|
5239 | isAlwaysOnTop(): boolean;
|
5240 | /**
|
5241 | * Whether the window can be manually closed by user.
|
5242 | *
|
5243 | * On Linux always returns `true`.
|
5244 | *
|
5245 | * @platform darwin,win32
|
5246 | */
|
5247 | isClosable(): boolean;
|
5248 | /**
|
5249 | * Whether the window is destroyed.
|
5250 | */
|
5251 | isDestroyed(): boolean;
|
5252 | /**
|
5253 | * Whether the window's document has been edited.
|
5254 | *
|
5255 | * @platform darwin
|
5256 | */
|
5257 | isDocumentEdited(): boolean;
|
5258 | /**
|
5259 | * whether the window is enabled.
|
5260 | */
|
5261 | isEnabled(): boolean;
|
5262 | /**
|
5263 | * Whether the window can be focused.
|
5264 | *
|
5265 | * @platform darwin,win32
|
5266 | */
|
5267 | isFocusable(): boolean;
|
5268 | /**
|
5269 | * Whether the window is focused.
|
5270 | */
|
5271 | isFocused(): boolean;
|
5272 | /**
|
5273 | * Whether the window is in fullscreen mode.
|
5274 | *
|
5275 | * **Note:** On macOS, fullscreen transitions take place asynchronously. When
|
5276 | * querying for a BrowserWindow's fullscreen status, you should ensure that either
|
5277 | * the 'enter-full-screen' or 'leave-full-screen' events have been emitted.
|
5278 | */
|
5279 | isFullScreen(): boolean;
|
5280 | /**
|
5281 | * Whether the maximize/zoom window button toggles fullscreen mode or maximizes the
|
5282 | * window.
|
5283 | */
|
5284 | isFullScreenable(): boolean;
|
5285 | /**
|
5286 | * Whether the window will be hidden when the user toggles into mission control.
|
5287 | *
|
5288 | * @platform darwin
|
5289 | */
|
5290 | isHiddenInMissionControl(): boolean;
|
5291 | /**
|
5292 | * Whether the window is in kiosk mode.
|
5293 | */
|
5294 | isKiosk(): boolean;
|
5295 | /**
|
5296 | * Whether the window can be manually maximized by user.
|
5297 | *
|
5298 | * On Linux always returns `true`.
|
5299 | *
|
5300 | * @platform darwin,win32
|
5301 | */
|
5302 | isMaximizable(): boolean;
|
5303 | /**
|
5304 | * Whether the window is maximized.
|
5305 | */
|
5306 | isMaximized(): boolean;
|
5307 | /**
|
5308 | * Whether menu bar automatically hides itself.
|
5309 | *
|
5310 | * @platform win32,linux
|
5311 | */
|
5312 | isMenuBarAutoHide(): boolean;
|
5313 | /**
|
5314 | * Whether the menu bar is visible.
|
5315 | *
|
5316 | * @platform win32,linux
|
5317 | */
|
5318 | isMenuBarVisible(): boolean;
|
5319 | /**
|
5320 | * Whether the window can be manually minimized by the user.
|
5321 | *
|
5322 | * On Linux always returns `true`.
|
5323 | *
|
5324 | * @platform darwin,win32
|
5325 | */
|
5326 | isMinimizable(): boolean;
|
5327 | /**
|
5328 | * Whether the window is minimized.
|
5329 | */
|
5330 | isMinimized(): boolean;
|
5331 | /**
|
5332 | * Whether current window is a modal window.
|
5333 | */
|
5334 | isModal(): boolean;
|
5335 | /**
|
5336 | * Whether the window can be moved by user.
|
5337 | *
|
5338 | * On Linux always returns `true`.
|
5339 | *
|
5340 | * @platform darwin,win32
|
5341 | */
|
5342 | isMovable(): boolean;
|
5343 | /**
|
5344 | * Whether the window is in normal state (not maximized, not minimized, not in
|
5345 | * fullscreen mode).
|
5346 | */
|
5347 | isNormal(): boolean;
|
5348 | /**
|
5349 | * Whether the window can be manually resized by the user.
|
5350 | */
|
5351 | isResizable(): boolean;
|
5352 | /**
|
5353 | * Whether the window is in simple (pre-Lion) fullscreen mode.
|
5354 | *
|
5355 | * @platform darwin
|
5356 | */
|
5357 | isSimpleFullScreen(): boolean;
|
5358 | /**
|
5359 | * Whether the window is in Windows 10 tablet mode.
|
5360 | *
|
5361 | * Since Windows 10 users can use their PC as tablet, under this mode apps can
|
5362 | * choose to optimize their UI for tablets, such as enlarging the titlebar and
|
5363 | * hiding titlebar buttons.
|
5364 | *
|
5365 | * This API returns whether the window is in tablet mode, and the `resize` event
|
5366 | * can be be used to listen to changes to tablet mode.
|
5367 | *
|
5368 | * @platform win32
|
5369 | */
|
5370 | isTabletMode(): boolean;
|
5371 | /**
|
5372 | * Whether the window is visible to the user in the foreground of the app.
|
5373 | */
|
5374 | isVisible(): boolean;
|
5375 | /**
|
5376 | * Whether the window is visible on all workspaces.
|
5377 | *
|
5378 | * **Note:** This API always returns false on Windows.
|
5379 | *
|
5380 | * @platform darwin,linux
|
5381 | */
|
5382 | isVisibleOnAllWorkspaces(): boolean;
|
5383 | /**
|
5384 | * `true` or `false` depending on whether the message is hooked.
|
5385 | *
|
5386 | * @platform win32
|
5387 | */
|
5388 | isWindowMessageHooked(message: number): boolean;
|
5389 | /**
|
5390 | * the promise will resolve when the page has finished loading (see
|
5391 | * `did-finish-load`), and rejects if the page fails to load (see `did-fail-load`).
|
5392 | *
|
5393 | * Same as `webContents.loadFile`, `filePath` should be a path to an HTML file
|
5394 | * relative to the root of your application. See the `webContents` docs for more
|
5395 | * information.
|
5396 | */
|
5397 | loadFile(filePath: string, options?: LoadFileOptions): Promise<void>;
|
5398 | /**
|
5399 | * the promise will resolve when the page has finished loading (see
|
5400 | * `did-finish-load`), and rejects if the page fails to load (see `did-fail-load`).
|
5401 | *
|
5402 | * Same as `webContents.loadURL(url[, options])`.
|
5403 | *
|
5404 | * The `url` can be a remote address (e.g. `http://`) or a path to a local HTML
|
5405 | * file using the `file://` protocol.
|
5406 | *
|
5407 | * To ensure that file URLs are properly formatted, it is recommended to use Node's
|
5408 | * `url.format` method:
|
5409 | *
|
5410 | * You can load a URL using a `POST` request with URL-encoded data by doing the
|
5411 | * following:
|
5412 | */
|
5413 | loadURL(url: string, options?: LoadURLOptions): Promise<void>;
|
5414 | /**
|
5415 | * Maximizes the window. This will also show (but not focus) the window if it isn't
|
5416 | * being displayed already.
|
5417 | */
|
5418 | maximize(): void;
|
5419 | /**
|
5420 | * Merges all windows into one window with multiple tabs when native tabs are
|
5421 | * enabled and there is more than one open window.
|
5422 | *
|
5423 | * @platform darwin
|
5424 | */
|
5425 | mergeAllWindows(): void;
|
5426 | /**
|
5427 | * Minimizes the window. On some platforms the minimized window will be shown in
|
5428 | * the Dock.
|
5429 | */
|
5430 | minimize(): void;
|
5431 | /**
|
5432 | * Moves window above the source window in the sense of z-order. If the
|
5433 | * `mediaSourceId` is not of type window or if the window does not exist then this
|
5434 | * method throws an error.
|
5435 | */
|
5436 | moveAbove(mediaSourceId: string): void;
|
5437 | /**
|
5438 | * Moves the current tab into a new window if native tabs are enabled and there is
|
5439 | * more than one tab in the current window.
|
5440 | *
|
5441 | * @platform darwin
|
5442 | */
|
5443 | moveTabToNewWindow(): void;
|
5444 | /**
|
5445 | * Moves window to top(z-order) regardless of focus
|
5446 | */
|
5447 | moveTop(): void;
|
5448 | /**
|
5449 | * Uses Quick Look to preview a file at a given path.
|
5450 | *
|
5451 | * @platform darwin
|
5452 | */
|
5453 | previewFile(path: string, displayName?: string): void;
|
5454 | /**
|
5455 | * Same as `webContents.reload`.
|
5456 | */
|
5457 | reload(): void;
|
5458 | /**
|
5459 | * > **Note** The `BrowserView` class is deprecated, and replaced by the new
|
5460 | * `WebContentsView` class.
|
5461 | *
|
5462 | * @experimental
|
5463 | * @deprecated
|
5464 | */
|
5465 | removeBrowserView(browserView: BrowserView): void;
|
5466 | /**
|
5467 | * Remove the window's menu bar.
|
5468 | *
|
5469 | * @platform linux,win32
|
5470 | */
|
5471 | removeMenu(): void;
|
5472 | /**
|
5473 | * Restores the window from minimized state to its previous state.
|
5474 | */
|
5475 | restore(): void;
|
5476 | /**
|
5477 | * Selects the next tab when native tabs are enabled and there are other tabs in
|
5478 | * the window.
|
5479 | *
|
5480 | * @platform darwin
|
5481 | */
|
5482 | selectNextTab(): void;
|
5483 | /**
|
5484 | * Selects the previous tab when native tabs are enabled and there are other tabs
|
5485 | * in the window.
|
5486 | *
|
5487 | * @platform darwin
|
5488 | */
|
5489 | selectPreviousTab(): void;
|
5490 | /**
|
5491 | * Sets whether the window should show always on top of other windows. After
|
5492 | * setting this, the window is still a normal window, not a toolbox window which
|
5493 | * can not be focused on.
|
5494 | */
|
5495 | setAlwaysOnTop(flag: boolean, level?: 'normal' | 'floating' | 'torn-off-menu' | 'modal-panel' | 'main-menu' | 'status' | 'pop-up-menu' | 'screen-saver' | 'dock', relativeLevel?: number): void;
|
5496 | /**
|
5497 | * Sets the properties for the window's taskbar button.
|
5498 | *
|
5499 | * **Note:** `relaunchCommand` and `relaunchDisplayName` must always be set
|
5500 | * together. If one of those properties is not set, then neither will be used.
|
5501 | *
|
5502 | * @platform win32
|
5503 | */
|
5504 | setAppDetails(options: AppDetailsOptions): void;
|
5505 | /**
|
5506 | * This will make a window maintain an aspect ratio. The extra size allows a
|
5507 | * developer to have space, specified in pixels, not included within the aspect
|
5508 | * ratio calculations. This API already takes into account the difference between a
|
5509 | * window's size and its content size.
|
5510 | *
|
5511 | * Consider a normal window with an HD video player and associated controls.
|
5512 | * Perhaps there are 15 pixels of controls on the left edge, 25 pixels of controls
|
5513 | * on the right edge and 50 pixels of controls below the player. In order to
|
5514 | * maintain a 16:9 aspect ratio (standard aspect ratio for HD @1920x1080) within
|
5515 | * the player itself we would call this function with arguments of 16/9 and {
|
5516 | * width: 40, height: 50 }. The second argument doesn't care where the extra width
|
5517 | * and height are within the content view--only that they exist. Sum any extra
|
5518 | * width and height areas you have within the overall content view.
|
5519 | *
|
5520 | * The aspect ratio is not respected when window is resized programmatically with
|
5521 | * APIs like `win.setSize`.
|
5522 | *
|
5523 | * To reset an aspect ratio, pass 0 as the `aspectRatio` value:
|
5524 | * `win.setAspectRatio(0)`.
|
5525 | */
|
5526 | setAspectRatio(aspectRatio: number, extraSize?: Size): void;
|
5527 | /**
|
5528 | * Controls whether to hide cursor when typing.
|
5529 | *
|
5530 | * @platform darwin
|
5531 | */
|
5532 | setAutoHideCursor(autoHide: boolean): void;
|
5533 | /**
|
5534 | * Sets whether the window menu bar should hide itself automatically. Once set the
|
5535 | * menu bar will only show when users press the single `Alt` key.
|
5536 | *
|
5537 | * If the menu bar is already visible, calling `setAutoHideMenuBar(true)` won't
|
5538 | * hide it immediately.
|
5539 | *
|
5540 | * @platform win32,linux
|
5541 | */
|
5542 | setAutoHideMenuBar(hide: boolean): void;
|
5543 | /**
|
5544 | * Examples of valid `backgroundColor` values:
|
5545 | *
|
5546 | * * Hex
|
5547 | * * #fff (shorthand RGB)
|
5548 | * * #ffff (shorthand ARGB)
|
5549 | * * #ffffff (RGB)
|
5550 | * * #ffffffff (ARGB)
|
5551 | * * RGB
|
5552 | * * `rgb\(([\d]+),\s*([\d]+),\s*([\d]+)\)`
|
5553 | * * e.g. rgb(255, 255, 255)
|
5554 | * * RGBA
|
5555 | * * `rgba\(([\d]+),\s*([\d]+),\s*([\d]+),\s*([\d.]+)\)`
|
5556 | * * e.g. rgba(255, 255, 255, 1.0)
|
5557 | * * HSL
|
5558 | * * `hsl\((-?[\d.]+),\s*([\d.]+)%,\s*([\d.]+)%\)`
|
5559 | * * e.g. hsl(200, 20%, 50%)
|
5560 | * * HSLA
|
5561 | * * `hsla\((-?[\d.]+),\s*([\d.]+)%,\s*([\d.]+)%,\s*([\d.]+)\)`
|
5562 | * * e.g. hsla(200, 20%, 50%, 0.5)
|
5563 | * * Color name
|
5564 | * * Options are listed in SkParseColor.cpp
|
5565 | * * Similar to CSS Color Module Level 3 keywords, but case-sensitive.
|
5566 | * * e.g. `blueviolet` or `red`
|
5567 | *
|
5568 | * Sets the background color of the window. See Setting `backgroundColor`.
|
5569 | */
|
5570 | setBackgroundColor(backgroundColor: string): void;
|
5571 | /**
|
5572 | * This method sets the browser window's system-drawn background material,
|
5573 | * including behind the non-client area.
|
5574 | *
|
5575 | * See the Windows documentation for more details.
|
5576 | *
|
5577 | * **Note:** This method is only supported on Windows 11 22H2 and up.
|
5578 | *
|
5579 | * @platform win32
|
5580 | */
|
5581 | setBackgroundMaterial(material: 'auto' | 'none' | 'mica' | 'acrylic' | 'tabbed'): void;
|
5582 | /**
|
5583 | * Resizes and moves the window to the supplied bounds. Any properties that are not
|
5584 | * supplied will default to their current values.
|
5585 | *
|
5586 | * **Note:** On macOS, the y-coordinate value cannot be smaller than the Tray
|
5587 | * height. The tray height has changed over time and depends on the operating
|
5588 | * system, but is between 20-40px. Passing a value lower than the tray height will
|
5589 | * result in a window that is flush to the tray.
|
5590 | */
|
5591 | setBounds(bounds: Partial<Rectangle>, animate?: boolean): void;
|
5592 | /**
|
5593 | * > **Note** The `BrowserView` class is deprecated, and replaced by the new
|
5594 | * `WebContentsView` class.
|
5595 | *
|
5596 | * @experimental
|
5597 | * @deprecated
|
5598 | */
|
5599 | setBrowserView(browserView: (BrowserView) | (null)): void;
|
5600 | /**
|
5601 | * Sets whether the window can be manually closed by user. On Linux does nothing.
|
5602 | *
|
5603 | * @platform darwin,win32
|
5604 | */
|
5605 | setClosable(closable: boolean): void;
|
5606 | /**
|
5607 | * Resizes and moves the window's client area (e.g. the web page) to the supplied
|
5608 | * bounds.
|
5609 | */
|
5610 | setContentBounds(bounds: Rectangle, animate?: boolean): void;
|
5611 | /**
|
5612 | * Prevents the window contents from being captured by other apps.
|
5613 | *
|
5614 | * On macOS it sets the NSWindow's sharingType to NSWindowSharingNone. On Windows
|
5615 | * it calls SetWindowDisplayAffinity with `WDA_EXCLUDEFROMCAPTURE`. For Windows 10
|
5616 | * version 2004 and up the window will be removed from capture entirely, older
|
5617 | * Windows versions behave as if `WDA_MONITOR` is applied capturing a black window.
|
5618 | *
|
5619 | * @platform darwin,win32
|
5620 | */
|
5621 | setContentProtection(enable: boolean): void;
|
5622 | /**
|
5623 | * Resizes the window's client area (e.g. the web page) to `width` and `height`.
|
5624 | */
|
5625 | setContentSize(width: number, height: number, animate?: boolean): void;
|
5626 | /**
|
5627 | * Specifies whether the window’s document has been edited, and the icon in title
|
5628 | * bar will become gray when set to `true`.
|
5629 | *
|
5630 | * @platform darwin
|
5631 | */
|
5632 | setDocumentEdited(edited: boolean): void;
|
5633 | /**
|
5634 | * Disable or enable the window.
|
5635 | */
|
5636 | setEnabled(enable: boolean): void;
|
5637 | /**
|
5638 | * Changes whether the window can be focused.
|
5639 | *
|
5640 | * On macOS it does not remove the focus from the window.
|
5641 | *
|
5642 | * @platform darwin,win32
|
5643 | */
|
5644 | setFocusable(focusable: boolean): void;
|
5645 | /**
|
5646 | * Sets whether the window should be in fullscreen mode.
|
5647 | *
|
5648 | * **Note:** On macOS, fullscreen transitions take place asynchronously. If further
|
5649 | * actions depend on the fullscreen state, use the 'enter-full-screen' or
|
5650 | * 'leave-full-screen' events.
|
5651 | */
|
5652 | setFullScreen(flag: boolean): void;
|
5653 | /**
|
5654 | * Sets whether the maximize/zoom window button toggles fullscreen mode or
|
5655 | * maximizes the window.
|
5656 | */
|
5657 | setFullScreenable(fullscreenable: boolean): void;
|
5658 | /**
|
5659 | * Sets whether the window should have a shadow.
|
5660 | */
|
5661 | setHasShadow(hasShadow: boolean): void;
|
5662 | /**
|
5663 | * Sets whether the window will be hidden when the user toggles into mission
|
5664 | * control.
|
5665 | *
|
5666 | * @platform darwin
|
5667 | */
|
5668 | setHiddenInMissionControl(hidden: boolean): void;
|
5669 | /**
|
5670 | * Changes window icon.
|
5671 | *
|
5672 | * @platform win32,linux
|
5673 | */
|
5674 | setIcon(icon: (NativeImage) | (string)): void;
|
5675 | /**
|
5676 | * Makes the window ignore all mouse events.
|
5677 | *
|
5678 | * All mouse events happened in this window will be passed to the window below this
|
5679 | * window, but if this window has focus, it will still receive keyboard events.
|
5680 | */
|
5681 | setIgnoreMouseEvents(ignore: boolean, options?: IgnoreMouseEventsOptions): void;
|
5682 | /**
|
5683 | * Enters or leaves kiosk mode.
|
5684 | */
|
5685 | setKiosk(flag: boolean): void;
|
5686 | /**
|
5687 | * Sets whether the window can be manually maximized by user. On Linux does
|
5688 | * nothing.
|
5689 | *
|
5690 | * @platform darwin,win32
|
5691 | */
|
5692 | setMaximizable(maximizable: boolean): void;
|
5693 | /**
|
5694 | * Sets the maximum size of window to `width` and `height`.
|
5695 | */
|
5696 | setMaximumSize(width: number, height: number): void;
|
5697 | /**
|
5698 | * Sets the `menu` as the window's menu bar.
|
5699 | *
|
5700 | * @platform linux,win32
|
5701 | */
|
5702 | setMenu(menu: (Menu) | (null)): void;
|
5703 | /**
|
5704 | * Sets whether the menu bar should be visible. If the menu bar is auto-hide, users
|
5705 | * can still bring up the menu bar by pressing the single `Alt` key.
|
5706 | *
|
5707 | * @platform win32,linux
|
5708 | */
|
5709 | setMenuBarVisibility(visible: boolean): void;
|
5710 | /**
|
5711 | * Sets whether the window can be manually minimized by user. On Linux does
|
5712 | * nothing.
|
5713 | *
|
5714 | * @platform darwin,win32
|
5715 | */
|
5716 | setMinimizable(minimizable: boolean): void;
|
5717 | /**
|
5718 | * Sets the minimum size of window to `width` and `height`.
|
5719 | */
|
5720 | setMinimumSize(width: number, height: number): void;
|
5721 | /**
|
5722 | * Sets whether the window can be moved by user. On Linux does nothing.
|
5723 | *
|
5724 | * @platform darwin,win32
|
5725 | */
|
5726 | setMovable(movable: boolean): void;
|
5727 | /**
|
5728 | * Sets the opacity of the window. On Linux, does nothing. Out of bound number
|
5729 | * values are clamped to the [0, 1] range.
|
5730 | *
|
5731 | * @platform win32,darwin
|
5732 | */
|
5733 | setOpacity(opacity: number): void;
|
5734 | /**
|
5735 | * Sets a 16 x 16 pixel overlay onto the current taskbar icon, usually used to
|
5736 | * convey some sort of application status or to passively notify the user.
|
5737 | *
|
5738 | * @platform win32
|
5739 | */
|
5740 | setOverlayIcon(overlay: (NativeImage) | (null), description: string): void;
|
5741 | /**
|
5742 | * Sets `parent` as current window's parent window, passing `null` will turn
|
5743 | * current window into a top-level window.
|
5744 | */
|
5745 | setParentWindow(parent: (BrowserWindow) | (null)): void;
|
5746 | /**
|
5747 | * Moves window to `x` and `y`.
|
5748 | */
|
5749 | setPosition(x: number, y: number, animate?: boolean): void;
|
5750 | /**
|
5751 | * Sets progress value in progress bar. Valid range is [0, 1.0].
|
5752 | *
|
5753 | * Remove progress bar when progress < 0; Change to indeterminate mode when
|
5754 | * progress > 1.
|
5755 | *
|
5756 | * On Linux platform, only supports Unity desktop environment, you need to specify
|
5757 | * the `*.desktop` file name to `desktopName` field in `package.json`. By default,
|
5758 | * it will assume `{app.name}.desktop`.
|
5759 | *
|
5760 | * On Windows, a mode can be passed. Accepted values are `none`, `normal`,
|
5761 | * `indeterminate`, `error`, and `paused`. If you call `setProgressBar` without a
|
5762 | * mode set (but with a value within the valid range), `normal` will be assumed.
|
5763 | */
|
5764 | setProgressBar(progress: number, options?: ProgressBarOptions): void;
|
5765 | /**
|
5766 | * Sets the pathname of the file the window represents, and the icon of the file
|
5767 | * will show in window's title bar.
|
5768 | *
|
5769 | * @platform darwin
|
5770 | */
|
5771 | setRepresentedFilename(filename: string): void;
|
5772 | /**
|
5773 | * Sets whether the window can be manually resized by the user.
|
5774 | */
|
5775 | setResizable(resizable: boolean): void;
|
5776 | /**
|
5777 | * Setting a window shape determines the area within the window where the system
|
5778 | * permits drawing and user interaction. Outside of the given region, no pixels
|
5779 | * will be drawn and no mouse events will be registered. Mouse events outside of
|
5780 | * the region will not be received by that window, but will fall through to
|
5781 | * whatever is behind the window.
|
5782 | *
|
5783 | * @experimental
|
5784 | * @platform win32,linux
|
5785 | */
|
5786 | setShape(rects: Rectangle[]): void;
|
5787 | /**
|
5788 | * Changes the attachment point for sheets on macOS. By default, sheets are
|
5789 | * attached just below the window frame, but you may want to display them beneath a
|
5790 | * HTML-rendered toolbar. For example:
|
5791 | *
|
5792 | * @platform darwin
|
5793 | */
|
5794 | setSheetOffset(offsetY: number, offsetX?: number): void;
|
5795 | /**
|
5796 | * Enters or leaves simple fullscreen mode.
|
5797 | *
|
5798 | * Simple fullscreen mode emulates the native fullscreen behavior found in versions
|
5799 | * of macOS prior to Lion (10.7).
|
5800 | *
|
5801 | * @platform darwin
|
5802 | */
|
5803 | setSimpleFullScreen(flag: boolean): void;
|
5804 | /**
|
5805 | * Resizes the window to `width` and `height`. If `width` or `height` are below any
|
5806 | * set minimum size constraints the window will snap to its minimum size.
|
5807 | */
|
5808 | setSize(width: number, height: number, animate?: boolean): void;
|
5809 | /**
|
5810 | * Makes the window not show in the taskbar.
|
5811 | *
|
5812 | * @platform darwin,win32
|
5813 | */
|
5814 | setSkipTaskbar(skip: boolean): void;
|
5815 | /**
|
5816 | * Whether the buttons were added successfully
|
5817 | *
|
5818 | * Add a thumbnail toolbar with a specified set of buttons to the thumbnail image
|
5819 | * of a window in a taskbar button layout. Returns a `boolean` object indicates
|
5820 | * whether the thumbnail has been added successfully.
|
5821 | *
|
5822 | * The number of buttons in thumbnail toolbar should be no greater than 7 due to
|
5823 | * the limited room. Once you setup the thumbnail toolbar, the toolbar cannot be
|
5824 | * removed due to the platform's limitation. But you can call the API with an empty
|
5825 | * array to clean the buttons.
|
5826 | *
|
5827 | * The `buttons` is an array of `Button` objects:
|
5828 | *
|
5829 | * * `Button` Object
|
5830 | * * `icon` NativeImage - The icon showing in thumbnail toolbar.
|
5831 | * * `click` Function
|
5832 | * * `tooltip` string (optional) - The text of the button's tooltip.
|
5833 | * * `flags` string[] (optional) - Control specific states and behaviors of the
|
5834 | * button. By default, it is `['enabled']`.
|
5835 | *
|
5836 | * The `flags` is an array that can include following `string`s:
|
5837 | *
|
5838 | * * `enabled` - The button is active and available to the user.
|
5839 | * * `disabled` - The button is disabled. It is present, but has a visual state
|
5840 | * indicating it will not respond to user action.
|
5841 | * * `dismissonclick` - When the button is clicked, the thumbnail window closes
|
5842 | * immediately.
|
5843 | * * `nobackground` - Do not draw a button border, use only the image.
|
5844 | * * `hidden` - The button is not shown to the user.
|
5845 | * * `noninteractive` - The button is enabled but not interactive; no pressed
|
5846 | * button state is drawn. This value is intended for instances where the button is
|
5847 | * used in a notification.
|
5848 | *
|
5849 | * @platform win32
|
5850 | */
|
5851 | setThumbarButtons(buttons: ThumbarButton[]): boolean;
|
5852 | /**
|
5853 | * Sets the region of the window to show as the thumbnail image displayed when
|
5854 | * hovering over the window in the taskbar. You can reset the thumbnail to be the
|
5855 | * entire window by specifying an empty region: `{ x: 0, y: 0, width: 0, height: 0
|
5856 | * }`.
|
5857 | *
|
5858 | * @platform win32
|
5859 | */
|
5860 | setThumbnailClip(region: Rectangle): void;
|
5861 | /**
|
5862 | * Sets the toolTip that is displayed when hovering over the window thumbnail in
|
5863 | * the taskbar.
|
5864 | *
|
5865 | * @platform win32
|
5866 | */
|
5867 | setThumbnailToolTip(toolTip: string): void;
|
5868 | /**
|
5869 | * Changes the title of native window to `title`.
|
5870 | */
|
5871 | setTitle(title: string): void;
|
5872 | /**
|
5873 | * On a window with Window Controls Overlay already enabled, this method updates
|
5874 | * the style of the title bar overlay.
|
5875 | *
|
5876 | * On Linux, the `symbolColor` is automatically calculated to have minimum
|
5877 | * accessible contrast to the `color` if not explicitly set.
|
5878 | *
|
5879 | * @platform win32,linux
|
5880 | */
|
5881 | setTitleBarOverlay(options: TitleBarOverlayOptions): void;
|
5882 | /**
|
5883 | * Raises `browserView` above other `BrowserView`s attached to `win`. Throws an
|
5884 | * error if `browserView` is not attached to `win`.
|
5885 | *
|
5886 | * > **Note** The `BrowserView` class is deprecated, and replaced by the new
|
5887 | * `WebContentsView` class.
|
5888 | *
|
5889 | * @experimental
|
5890 | * @deprecated
|
5891 | */
|
5892 | setTopBrowserView(browserView: BrowserView): void;
|
5893 | /**
|
5894 | * Sets the touchBar layout for the current window. Specifying `null` or
|
5895 | * `undefined` clears the touch bar. This method only has an effect if the machine
|
5896 | * has a touch bar.
|
5897 | *
|
5898 | * **Note:** The TouchBar API is currently experimental and may change or be
|
5899 | * removed in future Electron releases.
|
5900 | *
|
5901 | * @platform darwin
|
5902 | */
|
5903 | setTouchBar(touchBar: (TouchBar) | (null)): void;
|
5904 | /**
|
5905 | * Adds a vibrancy effect to the browser window. Passing `null` or an empty string
|
5906 | * will remove the vibrancy effect on the window.
|
5907 | *
|
5908 | * @platform darwin
|
5909 | */
|
5910 | setVibrancy(type: (('titlebar' | 'selection' | 'menu' | 'popover' | 'sidebar' | 'header' | 'sheet' | 'window' | 'hud' | 'fullscreen-ui' | 'tooltip' | 'content' | 'under-window' | 'under-page')) | (null)): void;
|
5911 | /**
|
5912 | * Sets whether the window should be visible on all workspaces.
|
5913 | *
|
5914 | * **Note:** This API does nothing on Windows.
|
5915 | *
|
5916 | * @platform darwin,linux
|
5917 | */
|
5918 | setVisibleOnAllWorkspaces(visible: boolean, options?: VisibleOnAllWorkspacesOptions): void;
|
5919 | /**
|
5920 | * Set a custom position for the traffic light buttons in frameless window. Passing
|
5921 | * `null` will reset the position to default.
|
5922 | *
|
5923 | * @platform darwin
|
5924 | */
|
5925 | setWindowButtonPosition(position: (Point) | (null)): void;
|
5926 | /**
|
5927 | * Sets whether the window traffic light buttons should be visible.
|
5928 | *
|
5929 | * @platform darwin
|
5930 | */
|
5931 | setWindowButtonVisibility(visible: boolean): void;
|
5932 | /**
|
5933 | * Shows and gives focus to the window.
|
5934 | */
|
5935 | show(): void;
|
5936 | /**
|
5937 | * Shows or hides the tab overview when native tabs are enabled.
|
5938 | *
|
5939 | * @platform darwin
|
5940 | */
|
5941 | showAllTabs(): void;
|
5942 | /**
|
5943 | * Same as `webContents.showDefinitionForSelection()`.
|
5944 | *
|
5945 | * @platform darwin
|
5946 | */
|
5947 | showDefinitionForSelection(): void;
|
5948 | /**
|
5949 | * Shows the window but doesn't focus on it.
|
5950 | */
|
5951 | showInactive(): void;
|
5952 | /**
|
5953 | * Toggles the visibility of the tab bar if native tabs are enabled and there is
|
5954 | * only one tab in the current window.
|
5955 | *
|
5956 | * @platform darwin
|
5957 | */
|
5958 | toggleTabBar(): void;
|
5959 | /**
|
5960 | * Unhooks all of the window messages.
|
5961 | *
|
5962 | * @platform win32
|
5963 | */
|
5964 | unhookAllWindowMessages(): void;
|
5965 | /**
|
5966 | * Unhook the window message.
|
5967 | *
|
5968 | * @platform win32
|
5969 | */
|
5970 | unhookWindowMessage(message: number): void;
|
5971 | /**
|
5972 | * Unmaximizes the window.
|
5973 | */
|
5974 | unmaximize(): void;
|
5975 | /**
|
5976 | * A `string` property that defines an alternative title provided only to
|
5977 | * accessibility tools such as screen readers. This string is not directly visible
|
5978 | * to users.
|
5979 | */
|
5980 | accessibleTitle: string;
|
5981 | /**
|
5982 | * A `boolean` property that determines whether the window menu bar should hide
|
5983 | * itself automatically. Once set, the menu bar will only show when users press the
|
5984 | * single `Alt` key.
|
5985 | *
|
5986 | * If the menu bar is already visible, setting this property to `true` won't hide
|
5987 | * it immediately.
|
5988 | */
|
5989 | autoHideMenuBar: boolean;
|
5990 | /**
|
5991 | * A `boolean` property that determines whether the window can be manually closed
|
5992 | * by user.
|
5993 | *
|
5994 | * On Linux the setter is a no-op, although the getter returns `true`.
|
5995 | *
|
5996 | * @platform darwin,win32
|
5997 | */
|
5998 | closable: boolean;
|
5999 | /**
|
6000 | * A `boolean` property that specifies whether the window’s document has been
|
6001 | * edited.
|
6002 | *
|
6003 | * The icon in title bar will become gray when set to `true`.
|
6004 | *
|
6005 | * @platform darwin
|
6006 | */
|
6007 | documentEdited: boolean;
|
6008 | /**
|
6009 | * A `boolean` property that determines whether the window is excluded from the
|
6010 | * application’s Windows menu. `false` by default.
|
6011 | *
|
6012 | * @platform darwin
|
6013 | */
|
6014 | excludedFromShownWindowsMenu: boolean;
|
6015 | /**
|
6016 | * A `boolean` property that determines whether the window is focusable.
|
6017 | *
|
6018 | * @platform win32,darwin
|
6019 | */
|
6020 | focusable: boolean;
|
6021 | /**
|
6022 | * A `boolean` property that determines whether the window is in fullscreen mode.
|
6023 | */
|
6024 | fullScreen: boolean;
|
6025 | /**
|
6026 | * A `boolean` property that determines whether the maximize/zoom window button
|
6027 | * toggles fullscreen mode or maximizes the window.
|
6028 | */
|
6029 | fullScreenable: boolean;
|
6030 | /**
|
6031 | * A `Integer` property representing the unique ID of the window. Each ID is unique
|
6032 | * among all `BrowserWindow` instances of the entire Electron application.
|
6033 | *
|
6034 | */
|
6035 | readonly id: number;
|
6036 | /**
|
6037 | * A `boolean` property that determines whether the window is in kiosk mode.
|
6038 | */
|
6039 | kiosk: boolean;
|
6040 | /**
|
6041 | * A `boolean` property that determines whether the window can be manually
|
6042 | * maximized by user.
|
6043 | *
|
6044 | * On Linux the setter is a no-op, although the getter returns `true`.
|
6045 | *
|
6046 | * @platform darwin,win32
|
6047 | */
|
6048 | maximizable: boolean;
|
6049 | /**
|
6050 | * A `boolean` property that determines whether the menu bar should be visible.
|
6051 | *
|
6052 | * **Note:** If the menu bar is auto-hide, users can still bring up the menu bar by
|
6053 | * pressing the single `Alt` key.
|
6054 | *
|
6055 | * @platform win32,linux
|
6056 | */
|
6057 | menuBarVisible: boolean;
|
6058 | /**
|
6059 | * A `boolean` property that determines whether the window can be manually
|
6060 | * minimized by user.
|
6061 | *
|
6062 | * On Linux the setter is a no-op, although the getter returns `true`.
|
6063 | *
|
6064 | * @platform darwin,win32
|
6065 | */
|
6066 | minimizable: boolean;
|
6067 | /**
|
6068 | * A `boolean` property that determines Whether the window can be moved by user.
|
6069 | *
|
6070 | * On Linux the setter is a no-op, although the getter returns `true`.
|
6071 | *
|
6072 | * @platform darwin,win32
|
6073 | */
|
6074 | movable: boolean;
|
6075 | /**
|
6076 | * A `string` property that determines the pathname of the file the window
|
6077 | * represents, and the icon of the file will show in window's title bar.
|
6078 | *
|
6079 | * @platform darwin
|
6080 | */
|
6081 | representedFilename: string;
|
6082 | /**
|
6083 | * A `boolean` property that determines whether the window can be manually resized
|
6084 | * by user.
|
6085 | */
|
6086 | resizable: boolean;
|
6087 | /**
|
6088 | * A `boolean` property that determines whether the window has a shadow.
|
6089 | */
|
6090 | shadow: boolean;
|
6091 | /**
|
6092 | * A `boolean` property that determines whether the window is in simple (pre-Lion)
|
6093 | * fullscreen mode.
|
6094 | */
|
6095 | simpleFullScreen: boolean;
|
6096 | /**
|
6097 | * A `string` (optional) property that is equal to the `tabbingIdentifier` passed
|
6098 | * to the `BrowserWindow` constructor or `undefined` if none was set.
|
6099 | *
|
6100 | * @platform darwin
|
6101 | */
|
6102 | readonly tabbingIdentifier?: string;
|
6103 | /**
|
6104 | * A `string` property that determines the title of the native window.
|
6105 | *
|
6106 | * **Note:** The title of the web page can be different from the title of the
|
6107 | * native window.
|
6108 | */
|
6109 | title: string;
|
6110 | /**
|
6111 | * A `boolean` property that determines whether the window is visible on all
|
6112 | * workspaces.
|
6113 | *
|
6114 | * **Note:** Always returns false on Windows.
|
6115 | *
|
6116 | * @platform darwin,linux
|
6117 | */
|
6118 | visibleOnAllWorkspaces: boolean;
|
6119 | /**
|
6120 | * A `WebContents` object this window owns. All web page related events and
|
6121 | * operations will be done via it.
|
6122 | *
|
6123 | * See the `webContents` documentation for its methods and events.
|
6124 | *
|
6125 | */
|
6126 | readonly webContents: WebContents;
|
6127 | }
|
6128 |
|
6129 | interface BrowserWindowConstructorOptions extends BaseWindowConstructorOptions {
|
6130 |
|
6131 | // Docs: https://electronjs.org/docs/api/structures/browser-window-options
|
6132 |
|
6133 | /**
|
6134 | * Whether the renderer should be active when `show` is `false` and it has just
|
6135 | * been created. In order for `document.visibilityState` to work correctly on
|
6136 | * first load with `show: false` you should set this to `false`. Setting this to
|
6137 | * `false` will cause the `ready-to-show` event to not fire. Default is `true`.
|
6138 | */
|
6139 | paintWhenInitiallyHidden?: boolean;
|
6140 | /**
|
6141 | * Settings of web page's features.
|
6142 | */
|
6143 | webPreferences?: WebPreferences;
|
6144 | }
|
6145 |
|
6146 | interface Certificate {
|
6147 |
|
6148 | // Docs: https://electronjs.org/docs/api/structures/certificate
|
6149 |
|
6150 | /**
|
6151 | * PEM encoded data
|
6152 | */
|
6153 | data: string;
|
6154 | /**
|
6155 | * Fingerprint of the certificate
|
6156 | */
|
6157 | fingerprint: string;
|
6158 | /**
|
6159 | * Issuer principal
|
6160 | */
|
6161 | issuer: CertificatePrincipal;
|
6162 | /**
|
6163 | * Issuer certificate (if not self-signed)
|
6164 | */
|
6165 | issuerCert: Certificate;
|
6166 | /**
|
6167 | * Issuer's Common Name
|
6168 | */
|
6169 | issuerName: string;
|
6170 | /**
|
6171 | * Hex value represented string
|
6172 | */
|
6173 | serialNumber: string;
|
6174 | /**
|
6175 | * Subject principal
|
6176 | */
|
6177 | subject: CertificatePrincipal;
|
6178 | /**
|
6179 | * Subject's Common Name
|
6180 | */
|
6181 | subjectName: string;
|
6182 | /**
|
6183 | * End date of the certificate being valid in seconds
|
6184 | */
|
6185 | validExpiry: number;
|
6186 | /**
|
6187 | * Start date of the certificate being valid in seconds
|
6188 | */
|
6189 | validStart: number;
|
6190 | }
|
6191 |
|
6192 | interface CertificatePrincipal {
|
6193 |
|
6194 | // Docs: https://electronjs.org/docs/api/structures/certificate-principal
|
6195 |
|
6196 | /**
|
6197 | * Common Name.
|
6198 | */
|
6199 | commonName: string;
|
6200 | /**
|
6201 | * Country or region.
|
6202 | */
|
6203 | country: string;
|
6204 | /**
|
6205 | * Locality.
|
6206 | */
|
6207 | locality: string;
|
6208 | /**
|
6209 | * Organization names.
|
6210 | */
|
6211 | organizations: string[];
|
6212 | /**
|
6213 | * Organization Unit names.
|
6214 | */
|
6215 | organizationUnits: string[];
|
6216 | /**
|
6217 | * State or province.
|
6218 | */
|
6219 | state: string;
|
6220 | }
|
6221 |
|
6222 | class ClientRequest extends NodeEventEmitter {
|
6223 |
|
6224 | // Docs: https://electronjs.org/docs/api/client-request
|
6225 |
|
6226 | /**
|
6227 | * Emitted when the `request` is aborted. The `abort` event will not be fired if
|
6228 | * the `request` is already closed.
|
6229 | */
|
6230 | on(event: 'abort', listener: () => void): this;
|
6231 | off(event: 'abort', listener: () => void): this;
|
6232 | once(event: 'abort', listener: () => void): this;
|
6233 | addListener(event: 'abort', listener: () => void): this;
|
6234 | removeListener(event: 'abort', listener: () => void): this;
|
6235 | /**
|
6236 | * Emitted as the last event in the HTTP request-response transaction. The `close`
|
6237 | * event indicates that no more events will be emitted on either the `request` or
|
6238 | * `response` objects.
|
6239 | */
|
6240 | on(event: 'close', listener: () => void): this;
|
6241 | off(event: 'close', listener: () => void): this;
|
6242 | once(event: 'close', listener: () => void): this;
|
6243 | addListener(event: 'close', listener: () => void): this;
|
6244 | removeListener(event: 'close', listener: () => void): this;
|
6245 | /**
|
6246 | * Emitted when the `net` module fails to issue a network request. Typically when
|
6247 | * the `request` object emits an `error` event, a `close` event will subsequently
|
6248 | * follow and no response object will be provided.
|
6249 | */
|
6250 | on(event: 'error', listener: (
|
6251 | /**
|
6252 | * an error object providing some information about the failure.
|
6253 | */
|
6254 | error: Error) => void): this;
|
6255 | off(event: 'error', listener: (
|
6256 | /**
|
6257 | * an error object providing some information about the failure.
|
6258 | */
|
6259 | error: Error) => void): this;
|
6260 | once(event: 'error', listener: (
|
6261 | /**
|
6262 | * an error object providing some information about the failure.
|
6263 | */
|
6264 | error: Error) => void): this;
|
6265 | addListener(event: 'error', listener: (
|
6266 | /**
|
6267 | * an error object providing some information about the failure.
|
6268 | */
|
6269 | error: Error) => void): this;
|
6270 | removeListener(event: 'error', listener: (
|
6271 | /**
|
6272 | * an error object providing some information about the failure.
|
6273 | */
|
6274 | error: Error) => void): this;
|
6275 | /**
|
6276 | * Emitted just after the last chunk of the `request`'s data has been written into
|
6277 | * the `request` object.
|
6278 | */
|
6279 | on(event: 'finish', listener: () => void): this;
|
6280 | off(event: 'finish', listener: () => void): this;
|
6281 | once(event: 'finish', listener: () => void): this;
|
6282 | addListener(event: 'finish', listener: () => void): this;
|
6283 | removeListener(event: 'finish', listener: () => void): this;
|
6284 | /**
|
6285 | * Emitted when an authenticating proxy is asking for user credentials.
|
6286 | *
|
6287 | * The `callback` function is expected to be called back with user credentials:
|
6288 | *
|
6289 | * * `username` string
|
6290 | * * `password` string
|
6291 | *
|
6292 | * Providing empty credentials will cancel the request and report an authentication
|
6293 | * error on the response object:
|
6294 | */
|
6295 | on(event: 'login', listener: (authInfo: AuthInfo,
|
6296 | callback: (username?: string, password?: string) => void) => void): this;
|
6297 | off(event: 'login', listener: (authInfo: AuthInfo,
|
6298 | callback: (username?: string, password?: string) => void) => void): this;
|
6299 | once(event: 'login', listener: (authInfo: AuthInfo,
|
6300 | callback: (username?: string, password?: string) => void) => void): this;
|
6301 | addListener(event: 'login', listener: (authInfo: AuthInfo,
|
6302 | callback: (username?: string, password?: string) => void) => void): this;
|
6303 | removeListener(event: 'login', listener: (authInfo: AuthInfo,
|
6304 | callback: (username?: string, password?: string) => void) => void): this;
|
6305 | /**
|
6306 | * Emitted when the server returns a redirect response (e.g. 301 Moved
|
6307 | * Permanently). Calling `request.followRedirect` will continue with the
|
6308 | * redirection. If this event is handled, `request.followRedirect` must be called
|
6309 | * **synchronously**, otherwise the request will be cancelled.
|
6310 | */
|
6311 | on(event: 'redirect', listener: (statusCode: number,
|
6312 | method: string,
|
6313 | redirectUrl: string,
|
6314 | responseHeaders: Record<string, string[]>) => void): this;
|
6315 | off(event: 'redirect', listener: (statusCode: number,
|
6316 | method: string,
|
6317 | redirectUrl: string,
|
6318 | responseHeaders: Record<string, string[]>) => void): this;
|
6319 | once(event: 'redirect', listener: (statusCode: number,
|
6320 | method: string,
|
6321 | redirectUrl: string,
|
6322 | responseHeaders: Record<string, string[]>) => void): this;
|
6323 | addListener(event: 'redirect', listener: (statusCode: number,
|
6324 | method: string,
|
6325 | redirectUrl: string,
|
6326 | responseHeaders: Record<string, string[]>) => void): this;
|
6327 | removeListener(event: 'redirect', listener: (statusCode: number,
|
6328 | method: string,
|
6329 | redirectUrl: string,
|
6330 | responseHeaders: Record<string, string[]>) => void): this;
|
6331 | on(event: 'response', listener: (
|
6332 | /**
|
6333 | * An object representing the HTTP response message.
|
6334 | */
|
6335 | response: IncomingMessage) => void): this;
|
6336 | off(event: 'response', listener: (
|
6337 | /**
|
6338 | * An object representing the HTTP response message.
|
6339 | */
|
6340 | response: IncomingMessage) => void): this;
|
6341 | once(event: 'response', listener: (
|
6342 | /**
|
6343 | * An object representing the HTTP response message.
|
6344 | */
|
6345 | response: IncomingMessage) => void): this;
|
6346 | addListener(event: 'response', listener: (
|
6347 | /**
|
6348 | * An object representing the HTTP response message.
|
6349 | */
|
6350 | response: IncomingMessage) => void): this;
|
6351 | removeListener(event: 'response', listener: (
|
6352 | /**
|
6353 | * An object representing the HTTP response message.
|
6354 | */
|
6355 | response: IncomingMessage) => void): this;
|
6356 | /**
|
6357 | * ClientRequest
|
6358 | */
|
6359 | constructor(options: (ClientRequestConstructorOptions) | (string));
|
6360 | /**
|
6361 | * Cancels an ongoing HTTP transaction. If the request has already emitted the
|
6362 | * `close` event, the abort operation will have no effect. Otherwise an ongoing
|
6363 | * event will emit `abort` and `close` events. Additionally, if there is an ongoing
|
6364 | * response object,it will emit the `aborted` event.
|
6365 | */
|
6366 | abort(): void;
|
6367 | /**
|
6368 | * Sends the last chunk of the request data. Subsequent write or end operations
|
6369 | * will not be allowed. The `finish` event is emitted just after the end operation.
|
6370 | */
|
6371 | end(chunk?: (string) | (Buffer), encoding?: string, callback?: () => void): this;
|
6372 | /**
|
6373 | * Continues any pending redirection. Can only be called during a `'redirect'`
|
6374 | * event.
|
6375 | */
|
6376 | followRedirect(): void;
|
6377 | /**
|
6378 | * The value of a previously set extra header name.
|
6379 | */
|
6380 | getHeader(name: string): string;
|
6381 | /**
|
6382 | * * `active` boolean - Whether the request is currently active. If this is false
|
6383 | * no other properties will be set
|
6384 | * * `started` boolean - Whether the upload has started. If this is false both
|
6385 | * `current` and `total` will be set to 0.
|
6386 | * * `current` Integer - The number of bytes that have been uploaded so far
|
6387 | * * `total` Integer - The number of bytes that will be uploaded this request
|
6388 | *
|
6389 | * You can use this method in conjunction with `POST` requests to get the progress
|
6390 | * of a file upload or other data transfer.
|
6391 | */
|
6392 | getUploadProgress(): UploadProgress;
|
6393 | /**
|
6394 | * Removes a previously set extra header name. This method can be called only
|
6395 | * before first write. Trying to call it after the first write will throw an error.
|
6396 | */
|
6397 | removeHeader(name: string): void;
|
6398 | /**
|
6399 | * Adds an extra HTTP header. The header name will be issued as-is without
|
6400 | * lowercasing. It can be called only before first write. Calling this method after
|
6401 | * the first write will throw an error. If the passed value is not a `string`, its
|
6402 | * `toString()` method will be called to obtain the final value.
|
6403 | *
|
6404 | * Certain headers are restricted from being set by apps. These headers are listed
|
6405 | * below. More information on restricted headers can be found in Chromium's header
|
6406 | * utils.
|
6407 | *
|
6408 | * * `Content-Length`
|
6409 | * * `Host`
|
6410 | * * `Trailer` or `Te`
|
6411 | * * `Upgrade`
|
6412 | * * `Cookie2`
|
6413 | * * `Keep-Alive`
|
6414 | * * `Transfer-Encoding`
|
6415 | *
|
6416 | * Additionally, setting the `Connection` header to the value `upgrade` is also
|
6417 | * disallowed.
|
6418 | */
|
6419 | setHeader(name: string, value: string): void;
|
6420 | /**
|
6421 | * `callback` is essentially a dummy function introduced in the purpose of keeping
|
6422 | * similarity with the Node.js API. It is called asynchronously in the next tick
|
6423 | * after `chunk` content have been delivered to the Chromium networking layer.
|
6424 | * Contrary to the Node.js implementation, it is not guaranteed that `chunk`
|
6425 | * content have been flushed on the wire before `callback` is called.
|
6426 | *
|
6427 | * Adds a chunk of data to the request body. The first write operation may cause
|
6428 | * the request headers to be issued on the wire. After the first write operation,
|
6429 | * it is not allowed to add or remove a custom header.
|
6430 | */
|
6431 | write(chunk: (string) | (Buffer), encoding?: string, callback?: () => void): void;
|
6432 | /**
|
6433 | * A `boolean` specifying whether the request will use HTTP chunked transfer
|
6434 | * encoding or not. Defaults to false. The property is readable and writable,
|
6435 | * however it can be set only before the first write operation as the HTTP headers
|
6436 | * are not yet put on the wire. Trying to set the `chunkedEncoding` property after
|
6437 | * the first write will throw an error.
|
6438 | *
|
6439 | * Using chunked encoding is strongly recommended if you need to send a large
|
6440 | * request body as data will be streamed in small chunks instead of being
|
6441 | * internally buffered inside Electron process memory.
|
6442 | */
|
6443 | chunkedEncoding: boolean;
|
6444 | }
|
6445 |
|
6446 | interface Clipboard {
|
6447 |
|
6448 | // Docs: https://electronjs.org/docs/api/clipboard
|
6449 |
|
6450 | /**
|
6451 | * An array of supported formats for the clipboard `type`.
|
6452 | */
|
6453 | availableFormats(type?: 'selection' | 'clipboard'): string[];
|
6454 | /**
|
6455 | * Clears the clipboard content.
|
6456 | */
|
6457 | clear(type?: 'selection' | 'clipboard'): void;
|
6458 | /**
|
6459 | * Whether the clipboard supports the specified `format`.
|
6460 | *
|
6461 | * @experimental
|
6462 | */
|
6463 | has(format: string, type?: 'selection' | 'clipboard'): boolean;
|
6464 | /**
|
6465 | * Reads `format` type from the clipboard.
|
6466 | *
|
6467 | * `format` should contain valid ASCII characters and have `/` separator. `a/c`,
|
6468 | * `a/bc` are valid formats while `/abc`, `abc/`, `a/`, `/a`, `a` are not valid.
|
6469 | *
|
6470 | * @experimental
|
6471 | */
|
6472 | read(format: string): string;
|
6473 | /**
|
6474 | * * `title` string
|
6475 | * * `url` string
|
6476 | *
|
6477 | * Returns an Object containing `title` and `url` keys representing the bookmark in
|
6478 | * the clipboard. The `title` and `url` values will be empty strings when the
|
6479 | * bookmark is unavailable. The `title` value will always be empty on Windows.
|
6480 | *
|
6481 | * @platform darwin,win32
|
6482 | */
|
6483 | readBookmark(): ReadBookmark;
|
6484 | /**
|
6485 | * Reads `format` type from the clipboard.
|
6486 | *
|
6487 | * @experimental
|
6488 | */
|
6489 | readBuffer(format: string): Buffer;
|
6490 | /**
|
6491 | * The text on the find pasteboard, which is the pasteboard that holds information
|
6492 | * about the current state of the active application’s find panel.
|
6493 | *
|
6494 | * This method uses synchronous IPC when called from the renderer process. The
|
6495 | * cached value is reread from the find pasteboard whenever the application is
|
6496 | * activated.
|
6497 | *
|
6498 | * @platform darwin
|
6499 | */
|
6500 | readFindText(): string;
|
6501 | /**
|
6502 | * The content in the clipboard as markup.
|
6503 | */
|
6504 | readHTML(type?: 'selection' | 'clipboard'): string;
|
6505 | /**
|
6506 | * The image content in the clipboard.
|
6507 | */
|
6508 | readImage(type?: 'selection' | 'clipboard'): NativeImage;
|
6509 | /**
|
6510 | * The content in the clipboard as RTF.
|
6511 | */
|
6512 | readRTF(type?: 'selection' | 'clipboard'): string;
|
6513 | /**
|
6514 | * The content in the clipboard as plain text.
|
6515 | */
|
6516 | readText(type?: 'selection' | 'clipboard'): string;
|
6517 | /**
|
6518 | * Writes `data` to the clipboard.
|
6519 | */
|
6520 | write(data: Data, type?: 'selection' | 'clipboard'): void;
|
6521 | /**
|
6522 | * Writes the `title` (macOS only) and `url` into the clipboard as a bookmark.
|
6523 | *
|
6524 | * **Note:** Most apps on Windows don't support pasting bookmarks into them so you
|
6525 | * can use `clipboard.write` to write both a bookmark and fallback text to the
|
6526 | * clipboard.
|
6527 | *
|
6528 | * @platform darwin,win32
|
6529 | */
|
6530 | writeBookmark(title: string, url: string, type?: 'selection' | 'clipboard'): void;
|
6531 | /**
|
6532 | * Writes the `buffer` into the clipboard as `format`.
|
6533 | *
|
6534 | * @experimental
|
6535 | */
|
6536 | writeBuffer(format: string, buffer: Buffer, type?: 'selection' | 'clipboard'): void;
|
6537 | /**
|
6538 | * Writes the `text` into the find pasteboard (the pasteboard that holds
|
6539 | * information about the current state of the active application’s find panel) as
|
6540 | * plain text. This method uses synchronous IPC when called from the renderer
|
6541 | * process.
|
6542 | *
|
6543 | * @platform darwin
|
6544 | */
|
6545 | writeFindText(text: string): void;
|
6546 | /**
|
6547 | * Writes `markup` to the clipboard.
|
6548 | */
|
6549 | writeHTML(markup: string, type?: 'selection' | 'clipboard'): void;
|
6550 | /**
|
6551 | * Writes `image` to the clipboard.
|
6552 | */
|
6553 | writeImage(image: NativeImage, type?: 'selection' | 'clipboard'): void;
|
6554 | /**
|
6555 | * Writes the `text` into the clipboard in RTF.
|
6556 | */
|
6557 | writeRTF(text: string, type?: 'selection' | 'clipboard'): void;
|
6558 | /**
|
6559 | * Writes the `text` into the clipboard as plain text.
|
6560 | */
|
6561 | writeText(text: string, type?: 'selection' | 'clipboard'): void;
|
6562 | }
|
6563 |
|
6564 | class CommandLine {
|
6565 |
|
6566 | // Docs: https://electronjs.org/docs/api/command-line
|
6567 |
|
6568 | /**
|
6569 | * Append an argument to Chromium's command line. The argument will be quoted
|
6570 | * correctly. Switches will precede arguments regardless of appending order.
|
6571 | *
|
6572 | * If you're appending an argument like `--switch=value`, consider using
|
6573 | * `appendSwitch('switch', 'value')` instead.
|
6574 | *
|
6575 | * **Note:** This will not affect `process.argv`. The intended usage of this
|
6576 | * function is to control Chromium's behavior.
|
6577 | */
|
6578 | appendArgument(value: string): void;
|
6579 | /**
|
6580 | * Append a switch (with optional `value`) to Chromium's command line.
|
6581 | *
|
6582 | * **Note:** This will not affect `process.argv`. The intended usage of this
|
6583 | * function is to control Chromium's behavior.
|
6584 | */
|
6585 | appendSwitch(the_switch: string, value?: string): void;
|
6586 | /**
|
6587 | * The command-line switch value.
|
6588 | *
|
6589 | * **Note:** When the switch is not present or has no value, it returns empty
|
6590 | * string.
|
6591 | */
|
6592 | getSwitchValue(the_switch: string): string;
|
6593 | /**
|
6594 | * Whether the command-line switch is present.
|
6595 | */
|
6596 | hasSwitch(the_switch: string): boolean;
|
6597 | /**
|
6598 | * Removes the specified switch from Chromium's command line.
|
6599 | *
|
6600 | * **Note:** This will not affect `process.argv`. The intended usage of this
|
6601 | * function is to control Chromium's behavior.
|
6602 | */
|
6603 | removeSwitch(the_switch: string): void;
|
6604 | }
|
6605 |
|
6606 | interface ContentTracing {
|
6607 |
|
6608 | // Docs: https://electronjs.org/docs/api/content-tracing
|
6609 |
|
6610 | /**
|
6611 | * resolves with an array of category groups once all child processes have
|
6612 | * acknowledged the `getCategories` request
|
6613 | *
|
6614 | * Get a set of category groups. The category groups can change as new code paths
|
6615 | * are reached. See also the list of built-in tracing categories.
|
6616 | *
|
6617 | * > **NOTE:** Electron adds a non-default tracing category called `"electron"`.
|
6618 | * This category can be used to capture Electron-specific tracing events.
|
6619 | */
|
6620 | getCategories(): Promise<string[]>;
|
6621 | /**
|
6622 | * Resolves with an object containing the `value` and `percentage` of trace buffer
|
6623 | * maximum usage
|
6624 | *
|
6625 | * * `value` number
|
6626 | * * `percentage` number
|
6627 | *
|
6628 | * Get the maximum usage across processes of trace buffer as a percentage of the
|
6629 | * full state.
|
6630 | */
|
6631 | getTraceBufferUsage(): Promise<Electron.TraceBufferUsageReturnValue>;
|
6632 | /**
|
6633 | * resolved once all child processes have acknowledged the `startRecording`
|
6634 | * request.
|
6635 | *
|
6636 | * Start recording on all processes.
|
6637 | *
|
6638 | * Recording begins immediately locally and asynchronously on child processes as
|
6639 | * soon as they receive the EnableRecording request.
|
6640 | *
|
6641 | * If a recording is already running, the promise will be immediately resolved, as
|
6642 | * only one trace operation can be in progress at a time.
|
6643 | */
|
6644 | startRecording(options: (TraceConfig) | (TraceCategoriesAndOptions)): Promise<void>;
|
6645 | /**
|
6646 | * resolves with a path to a file that contains the traced data once all child
|
6647 | * processes have acknowledged the `stopRecording` request
|
6648 | *
|
6649 | * Stop recording on all processes.
|
6650 | *
|
6651 | * Child processes typically cache trace data and only rarely flush and send trace
|
6652 | * data back to the main process. This helps to minimize the runtime overhead of
|
6653 | * tracing since sending trace data over IPC can be an expensive operation. So, to
|
6654 | * end tracing, Chromium asynchronously asks all child processes to flush any
|
6655 | * pending trace data.
|
6656 | *
|
6657 | * Trace data will be written into `resultFilePath`. If `resultFilePath` is empty
|
6658 | * or not provided, trace data will be written to a temporary file, and the path
|
6659 | * will be returned in the promise.
|
6660 | */
|
6661 | stopRecording(resultFilePath?: string): Promise<string>;
|
6662 | }
|
6663 |
|
6664 | interface ContextBridge {
|
6665 |
|
6666 | // Docs: https://electronjs.org/docs/api/context-bridge
|
6667 |
|
6668 | exposeInIsolatedWorld(worldId: number, apiKey: string, api: any): void;
|
6669 | exposeInMainWorld(apiKey: string, api: any): void;
|
6670 | }
|
6671 |
|
6672 | interface Cookie {
|
6673 |
|
6674 | // Docs: https://electronjs.org/docs/api/structures/cookie
|
6675 |
|
6676 | /**
|
6677 | * The domain of the cookie; this will be normalized with a preceding dot so that
|
6678 | * it's also valid for subdomains.
|
6679 | */
|
6680 | domain?: string;
|
6681 | /**
|
6682 | * The expiration date of the cookie as the number of seconds since the UNIX epoch.
|
6683 | * Not provided for session cookies.
|
6684 | */
|
6685 | expirationDate?: number;
|
6686 | /**
|
6687 | * Whether the cookie is a host-only cookie; this will only be `true` if no domain
|
6688 | * was passed.
|
6689 | */
|
6690 | hostOnly?: boolean;
|
6691 | /**
|
6692 | * Whether the cookie is marked as HTTP only.
|
6693 | */
|
6694 | httpOnly?: boolean;
|
6695 | /**
|
6696 | * The name of the cookie.
|
6697 | */
|
6698 | name: string;
|
6699 | /**
|
6700 | * The path of the cookie.
|
6701 | */
|
6702 | path?: string;
|
6703 | /**
|
6704 | * The Same Site policy applied to this cookie. Can be `unspecified`,
|
6705 | * `no_restriction`, `lax` or `strict`.
|
6706 | */
|
6707 | sameSite: ('unspecified' | 'no_restriction' | 'lax' | 'strict');
|
6708 | /**
|
6709 | * Whether the cookie is marked as secure.
|
6710 | */
|
6711 | secure?: boolean;
|
6712 | /**
|
6713 | * Whether the cookie is a session cookie or a persistent cookie with an expiration
|
6714 | * date.
|
6715 | */
|
6716 | session?: boolean;
|
6717 | /**
|
6718 | * The value of the cookie.
|
6719 | */
|
6720 | value: string;
|
6721 | }
|
6722 |
|
6723 | class Cookies extends NodeEventEmitter {
|
6724 |
|
6725 | // Docs: https://electronjs.org/docs/api/cookies
|
6726 |
|
6727 | /**
|
6728 | * Emitted when a cookie is changed because it was added, edited, removed, or
|
6729 | * expired.
|
6730 | */
|
6731 | on(event: 'changed', listener: (event: Event,
|
6732 | /**
|
6733 | * The cookie that was changed.
|
6734 | */
|
6735 | cookie: Cookie,
|
6736 | /**
|
6737 | * The cause of the change with one of the following values:
|
6738 | */
|
6739 | cause: ('explicit' | 'overwrite' | 'expired' | 'evicted' | 'expired-overwrite'),
|
6740 | /**
|
6741 | * `true` if the cookie was removed, `false` otherwise.
|
6742 | */
|
6743 | removed: boolean) => void): this;
|
6744 | off(event: 'changed', listener: (event: Event,
|
6745 | /**
|
6746 | * The cookie that was changed.
|
6747 | */
|
6748 | cookie: Cookie,
|
6749 | /**
|
6750 | * The cause of the change with one of the following values:
|
6751 | */
|
6752 | cause: ('explicit' | 'overwrite' | 'expired' | 'evicted' | 'expired-overwrite'),
|
6753 | /**
|
6754 | * `true` if the cookie was removed, `false` otherwise.
|
6755 | */
|
6756 | removed: boolean) => void): this;
|
6757 | once(event: 'changed', listener: (event: Event,
|
6758 | /**
|
6759 | * The cookie that was changed.
|
6760 | */
|
6761 | cookie: Cookie,
|
6762 | /**
|
6763 | * The cause of the change with one of the following values:
|
6764 | */
|
6765 | cause: ('explicit' | 'overwrite' | 'expired' | 'evicted' | 'expired-overwrite'),
|
6766 | /**
|
6767 | * `true` if the cookie was removed, `false` otherwise.
|
6768 | */
|
6769 | removed: boolean) => void): this;
|
6770 | addListener(event: 'changed', listener: (event: Event,
|
6771 | /**
|
6772 | * The cookie that was changed.
|
6773 | */
|
6774 | cookie: Cookie,
|
6775 | /**
|
6776 | * The cause of the change with one of the following values:
|
6777 | */
|
6778 | cause: ('explicit' | 'overwrite' | 'expired' | 'evicted' | 'expired-overwrite'),
|
6779 | /**
|
6780 | * `true` if the cookie was removed, `false` otherwise.
|
6781 | */
|
6782 | removed: boolean) => void): this;
|
6783 | removeListener(event: 'changed', listener: (event: Event,
|
6784 | /**
|
6785 | * The cookie that was changed.
|
6786 | */
|
6787 | cookie: Cookie,
|
6788 | /**
|
6789 | * The cause of the change with one of the following values:
|
6790 | */
|
6791 | cause: ('explicit' | 'overwrite' | 'expired' | 'evicted' | 'expired-overwrite'),
|
6792 | /**
|
6793 | * `true` if the cookie was removed, `false` otherwise.
|
6794 | */
|
6795 | removed: boolean) => void): this;
|
6796 | /**
|
6797 | * A promise which resolves when the cookie store has been flushed
|
6798 | *
|
6799 | * Writes any unwritten cookies data to disk
|
6800 | *
|
6801 | * Cookies written by any method will not be written to disk immediately, but will
|
6802 | * be written every 30 seconds or 512 operations
|
6803 | *
|
6804 | * Calling this method can cause the cookie to be written to disk immediately.
|
6805 | */
|
6806 | flushStore(): Promise<void>;
|
6807 | /**
|
6808 | * A promise which resolves an array of cookie objects.
|
6809 | *
|
6810 | * Sends a request to get all cookies matching `filter`, and resolves a promise
|
6811 | * with the response.
|
6812 | */
|
6813 | get(filter: CookiesGetFilter): Promise<Electron.Cookie[]>;
|
6814 | /**
|
6815 | * A promise which resolves when the cookie has been removed
|
6816 | *
|
6817 | * Removes the cookies matching `url` and `name`
|
6818 | */
|
6819 | remove(url: string, name: string): Promise<void>;
|
6820 | /**
|
6821 | * A promise which resolves when the cookie has been set
|
6822 | *
|
6823 | * Sets a cookie with `details`.
|
6824 | */
|
6825 | set(details: CookiesSetDetails): Promise<void>;
|
6826 | }
|
6827 |
|
6828 | interface CPUUsage {
|
6829 |
|
6830 | // Docs: https://electronjs.org/docs/api/structures/cpu-usage
|
6831 |
|
6832 | /**
|
6833 | * Total seconds of CPU time used since process startup.
|
6834 | */
|
6835 | cumulativeCPUUsage?: number;
|
6836 | /**
|
6837 | * The number of average idle CPU wakeups per second since the last call to
|
6838 | * getCPUUsage. First call returns 0. Will always return 0 on Windows.
|
6839 | */
|
6840 | idleWakeupsPerSecond: number;
|
6841 | /**
|
6842 | * Percentage of CPU used since the last call to getCPUUsage. First call returns 0.
|
6843 | */
|
6844 | percentCPUUsage: number;
|
6845 | }
|
6846 |
|
6847 | interface CrashReport {
|
6848 |
|
6849 | // Docs: https://electronjs.org/docs/api/structures/crash-report
|
6850 |
|
6851 | date: Date;
|
6852 | id: string;
|
6853 | }
|
6854 |
|
6855 | interface CrashReporter {
|
6856 |
|
6857 | // Docs: https://electronjs.org/docs/api/crash-reporter
|
6858 |
|
6859 | /**
|
6860 | * Set an extra parameter to be sent with the crash report. The values specified
|
6861 | * here will be sent in addition to any values set via the `extra` option when
|
6862 | * `start` was called.
|
6863 | *
|
6864 | * Parameters added in this fashion (or via the `extra` parameter to
|
6865 | * `crashReporter.start`) are specific to the calling process. Adding extra
|
6866 | * parameters in the main process will not cause those parameters to be sent along
|
6867 | * with crashes from renderer or other child processes. Similarly, adding extra
|
6868 | * parameters in a renderer process will not result in those parameters being sent
|
6869 | * with crashes that occur in other renderer processes or in the main process.
|
6870 | *
|
6871 | * **Note:** Parameters have limits on the length of the keys and values. Key names
|
6872 | * must be no longer than 39 bytes, and values must be no longer than 20320 bytes.
|
6873 | * Keys with names longer than the maximum will be silently ignored. Key values
|
6874 | * longer than the maximum length will be truncated.
|
6875 | */
|
6876 | addExtraParameter(key: string, value: string): void;
|
6877 | /**
|
6878 | * The date and ID of the last crash report. Only crash reports that have been
|
6879 | * uploaded will be returned; even if a crash report is present on disk it will not
|
6880 | * be returned until it is uploaded. In the case that there are no uploaded
|
6881 | * reports, `null` is returned.
|
6882 | *
|
6883 | * **Note:** This method is only available in the main process.
|
6884 | */
|
6885 | getLastCrashReport(): (CrashReport) | (null);
|
6886 | /**
|
6887 | * The current 'extra' parameters of the crash reporter.
|
6888 | */
|
6889 | getParameters(): Record<string, string>;
|
6890 | /**
|
6891 | * Returns all uploaded crash reports. Each report contains the date and uploaded
|
6892 | * ID.
|
6893 | *
|
6894 | * **Note:** This method is only available in the main process.
|
6895 | */
|
6896 | getUploadedReports(): CrashReport[];
|
6897 | /**
|
6898 | * Whether reports should be submitted to the server. Set through the `start`
|
6899 | * method or `setUploadToServer`.
|
6900 | *
|
6901 | * **Note:** This method is only available in the main process.
|
6902 | */
|
6903 | getUploadToServer(): boolean;
|
6904 | /**
|
6905 | * Remove an extra parameter from the current set of parameters. Future crashes
|
6906 | * will not include this parameter.
|
6907 | */
|
6908 | removeExtraParameter(key: string): void;
|
6909 | /**
|
6910 | * This would normally be controlled by user preferences. This has no effect if
|
6911 | * called before `start` is called.
|
6912 | *
|
6913 | * **Note:** This method is only available in the main process.
|
6914 | */
|
6915 | setUploadToServer(uploadToServer: boolean): void;
|
6916 | /**
|
6917 | * This method must be called before using any other `crashReporter` APIs. Once
|
6918 | * initialized this way, the crashpad handler collects crashes from all
|
6919 | * subsequently created processes. The crash reporter cannot be disabled once
|
6920 | * started.
|
6921 | *
|
6922 | * This method should be called as early as possible in app startup, preferably
|
6923 | * before `app.on('ready')`. If the crash reporter is not initialized at the time a
|
6924 | * renderer process is created, then that renderer process will not be monitored by
|
6925 | * the crash reporter.
|
6926 | *
|
6927 | * **Note:** You can test out the crash reporter by generating a crash using
|
6928 | * `process.crash()`.
|
6929 | *
|
6930 | * **Note:** If you need to send additional/updated `extra` parameters after your
|
6931 | * first call `start` you can call `addExtraParameter`.
|
6932 | *
|
6933 | * **Note:** Parameters passed in `extra`, `globalExtra` or set with
|
6934 | * `addExtraParameter` have limits on the length of the keys and values. Key names
|
6935 | * must be at most 39 bytes long, and values must be no longer than 127 bytes. Keys
|
6936 | * with names longer than the maximum will be silently ignored. Key values longer
|
6937 | * than the maximum length will be truncated.
|
6938 | *
|
6939 | * **Note:** This method is only available in the main process.
|
6940 | */
|
6941 | start(options: CrashReporterStartOptions): void;
|
6942 | }
|
6943 |
|
6944 | interface CustomScheme {
|
6945 |
|
6946 | // Docs: https://electronjs.org/docs/api/structures/custom-scheme
|
6947 |
|
6948 | privileges?: Privileges;
|
6949 | /**
|
6950 | * Custom schemes to be registered with options.
|
6951 | */
|
6952 | scheme: string;
|
6953 | }
|
6954 |
|
6955 | class Debugger extends NodeEventEmitter {
|
6956 |
|
6957 | // Docs: https://electronjs.org/docs/api/debugger
|
6958 |
|
6959 | /**
|
6960 | * Emitted when the debugging session is terminated. This happens either when
|
6961 | * `webContents` is closed or devtools is invoked for the attached `webContents`.
|
6962 | */
|
6963 | on(event: 'detach', listener: (event: Event,
|
6964 | /**
|
6965 | * Reason for detaching debugger.
|
6966 | */
|
6967 | reason: string) => void): this;
|
6968 | off(event: 'detach', listener: (event: Event,
|
6969 | /**
|
6970 | * Reason for detaching debugger.
|
6971 | */
|
6972 | reason: string) => void): this;
|
6973 | once(event: 'detach', listener: (event: Event,
|
6974 | /**
|
6975 | * Reason for detaching debugger.
|
6976 | */
|
6977 | reason: string) => void): this;
|
6978 | addListener(event: 'detach', listener: (event: Event,
|
6979 | /**
|
6980 | * Reason for detaching debugger.
|
6981 | */
|
6982 | reason: string) => void): this;
|
6983 | removeListener(event: 'detach', listener: (event: Event,
|
6984 | /**
|
6985 | * Reason for detaching debugger.
|
6986 | */
|
6987 | reason: string) => void): this;
|
6988 | /**
|
6989 | * Emitted whenever the debugging target issues an instrumentation event.
|
6990 | */
|
6991 | on(event: 'message', listener: (event: Event,
|
6992 | /**
|
6993 | * Method name.
|
6994 | */
|
6995 | method: string,
|
6996 | /**
|
6997 | * Event parameters defined by the 'parameters' attribute in the remote debugging
|
6998 | * protocol.
|
6999 | */
|
7000 | params: any,
|
7001 | /**
|
7002 | * Unique identifier of attached debugging session, will match the value sent from
|
7003 | * `debugger.sendCommand`.
|
7004 | */
|
7005 | sessionId: string) => void): this;
|
7006 | off(event: 'message', listener: (event: Event,
|
7007 | /**
|
7008 | * Method name.
|
7009 | */
|
7010 | method: string,
|
7011 | /**
|
7012 | * Event parameters defined by the 'parameters' attribute in the remote debugging
|
7013 | * protocol.
|
7014 | */
|
7015 | params: any,
|
7016 | /**
|
7017 | * Unique identifier of attached debugging session, will match the value sent from
|
7018 | * `debugger.sendCommand`.
|
7019 | */
|
7020 | sessionId: string) => void): this;
|
7021 | once(event: 'message', listener: (event: Event,
|
7022 | /**
|
7023 | * Method name.
|
7024 | */
|
7025 | method: string,
|
7026 | /**
|
7027 | * Event parameters defined by the 'parameters' attribute in the remote debugging
|
7028 | * protocol.
|
7029 | */
|
7030 | params: any,
|
7031 | /**
|
7032 | * Unique identifier of attached debugging session, will match the value sent from
|
7033 | * `debugger.sendCommand`.
|
7034 | */
|
7035 | sessionId: string) => void): this;
|
7036 | addListener(event: 'message', listener: (event: Event,
|
7037 | /**
|
7038 | * Method name.
|
7039 | */
|
7040 | method: string,
|
7041 | /**
|
7042 | * Event parameters defined by the 'parameters' attribute in the remote debugging
|
7043 | * protocol.
|
7044 | */
|
7045 | params: any,
|
7046 | /**
|
7047 | * Unique identifier of attached debugging session, will match the value sent from
|
7048 | * `debugger.sendCommand`.
|
7049 | */
|
7050 | sessionId: string) => void): this;
|
7051 | removeListener(event: 'message', listener: (event: Event,
|
7052 | /**
|
7053 | * Method name.
|
7054 | */
|
7055 | method: string,
|
7056 | /**
|
7057 | * Event parameters defined by the 'parameters' attribute in the remote debugging
|
7058 | * protocol.
|
7059 | */
|
7060 | params: any,
|
7061 | /**
|
7062 | * Unique identifier of attached debugging session, will match the value sent from
|
7063 | * `debugger.sendCommand`.
|
7064 | */
|
7065 | sessionId: string) => void): this;
|
7066 | /**
|
7067 | * Attaches the debugger to the `webContents`.
|
7068 | */
|
7069 | attach(protocolVersion?: string): void;
|
7070 | /**
|
7071 | * Detaches the debugger from the `webContents`.
|
7072 | */
|
7073 | detach(): void;
|
7074 | /**
|
7075 | * Whether a debugger is attached to the `webContents`.
|
7076 | */
|
7077 | isAttached(): boolean;
|
7078 | /**
|
7079 | * A promise that resolves with the response defined by the 'returns' attribute of
|
7080 | * the command description in the remote debugging protocol or is rejected
|
7081 | * indicating the failure of the command.
|
7082 | *
|
7083 | * Send given command to the debugging target.
|
7084 | */
|
7085 | sendCommand(method: string, commandParams?: any, sessionId?: string): Promise<any>;
|
7086 | }
|
7087 |
|
7088 | interface DesktopCapturer {
|
7089 |
|
7090 | // Docs: https://electronjs.org/docs/api/desktop-capturer
|
7091 |
|
7092 | /**
|
7093 | * Resolves with an array of `DesktopCapturerSource` objects, each
|
7094 | * `DesktopCapturerSource` represents a screen or an individual window that can be
|
7095 | * captured.
|
7096 | *
|
7097 | * **Note** Capturing the screen contents requires user consent on macOS 10.15
|
7098 | * Catalina or higher, which can detected by
|
7099 | * `systemPreferences.getMediaAccessStatus`.
|
7100 | */
|
7101 | getSources(options: SourcesOptions): Promise<Electron.DesktopCapturerSource[]>;
|
7102 | }
|
7103 |
|
7104 | interface DesktopCapturerSource {
|
7105 |
|
7106 | // Docs: https://electronjs.org/docs/api/structures/desktop-capturer-source
|
7107 |
|
7108 | /**
|
7109 | * An icon image of the application that owns the window or null if the source has
|
7110 | * a type screen. The size of the icon is not known in advance and depends on what
|
7111 | * the application provides.
|
7112 | */
|
7113 | appIcon: NativeImage;
|
7114 | /**
|
7115 | * A unique identifier that will correspond to the `id` of the matching Display
|
7116 | * returned by the Screen API. On some platforms, this is equivalent to the `XX`
|
7117 | * portion of the `id` field above and on others it will differ. It will be an
|
7118 | * empty string if not available.
|
7119 | */
|
7120 | display_id: string;
|
7121 | /**
|
7122 | * The identifier of a window or screen that can be used as a `chromeMediaSourceId`
|
7123 | * constraint when calling `navigator.getUserMedia`. The format of the identifier
|
7124 | * will be `window:XX:YY` or `screen:ZZ:0`. XX is the windowID/handle. YY is 1 for
|
7125 | * the current process, and 0 for all others. ZZ is a sequential number that
|
7126 | * represents the screen, and it does not equal to the index in the source's name.
|
7127 | */
|
7128 | id: string;
|
7129 | /**
|
7130 | * A screen source will be named either `Entire Screen` or `Screen <index>`, while
|
7131 | * the name of a window source will match the window title.
|
7132 | */
|
7133 | name: string;
|
7134 | /**
|
7135 | * A thumbnail image. **Note:** There is no guarantee that the size of the
|
7136 | * thumbnail is the same as the `thumbnailSize` specified in the `options` passed
|
7137 | * to `desktopCapturer.getSources`. The actual size depends on the scale of the
|
7138 | * screen or window.
|
7139 | */
|
7140 | thumbnail: NativeImage;
|
7141 | }
|
7142 |
|
7143 | interface Dialog {
|
7144 |
|
7145 | // Docs: https://electronjs.org/docs/api/dialog
|
7146 |
|
7147 | /**
|
7148 | * resolves when the certificate trust dialog is shown.
|
7149 | *
|
7150 | * On macOS, this displays a modal dialog that shows a message and certificate
|
7151 | * information, and gives the user the option of trusting/importing the
|
7152 | * certificate. If you provide a `window` argument the dialog will be attached to
|
7153 | * the parent window, making it modal.
|
7154 | *
|
7155 | * On Windows the options are more limited, due to the Win32 APIs used:
|
7156 | *
|
7157 | * * The `message` argument is not used, as the OS provides its own confirmation
|
7158 | * dialog.
|
7159 | * * The `window` argument is ignored since it is not possible to make this
|
7160 | * confirmation dialog modal.
|
7161 | *
|
7162 | * @platform darwin,win32
|
7163 | */
|
7164 | showCertificateTrustDialog(window: BaseWindow, options: CertificateTrustDialogOptions): Promise<void>;
|
7165 | /**
|
7166 | * resolves when the certificate trust dialog is shown.
|
7167 | *
|
7168 | * On macOS, this displays a modal dialog that shows a message and certificate
|
7169 | * information, and gives the user the option of trusting/importing the
|
7170 | * certificate. If you provide a `window` argument the dialog will be attached to
|
7171 | * the parent window, making it modal.
|
7172 | *
|
7173 | * On Windows the options are more limited, due to the Win32 APIs used:
|
7174 | *
|
7175 | * * The `message` argument is not used, as the OS provides its own confirmation
|
7176 | * dialog.
|
7177 | * * The `window` argument is ignored since it is not possible to make this
|
7178 | * confirmation dialog modal.
|
7179 | *
|
7180 | * @platform darwin,win32
|
7181 | */
|
7182 | showCertificateTrustDialog(options: CertificateTrustDialogOptions): Promise<void>;
|
7183 | /**
|
7184 | * Displays a modal dialog that shows an error message.
|
7185 | *
|
7186 | * This API can be called safely before the `ready` event the `app` module emits,
|
7187 | * it is usually used to report errors in early stage of startup. If called before
|
7188 | * the app `ready`event on Linux, the message will be emitted to stderr, and no GUI
|
7189 | * dialog will appear.
|
7190 | */
|
7191 | showErrorBox(title: string, content: string): void;
|
7192 | /**
|
7193 | * resolves with a promise containing the following properties:
|
7194 | *
|
7195 | * * `response` number - The index of the clicked button.
|
7196 | * * `checkboxChecked` boolean - The checked state of the checkbox if
|
7197 | * `checkboxLabel` was set. Otherwise `false`.
|
7198 | *
|
7199 | * Shows a message box.
|
7200 | *
|
7201 | * The `window` argument allows the dialog to attach itself to a parent window,
|
7202 | * making it modal.
|
7203 | */
|
7204 | showMessageBox(window: BaseWindow, options: MessageBoxOptions): Promise<Electron.MessageBoxReturnValue>;
|
7205 | /**
|
7206 | * resolves with a promise containing the following properties:
|
7207 | *
|
7208 | * * `response` number - The index of the clicked button.
|
7209 | * * `checkboxChecked` boolean - The checked state of the checkbox if
|
7210 | * `checkboxLabel` was set. Otherwise `false`.
|
7211 | *
|
7212 | * Shows a message box.
|
7213 | *
|
7214 | * The `window` argument allows the dialog to attach itself to a parent window,
|
7215 | * making it modal.
|
7216 | */
|
7217 | showMessageBox(options: MessageBoxOptions): Promise<Electron.MessageBoxReturnValue>;
|
7218 | /**
|
7219 | * the index of the clicked button.
|
7220 | *
|
7221 | * Shows a message box, it will block the process until the message box is closed.
|
7222 | * It returns the index of the clicked button.
|
7223 | *
|
7224 | * The `window` argument allows the dialog to attach itself to a parent window,
|
7225 | * making it modal. If `window` is not shown dialog will not be attached to it. In
|
7226 | * such case it will be displayed as an independent window.
|
7227 | */
|
7228 | showMessageBoxSync(window: BaseWindow, options: MessageBoxSyncOptions): number;
|
7229 | /**
|
7230 | * the index of the clicked button.
|
7231 | *
|
7232 | * Shows a message box, it will block the process until the message box is closed.
|
7233 | * It returns the index of the clicked button.
|
7234 | *
|
7235 | * The `window` argument allows the dialog to attach itself to a parent window,
|
7236 | * making it modal. If `window` is not shown dialog will not be attached to it. In
|
7237 | * such case it will be displayed as an independent window.
|
7238 | */
|
7239 | showMessageBoxSync(options: MessageBoxSyncOptions): number;
|
7240 | /**
|
7241 | * Resolve with an object containing the following:
|
7242 | *
|
7243 | * * `canceled` boolean - whether or not the dialog was canceled.
|
7244 | * * `filePaths` string[] - An array of file paths chosen by the user. If the
|
7245 | * dialog is cancelled this will be an empty array.
|
7246 | * * `bookmarks` string[] (optional) _macOS_ _mas_ - An array matching the
|
7247 | * `filePaths` array of base64 encoded strings which contains security scoped
|
7248 | * bookmark data. `securityScopedBookmarks` must be enabled for this to be
|
7249 | * populated. (For return values, see table here.)
|
7250 | *
|
7251 | * The `window` argument allows the dialog to attach itself to a parent window,
|
7252 | * making it modal.
|
7253 | *
|
7254 | * The `filters` specifies an array of file types that can be displayed or selected
|
7255 | * when you want to limit the user to a specific type. For example:
|
7256 | *
|
7257 | * The `extensions` array should contain extensions without wildcards or dots (e.g.
|
7258 | * `'png'` is good but `'.png'` and `'*.png'` are bad). To show all files, use the
|
7259 | * `'*'` wildcard (no other wildcard is supported).
|
7260 | *
|
7261 | * **Note:** On Windows and Linux an open dialog can not be both a file selector
|
7262 | * and a directory selector, so if you set `properties` to `['openFile',
|
7263 | * 'openDirectory']` on these platforms, a directory selector will be shown.
|
7264 | */
|
7265 | showOpenDialog(window: BaseWindow, options: OpenDialogOptions): Promise<Electron.OpenDialogReturnValue>;
|
7266 | /**
|
7267 | * Resolve with an object containing the following:
|
7268 | *
|
7269 | * * `canceled` boolean - whether or not the dialog was canceled.
|
7270 | * * `filePaths` string[] - An array of file paths chosen by the user. If the
|
7271 | * dialog is cancelled this will be an empty array.
|
7272 | * * `bookmarks` string[] (optional) _macOS_ _mas_ - An array matching the
|
7273 | * `filePaths` array of base64 encoded strings which contains security scoped
|
7274 | * bookmark data. `securityScopedBookmarks` must be enabled for this to be
|
7275 | * populated. (For return values, see table here.)
|
7276 | *
|
7277 | * The `window` argument allows the dialog to attach itself to a parent window,
|
7278 | * making it modal.
|
7279 | *
|
7280 | * The `filters` specifies an array of file types that can be displayed or selected
|
7281 | * when you want to limit the user to a specific type. For example:
|
7282 | *
|
7283 | * The `extensions` array should contain extensions without wildcards or dots (e.g.
|
7284 | * `'png'` is good but `'.png'` and `'*.png'` are bad). To show all files, use the
|
7285 | * `'*'` wildcard (no other wildcard is supported).
|
7286 | *
|
7287 | * **Note:** On Windows and Linux an open dialog can not be both a file selector
|
7288 | * and a directory selector, so if you set `properties` to `['openFile',
|
7289 | * 'openDirectory']` on these platforms, a directory selector will be shown.
|
7290 | */
|
7291 | showOpenDialog(options: OpenDialogOptions): Promise<Electron.OpenDialogReturnValue>;
|
7292 | /**
|
7293 | * the file paths chosen by the user; if the dialog is cancelled it returns
|
7294 | * `undefined`.
|
7295 | *
|
7296 | * The `window` argument allows the dialog to attach itself to a parent window,
|
7297 | * making it modal.
|
7298 | *
|
7299 | * The `filters` specifies an array of file types that can be displayed or selected
|
7300 | * when you want to limit the user to a specific type. For example:
|
7301 | *
|
7302 | * The `extensions` array should contain extensions without wildcards or dots (e.g.
|
7303 | * `'png'` is good but `'.png'` and `'*.png'` are bad). To show all files, use the
|
7304 | * `'*'` wildcard (no other wildcard is supported).
|
7305 | *
|
7306 | * **Note:** On Windows and Linux an open dialog can not be both a file selector
|
7307 | * and a directory selector, so if you set `properties` to `['openFile',
|
7308 | * 'openDirectory']` on these platforms, a directory selector will be shown.
|
7309 | */
|
7310 | showOpenDialogSync(window: BaseWindow, options: OpenDialogSyncOptions): (string[]) | (undefined);
|
7311 | /**
|
7312 | * the file paths chosen by the user; if the dialog is cancelled it returns
|
7313 | * `undefined`.
|
7314 | *
|
7315 | * The `window` argument allows the dialog to attach itself to a parent window,
|
7316 | * making it modal.
|
7317 | *
|
7318 | * The `filters` specifies an array of file types that can be displayed or selected
|
7319 | * when you want to limit the user to a specific type. For example:
|
7320 | *
|
7321 | * The `extensions` array should contain extensions without wildcards or dots (e.g.
|
7322 | * `'png'` is good but `'.png'` and `'*.png'` are bad). To show all files, use the
|
7323 | * `'*'` wildcard (no other wildcard is supported).
|
7324 | *
|
7325 | * **Note:** On Windows and Linux an open dialog can not be both a file selector
|
7326 | * and a directory selector, so if you set `properties` to `['openFile',
|
7327 | * 'openDirectory']` on these platforms, a directory selector will be shown.
|
7328 | */
|
7329 | showOpenDialogSync(options: OpenDialogSyncOptions): (string[]) | (undefined);
|
7330 | /**
|
7331 | * Resolve with an object containing the following:
|
7332 | *
|
7333 | * * `canceled` boolean - whether or not the dialog was canceled.
|
7334 | * * `filePath` string - If the dialog is canceled, this will be an empty string.
|
7335 | * * `bookmark` string (optional) _macOS_ _mas_ - Base64 encoded string which
|
7336 | * contains the security scoped bookmark data for the saved file.
|
7337 | * `securityScopedBookmarks` must be enabled for this to be present. (For return
|
7338 | * values, see table here.)
|
7339 | *
|
7340 | * The `window` argument allows the dialog to attach itself to a parent window,
|
7341 | * making it modal.
|
7342 | *
|
7343 | * The `filters` specifies an array of file types that can be displayed, see
|
7344 | * `dialog.showOpenDialog` for an example.
|
7345 | *
|
7346 | * **Note:** On macOS, using the asynchronous version is recommended to avoid
|
7347 | * issues when expanding and collapsing the dialog.
|
7348 | */
|
7349 | showSaveDialog(window: BaseWindow, options: SaveDialogOptions): Promise<Electron.SaveDialogReturnValue>;
|
7350 | /**
|
7351 | * Resolve with an object containing the following:
|
7352 | *
|
7353 | * * `canceled` boolean - whether or not the dialog was canceled.
|
7354 | * * `filePath` string - If the dialog is canceled, this will be an empty string.
|
7355 | * * `bookmark` string (optional) _macOS_ _mas_ - Base64 encoded string which
|
7356 | * contains the security scoped bookmark data for the saved file.
|
7357 | * `securityScopedBookmarks` must be enabled for this to be present. (For return
|
7358 | * values, see table here.)
|
7359 | *
|
7360 | * The `window` argument allows the dialog to attach itself to a parent window,
|
7361 | * making it modal.
|
7362 | *
|
7363 | * The `filters` specifies an array of file types that can be displayed, see
|
7364 | * `dialog.showOpenDialog` for an example.
|
7365 | *
|
7366 | * **Note:** On macOS, using the asynchronous version is recommended to avoid
|
7367 | * issues when expanding and collapsing the dialog.
|
7368 | */
|
7369 | showSaveDialog(options: SaveDialogOptions): Promise<Electron.SaveDialogReturnValue>;
|
7370 | /**
|
7371 | * the path of the file chosen by the user; if the dialog is cancelled it returns
|
7372 | * an empty string.
|
7373 | *
|
7374 | * The `window` argument allows the dialog to attach itself to a parent window,
|
7375 | * making it modal.
|
7376 | *
|
7377 | * The `filters` specifies an array of file types that can be displayed, see
|
7378 | * `dialog.showOpenDialog` for an example.
|
7379 | */
|
7380 | showSaveDialogSync(window: BaseWindow, options: SaveDialogSyncOptions): string;
|
7381 | /**
|
7382 | * the path of the file chosen by the user; if the dialog is cancelled it returns
|
7383 | * an empty string.
|
7384 | *
|
7385 | * The `window` argument allows the dialog to attach itself to a parent window,
|
7386 | * making it modal.
|
7387 | *
|
7388 | * The `filters` specifies an array of file types that can be displayed, see
|
7389 | * `dialog.showOpenDialog` for an example.
|
7390 | */
|
7391 | showSaveDialogSync(options: SaveDialogSyncOptions): string;
|
7392 | }
|
7393 |
|
7394 | interface Display {
|
7395 |
|
7396 | // Docs: https://electronjs.org/docs/api/structures/display
|
7397 |
|
7398 | /**
|
7399 | * Can be `available`, `unavailable`, `unknown`.
|
7400 | */
|
7401 | accelerometerSupport: ('available' | 'unavailable' | 'unknown');
|
7402 | /**
|
7403 | * the bounds of the display in DIP points.
|
7404 | */
|
7405 | bounds: Rectangle;
|
7406 | /**
|
7407 | * The number of bits per pixel.
|
7408 | */
|
7409 | colorDepth: number;
|
7410 | /**
|
7411 | * represent a color space (three-dimensional object which contains all realizable
|
7412 | * color combinations) for the purpose of color conversions.
|
7413 | */
|
7414 | colorSpace: string;
|
7415 | /**
|
7416 | * The number of bits per color component.
|
7417 | */
|
7418 | depthPerComponent: number;
|
7419 | /**
|
7420 | * `true`` if the display is detected by the system.
|
7421 | */
|
7422 | detected: boolean;
|
7423 | /**
|
7424 | * The display refresh rate.
|
7425 | */
|
7426 | displayFrequency: number;
|
7427 | /**
|
7428 | * Unique identifier associated with the display. A value of of -1 means the
|
7429 | * display is invalid or the correct `id` is not yet known, and a value of -10
|
7430 | * means the display is a virtual display assigned to a unified desktop.
|
7431 | */
|
7432 | id: number;
|
7433 | /**
|
7434 | * `true` for an internal display and `false` for an external display.
|
7435 | */
|
7436 | internal: boolean;
|
7437 | /**
|
7438 | * User-friendly label, determined by the platform.
|
7439 | */
|
7440 | label: string;
|
7441 | /**
|
7442 | * Maximum cursor size in native pixels.
|
7443 | */
|
7444 | maximumCursorSize: Size;
|
7445 | /**
|
7446 | * Whether or not the display is a monochrome display.
|
7447 | */
|
7448 | monochrome: boolean;
|
7449 | /**
|
7450 | * Returns the display's origin in pixel coordinates. Only available on windowing
|
7451 | * systems like X11 that position displays in pixel coordinates.
|
7452 | */
|
7453 | nativeOrigin: Point;
|
7454 | /**
|
7455 | * Can be 0, 90, 180, 270, represents screen rotation in clock-wise degrees.
|
7456 | */
|
7457 | rotation: number;
|
7458 | /**
|
7459 | * Output device's pixel scale factor.
|
7460 | */
|
7461 | scaleFactor: number;
|
7462 | size: Size;
|
7463 | /**
|
7464 | * Can be `available`, `unavailable`, `unknown`.
|
7465 | */
|
7466 | touchSupport: ('available' | 'unavailable' | 'unknown');
|
7467 | /**
|
7468 | * the work area of the display in DIP points.
|
7469 | */
|
7470 | workArea: Rectangle;
|
7471 | /**
|
7472 | * The size of the work area.
|
7473 | */
|
7474 | workAreaSize: Size;
|
7475 | }
|
7476 |
|
7477 | class Dock {
|
7478 |
|
7479 | // Docs: https://electronjs.org/docs/api/dock
|
7480 |
|
7481 | /**
|
7482 | * an ID representing the request.
|
7483 | *
|
7484 | * When `critical` is passed, the dock icon will bounce until either the
|
7485 | * application becomes active or the request is canceled.
|
7486 | *
|
7487 | * When `informational` is passed, the dock icon will bounce for one second.
|
7488 | * However, the request remains active until either the application becomes active
|
7489 | * or the request is canceled.
|
7490 | *
|
7491 | * **Note:** This method can only be used while the app is not focused; when the
|
7492 | * app is focused it will return -1.
|
7493 | *
|
7494 | * @platform darwin
|
7495 | */
|
7496 | bounce(type?: 'critical' | 'informational'): number;
|
7497 | /**
|
7498 | * Cancel the bounce of `id`.
|
7499 | *
|
7500 | * @platform darwin
|
7501 | */
|
7502 | cancelBounce(id: number): void;
|
7503 | /**
|
7504 | * Bounces the Downloads stack if the filePath is inside the Downloads folder.
|
7505 | *
|
7506 | * @platform darwin
|
7507 | */
|
7508 | downloadFinished(filePath: string): void;
|
7509 | /**
|
7510 | * The badge string of the dock.
|
7511 | *
|
7512 | * @platform darwin
|
7513 | */
|
7514 | getBadge(): string;
|
7515 | /**
|
7516 | * The application's dock menu.
|
7517 | *
|
7518 | * @platform darwin
|
7519 | */
|
7520 | getMenu(): (Menu) | (null);
|
7521 | /**
|
7522 | * Hides the dock icon.
|
7523 | *
|
7524 | * @platform darwin
|
7525 | */
|
7526 | hide(): void;
|
7527 | /**
|
7528 | * Whether the dock icon is visible.
|
7529 | *
|
7530 | * @platform darwin
|
7531 | */
|
7532 | isVisible(): boolean;
|
7533 | /**
|
7534 | * Sets the string to be displayed in the dock’s badging area.
|
7535 | *
|
7536 | * @platform darwin
|
7537 | */
|
7538 | setBadge(text: string): void;
|
7539 | /**
|
7540 | * Sets the `image` associated with this dock icon.
|
7541 | *
|
7542 | * @platform darwin
|
7543 | */
|
7544 | setIcon(image: (NativeImage) | (string)): void;
|
7545 | /**
|
7546 | * Sets the application's dock menu.
|
7547 | *
|
7548 | * @platform darwin
|
7549 | */
|
7550 | setMenu(menu: Menu): void;
|
7551 | /**
|
7552 | * Resolves when the dock icon is shown.
|
7553 | *
|
7554 | * @platform darwin
|
7555 | */
|
7556 | show(): Promise<void>;
|
7557 | }
|
7558 |
|
7559 | class DownloadItem extends NodeEventEmitter {
|
7560 |
|
7561 | // Docs: https://electronjs.org/docs/api/download-item
|
7562 |
|
7563 | /**
|
7564 | * Emitted when the download is in a terminal state. This includes a completed
|
7565 | * download, a cancelled download (via `downloadItem.cancel()`), and interrupted
|
7566 | * download that can't be resumed.
|
7567 | *
|
7568 | * The `state` can be one of following:
|
7569 | *
|
7570 | * * `completed` - The download completed successfully.
|
7571 | * * `cancelled` - The download has been cancelled.
|
7572 | * * `interrupted` - The download has interrupted and can not resume.
|
7573 | */
|
7574 | on(event: 'done', listener: (event: Event,
|
7575 | /**
|
7576 | * Can be `completed`, `cancelled` or `interrupted`.
|
7577 | */
|
7578 | state: ('completed' | 'cancelled' | 'interrupted')) => void): this;
|
7579 | off(event: 'done', listener: (event: Event,
|
7580 | /**
|
7581 | * Can be `completed`, `cancelled` or `interrupted`.
|
7582 | */
|
7583 | state: ('completed' | 'cancelled' | 'interrupted')) => void): this;
|
7584 | once(event: 'done', listener: (event: Event,
|
7585 | /**
|
7586 | * Can be `completed`, `cancelled` or `interrupted`.
|
7587 | */
|
7588 | state: ('completed' | 'cancelled' | 'interrupted')) => void): this;
|
7589 | addListener(event: 'done', listener: (event: Event,
|
7590 | /**
|
7591 | * Can be `completed`, `cancelled` or `interrupted`.
|
7592 | */
|
7593 | state: ('completed' | 'cancelled' | 'interrupted')) => void): this;
|
7594 | removeListener(event: 'done', listener: (event: Event,
|
7595 | /**
|
7596 | * Can be `completed`, `cancelled` or `interrupted`.
|
7597 | */
|
7598 | state: ('completed' | 'cancelled' | 'interrupted')) => void): this;
|
7599 | /**
|
7600 | * Emitted when the download has been updated and is not done.
|
7601 | *
|
7602 | * The `state` can be one of following:
|
7603 | *
|
7604 | * * `progressing` - The download is in-progress.
|
7605 | * * `interrupted` - The download has interrupted and can be resumed.
|
7606 | */
|
7607 | on(event: 'updated', listener: (event: Event,
|
7608 | /**
|
7609 | * Can be `progressing` or `interrupted`.
|
7610 | */
|
7611 | state: ('progressing' | 'interrupted')) => void): this;
|
7612 | off(event: 'updated', listener: (event: Event,
|
7613 | /**
|
7614 | * Can be `progressing` or `interrupted`.
|
7615 | */
|
7616 | state: ('progressing' | 'interrupted')) => void): this;
|
7617 | once(event: 'updated', listener: (event: Event,
|
7618 | /**
|
7619 | * Can be `progressing` or `interrupted`.
|
7620 | */
|
7621 | state: ('progressing' | 'interrupted')) => void): this;
|
7622 | addListener(event: 'updated', listener: (event: Event,
|
7623 | /**
|
7624 | * Can be `progressing` or `interrupted`.
|
7625 | */
|
7626 | state: ('progressing' | 'interrupted')) => void): this;
|
7627 | removeListener(event: 'updated', listener: (event: Event,
|
7628 | /**
|
7629 | * Can be `progressing` or `interrupted`.
|
7630 | */
|
7631 | state: ('progressing' | 'interrupted')) => void): this;
|
7632 | /**
|
7633 | * Cancels the download operation.
|
7634 | */
|
7635 | cancel(): void;
|
7636 | /**
|
7637 | * Whether the download can resume.
|
7638 | */
|
7639 | canResume(): boolean;
|
7640 | /**
|
7641 | * The Content-Disposition field from the response header.
|
7642 | */
|
7643 | getContentDisposition(): string;
|
7644 | /**
|
7645 | * The current download speed in bytes per second.
|
7646 | */
|
7647 | getCurrentBytesPerSecond(): number;
|
7648 | /**
|
7649 | * Number of seconds since the UNIX epoch when the download ended.
|
7650 | */
|
7651 | getEndTime(): number;
|
7652 | /**
|
7653 | * ETag header value.
|
7654 | */
|
7655 | getETag(): string;
|
7656 | /**
|
7657 | * The file name of the download item.
|
7658 | *
|
7659 | * **Note:** The file name is not always the same as the actual one saved in local
|
7660 | * disk. If user changes the file name in a prompted download saving dialog, the
|
7661 | * actual name of saved file will be different.
|
7662 | */
|
7663 | getFilename(): string;
|
7664 | /**
|
7665 | * Last-Modified header value.
|
7666 | */
|
7667 | getLastModifiedTime(): string;
|
7668 | /**
|
7669 | * The files mime type.
|
7670 | */
|
7671 | getMimeType(): string;
|
7672 | /**
|
7673 | * The download completion in percent.
|
7674 | */
|
7675 | getPercentComplete(): number;
|
7676 | /**
|
7677 | * The received bytes of the download item.
|
7678 | */
|
7679 | getReceivedBytes(): number;
|
7680 | /**
|
7681 | * Returns the object previously set by
|
7682 | * `downloadItem.setSaveDialogOptions(options)`.
|
7683 | */
|
7684 | getSaveDialogOptions(): SaveDialogOptions;
|
7685 | /**
|
7686 | * The save path of the download item. This will be either the path set via
|
7687 | * `downloadItem.setSavePath(path)` or the path selected from the shown save
|
7688 | * dialog.
|
7689 | */
|
7690 | getSavePath(): string;
|
7691 | /**
|
7692 | * Number of seconds since the UNIX epoch when the download was started.
|
7693 | */
|
7694 | getStartTime(): number;
|
7695 | /**
|
7696 | * The current state. Can be `progressing`, `completed`, `cancelled` or
|
7697 | * `interrupted`.
|
7698 | *
|
7699 | * **Note:** The following methods are useful specifically to resume a `cancelled`
|
7700 | * item when session is restarted.
|
7701 | */
|
7702 | getState(): ('progressing' | 'completed' | 'cancelled' | 'interrupted');
|
7703 | /**
|
7704 | * The total size in bytes of the download item.
|
7705 | *
|
7706 | * If the size is unknown, it returns 0.
|
7707 | */
|
7708 | getTotalBytes(): number;
|
7709 | /**
|
7710 | * The origin URL where the item is downloaded from.
|
7711 | */
|
7712 | getURL(): string;
|
7713 | /**
|
7714 | * The complete URL chain of the item including any redirects.
|
7715 | */
|
7716 | getURLChain(): string[];
|
7717 | /**
|
7718 | * Whether the download has user gesture.
|
7719 | */
|
7720 | hasUserGesture(): boolean;
|
7721 | /**
|
7722 | * Whether the download is paused.
|
7723 | */
|
7724 | isPaused(): boolean;
|
7725 | /**
|
7726 | * Pauses the download.
|
7727 | */
|
7728 | pause(): void;
|
7729 | /**
|
7730 | * Resumes the download that has been paused.
|
7731 | *
|
7732 | * **Note:** To enable resumable downloads the server you are downloading from must
|
7733 | * support range requests and provide both `Last-Modified` and `ETag` header
|
7734 | * values. Otherwise `resume()` will dismiss previously received bytes and restart
|
7735 | * the download from the beginning.
|
7736 | */
|
7737 | resume(): void;
|
7738 | /**
|
7739 | * This API allows the user to set custom options for the save dialog that opens
|
7740 | * for the download item by default. The API is only available in session's
|
7741 | * `will-download` callback function.
|
7742 | */
|
7743 | setSaveDialogOptions(options: SaveDialogOptions): void;
|
7744 | /**
|
7745 | * The API is only available in session's `will-download` callback function. If
|
7746 | * `path` doesn't exist, Electron will try to make the directory recursively. If
|
7747 | * user doesn't set the save path via the API, Electron will use the original
|
7748 | * routine to determine the save path; this usually prompts a save dialog.
|
7749 | */
|
7750 | setSavePath(path: string): void;
|
7751 | /**
|
7752 | * A `string` property that determines the save file path of the download item.
|
7753 | *
|
7754 | * The property is only available in session's `will-download` callback function.
|
7755 | * If user doesn't set the save path via the property, Electron will use the
|
7756 | * original routine to determine the save path; this usually prompts a save dialog.
|
7757 | */
|
7758 | savePath: string;
|
7759 | }
|
7760 |
|
7761 | interface Extension {
|
7762 |
|
7763 | // Docs: https://electronjs.org/docs/api/structures/extension
|
7764 |
|
7765 | id: string;
|
7766 | /**
|
7767 | * Copy of the extension's manifest data.
|
7768 | */
|
7769 | manifest: any;
|
7770 | name: string;
|
7771 | /**
|
7772 | * The extension's file path.
|
7773 | */
|
7774 | path: string;
|
7775 | /**
|
7776 | * The extension's `chrome-extension://` URL.
|
7777 | */
|
7778 | url: string;
|
7779 | version: string;
|
7780 | }
|
7781 |
|
7782 | interface ExtensionInfo {
|
7783 |
|
7784 | // Docs: https://electronjs.org/docs/api/structures/extension-info
|
7785 |
|
7786 | name: string;
|
7787 | version: string;
|
7788 | }
|
7789 |
|
7790 | interface FileFilter {
|
7791 |
|
7792 | // Docs: https://electronjs.org/docs/api/structures/file-filter
|
7793 |
|
7794 | extensions: string[];
|
7795 | name: string;
|
7796 | }
|
7797 |
|
7798 | interface FilePathWithHeaders {
|
7799 |
|
7800 | // Docs: https://electronjs.org/docs/api/structures/file-path-with-headers
|
7801 |
|
7802 | /**
|
7803 | * Additional headers to be sent.
|
7804 | */
|
7805 | headers?: Record<string, string>;
|
7806 | /**
|
7807 | * The path to the file to send.
|
7808 | */
|
7809 | path: string;
|
7810 | }
|
7811 |
|
7812 | interface FilesystemPermissionRequest extends PermissionRequest {
|
7813 |
|
7814 | // Docs: https://electronjs.org/docs/api/structures/filesystem-permission-request
|
7815 |
|
7816 | /**
|
7817 | * The access type of the `fileSystem` request. Can be `writable` or `readable`.
|
7818 | */
|
7819 | fileAccessType?: ('writable' | 'readable');
|
7820 | /**
|
7821 | * The path of the `fileSystem` request.
|
7822 | */
|
7823 | filePath?: string;
|
7824 | /**
|
7825 | * Whether the `fileSystem` request is a directory.
|
7826 | */
|
7827 | isDirectory?: boolean;
|
7828 | }
|
7829 |
|
7830 | interface GlobalShortcut {
|
7831 |
|
7832 | // Docs: https://electronjs.org/docs/api/global-shortcut
|
7833 |
|
7834 | /**
|
7835 | * Whether this application has registered `accelerator`.
|
7836 | *
|
7837 | * When the accelerator is already taken by other applications, this call will
|
7838 | * still return `false`. This behavior is intended by operating systems, since they
|
7839 | * don't want applications to fight for global shortcuts.
|
7840 | */
|
7841 | isRegistered(accelerator: Accelerator): boolean;
|
7842 | /**
|
7843 | * Whether or not the shortcut was registered successfully.
|
7844 | *
|
7845 | * Registers a global shortcut of `accelerator`. The `callback` is called when the
|
7846 | * registered shortcut is pressed by the user.
|
7847 | *
|
7848 | * When the accelerator is already taken by other applications, this call will
|
7849 | * silently fail. This behavior is intended by operating systems, since they don't
|
7850 | * want applications to fight for global shortcuts.
|
7851 | *
|
7852 | * The following accelerators will not be registered successfully on macOS 10.14
|
7853 | * Mojave unless the app has been authorized as a trusted accessibility client:
|
7854 | *
|
7855 | * * "Media Play/Pause"
|
7856 | * * "Media Next Track"
|
7857 | * * "Media Previous Track"
|
7858 | * * "Media Stop"
|
7859 | */
|
7860 | register(accelerator: Accelerator, callback: () => void): boolean;
|
7861 | /**
|
7862 | * Registers a global shortcut of all `accelerator` items in `accelerators`. The
|
7863 | * `callback` is called when any of the registered shortcuts are pressed by the
|
7864 | * user.
|
7865 | *
|
7866 | * When a given accelerator is already taken by other applications, this call will
|
7867 | * silently fail. This behavior is intended by operating systems, since they don't
|
7868 | * want applications to fight for global shortcuts.
|
7869 | *
|
7870 | * The following accelerators will not be registered successfully on macOS 10.14
|
7871 | * Mojave unless the app has been authorized as a trusted accessibility client:
|
7872 | *
|
7873 | * * "Media Play/Pause"
|
7874 | * * "Media Next Track"
|
7875 | * * "Media Previous Track"
|
7876 | * * "Media Stop"
|
7877 | */
|
7878 | registerAll(accelerators: Accelerator[], callback: () => void): void;
|
7879 | /**
|
7880 | * Unregisters the global shortcut of `accelerator`.
|
7881 | */
|
7882 | unregister(accelerator: Accelerator): void;
|
7883 | /**
|
7884 | * Unregisters all of the global shortcuts.
|
7885 | */
|
7886 | unregisterAll(): void;
|
7887 | }
|
7888 |
|
7889 | interface GPUFeatureStatus {
|
7890 |
|
7891 | // Docs: https://electronjs.org/docs/api/structures/gpu-feature-status
|
7892 |
|
7893 | /**
|
7894 | * Canvas.
|
7895 | */
|
7896 | '2d_canvas': string;
|
7897 | /**
|
7898 | * Flash.
|
7899 | */
|
7900 | flash_3d: string;
|
7901 | /**
|
7902 | * Flash Stage3D.
|
7903 | */
|
7904 | flash_stage3d: string;
|
7905 | /**
|
7906 | * Flash Stage3D Baseline profile.
|
7907 | */
|
7908 | flash_stage3d_baseline: string;
|
7909 | /**
|
7910 | * Compositing.
|
7911 | */
|
7912 | gpu_compositing: string;
|
7913 | /**
|
7914 | * Multiple Raster Threads.
|
7915 | */
|
7916 | multiple_raster_threads: string;
|
7917 | /**
|
7918 | * Native GpuMemoryBuffers.
|
7919 | */
|
7920 | native_gpu_memory_buffers: string;
|
7921 | /**
|
7922 | * Rasterization.
|
7923 | */
|
7924 | rasterization: string;
|
7925 | /**
|
7926 | * Video Decode.
|
7927 | */
|
7928 | video_decode: string;
|
7929 | /**
|
7930 | * Video Encode.
|
7931 | */
|
7932 | video_encode: string;
|
7933 | /**
|
7934 | * VPx Video Decode.
|
7935 | */
|
7936 | vpx_decode: string;
|
7937 | /**
|
7938 | * WebGL.
|
7939 | */
|
7940 | webgl: string;
|
7941 | /**
|
7942 | * WebGL2.
|
7943 | */
|
7944 | webgl2: string;
|
7945 | }
|
7946 |
|
7947 | interface HIDDevice {
|
7948 |
|
7949 | // Docs: https://electronjs.org/docs/api/structures/hid-device
|
7950 |
|
7951 | /**
|
7952 | * Unique identifier for the device.
|
7953 | */
|
7954 | deviceId: string;
|
7955 | /**
|
7956 | * Unique identifier for the HID interface. A device may have multiple HID
|
7957 | * interfaces.
|
7958 | */
|
7959 | guid?: string;
|
7960 | /**
|
7961 | * Name of the device.
|
7962 | */
|
7963 | name: string;
|
7964 | /**
|
7965 | * The USB product ID.
|
7966 | */
|
7967 | productId: number;
|
7968 | /**
|
7969 | * The USB device serial number.
|
7970 | */
|
7971 | serialNumber?: string;
|
7972 | /**
|
7973 | * The USB vendor ID.
|
7974 | */
|
7975 | vendorId: number;
|
7976 | }
|
7977 |
|
7978 | interface InAppPurchase extends NodeJS.EventEmitter {
|
7979 |
|
7980 | // Docs: https://electronjs.org/docs/api/in-app-purchase
|
7981 |
|
7982 | on(event: 'transactions-updated', listener: () => void): this;
|
7983 | off(event: 'transactions-updated', listener: () => void): this;
|
7984 | once(event: 'transactions-updated', listener: () => void): this;
|
7985 | addListener(event: 'transactions-updated', listener: () => void): this;
|
7986 | removeListener(event: 'transactions-updated', listener: () => void): this;
|
7987 | /**
|
7988 | * whether a user can make a payment.
|
7989 | */
|
7990 | canMakePayments(): boolean;
|
7991 | /**
|
7992 | * Completes all pending transactions.
|
7993 | */
|
7994 | finishAllTransactions(): void;
|
7995 | /**
|
7996 | * Completes the pending transactions corresponding to the date.
|
7997 | */
|
7998 | finishTransactionByDate(date: string): void;
|
7999 | /**
|
8000 | * Resolves with an array of `Product` objects.
|
8001 | *
|
8002 | * Retrieves the product descriptions.
|
8003 | */
|
8004 | getProducts(productIDs: string[]): Promise<Electron.Product[]>;
|
8005 | /**
|
8006 | * the path to the receipt.
|
8007 | */
|
8008 | getReceiptURL(): string;
|
8009 | /**
|
8010 | * Returns `true` if the product is valid and added to the payment queue.
|
8011 | *
|
8012 | * You should listen for the `transactions-updated` event as soon as possible and
|
8013 | * certainly before you call `purchaseProduct`.
|
8014 | */
|
8015 | purchaseProduct(productID: string, opts?: (number) | (PurchaseProductOpts)): Promise<boolean>;
|
8016 | /**
|
8017 | * Restores finished transactions. This method can be called either to install
|
8018 | * purchases on additional devices, or to restore purchases for an application that
|
8019 | * the user deleted and reinstalled.
|
8020 | *
|
8021 | * The payment queue delivers a new transaction for each previously completed
|
8022 | * transaction that can be restored. Each transaction includes a copy of the
|
8023 | * original transaction.
|
8024 | */
|
8025 | restoreCompletedTransactions(): void;
|
8026 | }
|
8027 |
|
8028 | class IncomingMessage extends NodeEventEmitter {
|
8029 |
|
8030 | // Docs: https://electronjs.org/docs/api/incoming-message
|
8031 |
|
8032 | /**
|
8033 | * Emitted when a request has been canceled during an ongoing HTTP transaction.
|
8034 | */
|
8035 | on(event: 'aborted', listener: () => void): this;
|
8036 | off(event: 'aborted', listener: () => void): this;
|
8037 | once(event: 'aborted', listener: () => void): this;
|
8038 | addListener(event: 'aborted', listener: () => void): this;
|
8039 | removeListener(event: 'aborted', listener: () => void): this;
|
8040 | /**
|
8041 | * The `data` event is the usual method of transferring response data into
|
8042 | * applicative code.
|
8043 | */
|
8044 | on(event: 'data', listener: (
|
8045 | /**
|
8046 | * A chunk of response body's data.
|
8047 | */
|
8048 | chunk: Buffer) => void): this;
|
8049 | off(event: 'data', listener: (
|
8050 | /**
|
8051 | * A chunk of response body's data.
|
8052 | */
|
8053 | chunk: Buffer) => void): this;
|
8054 | once(event: 'data', listener: (
|
8055 | /**
|
8056 | * A chunk of response body's data.
|
8057 | */
|
8058 | chunk: Buffer) => void): this;
|
8059 | addListener(event: 'data', listener: (
|
8060 | /**
|
8061 | * A chunk of response body's data.
|
8062 | */
|
8063 | chunk: Buffer) => void): this;
|
8064 | removeListener(event: 'data', listener: (
|
8065 | /**
|
8066 | * A chunk of response body's data.
|
8067 | */
|
8068 | chunk: Buffer) => void): this;
|
8069 | /**
|
8070 | * Indicates that response body has ended. Must be placed before 'data' event.
|
8071 | */
|
8072 | on(event: 'end', listener: () => void): this;
|
8073 | off(event: 'end', listener: () => void): this;
|
8074 | once(event: 'end', listener: () => void): this;
|
8075 | addListener(event: 'end', listener: () => void): this;
|
8076 | removeListener(event: 'end', listener: () => void): this;
|
8077 | /**
|
8078 | * Emitted when an error was encountered while streaming response data events. For
|
8079 | * instance, if the server closes the underlying while the response is still
|
8080 | * streaming, an `error` event will be emitted on the response object and a `close`
|
8081 | * event will subsequently follow on the request object.
|
8082 | */
|
8083 | on(event: 'error', listener: (
|
8084 | /**
|
8085 | * Typically holds an error string identifying failure root cause.
|
8086 | */
|
8087 | error: Error) => void): this;
|
8088 | off(event: 'error', listener: (
|
8089 | /**
|
8090 | * Typically holds an error string identifying failure root cause.
|
8091 | */
|
8092 | error: Error) => void): this;
|
8093 | once(event: 'error', listener: (
|
8094 | /**
|
8095 | * Typically holds an error string identifying failure root cause.
|
8096 | */
|
8097 | error: Error) => void): this;
|
8098 | addListener(event: 'error', listener: (
|
8099 | /**
|
8100 | * Typically holds an error string identifying failure root cause.
|
8101 | */
|
8102 | error: Error) => void): this;
|
8103 | removeListener(event: 'error', listener: (
|
8104 | /**
|
8105 | * Typically holds an error string identifying failure root cause.
|
8106 | */
|
8107 | error: Error) => void): this;
|
8108 | /**
|
8109 | * A `Record<string, string | string[]>` representing the HTTP response headers.
|
8110 | * The `headers` object is formatted as follows:
|
8111 | *
|
8112 | * * All header names are lowercased.
|
8113 | * * Duplicates of `age`, `authorization`, `content-length`, `content-type`,
|
8114 | * `etag`, `expires`, `from`, `host`, `if-modified-since`, `if-unmodified-since`,
|
8115 | * `last-modified`, `location`, `max-forwards`, `proxy-authorization`, `referer`,
|
8116 | * `retry-after`, `server`, or `user-agent` are discarded.
|
8117 | * * `set-cookie` is always an array. Duplicates are added to the array.
|
8118 | * * For duplicate `cookie` headers, the values are joined together with '; '.
|
8119 | * * For all other headers, the values are joined together with ', '.
|
8120 | */
|
8121 | headers: Record<string, (string) | (string[])>;
|
8122 | /**
|
8123 | * A `string` indicating the HTTP protocol version number. Typical values are '1.0'
|
8124 | * or '1.1'. Additionally `httpVersionMajor` and `httpVersionMinor` are two
|
8125 | * Integer-valued readable properties that return respectively the HTTP major and
|
8126 | * minor version numbers.
|
8127 | */
|
8128 | httpVersion: string;
|
8129 | /**
|
8130 | * An `Integer` indicating the HTTP protocol major version number.
|
8131 | */
|
8132 | httpVersionMajor: number;
|
8133 | /**
|
8134 | * An `Integer` indicating the HTTP protocol minor version number.
|
8135 | */
|
8136 | httpVersionMinor: number;
|
8137 | /**
|
8138 | * A `string[]` containing the raw HTTP response headers exactly as they were
|
8139 | * received. The keys and values are in the same list. It is not a list of tuples.
|
8140 | * So, the even-numbered offsets are key values, and the odd-numbered offsets are
|
8141 | * the associated values. Header names are not lowercased, and duplicates are not
|
8142 | * merged.
|
8143 | */
|
8144 | rawHeaders: string[];
|
8145 | /**
|
8146 | * An `Integer` indicating the HTTP response status code.
|
8147 | */
|
8148 | statusCode: number;
|
8149 | /**
|
8150 | * A `string` representing the HTTP status message.
|
8151 | */
|
8152 | statusMessage: string;
|
8153 | }
|
8154 |
|
8155 | interface InputEvent {
|
8156 |
|
8157 | // Docs: https://electronjs.org/docs/api/structures/input-event
|
8158 |
|
8159 | /**
|
8160 | * An array of modifiers of the event, can be `shift`, `control`, `ctrl`, `alt`,
|
8161 | * `meta`, `command`, `cmd`, `isKeypad`, `isAutoRepeat`, `leftButtonDown`,
|
8162 | * `middleButtonDown`, `rightButtonDown`, `capsLock`, `numLock`, `left`, `right`.
|
8163 | */
|
8164 | modifiers?: Array<'shift' | 'control' | 'ctrl' | 'alt' | 'meta' | 'command' | 'cmd' | 'isKeypad' | 'isAutoRepeat' | 'leftButtonDown' | 'middleButtonDown' | 'rightButtonDown' | 'capsLock' | 'numLock' | 'left' | 'right'>;
|
8165 | /**
|
8166 | * Can be `undefined`, `mouseDown`, `mouseUp`, `mouseMove`, `mouseEnter`,
|
8167 | * `mouseLeave`, `contextMenu`, `mouseWheel`, `rawKeyDown`, `keyDown`, `keyUp`,
|
8168 | * `char`, `gestureScrollBegin`, `gestureScrollEnd`, `gestureScrollUpdate`,
|
8169 | * `gestureFlingStart`, `gestureFlingCancel`, `gesturePinchBegin`,
|
8170 | * `gesturePinchEnd`, `gesturePinchUpdate`, `gestureTapDown`, `gestureShowPress`,
|
8171 | * `gestureTap`, `gestureTapCancel`, `gestureShortPress`, `gestureLongPress`,
|
8172 | * `gestureLongTap`, `gestureTwoFingerTap`, `gestureTapUnconfirmed`,
|
8173 | * `gestureDoubleTap`, `touchStart`, `touchMove`, `touchEnd`, `touchCancel`,
|
8174 | * `touchScrollStarted`, `pointerDown`, `pointerUp`, `pointerMove`,
|
8175 | * `pointerRawUpdate`, `pointerCancel` or `pointerCausedUaAction`.
|
8176 | */
|
8177 | type: ('undefined' | 'mouseDown' | 'mouseUp' | 'mouseMove' | 'mouseEnter' | 'mouseLeave' | 'contextMenu' | 'mouseWheel' | 'rawKeyDown' | 'keyDown' | 'keyUp' | 'char' | 'gestureScrollBegin' | 'gestureScrollEnd' | 'gestureScrollUpdate' | 'gestureFlingStart' | 'gestureFlingCancel' | 'gesturePinchBegin' | 'gesturePinchEnd' | 'gesturePinchUpdate' | 'gestureTapDown' | 'gestureShowPress' | 'gestureTap' | 'gestureTapCancel' | 'gestureShortPress' | 'gestureLongPress' | 'gestureLongTap' | 'gestureTwoFingerTap' | 'gestureTapUnconfirmed' | 'gestureDoubleTap' | 'touchStart' | 'touchMove' | 'touchEnd' | 'touchCancel' | 'touchScrollStarted' | 'pointerDown' | 'pointerUp' | 'pointerMove' | 'pointerRawUpdate' | 'pointerCancel' | 'pointerCausedUaAction');
|
8178 | }
|
8179 |
|
8180 | interface IpcMain extends NodeJS.EventEmitter {
|
8181 |
|
8182 | // Docs: https://electronjs.org/docs/api/ipc-main
|
8183 |
|
8184 | /**
|
8185 | * Adds a handler for an `invoke`able IPC. This handler will be called whenever a
|
8186 | * renderer calls `ipcRenderer.invoke(channel, ...args)`.
|
8187 | *
|
8188 | * If `listener` returns a Promise, the eventual result of the promise will be
|
8189 | * returned as a reply to the remote caller. Otherwise, the return value of the
|
8190 | * listener will be used as the value of the reply.
|
8191 | *
|
8192 | * The `event` that is passed as the first argument to the handler is the same as
|
8193 | * that passed to a regular event listener. It includes information about which
|
8194 | * WebContents is the source of the invoke request.
|
8195 | *
|
8196 | * Errors thrown through `handle` in the main process are not transparent as they
|
8197 | * are serialized and only the `message` property from the original error is
|
8198 | * provided to the renderer process. Please refer to #24427 for details.
|
8199 | */
|
8200 | handle(channel: string, listener: (event: IpcMainInvokeEvent, ...args: any[]) => (Promise<any>) | (any)): void;
|
8201 | /**
|
8202 | * Handles a single `invoke`able IPC message, then removes the listener. See
|
8203 | * `ipcMain.handle(channel, listener)`.
|
8204 | */
|
8205 | handleOnce(channel: string, listener: (event: IpcMainInvokeEvent, ...args: any[]) => (Promise<any>) | (any)): void;
|
8206 | /**
|
8207 | * Listens to `channel`, when a new message arrives `listener` would be called with
|
8208 | * `listener(event, args...)`.
|
8209 | */
|
8210 | on(channel: string, listener: (event: IpcMainEvent, ...args: any[]) => void): this;
|
8211 | /**
|
8212 | * Adds a one time `listener` function for the event. This `listener` is invoked
|
8213 | * only the next time a message is sent to `channel`, after which it is removed.
|
8214 | */
|
8215 | once(channel: string, listener: (event: IpcMainEvent, ...args: any[]) => void): this;
|
8216 | /**
|
8217 | * Removes listeners of the specified `channel`.
|
8218 | */
|
8219 | removeAllListeners(channel?: string): this;
|
8220 | /**
|
8221 | * Removes any handler for `channel`, if present.
|
8222 | */
|
8223 | removeHandler(channel: string): void;
|
8224 | /**
|
8225 | * Removes the specified `listener` from the listener array for the specified
|
8226 | * `channel`.
|
8227 | */
|
8228 | removeListener(channel: string, listener: (...args: any[]) => void): this;
|
8229 | }
|
8230 |
|
8231 | interface IpcMainEvent extends Event {
|
8232 |
|
8233 | // Docs: https://electronjs.org/docs/api/structures/ipc-main-event
|
8234 |
|
8235 | /**
|
8236 | * The ID of the renderer frame that sent this message
|
8237 | */
|
8238 | frameId: number;
|
8239 | /**
|
8240 | * A list of MessagePorts that were transferred with this message
|
8241 | */
|
8242 | ports: MessagePortMain[];
|
8243 | /**
|
8244 | * The internal ID of the renderer process that sent this message
|
8245 | */
|
8246 | processId: number;
|
8247 | /**
|
8248 | * A function that will send an IPC message to the renderer frame that sent the
|
8249 | * original message that you are currently handling. You should use this method to
|
8250 | * "reply" to the sent message in order to guarantee the reply will go to the
|
8251 | * correct process and frame.
|
8252 | */
|
8253 | reply: (channel: string, ...args: any[]) => void;
|
8254 | /**
|
8255 | * Set this to the value to be returned in a synchronous message
|
8256 | */
|
8257 | returnValue: any;
|
8258 | /**
|
8259 | * Returns the `webContents` that sent the message
|
8260 | */
|
8261 | sender: WebContents;
|
8262 | /**
|
8263 | * The frame that sent this message
|
8264 | *
|
8265 | */
|
8266 | readonly senderFrame: WebFrameMain;
|
8267 | }
|
8268 |
|
8269 | interface IpcMainInvokeEvent extends Event {
|
8270 |
|
8271 | // Docs: https://electronjs.org/docs/api/structures/ipc-main-invoke-event
|
8272 |
|
8273 | /**
|
8274 | * The ID of the renderer frame that sent this message
|
8275 | */
|
8276 | frameId: number;
|
8277 | /**
|
8278 | * The internal ID of the renderer process that sent this message
|
8279 | */
|
8280 | processId: number;
|
8281 | /**
|
8282 | * Returns the `webContents` that sent the message
|
8283 | */
|
8284 | sender: WebContents;
|
8285 | /**
|
8286 | * The frame that sent this message
|
8287 | *
|
8288 | */
|
8289 | readonly senderFrame: WebFrameMain;
|
8290 | }
|
8291 |
|
8292 | interface IpcRenderer extends NodeJS.EventEmitter {
|
8293 |
|
8294 | // Docs: https://electronjs.org/docs/api/ipc-renderer
|
8295 |
|
8296 | /**
|
8297 | * Alias for `ipcRenderer.on`.
|
8298 | */
|
8299 | addListener(channel: string, listener: (event: IpcRendererEvent, ...args: any[]) => void): this;
|
8300 | /**
|
8301 | * Resolves with the response from the main process.
|
8302 | *
|
8303 | * Send a message to the main process via `channel` and expect a result
|
8304 | * asynchronously. Arguments will be serialized with the Structured Clone
|
8305 | * Algorithm, just like `window.postMessage`, so prototype chains will not be
|
8306 | * included. Sending Functions, Promises, Symbols, WeakMaps, or WeakSets will throw
|
8307 | * an exception.
|
8308 | *
|
8309 | * The main process should listen for `channel` with `ipcMain.handle()`.
|
8310 | *
|
8311 | * For example:
|
8312 | *
|
8313 | * If you need to transfer a `MessagePort` to the main process, use
|
8314 | * `ipcRenderer.postMessage`.
|
8315 | *
|
8316 | * If you do not need a response to the message, consider using `ipcRenderer.send`.
|
8317 | *
|
8318 | * > **Note** Sending non-standard JavaScript types such as DOM objects or special
|
8319 | * Electron objects will throw an exception.
|
8320 | *
|
8321 | * Since the main process does not have support for DOM objects such as
|
8322 | * `ImageBitmap`, `File`, `DOMMatrix` and so on, such objects cannot be sent over
|
8323 | * Electron's IPC to the main process, as the main process would have no way to
|
8324 | * decode them. Attempting to send such objects over IPC will result in an error.
|
8325 | *
|
8326 | * > **Note** If the handler in the main process throws an error, the promise
|
8327 | * returned by `invoke` will reject. However, the `Error` object in the renderer
|
8328 | * process will not be the same as the one thrown in the main process.
|
8329 | */
|
8330 | invoke(channel: string, ...args: any[]): Promise<any>;
|
8331 | /**
|
8332 | * Alias for `ipcRenderer.removeListener`.
|
8333 | */
|
8334 | off(channel: string, listener: (event: IpcRendererEvent, ...args: any[]) => void): this;
|
8335 | /**
|
8336 | * Listens to `channel`, when a new message arrives `listener` would be called with
|
8337 | * `listener(event, args...)`.
|
8338 | */
|
8339 | on(channel: string, listener: (event: IpcRendererEvent, ...args: any[]) => void): this;
|
8340 | /**
|
8341 | * Adds a one time `listener` function for the event. This `listener` is invoked
|
8342 | * only the next time a message is sent to `channel`, after which it is removed.
|
8343 | */
|
8344 | once(channel: string, listener: (event: IpcRendererEvent, ...args: any[]) => void): this;
|
8345 | /**
|
8346 | * Send a message to the main process, optionally transferring ownership of zero or
|
8347 | * more `MessagePort` objects.
|
8348 | *
|
8349 | * The transferred `MessagePort` objects will be available in the main process as
|
8350 | * `MessagePortMain` objects by accessing the `ports` property of the emitted
|
8351 | * event.
|
8352 | *
|
8353 | * For example:
|
8354 | *
|
8355 | * For more information on using `MessagePort` and `MessageChannel`, see the MDN
|
8356 | * documentation.
|
8357 | */
|
8358 | postMessage(channel: string, message: any, transfer?: MessagePort[]): void;
|
8359 | /**
|
8360 | * Removes all listeners, or those of the specified `channel`.
|
8361 | */
|
8362 | removeAllListeners(channel: string): this;
|
8363 | /**
|
8364 | * Removes the specified `listener` from the listener array for the specified
|
8365 | * `channel`.
|
8366 | */
|
8367 | removeListener(channel: string, listener: (event: IpcRendererEvent, ...args: any[]) => void): this;
|
8368 | /**
|
8369 | * Send an asynchronous message to the main process via `channel`, along with
|
8370 | * arguments. Arguments will be serialized with the Structured Clone Algorithm,
|
8371 | * just like `window.postMessage`, so prototype chains will not be included.
|
8372 | * Sending Functions, Promises, Symbols, WeakMaps, or WeakSets will throw an
|
8373 | * exception.
|
8374 | *
|
8375 | * > **NOTE:** Sending non-standard JavaScript types such as DOM objects or special
|
8376 | * Electron objects will throw an exception.
|
8377 | *
|
8378 | * Since the main process does not have support for DOM objects such as
|
8379 | * `ImageBitmap`, `File`, `DOMMatrix` and so on, such objects cannot be sent over
|
8380 | * Electron's IPC to the main process, as the main process would have no way to
|
8381 | * decode them. Attempting to send such objects over IPC will result in an error.
|
8382 | *
|
8383 | * The main process handles it by listening for `channel` with the `ipcMain`
|
8384 | * module.
|
8385 | *
|
8386 | * If you need to transfer a `MessagePort` to the main process, use
|
8387 | * `ipcRenderer.postMessage`.
|
8388 | *
|
8389 | * If you want to receive a single response from the main process, like the result
|
8390 | * of a method call, consider using `ipcRenderer.invoke`.
|
8391 | */
|
8392 | send(channel: string, ...args: any[]): void;
|
8393 | /**
|
8394 | * The value sent back by the `ipcMain` handler.
|
8395 | *
|
8396 | * Send a message to the main process via `channel` and expect a result
|
8397 | * synchronously. Arguments will be serialized with the Structured Clone Algorithm,
|
8398 | * just like `window.postMessage`, so prototype chains will not be included.
|
8399 | * Sending Functions, Promises, Symbols, WeakMaps, or WeakSets will throw an
|
8400 | * exception.
|
8401 | *
|
8402 | * > **NOTE:** Sending non-standard JavaScript types such as DOM objects or special
|
8403 | * Electron objects will throw an exception.
|
8404 | *
|
8405 | * Since the main process does not have support for DOM objects such as
|
8406 | * `ImageBitmap`, `File`, `DOMMatrix` and so on, such objects cannot be sent over
|
8407 | * Electron's IPC to the main process, as the main process would have no way to
|
8408 | * decode them. Attempting to send such objects over IPC will result in an error.
|
8409 | *
|
8410 | * The main process handles it by listening for `channel` with `ipcMain` module,
|
8411 | * and replies by setting `event.returnValue`.
|
8412 | *
|
8413 | * > :warning: **WARNING**: Sending a synchronous message will block the whole
|
8414 | * renderer process until the reply is received, so use this method only as a last
|
8415 | * resort. It's much better to use the asynchronous version, `invoke()`.
|
8416 | */
|
8417 | sendSync(channel: string, ...args: any[]): any;
|
8418 | /**
|
8419 | * Like `ipcRenderer.send` but the event will be sent to the `<webview>` element in
|
8420 | * the host page instead of the main process.
|
8421 | */
|
8422 | sendToHost(channel: string, ...args: any[]): void;
|
8423 | }
|
8424 |
|
8425 | interface IpcRendererEvent extends Event {
|
8426 |
|
8427 | // Docs: https://electronjs.org/docs/api/structures/ipc-renderer-event
|
8428 |
|
8429 | /**
|
8430 | * A list of MessagePorts that were transferred with this message
|
8431 | */
|
8432 | ports: MessagePort[];
|
8433 | /**
|
8434 | * The `IpcRenderer` instance that emitted the event originally
|
8435 | */
|
8436 | sender: IpcRenderer;
|
8437 | }
|
8438 |
|
8439 | interface JumpListCategory {
|
8440 |
|
8441 | // Docs: https://electronjs.org/docs/api/structures/jump-list-category
|
8442 |
|
8443 | /**
|
8444 | * Array of `JumpListItem` objects if `type` is `tasks` or `custom`, otherwise it
|
8445 | * should be omitted.
|
8446 | */
|
8447 | items?: JumpListItem[];
|
8448 | /**
|
8449 | * Must be set if `type` is `custom`, otherwise it should be omitted.
|
8450 | */
|
8451 | name?: string;
|
8452 | /**
|
8453 | * One of the following:
|
8454 | */
|
8455 | type?: ('tasks' | 'frequent' | 'recent' | 'custom');
|
8456 | }
|
8457 |
|
8458 | interface JumpListItem {
|
8459 |
|
8460 | // Docs: https://electronjs.org/docs/api/structures/jump-list-item
|
8461 |
|
8462 | /**
|
8463 | * The command line arguments when `program` is executed. Should only be set if
|
8464 | * `type` is `task`.
|
8465 | */
|
8466 | args?: string;
|
8467 | /**
|
8468 | * Description of the task (displayed in a tooltip). Should only be set if `type`
|
8469 | * is `task`. Maximum length 260 characters.
|
8470 | */
|
8471 | description?: string;
|
8472 | /**
|
8473 | * The index of the icon in the resource file. If a resource file contains multiple
|
8474 | * icons this value can be used to specify the zero-based index of the icon that
|
8475 | * should be displayed for this task. If a resource file contains only one icon,
|
8476 | * this property should be set to zero.
|
8477 | */
|
8478 | iconIndex?: number;
|
8479 | /**
|
8480 | * The absolute path to an icon to be displayed in a Jump List, which can be an
|
8481 | * arbitrary resource file that contains an icon (e.g. `.ico`, `.exe`, `.dll`). You
|
8482 | * can usually specify `process.execPath` to show the program icon.
|
8483 | */
|
8484 | iconPath?: string;
|
8485 | /**
|
8486 | * Path of the file to open, should only be set if `type` is `file`.
|
8487 | */
|
8488 | path?: string;
|
8489 | /**
|
8490 | * Path of the program to execute, usually you should specify `process.execPath`
|
8491 | * which opens the current program. Should only be set if `type` is `task`.
|
8492 | */
|
8493 | program?: string;
|
8494 | /**
|
8495 | * The text to be displayed for the item in the Jump List. Should only be set if
|
8496 | * `type` is `task`.
|
8497 | */
|
8498 | title?: string;
|
8499 | /**
|
8500 | * One of the following:
|
8501 | */
|
8502 | type?: ('task' | 'separator' | 'file');
|
8503 | /**
|
8504 | * The working directory. Default is empty.
|
8505 | */
|
8506 | workingDirectory?: string;
|
8507 | }
|
8508 |
|
8509 | interface KeyboardEvent {
|
8510 |
|
8511 | // Docs: https://electronjs.org/docs/api/structures/keyboard-event
|
8512 |
|
8513 | /**
|
8514 | * whether an Alt key was used in an accelerator to trigger the Event
|
8515 | */
|
8516 | altKey?: boolean;
|
8517 | /**
|
8518 | * whether the Control key was used in an accelerator to trigger the Event
|
8519 | */
|
8520 | ctrlKey?: boolean;
|
8521 | /**
|
8522 | * whether a meta key was used in an accelerator to trigger the Event
|
8523 | */
|
8524 | metaKey?: boolean;
|
8525 | /**
|
8526 | * whether a Shift key was used in an accelerator to trigger the Event
|
8527 | */
|
8528 | shiftKey?: boolean;
|
8529 | /**
|
8530 | * whether an accelerator was used to trigger the event as opposed to another user
|
8531 | * gesture like mouse click
|
8532 | */
|
8533 | triggeredByAccelerator?: boolean;
|
8534 | }
|
8535 |
|
8536 | interface KeyboardInputEvent extends InputEvent {
|
8537 |
|
8538 | // Docs: https://electronjs.org/docs/api/structures/keyboard-input-event
|
8539 |
|
8540 | /**
|
8541 | * The character that will be sent as the keyboard event. Should only use the valid
|
8542 | * key codes in Accelerator.
|
8543 | */
|
8544 | keyCode: string;
|
8545 | /**
|
8546 | * The type of the event, can be `rawKeyDown`, `keyDown`, `keyUp` or `char`.
|
8547 | */
|
8548 | type: ('rawKeyDown' | 'keyDown' | 'keyUp' | 'char');
|
8549 | }
|
8550 |
|
8551 | interface MediaAccessPermissionRequest extends PermissionRequest {
|
8552 |
|
8553 | // Docs: https://electronjs.org/docs/api/structures/media-access-permission-request
|
8554 |
|
8555 | /**
|
8556 | * The types of media access being requested - elements can be `video` or `audio`.
|
8557 | */
|
8558 | mediaTypes?: Array<'video' | 'audio'>;
|
8559 | /**
|
8560 | * The security origin of the request.
|
8561 | */
|
8562 | securityOrigin?: string;
|
8563 | }
|
8564 |
|
8565 | interface MemoryInfo {
|
8566 |
|
8567 | // Docs: https://electronjs.org/docs/api/structures/memory-info
|
8568 |
|
8569 | /**
|
8570 | * The maximum amount of memory that has ever been pinned to actual physical RAM.
|
8571 | */
|
8572 | peakWorkingSetSize: number;
|
8573 | /**
|
8574 | * The amount of memory not shared by other processes, such as JS heap or HTML
|
8575 | * content.
|
8576 | *
|
8577 | * @platform win32
|
8578 | */
|
8579 | privateBytes?: number;
|
8580 | /**
|
8581 | * The amount of memory currently pinned to actual physical RAM.
|
8582 | */
|
8583 | workingSetSize: number;
|
8584 | }
|
8585 |
|
8586 | interface MemoryUsageDetails {
|
8587 |
|
8588 | // Docs: https://electronjs.org/docs/api/structures/memory-usage-details
|
8589 |
|
8590 | count: number;
|
8591 | liveSize: number;
|
8592 | size: number;
|
8593 | }
|
8594 |
|
8595 | class Menu extends NodeEventEmitter {
|
8596 |
|
8597 | // Docs: https://electronjs.org/docs/api/menu
|
8598 |
|
8599 | /**
|
8600 | * Emitted when a popup is closed either manually or with `menu.closePopup()`.
|
8601 | */
|
8602 | on(event: 'menu-will-close', listener: (event: Event) => void): this;
|
8603 | off(event: 'menu-will-close', listener: (event: Event) => void): this;
|
8604 | once(event: 'menu-will-close', listener: (event: Event) => void): this;
|
8605 | addListener(event: 'menu-will-close', listener: (event: Event) => void): this;
|
8606 | removeListener(event: 'menu-will-close', listener: (event: Event) => void): this;
|
8607 | /**
|
8608 | * Emitted when `menu.popup()` is called.
|
8609 | */
|
8610 | on(event: 'menu-will-show', listener: (event: Event) => void): this;
|
8611 | off(event: 'menu-will-show', listener: (event: Event) => void): this;
|
8612 | once(event: 'menu-will-show', listener: (event: Event) => void): this;
|
8613 | addListener(event: 'menu-will-show', listener: (event: Event) => void): this;
|
8614 | removeListener(event: 'menu-will-show', listener: (event: Event) => void): this;
|
8615 | /**
|
8616 | * Menu
|
8617 | */
|
8618 | constructor();
|
8619 | /**
|
8620 | * Generally, the `template` is an array of `options` for constructing a MenuItem.
|
8621 | * The usage can be referenced above.
|
8622 | *
|
8623 | * You can also attach other fields to the element of the `template` and they will
|
8624 | * become properties of the constructed menu items.
|
8625 | */
|
8626 | static buildFromTemplate(template: Array<(MenuItemConstructorOptions) | (MenuItem)>): Menu;
|
8627 | /**
|
8628 | * The application menu, if set, or `null`, if not set.
|
8629 | *
|
8630 | * **Note:** The returned `Menu` instance doesn't support dynamic addition or
|
8631 | * removal of menu items. Instance properties can still be dynamically modified.
|
8632 | */
|
8633 | static getApplicationMenu(): (Menu) | (null);
|
8634 | /**
|
8635 | * Sends the `action` to the first responder of application. This is used for
|
8636 | * emulating default macOS menu behaviors. Usually you would use the `role`
|
8637 | * property of a `MenuItem`.
|
8638 | *
|
8639 | * See the macOS Cocoa Event Handling Guide for more information on macOS' native
|
8640 | * actions.
|
8641 | *
|
8642 | * @platform darwin
|
8643 | */
|
8644 | static sendActionToFirstResponder(action: string): void;
|
8645 | /**
|
8646 | * Sets `menu` as the application menu on macOS. On Windows and Linux, the `menu`
|
8647 | * will be set as each window's top menu.
|
8648 | *
|
8649 | * Also on Windows and Linux, you can use a `&` in the top-level item name to
|
8650 | * indicate which letter should get a generated accelerator. For example, using
|
8651 | * `&File` for the file menu would result in a generated `Alt-F` accelerator that
|
8652 | * opens the associated menu. The indicated character in the button label then gets
|
8653 | * an underline, and the `&` character is not displayed on the button label.
|
8654 | *
|
8655 | * In order to escape the `&` character in an item name, add a proceeding `&`. For
|
8656 | * example, `&&File` would result in `&File` displayed on the button label.
|
8657 | *
|
8658 | * Passing `null` will suppress the default menu. On Windows and Linux, this has
|
8659 | * the additional effect of removing the menu bar from the window.
|
8660 | *
|
8661 | * **Note:** The default menu will be created automatically if the app does not set
|
8662 | * one. It contains standard items such as `File`, `Edit`, `View`, `Window` and
|
8663 | * `Help`.
|
8664 | */
|
8665 | static setApplicationMenu(menu: (Menu) | (null)): void;
|
8666 | /**
|
8667 | * Appends the `menuItem` to the menu.
|
8668 | */
|
8669 | append(menuItem: MenuItem): void;
|
8670 | /**
|
8671 | * Closes the context menu in the `browserWindow`.
|
8672 | */
|
8673 | closePopup(browserWindow?: BrowserWindow): void;
|
8674 | /**
|
8675 | * the item with the specified `id`
|
8676 | */
|
8677 | getMenuItemById(id: string): (MenuItem) | (null);
|
8678 | /**
|
8679 | * Inserts the `menuItem` to the `pos` position of the menu.
|
8680 | */
|
8681 | insert(pos: number, menuItem: MenuItem): void;
|
8682 | /**
|
8683 | * Pops up this menu as a context menu in the `BrowserWindow`.
|
8684 | */
|
8685 | popup(options?: PopupOptions): void;
|
8686 | /**
|
8687 | * A `MenuItem[]` array containing the menu's items.
|
8688 | *
|
8689 | * Each `Menu` consists of multiple `MenuItem`s and each `MenuItem` can have a
|
8690 | * submenu.
|
8691 | */
|
8692 | items: MenuItem[];
|
8693 | }
|
8694 |
|
8695 | class MenuItem {
|
8696 |
|
8697 | // Docs: https://electronjs.org/docs/api/menu-item
|
8698 |
|
8699 | /**
|
8700 | * MenuItem
|
8701 | */
|
8702 | constructor(options: MenuItemConstructorOptions);
|
8703 | /**
|
8704 | * An `Accelerator` (optional) indicating the item's accelerator, if set.
|
8705 | */
|
8706 | accelerator?: Accelerator;
|
8707 | /**
|
8708 | * A `boolean` indicating whether the item is checked, this property can be
|
8709 | * dynamically changed.
|
8710 | *
|
8711 | * A `checkbox` menu item will toggle the `checked` property on and off when
|
8712 | * selected.
|
8713 | *
|
8714 | * A `radio` menu item will turn on its `checked` property when clicked, and will
|
8715 | * turn off that property for all adjacent items in the same menu.
|
8716 | *
|
8717 | * You can add a `click` function for additional behavior.
|
8718 | */
|
8719 | checked: boolean;
|
8720 | /**
|
8721 | * A `Function` that is fired when the MenuItem receives a click event. It can be
|
8722 | * called with `menuItem.click(event, focusedWindow, focusedWebContents)`.
|
8723 | *
|
8724 | * * `event` KeyboardEvent
|
8725 | * * `focusedWindow` BaseWindow
|
8726 | * * `focusedWebContents` WebContents
|
8727 | */
|
8728 | click: Function;
|
8729 | /**
|
8730 | * A `number` indicating an item's sequential unique id.
|
8731 | */
|
8732 | commandId: number;
|
8733 | /**
|
8734 | * A `boolean` indicating whether the item is enabled, this property can be
|
8735 | * dynamically changed.
|
8736 | */
|
8737 | enabled: boolean;
|
8738 | /**
|
8739 | * A `NativeImage | string` (optional) indicating the item's icon, if set.
|
8740 | */
|
8741 | icon?: (NativeImage) | (string);
|
8742 | /**
|
8743 | * A `string` indicating the item's unique id, this property can be dynamically
|
8744 | * changed.
|
8745 | */
|
8746 | id: string;
|
8747 | /**
|
8748 | * A `string` indicating the item's visible label.
|
8749 | */
|
8750 | label: string;
|
8751 | /**
|
8752 | * A `Menu` that the item is a part of.
|
8753 | */
|
8754 | menu: Menu;
|
8755 | /**
|
8756 | * A `boolean` indicating if the accelerator should be registered with the system
|
8757 | * or just displayed.
|
8758 | *
|
8759 | * This property can be dynamically changed.
|
8760 | */
|
8761 | registerAccelerator: boolean;
|
8762 | /**
|
8763 | * A `string` (optional) indicating the item's role, if set. Can be `undo`, `redo`,
|
8764 | * `cut`, `copy`, `paste`, `pasteAndMatchStyle`, `delete`, `selectAll`, `reload`,
|
8765 | * `forceReload`, `toggleDevTools`, `resetZoom`, `zoomIn`, `zoomOut`,
|
8766 | * `toggleSpellChecker`, `togglefullscreen`, `window`, `minimize`, `close`, `help`,
|
8767 | * `about`, `services`, `hide`, `hideOthers`, `unhide`, `quit`, `startSpeaking`,
|
8768 | * `stopSpeaking`, `zoom`, `front`, `appMenu`, `fileMenu`, `editMenu`, `viewMenu`,
|
8769 | * `shareMenu`, `recentDocuments`, `toggleTabBar`, `selectNextTab`,
|
8770 | * `selectPreviousTab`, `showAllTabs`, `mergeAllWindows`, `clearRecentDocuments`,
|
8771 | * `moveTabToNewWindow` or `windowMenu`
|
8772 | */
|
8773 | role?: ('undo' | 'redo' | 'cut' | 'copy' | 'paste' | 'pasteAndMatchStyle' | 'delete' | 'selectAll' | 'reload' | 'forceReload' | 'toggleDevTools' | 'resetZoom' | 'zoomIn' | 'zoomOut' | 'toggleSpellChecker' | 'togglefullscreen' | 'window' | 'minimize' | 'close' | 'help' | 'about' | 'services' | 'hide' | 'hideOthers' | 'unhide' | 'quit' | 'startSpeaking' | 'stopSpeaking' | 'zoom' | 'front' | 'appMenu' | 'fileMenu' | 'editMenu' | 'viewMenu' | 'shareMenu' | 'recentDocuments' | 'toggleTabBar' | 'selectNextTab' | 'selectPreviousTab' | 'showAllTabs' | 'mergeAllWindows' | 'clearRecentDocuments' | 'moveTabToNewWindow' | 'windowMenu');
|
8774 | /**
|
8775 | * A `SharingItem` indicating the item to share when the `role` is `shareMenu`.
|
8776 | *
|
8777 | * This property can be dynamically changed.
|
8778 | *
|
8779 | * @platform darwin
|
8780 | */
|
8781 | sharingItem: SharingItem;
|
8782 | /**
|
8783 | * A `string` indicating the item's sublabel.
|
8784 | */
|
8785 | sublabel: string;
|
8786 | /**
|
8787 | * A `Menu` (optional) containing the menu item's submenu, if present.
|
8788 | */
|
8789 | submenu?: Menu;
|
8790 | /**
|
8791 | * A `string` indicating the item's hover text.
|
8792 | *
|
8793 | * @platform darwin
|
8794 | */
|
8795 | toolTip: string;
|
8796 | /**
|
8797 | * A `string` indicating the type of the item. Can be `normal`, `separator`,
|
8798 | * `submenu`, `checkbox` or `radio`.
|
8799 | */
|
8800 | type: ('normal' | 'separator' | 'submenu' | 'checkbox' | 'radio');
|
8801 | /**
|
8802 | * An `Accelerator | null` indicating the item's user-assigned accelerator for the
|
8803 | * menu item.
|
8804 | *
|
8805 | * **Note:** This property is only initialized after the `MenuItem` has been added
|
8806 | * to a `Menu`. Either via `Menu.buildFromTemplate` or via
|
8807 | * `Menu.append()/insert()`. Accessing before initialization will just return
|
8808 | * `null`.
|
8809 | *
|
8810 | * @platform darwin
|
8811 | */
|
8812 | readonly userAccelerator: (Accelerator) | (null);
|
8813 | /**
|
8814 | * A `boolean` indicating whether the item is visible, this property can be
|
8815 | * dynamically changed.
|
8816 | */
|
8817 | visible: boolean;
|
8818 | }
|
8819 |
|
8820 | class MessageChannelMain {
|
8821 |
|
8822 | // Docs: https://electronjs.org/docs/api/message-channel-main
|
8823 |
|
8824 | /**
|
8825 | * A `MessagePortMain` property.
|
8826 | */
|
8827 | port1: MessagePortMain;
|
8828 | /**
|
8829 | * A `MessagePortMain` property.
|
8830 | */
|
8831 | port2: MessagePortMain;
|
8832 | }
|
8833 |
|
8834 | class MessagePortMain extends NodeEventEmitter {
|
8835 |
|
8836 | // Docs: https://electronjs.org/docs/api/message-port-main
|
8837 |
|
8838 | /**
|
8839 | * Emitted when the remote end of a MessagePortMain object becomes disconnected.
|
8840 | */
|
8841 | on(event: 'close', listener: () => void): this;
|
8842 | off(event: 'close', listener: () => void): this;
|
8843 | once(event: 'close', listener: () => void): this;
|
8844 | addListener(event: 'close', listener: () => void): this;
|
8845 | removeListener(event: 'close', listener: () => void): this;
|
8846 | /**
|
8847 | * Emitted when a MessagePortMain object receives a message.
|
8848 | */
|
8849 | on(event: 'message', listener: (messageEvent: MessageEvent) => void): this;
|
8850 | off(event: 'message', listener: (messageEvent: MessageEvent) => void): this;
|
8851 | once(event: 'message', listener: (messageEvent: MessageEvent) => void): this;
|
8852 | addListener(event: 'message', listener: (messageEvent: MessageEvent) => void): this;
|
8853 | removeListener(event: 'message', listener: (messageEvent: MessageEvent) => void): this;
|
8854 | /**
|
8855 | * Disconnects the port, so it is no longer active.
|
8856 | */
|
8857 | close(): void;
|
8858 | /**
|
8859 | * Sends a message from the port, and optionally, transfers ownership of objects to
|
8860 | * other browsing contexts.
|
8861 | */
|
8862 | postMessage(message: any, transfer?: MessagePortMain[]): void;
|
8863 | /**
|
8864 | * Starts the sending of messages queued on the port. Messages will be queued until
|
8865 | * this method is called.
|
8866 | */
|
8867 | start(): void;
|
8868 | }
|
8869 |
|
8870 | interface MimeTypedBuffer {
|
8871 |
|
8872 | // Docs: https://electronjs.org/docs/api/structures/mime-typed-buffer
|
8873 |
|
8874 | /**
|
8875 | * Charset of the buffer.
|
8876 | */
|
8877 | charset?: string;
|
8878 | /**
|
8879 | * The actual Buffer content.
|
8880 | */
|
8881 | data: Buffer;
|
8882 | /**
|
8883 | * MIME type of the buffer.
|
8884 | */
|
8885 | mimeType?: string;
|
8886 | }
|
8887 |
|
8888 | interface MouseInputEvent extends InputEvent {
|
8889 |
|
8890 | // Docs: https://electronjs.org/docs/api/structures/mouse-input-event
|
8891 |
|
8892 | /**
|
8893 | * The button pressed, can be `left`, `middle`, `right`.
|
8894 | */
|
8895 | button?: ('left' | 'middle' | 'right');
|
8896 | clickCount?: number;
|
8897 | globalX?: number;
|
8898 | globalY?: number;
|
8899 | movementX?: number;
|
8900 | movementY?: number;
|
8901 | /**
|
8902 | * The type of the event, can be `mouseDown`, `mouseUp`, `mouseEnter`,
|
8903 | * `mouseLeave`, `contextMenu`, `mouseWheel` or `mouseMove`.
|
8904 | */
|
8905 | type: ('mouseDown' | 'mouseUp' | 'mouseEnter' | 'mouseLeave' | 'contextMenu' | 'mouseWheel' | 'mouseMove');
|
8906 | x: number;
|
8907 | y: number;
|
8908 | }
|
8909 |
|
8910 | interface MouseWheelInputEvent extends MouseInputEvent {
|
8911 |
|
8912 | // Docs: https://electronjs.org/docs/api/structures/mouse-wheel-input-event
|
8913 |
|
8914 | accelerationRatioX?: number;
|
8915 | accelerationRatioY?: number;
|
8916 | canScroll?: boolean;
|
8917 | deltaX?: number;
|
8918 | deltaY?: number;
|
8919 | hasPreciseScrollingDeltas?: boolean;
|
8920 | /**
|
8921 | * The type of the event, can be `mouseWheel`.
|
8922 | */
|
8923 | type: ('mouseWheel');
|
8924 | wheelTicksX?: number;
|
8925 | wheelTicksY?: number;
|
8926 | }
|
8927 |
|
8928 | class NativeImage {
|
8929 |
|
8930 | // Docs: https://electronjs.org/docs/api/native-image
|
8931 |
|
8932 | /**
|
8933 | * Creates an empty `NativeImage` instance.
|
8934 | */
|
8935 | static createEmpty(): NativeImage;
|
8936 | /**
|
8937 | * Creates a new `NativeImage` instance from `buffer` that contains the raw bitmap
|
8938 | * pixel data returned by `toBitmap()`. The specific format is platform-dependent.
|
8939 | */
|
8940 | static createFromBitmap(buffer: Buffer, options: CreateFromBitmapOptions): NativeImage;
|
8941 | /**
|
8942 | * Creates a new `NativeImage` instance from `buffer`. Tries to decode as PNG or
|
8943 | * JPEG first.
|
8944 | */
|
8945 | static createFromBuffer(buffer: Buffer, options?: CreateFromBufferOptions): NativeImage;
|
8946 | /**
|
8947 | * Creates a new `NativeImage` instance from `dataUrl`, a base 64 encoded Data URL
|
8948 | * string.
|
8949 | */
|
8950 | static createFromDataURL(dataURL: string): NativeImage;
|
8951 | /**
|
8952 | * Creates a new `NativeImage` instance from the `NSImage` that maps to the given
|
8953 | * image name. See Apple's `NSImageName` documentation for a list of possible
|
8954 | * values.
|
8955 | *
|
8956 | * The `hslShift` is applied to the image with the following rules:
|
8957 | *
|
8958 | * * `hsl_shift[0]` (hue): The absolute hue value for the image - 0 and 1 map to 0
|
8959 | * and 360 on the hue color wheel (red).
|
8960 | * * `hsl_shift[1]` (saturation): A saturation shift for the image, with the
|
8961 | * following key values: 0 = remove all color. 0.5 = leave unchanged. 1 = fully
|
8962 | * saturate the image.
|
8963 | * * `hsl_shift[2]` (lightness): A lightness shift for the image, with the
|
8964 | * following key values: 0 = remove all lightness (make all pixels black). 0.5 =
|
8965 | * leave unchanged. 1 = full lightness (make all pixels white).
|
8966 | *
|
8967 | * This means that `[-1, 0, 1]` will make the image completely white and `[-1, 1,
|
8968 | * 0]` will make the image completely black.
|
8969 | *
|
8970 | * In some cases, the `NSImageName` doesn't match its string representation; one
|
8971 | * example of this is `NSFolderImageName`, whose string representation would
|
8972 | * actually be `NSFolder`. Therefore, you'll need to determine the correct string
|
8973 | * representation for your image before passing it in. This can be done with the
|
8974 | * following:
|
8975 | *
|
8976 | * where `SYSTEM_IMAGE_NAME` should be replaced with any value from this list.
|
8977 | *
|
8978 | * @platform darwin
|
8979 | */
|
8980 | static createFromNamedImage(imageName: string, hslShift?: number[]): NativeImage;
|
8981 | /**
|
8982 | * Creates a new `NativeImage` instance from a file located at `path`. This method
|
8983 | * returns an empty image if the `path` does not exist, cannot be read, or is not a
|
8984 | * valid image.
|
8985 | */
|
8986 | static createFromPath(path: string): NativeImage;
|
8987 | /**
|
8988 | * fulfilled with the file's thumbnail preview image, which is a NativeImage.
|
8989 | *
|
8990 | * Note: The Windows implementation will ignore `size.height` and scale the height
|
8991 | * according to `size.width`.
|
8992 | *
|
8993 | * @platform darwin,win32
|
8994 | */
|
8995 | static createThumbnailFromPath(path: string, size: Size): Promise<Electron.NativeImage>;
|
8996 | /**
|
8997 | * Add an image representation for a specific scale factor. This can be used to
|
8998 | * programmatically add different scale factor representations to an image. This
|
8999 | * can be called on empty images.
|
9000 | */
|
9001 | addRepresentation(options: AddRepresentationOptions): void;
|
9002 | /**
|
9003 | * The cropped image.
|
9004 | */
|
9005 | crop(rect: Rectangle): NativeImage;
|
9006 | /**
|
9007 | * The image's aspect ratio (width divided by height).
|
9008 | *
|
9009 | * If `scaleFactor` is passed, this will return the aspect ratio corresponding to
|
9010 | * the image representation most closely matching the passed value.
|
9011 | */
|
9012 | getAspectRatio(scaleFactor?: number): number;
|
9013 | /**
|
9014 | * A Buffer that contains the image's raw bitmap pixel data.
|
9015 | *
|
9016 | * The difference between `getBitmap()` and `toBitmap()` is that `getBitmap()` does
|
9017 | * not copy the bitmap data, so you have to use the returned Buffer immediately in
|
9018 | * current event loop tick; otherwise the data might be changed or destroyed.
|
9019 | */
|
9020 | getBitmap(options?: BitmapOptions): Buffer;
|
9021 | /**
|
9022 | * A Buffer that stores C pointer to underlying native handle of the image. On
|
9023 | * macOS, a pointer to `NSImage` instance is returned.
|
9024 | *
|
9025 | * Notice that the returned pointer is a weak pointer to the underlying native
|
9026 | * image instead of a copy, so you _must_ ensure that the associated `nativeImage`
|
9027 | * instance is kept around.
|
9028 | *
|
9029 | * @platform darwin
|
9030 | */
|
9031 | getNativeHandle(): Buffer;
|
9032 | /**
|
9033 | * An array of all scale factors corresponding to representations for a given
|
9034 | * `NativeImage`.
|
9035 | */
|
9036 | getScaleFactors(): number[];
|
9037 | /**
|
9038 | * If `scaleFactor` is passed, this will return the size corresponding to the image
|
9039 | * representation most closely matching the passed value.
|
9040 | */
|
9041 | getSize(scaleFactor?: number): Size;
|
9042 | /**
|
9043 | * Whether the image is empty.
|
9044 | */
|
9045 | isEmpty(): boolean;
|
9046 | /**
|
9047 | * Whether the image is a macOS template image.
|
9048 | */
|
9049 | isTemplateImage(): boolean;
|
9050 | /**
|
9051 | * The resized image.
|
9052 | *
|
9053 | * If only the `height` or the `width` are specified then the current aspect ratio
|
9054 | * will be preserved in the resized image.
|
9055 | */
|
9056 | resize(options: ResizeOptions): NativeImage;
|
9057 | /**
|
9058 | * Marks the image as a macOS template image.
|
9059 | */
|
9060 | setTemplateImage(option: boolean): void;
|
9061 | /**
|
9062 | * A Buffer that contains a copy of the image's raw bitmap pixel data.
|
9063 | */
|
9064 | toBitmap(options?: ToBitmapOptions): Buffer;
|
9065 | /**
|
9066 | * The Data URL of the image.
|
9067 | */
|
9068 | toDataURL(options?: ToDataURLOptions): string;
|
9069 | /**
|
9070 | * A Buffer that contains the image's `JPEG` encoded data.
|
9071 | */
|
9072 | toJPEG(quality: number): Buffer;
|
9073 | /**
|
9074 | * A Buffer that contains the image's `PNG` encoded data.
|
9075 | */
|
9076 | toPNG(options?: ToPNGOptions): Buffer;
|
9077 | /**
|
9078 | * A `boolean` property that determines whether the image is considered a template
|
9079 | * image.
|
9080 | *
|
9081 | * Please note that this property only has an effect on macOS.
|
9082 | *
|
9083 | * @platform darwin
|
9084 | */
|
9085 | isMacTemplateImage: boolean;
|
9086 | }
|
9087 |
|
9088 | interface NativeTheme extends NodeJS.EventEmitter {
|
9089 |
|
9090 | // Docs: https://electronjs.org/docs/api/native-theme
|
9091 |
|
9092 | /**
|
9093 | * Emitted when something in the underlying NativeTheme has changed. This normally
|
9094 | * means that either the value of `shouldUseDarkColors`,
|
9095 | * `shouldUseHighContrastColors` or `shouldUseInvertedColorScheme` has changed. You
|
9096 | * will have to check them to determine which one has changed.
|
9097 | */
|
9098 | on(event: 'updated', listener: () => void): this;
|
9099 | off(event: 'updated', listener: () => void): this;
|
9100 | once(event: 'updated', listener: () => void): this;
|
9101 | addListener(event: 'updated', listener: () => void): this;
|
9102 | removeListener(event: 'updated', listener: () => void): this;
|
9103 | /**
|
9104 | * A `boolean` indicating whether Chromium is in forced colors mode, controlled by
|
9105 | * system accessibility settings. Currently, Windows high contrast is the only
|
9106 | * system setting that triggers forced colors mode.
|
9107 | *
|
9108 | * @platform win32
|
9109 | */
|
9110 | readonly inForcedColorsMode: boolean;
|
9111 | /**
|
9112 | * A `boolean` that indicates the whether the user has chosen via system
|
9113 | * accessibility settings to reduce transparency at the OS level.
|
9114 | *
|
9115 | */
|
9116 | readonly prefersReducedTransparency: boolean;
|
9117 | /**
|
9118 | * A `boolean` for if the OS / Chromium currently has a dark mode enabled or is
|
9119 | * being instructed to show a dark-style UI. If you want to modify this value you
|
9120 | * should use `themeSource` below.
|
9121 | *
|
9122 | */
|
9123 | readonly shouldUseDarkColors: boolean;
|
9124 | /**
|
9125 | * A `boolean` for if the OS / Chromium currently has high-contrast mode enabled or
|
9126 | * is being instructed to show a high-contrast UI.
|
9127 | *
|
9128 | * @platform darwin,win32
|
9129 | */
|
9130 | readonly shouldUseHighContrastColors: boolean;
|
9131 | /**
|
9132 | * A `boolean` for if the OS / Chromium currently has an inverted color scheme or
|
9133 | * is being instructed to use an inverted color scheme.
|
9134 | *
|
9135 | * @platform darwin,win32
|
9136 | */
|
9137 | readonly shouldUseInvertedColorScheme: boolean;
|
9138 | /**
|
9139 | * A `string` property that can be `system`, `light` or `dark`. It is used to
|
9140 | * override and supersede the value that Chromium has chosen to use internally.
|
9141 | *
|
9142 | * Setting this property to `system` will remove the override and everything will
|
9143 | * be reset to the OS default. By default `themeSource` is `system`.
|
9144 | *
|
9145 | * Settings this property to `dark` will have the following effects:
|
9146 | *
|
9147 | * * `nativeTheme.shouldUseDarkColors` will be `true` when accessed
|
9148 | * * Any UI Electron renders on Linux and Windows including context menus,
|
9149 | * devtools, etc. will use the dark UI.
|
9150 | * * Any UI the OS renders on macOS including menus, window frames, etc. will use
|
9151 | * the dark UI.
|
9152 | * * The `prefers-color-scheme` CSS query will match `dark` mode.
|
9153 | * * The `updated` event will be emitted
|
9154 | *
|
9155 | * Settings this property to `light` will have the following effects:
|
9156 | *
|
9157 | * * `nativeTheme.shouldUseDarkColors` will be `false` when accessed
|
9158 | * * Any UI Electron renders on Linux and Windows including context menus,
|
9159 | * devtools, etc. will use the light UI.
|
9160 | * * Any UI the OS renders on macOS including menus, window frames, etc. will use
|
9161 | * the light UI.
|
9162 | * * The `prefers-color-scheme` CSS query will match `light` mode.
|
9163 | * * The `updated` event will be emitted
|
9164 | *
|
9165 | * The usage of this property should align with a classic "dark mode" state machine
|
9166 | * in your application where the user has three options.
|
9167 | *
|
9168 | * * `Follow OS` --> `themeSource = 'system'`
|
9169 | * * `Dark Mode` --> `themeSource = 'dark'`
|
9170 | * * `Light Mode` --> `themeSource = 'light'`
|
9171 | *
|
9172 | * Your application should then always use `shouldUseDarkColors` to determine what
|
9173 | * CSS to apply.
|
9174 | */
|
9175 | themeSource: ('system' | 'light' | 'dark');
|
9176 | }
|
9177 |
|
9178 | interface NavigationEntry {
|
9179 |
|
9180 | // Docs: https://electronjs.org/docs/api/structures/navigation-entry
|
9181 |
|
9182 | title: string;
|
9183 | url: string;
|
9184 | }
|
9185 |
|
9186 | class NavigationHistory {
|
9187 |
|
9188 | // Docs: https://electronjs.org/docs/api/navigation-history
|
9189 |
|
9190 | /**
|
9191 | * Whether the browser can go back to previous web page.
|
9192 | */
|
9193 | canGoBack(): boolean;
|
9194 | /**
|
9195 | * Whether the browser can go forward to next web page.
|
9196 | */
|
9197 | canGoForward(): boolean;
|
9198 | /**
|
9199 | * Whether the web page can go to the specified `offset` from the current entry.
|
9200 | */
|
9201 | canGoToOffset(offset: number): boolean;
|
9202 | /**
|
9203 | * Clears the navigation history.
|
9204 | */
|
9205 | clear(): void;
|
9206 | /**
|
9207 | * The index of the current page, from which we would go back/forward or reload.
|
9208 | */
|
9209 | getActiveIndex(): number;
|
9210 | /**
|
9211 | * WebContents complete history.
|
9212 | */
|
9213 | getAllEntries(): NavigationEntry[];
|
9214 | /**
|
9215 | * Navigation entry at the given index.
|
9216 | *
|
9217 | * If index is out of bounds (greater than history length or less than 0), null
|
9218 | * will be returned.
|
9219 | */
|
9220 | getEntryAtIndex(index: number): NavigationEntry;
|
9221 | /**
|
9222 | * Makes the browser go back a web page.
|
9223 | */
|
9224 | goBack(): void;
|
9225 | /**
|
9226 | * Makes the browser go forward a web page.
|
9227 | */
|
9228 | goForward(): void;
|
9229 | /**
|
9230 | * Navigates browser to the specified absolute web page index.
|
9231 | */
|
9232 | goToIndex(index: number): void;
|
9233 | /**
|
9234 | * Navigates to the specified offset from the current entry.
|
9235 | */
|
9236 | goToOffset(offset: number): void;
|
9237 | /**
|
9238 | * History length.
|
9239 | */
|
9240 | length(): number;
|
9241 | /**
|
9242 | * Removes the navigation entry at the given index. Can't remove entry at the
|
9243 | * "current active index".
|
9244 | *
|
9245 | * Whether the navigation entry was removed from the webContents history.
|
9246 | */
|
9247 | removeEntryAtIndex(index: number): boolean;
|
9248 | }
|
9249 |
|
9250 | interface Net {
|
9251 |
|
9252 | // Docs: https://electronjs.org/docs/api/net
|
9253 |
|
9254 | /**
|
9255 | * see Response.
|
9256 | *
|
9257 | * Sends a request, similarly to how `fetch()` works in the renderer, using
|
9258 | * Chrome's network stack. This differs from Node's `fetch()`, which uses Node.js's
|
9259 | * HTTP stack.
|
9260 | *
|
9261 | * Example:
|
9262 | *
|
9263 | * This method will issue requests from the default session. To send a `fetch`
|
9264 | * request from another session, use ses.fetch().
|
9265 | *
|
9266 | * See the MDN documentation for `fetch()` for more details.
|
9267 | *
|
9268 | * Limitations:
|
9269 | *
|
9270 | * * `net.fetch()` does not support the `data:` or `blob:` schemes.
|
9271 | * * The value of the `integrity` option is ignored.
|
9272 | * * The `.type` and `.url` values of the returned `Response` object are incorrect.
|
9273 | *
|
9274 | * By default, requests made with `net.fetch` can be made to custom protocols as
|
9275 | * well as `file:`, and will trigger webRequest handlers if present. When the
|
9276 | * non-standard `bypassCustomProtocolHandlers` option is set in RequestInit, custom
|
9277 | * protocol handlers will not be called for this request. This allows forwarding an
|
9278 | * intercepted request to the built-in handler. webRequest handlers will still be
|
9279 | * triggered when bypassing custom protocols.
|
9280 | *
|
9281 | * Note: in the utility process custom protocols are not supported.
|
9282 | */
|
9283 | fetch(input: (string) | (GlobalRequest), init?: RequestInit & { bypassCustomProtocolHandlers?: boolean }): Promise<GlobalResponse>;
|
9284 | /**
|
9285 | * Whether there is currently internet connection.
|
9286 | *
|
9287 | * A return value of `false` is a pretty strong indicator that the user won't be
|
9288 | * able to connect to remote sites. However, a return value of `true` is
|
9289 | * inconclusive; even if some link is up, it is uncertain whether a particular
|
9290 | * connection attempt to a particular remote site will be successful.
|
9291 | */
|
9292 | isOnline(): boolean;
|
9293 | /**
|
9294 | * Creates a `ClientRequest` instance using the provided `options` which are
|
9295 | * directly forwarded to the `ClientRequest` constructor. The `net.request` method
|
9296 | * would be used to issue both secure and insecure HTTP requests according to the
|
9297 | * specified protocol scheme in the `options` object.
|
9298 | */
|
9299 | request(options: (ClientRequestConstructorOptions) | (string)): ClientRequest;
|
9300 | /**
|
9301 | * Resolves with the resolved IP addresses for the `host`.
|
9302 | *
|
9303 | * This method will resolve hosts from the default session. To resolve a host from
|
9304 | * another session, use ses.resolveHost().
|
9305 | */
|
9306 | resolveHost(host: string, options?: ResolveHostOptions): Promise<Electron.ResolvedHost>;
|
9307 | /**
|
9308 | * A `boolean` property. Whether there is currently internet connection.
|
9309 | *
|
9310 | * A return value of `false` is a pretty strong indicator that the user won't be
|
9311 | * able to connect to remote sites. However, a return value of `true` is
|
9312 | * inconclusive; even if some link is up, it is uncertain whether a particular
|
9313 | * connection attempt to a particular remote site will be successful.
|
9314 | *
|
9315 | */
|
9316 | readonly online: boolean;
|
9317 | }
|
9318 |
|
9319 | interface NetLog {
|
9320 |
|
9321 | // Docs: https://electronjs.org/docs/api/net-log
|
9322 |
|
9323 | /**
|
9324 | * resolves when the net log has begun recording.
|
9325 | *
|
9326 | * Starts recording network events to `path`.
|
9327 | */
|
9328 | startLogging(path: string, options?: StartLoggingOptions): Promise<void>;
|
9329 | /**
|
9330 | * resolves when the net log has been flushed to disk.
|
9331 | *
|
9332 | * Stops recording network events. If not called, net logging will automatically
|
9333 | * end when app quits.
|
9334 | */
|
9335 | stopLogging(): Promise<void>;
|
9336 | /**
|
9337 | * A `boolean` property that indicates whether network logs are currently being
|
9338 | * recorded.
|
9339 | *
|
9340 | */
|
9341 | readonly currentlyLogging: boolean;
|
9342 | }
|
9343 |
|
9344 | class Notification extends NodeEventEmitter {
|
9345 |
|
9346 | // Docs: https://electronjs.org/docs/api/notification
|
9347 |
|
9348 | /**
|
9349 | * @platform darwin
|
9350 | */
|
9351 | on(event: 'action', listener: (event: Event,
|
9352 | /**
|
9353 | * The index of the action that was activated.
|
9354 | */
|
9355 | index: number) => void): this;
|
9356 | /**
|
9357 | * @platform darwin
|
9358 | */
|
9359 | off(event: 'action', listener: (event: Event,
|
9360 | /**
|
9361 | * The index of the action that was activated.
|
9362 | */
|
9363 | index: number) => void): this;
|
9364 | /**
|
9365 | * @platform darwin
|
9366 | */
|
9367 | once(event: 'action', listener: (event: Event,
|
9368 | /**
|
9369 | * The index of the action that was activated.
|
9370 | */
|
9371 | index: number) => void): this;
|
9372 | /**
|
9373 | * @platform darwin
|
9374 | */
|
9375 | addListener(event: 'action', listener: (event: Event,
|
9376 | /**
|
9377 | * The index of the action that was activated.
|
9378 | */
|
9379 | index: number) => void): this;
|
9380 | /**
|
9381 | * @platform darwin
|
9382 | */
|
9383 | removeListener(event: 'action', listener: (event: Event,
|
9384 | /**
|
9385 | * The index of the action that was activated.
|
9386 | */
|
9387 | index: number) => void): this;
|
9388 | /**
|
9389 | * Emitted when the notification is clicked by the user.
|
9390 | */
|
9391 | on(event: 'click', listener: (event: Event) => void): this;
|
9392 | off(event: 'click', listener: (event: Event) => void): this;
|
9393 | once(event: 'click', listener: (event: Event) => void): this;
|
9394 | addListener(event: 'click', listener: (event: Event) => void): this;
|
9395 | removeListener(event: 'click', listener: (event: Event) => void): this;
|
9396 | /**
|
9397 | * Emitted when the notification is closed by manual intervention from the user.
|
9398 | *
|
9399 | * This event is not guaranteed to be emitted in all cases where the notification
|
9400 | * is closed.
|
9401 | *
|
9402 | * On Windows, the `close` event can be emitted in one of three ways: programmatic
|
9403 | * dismissal with `notification.close()`, by the user closing the notification, or
|
9404 | * via system timeout. If a notification is in the Action Center after the initial
|
9405 | * `close` event is emitted, a call to `notification.close()` will remove the
|
9406 | * notification from the action center but the `close` event will not be emitted
|
9407 | * again.
|
9408 | */
|
9409 | on(event: 'close', listener: (event: Event) => void): this;
|
9410 | off(event: 'close', listener: (event: Event) => void): this;
|
9411 | once(event: 'close', listener: (event: Event) => void): this;
|
9412 | addListener(event: 'close', listener: (event: Event) => void): this;
|
9413 | removeListener(event: 'close', listener: (event: Event) => void): this;
|
9414 | /**
|
9415 | * Emitted when an error is encountered while creating and showing the native
|
9416 | * notification.
|
9417 | *
|
9418 | * @platform win32
|
9419 | */
|
9420 | on(event: 'failed', listener: (event: Event,
|
9421 | /**
|
9422 | * The error encountered during execution of the `show()` method.
|
9423 | */
|
9424 | error: string) => void): this;
|
9425 | /**
|
9426 | * @platform win32
|
9427 | */
|
9428 | off(event: 'failed', listener: (event: Event,
|
9429 | /**
|
9430 | * The error encountered during execution of the `show()` method.
|
9431 | */
|
9432 | error: string) => void): this;
|
9433 | /**
|
9434 | * @platform win32
|
9435 | */
|
9436 | once(event: 'failed', listener: (event: Event,
|
9437 | /**
|
9438 | * The error encountered during execution of the `show()` method.
|
9439 | */
|
9440 | error: string) => void): this;
|
9441 | /**
|
9442 | * @platform win32
|
9443 | */
|
9444 | addListener(event: 'failed', listener: (event: Event,
|
9445 | /**
|
9446 | * The error encountered during execution of the `show()` method.
|
9447 | */
|
9448 | error: string) => void): this;
|
9449 | /**
|
9450 | * @platform win32
|
9451 | */
|
9452 | removeListener(event: 'failed', listener: (event: Event,
|
9453 | /**
|
9454 | * The error encountered during execution of the `show()` method.
|
9455 | */
|
9456 | error: string) => void): this;
|
9457 | /**
|
9458 | * Emitted when the user clicks the "Reply" button on a notification with
|
9459 | * `hasReply: true`.
|
9460 | *
|
9461 | * @platform darwin
|
9462 | */
|
9463 | on(event: 'reply', listener: (event: Event,
|
9464 | /**
|
9465 | * The string the user entered into the inline reply field.
|
9466 | */
|
9467 | reply: string) => void): this;
|
9468 | /**
|
9469 | * @platform darwin
|
9470 | */
|
9471 | off(event: 'reply', listener: (event: Event,
|
9472 | /**
|
9473 | * The string the user entered into the inline reply field.
|
9474 | */
|
9475 | reply: string) => void): this;
|
9476 | /**
|
9477 | * @platform darwin
|
9478 | */
|
9479 | once(event: 'reply', listener: (event: Event,
|
9480 | /**
|
9481 | * The string the user entered into the inline reply field.
|
9482 | */
|
9483 | reply: string) => void): this;
|
9484 | /**
|
9485 | * @platform darwin
|
9486 | */
|
9487 | addListener(event: 'reply', listener: (event: Event,
|
9488 | /**
|
9489 | * The string the user entered into the inline reply field.
|
9490 | */
|
9491 | reply: string) => void): this;
|
9492 | /**
|
9493 | * @platform darwin
|
9494 | */
|
9495 | removeListener(event: 'reply', listener: (event: Event,
|
9496 | /**
|
9497 | * The string the user entered into the inline reply field.
|
9498 | */
|
9499 | reply: string) => void): this;
|
9500 | /**
|
9501 | * Emitted when the notification is shown to the user. Note that this event can be
|
9502 | * fired multiple times as a notification can be shown multiple times through the
|
9503 | * `show()` method.
|
9504 | */
|
9505 | on(event: 'show', listener: (event: Event) => void): this;
|
9506 | off(event: 'show', listener: (event: Event) => void): this;
|
9507 | once(event: 'show', listener: (event: Event) => void): this;
|
9508 | addListener(event: 'show', listener: (event: Event) => void): this;
|
9509 | removeListener(event: 'show', listener: (event: Event) => void): this;
|
9510 | /**
|
9511 | * Notification
|
9512 | */
|
9513 | constructor(options?: NotificationConstructorOptions);
|
9514 | /**
|
9515 | * Whether or not desktop notifications are supported on the current system
|
9516 | */
|
9517 | static isSupported(): boolean;
|
9518 | /**
|
9519 | * Dismisses the notification.
|
9520 | *
|
9521 | * On Windows, calling `notification.close()` while the notification is visible on
|
9522 | * screen will dismiss the notification and remove it from the Action Center. If
|
9523 | * `notification.close()` is called after the notification is no longer visible on
|
9524 | * screen, calling `notification.close()` will try remove it from the Action
|
9525 | * Center.
|
9526 | */
|
9527 | close(): void;
|
9528 | /**
|
9529 | * Immediately shows the notification to the user. Unlike the web notification API,
|
9530 | * instantiating a `new Notification()` does not immediately show it to the user.
|
9531 | * Instead, you need to call this method before the OS will display it.
|
9532 | *
|
9533 | * If the notification has been shown before, this method will dismiss the
|
9534 | * previously shown notification and create a new one with identical properties.
|
9535 | */
|
9536 | show(): void;
|
9537 | /**
|
9538 | * A `NotificationAction[]` property representing the actions of the notification.
|
9539 | */
|
9540 | actions: NotificationAction[];
|
9541 | /**
|
9542 | * A `string` property representing the body of the notification.
|
9543 | */
|
9544 | body: string;
|
9545 | /**
|
9546 | * A `string` property representing the close button text of the notification.
|
9547 | */
|
9548 | closeButtonText: string;
|
9549 | /**
|
9550 | * A `boolean` property representing whether the notification has a reply action.
|
9551 | */
|
9552 | hasReply: boolean;
|
9553 | /**
|
9554 | * A `string` property representing the reply placeholder of the notification.
|
9555 | */
|
9556 | replyPlaceholder: string;
|
9557 | /**
|
9558 | * A `boolean` property representing whether the notification is silent.
|
9559 | */
|
9560 | silent: boolean;
|
9561 | /**
|
9562 | * A `string` property representing the sound of the notification.
|
9563 | */
|
9564 | sound: string;
|
9565 | /**
|
9566 | * A `string` property representing the subtitle of the notification.
|
9567 | */
|
9568 | subtitle: string;
|
9569 | /**
|
9570 | * A `string` property representing the type of timeout duration for the
|
9571 | * notification. Can be 'default' or 'never'.
|
9572 | *
|
9573 | * If `timeoutType` is set to 'never', the notification never expires. It stays
|
9574 | * open until closed by the calling API or the user.
|
9575 | *
|
9576 | * @platform linux,win32
|
9577 | */
|
9578 | timeoutType: ('default' | 'never');
|
9579 | /**
|
9580 | * A `string` property representing the title of the notification.
|
9581 | */
|
9582 | title: string;
|
9583 | /**
|
9584 | * A `string` property representing the custom Toast XML of the notification.
|
9585 | *
|
9586 | * @platform win32
|
9587 | */
|
9588 | toastXml: string;
|
9589 | /**
|
9590 | * A `string` property representing the urgency level of the notification. Can be
|
9591 | * 'normal', 'critical', or 'low'.
|
9592 | *
|
9593 | * Default is 'low' - see NotifyUrgency for more information.
|
9594 | *
|
9595 | * @platform linux
|
9596 | */
|
9597 | urgency: ('normal' | 'critical' | 'low');
|
9598 | }
|
9599 |
|
9600 | interface NotificationAction {
|
9601 |
|
9602 | // Docs: https://electronjs.org/docs/api/structures/notification-action
|
9603 |
|
9604 | /**
|
9605 | * The label for the given action.
|
9606 | */
|
9607 | text?: string;
|
9608 | /**
|
9609 | * The type of action, can be `button`.
|
9610 | */
|
9611 | type: ('button');
|
9612 | }
|
9613 |
|
9614 | interface NotificationResponse {
|
9615 |
|
9616 | // Docs: https://electronjs.org/docs/api/structures/notification-response
|
9617 |
|
9618 | /**
|
9619 | * The identifier string of the action that the user selected.
|
9620 | */
|
9621 | actionIdentifier: string;
|
9622 | /**
|
9623 | * The delivery date of the notification.
|
9624 | */
|
9625 | date: number;
|
9626 | /**
|
9627 | * The unique identifier for this notification request.
|
9628 | */
|
9629 | identifier: string;
|
9630 | /**
|
9631 | * A dictionary of custom information associated with the notification.
|
9632 | */
|
9633 | userInfo: Record<string, any>;
|
9634 | /**
|
9635 | * The text entered or chosen by the user.
|
9636 | */
|
9637 | userText?: string;
|
9638 | }
|
9639 |
|
9640 | interface OpenExternalPermissionRequest extends PermissionRequest {
|
9641 |
|
9642 | // Docs: https://electronjs.org/docs/api/structures/open-external-permission-request
|
9643 |
|
9644 | /**
|
9645 | * The url of the `openExternal` request.
|
9646 | */
|
9647 | externalURL?: string;
|
9648 | }
|
9649 |
|
9650 | interface ParentPort extends NodeJS.EventEmitter {
|
9651 |
|
9652 | // Docs: https://electronjs.org/docs/api/parent-port
|
9653 |
|
9654 | /**
|
9655 | * Emitted when the process receives a message. Messages received on this port will
|
9656 | * be queued up until a handler is registered for this event.
|
9657 | */
|
9658 | on(event: 'message', listener: (messageEvent: MessageEvent) => void): this;
|
9659 | off(event: 'message', listener: (messageEvent: MessageEvent) => void): this;
|
9660 | once(event: 'message', listener: (messageEvent: MessageEvent) => void): this;
|
9661 | addListener(event: 'message', listener: (messageEvent: MessageEvent) => void): this;
|
9662 | removeListener(event: 'message', listener: (messageEvent: MessageEvent) => void): this;
|
9663 | /**
|
9664 | * Sends a message from the process to its parent.
|
9665 | */
|
9666 | postMessage(message: any): void;
|
9667 | }
|
9668 |
|
9669 | interface PaymentDiscount {
|
9670 |
|
9671 | // Docs: https://electronjs.org/docs/api/structures/payment-discount
|
9672 |
|
9673 | /**
|
9674 | * A string used to uniquely identify a discount offer for a product.
|
9675 | */
|
9676 | identifier: string;
|
9677 | /**
|
9678 | * A string that identifies the key used to generate the signature.
|
9679 | */
|
9680 | keyIdentifier: string;
|
9681 | /**
|
9682 | * A universally unique ID (UUID) value that you define.
|
9683 | */
|
9684 | nonce: string;
|
9685 | /**
|
9686 | * A UTF-8 string representing the properties of a specific discount offer,
|
9687 | * cryptographically signed.
|
9688 | */
|
9689 | signature: string;
|
9690 | /**
|
9691 | * The date and time of the signature's creation in milliseconds, formatted in Unix
|
9692 | * epoch time.
|
9693 | */
|
9694 | timestamp: number;
|
9695 | }
|
9696 |
|
9697 | interface PermissionRequest {
|
9698 |
|
9699 | // Docs: https://electronjs.org/docs/api/structures/permission-request
|
9700 |
|
9701 | /**
|
9702 | * Whether the frame making the request is the main frame.
|
9703 | */
|
9704 | isMainFrame: boolean;
|
9705 | /**
|
9706 | * The last URL the requesting frame loaded.
|
9707 | */
|
9708 | requestingUrl: string;
|
9709 | }
|
9710 |
|
9711 | interface Point {
|
9712 |
|
9713 | // Docs: https://electronjs.org/docs/api/structures/point
|
9714 |
|
9715 | x: number;
|
9716 | y: number;
|
9717 | }
|
9718 |
|
9719 | interface PostBody {
|
9720 |
|
9721 | // Docs: https://electronjs.org/docs/api/structures/post-body
|
9722 |
|
9723 | /**
|
9724 | * The boundary used to separate multiple parts of the message. Only valid when
|
9725 | * `contentType` is `multipart/form-data`.
|
9726 | */
|
9727 | boundary?: string;
|
9728 | /**
|
9729 | * The `content-type` header used for the data. One of
|
9730 | * `application/x-www-form-urlencoded` or `multipart/form-data`. Corresponds to the
|
9731 | * `enctype` attribute of the submitted HTML form.
|
9732 | */
|
9733 | contentType: string;
|
9734 | /**
|
9735 | * The post data to be sent to the new window.
|
9736 | */
|
9737 | data: Array<(UploadRawData) | (UploadFile)>;
|
9738 | }
|
9739 |
|
9740 | interface PowerMonitor extends NodeJS.EventEmitter {
|
9741 |
|
9742 | // Docs: https://electronjs.org/docs/api/power-monitor
|
9743 |
|
9744 | /**
|
9745 | * Emitted when the system is about to lock the screen.
|
9746 | *
|
9747 | * @platform darwin,win32
|
9748 | */
|
9749 | on(event: 'lock-screen', listener: () => void): this;
|
9750 | /**
|
9751 | * @platform darwin,win32
|
9752 | */
|
9753 | off(event: 'lock-screen', listener: () => void): this;
|
9754 | /**
|
9755 | * @platform darwin,win32
|
9756 | */
|
9757 | once(event: 'lock-screen', listener: () => void): this;
|
9758 | /**
|
9759 | * @platform darwin,win32
|
9760 | */
|
9761 | addListener(event: 'lock-screen', listener: () => void): this;
|
9762 | /**
|
9763 | * @platform darwin,win32
|
9764 | */
|
9765 | removeListener(event: 'lock-screen', listener: () => void): this;
|
9766 | /**
|
9767 | * Emitted when the system changes to AC power.
|
9768 | *
|
9769 | * @platform darwin,win32
|
9770 | */
|
9771 | on(event: 'on-ac', listener: () => void): this;
|
9772 | /**
|
9773 | * @platform darwin,win32
|
9774 | */
|
9775 | off(event: 'on-ac', listener: () => void): this;
|
9776 | /**
|
9777 | * @platform darwin,win32
|
9778 | */
|
9779 | once(event: 'on-ac', listener: () => void): this;
|
9780 | /**
|
9781 | * @platform darwin,win32
|
9782 | */
|
9783 | addListener(event: 'on-ac', listener: () => void): this;
|
9784 | /**
|
9785 | * @platform darwin,win32
|
9786 | */
|
9787 | removeListener(event: 'on-ac', listener: () => void): this;
|
9788 | /**
|
9789 | * Emitted when system changes to battery power.
|
9790 | *
|
9791 | * @platform darwin
|
9792 | */
|
9793 | on(event: 'on-battery', listener: () => void): this;
|
9794 | /**
|
9795 | * @platform darwin
|
9796 | */
|
9797 | off(event: 'on-battery', listener: () => void): this;
|
9798 | /**
|
9799 | * @platform darwin
|
9800 | */
|
9801 | once(event: 'on-battery', listener: () => void): this;
|
9802 | /**
|
9803 | * @platform darwin
|
9804 | */
|
9805 | addListener(event: 'on-battery', listener: () => void): this;
|
9806 | /**
|
9807 | * @platform darwin
|
9808 | */
|
9809 | removeListener(event: 'on-battery', listener: () => void): this;
|
9810 | /**
|
9811 | * Emitted when system is resuming.
|
9812 | */
|
9813 | on(event: 'resume', listener: () => void): this;
|
9814 | off(event: 'resume', listener: () => void): this;
|
9815 | once(event: 'resume', listener: () => void): this;
|
9816 | addListener(event: 'resume', listener: () => void): this;
|
9817 | removeListener(event: 'resume', listener: () => void): this;
|
9818 | /**
|
9819 | * Emitted when the system is about to reboot or shut down. If the event handler
|
9820 | * invokes `e.preventDefault()`, Electron will attempt to delay system shutdown in
|
9821 | * order for the app to exit cleanly. If `e.preventDefault()` is called, the app
|
9822 | * should exit as soon as possible by calling something like `app.quit()`.
|
9823 | *
|
9824 | * @platform linux,darwin
|
9825 | */
|
9826 | on(event: 'shutdown', listener: () => void): this;
|
9827 | /**
|
9828 | * @platform linux,darwin
|
9829 | */
|
9830 | off(event: 'shutdown', listener: () => void): this;
|
9831 | /**
|
9832 | * @platform linux,darwin
|
9833 | */
|
9834 | once(event: 'shutdown', listener: () => void): this;
|
9835 | /**
|
9836 | * @platform linux,darwin
|
9837 | */
|
9838 | addListener(event: 'shutdown', listener: () => void): this;
|
9839 | /**
|
9840 | * @platform linux,darwin
|
9841 | */
|
9842 | removeListener(event: 'shutdown', listener: () => void): this;
|
9843 | /**
|
9844 | * Notification of a change in the operating system's advertised speed limit for
|
9845 | * CPUs, in percent. Values below 100 indicate that the system is impairing
|
9846 | * processing power due to thermal management.
|
9847 | *
|
9848 | * @platform darwin,win32
|
9849 | */
|
9850 | on(event: 'speed-limit-change', listener: () => void): this;
|
9851 | /**
|
9852 | * @platform darwin,win32
|
9853 | */
|
9854 | off(event: 'speed-limit-change', listener: () => void): this;
|
9855 | /**
|
9856 | * @platform darwin,win32
|
9857 | */
|
9858 | once(event: 'speed-limit-change', listener: () => void): this;
|
9859 | /**
|
9860 | * @platform darwin,win32
|
9861 | */
|
9862 | addListener(event: 'speed-limit-change', listener: () => void): this;
|
9863 | /**
|
9864 | * @platform darwin,win32
|
9865 | */
|
9866 | removeListener(event: 'speed-limit-change', listener: () => void): this;
|
9867 | /**
|
9868 | * Emitted when the system is suspending.
|
9869 | */
|
9870 | on(event: 'suspend', listener: () => void): this;
|
9871 | off(event: 'suspend', listener: () => void): this;
|
9872 | once(event: 'suspend', listener: () => void): this;
|
9873 | addListener(event: 'suspend', listener: () => void): this;
|
9874 | removeListener(event: 'suspend', listener: () => void): this;
|
9875 | /**
|
9876 | * Emitted when the thermal state of the system changes. Notification of a change
|
9877 | * in the thermal status of the system, such as entering a critical temperature
|
9878 | * range. Depending on the severity, the system might take steps to reduce said
|
9879 | * temperature, for example, throttling the CPU or switching on the fans if
|
9880 | * available.
|
9881 | *
|
9882 | * Apps may react to the new state by reducing expensive computing tasks (e.g.
|
9883 | * video encoding), or notifying the user. The same state might be received
|
9884 | * repeatedly.
|
9885 | *
|
9886 | * See
|
9887 | * https://developer.apple.com/library/archive/documentation/Performance/Conceptual/power_efficiency_guidelines_osx/RespondToThermalStateChanges.html
|
9888 | *
|
9889 | * @platform darwin
|
9890 | */
|
9891 | on(event: 'thermal-state-change', listener: () => void): this;
|
9892 | /**
|
9893 | * @platform darwin
|
9894 | */
|
9895 | off(event: 'thermal-state-change', listener: () => void): this;
|
9896 | /**
|
9897 | * @platform darwin
|
9898 | */
|
9899 | once(event: 'thermal-state-change', listener: () => void): this;
|
9900 | /**
|
9901 | * @platform darwin
|
9902 | */
|
9903 | addListener(event: 'thermal-state-change', listener: () => void): this;
|
9904 | /**
|
9905 | * @platform darwin
|
9906 | */
|
9907 | removeListener(event: 'thermal-state-change', listener: () => void): this;
|
9908 | /**
|
9909 | * Emitted as soon as the systems screen is unlocked.
|
9910 | *
|
9911 | * @platform darwin,win32
|
9912 | */
|
9913 | on(event: 'unlock-screen', listener: () => void): this;
|
9914 | /**
|
9915 | * @platform darwin,win32
|
9916 | */
|
9917 | off(event: 'unlock-screen', listener: () => void): this;
|
9918 | /**
|
9919 | * @platform darwin,win32
|
9920 | */
|
9921 | once(event: 'unlock-screen', listener: () => void): this;
|
9922 | /**
|
9923 | * @platform darwin,win32
|
9924 | */
|
9925 | addListener(event: 'unlock-screen', listener: () => void): this;
|
9926 | /**
|
9927 | * @platform darwin,win32
|
9928 | */
|
9929 | removeListener(event: 'unlock-screen', listener: () => void): this;
|
9930 | /**
|
9931 | * Emitted when a login session is activated. See documentation for more
|
9932 | * information.
|
9933 | *
|
9934 | * @platform darwin
|
9935 | */
|
9936 | on(event: 'user-did-become-active', listener: () => void): this;
|
9937 | /**
|
9938 | * @platform darwin
|
9939 | */
|
9940 | off(event: 'user-did-become-active', listener: () => void): this;
|
9941 | /**
|
9942 | * @platform darwin
|
9943 | */
|
9944 | once(event: 'user-did-become-active', listener: () => void): this;
|
9945 | /**
|
9946 | * @platform darwin
|
9947 | */
|
9948 | addListener(event: 'user-did-become-active', listener: () => void): this;
|
9949 | /**
|
9950 | * @platform darwin
|
9951 | */
|
9952 | removeListener(event: 'user-did-become-active', listener: () => void): this;
|
9953 | /**
|
9954 | * Emitted when a login session is deactivated. See documentation for more
|
9955 | * information.
|
9956 | *
|
9957 | * @platform darwin
|
9958 | */
|
9959 | on(event: 'user-did-resign-active', listener: () => void): this;
|
9960 | /**
|
9961 | * @platform darwin
|
9962 | */
|
9963 | off(event: 'user-did-resign-active', listener: () => void): this;
|
9964 | /**
|
9965 | * @platform darwin
|
9966 | */
|
9967 | once(event: 'user-did-resign-active', listener: () => void): this;
|
9968 | /**
|
9969 | * @platform darwin
|
9970 | */
|
9971 | addListener(event: 'user-did-resign-active', listener: () => void): this;
|
9972 | /**
|
9973 | * @platform darwin
|
9974 | */
|
9975 | removeListener(event: 'user-did-resign-active', listener: () => void): this;
|
9976 | /**
|
9977 | * The system's current thermal state. Can be `unknown`, `nominal`, `fair`,
|
9978 | * `serious`, or `critical`.
|
9979 | *
|
9980 | * @platform darwin
|
9981 | */
|
9982 | getCurrentThermalState(): ('unknown' | 'nominal' | 'fair' | 'serious' | 'critical');
|
9983 | /**
|
9984 | * The system's current idle state. Can be `active`, `idle`, `locked` or `unknown`.
|
9985 | *
|
9986 | * Calculate the system idle state. `idleThreshold` is the amount of time (in
|
9987 | * seconds) before considered idle. `locked` is available on supported systems
|
9988 | * only.
|
9989 | */
|
9990 | getSystemIdleState(idleThreshold: number): ('active' | 'idle' | 'locked' | 'unknown');
|
9991 | /**
|
9992 | * Idle time in seconds
|
9993 | *
|
9994 | * Calculate system idle time in seconds.
|
9995 | */
|
9996 | getSystemIdleTime(): number;
|
9997 | /**
|
9998 | * Whether the system is on battery power.
|
9999 | *
|
10000 | * To monitor for changes in this property, use the `on-battery` and `on-ac`
|
10001 | * events.
|
10002 | */
|
10003 | isOnBatteryPower(): boolean;
|
10004 | /**
|
10005 | * A `boolean` property. True if the system is on battery power.
|
10006 | *
|
10007 | * See `powerMonitor.isOnBatteryPower()`.
|
10008 | */
|
10009 | onBatteryPower: boolean;
|
10010 | }
|
10011 |
|
10012 | interface PowerSaveBlocker {
|
10013 |
|
10014 | // Docs: https://electronjs.org/docs/api/power-save-blocker
|
10015 |
|
10016 | /**
|
10017 | * Whether the corresponding `powerSaveBlocker` has started.
|
10018 | */
|
10019 | isStarted(id: number): boolean;
|
10020 | /**
|
10021 | * The blocker ID that is assigned to this power blocker.
|
10022 | *
|
10023 | * Starts preventing the system from entering lower-power mode. Returns an integer
|
10024 | * identifying the power save blocker.
|
10025 | *
|
10026 | * **Note:** `prevent-display-sleep` has higher precedence over
|
10027 | * `prevent-app-suspension`. Only the highest precedence type takes effect. In
|
10028 | * other words, `prevent-display-sleep` always takes precedence over
|
10029 | * `prevent-app-suspension`.
|
10030 | *
|
10031 | * For example, an API calling A requests for `prevent-app-suspension`, and another
|
10032 | * calling B requests for `prevent-display-sleep`. `prevent-display-sleep` will be
|
10033 | * used until B stops its request. After that, `prevent-app-suspension` is used.
|
10034 | */
|
10035 | start(type: 'prevent-app-suspension' | 'prevent-display-sleep'): number;
|
10036 | /**
|
10037 | * Stops the specified power save blocker.
|
10038 | *
|
10039 | * Whether the specified `powerSaveBlocker` has been stopped.
|
10040 | */
|
10041 | stop(id: number): boolean;
|
10042 | }
|
10043 |
|
10044 | interface PrinterInfo {
|
10045 |
|
10046 | // Docs: https://electronjs.org/docs/api/structures/printer-info
|
10047 |
|
10048 | /**
|
10049 | * a longer description of the printer's type.
|
10050 | */
|
10051 | description: string;
|
10052 | /**
|
10053 | * the name of the printer as shown in Print Preview.
|
10054 | */
|
10055 | displayName: string;
|
10056 | /**
|
10057 | * whether or not a given printer is set as the default printer on the OS.
|
10058 | */
|
10059 | isDefault: boolean;
|
10060 | /**
|
10061 | * the name of the printer as understood by the OS.
|
10062 | */
|
10063 | name: string;
|
10064 | /**
|
10065 | * an object containing a variable number of platform-specific printer information.
|
10066 | */
|
10067 | options: Options;
|
10068 | /**
|
10069 | * the current status of the printer.
|
10070 | */
|
10071 | status: number;
|
10072 | }
|
10073 |
|
10074 | interface ProcessMemoryInfo {
|
10075 |
|
10076 | // Docs: https://electronjs.org/docs/api/structures/process-memory-info
|
10077 |
|
10078 | /**
|
10079 | * The amount of memory not shared by other processes, such as JS heap or HTML
|
10080 | * content in Kilobytes.
|
10081 | */
|
10082 | private: number;
|
10083 | /**
|
10084 | * The amount of memory currently pinned to actual physical RAM in Kilobytes.
|
10085 | *
|
10086 | * @platform linux,win32
|
10087 | */
|
10088 | residentSet: number;
|
10089 | /**
|
10090 | * The amount of memory shared between processes, typically memory consumed by the
|
10091 | * Electron code itself in Kilobytes.
|
10092 | */
|
10093 | shared: number;
|
10094 | }
|
10095 |
|
10096 | interface ProcessMetric {
|
10097 |
|
10098 | // Docs: https://electronjs.org/docs/api/structures/process-metric
|
10099 |
|
10100 | /**
|
10101 | * CPU usage of the process.
|
10102 | */
|
10103 | cpu: CPUUsage;
|
10104 | /**
|
10105 | * Creation time for this process. The time is represented as number of
|
10106 | * milliseconds since epoch. Since the `pid` can be reused after a process dies, it
|
10107 | * is useful to use both the `pid` and the `creationTime` to uniquely identify a
|
10108 | * process.
|
10109 | */
|
10110 | creationTime: number;
|
10111 | /**
|
10112 | * One of the following values:
|
10113 | *
|
10114 | * @platform win32
|
10115 | */
|
10116 | integrityLevel?: ('untrusted' | 'low' | 'medium' | 'high' | 'unknown');
|
10117 | /**
|
10118 | * Memory information for the process.
|
10119 | */
|
10120 | memory: MemoryInfo;
|
10121 | /**
|
10122 | * The name of the process. Examples for utility: `Audio Service`, `Content
|
10123 | * Decryption Module Service`, `Network Service`, `Video Capture`, etc.
|
10124 | */
|
10125 | name?: string;
|
10126 | /**
|
10127 | * Process id of the process.
|
10128 | */
|
10129 | pid: number;
|
10130 | /**
|
10131 | * Whether the process is sandboxed on OS level.
|
10132 | *
|
10133 | * @platform darwin,win32
|
10134 | */
|
10135 | sandboxed?: boolean;
|
10136 | /**
|
10137 | * The non-localized name of the process.
|
10138 | */
|
10139 | serviceName?: string;
|
10140 | /**
|
10141 | * Process type. One of the following values:
|
10142 | */
|
10143 | type: ('Browser' | 'Tab' | 'Utility' | 'Zygote' | 'Sandbox helper' | 'GPU' | 'Pepper Plugin' | 'Pepper Plugin Broker' | 'Unknown');
|
10144 | }
|
10145 |
|
10146 | interface Product {
|
10147 |
|
10148 | // Docs: https://electronjs.org/docs/api/structures/product
|
10149 |
|
10150 | /**
|
10151 | * 3 character code presenting a product's currency based on the ISO 4217 standard.
|
10152 | */
|
10153 | currencyCode: string;
|
10154 | /**
|
10155 | * An array of discount offers
|
10156 | */
|
10157 | discounts: ProductDiscount[];
|
10158 | /**
|
10159 | * The total size of the content, in bytes.
|
10160 | */
|
10161 | downloadContentLengths: number[];
|
10162 | /**
|
10163 | * A string that identifies the version of the content.
|
10164 | */
|
10165 | downloadContentVersion: string;
|
10166 | /**
|
10167 | * The locale formatted price of the product.
|
10168 | */
|
10169 | formattedPrice: string;
|
10170 | /**
|
10171 | * The object containing introductory price information for the product. available
|
10172 | * for the product.
|
10173 | */
|
10174 | introductoryPrice?: ProductDiscount;
|
10175 | /**
|
10176 | * A boolean value that indicates whether the App Store has downloadable content
|
10177 | * for this product. `true` if at least one file has been associated with the
|
10178 | * product.
|
10179 | */
|
10180 | isDownloadable: boolean;
|
10181 | /**
|
10182 | * A description of the product.
|
10183 | */
|
10184 | localizedDescription: string;
|
10185 | /**
|
10186 | * The name of the product.
|
10187 | */
|
10188 | localizedTitle: string;
|
10189 | /**
|
10190 | * The cost of the product in the local currency.
|
10191 | */
|
10192 | price: number;
|
10193 | /**
|
10194 | * The string that identifies the product to the Apple App Store.
|
10195 | */
|
10196 | productIdentifier: string;
|
10197 | /**
|
10198 | * The identifier of the subscription group to which the subscription belongs.
|
10199 | */
|
10200 | subscriptionGroupIdentifier: string;
|
10201 | /**
|
10202 | * The period details for products that are subscriptions.
|
10203 | */
|
10204 | subscriptionPeriod?: ProductSubscriptionPeriod;
|
10205 | }
|
10206 |
|
10207 | interface ProductDiscount {
|
10208 |
|
10209 | // Docs: https://electronjs.org/docs/api/structures/product-discount
|
10210 |
|
10211 | /**
|
10212 | * A string used to uniquely identify a discount offer for a product.
|
10213 | */
|
10214 | identifier: string;
|
10215 | /**
|
10216 | * An integer that indicates the number of periods the product discount is
|
10217 | * available.
|
10218 | */
|
10219 | numberOfPeriods: number;
|
10220 | /**
|
10221 | * The payment mode for this product discount. Can be `payAsYouGo`, `payUpFront`,
|
10222 | * or `freeTrial`.
|
10223 | */
|
10224 | paymentMode: ('payAsYouGo' | 'payUpFront' | 'freeTrial');
|
10225 | /**
|
10226 | * The discount price of the product in the local currency.
|
10227 | */
|
10228 | price: number;
|
10229 | /**
|
10230 | * The locale used to format the discount price of the product.
|
10231 | */
|
10232 | priceLocale: string;
|
10233 | /**
|
10234 | * An object that defines the period for the product discount.
|
10235 | */
|
10236 | subscriptionPeriod?: ProductSubscriptionPeriod;
|
10237 | /**
|
10238 | * The type of discount offer.
|
10239 | */
|
10240 | type: number;
|
10241 | }
|
10242 |
|
10243 | interface ProductSubscriptionPeriod {
|
10244 |
|
10245 | // Docs: https://electronjs.org/docs/api/structures/product-subscription-period
|
10246 |
|
10247 | /**
|
10248 | * The number of units per subscription period.
|
10249 | */
|
10250 | numberOfUnits: number;
|
10251 | /**
|
10252 | * The increment of time that a subscription period is specified in. Can be `day`,
|
10253 | * `week`, `month`, `year`.
|
10254 | */
|
10255 | unit: ('day' | 'week' | 'month' | 'year');
|
10256 | }
|
10257 |
|
10258 | interface Protocol {
|
10259 |
|
10260 | // Docs: https://electronjs.org/docs/api/protocol
|
10261 |
|
10262 | /**
|
10263 | * Register a protocol handler for `scheme`. Requests made to URLs with this scheme
|
10264 | * will delegate to this handler to determine what response should be sent.
|
10265 | *
|
10266 | * Either a `Response` or a `Promise<Response>` can be returned.
|
10267 | *
|
10268 | * Example:
|
10269 | *
|
10270 | * See the MDN docs for `Request` and `Response` for more details.
|
10271 | */
|
10272 | handle(scheme: string, handler: (request: GlobalRequest) => (GlobalResponse) | (Promise<GlobalResponse>)): void;
|
10273 | /**
|
10274 | * Whether the protocol was successfully intercepted
|
10275 | *
|
10276 | * Intercepts `scheme` protocol and uses `handler` as the protocol's new handler
|
10277 | * which sends a `Buffer` as a response.
|
10278 | *
|
10279 | * @deprecated
|
10280 | */
|
10281 | interceptBufferProtocol(scheme: string, handler: (request: ProtocolRequest, callback: (response: (Buffer) | (ProtocolResponse)) => void) => void): boolean;
|
10282 | /**
|
10283 | * Whether the protocol was successfully intercepted
|
10284 | *
|
10285 | * Intercepts `scheme` protocol and uses `handler` as the protocol's new handler
|
10286 | * which sends a file as a response.
|
10287 | *
|
10288 | * @deprecated
|
10289 | */
|
10290 | interceptFileProtocol(scheme: string, handler: (request: ProtocolRequest, callback: (response: (string) | (ProtocolResponse)) => void) => void): boolean;
|
10291 | /**
|
10292 | * Whether the protocol was successfully intercepted
|
10293 | *
|
10294 | * Intercepts `scheme` protocol and uses `handler` as the protocol's new handler
|
10295 | * which sends a new HTTP request as a response.
|
10296 | *
|
10297 | * @deprecated
|
10298 | */
|
10299 | interceptHttpProtocol(scheme: string, handler: (request: ProtocolRequest, callback: (response: ProtocolResponse) => void) => void): boolean;
|
10300 | /**
|
10301 | * Whether the protocol was successfully intercepted
|
10302 | *
|
10303 | * Same as `protocol.registerStreamProtocol`, except that it replaces an existing
|
10304 | * protocol handler.
|
10305 | *
|
10306 | * @deprecated
|
10307 | */
|
10308 | interceptStreamProtocol(scheme: string, handler: (request: ProtocolRequest, callback: (response: (NodeJS.ReadableStream) | (ProtocolResponse)) => void) => void): boolean;
|
10309 | /**
|
10310 | * Whether the protocol was successfully intercepted
|
10311 | *
|
10312 | * Intercepts `scheme` protocol and uses `handler` as the protocol's new handler
|
10313 | * which sends a `string` as a response.
|
10314 | *
|
10315 | * @deprecated
|
10316 | */
|
10317 | interceptStringProtocol(scheme: string, handler: (request: ProtocolRequest, callback: (response: (string) | (ProtocolResponse)) => void) => void): boolean;
|
10318 | /**
|
10319 | * Whether `scheme` is already handled.
|
10320 | */
|
10321 | isProtocolHandled(scheme: string): boolean;
|
10322 | /**
|
10323 | * Whether `scheme` is already intercepted.
|
10324 | *
|
10325 | * @deprecated
|
10326 | */
|
10327 | isProtocolIntercepted(scheme: string): boolean;
|
10328 | /**
|
10329 | * Whether `scheme` is already registered.
|
10330 | *
|
10331 | * @deprecated
|
10332 | */
|
10333 | isProtocolRegistered(scheme: string): boolean;
|
10334 | /**
|
10335 | * Whether the protocol was successfully registered
|
10336 | *
|
10337 | * Registers a protocol of `scheme` that will send a `Buffer` as a response.
|
10338 | *
|
10339 | * The usage is the same with `registerFileProtocol`, except that the `callback`
|
10340 | * should be called with either a `Buffer` object or an object that has the `data`
|
10341 | * property.
|
10342 | *
|
10343 | * Example:
|
10344 | *
|
10345 | * @deprecated
|
10346 | */
|
10347 | registerBufferProtocol(scheme: string, handler: (request: ProtocolRequest, callback: (response: (Buffer) | (ProtocolResponse)) => void) => void): boolean;
|
10348 | /**
|
10349 | * Whether the protocol was successfully registered
|
10350 | *
|
10351 | * Registers a protocol of `scheme` that will send a file as the response. The
|
10352 | * `handler` will be called with `request` and `callback` where `request` is an
|
10353 | * incoming request for the `scheme`.
|
10354 | *
|
10355 | * To handle the `request`, the `callback` should be called with either the file's
|
10356 | * path or an object that has a `path` property, e.g. `callback(filePath)` or
|
10357 | * `callback({ path: filePath })`. The `filePath` must be an absolute path.
|
10358 | *
|
10359 | * By default the `scheme` is treated like `http:`, which is parsed differently
|
10360 | * from protocols that follow the "generic URI syntax" like `file:`.
|
10361 | *
|
10362 | * @deprecated
|
10363 | */
|
10364 | registerFileProtocol(scheme: string, handler: (request: ProtocolRequest, callback: (response: (string) | (ProtocolResponse)) => void) => void): boolean;
|
10365 | /**
|
10366 | * Whether the protocol was successfully registered
|
10367 | *
|
10368 | * Registers a protocol of `scheme` that will send an HTTP request as a response.
|
10369 | *
|
10370 | * The usage is the same with `registerFileProtocol`, except that the `callback`
|
10371 | * should be called with an object that has the `url` property.
|
10372 | *
|
10373 | * @deprecated
|
10374 | */
|
10375 | registerHttpProtocol(scheme: string, handler: (request: ProtocolRequest, callback: (response: ProtocolResponse) => void) => void): boolean;
|
10376 | /**
|
10377 | * **Note:** This method can only be used before the `ready` event of the `app`
|
10378 | * module gets emitted and can be called only once.
|
10379 | *
|
10380 | * Registers the `scheme` as standard, secure, bypasses content security policy for
|
10381 | * resources, allows registering ServiceWorker, supports fetch API, streaming
|
10382 | * video/audio, and V8 code cache. Specify a privilege with the value of `true` to
|
10383 | * enable the capability.
|
10384 | *
|
10385 | * An example of registering a privileged scheme, that bypasses Content Security
|
10386 | * Policy:
|
10387 | *
|
10388 | * A standard scheme adheres to what RFC 3986 calls generic URI syntax. For example
|
10389 | * `http` and `https` are standard schemes, while `file` is not.
|
10390 | *
|
10391 | * Registering a scheme as standard allows relative and absolute resources to be
|
10392 | * resolved correctly when served. Otherwise the scheme will behave like the `file`
|
10393 | * protocol, but without the ability to resolve relative URLs.
|
10394 | *
|
10395 | * For example when you load following page with custom protocol without
|
10396 | * registering it as standard scheme, the image will not be loaded because
|
10397 | * non-standard schemes can not recognize relative URLs:
|
10398 | *
|
10399 | * Registering a scheme as standard will allow access to files through the
|
10400 | * FileSystem API. Otherwise the renderer will throw a security error for the
|
10401 | * scheme.
|
10402 | *
|
10403 | * By default web storage apis (localStorage, sessionStorage, webSQL, indexedDB,
|
10404 | * cookies) are disabled for non standard schemes. So in general if you want to
|
10405 | * register a custom protocol to replace the `http` protocol, you have to register
|
10406 | * it as a standard scheme.
|
10407 | *
|
10408 | * Protocols that use streams (http and stream protocols) should set `stream:
|
10409 | * true`. The `<video>` and `<audio>` HTML elements expect protocols to buffer
|
10410 | * their responses by default. The `stream` flag configures those elements to
|
10411 | * correctly expect streaming responses.
|
10412 | */
|
10413 | registerSchemesAsPrivileged(customSchemes: CustomScheme[]): void;
|
10414 | /**
|
10415 | * Whether the protocol was successfully registered
|
10416 | *
|
10417 | * Registers a protocol of `scheme` that will send a stream as a response.
|
10418 | *
|
10419 | * The usage is the same with `registerFileProtocol`, except that the `callback`
|
10420 | * should be called with either a `ReadableStream` object or an object that has the
|
10421 | * `data` property.
|
10422 | *
|
10423 | * Example:
|
10424 | *
|
10425 | * It is possible to pass any object that implements the readable stream API (emits
|
10426 | * `data`/`end`/`error` events). For example, here's how a file could be returned:
|
10427 | *
|
10428 | * @deprecated
|
10429 | */
|
10430 | registerStreamProtocol(scheme: string, handler: (request: ProtocolRequest, callback: (response: (NodeJS.ReadableStream) | (ProtocolResponse)) => void) => void): boolean;
|
10431 | /**
|
10432 | * Whether the protocol was successfully registered
|
10433 | *
|
10434 | * Registers a protocol of `scheme` that will send a `string` as a response.
|
10435 | *
|
10436 | * The usage is the same with `registerFileProtocol`, except that the `callback`
|
10437 | * should be called with either a `string` or an object that has the `data`
|
10438 | * property.
|
10439 | *
|
10440 | * @deprecated
|
10441 | */
|
10442 | registerStringProtocol(scheme: string, handler: (request: ProtocolRequest, callback: (response: (string) | (ProtocolResponse)) => void) => void): boolean;
|
10443 | /**
|
10444 | * Removes a protocol handler registered with `protocol.handle`.
|
10445 | */
|
10446 | unhandle(scheme: string): void;
|
10447 | /**
|
10448 | * Whether the protocol was successfully unintercepted
|
10449 | *
|
10450 | * Remove the interceptor installed for `scheme` and restore its original handler.
|
10451 | *
|
10452 | * @deprecated
|
10453 | */
|
10454 | uninterceptProtocol(scheme: string): boolean;
|
10455 | /**
|
10456 | * Whether the protocol was successfully unregistered
|
10457 | *
|
10458 | * Unregisters the custom protocol of `scheme`.
|
10459 | *
|
10460 | * @deprecated
|
10461 | */
|
10462 | unregisterProtocol(scheme: string): boolean;
|
10463 | }
|
10464 |
|
10465 | interface ProtocolRequest {
|
10466 |
|
10467 | // Docs: https://electronjs.org/docs/api/structures/protocol-request
|
10468 |
|
10469 | headers: Record<string, string>;
|
10470 | method: string;
|
10471 | referrer: string;
|
10472 | uploadData?: UploadData[];
|
10473 | url: string;
|
10474 | }
|
10475 |
|
10476 | interface ProtocolResponse {
|
10477 |
|
10478 | // Docs: https://electronjs.org/docs/api/structures/protocol-response
|
10479 |
|
10480 | /**
|
10481 | * The charset of response body, default is `"utf-8"`.
|
10482 | */
|
10483 | charset?: string;
|
10484 | /**
|
10485 | * The response body. When returning stream as response, this is a Node.js readable
|
10486 | * stream representing the response body. When returning `Buffer` as response, this
|
10487 | * is a `Buffer`. When returning `string` as response, this is a `string`. This is
|
10488 | * ignored for other types of responses.
|
10489 | */
|
10490 | data?: (Buffer) | (string) | (NodeJS.ReadableStream);
|
10491 | /**
|
10492 | * When assigned, the `request` will fail with the `error` number . For the
|
10493 | * available error numbers you can use, please see the net error list.
|
10494 | */
|
10495 | error?: number;
|
10496 | /**
|
10497 | * An object containing the response headers. The keys must be string, and values
|
10498 | * must be either string or Array of string.
|
10499 | */
|
10500 | headers?: Record<string, (string) | (string[])>;
|
10501 | /**
|
10502 | * The HTTP `method`. This is only used for file and URL responses.
|
10503 | */
|
10504 | method?: string;
|
10505 | /**
|
10506 | * The MIME type of response body, default is `"text/html"`. Setting `mimeType`
|
10507 | * would implicitly set the `content-type` header in response, but if
|
10508 | * `content-type` is already set in `headers`, the `mimeType` would be ignored.
|
10509 | */
|
10510 | mimeType?: string;
|
10511 | /**
|
10512 | * Path to the file which would be sent as response body. This is only used for
|
10513 | * file responses.
|
10514 | */
|
10515 | path?: string;
|
10516 | /**
|
10517 | * The `referrer` URL. This is only used for file and URL responses.
|
10518 | */
|
10519 | referrer?: string;
|
10520 | /**
|
10521 | * The session used for requesting URL, by default the HTTP request will reuse the
|
10522 | * current session. Setting `session` to `null` would use a random independent
|
10523 | * session. This is only used for URL responses.
|
10524 | */
|
10525 | session?: Session;
|
10526 | /**
|
10527 | * The HTTP response code, default is 200.
|
10528 | */
|
10529 | statusCode?: number;
|
10530 | /**
|
10531 | * The data used as upload data. This is only used for URL responses when `method`
|
10532 | * is `"POST"`.
|
10533 | */
|
10534 | uploadData?: ProtocolResponseUploadData;
|
10535 | /**
|
10536 | * Download the `url` and pipe the result as response body. This is only used for
|
10537 | * URL responses.
|
10538 | */
|
10539 | url?: string;
|
10540 | }
|
10541 |
|
10542 | interface ProtocolResponseUploadData {
|
10543 |
|
10544 | // Docs: https://electronjs.org/docs/api/structures/protocol-response-upload-data
|
10545 |
|
10546 | /**
|
10547 | * MIME type of the content.
|
10548 | */
|
10549 | contentType: string;
|
10550 | /**
|
10551 | * Content to be sent.
|
10552 | */
|
10553 | data: (string) | (Buffer);
|
10554 | }
|
10555 |
|
10556 | interface ProxyConfig {
|
10557 |
|
10558 | // Docs: https://electronjs.org/docs/api/structures/proxy-config
|
10559 |
|
10560 | /**
|
10561 | * The proxy mode. Should be one of `direct`, `auto_detect`, `pac_script`,
|
10562 | * `fixed_servers` or `system`. Defaults to `pac_script` proxy mode if `pacScript`
|
10563 | * option is specified otherwise defaults to `fixed_servers`.
|
10564 | */
|
10565 | mode?: ('direct' | 'auto_detect' | 'pac_script' | 'fixed_servers' | 'system');
|
10566 | /**
|
10567 | * The URL associated with the PAC file.
|
10568 | */
|
10569 | pacScript?: string;
|
10570 | /**
|
10571 | * Rules indicating which URLs should bypass the proxy settings.
|
10572 | */
|
10573 | proxyBypassRules?: string;
|
10574 | /**
|
10575 | * Rules indicating which proxies to use.
|
10576 | */
|
10577 | proxyRules?: string;
|
10578 | }
|
10579 |
|
10580 | interface PushNotifications extends NodeJS.EventEmitter {
|
10581 |
|
10582 | // Docs: https://electronjs.org/docs/api/push-notifications
|
10583 |
|
10584 | /**
|
10585 | * Emitted when the app receives a remote notification while running. See:
|
10586 | * https://developer.apple.com/documentation/appkit/nsapplicationdelegate/1428430-application?language=objc
|
10587 | *
|
10588 | * @platform darwin
|
10589 | */
|
10590 | on(event: 'received-apns-notification', listener: (event: Event,
|
10591 | userInfo: Record<string, any>) => void): this;
|
10592 | /**
|
10593 | * @platform darwin
|
10594 | */
|
10595 | off(event: 'received-apns-notification', listener: (event: Event,
|
10596 | userInfo: Record<string, any>) => void): this;
|
10597 | /**
|
10598 | * @platform darwin
|
10599 | */
|
10600 | once(event: 'received-apns-notification', listener: (event: Event,
|
10601 | userInfo: Record<string, any>) => void): this;
|
10602 | /**
|
10603 | * @platform darwin
|
10604 | */
|
10605 | addListener(event: 'received-apns-notification', listener: (event: Event,
|
10606 | userInfo: Record<string, any>) => void): this;
|
10607 | /**
|
10608 | * @platform darwin
|
10609 | */
|
10610 | removeListener(event: 'received-apns-notification', listener: (event: Event,
|
10611 | userInfo: Record<string, any>) => void): this;
|
10612 | /**
|
10613 | * Registers the app with Apple Push Notification service (APNS) to receive Badge,
|
10614 | * Sound, and Alert notifications. If registration is successful, the promise will
|
10615 | * be resolved with the APNS device token. Otherwise, the promise will be rejected
|
10616 | * with an error message. See:
|
10617 | * https://developer.apple.com/documentation/appkit/nsapplication/1428476-registerforremotenotificationtyp?language=objc
|
10618 | *
|
10619 | * @platform darwin
|
10620 | */
|
10621 | registerForAPNSNotifications(): Promise<string>;
|
10622 | /**
|
10623 | * Unregisters the app from notifications received from APNS. See:
|
10624 | * https://developer.apple.com/documentation/appkit/nsapplication/1428747-unregisterforremotenotifications?language=objc
|
10625 | *
|
10626 | * @platform darwin
|
10627 | */
|
10628 | unregisterForAPNSNotifications(): void;
|
10629 | }
|
10630 |
|
10631 | interface Rectangle {
|
10632 |
|
10633 | // Docs: https://electronjs.org/docs/api/structures/rectangle
|
10634 |
|
10635 | /**
|
10636 | * The height of the rectangle (must be an integer).
|
10637 | */
|
10638 | height: number;
|
10639 | /**
|
10640 | * The width of the rectangle (must be an integer).
|
10641 | */
|
10642 | width: number;
|
10643 | /**
|
10644 | * The x coordinate of the origin of the rectangle (must be an integer).
|
10645 | */
|
10646 | x: number;
|
10647 | /**
|
10648 | * The y coordinate of the origin of the rectangle (must be an integer).
|
10649 | */
|
10650 | y: number;
|
10651 | }
|
10652 |
|
10653 | interface Referrer {
|
10654 |
|
10655 | // Docs: https://electronjs.org/docs/api/structures/referrer
|
10656 |
|
10657 | /**
|
10658 | * Can be `default`, `unsafe-url`, `no-referrer-when-downgrade`, `no-referrer`,
|
10659 | * `origin`, `strict-origin-when-cross-origin`, `same-origin` or `strict-origin`.
|
10660 | * See the Referrer-Policy spec for more details on the meaning of these values.
|
10661 | */
|
10662 | policy: ('default' | 'unsafe-url' | 'no-referrer-when-downgrade' | 'no-referrer' | 'origin' | 'strict-origin-when-cross-origin' | 'same-origin' | 'strict-origin');
|
10663 | /**
|
10664 | * HTTP Referrer URL.
|
10665 | */
|
10666 | url: string;
|
10667 | }
|
10668 |
|
10669 | interface RenderProcessGoneDetails {
|
10670 |
|
10671 | // Docs: https://electronjs.org/docs/api/structures/render-process-gone-details
|
10672 |
|
10673 | /**
|
10674 | * The exit code of the process, unless `reason` is `launch-failed`, in which case
|
10675 | * `exitCode` will be a platform-specific launch failure error code.
|
10676 | */
|
10677 | exitCode: number;
|
10678 | /**
|
10679 | * The reason the render process is gone. Possible values:
|
10680 | */
|
10681 | reason: ('clean-exit' | 'abnormal-exit' | 'killed' | 'crashed' | 'oom' | 'launch-failed' | 'integrity-failure');
|
10682 | }
|
10683 |
|
10684 | interface ResolvedEndpoint {
|
10685 |
|
10686 | // Docs: https://electronjs.org/docs/api/structures/resolved-endpoint
|
10687 |
|
10688 | address: string;
|
10689 | /**
|
10690 | * One of the following:
|
10691 | */
|
10692 | family: ('ipv4' | 'ipv6' | 'unspec');
|
10693 | }
|
10694 |
|
10695 | interface ResolvedHost {
|
10696 |
|
10697 | // Docs: https://electronjs.org/docs/api/structures/resolved-host
|
10698 |
|
10699 | /**
|
10700 | * resolved DNS entries for the hostname
|
10701 | */
|
10702 | endpoints: ResolvedEndpoint[];
|
10703 | }
|
10704 |
|
10705 | interface SafeStorage {
|
10706 |
|
10707 | // Docs: https://electronjs.org/docs/api/safe-storage
|
10708 |
|
10709 | /**
|
10710 | * the decrypted string. Decrypts the encrypted buffer obtained with
|
10711 | * `safeStorage.encryptString` back into a string.
|
10712 | *
|
10713 | * This function will throw an error if decryption fails.
|
10714 | */
|
10715 | decryptString(encrypted: Buffer): string;
|
10716 | /**
|
10717 | * An array of bytes representing the encrypted string.
|
10718 | *
|
10719 | * This function will throw an error if encryption fails.
|
10720 | */
|
10721 | encryptString(plainText: string): Buffer;
|
10722 | /**
|
10723 | * User friendly name of the password manager selected on Linux.
|
10724 | *
|
10725 | * This function will return one of the following values:
|
10726 | *
|
10727 | * * `basic_text` - When the desktop environment is not recognised or if the
|
10728 | * following command line flag is provided `--password-store="basic"`.
|
10729 | * * `gnome_libsecret` - When the desktop environment is `X-Cinnamon`, `Deepin`,
|
10730 | * `GNOME`, `Pantheon`, `XFCE`, `UKUI`, `unity` or if the following command line
|
10731 | * flag is provided `--password-store="gnome-libsecret"`.
|
10732 | * * `kwallet` - When the desktop session is `kde4` or if the following command
|
10733 | * line flag is provided `--password-store="kwallet"`.
|
10734 | * * `kwallet5` - When the desktop session is `kde5` or if the following command
|
10735 | * line flag is provided `--password-store="kwallet5"`.
|
10736 | * * `kwallet6` - When the desktop session is `kde6`.
|
10737 | * * `unknown` - When the function is called before app has emitted the `ready`
|
10738 | * event.
|
10739 | *
|
10740 | * @platform linux
|
10741 | */
|
10742 | getSelectedStorageBackend(): ('basic_text' | 'gnome_libsecret' | 'kwallet' | 'kwallet5' | 'kwallet6' | 'unknown');
|
10743 | /**
|
10744 | * Whether encryption is available.
|
10745 | *
|
10746 | * On Linux, returns true if the app has emitted the `ready` event and the secret
|
10747 | * key is available. On MacOS, returns true if Keychain is available. On Windows,
|
10748 | * returns true once the app has emitted the `ready` event.
|
10749 | */
|
10750 | isEncryptionAvailable(): boolean;
|
10751 | /**
|
10752 | * This function on Linux will force the module to use an in memory password for
|
10753 | * creating symmetric key that is used for encrypt/decrypt functions when a valid
|
10754 | * OS password manager cannot be determined for the current active desktop
|
10755 | * environment. This function is a no-op on Windows and MacOS.
|
10756 | */
|
10757 | setUsePlainTextEncryption(usePlainText: boolean): void;
|
10758 | }
|
10759 |
|
10760 | interface Screen extends NodeJS.EventEmitter {
|
10761 |
|
10762 | // Docs: https://electronjs.org/docs/api/screen
|
10763 |
|
10764 | /**
|
10765 | * Emitted when `newDisplay` has been added.
|
10766 | */
|
10767 | on(event: 'display-added', listener: (event: Event,
|
10768 | newDisplay: Display) => void): this;
|
10769 | off(event: 'display-added', listener: (event: Event,
|
10770 | newDisplay: Display) => void): this;
|
10771 | once(event: 'display-added', listener: (event: Event,
|
10772 | newDisplay: Display) => void): this;
|
10773 | addListener(event: 'display-added', listener: (event: Event,
|
10774 | newDisplay: Display) => void): this;
|
10775 | removeListener(event: 'display-added', listener: (event: Event,
|
10776 | newDisplay: Display) => void): this;
|
10777 | /**
|
10778 | * Emitted when one or more metrics change in a `display`. The `changedMetrics` is
|
10779 | * an array of strings that describe the changes. Possible changes are `bounds`,
|
10780 | * `workArea`, `scaleFactor` and `rotation`.
|
10781 | */
|
10782 | on(event: 'display-metrics-changed', listener: (event: Event,
|
10783 | display: Display,
|
10784 | changedMetrics: string[]) => void): this;
|
10785 | off(event: 'display-metrics-changed', listener: (event: Event,
|
10786 | display: Display,
|
10787 | changedMetrics: string[]) => void): this;
|
10788 | once(event: 'display-metrics-changed', listener: (event: Event,
|
10789 | display: Display,
|
10790 | changedMetrics: string[]) => void): this;
|
10791 | addListener(event: 'display-metrics-changed', listener: (event: Event,
|
10792 | display: Display,
|
10793 | changedMetrics: string[]) => void): this;
|
10794 | removeListener(event: 'display-metrics-changed', listener: (event: Event,
|
10795 | display: Display,
|
10796 | changedMetrics: string[]) => void): this;
|
10797 | /**
|
10798 | * Emitted when `oldDisplay` has been removed.
|
10799 | */
|
10800 | on(event: 'display-removed', listener: (event: Event,
|
10801 | oldDisplay: Display) => void): this;
|
10802 | off(event: 'display-removed', listener: (event: Event,
|
10803 | oldDisplay: Display) => void): this;
|
10804 | once(event: 'display-removed', listener: (event: Event,
|
10805 | oldDisplay: Display) => void): this;
|
10806 | addListener(event: 'display-removed', listener: (event: Event,
|
10807 | oldDisplay: Display) => void): this;
|
10808 | removeListener(event: 'display-removed', listener: (event: Event,
|
10809 | oldDisplay: Display) => void): this;
|
10810 | /**
|
10811 | * Converts a screen DIP point to a screen physical point. The DPI scale is
|
10812 | * performed relative to the display containing the DIP point.
|
10813 | *
|
10814 | * @platform win32
|
10815 | */
|
10816 | dipToScreenPoint(point: Point): Point;
|
10817 | /**
|
10818 | * Converts a screen DIP rect to a screen physical rect. The DPI scale is performed
|
10819 | * relative to the display nearest to `window`. If `window` is null, scaling will
|
10820 | * be performed to the display nearest to `rect`.
|
10821 | *
|
10822 | * @platform win32
|
10823 | */
|
10824 | dipToScreenRect(window: (BrowserWindow) | (null), rect: Rectangle): Rectangle;
|
10825 | /**
|
10826 | * An array of displays that are currently available.
|
10827 | */
|
10828 | getAllDisplays(): Display[];
|
10829 | /**
|
10830 | * The current absolute position of the mouse pointer.
|
10831 | *
|
10832 | * **Note:** The return value is a DIP point, not a screen physical point.
|
10833 | */
|
10834 | getCursorScreenPoint(): Point;
|
10835 | /**
|
10836 | * The display that most closely intersects the provided bounds.
|
10837 | */
|
10838 | getDisplayMatching(rect: Rectangle): Display;
|
10839 | /**
|
10840 | * The display nearest the specified point.
|
10841 | */
|
10842 | getDisplayNearestPoint(point: Point): Display;
|
10843 | /**
|
10844 | * The primary display.
|
10845 | */
|
10846 | getPrimaryDisplay(): Display;
|
10847 | /**
|
10848 | * Converts a screen physical point to a screen DIP point. The DPI scale is
|
10849 | * performed relative to the display containing the physical point.
|
10850 | *
|
10851 | * @platform win32
|
10852 | */
|
10853 | screenToDipPoint(point: Point): Point;
|
10854 | /**
|
10855 | * Converts a screen physical rect to a screen DIP rect. The DPI scale is performed
|
10856 | * relative to the display nearest to `window`. If `window` is null, scaling will
|
10857 | * be performed to the display nearest to `rect`.
|
10858 | *
|
10859 | * @platform win32
|
10860 | */
|
10861 | screenToDipRect(window: (BrowserWindow) | (null), rect: Rectangle): Rectangle;
|
10862 | }
|
10863 |
|
10864 | interface ScrubberItem {
|
10865 |
|
10866 | // Docs: https://electronjs.org/docs/api/structures/scrubber-item
|
10867 |
|
10868 | /**
|
10869 | * The image to appear in this item.
|
10870 | */
|
10871 | icon?: NativeImage;
|
10872 | /**
|
10873 | * The text to appear in this item.
|
10874 | */
|
10875 | label?: string;
|
10876 | }
|
10877 |
|
10878 | interface SegmentedControlSegment {
|
10879 |
|
10880 | // Docs: https://electronjs.org/docs/api/structures/segmented-control-segment
|
10881 |
|
10882 | /**
|
10883 | * Whether this segment is selectable. Default: true.
|
10884 | */
|
10885 | enabled?: boolean;
|
10886 | /**
|
10887 | * The image to appear in this segment.
|
10888 | */
|
10889 | icon?: NativeImage;
|
10890 | /**
|
10891 | * The text to appear in this segment.
|
10892 | */
|
10893 | label?: string;
|
10894 | }
|
10895 |
|
10896 | interface SerialPort {
|
10897 |
|
10898 | // Docs: https://electronjs.org/docs/api/structures/serial-port
|
10899 |
|
10900 | /**
|
10901 | * A stable identifier on Windows that can be used for device permissions.
|
10902 | *
|
10903 | * @platform win32
|
10904 | */
|
10905 | deviceInstanceId?: string;
|
10906 | /**
|
10907 | * A string suitable for display to the user for describing this device.
|
10908 | */
|
10909 | displayName?: string;
|
10910 | /**
|
10911 | * Unique identifier for the port.
|
10912 | */
|
10913 | portId: string;
|
10914 | /**
|
10915 | * Name of the port.
|
10916 | */
|
10917 | portName: string;
|
10918 | /**
|
10919 | * The USB product ID.
|
10920 | */
|
10921 | productId?: string;
|
10922 | /**
|
10923 | * The USB device serial number.
|
10924 | */
|
10925 | serialNumber?: string;
|
10926 | /**
|
10927 | * Represents a single serial port on macOS can be enumerated by multiple drivers.
|
10928 | *
|
10929 | * @platform darwin
|
10930 | */
|
10931 | usbDriverName?: string;
|
10932 | /**
|
10933 | * The USB vendor ID.
|
10934 | */
|
10935 | vendorId?: string;
|
10936 | }
|
10937 |
|
10938 | interface ServiceWorkerInfo {
|
10939 |
|
10940 | // Docs: https://electronjs.org/docs/api/structures/service-worker-info
|
10941 |
|
10942 | /**
|
10943 | * The virtual ID of the process that this service worker is running in. This is
|
10944 | * not an OS level PID. This aligns with the ID set used for
|
10945 | * `webContents.getProcessId()`.
|
10946 | */
|
10947 | renderProcessId: number;
|
10948 | /**
|
10949 | * The base URL that this service worker is active for.
|
10950 | */
|
10951 | scope: string;
|
10952 | /**
|
10953 | * The full URL to the script that this service worker runs
|
10954 | */
|
10955 | scriptUrl: string;
|
10956 | }
|
10957 |
|
10958 | class ServiceWorkers extends NodeEventEmitter {
|
10959 |
|
10960 | // Docs: https://electronjs.org/docs/api/service-workers
|
10961 |
|
10962 | /**
|
10963 | * Emitted when a service worker logs something to the console.
|
10964 | */
|
10965 | on(event: 'console-message', listener: (event: Event,
|
10966 | /**
|
10967 | * Information about the console message
|
10968 | */
|
10969 | messageDetails: MessageDetails) => void): this;
|
10970 | off(event: 'console-message', listener: (event: Event,
|
10971 | /**
|
10972 | * Information about the console message
|
10973 | */
|
10974 | messageDetails: MessageDetails) => void): this;
|
10975 | once(event: 'console-message', listener: (event: Event,
|
10976 | /**
|
10977 | * Information about the console message
|
10978 | */
|
10979 | messageDetails: MessageDetails) => void): this;
|
10980 | addListener(event: 'console-message', listener: (event: Event,
|
10981 | /**
|
10982 | * Information about the console message
|
10983 | */
|
10984 | messageDetails: MessageDetails) => void): this;
|
10985 | removeListener(event: 'console-message', listener: (event: Event,
|
10986 | /**
|
10987 | * Information about the console message
|
10988 | */
|
10989 | messageDetails: MessageDetails) => void): this;
|
10990 | /**
|
10991 | * Emitted when a service worker has been registered. Can occur after a call to
|
10992 | * `navigator.serviceWorker.register('/sw.js')` successfully resolves or when a
|
10993 | * Chrome extension is loaded.
|
10994 | */
|
10995 | on(event: 'registration-completed', listener: (event: Event,
|
10996 | /**
|
10997 | * Information about the registered service worker
|
10998 | */
|
10999 | details: RegistrationCompletedDetails) => void): this;
|
11000 | off(event: 'registration-completed', listener: (event: Event,
|
11001 | /**
|
11002 | * Information about the registered service worker
|
11003 | */
|
11004 | details: RegistrationCompletedDetails) => void): this;
|
11005 | once(event: 'registration-completed', listener: (event: Event,
|
11006 | /**
|
11007 | * Information about the registered service worker
|
11008 | */
|
11009 | details: RegistrationCompletedDetails) => void): this;
|
11010 | addListener(event: 'registration-completed', listener: (event: Event,
|
11011 | /**
|
11012 | * Information about the registered service worker
|
11013 | */
|
11014 | details: RegistrationCompletedDetails) => void): this;
|
11015 | removeListener(event: 'registration-completed', listener: (event: Event,
|
11016 | /**
|
11017 | * Information about the registered service worker
|
11018 | */
|
11019 | details: RegistrationCompletedDetails) => void): this;
|
11020 | /**
|
11021 | * A ServiceWorkerInfo object where the keys are the service worker version ID and
|
11022 | * the values are the information about that service worker.
|
11023 | */
|
11024 | getAllRunning(): Record<number, ServiceWorkerInfo>;
|
11025 | /**
|
11026 | * Information about this service worker
|
11027 | *
|
11028 | * If the service worker does not exist or is not running this method will throw an
|
11029 | * exception.
|
11030 | */
|
11031 | getFromVersionID(versionId: number): ServiceWorkerInfo;
|
11032 | }
|
11033 |
|
11034 | class Session extends NodeEventEmitter {
|
11035 |
|
11036 | // Docs: https://electronjs.org/docs/api/session
|
11037 |
|
11038 | /**
|
11039 | * A session instance from `partition` string. When there is an existing `Session`
|
11040 | * with the same `partition`, it will be returned; otherwise a new `Session`
|
11041 | * instance will be created with `options`.
|
11042 | *
|
11043 | * If `partition` starts with `persist:`, the page will use a persistent session
|
11044 | * available to all pages in the app with the same `partition`. if there is no
|
11045 | * `persist:` prefix, the page will use an in-memory session. If the `partition` is
|
11046 | * empty then default session of the app will be returned.
|
11047 | *
|
11048 | * To create a `Session` with `options`, you have to ensure the `Session` with the
|
11049 | * `partition` has never been used before. There is no way to change the `options`
|
11050 | * of an existing `Session` object.
|
11051 | */
|
11052 | static fromPartition(partition: string, options?: FromPartitionOptions): Session;
|
11053 | /**
|
11054 | * A session instance from the absolute path as specified by the `path` string.
|
11055 | * When there is an existing `Session` with the same absolute path, it will be
|
11056 | * returned; otherwise a new `Session` instance will be created with `options`. The
|
11057 | * call will throw an error if the path is not an absolute path. Additionally, an
|
11058 | * error will be thrown if an empty string is provided.
|
11059 | *
|
11060 | * To create a `Session` with `options`, you have to ensure the `Session` with the
|
11061 | * `path` has never been used before. There is no way to change the `options` of an
|
11062 | * existing `Session` object.
|
11063 | */
|
11064 | static fromPath(path: string, options?: FromPathOptions): Session;
|
11065 | /**
|
11066 | * A `Session` object, the default session object of the app.
|
11067 | */
|
11068 | static defaultSession: Session;
|
11069 | /**
|
11070 | * Emitted after an extension is loaded. This occurs whenever an extension is added
|
11071 | * to the "enabled" set of extensions. This includes:
|
11072 | *
|
11073 | * * Extensions being loaded from `Session.loadExtension`.
|
11074 | * * Extensions being reloaded:
|
11075 | * * from a crash.
|
11076 | * * if the extension requested it (`chrome.runtime.reload()`).
|
11077 | */
|
11078 | on(event: 'extension-loaded', listener: (event: Event,
|
11079 | extension: Extension) => void): this;
|
11080 | off(event: 'extension-loaded', listener: (event: Event,
|
11081 | extension: Extension) => void): this;
|
11082 | once(event: 'extension-loaded', listener: (event: Event,
|
11083 | extension: Extension) => void): this;
|
11084 | addListener(event: 'extension-loaded', listener: (event: Event,
|
11085 | extension: Extension) => void): this;
|
11086 | removeListener(event: 'extension-loaded', listener: (event: Event,
|
11087 | extension: Extension) => void): this;
|
11088 | /**
|
11089 | * Emitted after an extension is loaded and all necessary browser state is
|
11090 | * initialized to support the start of the extension's background page.
|
11091 | */
|
11092 | on(event: 'extension-ready', listener: (event: Event,
|
11093 | extension: Extension) => void): this;
|
11094 | off(event: 'extension-ready', listener: (event: Event,
|
11095 | extension: Extension) => void): this;
|
11096 | once(event: 'extension-ready', listener: (event: Event,
|
11097 | extension: Extension) => void): this;
|
11098 | addListener(event: 'extension-ready', listener: (event: Event,
|
11099 | extension: Extension) => void): this;
|
11100 | removeListener(event: 'extension-ready', listener: (event: Event,
|
11101 | extension: Extension) => void): this;
|
11102 | /**
|
11103 | * Emitted after an extension is unloaded. This occurs when
|
11104 | * `Session.removeExtension` is called.
|
11105 | */
|
11106 | on(event: 'extension-unloaded', listener: (event: Event,
|
11107 | extension: Extension) => void): this;
|
11108 | off(event: 'extension-unloaded', listener: (event: Event,
|
11109 | extension: Extension) => void): this;
|
11110 | once(event: 'extension-unloaded', listener: (event: Event,
|
11111 | extension: Extension) => void): this;
|
11112 | addListener(event: 'extension-unloaded', listener: (event: Event,
|
11113 | extension: Extension) => void): this;
|
11114 | removeListener(event: 'extension-unloaded', listener: (event: Event,
|
11115 | extension: Extension) => void): this;
|
11116 | on(event: 'file-system-access-restricted', listener: (event: Event,
|
11117 | details: FileSystemAccessRestrictedDetails,
|
11118 | callback: (action: 'allow' | 'deny' | 'tryAgain') => void) => void): this;
|
11119 | off(event: 'file-system-access-restricted', listener: (event: Event,
|
11120 | details: FileSystemAccessRestrictedDetails,
|
11121 | callback: (action: 'allow' | 'deny' | 'tryAgain') => void) => void): this;
|
11122 | once(event: 'file-system-access-restricted', listener: (event: Event,
|
11123 | details: FileSystemAccessRestrictedDetails,
|
11124 | callback: (action: 'allow' | 'deny' | 'tryAgain') => void) => void): this;
|
11125 | addListener(event: 'file-system-access-restricted', listener: (event: Event,
|
11126 | details: FileSystemAccessRestrictedDetails,
|
11127 | callback: (action: 'allow' | 'deny' | 'tryAgain') => void) => void): this;
|
11128 | removeListener(event: 'file-system-access-restricted', listener: (event: Event,
|
11129 | details: FileSystemAccessRestrictedDetails,
|
11130 | callback: (action: 'allow' | 'deny' | 'tryAgain') => void) => void): this;
|
11131 | /**
|
11132 | * Emitted after `navigator.hid.requestDevice` has been called and
|
11133 | * `select-hid-device` has fired if a new device becomes available before the
|
11134 | * callback from `select-hid-device` is called. This event is intended for use
|
11135 | * when using a UI to ask users to pick a device so that the UI can be updated with
|
11136 | * the newly added device.
|
11137 | */
|
11138 | on(event: 'hid-device-added', listener: (event: Event,
|
11139 | details: HidDeviceAddedDetails) => void): this;
|
11140 | off(event: 'hid-device-added', listener: (event: Event,
|
11141 | details: HidDeviceAddedDetails) => void): this;
|
11142 | once(event: 'hid-device-added', listener: (event: Event,
|
11143 | details: HidDeviceAddedDetails) => void): this;
|
11144 | addListener(event: 'hid-device-added', listener: (event: Event,
|
11145 | details: HidDeviceAddedDetails) => void): this;
|
11146 | removeListener(event: 'hid-device-added', listener: (event: Event,
|
11147 | details: HidDeviceAddedDetails) => void): this;
|
11148 | /**
|
11149 | * Emitted after `navigator.hid.requestDevice` has been called and
|
11150 | * `select-hid-device` has fired if a device has been removed before the callback
|
11151 | * from `select-hid-device` is called. This event is intended for use when using a
|
11152 | * UI to ask users to pick a device so that the UI can be updated to remove the
|
11153 | * specified device.
|
11154 | */
|
11155 | on(event: 'hid-device-removed', listener: (event: Event,
|
11156 | details: HidDeviceRemovedDetails) => void): this;
|
11157 | off(event: 'hid-device-removed', listener: (event: Event,
|
11158 | details: HidDeviceRemovedDetails) => void): this;
|
11159 | once(event: 'hid-device-removed', listener: (event: Event,
|
11160 | details: HidDeviceRemovedDetails) => void): this;
|
11161 | addListener(event: 'hid-device-removed', listener: (event: Event,
|
11162 | details: HidDeviceRemovedDetails) => void): this;
|
11163 | removeListener(event: 'hid-device-removed', listener: (event: Event,
|
11164 | details: HidDeviceRemovedDetails) => void): this;
|
11165 | /**
|
11166 | * Emitted after `HIDDevice.forget()` has been called. This event can be used to
|
11167 | * help maintain persistent storage of permissions when
|
11168 | * `setDevicePermissionHandler` is used.
|
11169 | */
|
11170 | on(event: 'hid-device-revoked', listener: (event: Event,
|
11171 | details: HidDeviceRevokedDetails) => void): this;
|
11172 | off(event: 'hid-device-revoked', listener: (event: Event,
|
11173 | details: HidDeviceRevokedDetails) => void): this;
|
11174 | once(event: 'hid-device-revoked', listener: (event: Event,
|
11175 | details: HidDeviceRevokedDetails) => void): this;
|
11176 | addListener(event: 'hid-device-revoked', listener: (event: Event,
|
11177 | details: HidDeviceRevokedDetails) => void): this;
|
11178 | removeListener(event: 'hid-device-revoked', listener: (event: Event,
|
11179 | details: HidDeviceRevokedDetails) => void): this;
|
11180 | /**
|
11181 | * Emitted when a render process requests preconnection to a URL, generally due to
|
11182 | * a resource hint.
|
11183 | */
|
11184 | on(event: 'preconnect', listener: (event: Event,
|
11185 | /**
|
11186 | * The URL being requested for preconnection by the renderer.
|
11187 | */
|
11188 | preconnectUrl: string,
|
11189 | /**
|
11190 | * True if the renderer is requesting that the connection include credentials (see
|
11191 | * the spec for more details.)
|
11192 | */
|
11193 | allowCredentials: boolean) => void): this;
|
11194 | off(event: 'preconnect', listener: (event: Event,
|
11195 | /**
|
11196 | * The URL being requested for preconnection by the renderer.
|
11197 | */
|
11198 | preconnectUrl: string,
|
11199 | /**
|
11200 | * True if the renderer is requesting that the connection include credentials (see
|
11201 | * the spec for more details.)
|
11202 | */
|
11203 | allowCredentials: boolean) => void): this;
|
11204 | once(event: 'preconnect', listener: (event: Event,
|
11205 | /**
|
11206 | * The URL being requested for preconnection by the renderer.
|
11207 | */
|
11208 | preconnectUrl: string,
|
11209 | /**
|
11210 | * True if the renderer is requesting that the connection include credentials (see
|
11211 | * the spec for more details.)
|
11212 | */
|
11213 | allowCredentials: boolean) => void): this;
|
11214 | addListener(event: 'preconnect', listener: (event: Event,
|
11215 | /**
|
11216 | * The URL being requested for preconnection by the renderer.
|
11217 | */
|
11218 | preconnectUrl: string,
|
11219 | /**
|
11220 | * True if the renderer is requesting that the connection include credentials (see
|
11221 | * the spec for more details.)
|
11222 | */
|
11223 | allowCredentials: boolean) => void): this;
|
11224 | removeListener(event: 'preconnect', listener: (event: Event,
|
11225 | /**
|
11226 | * The URL being requested for preconnection by the renderer.
|
11227 | */
|
11228 | preconnectUrl: string,
|
11229 | /**
|
11230 | * True if the renderer is requesting that the connection include credentials (see
|
11231 | * the spec for more details.)
|
11232 | */
|
11233 | allowCredentials: boolean) => void): this;
|
11234 | /**
|
11235 | * Emitted when a HID device needs to be selected when a call to
|
11236 | * `navigator.hid.requestDevice` is made. `callback` should be called with
|
11237 | * `deviceId` to be selected; passing no arguments to `callback` will cancel the
|
11238 | * request. Additionally, permissioning on `navigator.hid` can be further managed
|
11239 | * by using `ses.setPermissionCheckHandler(handler)` and
|
11240 | * `ses.setDevicePermissionHandler(handler)`.
|
11241 | */
|
11242 | on(event: 'select-hid-device', listener: (event: Event,
|
11243 | details: SelectHidDeviceDetails,
|
11244 | callback: (deviceId?: (string) | (null)) => void) => void): this;
|
11245 | off(event: 'select-hid-device', listener: (event: Event,
|
11246 | details: SelectHidDeviceDetails,
|
11247 | callback: (deviceId?: (string) | (null)) => void) => void): this;
|
11248 | once(event: 'select-hid-device', listener: (event: Event,
|
11249 | details: SelectHidDeviceDetails,
|
11250 | callback: (deviceId?: (string) | (null)) => void) => void): this;
|
11251 | addListener(event: 'select-hid-device', listener: (event: Event,
|
11252 | details: SelectHidDeviceDetails,
|
11253 | callback: (deviceId?: (string) | (null)) => void) => void): this;
|
11254 | removeListener(event: 'select-hid-device', listener: (event: Event,
|
11255 | details: SelectHidDeviceDetails,
|
11256 | callback: (deviceId?: (string) | (null)) => void) => void): this;
|
11257 | /**
|
11258 | * Emitted when a serial port needs to be selected when a call to
|
11259 | * `navigator.serial.requestPort` is made. `callback` should be called with
|
11260 | * `portId` to be selected, passing an empty string to `callback` will cancel the
|
11261 | * request. Additionally, permissioning on `navigator.serial` can be managed by
|
11262 | * using ses.setPermissionCheckHandler(handler) with the `serial` permission.
|
11263 | */
|
11264 | on(event: 'select-serial-port', listener: (event: Event,
|
11265 | portList: SerialPort[],
|
11266 | webContents: WebContents,
|
11267 | callback: (portId: string) => void) => void): this;
|
11268 | off(event: 'select-serial-port', listener: (event: Event,
|
11269 | portList: SerialPort[],
|
11270 | webContents: WebContents,
|
11271 | callback: (portId: string) => void) => void): this;
|
11272 | once(event: 'select-serial-port', listener: (event: Event,
|
11273 | portList: SerialPort[],
|
11274 | webContents: WebContents,
|
11275 | callback: (portId: string) => void) => void): this;
|
11276 | addListener(event: 'select-serial-port', listener: (event: Event,
|
11277 | portList: SerialPort[],
|
11278 | webContents: WebContents,
|
11279 | callback: (portId: string) => void) => void): this;
|
11280 | removeListener(event: 'select-serial-port', listener: (event: Event,
|
11281 | portList: SerialPort[],
|
11282 | webContents: WebContents,
|
11283 | callback: (portId: string) => void) => void): this;
|
11284 | /**
|
11285 | * Emitted when a USB device needs to be selected when a call to
|
11286 | * `navigator.usb.requestDevice` is made. `callback` should be called with
|
11287 | * `deviceId` to be selected; passing no arguments to `callback` will cancel the
|
11288 | * request. Additionally, permissioning on `navigator.usb` can be further managed
|
11289 | * by using `ses.setPermissionCheckHandler(handler)` and
|
11290 | * `ses.setDevicePermissionHandler(handler)`.
|
11291 | */
|
11292 | on(event: 'select-usb-device', listener: (event: Event,
|
11293 | details: SelectUsbDeviceDetails,
|
11294 | callback: (deviceId?: string) => void) => void): this;
|
11295 | off(event: 'select-usb-device', listener: (event: Event,
|
11296 | details: SelectUsbDeviceDetails,
|
11297 | callback: (deviceId?: string) => void) => void): this;
|
11298 | once(event: 'select-usb-device', listener: (event: Event,
|
11299 | details: SelectUsbDeviceDetails,
|
11300 | callback: (deviceId?: string) => void) => void): this;
|
11301 | addListener(event: 'select-usb-device', listener: (event: Event,
|
11302 | details: SelectUsbDeviceDetails,
|
11303 | callback: (deviceId?: string) => void) => void): this;
|
11304 | removeListener(event: 'select-usb-device', listener: (event: Event,
|
11305 | details: SelectUsbDeviceDetails,
|
11306 | callback: (deviceId?: string) => void) => void): this;
|
11307 | /**
|
11308 | * Emitted after `navigator.serial.requestPort` has been called and
|
11309 | * `select-serial-port` has fired if a new serial port becomes available before the
|
11310 | * callback from `select-serial-port` is called. This event is intended for use
|
11311 | * when using a UI to ask users to pick a port so that the UI can be updated with
|
11312 | * the newly added port.
|
11313 | */
|
11314 | on(event: 'serial-port-added', listener: (event: Event,
|
11315 | port: SerialPort,
|
11316 | webContents: WebContents) => void): this;
|
11317 | off(event: 'serial-port-added', listener: (event: Event,
|
11318 | port: SerialPort,
|
11319 | webContents: WebContents) => void): this;
|
11320 | once(event: 'serial-port-added', listener: (event: Event,
|
11321 | port: SerialPort,
|
11322 | webContents: WebContents) => void): this;
|
11323 | addListener(event: 'serial-port-added', listener: (event: Event,
|
11324 | port: SerialPort,
|
11325 | webContents: WebContents) => void): this;
|
11326 | removeListener(event: 'serial-port-added', listener: (event: Event,
|
11327 | port: SerialPort,
|
11328 | webContents: WebContents) => void): this;
|
11329 | /**
|
11330 | * Emitted after `navigator.serial.requestPort` has been called and
|
11331 | * `select-serial-port` has fired if a serial port has been removed before the
|
11332 | * callback from `select-serial-port` is called. This event is intended for use
|
11333 | * when using a UI to ask users to pick a port so that the UI can be updated to
|
11334 | * remove the specified port.
|
11335 | */
|
11336 | on(event: 'serial-port-removed', listener: (event: Event,
|
11337 | port: SerialPort,
|
11338 | webContents: WebContents) => void): this;
|
11339 | off(event: 'serial-port-removed', listener: (event: Event,
|
11340 | port: SerialPort,
|
11341 | webContents: WebContents) => void): this;
|
11342 | once(event: 'serial-port-removed', listener: (event: Event,
|
11343 | port: SerialPort,
|
11344 | webContents: WebContents) => void): this;
|
11345 | addListener(event: 'serial-port-removed', listener: (event: Event,
|
11346 | port: SerialPort,
|
11347 | webContents: WebContents) => void): this;
|
11348 | removeListener(event: 'serial-port-removed', listener: (event: Event,
|
11349 | port: SerialPort,
|
11350 | webContents: WebContents) => void): this;
|
11351 | /**
|
11352 | * Emitted after `SerialPort.forget()` has been called. This event can be used to
|
11353 | * help maintain persistent storage of permissions when
|
11354 | * `setDevicePermissionHandler` is used.
|
11355 | */
|
11356 | on(event: 'serial-port-revoked', listener: (event: Event,
|
11357 | details: SerialPortRevokedDetails) => void): this;
|
11358 | off(event: 'serial-port-revoked', listener: (event: Event,
|
11359 | details: SerialPortRevokedDetails) => void): this;
|
11360 | once(event: 'serial-port-revoked', listener: (event: Event,
|
11361 | details: SerialPortRevokedDetails) => void): this;
|
11362 | addListener(event: 'serial-port-revoked', listener: (event: Event,
|
11363 | details: SerialPortRevokedDetails) => void): this;
|
11364 | removeListener(event: 'serial-port-revoked', listener: (event: Event,
|
11365 | details: SerialPortRevokedDetails) => void): this;
|
11366 | /**
|
11367 | * Emitted when a hunspell dictionary file starts downloading
|
11368 | */
|
11369 | on(event: 'spellcheck-dictionary-download-begin', listener: (event: Event,
|
11370 | /**
|
11371 | * The language code of the dictionary file
|
11372 | */
|
11373 | languageCode: string) => void): this;
|
11374 | off(event: 'spellcheck-dictionary-download-begin', listener: (event: Event,
|
11375 | /**
|
11376 | * The language code of the dictionary file
|
11377 | */
|
11378 | languageCode: string) => void): this;
|
11379 | once(event: 'spellcheck-dictionary-download-begin', listener: (event: Event,
|
11380 | /**
|
11381 | * The language code of the dictionary file
|
11382 | */
|
11383 | languageCode: string) => void): this;
|
11384 | addListener(event: 'spellcheck-dictionary-download-begin', listener: (event: Event,
|
11385 | /**
|
11386 | * The language code of the dictionary file
|
11387 | */
|
11388 | languageCode: string) => void): this;
|
11389 | removeListener(event: 'spellcheck-dictionary-download-begin', listener: (event: Event,
|
11390 | /**
|
11391 | * The language code of the dictionary file
|
11392 | */
|
11393 | languageCode: string) => void): this;
|
11394 | /**
|
11395 | * Emitted when a hunspell dictionary file download fails. For details on the
|
11396 | * failure you should collect a netlog and inspect the download request.
|
11397 | */
|
11398 | on(event: 'spellcheck-dictionary-download-failure', listener: (event: Event,
|
11399 | /**
|
11400 | * The language code of the dictionary file
|
11401 | */
|
11402 | languageCode: string) => void): this;
|
11403 | off(event: 'spellcheck-dictionary-download-failure', listener: (event: Event,
|
11404 | /**
|
11405 | * The language code of the dictionary file
|
11406 | */
|
11407 | languageCode: string) => void): this;
|
11408 | once(event: 'spellcheck-dictionary-download-failure', listener: (event: Event,
|
11409 | /**
|
11410 | * The language code of the dictionary file
|
11411 | */
|
11412 | languageCode: string) => void): this;
|
11413 | addListener(event: 'spellcheck-dictionary-download-failure', listener: (event: Event,
|
11414 | /**
|
11415 | * The language code of the dictionary file
|
11416 | */
|
11417 | languageCode: string) => void): this;
|
11418 | removeListener(event: 'spellcheck-dictionary-download-failure', listener: (event: Event,
|
11419 | /**
|
11420 | * The language code of the dictionary file
|
11421 | */
|
11422 | languageCode: string) => void): this;
|
11423 | /**
|
11424 | * Emitted when a hunspell dictionary file has been successfully downloaded
|
11425 | */
|
11426 | on(event: 'spellcheck-dictionary-download-success', listener: (event: Event,
|
11427 | /**
|
11428 | * The language code of the dictionary file
|
11429 | */
|
11430 | languageCode: string) => void): this;
|
11431 | off(event: 'spellcheck-dictionary-download-success', listener: (event: Event,
|
11432 | /**
|
11433 | * The language code of the dictionary file
|
11434 | */
|
11435 | languageCode: string) => void): this;
|
11436 | once(event: 'spellcheck-dictionary-download-success', listener: (event: Event,
|
11437 | /**
|
11438 | * The language code of the dictionary file
|
11439 | */
|
11440 | languageCode: string) => void): this;
|
11441 | addListener(event: 'spellcheck-dictionary-download-success', listener: (event: Event,
|
11442 | /**
|
11443 | * The language code of the dictionary file
|
11444 | */
|
11445 | languageCode: string) => void): this;
|
11446 | removeListener(event: 'spellcheck-dictionary-download-success', listener: (event: Event,
|
11447 | /**
|
11448 | * The language code of the dictionary file
|
11449 | */
|
11450 | languageCode: string) => void): this;
|
11451 | /**
|
11452 | * Emitted when a hunspell dictionary file has been successfully initialized. This
|
11453 | * occurs after the file has been downloaded.
|
11454 | */
|
11455 | on(event: 'spellcheck-dictionary-initialized', listener: (event: Event,
|
11456 | /**
|
11457 | * The language code of the dictionary file
|
11458 | */
|
11459 | languageCode: string) => void): this;
|
11460 | off(event: 'spellcheck-dictionary-initialized', listener: (event: Event,
|
11461 | /**
|
11462 | * The language code of the dictionary file
|
11463 | */
|
11464 | languageCode: string) => void): this;
|
11465 | once(event: 'spellcheck-dictionary-initialized', listener: (event: Event,
|
11466 | /**
|
11467 | * The language code of the dictionary file
|
11468 | */
|
11469 | languageCode: string) => void): this;
|
11470 | addListener(event: 'spellcheck-dictionary-initialized', listener: (event: Event,
|
11471 | /**
|
11472 | * The language code of the dictionary file
|
11473 | */
|
11474 | languageCode: string) => void): this;
|
11475 | removeListener(event: 'spellcheck-dictionary-initialized', listener: (event: Event,
|
11476 | /**
|
11477 | * The language code of the dictionary file
|
11478 | */
|
11479 | languageCode: string) => void): this;
|
11480 | /**
|
11481 | * Emitted after `navigator.usb.requestDevice` has been called and
|
11482 | * `select-usb-device` has fired if a new device becomes available before the
|
11483 | * callback from `select-usb-device` is called. This event is intended for use
|
11484 | * when using a UI to ask users to pick a device so that the UI can be updated with
|
11485 | * the newly added device.
|
11486 | */
|
11487 | on(event: 'usb-device-added', listener: (event: Event,
|
11488 | device: USBDevice,
|
11489 | webContents: WebContents) => void): this;
|
11490 | off(event: 'usb-device-added', listener: (event: Event,
|
11491 | device: USBDevice,
|
11492 | webContents: WebContents) => void): this;
|
11493 | once(event: 'usb-device-added', listener: (event: Event,
|
11494 | device: USBDevice,
|
11495 | webContents: WebContents) => void): this;
|
11496 | addListener(event: 'usb-device-added', listener: (event: Event,
|
11497 | device: USBDevice,
|
11498 | webContents: WebContents) => void): this;
|
11499 | removeListener(event: 'usb-device-added', listener: (event: Event,
|
11500 | device: USBDevice,
|
11501 | webContents: WebContents) => void): this;
|
11502 | /**
|
11503 | * Emitted after `navigator.usb.requestDevice` has been called and
|
11504 | * `select-usb-device` has fired if a device has been removed before the callback
|
11505 | * from `select-usb-device` is called. This event is intended for use when using a
|
11506 | * UI to ask users to pick a device so that the UI can be updated to remove the
|
11507 | * specified device.
|
11508 | */
|
11509 | on(event: 'usb-device-removed', listener: (event: Event,
|
11510 | device: USBDevice,
|
11511 | webContents: WebContents) => void): this;
|
11512 | off(event: 'usb-device-removed', listener: (event: Event,
|
11513 | device: USBDevice,
|
11514 | webContents: WebContents) => void): this;
|
11515 | once(event: 'usb-device-removed', listener: (event: Event,
|
11516 | device: USBDevice,
|
11517 | webContents: WebContents) => void): this;
|
11518 | addListener(event: 'usb-device-removed', listener: (event: Event,
|
11519 | device: USBDevice,
|
11520 | webContents: WebContents) => void): this;
|
11521 | removeListener(event: 'usb-device-removed', listener: (event: Event,
|
11522 | device: USBDevice,
|
11523 | webContents: WebContents) => void): this;
|
11524 | /**
|
11525 | * Emitted after `USBDevice.forget()` has been called. This event can be used to
|
11526 | * help maintain persistent storage of permissions when
|
11527 | * `setDevicePermissionHandler` is used.
|
11528 | */
|
11529 | on(event: 'usb-device-revoked', listener: (event: Event,
|
11530 | details: UsbDeviceRevokedDetails) => void): this;
|
11531 | off(event: 'usb-device-revoked', listener: (event: Event,
|
11532 | details: UsbDeviceRevokedDetails) => void): this;
|
11533 | once(event: 'usb-device-revoked', listener: (event: Event,
|
11534 | details: UsbDeviceRevokedDetails) => void): this;
|
11535 | addListener(event: 'usb-device-revoked', listener: (event: Event,
|
11536 | details: UsbDeviceRevokedDetails) => void): this;
|
11537 | removeListener(event: 'usb-device-revoked', listener: (event: Event,
|
11538 | details: UsbDeviceRevokedDetails) => void): this;
|
11539 | /**
|
11540 | * Emitted when Electron is about to download `item` in `webContents`.
|
11541 | *
|
11542 | * Calling `event.preventDefault()` will cancel the download and `item` will not be
|
11543 | * available from next tick of the process.
|
11544 | */
|
11545 | on(event: 'will-download', listener: (event: Event,
|
11546 | item: DownloadItem,
|
11547 | webContents: WebContents) => void): this;
|
11548 | off(event: 'will-download', listener: (event: Event,
|
11549 | item: DownloadItem,
|
11550 | webContents: WebContents) => void): this;
|
11551 | once(event: 'will-download', listener: (event: Event,
|
11552 | item: DownloadItem,
|
11553 | webContents: WebContents) => void): this;
|
11554 | addListener(event: 'will-download', listener: (event: Event,
|
11555 | item: DownloadItem,
|
11556 | webContents: WebContents) => void): this;
|
11557 | removeListener(event: 'will-download', listener: (event: Event,
|
11558 | item: DownloadItem,
|
11559 | webContents: WebContents) => void): this;
|
11560 | /**
|
11561 | * Whether the word was successfully written to the custom dictionary. This API
|
11562 | * will not work on non-persistent (in-memory) sessions.
|
11563 | *
|
11564 | * **Note:** On macOS and Windows 10 this word will be written to the OS custom
|
11565 | * dictionary as well
|
11566 | */
|
11567 | addWordToSpellCheckerDictionary(word: string): boolean;
|
11568 | /**
|
11569 | * Dynamically sets whether to always send credentials for HTTP NTLM or Negotiate
|
11570 | * authentication.
|
11571 | */
|
11572 | allowNTLMCredentialsForDomains(domains: string): void;
|
11573 | /**
|
11574 | * resolves when the session’s HTTP authentication cache has been cleared.
|
11575 | */
|
11576 | clearAuthCache(): Promise<void>;
|
11577 | /**
|
11578 | * resolves when the cache clear operation is complete.
|
11579 | *
|
11580 | * Clears the session’s HTTP cache.
|
11581 | */
|
11582 | clearCache(): Promise<void>;
|
11583 | /**
|
11584 | * resolves when the code cache clear operation is complete.
|
11585 | */
|
11586 | clearCodeCaches(options: ClearCodeCachesOptions): Promise<void>;
|
11587 | /**
|
11588 | * resolves when all data has been cleared.
|
11589 | *
|
11590 | * Clears various different types of data.
|
11591 | *
|
11592 | * This method clears more types of data and is more thorough than the
|
11593 | * `clearStorageData` method.
|
11594 | *
|
11595 | * **Note:** Cookies are stored at a broader scope than origins. When removing
|
11596 | * cookies and filtering by `origins` (or `excludeOrigins`), the cookies will be
|
11597 | * removed at the registrable domain level. For example, clearing cookies for the
|
11598 | * origin `https://really.specific.origin.example.com/` will end up clearing all
|
11599 | * cookies for `example.com`. Clearing cookies for the origin
|
11600 | * `https://my.website.example.co.uk/` will end up clearing all cookies for
|
11601 | * `example.co.uk`.
|
11602 | *
|
11603 | * For more information, refer to Chromium's `BrowsingDataRemover` interface.
|
11604 | */
|
11605 | clearData(options?: ClearDataOptions): Promise<void>;
|
11606 | /**
|
11607 | * Resolves when the operation is complete.
|
11608 | *
|
11609 | * Clears the host resolver cache.
|
11610 | */
|
11611 | clearHostResolverCache(): Promise<void>;
|
11612 | /**
|
11613 | * resolves when the storage data has been cleared.
|
11614 | */
|
11615 | clearStorageData(options?: ClearStorageDataOptions): Promise<void>;
|
11616 | /**
|
11617 | * Resolves when all connections are closed.
|
11618 | *
|
11619 | * **Note:** It will terminate / fail all requests currently in flight.
|
11620 | */
|
11621 | closeAllConnections(): Promise<void>;
|
11622 | /**
|
11623 | * Allows resuming `cancelled` or `interrupted` downloads from previous `Session`.
|
11624 | * The API will generate a DownloadItem that can be accessed with the will-download
|
11625 | * event. The DownloadItem will not have any `WebContents` associated with it and
|
11626 | * the initial state will be `interrupted`. The download will start only when the
|
11627 | * `resume` API is called on the DownloadItem.
|
11628 | */
|
11629 | createInterruptedDownload(options: CreateInterruptedDownloadOptions): void;
|
11630 | /**
|
11631 | * Disables any network emulation already active for the `session`. Resets to the
|
11632 | * original network configuration.
|
11633 | */
|
11634 | disableNetworkEmulation(): void;
|
11635 | /**
|
11636 | * Initiates a download of the resource at `url`. The API will generate a
|
11637 | * DownloadItem that can be accessed with the will-download event.
|
11638 | *
|
11639 | * **Note:** This does not perform any security checks that relate to a page's
|
11640 | * origin, unlike `webContents.downloadURL`.
|
11641 | */
|
11642 | downloadURL(url: string, options?: DownloadURLOptions): void;
|
11643 | /**
|
11644 | * Emulates network with the given configuration for the `session`.
|
11645 | */
|
11646 | enableNetworkEmulation(options: EnableNetworkEmulationOptions): void;
|
11647 | /**
|
11648 | * see Response.
|
11649 | *
|
11650 | * Sends a request, similarly to how `fetch()` works in the renderer, using
|
11651 | * Chrome's network stack. This differs from Node's `fetch()`, which uses Node.js's
|
11652 | * HTTP stack.
|
11653 | *
|
11654 | * Example:
|
11655 | *
|
11656 | * See also `net.fetch()`, a convenience method which issues requests from the
|
11657 | * default session.
|
11658 | *
|
11659 | * See the MDN documentation for `fetch()` for more details.
|
11660 | *
|
11661 | * Limitations:
|
11662 | *
|
11663 | * * `net.fetch()` does not support the `data:` or `blob:` schemes.
|
11664 | * * The value of the `integrity` option is ignored.
|
11665 | * * The `.type` and `.url` values of the returned `Response` object are incorrect.
|
11666 | *
|
11667 | * By default, requests made with `net.fetch` can be made to custom protocols as
|
11668 | * well as `file:`, and will trigger webRequest handlers if present. When the
|
11669 | * non-standard `bypassCustomProtocolHandlers` option is set in RequestInit, custom
|
11670 | * protocol handlers will not be called for this request. This allows forwarding an
|
11671 | * intercepted request to the built-in handler. webRequest handlers will still be
|
11672 | * triggered when bypassing custom protocols.
|
11673 | */
|
11674 | fetch(input: (string) | (GlobalRequest), init?: RequestInit & { bypassCustomProtocolHandlers?: boolean }): Promise<GlobalResponse>;
|
11675 | /**
|
11676 | * Writes any unwritten DOMStorage data to disk.
|
11677 | */
|
11678 | flushStorageData(): void;
|
11679 | /**
|
11680 | * Resolves when the all internal states of proxy service is reset and the latest
|
11681 | * proxy configuration is reapplied if it's already available. The pac script will
|
11682 | * be fetched from `pacScript` again if the proxy mode is `pac_script`.
|
11683 | */
|
11684 | forceReloadProxyConfig(): Promise<void>;
|
11685 | /**
|
11686 | * A list of all loaded extensions.
|
11687 | *
|
11688 | * **Note:** This API cannot be called before the `ready` event of the `app` module
|
11689 | * is emitted.
|
11690 | */
|
11691 | getAllExtensions(): Extension[];
|
11692 | /**
|
11693 | * resolves with blob data.
|
11694 | */
|
11695 | getBlobData(identifier: string): Promise<Buffer>;
|
11696 | /**
|
11697 | * the session's current cache size, in bytes.
|
11698 | */
|
11699 | getCacheSize(): Promise<number>;
|
11700 | /**
|
11701 | * The loaded extension with the given ID.
|
11702 | *
|
11703 | * **Note:** This API cannot be called before the `ready` event of the `app` module
|
11704 | * is emitted.
|
11705 | */
|
11706 | getExtension(extensionId: string): (Extension) | (null);
|
11707 | /**
|
11708 | * an array of paths to preload scripts that have been registered.
|
11709 | */
|
11710 | getPreloads(): string[];
|
11711 | /**
|
11712 | * An array of language codes the spellchecker is enabled for. If this list is
|
11713 | * empty the spellchecker will fallback to using `en-US`. By default on launch if
|
11714 | * this setting is an empty list Electron will try to populate this setting with
|
11715 | * the current OS locale. This setting is persisted across restarts.
|
11716 | *
|
11717 | * **Note:** On macOS the OS spellchecker is used and has its own list of
|
11718 | * languages. On macOS, this API will return whichever languages have been
|
11719 | * configured by the OS.
|
11720 | */
|
11721 | getSpellCheckerLanguages(): string[];
|
11722 | /**
|
11723 | * The absolute file system path where data for this session is persisted on disk.
|
11724 | * For in memory sessions this returns `null`.
|
11725 | */
|
11726 | getStoragePath(): (string) | (null);
|
11727 | /**
|
11728 | * The user agent for this session.
|
11729 | */
|
11730 | getUserAgent(): string;
|
11731 | /**
|
11732 | * Whether or not this session is a persistent one. The default `webContents`
|
11733 | * session of a `BrowserWindow` is persistent. When creating a session from a
|
11734 | * partition, session prefixed with `persist:` will be persistent, while others
|
11735 | * will be temporary.
|
11736 | */
|
11737 | isPersistent(): boolean;
|
11738 | /**
|
11739 | * Whether the builtin spell checker is enabled.
|
11740 | */
|
11741 | isSpellCheckerEnabled(): boolean;
|
11742 | /**
|
11743 | * An array of all words in app's custom dictionary. Resolves when the full
|
11744 | * dictionary is loaded from disk.
|
11745 | */
|
11746 | listWordsInSpellCheckerDictionary(): Promise<string[]>;
|
11747 | /**
|
11748 | * resolves when the extension is loaded.
|
11749 | *
|
11750 | * This method will raise an exception if the extension could not be loaded. If
|
11751 | * there are warnings when installing the extension (e.g. if the extension requests
|
11752 | * an API that Electron does not support) then they will be logged to the console.
|
11753 | *
|
11754 | * Note that Electron does not support the full range of Chrome extensions APIs.
|
11755 | * See Supported Extensions APIs for more details on what is supported.
|
11756 | *
|
11757 | * Note that in previous versions of Electron, extensions that were loaded would be
|
11758 | * remembered for future runs of the application. This is no longer the case:
|
11759 | * `loadExtension` must be called on every boot of your app if you want the
|
11760 | * extension to be loaded.
|
11761 | *
|
11762 | * This API does not support loading packed (.crx) extensions.
|
11763 | *
|
11764 | * **Note:** This API cannot be called before the `ready` event of the `app` module
|
11765 | * is emitted.
|
11766 | *
|
11767 | * **Note:** Loading extensions into in-memory (non-persistent) sessions is not
|
11768 | * supported and will throw an error.
|
11769 | */
|
11770 | loadExtension(path: string, options?: LoadExtensionOptions): Promise<Electron.Extension>;
|
11771 | /**
|
11772 | * Preconnects the given number of sockets to an origin.
|
11773 | */
|
11774 | preconnect(options: PreconnectOptions): void;
|
11775 | /**
|
11776 | * Unloads an extension.
|
11777 | *
|
11778 | * **Note:** This API cannot be called before the `ready` event of the `app` module
|
11779 | * is emitted.
|
11780 | */
|
11781 | removeExtension(extensionId: string): void;
|
11782 | /**
|
11783 | * Whether the word was successfully removed from the custom dictionary. This API
|
11784 | * will not work on non-persistent (in-memory) sessions.
|
11785 | *
|
11786 | * **Note:** On macOS and Windows 10 this word will be removed from the OS custom
|
11787 | * dictionary as well
|
11788 | */
|
11789 | removeWordFromSpellCheckerDictionary(word: string): boolean;
|
11790 | /**
|
11791 | * Resolves with the resolved IP addresses for the `host`.
|
11792 | */
|
11793 | resolveHost(host: string, options?: ResolveHostOptions): Promise<Electron.ResolvedHost>;
|
11794 | /**
|
11795 | * Resolves with the proxy information for `url`.
|
11796 | */
|
11797 | resolveProxy(url: string): Promise<string>;
|
11798 | /**
|
11799 | * Sets a handler to respond to Bluetooth pairing requests. This handler allows
|
11800 | * developers to handle devices that require additional validation before pairing.
|
11801 | * When a handler is not defined, any pairing on Linux or Windows that requires
|
11802 | * additional validation will be automatically cancelled. macOS does not require a
|
11803 | * handler because macOS handles the pairing automatically. To clear the handler,
|
11804 | * call `setBluetoothPairingHandler(null)`.
|
11805 | *
|
11806 | * @platform win32,linux
|
11807 | */
|
11808 | setBluetoothPairingHandler(handler: ((details: BluetoothPairingHandlerHandlerDetails, callback: (response: Response) => void) => void) | (null)): void;
|
11809 | /**
|
11810 | * Sets the certificate verify proc for `session`, the `proc` will be called with
|
11811 | * `proc(request, callback)` whenever a server certificate verification is
|
11812 | * requested. Calling `callback(0)` accepts the certificate, calling `callback(-2)`
|
11813 | * rejects it.
|
11814 | *
|
11815 | * Calling `setCertificateVerifyProc(null)` will revert back to default certificate
|
11816 | * verify proc.
|
11817 | *
|
11818 | * > **NOTE:** The result of this procedure is cached by the network service.
|
11819 | */
|
11820 | setCertificateVerifyProc(proc: ((request: Request, callback: (verificationResult: number) => void) => void) | (null)): void;
|
11821 | /**
|
11822 | * Sets the directory to store the generated JS code cache for this session. The
|
11823 | * directory is not required to be created by the user before this call, the
|
11824 | * runtime will create if it does not exist otherwise will use the existing
|
11825 | * directory. If directory cannot be created, then code cache will not be used and
|
11826 | * all operations related to code cache will fail silently inside the runtime. By
|
11827 | * default, the directory will be `Code Cache` under the respective user data
|
11828 | * folder.
|
11829 | *
|
11830 | * Note that by default code cache is only enabled for http(s) URLs, to enable code
|
11831 | * cache for custom protocols, `codeCache: true` and `standard: true` must be
|
11832 | * specified when registering the protocol.
|
11833 | */
|
11834 | setCodeCachePath(path: string): void;
|
11835 | /**
|
11836 | * Sets the handler which can be used to respond to device permission checks for
|
11837 | * the `session`. Returning `true` will allow the device to be permitted and
|
11838 | * `false` will reject it. To clear the handler, call
|
11839 | * `setDevicePermissionHandler(null)`. This handler can be used to provide default
|
11840 | * permissioning to devices without first calling for permission to devices (eg via
|
11841 | * `navigator.hid.requestDevice`). If this handler is not defined, the default
|
11842 | * device permissions as granted through device selection (eg via
|
11843 | * `navigator.hid.requestDevice`) will be used. Additionally, the default behavior
|
11844 | * of Electron is to store granted device permission in memory. If longer term
|
11845 | * storage is needed, a developer can store granted device permissions (eg when
|
11846 | * handling the `select-hid-device` event) and then read from that storage with
|
11847 | * `setDevicePermissionHandler`.
|
11848 | */
|
11849 | setDevicePermissionHandler(handler: ((details: DevicePermissionHandlerHandlerDetails) => boolean) | (null)): void;
|
11850 | /**
|
11851 | * This handler will be called when web content requests access to display media
|
11852 | * via the `navigator.mediaDevices.getDisplayMedia` API. Use the desktopCapturer
|
11853 | * API to choose which stream(s) to grant access to.
|
11854 | *
|
11855 | * `useSystemPicker` allows an application to use the system picker instead of
|
11856 | * providing a specific video source from `getSources`. This option is
|
11857 | * experimental, and currently available for MacOS 15+ only. If the system picker
|
11858 | * is available and `useSystemPicker` is set to `true`, the handler will not be
|
11859 | * invoked.
|
11860 | *
|
11861 | * Passing a WebFrameMain object as a video or audio stream will capture the video
|
11862 | * or audio stream from that frame.
|
11863 | *
|
11864 | * Passing `null` instead of a function resets the handler to its default state.
|
11865 | */
|
11866 | setDisplayMediaRequestHandler(handler: ((request: DisplayMediaRequestHandlerHandlerRequest, callback: (streams: Streams) => void) => void) | (null), opts?: DisplayMediaRequestHandlerOpts): void;
|
11867 | /**
|
11868 | * Sets download saving directory. By default, the download directory will be the
|
11869 | * `Downloads` under the respective app folder.
|
11870 | */
|
11871 | setDownloadPath(path: string): void;
|
11872 | /**
|
11873 | * Sets the handler which can be used to respond to permission checks for the
|
11874 | * `session`. Returning `true` will allow the permission and `false` will reject
|
11875 | * it. Please note that you must also implement `setPermissionRequestHandler` to
|
11876 | * get complete permission handling. Most web APIs do a permission check and then
|
11877 | * make a permission request if the check is denied. To clear the handler, call
|
11878 | * `setPermissionCheckHandler(null)`.
|
11879 | */
|
11880 | setPermissionCheckHandler(handler: ((webContents: (WebContents) | (null), permission: 'clipboard-read' | 'clipboard-sanitized-write' | 'geolocation' | 'fullscreen' | 'hid' | 'idle-detection' | 'media' | 'mediaKeySystem' | 'midi' | 'midiSysex' | 'notifications' | 'openExternal' | 'pointerLock' | 'serial' | 'storage-access' | 'top-level-storage-access' | 'usb', requestingOrigin: string, details: PermissionCheckHandlerHandlerDetails) => boolean) | (null)): void;
|
11881 | /**
|
11882 | * Sets the handler which can be used to respond to permission requests for the
|
11883 | * `session`. Calling `callback(true)` will allow the permission and
|
11884 | * `callback(false)` will reject it. To clear the handler, call
|
11885 | * `setPermissionRequestHandler(null)`. Please note that you must also implement
|
11886 | * `setPermissionCheckHandler` to get complete permission handling. Most web APIs
|
11887 | * do a permission check and then make a permission request if the check is denied.
|
11888 | */
|
11889 | setPermissionRequestHandler(handler: ((webContents: WebContents, permission: 'clipboard-read' | 'clipboard-sanitized-write' | 'display-capture' | 'fullscreen' | 'geolocation' | 'idle-detection' | 'media' | 'mediaKeySystem' | 'midi' | 'midiSysex' | 'notifications' | 'pointerLock' | 'keyboardLock' | 'openExternal' | 'speaker-selection' | 'storage-access' | 'top-level-storage-access' | 'window-management' | 'unknown' | 'fileSystem', callback: (permissionGranted: boolean) => void, details: (PermissionRequest) | (FilesystemPermissionRequest) | (MediaAccessPermissionRequest) | (OpenExternalPermissionRequest)) => void) | (null)): void;
|
11890 | /**
|
11891 | * Adds scripts that will be executed on ALL web contents that are associated with
|
11892 | * this session just before normal `preload` scripts run.
|
11893 | */
|
11894 | setPreloads(preloads: string[]): void;
|
11895 | /**
|
11896 | * Resolves when the proxy setting process is complete.
|
11897 | *
|
11898 | * Sets the proxy settings.
|
11899 | *
|
11900 | * You may need `ses.closeAllConnections` to close currently in flight connections
|
11901 | * to prevent pooled sockets using previous proxy from being reused by future
|
11902 | * requests.
|
11903 | */
|
11904 | setProxy(config: ProxyConfig): Promise<void>;
|
11905 | /**
|
11906 | * By default Electron will download hunspell dictionaries from the Chromium CDN.
|
11907 | * If you want to override this behavior you can use this API to point the
|
11908 | * dictionary downloader at your own hosted version of the hunspell dictionaries.
|
11909 | * We publish a `hunspell_dictionaries.zip` file with each release which contains
|
11910 | * the files you need to host here.
|
11911 | *
|
11912 | * The file server must be **case insensitive**. If you cannot do this, you must
|
11913 | * upload each file twice: once with the case it has in the ZIP file and once with
|
11914 | * the filename as all lowercase.
|
11915 | *
|
11916 | * If the files present in `hunspell_dictionaries.zip` are available at
|
11917 | * `https://example.com/dictionaries/language-code.bdic` then you should call this
|
11918 | * api with
|
11919 | * `ses.setSpellCheckerDictionaryDownloadURL('https://example.com/dictionaries/')`.
|
11920 | * Please note the trailing slash. The URL to the dictionaries is formed as
|
11921 | * `${url}${filename}`.
|
11922 | *
|
11923 | * **Note:** On macOS the OS spellchecker is used and therefore we do not download
|
11924 | * any dictionary files. This API is a no-op on macOS.
|
11925 | */
|
11926 | setSpellCheckerDictionaryDownloadURL(url: string): void;
|
11927 | /**
|
11928 | * Sets whether to enable the builtin spell checker.
|
11929 | */
|
11930 | setSpellCheckerEnabled(enable: boolean): void;
|
11931 | /**
|
11932 | * The built in spellchecker does not automatically detect what language a user is
|
11933 | * typing in. In order for the spell checker to correctly check their words you
|
11934 | * must call this API with an array of language codes. You can get the list of
|
11935 | * supported language codes with the `ses.availableSpellCheckerLanguages` property.
|
11936 | *
|
11937 | * **Note:** On macOS the OS spellchecker is used and will detect your language
|
11938 | * automatically. This API is a no-op on macOS.
|
11939 | */
|
11940 | setSpellCheckerLanguages(languages: string[]): void;
|
11941 | /**
|
11942 | * Sets the SSL configuration for the session. All subsequent network requests will
|
11943 | * use the new configuration. Existing network connections (such as WebSocket
|
11944 | * connections) will not be terminated, but old sockets in the pool will not be
|
11945 | * reused for new connections.
|
11946 | */
|
11947 | setSSLConfig(config: Config): void;
|
11948 | /**
|
11949 | * Sets the handler which can be used to override which USB classes are protected.
|
11950 | * The return value for the handler is a string array of USB classes which should
|
11951 | * be considered protected (eg not available in the renderer). Valid values for
|
11952 | * the array are:
|
11953 | *
|
11954 | * * `audio`
|
11955 | * * `audio-video`
|
11956 | * * `hid`
|
11957 | * * `mass-storage`
|
11958 | * * `smart-card`
|
11959 | * * `video`
|
11960 | * * `wireless`
|
11961 | *
|
11962 | * Returning an empty string array from the handler will allow all USB classes;
|
11963 | * returning the passed in array will maintain the default list of protected USB
|
11964 | * classes (this is also the default behavior if a handler is not defined). To
|
11965 | * clear the handler, call `setUSBProtectedClassesHandler(null)`.
|
11966 | */
|
11967 | setUSBProtectedClassesHandler(handler: ((details: USBProtectedClassesHandlerHandlerDetails) => string[]) | (null)): void;
|
11968 | /**
|
11969 | * Overrides the `userAgent` and `acceptLanguages` for this session.
|
11970 | *
|
11971 | * The `acceptLanguages` must a comma separated ordered list of language codes, for
|
11972 | * example `"en-US,fr,de,ko,zh-CN,ja"`.
|
11973 | *
|
11974 | * This doesn't affect existing `WebContents`, and each `WebContents` can use
|
11975 | * `webContents.setUserAgent` to override the session-wide user agent.
|
11976 | */
|
11977 | setUserAgent(userAgent: string, acceptLanguages?: string): void;
|
11978 | /**
|
11979 | * A `string[]` array which consists of all the known available spell checker
|
11980 | * languages. Providing a language code to the `setSpellCheckerLanguages` API that
|
11981 | * isn't in this array will result in an error.
|
11982 | *
|
11983 | */
|
11984 | readonly availableSpellCheckerLanguages: string[];
|
11985 | /**
|
11986 | * A `Cookies` object for this session.
|
11987 | *
|
11988 | */
|
11989 | readonly cookies: Cookies;
|
11990 | /**
|
11991 | * A `NetLog` object for this session.
|
11992 | *
|
11993 | */
|
11994 | readonly netLog: NetLog;
|
11995 | /**
|
11996 | * A `Protocol` object for this session.
|
11997 | *
|
11998 | */
|
11999 | readonly protocol: Protocol;
|
12000 | /**
|
12001 | * A `ServiceWorkers` object for this session.
|
12002 | *
|
12003 | */
|
12004 | readonly serviceWorkers: ServiceWorkers;
|
12005 | /**
|
12006 | * A `boolean` indicating whether builtin spell checker is enabled.
|
12007 | */
|
12008 | spellCheckerEnabled: boolean;
|
12009 | /**
|
12010 | * A `string | null` indicating the absolute file system path where data for this
|
12011 | * session is persisted on disk. For in memory sessions this returns `null`.
|
12012 | *
|
12013 | */
|
12014 | readonly storagePath: (string) | (null);
|
12015 | /**
|
12016 | * A `WebRequest` object for this session.
|
12017 | *
|
12018 | */
|
12019 | readonly webRequest: WebRequest;
|
12020 | }
|
12021 |
|
12022 | interface SharedWorkerInfo {
|
12023 |
|
12024 | // Docs: https://electronjs.org/docs/api/structures/shared-worker-info
|
12025 |
|
12026 | /**
|
12027 | * The unique id of the shared worker.
|
12028 | */
|
12029 | id: string;
|
12030 | /**
|
12031 | * The url of the shared worker.
|
12032 | */
|
12033 | url: string;
|
12034 | }
|
12035 |
|
12036 | class ShareMenu {
|
12037 |
|
12038 | // Docs: https://electronjs.org/docs/api/share-menu
|
12039 |
|
12040 | /**
|
12041 | * ShareMenu
|
12042 | */
|
12043 | constructor(sharingItem: SharingItem);
|
12044 | /**
|
12045 | * Closes the context menu in the `browserWindow`.
|
12046 | */
|
12047 | closePopup(browserWindow?: BrowserWindow): void;
|
12048 | /**
|
12049 | * Pops up this menu as a context menu in the `BrowserWindow`.
|
12050 | */
|
12051 | popup(options?: PopupOptions): void;
|
12052 | }
|
12053 |
|
12054 | interface SharingItem {
|
12055 |
|
12056 | // Docs: https://electronjs.org/docs/api/structures/sharing-item
|
12057 |
|
12058 | /**
|
12059 | * An array of files to share.
|
12060 | */
|
12061 | filePaths?: string[];
|
12062 | /**
|
12063 | * An array of text to share.
|
12064 | */
|
12065 | texts?: string[];
|
12066 | /**
|
12067 | * An array of URLs to share.
|
12068 | */
|
12069 | urls?: string[];
|
12070 | }
|
12071 |
|
12072 | interface Shell {
|
12073 |
|
12074 | // Docs: https://electronjs.org/docs/api/shell
|
12075 |
|
12076 | /**
|
12077 | * Play the beep sound.
|
12078 | */
|
12079 | beep(): void;
|
12080 | /**
|
12081 | * Open the given external protocol URL in the desktop's default manner. (For
|
12082 | * example, mailto: URLs in the user's default mail agent).
|
12083 | */
|
12084 | openExternal(url: string, options?: OpenExternalOptions): Promise<void>;
|
12085 | /**
|
12086 | * Resolves with a string containing the error message corresponding to the failure
|
12087 | * if a failure occurred, otherwise "".
|
12088 | *
|
12089 | * Open the given file in the desktop's default manner.
|
12090 | */
|
12091 | openPath(path: string): Promise<string>;
|
12092 | /**
|
12093 | * Resolves the shortcut link at `shortcutPath`.
|
12094 | *
|
12095 | * An exception will be thrown when any error happens.
|
12096 | *
|
12097 | * @platform win32
|
12098 | */
|
12099 | readShortcutLink(shortcutPath: string): ShortcutDetails;
|
12100 | /**
|
12101 | * Show the given file in a file manager. If possible, select the file.
|
12102 | */
|
12103 | showItemInFolder(fullPath: string): void;
|
12104 | /**
|
12105 | * Resolves when the operation has been completed. Rejects if there was an error
|
12106 | * while deleting the requested item.
|
12107 | *
|
12108 | * This moves a path to the OS-specific trash location (Trash on macOS, Recycle Bin
|
12109 | * on Windows, and a desktop-environment-specific location on Linux).
|
12110 | */
|
12111 | trashItem(path: string): Promise<void>;
|
12112 | /**
|
12113 | * Whether the shortcut was created successfully.
|
12114 | *
|
12115 | * Creates or updates a shortcut link at `shortcutPath`.
|
12116 | *
|
12117 | * @platform win32
|
12118 | */
|
12119 | writeShortcutLink(shortcutPath: string, operation: 'create' | 'update' | 'replace', options: ShortcutDetails): boolean;
|
12120 | /**
|
12121 | * Whether the shortcut was created successfully.
|
12122 | *
|
12123 | * Creates or updates a shortcut link at `shortcutPath`.
|
12124 | *
|
12125 | * @platform win32
|
12126 | */
|
12127 | writeShortcutLink(shortcutPath: string, options: ShortcutDetails): boolean;
|
12128 | }
|
12129 |
|
12130 | interface ShortcutDetails {
|
12131 |
|
12132 | // Docs: https://electronjs.org/docs/api/structures/shortcut-details
|
12133 |
|
12134 | /**
|
12135 | * The Application User Model ID. Default is empty.
|
12136 | */
|
12137 | appUserModelId?: string;
|
12138 | /**
|
12139 | * The arguments to be applied to `target` when launching from this shortcut.
|
12140 | * Default is empty.
|
12141 | */
|
12142 | args?: string;
|
12143 | /**
|
12144 | * The working directory. Default is empty.
|
12145 | */
|
12146 | cwd?: string;
|
12147 | /**
|
12148 | * The description of the shortcut. Default is empty.
|
12149 | */
|
12150 | description?: string;
|
12151 | /**
|
12152 | * The path to the icon, can be a DLL or EXE. `icon` and `iconIndex` have to be set
|
12153 | * together. Default is empty, which uses the target's icon.
|
12154 | */
|
12155 | icon?: string;
|
12156 | /**
|
12157 | * The resource ID of icon when `icon` is a DLL or EXE. Default is 0.
|
12158 | */
|
12159 | iconIndex?: number;
|
12160 | /**
|
12161 | * The target to launch from this shortcut.
|
12162 | */
|
12163 | target: string;
|
12164 | /**
|
12165 | * The Application Toast Activator CLSID. Needed for participating in Action
|
12166 | * Center.
|
12167 | */
|
12168 | toastActivatorClsid?: string;
|
12169 | }
|
12170 |
|
12171 | interface Size {
|
12172 |
|
12173 | // Docs: https://electronjs.org/docs/api/structures/size
|
12174 |
|
12175 | height: number;
|
12176 | width: number;
|
12177 | }
|
12178 |
|
12179 | interface SystemPreferences extends NodeJS.EventEmitter {
|
12180 |
|
12181 | // Docs: https://electronjs.org/docs/api/system-preferences
|
12182 |
|
12183 | /**
|
12184 | * @platform win32
|
12185 | */
|
12186 | on(event: 'accent-color-changed', listener: (event: Event,
|
12187 | /**
|
12188 | * The new RGBA color the user assigned to be their system accent color.
|
12189 | */
|
12190 | newColor: string) => void): this;
|
12191 | /**
|
12192 | * @platform win32
|
12193 | */
|
12194 | off(event: 'accent-color-changed', listener: (event: Event,
|
12195 | /**
|
12196 | * The new RGBA color the user assigned to be their system accent color.
|
12197 | */
|
12198 | newColor: string) => void): this;
|
12199 | /**
|
12200 | * @platform win32
|
12201 | */
|
12202 | once(event: 'accent-color-changed', listener: (event: Event,
|
12203 | /**
|
12204 | * The new RGBA color the user assigned to be their system accent color.
|
12205 | */
|
12206 | newColor: string) => void): this;
|
12207 | /**
|
12208 | * @platform win32
|
12209 | */
|
12210 | addListener(event: 'accent-color-changed', listener: (event: Event,
|
12211 | /**
|
12212 | * The new RGBA color the user assigned to be their system accent color.
|
12213 | */
|
12214 | newColor: string) => void): this;
|
12215 | /**
|
12216 | * @platform win32
|
12217 | */
|
12218 | removeListener(event: 'accent-color-changed', listener: (event: Event,
|
12219 | /**
|
12220 | * The new RGBA color the user assigned to be their system accent color.
|
12221 | */
|
12222 | newColor: string) => void): this;
|
12223 | /**
|
12224 | * @platform win32
|
12225 | */
|
12226 | on(event: 'color-changed', listener: (event: Event) => void): this;
|
12227 | /**
|
12228 | * @platform win32
|
12229 | */
|
12230 | off(event: 'color-changed', listener: (event: Event) => void): this;
|
12231 | /**
|
12232 | * @platform win32
|
12233 | */
|
12234 | once(event: 'color-changed', listener: (event: Event) => void): this;
|
12235 | /**
|
12236 | * @platform win32
|
12237 | */
|
12238 | addListener(event: 'color-changed', listener: (event: Event) => void): this;
|
12239 | /**
|
12240 | * @platform win32
|
12241 | */
|
12242 | removeListener(event: 'color-changed', listener: (event: Event) => void): this;
|
12243 | /**
|
12244 | * A promise that resolves with `true` if consent was granted and `false` if it was
|
12245 | * denied. If an invalid `mediaType` is passed, the promise will be rejected. If an
|
12246 | * access request was denied and later is changed through the System Preferences
|
12247 | * pane, a restart of the app will be required for the new permissions to take
|
12248 | * effect. If access has already been requested and denied, it _must_ be changed
|
12249 | * through the preference pane; an alert will not pop up and the promise will
|
12250 | * resolve with the existing access status.
|
12251 | *
|
12252 | * **Important:** In order to properly leverage this API, you must set the
|
12253 | * `NSMicrophoneUsageDescription` and `NSCameraUsageDescription` strings in your
|
12254 | * app's `Info.plist` file. The values for these keys will be used to populate the
|
12255 | * permission dialogs so that the user will be properly informed as to the purpose
|
12256 | * of the permission request. See Electron Application Distribution for more
|
12257 | * information about how to set these in the context of Electron.
|
12258 | *
|
12259 | * This user consent was not required until macOS 10.14 Mojave, so this method will
|
12260 | * always return `true` if your system is running 10.13 High Sierra.
|
12261 | *
|
12262 | * @platform darwin
|
12263 | */
|
12264 | askForMediaAccess(mediaType: 'microphone' | 'camera'): Promise<boolean>;
|
12265 | /**
|
12266 | * whether or not this device has the ability to use Touch ID.
|
12267 | *
|
12268 | * @platform darwin
|
12269 | */
|
12270 | canPromptTouchID(): boolean;
|
12271 | /**
|
12272 | * The users current system wide accent color preference in RGBA hexadecimal form.
|
12273 | *
|
12274 | * This API is only available on macOS 10.14 Mojave or newer.
|
12275 | *
|
12276 | * @platform win32,darwin
|
12277 | */
|
12278 | getAccentColor(): string;
|
12279 | /**
|
12280 | * * `shouldRenderRichAnimation` boolean - Returns true if rich animations should
|
12281 | * be rendered. Looks at session type (e.g. remote desktop) and accessibility
|
12282 | * settings to give guidance for heavy animations.
|
12283 | * * `scrollAnimationsEnabledBySystem` boolean - Determines on a per-platform basis
|
12284 | * whether scroll animations (e.g. produced by home/end key) should be enabled.
|
12285 | * * `prefersReducedMotion` boolean - Determines whether the user desires reduced
|
12286 | * motion based on platform APIs.
|
12287 | *
|
12288 | * Returns an object with system animation settings.
|
12289 | */
|
12290 | getAnimationSettings(): AnimationSettings;
|
12291 | /**
|
12292 | * The system color setting in RGBA hexadecimal form (`#RRGGBBAA`). See the Windows
|
12293 | * docs and the macOS docs for more details.
|
12294 | *
|
12295 | * The following colors are only available on macOS 10.14: `find-highlight`,
|
12296 | * `selected-content-background`, `separator`,
|
12297 | * `unemphasized-selected-content-background`,
|
12298 | * `unemphasized-selected-text-background`, and `unemphasized-selected-text`.
|
12299 | *
|
12300 | * @platform win32,darwin
|
12301 | */
|
12302 | getColor(color: '3d-dark-shadow' | '3d-face' | '3d-highlight' | '3d-light' | '3d-shadow' | 'active-border' | 'active-caption' | 'active-caption-gradient' | 'app-workspace' | 'button-text' | 'caption-text' | 'desktop' | 'disabled-text' | 'highlight' | 'highlight-text' | 'hotlight' | 'inactive-border' | 'inactive-caption' | 'inactive-caption-gradient' | 'inactive-caption-text' | 'info-background' | 'info-text' | 'menu' | 'menu-highlight' | 'menubar' | 'menu-text' | 'scrollbar' | 'window' | 'window-frame' | 'window-text' | 'control-background' | 'control' | 'control-text' | 'disabled-control-text' | 'find-highlight' | 'grid' | 'header-text' | 'highlight' | 'keyboard-focus-indicator' | 'label' | 'link' | 'placeholder-text' | 'quaternary-label' | 'scrubber-textured-background' | 'secondary-label' | 'selected-content-background' | 'selected-control' | 'selected-control-text' | 'selected-menu-item-text' | 'selected-text-background' | 'selected-text' | 'separator' | 'shadow' | 'tertiary-label' | 'text-background' | 'text' | 'under-page-background' | 'unemphasized-selected-content-background' | 'unemphasized-selected-text-background' | 'unemphasized-selected-text' | 'window-background' | 'window-frame-text'): string;
|
12303 | /**
|
12304 | * Can be `dark`, `light` or `unknown`.
|
12305 | *
|
12306 | * Gets the macOS appearance setting that is currently applied to your application,
|
12307 | * maps to NSApplication.effectiveAppearance
|
12308 | *
|
12309 | * @platform darwin
|
12310 | */
|
12311 | getEffectiveAppearance(): ('dark' | 'light' | 'unknown');
|
12312 | /**
|
12313 | * Can be `not-determined`, `granted`, `denied`, `restricted` or `unknown`.
|
12314 | *
|
12315 | * This user consent was not required on macOS 10.13 High Sierra so this method
|
12316 | * will always return `granted`. macOS 10.14 Mojave or higher requires consent for
|
12317 | * `microphone` and `camera` access. macOS 10.15 Catalina or higher requires
|
12318 | * consent for `screen` access.
|
12319 | *
|
12320 | * Windows 10 has a global setting controlling `microphone` and `camera` access for
|
12321 | * all win32 applications. It will always return `granted` for `screen` and for all
|
12322 | * media types on older versions of Windows.
|
12323 | *
|
12324 | * @platform win32,darwin
|
12325 | */
|
12326 | getMediaAccessStatus(mediaType: 'microphone' | 'camera' | 'screen'): ('not-determined' | 'granted' | 'denied' | 'restricted' | 'unknown');
|
12327 | /**
|
12328 | * The standard system color formatted as `#RRGGBBAA`.
|
12329 | *
|
12330 | * Returns one of several standard system colors that automatically adapt to
|
12331 | * vibrancy and changes in accessibility settings like 'Increase contrast' and
|
12332 | * 'Reduce transparency'. See Apple Documentation for more details.
|
12333 | *
|
12334 | * @platform darwin
|
12335 | */
|
12336 | getSystemColor(color: 'blue' | 'brown' | 'gray' | 'green' | 'orange' | 'pink' | 'purple' | 'red' | 'yellow'): string;
|
12337 | /**
|
12338 | * The value of `key` in `NSUserDefaults`.
|
12339 | *
|
12340 | * Some popular `key` and `type`s are:
|
12341 | *
|
12342 | * * `AppleInterfaceStyle`: `string`
|
12343 | * * `AppleAquaColorVariant`: `integer`
|
12344 | * * `AppleHighlightColor`: `string`
|
12345 | * * `AppleShowScrollBars`: `string`
|
12346 | * * `NSNavRecentPlaces`: `array`
|
12347 | * * `NSPreferredWebServices`: `dictionary`
|
12348 | * * `NSUserDictionaryReplacementItems`: `array`
|
12349 | *
|
12350 | * @platform darwin
|
12351 | */
|
12352 | getUserDefault<Type extends keyof UserDefaultTypes>(key: string, type: Type): UserDefaultTypes[Type];
|
12353 | /**
|
12354 | * `true` if DWM composition (Aero Glass) is enabled, and `false` otherwise.
|
12355 | *
|
12356 | * An example of using it to determine if you should create a transparent window or
|
12357 | * not (transparent windows won't work correctly when DWM composition is disabled):
|
12358 | *
|
12359 | * @platform win32
|
12360 | */
|
12361 | isAeroGlassEnabled(): boolean;
|
12362 | /**
|
12363 | * Whether the Swipe between pages setting is on.
|
12364 | *
|
12365 | * @platform darwin
|
12366 | */
|
12367 | isSwipeTrackingFromScrollEventsEnabled(): boolean;
|
12368 | /**
|
12369 | * `true` if the current process is a trusted accessibility client and `false` if
|
12370 | * it is not.
|
12371 | *
|
12372 | * @platform darwin
|
12373 | */
|
12374 | isTrustedAccessibilityClient(prompt: boolean): boolean;
|
12375 | /**
|
12376 | * Posts `event` as native notifications of macOS. The `userInfo` is an Object that
|
12377 | * contains the user information dictionary sent along with the notification.
|
12378 | *
|
12379 | * @platform darwin
|
12380 | */
|
12381 | postLocalNotification(event: string, userInfo: Record<string, any>): void;
|
12382 | /**
|
12383 | * Posts `event` as native notifications of macOS. The `userInfo` is an Object that
|
12384 | * contains the user information dictionary sent along with the notification.
|
12385 | *
|
12386 | * @platform darwin
|
12387 | */
|
12388 | postNotification(event: string, userInfo: Record<string, any>, deliverImmediately?: boolean): void;
|
12389 | /**
|
12390 | * Posts `event` as native notifications of macOS. The `userInfo` is an Object that
|
12391 | * contains the user information dictionary sent along with the notification.
|
12392 | *
|
12393 | * @platform darwin
|
12394 | */
|
12395 | postWorkspaceNotification(event: string, userInfo: Record<string, any>): void;
|
12396 | /**
|
12397 | * resolves if the user has successfully authenticated with Touch ID.
|
12398 | *
|
12399 | * This API itself will not protect your user data; rather, it is a mechanism to
|
12400 | * allow you to do so. Native apps will need to set Access Control Constants like
|
12401 | * `kSecAccessControlUserPresence` on their keychain entry so that reading it would
|
12402 | * auto-prompt for Touch ID biometric consent. This could be done with
|
12403 | * `node-keytar`, such that one would store an encryption key with `node-keytar`
|
12404 | * and only fetch it if `promptTouchID()` resolves.
|
12405 | *
|
12406 | * @platform darwin
|
12407 | */
|
12408 | promptTouchID(reason: string): Promise<void>;
|
12409 | /**
|
12410 | * Add the specified defaults to your application's `NSUserDefaults`.
|
12411 | *
|
12412 | * @platform darwin
|
12413 | */
|
12414 | registerDefaults(defaults: Record<string, (string) | (boolean) | (number)>): void;
|
12415 | /**
|
12416 | * Removes the `key` in `NSUserDefaults`. This can be used to restore the default
|
12417 | * or global value of a `key` previously set with `setUserDefault`.
|
12418 | *
|
12419 | * @platform darwin
|
12420 | */
|
12421 | removeUserDefault(key: string): void;
|
12422 | /**
|
12423 | * Set the value of `key` in `NSUserDefaults`.
|
12424 | *
|
12425 | * Note that `type` should match actual type of `value`. An exception is thrown if
|
12426 | * they don't.
|
12427 | *
|
12428 | * Some popular `key` and `type`s are:
|
12429 | *
|
12430 | * * `ApplePressAndHoldEnabled`: `boolean`
|
12431 | *
|
12432 | * @platform darwin
|
12433 | */
|
12434 | setUserDefault<Type extends keyof UserDefaultTypes>(key: string, type: Type, value: UserDefaultTypes[Type]): void;
|
12435 | /**
|
12436 | * The ID of this subscription
|
12437 | *
|
12438 | * Same as `subscribeNotification`, but uses `NSNotificationCenter` for local
|
12439 | * defaults. This is necessary for events such as
|
12440 | * `NSUserDefaultsDidChangeNotification`.
|
12441 | *
|
12442 | * If `event` is null, the `NSNotificationCenter` doesn’t use it as criteria for
|
12443 | * delivery to the observer. See docs for more information.
|
12444 | *
|
12445 | * @platform darwin
|
12446 | */
|
12447 | subscribeLocalNotification(event: (string) | (null), callback: (event: string, userInfo: Record<string, unknown>, object: string) => void): number;
|
12448 | /**
|
12449 | * The ID of this subscription
|
12450 | *
|
12451 | * Subscribes to native notifications of macOS, `callback` will be called with
|
12452 | * `callback(event, userInfo)` when the corresponding `event` happens. The
|
12453 | * `userInfo` is an Object that contains the user information dictionary sent along
|
12454 | * with the notification. The `object` is the sender of the notification, and only
|
12455 | * supports `NSString` values for now.
|
12456 | *
|
12457 | * The `id` of the subscriber is returned, which can be used to unsubscribe the
|
12458 | * `event`.
|
12459 | *
|
12460 | * Under the hood this API subscribes to `NSDistributedNotificationCenter`, example
|
12461 | * values of `event` are:
|
12462 | *
|
12463 | * * `AppleInterfaceThemeChangedNotification`
|
12464 | * * `AppleAquaColorVariantChanged`
|
12465 | * * `AppleColorPreferencesChangedNotification`
|
12466 | * * `AppleShowScrollBarsSettingChanged`
|
12467 | *
|
12468 | * If `event` is null, the `NSDistributedNotificationCenter` doesn’t use it as
|
12469 | * criteria for delivery to the observer. See docs for more information.
|
12470 | *
|
12471 | * @platform darwin
|
12472 | */
|
12473 | subscribeNotification(event: (string) | (null), callback: (event: string, userInfo: Record<string, unknown>, object: string) => void): number;
|
12474 | /**
|
12475 | * The ID of this subscription
|
12476 | *
|
12477 | * Same as `subscribeNotification`, but uses
|
12478 | * `NSWorkspace.sharedWorkspace.notificationCenter`. This is necessary for events
|
12479 | * such as `NSWorkspaceDidActivateApplicationNotification`.
|
12480 | *
|
12481 | * If `event` is null, the `NSWorkspaceNotificationCenter` doesn’t use it as
|
12482 | * criteria for delivery to the observer. See docs for more information.
|
12483 | *
|
12484 | * @platform darwin
|
12485 | */
|
12486 | subscribeWorkspaceNotification(event: (string) | (null), callback: (event: string, userInfo: Record<string, unknown>, object: string) => void): number;
|
12487 | /**
|
12488 | * Same as `unsubscribeNotification`, but removes the subscriber from
|
12489 | * `NSNotificationCenter`.
|
12490 | *
|
12491 | * @platform darwin
|
12492 | */
|
12493 | unsubscribeLocalNotification(id: number): void;
|
12494 | /**
|
12495 | * Removes the subscriber with `id`.
|
12496 | *
|
12497 | * @platform darwin
|
12498 | */
|
12499 | unsubscribeNotification(id: number): void;
|
12500 | /**
|
12501 | * Same as `unsubscribeNotification`, but removes the subscriber from
|
12502 | * `NSWorkspace.sharedWorkspace.notificationCenter`.
|
12503 | *
|
12504 | * @platform darwin
|
12505 | */
|
12506 | unsubscribeWorkspaceNotification(id: number): void;
|
12507 | /**
|
12508 | * A `boolean` property which determines whether the app avoids using
|
12509 | * semitransparent backgrounds. This maps to
|
12510 | * NSWorkspace.accessibilityDisplayShouldReduceTransparency
|
12511 | *
|
12512 | * **Deprecated:** Use the new `nativeTheme.prefersReducedTransparency` API.
|
12513 | *
|
12514 | * @deprecated
|
12515 | * @platform darwin
|
12516 | */
|
12517 | accessibilityDisplayShouldReduceTransparency: boolean;
|
12518 | /**
|
12519 | * A `string` property that can be `dark`, `light` or `unknown`.
|
12520 | *
|
12521 | * Returns the macOS appearance setting that is currently applied to your
|
12522 | * application, maps to NSApplication.effectiveAppearance
|
12523 | *
|
12524 | * @platform darwin
|
12525 | */
|
12526 | readonly effectiveAppearance: ('dark' | 'light' | 'unknown');
|
12527 | }
|
12528 |
|
12529 | interface Task {
|
12530 |
|
12531 | // Docs: https://electronjs.org/docs/api/structures/task
|
12532 |
|
12533 | /**
|
12534 | * The command line arguments when `program` is executed.
|
12535 | */
|
12536 | arguments: string;
|
12537 | /**
|
12538 | * Description of this task.
|
12539 | */
|
12540 | description: string;
|
12541 | /**
|
12542 | * The icon index in the icon file. If an icon file consists of two or more icons,
|
12543 | * set this value to identify the icon. If an icon file consists of one icon, this
|
12544 | * value is 0.
|
12545 | */
|
12546 | iconIndex: number;
|
12547 | /**
|
12548 | * The absolute path to an icon to be displayed in a JumpList, which can be an
|
12549 | * arbitrary resource file that contains an icon. You can usually specify
|
12550 | * `process.execPath` to show the icon of the program.
|
12551 | */
|
12552 | iconPath: string;
|
12553 | /**
|
12554 | * Path of the program to execute, usually you should specify `process.execPath`
|
12555 | * which opens the current program.
|
12556 | */
|
12557 | program: string;
|
12558 | /**
|
12559 | * The string to be displayed in a JumpList.
|
12560 | */
|
12561 | title: string;
|
12562 | /**
|
12563 | * The working directory. Default is empty.
|
12564 | */
|
12565 | workingDirectory?: string;
|
12566 | }
|
12567 |
|
12568 | interface ThumbarButton {
|
12569 |
|
12570 | // Docs: https://electronjs.org/docs/api/structures/thumbar-button
|
12571 |
|
12572 | click: () => void;
|
12573 | /**
|
12574 | * Control specific states and behaviors of the button. By default, it is
|
12575 | * `['enabled']`.
|
12576 | */
|
12577 | flags?: string[];
|
12578 | /**
|
12579 | * The icon showing in thumbnail toolbar.
|
12580 | */
|
12581 | icon: NativeImage;
|
12582 | /**
|
12583 | * The text of the button's tooltip.
|
12584 | */
|
12585 | tooltip?: string;
|
12586 | }
|
12587 |
|
12588 | class TouchBar {
|
12589 |
|
12590 | // Docs: https://electronjs.org/docs/api/touch-bar
|
12591 |
|
12592 | /**
|
12593 | * TouchBar
|
12594 | */
|
12595 | constructor(options: TouchBarConstructorOptions);
|
12596 | /**
|
12597 | * A `TouchBarItem` that will replace the "esc" button on the touch bar when set.
|
12598 | * Setting to `null` restores the default "esc" button. Changing this value
|
12599 | * immediately updates the escape item in the touch bar.
|
12600 | */
|
12601 | escapeItem: (TouchBarButton | TouchBarColorPicker | TouchBarGroup | TouchBarLabel | TouchBarPopover | TouchBarScrubber | TouchBarSegmentedControl | TouchBarSlider | TouchBarSpacer | null);
|
12602 | /**
|
12603 | * A `typeof TouchBarButton` reference to the `TouchBarButton` class.
|
12604 | */
|
12605 | static TouchBarButton: typeof TouchBarButton;
|
12606 | /**
|
12607 | * A `typeof TouchBarColorPicker` reference to the `TouchBarColorPicker` class.
|
12608 | */
|
12609 | static TouchBarColorPicker: typeof TouchBarColorPicker;
|
12610 | /**
|
12611 | * A `typeof TouchBarGroup` reference to the `TouchBarGroup` class.
|
12612 | */
|
12613 | static TouchBarGroup: typeof TouchBarGroup;
|
12614 | /**
|
12615 | * A `typeof TouchBarLabel` reference to the `TouchBarLabel` class.
|
12616 | */
|
12617 | static TouchBarLabel: typeof TouchBarLabel;
|
12618 | /**
|
12619 | * A `typeof TouchBarOtherItemsProxy` reference to the `TouchBarOtherItemsProxy`
|
12620 | * class.
|
12621 | */
|
12622 | static TouchBarOtherItemsProxy: typeof TouchBarOtherItemsProxy;
|
12623 | /**
|
12624 | * A `typeof TouchBarPopover` reference to the `TouchBarPopover` class.
|
12625 | */
|
12626 | static TouchBarPopover: typeof TouchBarPopover;
|
12627 | /**
|
12628 | * A `typeof TouchBarScrubber` reference to the `TouchBarScrubber` class.
|
12629 | */
|
12630 | static TouchBarScrubber: typeof TouchBarScrubber;
|
12631 | /**
|
12632 | * A `typeof TouchBarSegmentedControl` reference to the `TouchBarSegmentedControl`
|
12633 | * class.
|
12634 | */
|
12635 | static TouchBarSegmentedControl: typeof TouchBarSegmentedControl;
|
12636 | /**
|
12637 | * A `typeof TouchBarSlider` reference to the `TouchBarSlider` class.
|
12638 | */
|
12639 | static TouchBarSlider: typeof TouchBarSlider;
|
12640 | /**
|
12641 | * A `typeof TouchBarSpacer` reference to the `TouchBarSpacer` class.
|
12642 | */
|
12643 | static TouchBarSpacer: typeof TouchBarSpacer;
|
12644 | }
|
12645 |
|
12646 | class TouchBarButton {
|
12647 |
|
12648 | // Docs: https://electronjs.org/docs/api/touch-bar-button
|
12649 |
|
12650 | /**
|
12651 | * TouchBarButton
|
12652 | */
|
12653 | constructor(options: TouchBarButtonConstructorOptions);
|
12654 | /**
|
12655 | * A `string` representing the description of the button to be read by a screen
|
12656 | * reader. Will only be read by screen readers if no label is set.
|
12657 | */
|
12658 | accessibilityLabel: string;
|
12659 | /**
|
12660 | * A `string` hex code representing the button's current background color. Changing
|
12661 | * this value immediately updates the button in the touch bar.
|
12662 | */
|
12663 | backgroundColor: string;
|
12664 | /**
|
12665 | * A `boolean` representing whether the button is in an enabled state.
|
12666 | */
|
12667 | enabled: boolean;
|
12668 | /**
|
12669 | * A `NativeImage` representing the button's current icon. Changing this value
|
12670 | * immediately updates the button in the touch bar.
|
12671 | */
|
12672 | icon: NativeImage;
|
12673 | /**
|
12674 | * A `string` - Can be `left`, `right` or `overlay`. Defaults to `overlay`.
|
12675 | */
|
12676 | iconPosition: ('left' | 'right' | 'overlay');
|
12677 | /**
|
12678 | * A `string` representing the button's current text. Changing this value
|
12679 | * immediately updates the button in the touch bar.
|
12680 | */
|
12681 | label: string;
|
12682 | }
|
12683 |
|
12684 | class TouchBarColorPicker {
|
12685 |
|
12686 | // Docs: https://electronjs.org/docs/api/touch-bar-color-picker
|
12687 |
|
12688 | /**
|
12689 | * TouchBarColorPicker
|
12690 | */
|
12691 | constructor(options: TouchBarColorPickerConstructorOptions);
|
12692 | /**
|
12693 | * A `string[]` array representing the color picker's available colors to select.
|
12694 | * Changing this value immediately updates the color picker in the touch bar.
|
12695 | */
|
12696 | availableColors: string[];
|
12697 | /**
|
12698 | * A `string` hex code representing the color picker's currently selected color.
|
12699 | * Changing this value immediately updates the color picker in the touch bar.
|
12700 | */
|
12701 | selectedColor: string;
|
12702 | }
|
12703 |
|
12704 | class TouchBarGroup {
|
12705 |
|
12706 | // Docs: https://electronjs.org/docs/api/touch-bar-group
|
12707 |
|
12708 | /**
|
12709 | * TouchBarGroup
|
12710 | */
|
12711 | constructor(options: TouchBarGroupConstructorOptions);
|
12712 | }
|
12713 |
|
12714 | class TouchBarLabel {
|
12715 |
|
12716 | // Docs: https://electronjs.org/docs/api/touch-bar-label
|
12717 |
|
12718 | /**
|
12719 | * TouchBarLabel
|
12720 | */
|
12721 | constructor(options: TouchBarLabelConstructorOptions);
|
12722 | /**
|
12723 | * A `string` representing the description of the label to be read by a screen
|
12724 | * reader.
|
12725 | */
|
12726 | accessibilityLabel: string;
|
12727 | /**
|
12728 | * A `string` representing the label's current text. Changing this value
|
12729 | * immediately updates the label in the touch bar.
|
12730 | */
|
12731 | label: string;
|
12732 | /**
|
12733 | * A `string` hex code representing the label's current text color. Changing this
|
12734 | * value immediately updates the label in the touch bar.
|
12735 | */
|
12736 | textColor: string;
|
12737 | }
|
12738 |
|
12739 | class TouchBarOtherItemsProxy {
|
12740 |
|
12741 | // Docs: https://electronjs.org/docs/api/touch-bar-other-items-proxy
|
12742 |
|
12743 | /**
|
12744 | * TouchBarOtherItemsProxy
|
12745 | */
|
12746 | constructor();
|
12747 | }
|
12748 |
|
12749 | class TouchBarPopover {
|
12750 |
|
12751 | // Docs: https://electronjs.org/docs/api/touch-bar-popover
|
12752 |
|
12753 | /**
|
12754 | * TouchBarPopover
|
12755 | */
|
12756 | constructor(options: TouchBarPopoverConstructorOptions);
|
12757 | /**
|
12758 | * A `NativeImage` representing the popover's current button icon. Changing this
|
12759 | * value immediately updates the popover in the touch bar.
|
12760 | */
|
12761 | icon: NativeImage;
|
12762 | /**
|
12763 | * A `string` representing the popover's current button text. Changing this value
|
12764 | * immediately updates the popover in the touch bar.
|
12765 | */
|
12766 | label: string;
|
12767 | }
|
12768 |
|
12769 | class TouchBarScrubber {
|
12770 |
|
12771 | // Docs: https://electronjs.org/docs/api/touch-bar-scrubber
|
12772 |
|
12773 | /**
|
12774 | * TouchBarScrubber
|
12775 | */
|
12776 | constructor(options: TouchBarScrubberConstructorOptions);
|
12777 | /**
|
12778 | * A `boolean` representing whether this scrubber is continuous or not. Updating
|
12779 | * this value immediately updates the control in the touch bar.
|
12780 | */
|
12781 | continuous: boolean;
|
12782 | /**
|
12783 | * A `ScrubberItem[]` array representing the items in this scrubber. Updating this
|
12784 | * value immediately updates the control in the touch bar. Updating deep properties
|
12785 | * inside this array **does not update the touch bar**.
|
12786 | */
|
12787 | items: ScrubberItem[];
|
12788 | /**
|
12789 | * A `string` representing the mode of this scrubber. Updating this value
|
12790 | * immediately updates the control in the touch bar. Possible values:
|
12791 | *
|
12792 | * * `fixed` - Maps to `NSScrubberModeFixed`.
|
12793 | * * `free` - Maps to `NSScrubberModeFree`.
|
12794 | */
|
12795 | mode: ('fixed' | 'free');
|
12796 | /**
|
12797 | * A `string` representing the style that selected items in the scrubber should
|
12798 | * have. This style is overlaid on top of the scrubber item instead of being placed
|
12799 | * behind it. Updating this value immediately updates the control in the touch bar.
|
12800 | * Possible values:
|
12801 | *
|
12802 | * * `background` - Maps to `[NSScrubberSelectionStyle roundedBackgroundStyle]`.
|
12803 | * * `outline` - Maps to `[NSScrubberSelectionStyle outlineOverlayStyle]`.
|
12804 | * * `none` - Removes all styles.
|
12805 | */
|
12806 | overlayStyle: ('background' | 'outline' | 'none');
|
12807 | /**
|
12808 | * A `string` representing the style that selected items in the scrubber should
|
12809 | * have. Updating this value immediately updates the control in the touch bar.
|
12810 | * Possible values:
|
12811 | *
|
12812 | * * `background` - Maps to `[NSScrubberSelectionStyle roundedBackgroundStyle]`.
|
12813 | * * `outline` - Maps to `[NSScrubberSelectionStyle outlineOverlayStyle]`.
|
12814 | * * `none` - Removes all styles.
|
12815 | */
|
12816 | selectedStyle: ('background' | 'outline' | 'none');
|
12817 | /**
|
12818 | * A `boolean` representing whether to show the left / right selection arrows in
|
12819 | * this scrubber. Updating this value immediately updates the control in the touch
|
12820 | * bar.
|
12821 | */
|
12822 | showArrowButtons: boolean;
|
12823 | }
|
12824 |
|
12825 | class TouchBarSegmentedControl {
|
12826 |
|
12827 | // Docs: https://electronjs.org/docs/api/touch-bar-segmented-control
|
12828 |
|
12829 | /**
|
12830 | * TouchBarSegmentedControl
|
12831 | */
|
12832 | constructor(options: TouchBarSegmentedControlConstructorOptions);
|
12833 | /**
|
12834 | * A `string` representing the current selection mode of the control. Can be
|
12835 | * `single`, `multiple` or `buttons`.
|
12836 | */
|
12837 | mode: ('single' | 'multiple' | 'buttons');
|
12838 | /**
|
12839 | * A `SegmentedControlSegment[]` array representing the segments in this control.
|
12840 | * Updating this value immediately updates the control in the touch bar. Updating
|
12841 | * deep properties inside this array **does not update the touch bar**.
|
12842 | */
|
12843 | segments: SegmentedControlSegment[];
|
12844 | /**
|
12845 | * A `string` representing the controls current segment style. Updating this value
|
12846 | * immediately updates the control in the touch bar.
|
12847 | */
|
12848 | segmentStyle: string;
|
12849 | /**
|
12850 | * An `Integer` representing the currently selected segment. Changing this value
|
12851 | * immediately updates the control in the touch bar. User interaction with the
|
12852 | * touch bar will update this value automatically.
|
12853 | */
|
12854 | selectedIndex: number;
|
12855 | }
|
12856 |
|
12857 | class TouchBarSlider {
|
12858 |
|
12859 | // Docs: https://electronjs.org/docs/api/touch-bar-slider
|
12860 |
|
12861 | /**
|
12862 | * TouchBarSlider
|
12863 | */
|
12864 | constructor(options: TouchBarSliderConstructorOptions);
|
12865 | /**
|
12866 | * A `string` representing the slider's current text. Changing this value
|
12867 | * immediately updates the slider in the touch bar.
|
12868 | */
|
12869 | label: string;
|
12870 | /**
|
12871 | * A `number` representing the slider's current maximum value. Changing this value
|
12872 | * immediately updates the slider in the touch bar.
|
12873 | */
|
12874 | maxValue: number;
|
12875 | /**
|
12876 | * A `number` representing the slider's current minimum value. Changing this value
|
12877 | * immediately updates the slider in the touch bar.
|
12878 | */
|
12879 | minValue: number;
|
12880 | /**
|
12881 | * A `number` representing the slider's current value. Changing this value
|
12882 | * immediately updates the slider in the touch bar.
|
12883 | */
|
12884 | value: number;
|
12885 | }
|
12886 |
|
12887 | class TouchBarSpacer {
|
12888 |
|
12889 | // Docs: https://electronjs.org/docs/api/touch-bar-spacer
|
12890 |
|
12891 | /**
|
12892 | * TouchBarSpacer
|
12893 | */
|
12894 | constructor(options: TouchBarSpacerConstructorOptions);
|
12895 | /**
|
12896 | * A `string` representing the size of the spacer. Can be `small`, `large` or
|
12897 | * `flexible`.
|
12898 | */
|
12899 | size: ('small' | 'large' | 'flexible');
|
12900 | }
|
12901 |
|
12902 | interface TraceCategoriesAndOptions {
|
12903 |
|
12904 | // Docs: https://electronjs.org/docs/api/structures/trace-categories-and-options
|
12905 |
|
12906 | /**
|
12907 | * A filter to control what category groups should be traced. A filter can have an
|
12908 | * optional '-' prefix to exclude category groups that contain a matching category.
|
12909 | * Having both included and excluded category patterns in the same list is not
|
12910 | * supported. Examples: `test_MyTest*`, `test_MyTest*,test_OtherStuff`,
|
12911 | * `-excluded_category1,-excluded_category2`.
|
12912 | */
|
12913 | categoryFilter: string;
|
12914 | /**
|
12915 | * Controls what kind of tracing is enabled, it is a comma-delimited sequence of
|
12916 | * the following strings: `record-until-full`, `record-continuously`,
|
12917 | * `trace-to-console`, `enable-sampling`, `enable-systrace`, e.g.
|
12918 | * `'record-until-full,enable-sampling'`. The first 3 options are trace recording
|
12919 | * modes and hence mutually exclusive. If more than one trace recording modes
|
12920 | * appear in the `traceOptions` string, the last one takes precedence. If none of
|
12921 | * the trace recording modes are specified, recording mode is `record-until-full`.
|
12922 | * The trace option will first be reset to the default option (`record_mode` set to
|
12923 | * `record-until-full`, `enable_sampling` and `enable_systrace` set to `false`)
|
12924 | * before options parsed from `traceOptions` are applied on it.
|
12925 | */
|
12926 | traceOptions: string;
|
12927 | }
|
12928 |
|
12929 | interface TraceConfig {
|
12930 |
|
12931 | // Docs: https://electronjs.org/docs/api/structures/trace-config
|
12932 |
|
12933 | /**
|
12934 | * if true, filter event data according to a specific list of events that have been
|
12935 | * manually vetted to not include any PII. See the implementation in Chromium for
|
12936 | * specifics.
|
12937 | */
|
12938 | enable_argument_filter?: boolean;
|
12939 | /**
|
12940 | * a list of tracing categories to exclude. Can include glob-like patterns using
|
12941 | * `*` at the end of the category name. See tracing categories for the list of
|
12942 | * categories.
|
12943 | */
|
12944 | excluded_categories?: string[];
|
12945 | /**
|
12946 | * a list of histogram names to report with the trace.
|
12947 | */
|
12948 | histogram_names?: string[];
|
12949 | /**
|
12950 | * a list of tracing categories to include. Can include glob-like patterns using
|
12951 | * `*` at the end of the category name. See tracing categories for the list of
|
12952 | * categories.
|
12953 | */
|
12954 | included_categories?: string[];
|
12955 | /**
|
12956 | * a list of process IDs to include in the trace. If not specified, trace all
|
12957 | * processes.
|
12958 | */
|
12959 | included_process_ids?: number[];
|
12960 | /**
|
12961 | * if the `disabled-by-default-memory-infra` category is enabled, this contains
|
12962 | * optional additional configuration for data collection. See the Chromium
|
12963 | * memory-infra docs for more information.
|
12964 | */
|
12965 | memory_dump_config?: Record<string, any>;
|
12966 | /**
|
12967 | * Can be `record-until-full`, `record-continuously`, `record-as-much-as-possible`
|
12968 | * or `trace-to-console`. Defaults to `record-until-full`.
|
12969 | */
|
12970 | recording_mode?: ('record-until-full' | 'record-continuously' | 'record-as-much-as-possible' | 'trace-to-console');
|
12971 | /**
|
12972 | * maximum size of the trace recording buffer in events.
|
12973 | */
|
12974 | trace_buffer_size_in_events?: number;
|
12975 | /**
|
12976 | * maximum size of the trace recording buffer in kilobytes. Defaults to 100MB.
|
12977 | */
|
12978 | trace_buffer_size_in_kb?: number;
|
12979 | }
|
12980 |
|
12981 | interface Transaction {
|
12982 |
|
12983 | // Docs: https://electronjs.org/docs/api/structures/transaction
|
12984 |
|
12985 | /**
|
12986 | * The error code if an error occurred while processing the transaction.
|
12987 | */
|
12988 | errorCode: number;
|
12989 | /**
|
12990 | * The error message if an error occurred while processing the transaction.
|
12991 | */
|
12992 | errorMessage: string;
|
12993 | /**
|
12994 | * The identifier of the restored transaction by the App Store.
|
12995 | */
|
12996 | originalTransactionIdentifier: string;
|
12997 | payment: Payment;
|
12998 | /**
|
12999 | * The date the transaction was added to the App Store’s payment queue.
|
13000 | */
|
13001 | transactionDate: string;
|
13002 | /**
|
13003 | * A string that uniquely identifies a successful payment transaction.
|
13004 | */
|
13005 | transactionIdentifier: string;
|
13006 | /**
|
13007 | * The transaction state, can be `purchasing`, `purchased`, `failed`, `restored` or
|
13008 | * `deferred`.
|
13009 | */
|
13010 | transactionState: ('purchasing' | 'purchased' | 'failed' | 'restored' | 'deferred');
|
13011 | }
|
13012 |
|
13013 | class Tray extends NodeEventEmitter {
|
13014 |
|
13015 | // Docs: https://electronjs.org/docs/api/tray
|
13016 |
|
13017 | /**
|
13018 | * Emitted when the tray balloon is clicked.
|
13019 | *
|
13020 | * @platform win32
|
13021 | */
|
13022 | on(event: 'balloon-click', listener: () => void): this;
|
13023 | /**
|
13024 | * @platform win32
|
13025 | */
|
13026 | off(event: 'balloon-click', listener: () => void): this;
|
13027 | /**
|
13028 | * @platform win32
|
13029 | */
|
13030 | once(event: 'balloon-click', listener: () => void): this;
|
13031 | /**
|
13032 | * @platform win32
|
13033 | */
|
13034 | addListener(event: 'balloon-click', listener: () => void): this;
|
13035 | /**
|
13036 | * @platform win32
|
13037 | */
|
13038 | removeListener(event: 'balloon-click', listener: () => void): this;
|
13039 | /**
|
13040 | * Emitted when the tray balloon is closed because of timeout or user manually
|
13041 | * closes it.
|
13042 | *
|
13043 | * @platform win32
|
13044 | */
|
13045 | on(event: 'balloon-closed', listener: () => void): this;
|
13046 | /**
|
13047 | * @platform win32
|
13048 | */
|
13049 | off(event: 'balloon-closed', listener: () => void): this;
|
13050 | /**
|
13051 | * @platform win32
|
13052 | */
|
13053 | once(event: 'balloon-closed', listener: () => void): this;
|
13054 | /**
|
13055 | * @platform win32
|
13056 | */
|
13057 | addListener(event: 'balloon-closed', listener: () => void): this;
|
13058 | /**
|
13059 | * @platform win32
|
13060 | */
|
13061 | removeListener(event: 'balloon-closed', listener: () => void): this;
|
13062 | /**
|
13063 | * Emitted when the tray balloon shows.
|
13064 | *
|
13065 | * @platform win32
|
13066 | */
|
13067 | on(event: 'balloon-show', listener: () => void): this;
|
13068 | /**
|
13069 | * @platform win32
|
13070 | */
|
13071 | off(event: 'balloon-show', listener: () => void): this;
|
13072 | /**
|
13073 | * @platform win32
|
13074 | */
|
13075 | once(event: 'balloon-show', listener: () => void): this;
|
13076 | /**
|
13077 | * @platform win32
|
13078 | */
|
13079 | addListener(event: 'balloon-show', listener: () => void): this;
|
13080 | /**
|
13081 | * @platform win32
|
13082 | */
|
13083 | removeListener(event: 'balloon-show', listener: () => void): this;
|
13084 | /**
|
13085 | * Emitted when the tray icon is clicked.
|
13086 | *
|
13087 | * Note that on Linux this event is emitted when the tray icon receives an
|
13088 | * activation, which might not necessarily be left mouse click.
|
13089 | */
|
13090 | on(event: 'click', listener: (event: KeyboardEvent,
|
13091 | /**
|
13092 | * The bounds of tray icon.
|
13093 | */
|
13094 | bounds: Rectangle,
|
13095 | /**
|
13096 | * The position of the event.
|
13097 | */
|
13098 | position: Point) => void): this;
|
13099 | off(event: 'click', listener: (event: KeyboardEvent,
|
13100 | /**
|
13101 | * The bounds of tray icon.
|
13102 | */
|
13103 | bounds: Rectangle,
|
13104 | /**
|
13105 | * The position of the event.
|
13106 | */
|
13107 | position: Point) => void): this;
|
13108 | once(event: 'click', listener: (event: KeyboardEvent,
|
13109 | /**
|
13110 | * The bounds of tray icon.
|
13111 | */
|
13112 | bounds: Rectangle,
|
13113 | /**
|
13114 | * The position of the event.
|
13115 | */
|
13116 | position: Point) => void): this;
|
13117 | addListener(event: 'click', listener: (event: KeyboardEvent,
|
13118 | /**
|
13119 | * The bounds of tray icon.
|
13120 | */
|
13121 | bounds: Rectangle,
|
13122 | /**
|
13123 | * The position of the event.
|
13124 | */
|
13125 | position: Point) => void): this;
|
13126 | removeListener(event: 'click', listener: (event: KeyboardEvent,
|
13127 | /**
|
13128 | * The bounds of tray icon.
|
13129 | */
|
13130 | bounds: Rectangle,
|
13131 | /**
|
13132 | * The position of the event.
|
13133 | */
|
13134 | position: Point) => void): this;
|
13135 | /**
|
13136 | * Emitted when the tray icon is double clicked.
|
13137 | *
|
13138 | * @platform darwin,win32
|
13139 | */
|
13140 | on(event: 'double-click', listener: (event: KeyboardEvent,
|
13141 | /**
|
13142 | * The bounds of tray icon.
|
13143 | */
|
13144 | bounds: Rectangle) => void): this;
|
13145 | /**
|
13146 | * @platform darwin,win32
|
13147 | */
|
13148 | off(event: 'double-click', listener: (event: KeyboardEvent,
|
13149 | /**
|
13150 | * The bounds of tray icon.
|
13151 | */
|
13152 | bounds: Rectangle) => void): this;
|
13153 | /**
|
13154 | * @platform darwin,win32
|
13155 | */
|
13156 | once(event: 'double-click', listener: (event: KeyboardEvent,
|
13157 | /**
|
13158 | * The bounds of tray icon.
|
13159 | */
|
13160 | bounds: Rectangle) => void): this;
|
13161 | /**
|
13162 | * @platform darwin,win32
|
13163 | */
|
13164 | addListener(event: 'double-click', listener: (event: KeyboardEvent,
|
13165 | /**
|
13166 | * The bounds of tray icon.
|
13167 | */
|
13168 | bounds: Rectangle) => void): this;
|
13169 | /**
|
13170 | * @platform darwin,win32
|
13171 | */
|
13172 | removeListener(event: 'double-click', listener: (event: KeyboardEvent,
|
13173 | /**
|
13174 | * The bounds of tray icon.
|
13175 | */
|
13176 | bounds: Rectangle) => void): this;
|
13177 | /**
|
13178 | * Emitted when a drag operation ends on the tray or ends at another location.
|
13179 | *
|
13180 | * @platform darwin
|
13181 | */
|
13182 | on(event: 'drag-end', listener: () => void): this;
|
13183 | /**
|
13184 | * @platform darwin
|
13185 | */
|
13186 | off(event: 'drag-end', listener: () => void): this;
|
13187 | /**
|
13188 | * @platform darwin
|
13189 | */
|
13190 | once(event: 'drag-end', listener: () => void): this;
|
13191 | /**
|
13192 | * @platform darwin
|
13193 | */
|
13194 | addListener(event: 'drag-end', listener: () => void): this;
|
13195 | /**
|
13196 | * @platform darwin
|
13197 | */
|
13198 | removeListener(event: 'drag-end', listener: () => void): this;
|
13199 | /**
|
13200 | * Emitted when a drag operation enters the tray icon.
|
13201 | *
|
13202 | * @platform darwin
|
13203 | */
|
13204 | on(event: 'drag-enter', listener: () => void): this;
|
13205 | /**
|
13206 | * @platform darwin
|
13207 | */
|
13208 | off(event: 'drag-enter', listener: () => void): this;
|
13209 | /**
|
13210 | * @platform darwin
|
13211 | */
|
13212 | once(event: 'drag-enter', listener: () => void): this;
|
13213 | /**
|
13214 | * @platform darwin
|
13215 | */
|
13216 | addListener(event: 'drag-enter', listener: () => void): this;
|
13217 | /**
|
13218 | * @platform darwin
|
13219 | */
|
13220 | removeListener(event: 'drag-enter', listener: () => void): this;
|
13221 | /**
|
13222 | * Emitted when a drag operation exits the tray icon.
|
13223 | *
|
13224 | * @platform darwin
|
13225 | */
|
13226 | on(event: 'drag-leave', listener: () => void): this;
|
13227 | /**
|
13228 | * @platform darwin
|
13229 | */
|
13230 | off(event: 'drag-leave', listener: () => void): this;
|
13231 | /**
|
13232 | * @platform darwin
|
13233 | */
|
13234 | once(event: 'drag-leave', listener: () => void): this;
|
13235 | /**
|
13236 | * @platform darwin
|
13237 | */
|
13238 | addListener(event: 'drag-leave', listener: () => void): this;
|
13239 | /**
|
13240 | * @platform darwin
|
13241 | */
|
13242 | removeListener(event: 'drag-leave', listener: () => void): this;
|
13243 | /**
|
13244 | * Emitted when any dragged items are dropped on the tray icon.
|
13245 | *
|
13246 | * @platform darwin
|
13247 | */
|
13248 | on(event: 'drop', listener: () => void): this;
|
13249 | /**
|
13250 | * @platform darwin
|
13251 | */
|
13252 | off(event: 'drop', listener: () => void): this;
|
13253 | /**
|
13254 | * @platform darwin
|
13255 | */
|
13256 | once(event: 'drop', listener: () => void): this;
|
13257 | /**
|
13258 | * @platform darwin
|
13259 | */
|
13260 | addListener(event: 'drop', listener: () => void): this;
|
13261 | /**
|
13262 | * @platform darwin
|
13263 | */
|
13264 | removeListener(event: 'drop', listener: () => void): this;
|
13265 | /**
|
13266 | * Emitted when dragged files are dropped in the tray icon.
|
13267 | *
|
13268 | * @platform darwin
|
13269 | */
|
13270 | on(event: 'drop-files', listener: (event: Event,
|
13271 | /**
|
13272 | * The paths of the dropped files.
|
13273 | */
|
13274 | files: string[]) => void): this;
|
13275 | /**
|
13276 | * @platform darwin
|
13277 | */
|
13278 | off(event: 'drop-files', listener: (event: Event,
|
13279 | /**
|
13280 | * The paths of the dropped files.
|
13281 | */
|
13282 | files: string[]) => void): this;
|
13283 | /**
|
13284 | * @platform darwin
|
13285 | */
|
13286 | once(event: 'drop-files', listener: (event: Event,
|
13287 | /**
|
13288 | * The paths of the dropped files.
|
13289 | */
|
13290 | files: string[]) => void): this;
|
13291 | /**
|
13292 | * @platform darwin
|
13293 | */
|
13294 | addListener(event: 'drop-files', listener: (event: Event,
|
13295 | /**
|
13296 | * The paths of the dropped files.
|
13297 | */
|
13298 | files: string[]) => void): this;
|
13299 | /**
|
13300 | * @platform darwin
|
13301 | */
|
13302 | removeListener(event: 'drop-files', listener: (event: Event,
|
13303 | /**
|
13304 | * The paths of the dropped files.
|
13305 | */
|
13306 | files: string[]) => void): this;
|
13307 | /**
|
13308 | * Emitted when dragged text is dropped in the tray icon.
|
13309 | *
|
13310 | * @platform darwin
|
13311 | */
|
13312 | on(event: 'drop-text', listener: (event: Event,
|
13313 | /**
|
13314 | * the dropped text string.
|
13315 | */
|
13316 | text: string) => void): this;
|
13317 | /**
|
13318 | * @platform darwin
|
13319 | */
|
13320 | off(event: 'drop-text', listener: (event: Event,
|
13321 | /**
|
13322 | * the dropped text string.
|
13323 | */
|
13324 | text: string) => void): this;
|
13325 | /**
|
13326 | * @platform darwin
|
13327 | */
|
13328 | once(event: 'drop-text', listener: (event: Event,
|
13329 | /**
|
13330 | * the dropped text string.
|
13331 | */
|
13332 | text: string) => void): this;
|
13333 | /**
|
13334 | * @platform darwin
|
13335 | */
|
13336 | addListener(event: 'drop-text', listener: (event: Event,
|
13337 | /**
|
13338 | * the dropped text string.
|
13339 | */
|
13340 | text: string) => void): this;
|
13341 | /**
|
13342 | * @platform darwin
|
13343 | */
|
13344 | removeListener(event: 'drop-text', listener: (event: Event,
|
13345 | /**
|
13346 | * the dropped text string.
|
13347 | */
|
13348 | text: string) => void): this;
|
13349 | /**
|
13350 | * Emitted when the tray icon is middle clicked.
|
13351 | *
|
13352 | * @platform win32
|
13353 | */
|
13354 | on(event: 'middle-click', listener: (event: KeyboardEvent,
|
13355 | /**
|
13356 | * The bounds of tray icon.
|
13357 | */
|
13358 | bounds: Rectangle) => void): this;
|
13359 | /**
|
13360 | * @platform win32
|
13361 | */
|
13362 | off(event: 'middle-click', listener: (event: KeyboardEvent,
|
13363 | /**
|
13364 | * The bounds of tray icon.
|
13365 | */
|
13366 | bounds: Rectangle) => void): this;
|
13367 | /**
|
13368 | * @platform win32
|
13369 | */
|
13370 | once(event: 'middle-click', listener: (event: KeyboardEvent,
|
13371 | /**
|
13372 | * The bounds of tray icon.
|
13373 | */
|
13374 | bounds: Rectangle) => void): this;
|
13375 | /**
|
13376 | * @platform win32
|
13377 | */
|
13378 | addListener(event: 'middle-click', listener: (event: KeyboardEvent,
|
13379 | /**
|
13380 | * The bounds of tray icon.
|
13381 | */
|
13382 | bounds: Rectangle) => void): this;
|
13383 | /**
|
13384 | * @platform win32
|
13385 | */
|
13386 | removeListener(event: 'middle-click', listener: (event: KeyboardEvent,
|
13387 | /**
|
13388 | * The bounds of tray icon.
|
13389 | */
|
13390 | bounds: Rectangle) => void): this;
|
13391 | /**
|
13392 | * Emitted when the mouse clicks the tray icon.
|
13393 | *
|
13394 | * @platform darwin
|
13395 | */
|
13396 | on(event: 'mouse-down', listener: (event: KeyboardEvent,
|
13397 | /**
|
13398 | * The position of the event.
|
13399 | */
|
13400 | position: Point) => void): this;
|
13401 | /**
|
13402 | * @platform darwin
|
13403 | */
|
13404 | off(event: 'mouse-down', listener: (event: KeyboardEvent,
|
13405 | /**
|
13406 | * The position of the event.
|
13407 | */
|
13408 | position: Point) => void): this;
|
13409 | /**
|
13410 | * @platform darwin
|
13411 | */
|
13412 | once(event: 'mouse-down', listener: (event: KeyboardEvent,
|
13413 | /**
|
13414 | * The position of the event.
|
13415 | */
|
13416 | position: Point) => void): this;
|
13417 | /**
|
13418 | * @platform darwin
|
13419 | */
|
13420 | addListener(event: 'mouse-down', listener: (event: KeyboardEvent,
|
13421 | /**
|
13422 | * The position of the event.
|
13423 | */
|
13424 | position: Point) => void): this;
|
13425 | /**
|
13426 | * @platform darwin
|
13427 | */
|
13428 | removeListener(event: 'mouse-down', listener: (event: KeyboardEvent,
|
13429 | /**
|
13430 | * The position of the event.
|
13431 | */
|
13432 | position: Point) => void): this;
|
13433 | /**
|
13434 | * Emitted when the mouse enters the tray icon.
|
13435 | *
|
13436 | * @platform darwin,win32
|
13437 | */
|
13438 | on(event: 'mouse-enter', listener: (event: KeyboardEvent,
|
13439 | /**
|
13440 | * The position of the event.
|
13441 | */
|
13442 | position: Point) => void): this;
|
13443 | /**
|
13444 | * @platform darwin,win32
|
13445 | */
|
13446 | off(event: 'mouse-enter', listener: (event: KeyboardEvent,
|
13447 | /**
|
13448 | * The position of the event.
|
13449 | */
|
13450 | position: Point) => void): this;
|
13451 | /**
|
13452 | * @platform darwin,win32
|
13453 | */
|
13454 | once(event: 'mouse-enter', listener: (event: KeyboardEvent,
|
13455 | /**
|
13456 | * The position of the event.
|
13457 | */
|
13458 | position: Point) => void): this;
|
13459 | /**
|
13460 | * @platform darwin,win32
|
13461 | */
|
13462 | addListener(event: 'mouse-enter', listener: (event: KeyboardEvent,
|
13463 | /**
|
13464 | * The position of the event.
|
13465 | */
|
13466 | position: Point) => void): this;
|
13467 | /**
|
13468 | * @platform darwin,win32
|
13469 | */
|
13470 | removeListener(event: 'mouse-enter', listener: (event: KeyboardEvent,
|
13471 | /**
|
13472 | * The position of the event.
|
13473 | */
|
13474 | position: Point) => void): this;
|
13475 | /**
|
13476 | * Emitted when the mouse exits the tray icon.
|
13477 | *
|
13478 | * @platform darwin,win32
|
13479 | */
|
13480 | on(event: 'mouse-leave', listener: (event: KeyboardEvent,
|
13481 | /**
|
13482 | * The position of the event.
|
13483 | */
|
13484 | position: Point) => void): this;
|
13485 | /**
|
13486 | * @platform darwin,win32
|
13487 | */
|
13488 | off(event: 'mouse-leave', listener: (event: KeyboardEvent,
|
13489 | /**
|
13490 | * The position of the event.
|
13491 | */
|
13492 | position: Point) => void): this;
|
13493 | /**
|
13494 | * @platform darwin,win32
|
13495 | */
|
13496 | once(event: 'mouse-leave', listener: (event: KeyboardEvent,
|
13497 | /**
|
13498 | * The position of the event.
|
13499 | */
|
13500 | position: Point) => void): this;
|
13501 | /**
|
13502 | * @platform darwin,win32
|
13503 | */
|
13504 | addListener(event: 'mouse-leave', listener: (event: KeyboardEvent,
|
13505 | /**
|
13506 | * The position of the event.
|
13507 | */
|
13508 | position: Point) => void): this;
|
13509 | /**
|
13510 | * @platform darwin,win32
|
13511 | */
|
13512 | removeListener(event: 'mouse-leave', listener: (event: KeyboardEvent,
|
13513 | /**
|
13514 | * The position of the event.
|
13515 | */
|
13516 | position: Point) => void): this;
|
13517 | /**
|
13518 | * Emitted when the mouse moves in the tray icon.
|
13519 | *
|
13520 | * @platform darwin,win32
|
13521 | */
|
13522 | on(event: 'mouse-move', listener: (event: KeyboardEvent,
|
13523 | /**
|
13524 | * The position of the event.
|
13525 | */
|
13526 | position: Point) => void): this;
|
13527 | /**
|
13528 | * @platform darwin,win32
|
13529 | */
|
13530 | off(event: 'mouse-move', listener: (event: KeyboardEvent,
|
13531 | /**
|
13532 | * The position of the event.
|
13533 | */
|
13534 | position: Point) => void): this;
|
13535 | /**
|
13536 | * @platform darwin,win32
|
13537 | */
|
13538 | once(event: 'mouse-move', listener: (event: KeyboardEvent,
|
13539 | /**
|
13540 | * The position of the event.
|
13541 | */
|
13542 | position: Point) => void): this;
|
13543 | /**
|
13544 | * @platform darwin,win32
|
13545 | */
|
13546 | addListener(event: 'mouse-move', listener: (event: KeyboardEvent,
|
13547 | /**
|
13548 | * The position of the event.
|
13549 | */
|
13550 | position: Point) => void): this;
|
13551 | /**
|
13552 | * @platform darwin,win32
|
13553 | */
|
13554 | removeListener(event: 'mouse-move', listener: (event: KeyboardEvent,
|
13555 | /**
|
13556 | * The position of the event.
|
13557 | */
|
13558 | position: Point) => void): this;
|
13559 | /**
|
13560 | * Emitted when the mouse is released from clicking the tray icon.
|
13561 | *
|
13562 | * Note: This will not be emitted if you have set a context menu for your Tray
|
13563 | * using `tray.setContextMenu`, as a result of macOS-level constraints.
|
13564 | *
|
13565 | * @platform darwin
|
13566 | */
|
13567 | on(event: 'mouse-up', listener: (event: KeyboardEvent,
|
13568 | /**
|
13569 | * The position of the event.
|
13570 | */
|
13571 | position: Point) => void): this;
|
13572 | /**
|
13573 | * @platform darwin
|
13574 | */
|
13575 | off(event: 'mouse-up', listener: (event: KeyboardEvent,
|
13576 | /**
|
13577 | * The position of the event.
|
13578 | */
|
13579 | position: Point) => void): this;
|
13580 | /**
|
13581 | * @platform darwin
|
13582 | */
|
13583 | once(event: 'mouse-up', listener: (event: KeyboardEvent,
|
13584 | /**
|
13585 | * The position of the event.
|
13586 | */
|
13587 | position: Point) => void): this;
|
13588 | /**
|
13589 | * @platform darwin
|
13590 | */
|
13591 | addListener(event: 'mouse-up', listener: (event: KeyboardEvent,
|
13592 | /**
|
13593 | * The position of the event.
|
13594 | */
|
13595 | position: Point) => void): this;
|
13596 | /**
|
13597 | * @platform darwin
|
13598 | */
|
13599 | removeListener(event: 'mouse-up', listener: (event: KeyboardEvent,
|
13600 | /**
|
13601 | * The position of the event.
|
13602 | */
|
13603 | position: Point) => void): this;
|
13604 | /**
|
13605 | * Emitted when the tray icon is right clicked.
|
13606 | *
|
13607 | * @platform darwin,win32
|
13608 | */
|
13609 | on(event: 'right-click', listener: (event: KeyboardEvent,
|
13610 | /**
|
13611 | * The bounds of tray icon.
|
13612 | */
|
13613 | bounds: Rectangle) => void): this;
|
13614 | /**
|
13615 | * @platform darwin,win32
|
13616 | */
|
13617 | off(event: 'right-click', listener: (event: KeyboardEvent,
|
13618 | /**
|
13619 | * The bounds of tray icon.
|
13620 | */
|
13621 | bounds: Rectangle) => void): this;
|
13622 | /**
|
13623 | * @platform darwin,win32
|
13624 | */
|
13625 | once(event: 'right-click', listener: (event: KeyboardEvent,
|
13626 | /**
|
13627 | * The bounds of tray icon.
|
13628 | */
|
13629 | bounds: Rectangle) => void): this;
|
13630 | /**
|
13631 | * @platform darwin,win32
|
13632 | */
|
13633 | addListener(event: 'right-click', listener: (event: KeyboardEvent,
|
13634 | /**
|
13635 | * The bounds of tray icon.
|
13636 | */
|
13637 | bounds: Rectangle) => void): this;
|
13638 | /**
|
13639 | * @platform darwin,win32
|
13640 | */
|
13641 | removeListener(event: 'right-click', listener: (event: KeyboardEvent,
|
13642 | /**
|
13643 | * The bounds of tray icon.
|
13644 | */
|
13645 | bounds: Rectangle) => void): this;
|
13646 | /**
|
13647 | * Tray
|
13648 | */
|
13649 | constructor(image: (NativeImage) | (string), guid?: string);
|
13650 | /**
|
13651 | * Closes an open context menu, as set by `tray.setContextMenu()`.
|
13652 | *
|
13653 | * @platform darwin,win32
|
13654 | */
|
13655 | closeContextMenu(): void;
|
13656 | /**
|
13657 | * Destroys the tray icon immediately.
|
13658 | */
|
13659 | destroy(): void;
|
13660 | /**
|
13661 | * Displays a tray balloon.
|
13662 | *
|
13663 | * @platform win32
|
13664 | */
|
13665 | displayBalloon(options: DisplayBalloonOptions): void;
|
13666 | /**
|
13667 | * Returns focus to the taskbar notification area. Notification area icons should
|
13668 | * use this message when they have completed their UI operation. For example, if
|
13669 | * the icon displays a shortcut menu, but the user presses ESC to cancel it, use
|
13670 | * `tray.focus()` to return focus to the notification area.
|
13671 | *
|
13672 | * @platform win32
|
13673 | */
|
13674 | focus(): void;
|
13675 | /**
|
13676 | * The `bounds` of this tray icon as `Object`.
|
13677 | *
|
13678 | * @platform darwin,win32
|
13679 | */
|
13680 | getBounds(): Rectangle;
|
13681 | /**
|
13682 | * Whether double click events will be ignored.
|
13683 | *
|
13684 | * @platform darwin
|
13685 | */
|
13686 | getIgnoreDoubleClickEvents(): boolean;
|
13687 | /**
|
13688 | * the title displayed next to the tray icon in the status bar
|
13689 | *
|
13690 | * @platform darwin
|
13691 | */
|
13692 | getTitle(): string;
|
13693 | /**
|
13694 | * Whether the tray icon is destroyed.
|
13695 | */
|
13696 | isDestroyed(): boolean;
|
13697 | /**
|
13698 | * Pops up the context menu of the tray icon. When `menu` is passed, the `menu`
|
13699 | * will be shown instead of the tray icon's context menu.
|
13700 | *
|
13701 | * The `position` is only available on Windows, and it is (0, 0) by default.
|
13702 | *
|
13703 | * @platform darwin,win32
|
13704 | */
|
13705 | popUpContextMenu(menu?: Menu, position?: Point): void;
|
13706 | /**
|
13707 | * Removes a tray balloon.
|
13708 | *
|
13709 | * @platform win32
|
13710 | */
|
13711 | removeBalloon(): void;
|
13712 | /**
|
13713 | * Sets the context menu for this icon.
|
13714 | */
|
13715 | setContextMenu(menu: (Menu) | (null)): void;
|
13716 | /**
|
13717 | * Sets the option to ignore double click events. Ignoring these events allows you
|
13718 | * to detect every individual click of the tray icon.
|
13719 | *
|
13720 | * This value is set to false by default.
|
13721 | *
|
13722 | * @platform darwin
|
13723 | */
|
13724 | setIgnoreDoubleClickEvents(ignore: boolean): void;
|
13725 | /**
|
13726 | * Sets the `image` associated with this tray icon.
|
13727 | */
|
13728 | setImage(image: (NativeImage) | (string)): void;
|
13729 | /**
|
13730 | * Sets the `image` associated with this tray icon when pressed on macOS.
|
13731 | *
|
13732 | * @platform darwin
|
13733 | */
|
13734 | setPressedImage(image: (NativeImage) | (string)): void;
|
13735 | /**
|
13736 | * Sets the title displayed next to the tray icon in the status bar (Support ANSI
|
13737 | * colors).
|
13738 | *
|
13739 | * @platform darwin
|
13740 | */
|
13741 | setTitle(title: string, options?: TitleOptions): void;
|
13742 | /**
|
13743 | * Sets the hover text for this tray icon.
|
13744 | */
|
13745 | setToolTip(toolTip: string): void;
|
13746 | }
|
13747 |
|
13748 | interface UploadData {
|
13749 |
|
13750 | // Docs: https://electronjs.org/docs/api/structures/upload-data
|
13751 |
|
13752 | /**
|
13753 | * UUID of blob data. Use ses.getBlobData method to retrieve the data.
|
13754 | */
|
13755 | blobUUID?: string;
|
13756 | /**
|
13757 | * Content being sent.
|
13758 | */
|
13759 | bytes: Buffer;
|
13760 | /**
|
13761 | * Path of file being uploaded.
|
13762 | */
|
13763 | file?: string;
|
13764 | }
|
13765 |
|
13766 | interface UploadFile {
|
13767 |
|
13768 | // Docs: https://electronjs.org/docs/api/structures/upload-file
|
13769 |
|
13770 | /**
|
13771 | * Path of file to be uploaded.
|
13772 | */
|
13773 | filePath: string;
|
13774 | /**
|
13775 | * Number of bytes to read from `offset`. Defaults to `0`.
|
13776 | */
|
13777 | length?: number;
|
13778 | /**
|
13779 | * Last Modification time in number of seconds since the UNIX epoch. Defaults to
|
13780 | * `0`.
|
13781 | */
|
13782 | modificationTime?: number;
|
13783 | /**
|
13784 | * Defaults to `0`.
|
13785 | */
|
13786 | offset?: number;
|
13787 | /**
|
13788 | * `file`.
|
13789 | */
|
13790 | type: 'file';
|
13791 | }
|
13792 |
|
13793 | interface UploadRawData {
|
13794 |
|
13795 | // Docs: https://electronjs.org/docs/api/structures/upload-raw-data
|
13796 |
|
13797 | /**
|
13798 | * Data to be uploaded.
|
13799 | */
|
13800 | bytes: Buffer;
|
13801 | /**
|
13802 | * `rawData`.
|
13803 | */
|
13804 | type: 'rawData';
|
13805 | }
|
13806 |
|
13807 | interface USBDevice {
|
13808 |
|
13809 | // Docs: https://electronjs.org/docs/api/structures/usb-device
|
13810 |
|
13811 | /**
|
13812 | * The device class for the communication interface supported by the device
|
13813 | */
|
13814 | deviceClass: number;
|
13815 | /**
|
13816 | * Unique identifier for the device.
|
13817 | */
|
13818 | deviceId: string;
|
13819 | /**
|
13820 | * The device protocol for the communication interface supported by the device
|
13821 | */
|
13822 | deviceProtocol: number;
|
13823 | /**
|
13824 | * The device subclass for the communication interface supported by the device
|
13825 | */
|
13826 | deviceSubclass: number;
|
13827 | /**
|
13828 | * The major version number of the device as defined by the device manufacturer.
|
13829 | */
|
13830 | deviceVersionMajor: number;
|
13831 | /**
|
13832 | * The minor version number of the device as defined by the device manufacturer.
|
13833 | */
|
13834 | deviceVersionMinor: number;
|
13835 | /**
|
13836 | * The subminor version number of the device as defined by the device manufacturer.
|
13837 | */
|
13838 | deviceVersionSubminor: number;
|
13839 | /**
|
13840 | * The manufacturer name of the device.
|
13841 | */
|
13842 | manufacturerName?: string;
|
13843 | /**
|
13844 | * The USB product ID.
|
13845 | */
|
13846 | productId: number;
|
13847 | /**
|
13848 | * Name of the device.
|
13849 | */
|
13850 | productName?: string;
|
13851 | /**
|
13852 | * The USB device serial number.
|
13853 | */
|
13854 | serialNumber?: string;
|
13855 | /**
|
13856 | * The USB protocol major version supported by the device
|
13857 | */
|
13858 | usbVersionMajor: number;
|
13859 | /**
|
13860 | * The USB protocol minor version supported by the device
|
13861 | */
|
13862 | usbVersionMinor: number;
|
13863 | /**
|
13864 | * The USB protocol subminor version supported by the device
|
13865 | */
|
13866 | usbVersionSubminor: number;
|
13867 | /**
|
13868 | * The USB vendor ID.
|
13869 | */
|
13870 | vendorId: number;
|
13871 | }
|
13872 |
|
13873 | interface UserDefaultTypes {
|
13874 |
|
13875 | // Docs: https://electronjs.org/docs/api/structures/user-default-types
|
13876 |
|
13877 | array: Array<unknown>;
|
13878 | boolean: boolean;
|
13879 | dictionary: Record<string, unknown>;
|
13880 | double: number;
|
13881 | float: number;
|
13882 | integer: number;
|
13883 | string: string;
|
13884 | url: string;
|
13885 | }
|
13886 |
|
13887 | class UtilityProcess extends NodeEventEmitter {
|
13888 |
|
13889 | // Docs: https://electronjs.org/docs/api/utility-process
|
13890 |
|
13891 | static fork(modulePath: string, args?: string[], options?: ForkOptions): UtilityProcess;
|
13892 | /**
|
13893 | * Emitted when the child process needs to terminate due to non continuable error
|
13894 | * from V8.
|
13895 | *
|
13896 | * No matter if you listen to the `error` event, the `exit` event will be emitted
|
13897 | * after the child process terminates.
|
13898 | *
|
13899 | * @experimental
|
13900 | */
|
13901 | on(event: 'error', listener: (
|
13902 | /**
|
13903 | * Type of error. One of the following values:
|
13904 | */
|
13905 | type: ('FatalError'),
|
13906 | /**
|
13907 | * Source location from where the error originated.
|
13908 | */
|
13909 | location: string,
|
13910 | /**
|
13911 | * `Node.js diagnostic report`.
|
13912 | */
|
13913 | report: string) => void): this;
|
13914 | /**
|
13915 | * @experimental
|
13916 | */
|
13917 | off(event: 'error', listener: (
|
13918 | /**
|
13919 | * Type of error. One of the following values:
|
13920 | */
|
13921 | type: ('FatalError'),
|
13922 | /**
|
13923 | * Source location from where the error originated.
|
13924 | */
|
13925 | location: string,
|
13926 | /**
|
13927 | * `Node.js diagnostic report`.
|
13928 | */
|
13929 | report: string) => void): this;
|
13930 | /**
|
13931 | * @experimental
|
13932 | */
|
13933 | once(event: 'error', listener: (
|
13934 | /**
|
13935 | * Type of error. One of the following values:
|
13936 | */
|
13937 | type: ('FatalError'),
|
13938 | /**
|
13939 | * Source location from where the error originated.
|
13940 | */
|
13941 | location: string,
|
13942 | /**
|
13943 | * `Node.js diagnostic report`.
|
13944 | */
|
13945 | report: string) => void): this;
|
13946 | /**
|
13947 | * @experimental
|
13948 | */
|
13949 | addListener(event: 'error', listener: (
|
13950 | /**
|
13951 | * Type of error. One of the following values:
|
13952 | */
|
13953 | type: ('FatalError'),
|
13954 | /**
|
13955 | * Source location from where the error originated.
|
13956 | */
|
13957 | location: string,
|
13958 | /**
|
13959 | * `Node.js diagnostic report`.
|
13960 | */
|
13961 | report: string) => void): this;
|
13962 | /**
|
13963 | * @experimental
|
13964 | */
|
13965 | removeListener(event: 'error', listener: (
|
13966 | /**
|
13967 | * Type of error. One of the following values:
|
13968 | */
|
13969 | type: ('FatalError'),
|
13970 | /**
|
13971 | * Source location from where the error originated.
|
13972 | */
|
13973 | location: string,
|
13974 | /**
|
13975 | * `Node.js diagnostic report`.
|
13976 | */
|
13977 | report: string) => void): this;
|
13978 | /**
|
13979 | * Emitted after the child process ends.
|
13980 | */
|
13981 | on(event: 'exit', listener: (
|
13982 | /**
|
13983 | * Contains the exit code for the process obtained from waitpid on posix, or
|
13984 | * GetExitCodeProcess on windows.
|
13985 | */
|
13986 | code: number) => void): this;
|
13987 | off(event: 'exit', listener: (
|
13988 | /**
|
13989 | * Contains the exit code for the process obtained from waitpid on posix, or
|
13990 | * GetExitCodeProcess on windows.
|
13991 | */
|
13992 | code: number) => void): this;
|
13993 | once(event: 'exit', listener: (
|
13994 | /**
|
13995 | * Contains the exit code for the process obtained from waitpid on posix, or
|
13996 | * GetExitCodeProcess on windows.
|
13997 | */
|
13998 | code: number) => void): this;
|
13999 | addListener(event: 'exit', listener: (
|
14000 | /**
|
14001 | * Contains the exit code for the process obtained from waitpid on posix, or
|
14002 | * GetExitCodeProcess on windows.
|
14003 | */
|
14004 | code: number) => void): this;
|
14005 | removeListener(event: 'exit', listener: (
|
14006 | /**
|
14007 | * Contains the exit code for the process obtained from waitpid on posix, or
|
14008 | * GetExitCodeProcess on windows.
|
14009 | */
|
14010 | code: number) => void): this;
|
14011 | /**
|
14012 | * Emitted when the child process sends a message using
|
14013 | * `process.parentPort.postMessage()`.
|
14014 | */
|
14015 | on(event: 'message', listener: (message: any) => void): this;
|
14016 | off(event: 'message', listener: (message: any) => void): this;
|
14017 | once(event: 'message', listener: (message: any) => void): this;
|
14018 | addListener(event: 'message', listener: (message: any) => void): this;
|
14019 | removeListener(event: 'message', listener: (message: any) => void): this;
|
14020 | /**
|
14021 | * Emitted once the child process has spawned successfully.
|
14022 | */
|
14023 | on(event: 'spawn', listener: () => void): this;
|
14024 | off(event: 'spawn', listener: () => void): this;
|
14025 | once(event: 'spawn', listener: () => void): this;
|
14026 | addListener(event: 'spawn', listener: () => void): this;
|
14027 | removeListener(event: 'spawn', listener: () => void): this;
|
14028 | /**
|
14029 | * Terminates the process gracefully. On POSIX, it uses SIGTERM but will ensure the
|
14030 | * process is reaped on exit. This function returns true if the kill is successful,
|
14031 | * and false otherwise.
|
14032 | */
|
14033 | kill(): boolean;
|
14034 | /**
|
14035 | * Send a message to the child process, optionally transferring ownership of zero
|
14036 | * or more `MessagePortMain` objects.
|
14037 | *
|
14038 | * For example:
|
14039 | */
|
14040 | postMessage(message: any, transfer?: MessagePortMain[]): void;
|
14041 | /**
|
14042 | * A `Integer | undefined` representing the process identifier (PID) of the child
|
14043 | * process. If the child process fails to spawn due to errors, then the value is
|
14044 | * `undefined`. When the child process exits, then the value is `undefined` after
|
14045 | * the `exit` event is emitted.
|
14046 | */
|
14047 | pid: (number) | (undefined);
|
14048 | /**
|
14049 | * A `NodeJS.ReadableStream | null` that represents the child process's stderr. If
|
14050 | * the child was spawned with options.stdio[2] set to anything other than 'pipe',
|
14051 | * then this will be `null`. When the child process exits, then the value is `null`
|
14052 | * after the `exit` event is emitted.
|
14053 | */
|
14054 | stderr: (NodeJS.ReadableStream) | (null);
|
14055 | /**
|
14056 | * A `NodeJS.ReadableStream | null` that represents the child process's stdout. If
|
14057 | * the child was spawned with options.stdio[1] set to anything other than 'pipe',
|
14058 | * then this will be `null`. When the child process exits, then the value is `null`
|
14059 | * after the `exit` event is emitted.
|
14060 | */
|
14061 | stdout: (NodeJS.ReadableStream) | (null);
|
14062 | }
|
14063 |
|
14064 | class View extends NodeEventEmitter {
|
14065 |
|
14066 | // Docs: https://electronjs.org/docs/api/view
|
14067 |
|
14068 | /**
|
14069 | * Emitted when the view's bounds have changed in response to being laid out. The
|
14070 | * new bounds can be retrieved with `view.getBounds()`.
|
14071 | */
|
14072 | on(event: 'bounds-changed', listener: () => void): this;
|
14073 | off(event: 'bounds-changed', listener: () => void): this;
|
14074 | once(event: 'bounds-changed', listener: () => void): this;
|
14075 | addListener(event: 'bounds-changed', listener: () => void): this;
|
14076 | removeListener(event: 'bounds-changed', listener: () => void): this;
|
14077 | /**
|
14078 | * View
|
14079 | */
|
14080 | constructor();
|
14081 | /**
|
14082 | * If the same View is added to a parent which already contains it, it will be
|
14083 | * reordered such that it becomes the topmost view.
|
14084 | */
|
14085 | addChildView(view: View, index?: number): void;
|
14086 | /**
|
14087 | * The bounds of this View, relative to its parent.
|
14088 | */
|
14089 | getBounds(): Rectangle;
|
14090 | /**
|
14091 | * If the view passed as a parameter is not a child of this view, this method is a
|
14092 | * no-op.
|
14093 | */
|
14094 | removeChildView(view: View): void;
|
14095 | /**
|
14096 | * Examples of valid `color` values:
|
14097 | *
|
14098 | * * Hex
|
14099 | * * `#fff` (RGB)
|
14100 | * * `#ffff` (ARGB)
|
14101 | * * `#ffffff` (RRGGBB)
|
14102 | * * `#ffffffff` (AARRGGBB)
|
14103 | * * RGB
|
14104 | * * `rgb\(([\d]+),\s*([\d]+),\s*([\d]+)\)`
|
14105 | * * e.g. `rgb(255, 255, 255)`
|
14106 | * * RGBA
|
14107 | * * `rgba\(([\d]+),\s*([\d]+),\s*([\d]+),\s*([\d.]+)\)`
|
14108 | * * e.g. `rgba(255, 255, 255, 1.0)`
|
14109 | * * HSL
|
14110 | * * `hsl\((-?[\d.]+),\s*([\d.]+)%,\s*([\d.]+)%\)`
|
14111 | * * e.g. `hsl(200, 20%, 50%)`
|
14112 | * * HSLA
|
14113 | * * `hsla\((-?[\d.]+),\s*([\d.]+)%,\s*([\d.]+)%,\s*([\d.]+)\)`
|
14114 | * * e.g. `hsla(200, 20%, 50%, 0.5)`
|
14115 | * * Color name
|
14116 | * * Options are listed in SkParseColor.cpp
|
14117 | * * Similar to CSS Color Module Level 3 keywords, but case-sensitive.
|
14118 | * * e.g. `blueviolet` or `red`
|
14119 | *
|
14120 | * **Note:** Hex format with alpha takes `AARRGGBB` or `ARGB`, _not_ `RRGGBBAA` or
|
14121 | * `RGB`.
|
14122 | */
|
14123 | setBackgroundColor(color: string): void;
|
14124 | /**
|
14125 | * **Note:** The area cutout of the view's border still captures clicks.
|
14126 | */
|
14127 | setBorderRadius(radius: number): void;
|
14128 | setBounds(bounds: Rectangle): void;
|
14129 | setVisible(visible: boolean): void;
|
14130 | /**
|
14131 | * A `View[]` property representing the child views of this view.
|
14132 | *
|
14133 | */
|
14134 | readonly children: View[];
|
14135 | }
|
14136 |
|
14137 | class WebContents extends NodeEventEmitter {
|
14138 |
|
14139 | // Docs: https://electronjs.org/docs/api/web-contents
|
14140 |
|
14141 | /**
|
14142 | * A WebContents instance with the given TargetID, or `undefined` if there is no
|
14143 | * WebContents associated with the given TargetID.
|
14144 | *
|
14145 | * When communicating with the Chrome DevTools Protocol, it can be useful to lookup
|
14146 | * a WebContents instance based on its assigned TargetID.
|
14147 | */
|
14148 | static fromDevToolsTargetId(targetId: string): (WebContents) | (undefined);
|
14149 | /**
|
14150 | * A WebContents instance with the given WebFrameMain, or `undefined` if there is
|
14151 | * no WebContents associated with the given WebFrameMain.
|
14152 | */
|
14153 | static fromFrame(frame: WebFrameMain): (WebContents) | (undefined);
|
14154 | /**
|
14155 | * A WebContents instance with the given ID, or `undefined` if there is no
|
14156 | * WebContents associated with the given ID.
|
14157 | */
|
14158 | static fromId(id: number): (WebContents) | (undefined);
|
14159 | /**
|
14160 | * An array of all `WebContents` instances. This will contain web contents for all
|
14161 | * windows, webviews, opened devtools, and devtools extension background pages.
|
14162 | */
|
14163 | static getAllWebContents(): WebContents[];
|
14164 | /**
|
14165 | * The web contents that is focused in this application, otherwise returns `null`.
|
14166 | */
|
14167 | static getFocusedWebContents(): (WebContents) | (null);
|
14168 | /**
|
14169 | * Emitted when media becomes audible or inaudible.
|
14170 | */
|
14171 | on(event: 'audio-state-changed', listener: (event: Event<WebContentsAudioStateChangedEventParams>) => void): this;
|
14172 | off(event: 'audio-state-changed', listener: (event: Event<WebContentsAudioStateChangedEventParams>) => void): this;
|
14173 | once(event: 'audio-state-changed', listener: (event: Event<WebContentsAudioStateChangedEventParams>) => void): this;
|
14174 | addListener(event: 'audio-state-changed', listener: (event: Event<WebContentsAudioStateChangedEventParams>) => void): this;
|
14175 | removeListener(event: 'audio-state-changed', listener: (event: Event<WebContentsAudioStateChangedEventParams>) => void): this;
|
14176 | /**
|
14177 | * Emitted before dispatching the `keydown` and `keyup` events in the page. Calling
|
14178 | * `event.preventDefault` will prevent the page `keydown`/`keyup` events and the
|
14179 | * menu shortcuts.
|
14180 | *
|
14181 | * To only prevent the menu shortcuts, use `setIgnoreMenuShortcuts`:
|
14182 | */
|
14183 | on(event: 'before-input-event', listener: (event: Event,
|
14184 | /**
|
14185 | * Input properties.
|
14186 | */
|
14187 | input: Input) => void): this;
|
14188 | off(event: 'before-input-event', listener: (event: Event,
|
14189 | /**
|
14190 | * Input properties.
|
14191 | */
|
14192 | input: Input) => void): this;
|
14193 | once(event: 'before-input-event', listener: (event: Event,
|
14194 | /**
|
14195 | * Input properties.
|
14196 | */
|
14197 | input: Input) => void): this;
|
14198 | addListener(event: 'before-input-event', listener: (event: Event,
|
14199 | /**
|
14200 | * Input properties.
|
14201 | */
|
14202 | input: Input) => void): this;
|
14203 | removeListener(event: 'before-input-event', listener: (event: Event,
|
14204 | /**
|
14205 | * Input properties.
|
14206 | */
|
14207 | input: Input) => void): this;
|
14208 | /**
|
14209 | * Emitted when the `WebContents` loses focus.
|
14210 | */
|
14211 | on(event: 'blur', listener: () => void): this;
|
14212 | off(event: 'blur', listener: () => void): this;
|
14213 | once(event: 'blur', listener: () => void): this;
|
14214 | addListener(event: 'blur', listener: () => void): this;
|
14215 | removeListener(event: 'blur', listener: () => void): this;
|
14216 | /**
|
14217 | * Emitted when failed to verify the `certificate` for `url`.
|
14218 | *
|
14219 | * The usage is the same with the `certificate-error` event of `app`.
|
14220 | */
|
14221 | on(event: 'certificate-error', listener: (event: Event,
|
14222 | url: string,
|
14223 | /**
|
14224 | * The error code.
|
14225 | */
|
14226 | error: string,
|
14227 | certificate: Certificate,
|
14228 | callback: (isTrusted: boolean) => void,
|
14229 | isMainFrame: boolean) => void): this;
|
14230 | off(event: 'certificate-error', listener: (event: Event,
|
14231 | url: string,
|
14232 | /**
|
14233 | * The error code.
|
14234 | */
|
14235 | error: string,
|
14236 | certificate: Certificate,
|
14237 | callback: (isTrusted: boolean) => void,
|
14238 | isMainFrame: boolean) => void): this;
|
14239 | once(event: 'certificate-error', listener: (event: Event,
|
14240 | url: string,
|
14241 | /**
|
14242 | * The error code.
|
14243 | */
|
14244 | error: string,
|
14245 | certificate: Certificate,
|
14246 | callback: (isTrusted: boolean) => void,
|
14247 | isMainFrame: boolean) => void): this;
|
14248 | addListener(event: 'certificate-error', listener: (event: Event,
|
14249 | url: string,
|
14250 | /**
|
14251 | * The error code.
|
14252 | */
|
14253 | error: string,
|
14254 | certificate: Certificate,
|
14255 | callback: (isTrusted: boolean) => void,
|
14256 | isMainFrame: boolean) => void): this;
|
14257 | removeListener(event: 'certificate-error', listener: (event: Event,
|
14258 | url: string,
|
14259 | /**
|
14260 | * The error code.
|
14261 | */
|
14262 | error: string,
|
14263 | certificate: Certificate,
|
14264 | callback: (isTrusted: boolean) => void,
|
14265 | isMainFrame: boolean) => void): this;
|
14266 | /**
|
14267 | * Emitted when the associated window logs a console message.
|
14268 | */
|
14269 | on(event: 'console-message', listener: (event: Event,
|
14270 | /**
|
14271 | * The log level, from 0 to 3. In order it matches `verbose`, `info`, `warning` and
|
14272 | * `error`.
|
14273 | */
|
14274 | level: number,
|
14275 | /**
|
14276 | * The actual console message
|
14277 | */
|
14278 | message: string,
|
14279 | /**
|
14280 | * The line number of the source that triggered this console message
|
14281 | */
|
14282 | line: number,
|
14283 | sourceId: string) => void): this;
|
14284 | off(event: 'console-message', listener: (event: Event,
|
14285 | /**
|
14286 | * The log level, from 0 to 3. In order it matches `verbose`, `info`, `warning` and
|
14287 | * `error`.
|
14288 | */
|
14289 | level: number,
|
14290 | /**
|
14291 | * The actual console message
|
14292 | */
|
14293 | message: string,
|
14294 | /**
|
14295 | * The line number of the source that triggered this console message
|
14296 | */
|
14297 | line: number,
|
14298 | sourceId: string) => void): this;
|
14299 | once(event: 'console-message', listener: (event: Event,
|
14300 | /**
|
14301 | * The log level, from 0 to 3. In order it matches `verbose`, `info`, `warning` and
|
14302 | * `error`.
|
14303 | */
|
14304 | level: number,
|
14305 | /**
|
14306 | * The actual console message
|
14307 | */
|
14308 | message: string,
|
14309 | /**
|
14310 | * The line number of the source that triggered this console message
|
14311 | */
|
14312 | line: number,
|
14313 | sourceId: string) => void): this;
|
14314 | addListener(event: 'console-message', listener: (event: Event,
|
14315 | /**
|
14316 | * The log level, from 0 to 3. In order it matches `verbose`, `info`, `warning` and
|
14317 | * `error`.
|
14318 | */
|
14319 | level: number,
|
14320 | /**
|
14321 | * The actual console message
|
14322 | */
|
14323 | message: string,
|
14324 | /**
|
14325 | * The line number of the source that triggered this console message
|
14326 | */
|
14327 | line: number,
|
14328 | sourceId: string) => void): this;
|
14329 | removeListener(event: 'console-message', listener: (event: Event,
|
14330 | /**
|
14331 | * The log level, from 0 to 3. In order it matches `verbose`, `info`, `warning` and
|
14332 | * `error`.
|
14333 | */
|
14334 | level: number,
|
14335 | /**
|
14336 | * The actual console message
|
14337 | */
|
14338 | message: string,
|
14339 | /**
|
14340 | * The line number of the source that triggered this console message
|
14341 | */
|
14342 | line: number,
|
14343 | sourceId: string) => void): this;
|
14344 | /**
|
14345 | * Emitted when the page calls `window.moveTo`, `window.resizeTo` or related APIs.
|
14346 | *
|
14347 | * By default, this will move the window. To prevent that behavior, call
|
14348 | * `event.preventDefault()`.
|
14349 | */
|
14350 | on(event: 'content-bounds-updated', listener: (event: Event,
|
14351 | /**
|
14352 | * requested new content bounds
|
14353 | */
|
14354 | bounds: Rectangle) => void): this;
|
14355 | off(event: 'content-bounds-updated', listener: (event: Event,
|
14356 | /**
|
14357 | * requested new content bounds
|
14358 | */
|
14359 | bounds: Rectangle) => void): this;
|
14360 | once(event: 'content-bounds-updated', listener: (event: Event,
|
14361 | /**
|
14362 | * requested new content bounds
|
14363 | */
|
14364 | bounds: Rectangle) => void): this;
|
14365 | addListener(event: 'content-bounds-updated', listener: (event: Event,
|
14366 | /**
|
14367 | * requested new content bounds
|
14368 | */
|
14369 | bounds: Rectangle) => void): this;
|
14370 | removeListener(event: 'content-bounds-updated', listener: (event: Event,
|
14371 | /**
|
14372 | * requested new content bounds
|
14373 | */
|
14374 | bounds: Rectangle) => void): this;
|
14375 | /**
|
14376 | * Emitted when there is a new context menu that needs to be handled.
|
14377 | */
|
14378 | on(event: 'context-menu', listener: (event: Event,
|
14379 | params: ContextMenuParams) => void): this;
|
14380 | off(event: 'context-menu', listener: (event: Event,
|
14381 | params: ContextMenuParams) => void): this;
|
14382 | once(event: 'context-menu', listener: (event: Event,
|
14383 | params: ContextMenuParams) => void): this;
|
14384 | addListener(event: 'context-menu', listener: (event: Event,
|
14385 | params: ContextMenuParams) => void): this;
|
14386 | removeListener(event: 'context-menu', listener: (event: Event,
|
14387 | params: ContextMenuParams) => void): this;
|
14388 | /**
|
14389 | * Emitted when the cursor's type changes. The `type` parameter can be `pointer`,
|
14390 | * `crosshair`, `hand`, `text`, `wait`, `help`, `e-resize`, `n-resize`,
|
14391 | * `ne-resize`, `nw-resize`, `s-resize`, `se-resize`, `sw-resize`, `w-resize`,
|
14392 | * `ns-resize`, `ew-resize`, `nesw-resize`, `nwse-resize`, `col-resize`,
|
14393 | * `row-resize`, `m-panning`, `m-panning-vertical`, `m-panning-horizontal`,
|
14394 | * `e-panning`, `n-panning`, `ne-panning`, `nw-panning`, `s-panning`, `se-panning`,
|
14395 | * `sw-panning`, `w-panning`, `move`, `vertical-text`, `cell`, `context-menu`,
|
14396 | * `alias`, `progress`, `nodrop`, `copy`, `none`, `not-allowed`, `zoom-in`,
|
14397 | * `zoom-out`, `grab`, `grabbing`, `custom`, `null`, `drag-drop-none`,
|
14398 | * `drag-drop-move`, `drag-drop-copy`, `drag-drop-link`, `ns-no-resize`,
|
14399 | * `ew-no-resize`, `nesw-no-resize`, `nwse-no-resize`, or `default`.
|
14400 | *
|
14401 | * If the `type` parameter is `custom`, the `image` parameter will hold the custom
|
14402 | * cursor image in a `NativeImage`, and `scale`, `size` and `hotspot` will hold
|
14403 | * additional information about the custom cursor.
|
14404 | */
|
14405 | on(event: 'cursor-changed', listener: (event: Event,
|
14406 | type: string,
|
14407 | image: NativeImage,
|
14408 | /**
|
14409 | * scaling factor for the custom cursor.
|
14410 | */
|
14411 | scale: number,
|
14412 | /**
|
14413 | * the size of the `image`.
|
14414 | */
|
14415 | size: Size,
|
14416 | /**
|
14417 | * coordinates of the custom cursor's hotspot.
|
14418 | */
|
14419 | hotspot: Point) => void): this;
|
14420 | off(event: 'cursor-changed', listener: (event: Event,
|
14421 | type: string,
|
14422 | image: NativeImage,
|
14423 | /**
|
14424 | * scaling factor for the custom cursor.
|
14425 | */
|
14426 | scale: number,
|
14427 | /**
|
14428 | * the size of the `image`.
|
14429 | */
|
14430 | size: Size,
|
14431 | /**
|
14432 | * coordinates of the custom cursor's hotspot.
|
14433 | */
|
14434 | hotspot: Point) => void): this;
|
14435 | once(event: 'cursor-changed', listener: (event: Event,
|
14436 | type: string,
|
14437 | image: NativeImage,
|
14438 | /**
|
14439 | * scaling factor for the custom cursor.
|
14440 | */
|
14441 | scale: number,
|
14442 | /**
|
14443 | * the size of the `image`.
|
14444 | */
|
14445 | size: Size,
|
14446 | /**
|
14447 | * coordinates of the custom cursor's hotspot.
|
14448 | */
|
14449 | hotspot: Point) => void): this;
|
14450 | addListener(event: 'cursor-changed', listener: (event: Event,
|
14451 | type: string,
|
14452 | image: NativeImage,
|
14453 | /**
|
14454 | * scaling factor for the custom cursor.
|
14455 | */
|
14456 | scale: number,
|
14457 | /**
|
14458 | * the size of the `image`.
|
14459 | */
|
14460 | size: Size,
|
14461 | /**
|
14462 | * coordinates of the custom cursor's hotspot.
|
14463 | */
|
14464 | hotspot: Point) => void): this;
|
14465 | removeListener(event: 'cursor-changed', listener: (event: Event,
|
14466 | type: string,
|
14467 | image: NativeImage,
|
14468 | /**
|
14469 | * scaling factor for the custom cursor.
|
14470 | */
|
14471 | scale: number,
|
14472 | /**
|
14473 | * the size of the `image`.
|
14474 | */
|
14475 | size: Size,
|
14476 | /**
|
14477 | * coordinates of the custom cursor's hotspot.
|
14478 | */
|
14479 | hotspot: Point) => void): this;
|
14480 | /**
|
14481 | * Emitted when `webContents` is destroyed.
|
14482 | */
|
14483 | on(event: 'destroyed', listener: () => void): this;
|
14484 | off(event: 'destroyed', listener: () => void): this;
|
14485 | once(event: 'destroyed', listener: () => void): this;
|
14486 | addListener(event: 'destroyed', listener: () => void): this;
|
14487 | removeListener(event: 'destroyed', listener: () => void): this;
|
14488 | /**
|
14489 | * Emitted when DevTools is closed.
|
14490 | */
|
14491 | on(event: 'devtools-closed', listener: () => void): this;
|
14492 | off(event: 'devtools-closed', listener: () => void): this;
|
14493 | once(event: 'devtools-closed', listener: () => void): this;
|
14494 | addListener(event: 'devtools-closed', listener: () => void): this;
|
14495 | removeListener(event: 'devtools-closed', listener: () => void): this;
|
14496 | /**
|
14497 | * Emitted when DevTools is focused / opened.
|
14498 | */
|
14499 | on(event: 'devtools-focused', listener: () => void): this;
|
14500 | off(event: 'devtools-focused', listener: () => void): this;
|
14501 | once(event: 'devtools-focused', listener: () => void): this;
|
14502 | addListener(event: 'devtools-focused', listener: () => void): this;
|
14503 | removeListener(event: 'devtools-focused', listener: () => void): this;
|
14504 | /**
|
14505 | * Emitted when a link is clicked in DevTools or 'Open in new tab' is selected for
|
14506 | * a link in its context menu.
|
14507 | */
|
14508 | on(event: 'devtools-open-url', listener: (event: Event,
|
14509 | /**
|
14510 | * URL of the link that was clicked or selected.
|
14511 | */
|
14512 | url: string) => void): this;
|
14513 | off(event: 'devtools-open-url', listener: (event: Event,
|
14514 | /**
|
14515 | * URL of the link that was clicked or selected.
|
14516 | */
|
14517 | url: string) => void): this;
|
14518 | once(event: 'devtools-open-url', listener: (event: Event,
|
14519 | /**
|
14520 | * URL of the link that was clicked or selected.
|
14521 | */
|
14522 | url: string) => void): this;
|
14523 | addListener(event: 'devtools-open-url', listener: (event: Event,
|
14524 | /**
|
14525 | * URL of the link that was clicked or selected.
|
14526 | */
|
14527 | url: string) => void): this;
|
14528 | removeListener(event: 'devtools-open-url', listener: (event: Event,
|
14529 | /**
|
14530 | * URL of the link that was clicked or selected.
|
14531 | */
|
14532 | url: string) => void): this;
|
14533 | /**
|
14534 | * Emitted when DevTools is opened.
|
14535 | */
|
14536 | on(event: 'devtools-opened', listener: () => void): this;
|
14537 | off(event: 'devtools-opened', listener: () => void): this;
|
14538 | once(event: 'devtools-opened', listener: () => void): this;
|
14539 | addListener(event: 'devtools-opened', listener: () => void): this;
|
14540 | removeListener(event: 'devtools-opened', listener: () => void): this;
|
14541 | /**
|
14542 | * Emitted when the devtools window instructs the webContents to reload
|
14543 | */
|
14544 | on(event: 'devtools-reload-page', listener: () => void): this;
|
14545 | off(event: 'devtools-reload-page', listener: () => void): this;
|
14546 | once(event: 'devtools-reload-page', listener: () => void): this;
|
14547 | addListener(event: 'devtools-reload-page', listener: () => void): this;
|
14548 | removeListener(event: 'devtools-reload-page', listener: () => void): this;
|
14549 | /**
|
14550 | * Emitted when 'Search' is selected for text in its context menu.
|
14551 | */
|
14552 | on(event: 'devtools-search-query', listener: (event: Event,
|
14553 | /**
|
14554 | * text to query for.
|
14555 | */
|
14556 | query: string) => void): this;
|
14557 | off(event: 'devtools-search-query', listener: (event: Event,
|
14558 | /**
|
14559 | * text to query for.
|
14560 | */
|
14561 | query: string) => void): this;
|
14562 | once(event: 'devtools-search-query', listener: (event: Event,
|
14563 | /**
|
14564 | * text to query for.
|
14565 | */
|
14566 | query: string) => void): this;
|
14567 | addListener(event: 'devtools-search-query', listener: (event: Event,
|
14568 | /**
|
14569 | * text to query for.
|
14570 | */
|
14571 | query: string) => void): this;
|
14572 | removeListener(event: 'devtools-search-query', listener: (event: Event,
|
14573 | /**
|
14574 | * text to query for.
|
14575 | */
|
14576 | query: string) => void): this;
|
14577 | /**
|
14578 | * Emitted when a `<webview>` has been attached to this web contents.
|
14579 | */
|
14580 | on(event: 'did-attach-webview', listener: (event: Event,
|
14581 | /**
|
14582 | * The guest web contents that is used by the `<webview>`.
|
14583 | */
|
14584 | webContents: WebContents) => void): this;
|
14585 | off(event: 'did-attach-webview', listener: (event: Event,
|
14586 | /**
|
14587 | * The guest web contents that is used by the `<webview>`.
|
14588 | */
|
14589 | webContents: WebContents) => void): this;
|
14590 | once(event: 'did-attach-webview', listener: (event: Event,
|
14591 | /**
|
14592 | * The guest web contents that is used by the `<webview>`.
|
14593 | */
|
14594 | webContents: WebContents) => void): this;
|
14595 | addListener(event: 'did-attach-webview', listener: (event: Event,
|
14596 | /**
|
14597 | * The guest web contents that is used by the `<webview>`.
|
14598 | */
|
14599 | webContents: WebContents) => void): this;
|
14600 | removeListener(event: 'did-attach-webview', listener: (event: Event,
|
14601 | /**
|
14602 | * The guest web contents that is used by the `<webview>`.
|
14603 | */
|
14604 | webContents: WebContents) => void): this;
|
14605 | /**
|
14606 | * Emitted when a page's theme color changes. This is usually due to encountering a
|
14607 | * meta tag:
|
14608 | */
|
14609 | on(event: 'did-change-theme-color', listener: (event: Event,
|
14610 | /**
|
14611 | * Theme color is in format of '#rrggbb'. It is `null` when no theme color is set.
|
14612 | */
|
14613 | color: (string) | (null)) => void): this;
|
14614 | off(event: 'did-change-theme-color', listener: (event: Event,
|
14615 | /**
|
14616 | * Theme color is in format of '#rrggbb'. It is `null` when no theme color is set.
|
14617 | */
|
14618 | color: (string) | (null)) => void): this;
|
14619 | once(event: 'did-change-theme-color', listener: (event: Event,
|
14620 | /**
|
14621 | * Theme color is in format of '#rrggbb'. It is `null` when no theme color is set.
|
14622 | */
|
14623 | color: (string) | (null)) => void): this;
|
14624 | addListener(event: 'did-change-theme-color', listener: (event: Event,
|
14625 | /**
|
14626 | * Theme color is in format of '#rrggbb'. It is `null` when no theme color is set.
|
14627 | */
|
14628 | color: (string) | (null)) => void): this;
|
14629 | removeListener(event: 'did-change-theme-color', listener: (event: Event,
|
14630 | /**
|
14631 | * Theme color is in format of '#rrggbb'. It is `null` when no theme color is set.
|
14632 | */
|
14633 | color: (string) | (null)) => void): this;
|
14634 | /**
|
14635 | * Emitted _after_ successful creation of a window via `window.open` in the
|
14636 | * renderer. Not emitted if the creation of the window is canceled from
|
14637 | * `webContents.setWindowOpenHandler`.
|
14638 | *
|
14639 | * See `window.open()` for more details and how to use this in conjunction with
|
14640 | * `webContents.setWindowOpenHandler`.
|
14641 | */
|
14642 | on(event: 'did-create-window', listener: (window: BrowserWindow,
|
14643 | details: DidCreateWindowDetails) => void): this;
|
14644 | off(event: 'did-create-window', listener: (window: BrowserWindow,
|
14645 | details: DidCreateWindowDetails) => void): this;
|
14646 | once(event: 'did-create-window', listener: (window: BrowserWindow,
|
14647 | details: DidCreateWindowDetails) => void): this;
|
14648 | addListener(event: 'did-create-window', listener: (window: BrowserWindow,
|
14649 | details: DidCreateWindowDetails) => void): this;
|
14650 | removeListener(event: 'did-create-window', listener: (window: BrowserWindow,
|
14651 | details: DidCreateWindowDetails) => void): this;
|
14652 | /**
|
14653 | * This event is like `did-finish-load` but emitted when the load failed. The full
|
14654 | * list of error codes and their meaning is available here.
|
14655 | */
|
14656 | on(event: 'did-fail-load', listener: (event: Event,
|
14657 | errorCode: number,
|
14658 | errorDescription: string,
|
14659 | validatedURL: string,
|
14660 | isMainFrame: boolean,
|
14661 | frameProcessId: number,
|
14662 | frameRoutingId: number) => void): this;
|
14663 | off(event: 'did-fail-load', listener: (event: Event,
|
14664 | errorCode: number,
|
14665 | errorDescription: string,
|
14666 | validatedURL: string,
|
14667 | isMainFrame: boolean,
|
14668 | frameProcessId: number,
|
14669 | frameRoutingId: number) => void): this;
|
14670 | once(event: 'did-fail-load', listener: (event: Event,
|
14671 | errorCode: number,
|
14672 | errorDescription: string,
|
14673 | validatedURL: string,
|
14674 | isMainFrame: boolean,
|
14675 | frameProcessId: number,
|
14676 | frameRoutingId: number) => void): this;
|
14677 | addListener(event: 'did-fail-load', listener: (event: Event,
|
14678 | errorCode: number,
|
14679 | errorDescription: string,
|
14680 | validatedURL: string,
|
14681 | isMainFrame: boolean,
|
14682 | frameProcessId: number,
|
14683 | frameRoutingId: number) => void): this;
|
14684 | removeListener(event: 'did-fail-load', listener: (event: Event,
|
14685 | errorCode: number,
|
14686 | errorDescription: string,
|
14687 | validatedURL: string,
|
14688 | isMainFrame: boolean,
|
14689 | frameProcessId: number,
|
14690 | frameRoutingId: number) => void): this;
|
14691 | /**
|
14692 | * This event is like `did-fail-load` but emitted when the load was cancelled (e.g.
|
14693 | * `window.stop()` was invoked).
|
14694 | */
|
14695 | on(event: 'did-fail-provisional-load', listener: (event: Event,
|
14696 | errorCode: number,
|
14697 | errorDescription: string,
|
14698 | validatedURL: string,
|
14699 | isMainFrame: boolean,
|
14700 | frameProcessId: number,
|
14701 | frameRoutingId: number) => void): this;
|
14702 | off(event: 'did-fail-provisional-load', listener: (event: Event,
|
14703 | errorCode: number,
|
14704 | errorDescription: string,
|
14705 | validatedURL: string,
|
14706 | isMainFrame: boolean,
|
14707 | frameProcessId: number,
|
14708 | frameRoutingId: number) => void): this;
|
14709 | once(event: 'did-fail-provisional-load', listener: (event: Event,
|
14710 | errorCode: number,
|
14711 | errorDescription: string,
|
14712 | validatedURL: string,
|
14713 | isMainFrame: boolean,
|
14714 | frameProcessId: number,
|
14715 | frameRoutingId: number) => void): this;
|
14716 | addListener(event: 'did-fail-provisional-load', listener: (event: Event,
|
14717 | errorCode: number,
|
14718 | errorDescription: string,
|
14719 | validatedURL: string,
|
14720 | isMainFrame: boolean,
|
14721 | frameProcessId: number,
|
14722 | frameRoutingId: number) => void): this;
|
14723 | removeListener(event: 'did-fail-provisional-load', listener: (event: Event,
|
14724 | errorCode: number,
|
14725 | errorDescription: string,
|
14726 | validatedURL: string,
|
14727 | isMainFrame: boolean,
|
14728 | frameProcessId: number,
|
14729 | frameRoutingId: number) => void): this;
|
14730 | /**
|
14731 | * Emitted when the navigation is done, i.e. the spinner of the tab has stopped
|
14732 | * spinning, and the `onload` event was dispatched.
|
14733 | */
|
14734 | on(event: 'did-finish-load', listener: () => void): this;
|
14735 | off(event: 'did-finish-load', listener: () => void): this;
|
14736 | once(event: 'did-finish-load', listener: () => void): this;
|
14737 | addListener(event: 'did-finish-load', listener: () => void): this;
|
14738 | removeListener(event: 'did-finish-load', listener: () => void): this;
|
14739 | /**
|
14740 | * Emitted when a frame has done navigation.
|
14741 | */
|
14742 | on(event: 'did-frame-finish-load', listener: (event: Event,
|
14743 | isMainFrame: boolean,
|
14744 | frameProcessId: number,
|
14745 | frameRoutingId: number) => void): this;
|
14746 | off(event: 'did-frame-finish-load', listener: (event: Event,
|
14747 | isMainFrame: boolean,
|
14748 | frameProcessId: number,
|
14749 | frameRoutingId: number) => void): this;
|
14750 | once(event: 'did-frame-finish-load', listener: (event: Event,
|
14751 | isMainFrame: boolean,
|
14752 | frameProcessId: number,
|
14753 | frameRoutingId: number) => void): this;
|
14754 | addListener(event: 'did-frame-finish-load', listener: (event: Event,
|
14755 | isMainFrame: boolean,
|
14756 | frameProcessId: number,
|
14757 | frameRoutingId: number) => void): this;
|
14758 | removeListener(event: 'did-frame-finish-load', listener: (event: Event,
|
14759 | isMainFrame: boolean,
|
14760 | frameProcessId: number,
|
14761 | frameRoutingId: number) => void): this;
|
14762 | /**
|
14763 | * Emitted when any frame navigation is done.
|
14764 | *
|
14765 | * This event is not emitted for in-page navigations, such as clicking anchor links
|
14766 | * or updating the `window.location.hash`. Use `did-navigate-in-page` event for
|
14767 | * this purpose.
|
14768 | */
|
14769 | on(event: 'did-frame-navigate', listener: (event: Event,
|
14770 | url: string,
|
14771 | /**
|
14772 | * -1 for non HTTP navigations
|
14773 | */
|
14774 | httpResponseCode: number,
|
14775 | /**
|
14776 | * empty for non HTTP navigations,
|
14777 | */
|
14778 | httpStatusText: string,
|
14779 | isMainFrame: boolean,
|
14780 | frameProcessId: number,
|
14781 | frameRoutingId: number) => void): this;
|
14782 | off(event: 'did-frame-navigate', listener: (event: Event,
|
14783 | url: string,
|
14784 | /**
|
14785 | * -1 for non HTTP navigations
|
14786 | */
|
14787 | httpResponseCode: number,
|
14788 | /**
|
14789 | * empty for non HTTP navigations,
|
14790 | */
|
14791 | httpStatusText: string,
|
14792 | isMainFrame: boolean,
|
14793 | frameProcessId: number,
|
14794 | frameRoutingId: number) => void): this;
|
14795 | once(event: 'did-frame-navigate', listener: (event: Event,
|
14796 | url: string,
|
14797 | /**
|
14798 | * -1 for non HTTP navigations
|
14799 | */
|
14800 | httpResponseCode: number,
|
14801 | /**
|
14802 | * empty for non HTTP navigations,
|
14803 | */
|
14804 | httpStatusText: string,
|
14805 | isMainFrame: boolean,
|
14806 | frameProcessId: number,
|
14807 | frameRoutingId: number) => void): this;
|
14808 | addListener(event: 'did-frame-navigate', listener: (event: Event,
|
14809 | url: string,
|
14810 | /**
|
14811 | * -1 for non HTTP navigations
|
14812 | */
|
14813 | httpResponseCode: number,
|
14814 | /**
|
14815 | * empty for non HTTP navigations,
|
14816 | */
|
14817 | httpStatusText: string,
|
14818 | isMainFrame: boolean,
|
14819 | frameProcessId: number,
|
14820 | frameRoutingId: number) => void): this;
|
14821 | removeListener(event: 'did-frame-navigate', listener: (event: Event,
|
14822 | url: string,
|
14823 | /**
|
14824 | * -1 for non HTTP navigations
|
14825 | */
|
14826 | httpResponseCode: number,
|
14827 | /**
|
14828 | * empty for non HTTP navigations,
|
14829 | */
|
14830 | httpStatusText: string,
|
14831 | isMainFrame: boolean,
|
14832 | frameProcessId: number,
|
14833 | frameRoutingId: number) => void): this;
|
14834 | /**
|
14835 | * Emitted when a main frame navigation is done.
|
14836 | *
|
14837 | * This event is not emitted for in-page navigations, such as clicking anchor links
|
14838 | * or updating the `window.location.hash`. Use `did-navigate-in-page` event for
|
14839 | * this purpose.
|
14840 | */
|
14841 | on(event: 'did-navigate', listener: (event: Event,
|
14842 | url: string,
|
14843 | /**
|
14844 | * -1 for non HTTP navigations
|
14845 | */
|
14846 | httpResponseCode: number,
|
14847 | /**
|
14848 | * empty for non HTTP navigations
|
14849 | */
|
14850 | httpStatusText: string) => void): this;
|
14851 | off(event: 'did-navigate', listener: (event: Event,
|
14852 | url: string,
|
14853 | /**
|
14854 | * -1 for non HTTP navigations
|
14855 | */
|
14856 | httpResponseCode: number,
|
14857 | /**
|
14858 | * empty for non HTTP navigations
|
14859 | */
|
14860 | httpStatusText: string) => void): this;
|
14861 | once(event: 'did-navigate', listener: (event: Event,
|
14862 | url: string,
|
14863 | /**
|
14864 | * -1 for non HTTP navigations
|
14865 | */
|
14866 | httpResponseCode: number,
|
14867 | /**
|
14868 | * empty for non HTTP navigations
|
14869 | */
|
14870 | httpStatusText: string) => void): this;
|
14871 | addListener(event: 'did-navigate', listener: (event: Event,
|
14872 | url: string,
|
14873 | /**
|
14874 | * -1 for non HTTP navigations
|
14875 | */
|
14876 | httpResponseCode: number,
|
14877 | /**
|
14878 | * empty for non HTTP navigations
|
14879 | */
|
14880 | httpStatusText: string) => void): this;
|
14881 | removeListener(event: 'did-navigate', listener: (event: Event,
|
14882 | url: string,
|
14883 | /**
|
14884 | * -1 for non HTTP navigations
|
14885 | */
|
14886 | httpResponseCode: number,
|
14887 | /**
|
14888 | * empty for non HTTP navigations
|
14889 | */
|
14890 | httpStatusText: string) => void): this;
|
14891 | /**
|
14892 | * Emitted when an in-page navigation happened in any frame.
|
14893 | *
|
14894 | * When in-page navigation happens, the page URL changes but does not cause
|
14895 | * navigation outside of the page. Examples of this occurring are when anchor links
|
14896 | * are clicked or when the DOM `hashchange` event is triggered.
|
14897 | */
|
14898 | on(event: 'did-navigate-in-page', listener: (event: Event,
|
14899 | url: string,
|
14900 | isMainFrame: boolean,
|
14901 | frameProcessId: number,
|
14902 | frameRoutingId: number) => void): this;
|
14903 | off(event: 'did-navigate-in-page', listener: (event: Event,
|
14904 | url: string,
|
14905 | isMainFrame: boolean,
|
14906 | frameProcessId: number,
|
14907 | frameRoutingId: number) => void): this;
|
14908 | once(event: 'did-navigate-in-page', listener: (event: Event,
|
14909 | url: string,
|
14910 | isMainFrame: boolean,
|
14911 | frameProcessId: number,
|
14912 | frameRoutingId: number) => void): this;
|
14913 | addListener(event: 'did-navigate-in-page', listener: (event: Event,
|
14914 | url: string,
|
14915 | isMainFrame: boolean,
|
14916 | frameProcessId: number,
|
14917 | frameRoutingId: number) => void): this;
|
14918 | removeListener(event: 'did-navigate-in-page', listener: (event: Event,
|
14919 | url: string,
|
14920 | isMainFrame: boolean,
|
14921 | frameProcessId: number,
|
14922 | frameRoutingId: number) => void): this;
|
14923 | /**
|
14924 | * Emitted after a server side redirect occurs during navigation. For example a
|
14925 | * 302 redirect.
|
14926 | *
|
14927 | * This event cannot be prevented, if you want to prevent redirects you should
|
14928 | * checkout out the `will-redirect` event above.
|
14929 | */
|
14930 | on(event: 'did-redirect-navigation', listener: (details: Event<WebContentsDidRedirectNavigationEventParams>,
|
14931 | /**
|
14932 | * @deprecated
|
14933 | */
|
14934 | url: string,
|
14935 | /**
|
14936 | * @deprecated
|
14937 | */
|
14938 | isInPlace: boolean,
|
14939 | /**
|
14940 | * @deprecated
|
14941 | */
|
14942 | isMainFrame: boolean,
|
14943 | /**
|
14944 | * @deprecated
|
14945 | */
|
14946 | frameProcessId: number,
|
14947 | /**
|
14948 | * @deprecated
|
14949 | */
|
14950 | frameRoutingId: number) => void): this;
|
14951 | off(event: 'did-redirect-navigation', listener: (details: Event<WebContentsDidRedirectNavigationEventParams>,
|
14952 | /**
|
14953 | * @deprecated
|
14954 | */
|
14955 | url: string,
|
14956 | /**
|
14957 | * @deprecated
|
14958 | */
|
14959 | isInPlace: boolean,
|
14960 | /**
|
14961 | * @deprecated
|
14962 | */
|
14963 | isMainFrame: boolean,
|
14964 | /**
|
14965 | * @deprecated
|
14966 | */
|
14967 | frameProcessId: number,
|
14968 | /**
|
14969 | * @deprecated
|
14970 | */
|
14971 | frameRoutingId: number) => void): this;
|
14972 | once(event: 'did-redirect-navigation', listener: (details: Event<WebContentsDidRedirectNavigationEventParams>,
|
14973 | /**
|
14974 | * @deprecated
|
14975 | */
|
14976 | url: string,
|
14977 | /**
|
14978 | * @deprecated
|
14979 | */
|
14980 | isInPlace: boolean,
|
14981 | /**
|
14982 | * @deprecated
|
14983 | */
|
14984 | isMainFrame: boolean,
|
14985 | /**
|
14986 | * @deprecated
|
14987 | */
|
14988 | frameProcessId: number,
|
14989 | /**
|
14990 | * @deprecated
|
14991 | */
|
14992 | frameRoutingId: number) => void): this;
|
14993 | addListener(event: 'did-redirect-navigation', listener: (details: Event<WebContentsDidRedirectNavigationEventParams>,
|
14994 | /**
|
14995 | * @deprecated
|
14996 | */
|
14997 | url: string,
|
14998 | /**
|
14999 | * @deprecated
|
15000 | */
|
15001 | isInPlace: boolean,
|
15002 | /**
|
15003 | * @deprecated
|
15004 | */
|
15005 | isMainFrame: boolean,
|
15006 | /**
|
15007 | * @deprecated
|
15008 | */
|
15009 | frameProcessId: number,
|
15010 | /**
|
15011 | * @deprecated
|
15012 | */
|
15013 | frameRoutingId: number) => void): this;
|
15014 | removeListener(event: 'did-redirect-navigation', listener: (details: Event<WebContentsDidRedirectNavigationEventParams>,
|
15015 | /**
|
15016 | * @deprecated
|
15017 | */
|
15018 | url: string,
|
15019 | /**
|
15020 | * @deprecated
|
15021 | */
|
15022 | isInPlace: boolean,
|
15023 | /**
|
15024 | * @deprecated
|
15025 | */
|
15026 | isMainFrame: boolean,
|
15027 | /**
|
15028 | * @deprecated
|
15029 | */
|
15030 | frameProcessId: number,
|
15031 | /**
|
15032 | * @deprecated
|
15033 | */
|
15034 | frameRoutingId: number) => void): this;
|
15035 | /**
|
15036 | * Corresponds to the points in time when the spinner of the tab started spinning.
|
15037 | */
|
15038 | on(event: 'did-start-loading', listener: () => void): this;
|
15039 | off(event: 'did-start-loading', listener: () => void): this;
|
15040 | once(event: 'did-start-loading', listener: () => void): this;
|
15041 | addListener(event: 'did-start-loading', listener: () => void): this;
|
15042 | removeListener(event: 'did-start-loading', listener: () => void): this;
|
15043 | /**
|
15044 | * Emitted when any frame (including main) starts navigating.
|
15045 | */
|
15046 | on(event: 'did-start-navigation', listener: (details: Event<WebContentsDidStartNavigationEventParams>,
|
15047 | /**
|
15048 | * @deprecated
|
15049 | */
|
15050 | url: string,
|
15051 | /**
|
15052 | * @deprecated
|
15053 | */
|
15054 | isInPlace: boolean,
|
15055 | /**
|
15056 | * @deprecated
|
15057 | */
|
15058 | isMainFrame: boolean,
|
15059 | /**
|
15060 | * @deprecated
|
15061 | */
|
15062 | frameProcessId: number,
|
15063 | /**
|
15064 | * @deprecated
|
15065 | */
|
15066 | frameRoutingId: number) => void): this;
|
15067 | off(event: 'did-start-navigation', listener: (details: Event<WebContentsDidStartNavigationEventParams>,
|
15068 | /**
|
15069 | * @deprecated
|
15070 | */
|
15071 | url: string,
|
15072 | /**
|
15073 | * @deprecated
|
15074 | */
|
15075 | isInPlace: boolean,
|
15076 | /**
|
15077 | * @deprecated
|
15078 | */
|
15079 | isMainFrame: boolean,
|
15080 | /**
|
15081 | * @deprecated
|
15082 | */
|
15083 | frameProcessId: number,
|
15084 | /**
|
15085 | * @deprecated
|
15086 | */
|
15087 | frameRoutingId: number) => void): this;
|
15088 | once(event: 'did-start-navigation', listener: (details: Event<WebContentsDidStartNavigationEventParams>,
|
15089 | /**
|
15090 | * @deprecated
|
15091 | */
|
15092 | url: string,
|
15093 | /**
|
15094 | * @deprecated
|
15095 | */
|
15096 | isInPlace: boolean,
|
15097 | /**
|
15098 | * @deprecated
|
15099 | */
|
15100 | isMainFrame: boolean,
|
15101 | /**
|
15102 | * @deprecated
|
15103 | */
|
15104 | frameProcessId: number,
|
15105 | /**
|
15106 | * @deprecated
|
15107 | */
|
15108 | frameRoutingId: number) => void): this;
|
15109 | addListener(event: 'did-start-navigation', listener: (details: Event<WebContentsDidStartNavigationEventParams>,
|
15110 | /**
|
15111 | * @deprecated
|
15112 | */
|
15113 | url: string,
|
15114 | /**
|
15115 | * @deprecated
|
15116 | */
|
15117 | isInPlace: boolean,
|
15118 | /**
|
15119 | * @deprecated
|
15120 | */
|
15121 | isMainFrame: boolean,
|
15122 | /**
|
15123 | * @deprecated
|
15124 | */
|
15125 | frameProcessId: number,
|
15126 | /**
|
15127 | * @deprecated
|
15128 | */
|
15129 | frameRoutingId: number) => void): this;
|
15130 | removeListener(event: 'did-start-navigation', listener: (details: Event<WebContentsDidStartNavigationEventParams>,
|
15131 | /**
|
15132 | * @deprecated
|
15133 | */
|
15134 | url: string,
|
15135 | /**
|
15136 | * @deprecated
|
15137 | */
|
15138 | isInPlace: boolean,
|
15139 | /**
|
15140 | * @deprecated
|
15141 | */
|
15142 | isMainFrame: boolean,
|
15143 | /**
|
15144 | * @deprecated
|
15145 | */
|
15146 | frameProcessId: number,
|
15147 | /**
|
15148 | * @deprecated
|
15149 | */
|
15150 | frameRoutingId: number) => void): this;
|
15151 | /**
|
15152 | * Corresponds to the points in time when the spinner of the tab stopped spinning.
|
15153 | */
|
15154 | on(event: 'did-stop-loading', listener: () => void): this;
|
15155 | off(event: 'did-stop-loading', listener: () => void): this;
|
15156 | once(event: 'did-stop-loading', listener: () => void): this;
|
15157 | addListener(event: 'did-stop-loading', listener: () => void): this;
|
15158 | removeListener(event: 'did-stop-loading', listener: () => void): this;
|
15159 | /**
|
15160 | * Emitted when the document in the top-level frame is loaded.
|
15161 | */
|
15162 | on(event: 'dom-ready', listener: () => void): this;
|
15163 | off(event: 'dom-ready', listener: () => void): this;
|
15164 | once(event: 'dom-ready', listener: () => void): this;
|
15165 | addListener(event: 'dom-ready', listener: () => void): this;
|
15166 | removeListener(event: 'dom-ready', listener: () => void): this;
|
15167 | /**
|
15168 | * Emitted when the window enters a full-screen state triggered by HTML API.
|
15169 | */
|
15170 | on(event: 'enter-html-full-screen', listener: () => void): this;
|
15171 | off(event: 'enter-html-full-screen', listener: () => void): this;
|
15172 | once(event: 'enter-html-full-screen', listener: () => void): this;
|
15173 | addListener(event: 'enter-html-full-screen', listener: () => void): this;
|
15174 | removeListener(event: 'enter-html-full-screen', listener: () => void): this;
|
15175 | /**
|
15176 | * Emitted when the `WebContents` gains focus.
|
15177 | *
|
15178 | * Note that on macOS, having focus means the `WebContents` is the first responder
|
15179 | * of window, so switching focus between windows would not trigger the `focus` and
|
15180 | * `blur` events of `WebContents`, as the first responder of each window is not
|
15181 | * changed.
|
15182 | *
|
15183 | * The `focus` and `blur` events of `WebContents` should only be used to detect
|
15184 | * focus change between different `WebContents` and `BrowserView` in the same
|
15185 | * window.
|
15186 | */
|
15187 | on(event: 'focus', listener: () => void): this;
|
15188 | off(event: 'focus', listener: () => void): this;
|
15189 | once(event: 'focus', listener: () => void): this;
|
15190 | addListener(event: 'focus', listener: () => void): this;
|
15191 | removeListener(event: 'focus', listener: () => void): this;
|
15192 | /**
|
15193 | * Emitted when a result is available for `webContents.findInPage` request.
|
15194 | */
|
15195 | on(event: 'found-in-page', listener: (event: Event,
|
15196 | result: Result) => void): this;
|
15197 | off(event: 'found-in-page', listener: (event: Event,
|
15198 | result: Result) => void): this;
|
15199 | once(event: 'found-in-page', listener: (event: Event,
|
15200 | result: Result) => void): this;
|
15201 | addListener(event: 'found-in-page', listener: (event: Event,
|
15202 | result: Result) => void): this;
|
15203 | removeListener(event: 'found-in-page', listener: (event: Event,
|
15204 | result: Result) => void): this;
|
15205 | /**
|
15206 | * Emitted when the mainFrame, an `<iframe>`, or a nested `<iframe>` is loaded
|
15207 | * within the page.
|
15208 | */
|
15209 | on(event: 'frame-created', listener: (event: Event,
|
15210 | details: FrameCreatedDetails) => void): this;
|
15211 | off(event: 'frame-created', listener: (event: Event,
|
15212 | details: FrameCreatedDetails) => void): this;
|
15213 | once(event: 'frame-created', listener: (event: Event,
|
15214 | details: FrameCreatedDetails) => void): this;
|
15215 | addListener(event: 'frame-created', listener: (event: Event,
|
15216 | details: FrameCreatedDetails) => void): this;
|
15217 | removeListener(event: 'frame-created', listener: (event: Event,
|
15218 | details: FrameCreatedDetails) => void): this;
|
15219 | /**
|
15220 | * Emitted when an input event is sent to the WebContents. See InputEvent for
|
15221 | * details.
|
15222 | */
|
15223 | on(event: 'input-event', listener: (event: Event,
|
15224 | inputEvent: InputEvent) => void): this;
|
15225 | off(event: 'input-event', listener: (event: Event,
|
15226 | inputEvent: InputEvent) => void): this;
|
15227 | once(event: 'input-event', listener: (event: Event,
|
15228 | inputEvent: InputEvent) => void): this;
|
15229 | addListener(event: 'input-event', listener: (event: Event,
|
15230 | inputEvent: InputEvent) => void): this;
|
15231 | removeListener(event: 'input-event', listener: (event: Event,
|
15232 | inputEvent: InputEvent) => void): this;
|
15233 | /**
|
15234 | * Emitted when the renderer process sends an asynchronous message via
|
15235 | * `ipcRenderer.send()`.
|
15236 | *
|
15237 | * See also `webContents.ipc`, which provides an `IpcMain`-like interface for
|
15238 | * responding to IPC messages specifically from this WebContents.
|
15239 | */
|
15240 | on(event: 'ipc-message', listener: (event: IpcMainEvent,
|
15241 | channel: string,
|
15242 | ...args: any[]) => void): this;
|
15243 | off(event: 'ipc-message', listener: (event: IpcMainEvent,
|
15244 | channel: string,
|
15245 | ...args: any[]) => void): this;
|
15246 | once(event: 'ipc-message', listener: (event: IpcMainEvent,
|
15247 | channel: string,
|
15248 | ...args: any[]) => void): this;
|
15249 | addListener(event: 'ipc-message', listener: (event: IpcMainEvent,
|
15250 | channel: string,
|
15251 | ...args: any[]) => void): this;
|
15252 | removeListener(event: 'ipc-message', listener: (event: IpcMainEvent,
|
15253 | channel: string,
|
15254 | ...args: any[]) => void): this;
|
15255 | /**
|
15256 | * Emitted when the renderer process sends a synchronous message via
|
15257 | * `ipcRenderer.sendSync()`.
|
15258 | *
|
15259 | * See also `webContents.ipc`, which provides an `IpcMain`-like interface for
|
15260 | * responding to IPC messages specifically from this WebContents.
|
15261 | */
|
15262 | on(event: 'ipc-message-sync', listener: (event: IpcMainEvent,
|
15263 | channel: string,
|
15264 | ...args: any[]) => void): this;
|
15265 | off(event: 'ipc-message-sync', listener: (event: IpcMainEvent,
|
15266 | channel: string,
|
15267 | ...args: any[]) => void): this;
|
15268 | once(event: 'ipc-message-sync', listener: (event: IpcMainEvent,
|
15269 | channel: string,
|
15270 | ...args: any[]) => void): this;
|
15271 | addListener(event: 'ipc-message-sync', listener: (event: IpcMainEvent,
|
15272 | channel: string,
|
15273 | ...args: any[]) => void): this;
|
15274 | removeListener(event: 'ipc-message-sync', listener: (event: IpcMainEvent,
|
15275 | channel: string,
|
15276 | ...args: any[]) => void): this;
|
15277 | /**
|
15278 | * Emitted when the window leaves a full-screen state triggered by HTML API.
|
15279 | */
|
15280 | on(event: 'leave-html-full-screen', listener: () => void): this;
|
15281 | off(event: 'leave-html-full-screen', listener: () => void): this;
|
15282 | once(event: 'leave-html-full-screen', listener: () => void): this;
|
15283 | addListener(event: 'leave-html-full-screen', listener: () => void): this;
|
15284 | removeListener(event: 'leave-html-full-screen', listener: () => void): this;
|
15285 | /**
|
15286 | * Emitted when `webContents` wants to do basic auth.
|
15287 | *
|
15288 | * The usage is the same with the `login` event of `app`.
|
15289 | */
|
15290 | on(event: 'login', listener: (event: Event,
|
15291 | authenticationResponseDetails: LoginAuthenticationResponseDetails,
|
15292 | authInfo: AuthInfo,
|
15293 | callback: (username?: string, password?: string) => void) => void): this;
|
15294 | off(event: 'login', listener: (event: Event,
|
15295 | authenticationResponseDetails: LoginAuthenticationResponseDetails,
|
15296 | authInfo: AuthInfo,
|
15297 | callback: (username?: string, password?: string) => void) => void): this;
|
15298 | once(event: 'login', listener: (event: Event,
|
15299 | authenticationResponseDetails: LoginAuthenticationResponseDetails,
|
15300 | authInfo: AuthInfo,
|
15301 | callback: (username?: string, password?: string) => void) => void): this;
|
15302 | addListener(event: 'login', listener: (event: Event,
|
15303 | authenticationResponseDetails: LoginAuthenticationResponseDetails,
|
15304 | authInfo: AuthInfo,
|
15305 | callback: (username?: string, password?: string) => void) => void): this;
|
15306 | removeListener(event: 'login', listener: (event: Event,
|
15307 | authenticationResponseDetails: LoginAuthenticationResponseDetails,
|
15308 | authInfo: AuthInfo,
|
15309 | callback: (username?: string, password?: string) => void) => void): this;
|
15310 | /**
|
15311 | * Emitted when media is paused or done playing.
|
15312 | */
|
15313 | on(event: 'media-paused', listener: () => void): this;
|
15314 | off(event: 'media-paused', listener: () => void): this;
|
15315 | once(event: 'media-paused', listener: () => void): this;
|
15316 | addListener(event: 'media-paused', listener: () => void): this;
|
15317 | removeListener(event: 'media-paused', listener: () => void): this;
|
15318 | /**
|
15319 | * Emitted when media starts playing.
|
15320 | */
|
15321 | on(event: 'media-started-playing', listener: () => void): this;
|
15322 | off(event: 'media-started-playing', listener: () => void): this;
|
15323 | once(event: 'media-started-playing', listener: () => void): this;
|
15324 | addListener(event: 'media-started-playing', listener: () => void): this;
|
15325 | removeListener(event: 'media-started-playing', listener: () => void): this;
|
15326 | /**
|
15327 | * Emitted when page receives favicon urls.
|
15328 | */
|
15329 | on(event: 'page-favicon-updated', listener: (event: Event,
|
15330 | /**
|
15331 | * Array of URLs.
|
15332 | */
|
15333 | favicons: string[]) => void): this;
|
15334 | off(event: 'page-favicon-updated', listener: (event: Event,
|
15335 | /**
|
15336 | * Array of URLs.
|
15337 | */
|
15338 | favicons: string[]) => void): this;
|
15339 | once(event: 'page-favicon-updated', listener: (event: Event,
|
15340 | /**
|
15341 | * Array of URLs.
|
15342 | */
|
15343 | favicons: string[]) => void): this;
|
15344 | addListener(event: 'page-favicon-updated', listener: (event: Event,
|
15345 | /**
|
15346 | * Array of URLs.
|
15347 | */
|
15348 | favicons: string[]) => void): this;
|
15349 | removeListener(event: 'page-favicon-updated', listener: (event: Event,
|
15350 | /**
|
15351 | * Array of URLs.
|
15352 | */
|
15353 | favicons: string[]) => void): this;
|
15354 | /**
|
15355 | * Fired when page title is set during navigation. `explicitSet` is false when
|
15356 | * title is synthesized from file url.
|
15357 | */
|
15358 | on(event: 'page-title-updated', listener: (event: Event,
|
15359 | title: string,
|
15360 | explicitSet: boolean) => void): this;
|
15361 | off(event: 'page-title-updated', listener: (event: Event,
|
15362 | title: string,
|
15363 | explicitSet: boolean) => void): this;
|
15364 | once(event: 'page-title-updated', listener: (event: Event,
|
15365 | title: string,
|
15366 | explicitSet: boolean) => void): this;
|
15367 | addListener(event: 'page-title-updated', listener: (event: Event,
|
15368 | title: string,
|
15369 | explicitSet: boolean) => void): this;
|
15370 | removeListener(event: 'page-title-updated', listener: (event: Event,
|
15371 | title: string,
|
15372 | explicitSet: boolean) => void): this;
|
15373 | /**
|
15374 | * Emitted when a new frame is generated. Only the dirty area is passed in the
|
15375 | * buffer.
|
15376 | */
|
15377 | on(event: 'paint', listener: (event: Event,
|
15378 | dirtyRect: Rectangle,
|
15379 | /**
|
15380 | * The image data of the whole frame.
|
15381 | */
|
15382 | image: NativeImage) => void): this;
|
15383 | off(event: 'paint', listener: (event: Event,
|
15384 | dirtyRect: Rectangle,
|
15385 | /**
|
15386 | * The image data of the whole frame.
|
15387 | */
|
15388 | image: NativeImage) => void): this;
|
15389 | once(event: 'paint', listener: (event: Event,
|
15390 | dirtyRect: Rectangle,
|
15391 | /**
|
15392 | * The image data of the whole frame.
|
15393 | */
|
15394 | image: NativeImage) => void): this;
|
15395 | addListener(event: 'paint', listener: (event: Event,
|
15396 | dirtyRect: Rectangle,
|
15397 | /**
|
15398 | * The image data of the whole frame.
|
15399 | */
|
15400 | image: NativeImage) => void): this;
|
15401 | removeListener(event: 'paint', listener: (event: Event,
|
15402 | dirtyRect: Rectangle,
|
15403 | /**
|
15404 | * The image data of the whole frame.
|
15405 | */
|
15406 | image: NativeImage) => void): this;
|
15407 | /**
|
15408 | * Emitted when a plugin process has crashed.
|
15409 | */
|
15410 | on(event: 'plugin-crashed', listener: (event: Event,
|
15411 | name: string,
|
15412 | version: string) => void): this;
|
15413 | off(event: 'plugin-crashed', listener: (event: Event,
|
15414 | name: string,
|
15415 | version: string) => void): this;
|
15416 | once(event: 'plugin-crashed', listener: (event: Event,
|
15417 | name: string,
|
15418 | version: string) => void): this;
|
15419 | addListener(event: 'plugin-crashed', listener: (event: Event,
|
15420 | name: string,
|
15421 | version: string) => void): this;
|
15422 | removeListener(event: 'plugin-crashed', listener: (event: Event,
|
15423 | name: string,
|
15424 | version: string) => void): this;
|
15425 | /**
|
15426 | * Emitted when the `WebContents` preferred size has changed.
|
15427 | *
|
15428 | * This event will only be emitted when `enablePreferredSizeMode` is set to `true`
|
15429 | * in `webPreferences`.
|
15430 | */
|
15431 | on(event: 'preferred-size-changed', listener: (event: Event,
|
15432 | /**
|
15433 | * The minimum size needed to contain the layout of the document—without requiring
|
15434 | * scrolling.
|
15435 | */
|
15436 | preferredSize: Size) => void): this;
|
15437 | off(event: 'preferred-size-changed', listener: (event: Event,
|
15438 | /**
|
15439 | * The minimum size needed to contain the layout of the document—without requiring
|
15440 | * scrolling.
|
15441 | */
|
15442 | preferredSize: Size) => void): this;
|
15443 | once(event: 'preferred-size-changed', listener: (event: Event,
|
15444 | /**
|
15445 | * The minimum size needed to contain the layout of the document—without requiring
|
15446 | * scrolling.
|
15447 | */
|
15448 | preferredSize: Size) => void): this;
|
15449 | addListener(event: 'preferred-size-changed', listener: (event: Event,
|
15450 | /**
|
15451 | * The minimum size needed to contain the layout of the document—without requiring
|
15452 | * scrolling.
|
15453 | */
|
15454 | preferredSize: Size) => void): this;
|
15455 | removeListener(event: 'preferred-size-changed', listener: (event: Event,
|
15456 | /**
|
15457 | * The minimum size needed to contain the layout of the document—without requiring
|
15458 | * scrolling.
|
15459 | */
|
15460 | preferredSize: Size) => void): this;
|
15461 | /**
|
15462 | * Emitted when the preload script `preloadPath` throws an unhandled exception
|
15463 | * `error`.
|
15464 | */
|
15465 | on(event: 'preload-error', listener: (event: Event,
|
15466 | preloadPath: string,
|
15467 | error: Error) => void): this;
|
15468 | off(event: 'preload-error', listener: (event: Event,
|
15469 | preloadPath: string,
|
15470 | error: Error) => void): this;
|
15471 | once(event: 'preload-error', listener: (event: Event,
|
15472 | preloadPath: string,
|
15473 | error: Error) => void): this;
|
15474 | addListener(event: 'preload-error', listener: (event: Event,
|
15475 | preloadPath: string,
|
15476 | error: Error) => void): this;
|
15477 | removeListener(event: 'preload-error', listener: (event: Event,
|
15478 | preloadPath: string,
|
15479 | error: Error) => void): this;
|
15480 | /**
|
15481 | * Emitted when the renderer process unexpectedly disappears. This is normally
|
15482 | * because it was crashed or killed.
|
15483 | */
|
15484 | on(event: 'render-process-gone', listener: (event: Event,
|
15485 | details: RenderProcessGoneDetails) => void): this;
|
15486 | off(event: 'render-process-gone', listener: (event: Event,
|
15487 | details: RenderProcessGoneDetails) => void): this;
|
15488 | once(event: 'render-process-gone', listener: (event: Event,
|
15489 | details: RenderProcessGoneDetails) => void): this;
|
15490 | addListener(event: 'render-process-gone', listener: (event: Event,
|
15491 | details: RenderProcessGoneDetails) => void): this;
|
15492 | removeListener(event: 'render-process-gone', listener: (event: Event,
|
15493 | details: RenderProcessGoneDetails) => void): this;
|
15494 | /**
|
15495 | * Emitted when the unresponsive web page becomes responsive again.
|
15496 | */
|
15497 | on(event: 'responsive', listener: () => void): this;
|
15498 | off(event: 'responsive', listener: () => void): this;
|
15499 | once(event: 'responsive', listener: () => void): this;
|
15500 | addListener(event: 'responsive', listener: () => void): this;
|
15501 | removeListener(event: 'responsive', listener: () => void): this;
|
15502 | /**
|
15503 | * Emitted when a bluetooth device needs to be selected when a call to
|
15504 | * `navigator.bluetooth.requestDevice` is made. `callback` should be called with
|
15505 | * the `deviceId` of the device to be selected. Passing an empty string to
|
15506 | * `callback` will cancel the request.
|
15507 | *
|
15508 | * If an event listener is not added for this event, or if `event.preventDefault`
|
15509 | * is not called when handling this event, the first available device will be
|
15510 | * automatically selected.
|
15511 | *
|
15512 | * Due to the nature of bluetooth, scanning for devices when
|
15513 | * `navigator.bluetooth.requestDevice` is called may take time and will cause
|
15514 | * `select-bluetooth-device` to fire multiple times until `callback` is called with
|
15515 | * either a device id or an empty string to cancel the request.
|
15516 | */
|
15517 | on(event: 'select-bluetooth-device', listener: (event: Event,
|
15518 | devices: BluetoothDevice[],
|
15519 | callback: (deviceId: string) => void) => void): this;
|
15520 | off(event: 'select-bluetooth-device', listener: (event: Event,
|
15521 | devices: BluetoothDevice[],
|
15522 | callback: (deviceId: string) => void) => void): this;
|
15523 | once(event: 'select-bluetooth-device', listener: (event: Event,
|
15524 | devices: BluetoothDevice[],
|
15525 | callback: (deviceId: string) => void) => void): this;
|
15526 | addListener(event: 'select-bluetooth-device', listener: (event: Event,
|
15527 | devices: BluetoothDevice[],
|
15528 | callback: (deviceId: string) => void) => void): this;
|
15529 | removeListener(event: 'select-bluetooth-device', listener: (event: Event,
|
15530 | devices: BluetoothDevice[],
|
15531 | callback: (deviceId: string) => void) => void): this;
|
15532 | /**
|
15533 | * Emitted when a client certificate is requested.
|
15534 | *
|
15535 | * The usage is the same with the `select-client-certificate` event of `app`.
|
15536 | */
|
15537 | on(event: 'select-client-certificate', listener: (event: Event,
|
15538 | url: string,
|
15539 | certificateList: Certificate[],
|
15540 | callback: (certificate: Certificate) => void) => void): this;
|
15541 | off(event: 'select-client-certificate', listener: (event: Event,
|
15542 | url: string,
|
15543 | certificateList: Certificate[],
|
15544 | callback: (certificate: Certificate) => void) => void): this;
|
15545 | once(event: 'select-client-certificate', listener: (event: Event,
|
15546 | url: string,
|
15547 | certificateList: Certificate[],
|
15548 | callback: (certificate: Certificate) => void) => void): this;
|
15549 | addListener(event: 'select-client-certificate', listener: (event: Event,
|
15550 | url: string,
|
15551 | certificateList: Certificate[],
|
15552 | callback: (certificate: Certificate) => void) => void): this;
|
15553 | removeListener(event: 'select-client-certificate', listener: (event: Event,
|
15554 | url: string,
|
15555 | certificateList: Certificate[],
|
15556 | callback: (certificate: Certificate) => void) => void): this;
|
15557 | /**
|
15558 | * Emitted when the web page becomes unresponsive.
|
15559 | */
|
15560 | on(event: 'unresponsive', listener: () => void): this;
|
15561 | off(event: 'unresponsive', listener: () => void): this;
|
15562 | once(event: 'unresponsive', listener: () => void): this;
|
15563 | addListener(event: 'unresponsive', listener: () => void): this;
|
15564 | removeListener(event: 'unresponsive', listener: () => void): this;
|
15565 | /**
|
15566 | * Emitted when mouse moves over a link or the keyboard moves the focus to a link.
|
15567 | */
|
15568 | on(event: 'update-target-url', listener: (event: Event,
|
15569 | url: string) => void): this;
|
15570 | off(event: 'update-target-url', listener: (event: Event,
|
15571 | url: string) => void): this;
|
15572 | once(event: 'update-target-url', listener: (event: Event,
|
15573 | url: string) => void): this;
|
15574 | addListener(event: 'update-target-url', listener: (event: Event,
|
15575 | url: string) => void): this;
|
15576 | removeListener(event: 'update-target-url', listener: (event: Event,
|
15577 | url: string) => void): this;
|
15578 | /**
|
15579 | * Emitted when a `<webview>`'s web contents is being attached to this web
|
15580 | * contents. Calling `event.preventDefault()` will destroy the guest page.
|
15581 | *
|
15582 | * This event can be used to configure `webPreferences` for the `webContents` of a
|
15583 | * `<webview>` before it's loaded, and provides the ability to set settings that
|
15584 | * can't be set via `<webview>` attributes.
|
15585 | */
|
15586 | on(event: 'will-attach-webview', listener: (event: Event,
|
15587 | /**
|
15588 | * The web preferences that will be used by the guest page. This object can be
|
15589 | * modified to adjust the preferences for the guest page.
|
15590 | */
|
15591 | webPreferences: WebPreferences,
|
15592 | /**
|
15593 | * The other `<webview>` parameters such as the `src` URL. This object can be
|
15594 | * modified to adjust the parameters of the guest page.
|
15595 | */
|
15596 | params: Record<string, string>) => void): this;
|
15597 | off(event: 'will-attach-webview', listener: (event: Event,
|
15598 | /**
|
15599 | * The web preferences that will be used by the guest page. This object can be
|
15600 | * modified to adjust the preferences for the guest page.
|
15601 | */
|
15602 | webPreferences: WebPreferences,
|
15603 | /**
|
15604 | * The other `<webview>` parameters such as the `src` URL. This object can be
|
15605 | * modified to adjust the parameters of the guest page.
|
15606 | */
|
15607 | params: Record<string, string>) => void): this;
|
15608 | once(event: 'will-attach-webview', listener: (event: Event,
|
15609 | /**
|
15610 | * The web preferences that will be used by the guest page. This object can be
|
15611 | * modified to adjust the preferences for the guest page.
|
15612 | */
|
15613 | webPreferences: WebPreferences,
|
15614 | /**
|
15615 | * The other `<webview>` parameters such as the `src` URL. This object can be
|
15616 | * modified to adjust the parameters of the guest page.
|
15617 | */
|
15618 | params: Record<string, string>) => void): this;
|
15619 | addListener(event: 'will-attach-webview', listener: (event: Event,
|
15620 | /**
|
15621 | * The web preferences that will be used by the guest page. This object can be
|
15622 | * modified to adjust the preferences for the guest page.
|
15623 | */
|
15624 | webPreferences: WebPreferences,
|
15625 | /**
|
15626 | * The other `<webview>` parameters such as the `src` URL. This object can be
|
15627 | * modified to adjust the parameters of the guest page.
|
15628 | */
|
15629 | params: Record<string, string>) => void): this;
|
15630 | removeListener(event: 'will-attach-webview', listener: (event: Event,
|
15631 | /**
|
15632 | * The web preferences that will be used by the guest page. This object can be
|
15633 | * modified to adjust the preferences for the guest page.
|
15634 | */
|
15635 | webPreferences: WebPreferences,
|
15636 | /**
|
15637 | * The other `<webview>` parameters such as the `src` URL. This object can be
|
15638 | * modified to adjust the parameters of the guest page.
|
15639 | */
|
15640 | params: Record<string, string>) => void): this;
|
15641 | /**
|
15642 | * Emitted when a user or the page wants to start navigation in any frame. It can
|
15643 | * happen when the `window.location` object is changed or a user clicks a link in
|
15644 | * the page.
|
15645 | *
|
15646 | * Unlike `will-navigate`, `will-frame-navigate` is fired when the main frame or
|
15647 | * any of its subframes attempts to navigate. When the navigation event comes from
|
15648 | * the main frame, `isMainFrame` will be `true`.
|
15649 | *
|
15650 | * This event will not emit when the navigation is started programmatically with
|
15651 | * APIs like `webContents.loadURL` and `webContents.back`.
|
15652 | *
|
15653 | * It is also not emitted for in-page navigations, such as clicking anchor links or
|
15654 | * updating the `window.location.hash`. Use `did-navigate-in-page` event for this
|
15655 | * purpose.
|
15656 | *
|
15657 | * Calling `event.preventDefault()` will prevent the navigation.
|
15658 | */
|
15659 | on(event: 'will-frame-navigate', listener: (details: Event<WebContentsWillFrameNavigateEventParams>) => void): this;
|
15660 | off(event: 'will-frame-navigate', listener: (details: Event<WebContentsWillFrameNavigateEventParams>) => void): this;
|
15661 | once(event: 'will-frame-navigate', listener: (details: Event<WebContentsWillFrameNavigateEventParams>) => void): this;
|
15662 | addListener(event: 'will-frame-navigate', listener: (details: Event<WebContentsWillFrameNavigateEventParams>) => void): this;
|
15663 | removeListener(event: 'will-frame-navigate', listener: (details: Event<WebContentsWillFrameNavigateEventParams>) => void): this;
|
15664 | /**
|
15665 | * Emitted when a user or the page wants to start navigation on the main frame. It
|
15666 | * can happen when the `window.location` object is changed or a user clicks a link
|
15667 | * in the page.
|
15668 | *
|
15669 | * This event will not emit when the navigation is started programmatically with
|
15670 | * APIs like `webContents.loadURL` and `webContents.back`.
|
15671 | *
|
15672 | * It is also not emitted for in-page navigations, such as clicking anchor links or
|
15673 | * updating the `window.location.hash`. Use `did-navigate-in-page` event for this
|
15674 | * purpose.
|
15675 | *
|
15676 | * Calling `event.preventDefault()` will prevent the navigation.
|
15677 | */
|
15678 | on(event: 'will-navigate', listener: (details: Event<WebContentsWillNavigateEventParams>,
|
15679 | /**
|
15680 | * @deprecated
|
15681 | */
|
15682 | url: string,
|
15683 | /**
|
15684 | * @deprecated
|
15685 | */
|
15686 | isInPlace: boolean,
|
15687 | /**
|
15688 | * @deprecated
|
15689 | */
|
15690 | isMainFrame: boolean,
|
15691 | /**
|
15692 | * @deprecated
|
15693 | */
|
15694 | frameProcessId: number,
|
15695 | /**
|
15696 | * @deprecated
|
15697 | */
|
15698 | frameRoutingId: number) => void): this;
|
15699 | off(event: 'will-navigate', listener: (details: Event<WebContentsWillNavigateEventParams>,
|
15700 | /**
|
15701 | * @deprecated
|
15702 | */
|
15703 | url: string,
|
15704 | /**
|
15705 | * @deprecated
|
15706 | */
|
15707 | isInPlace: boolean,
|
15708 | /**
|
15709 | * @deprecated
|
15710 | */
|
15711 | isMainFrame: boolean,
|
15712 | /**
|
15713 | * @deprecated
|
15714 | */
|
15715 | frameProcessId: number,
|
15716 | /**
|
15717 | * @deprecated
|
15718 | */
|
15719 | frameRoutingId: number) => void): this;
|
15720 | once(event: 'will-navigate', listener: (details: Event<WebContentsWillNavigateEventParams>,
|
15721 | /**
|
15722 | * @deprecated
|
15723 | */
|
15724 | url: string,
|
15725 | /**
|
15726 | * @deprecated
|
15727 | */
|
15728 | isInPlace: boolean,
|
15729 | /**
|
15730 | * @deprecated
|
15731 | */
|
15732 | isMainFrame: boolean,
|
15733 | /**
|
15734 | * @deprecated
|
15735 | */
|
15736 | frameProcessId: number,
|
15737 | /**
|
15738 | * @deprecated
|
15739 | */
|
15740 | frameRoutingId: number) => void): this;
|
15741 | addListener(event: 'will-navigate', listener: (details: Event<WebContentsWillNavigateEventParams>,
|
15742 | /**
|
15743 | * @deprecated
|
15744 | */
|
15745 | url: string,
|
15746 | /**
|
15747 | * @deprecated
|
15748 | */
|
15749 | isInPlace: boolean,
|
15750 | /**
|
15751 | * @deprecated
|
15752 | */
|
15753 | isMainFrame: boolean,
|
15754 | /**
|
15755 | * @deprecated
|
15756 | */
|
15757 | frameProcessId: number,
|
15758 | /**
|
15759 | * @deprecated
|
15760 | */
|
15761 | frameRoutingId: number) => void): this;
|
15762 | removeListener(event: 'will-navigate', listener: (details: Event<WebContentsWillNavigateEventParams>,
|
15763 | /**
|
15764 | * @deprecated
|
15765 | */
|
15766 | url: string,
|
15767 | /**
|
15768 | * @deprecated
|
15769 | */
|
15770 | isInPlace: boolean,
|
15771 | /**
|
15772 | * @deprecated
|
15773 | */
|
15774 | isMainFrame: boolean,
|
15775 | /**
|
15776 | * @deprecated
|
15777 | */
|
15778 | frameProcessId: number,
|
15779 | /**
|
15780 | * @deprecated
|
15781 | */
|
15782 | frameRoutingId: number) => void): this;
|
15783 | /**
|
15784 | * Emitted when a `beforeunload` event handler is attempting to cancel a page
|
15785 | * unload.
|
15786 | *
|
15787 | * Calling `event.preventDefault()` will ignore the `beforeunload` event handler
|
15788 | * and allow the page to be unloaded.
|
15789 | *
|
15790 | * **Note:** This will be emitted for `BrowserViews` but will _not_ be respected -
|
15791 | * this is because we have chosen not to tie the `BrowserView` lifecycle to its
|
15792 | * owning BrowserWindow should one exist per the specification.
|
15793 | */
|
15794 | on(event: 'will-prevent-unload', listener: (event: Event) => void): this;
|
15795 | off(event: 'will-prevent-unload', listener: (event: Event) => void): this;
|
15796 | once(event: 'will-prevent-unload', listener: (event: Event) => void): this;
|
15797 | addListener(event: 'will-prevent-unload', listener: (event: Event) => void): this;
|
15798 | removeListener(event: 'will-prevent-unload', listener: (event: Event) => void): this;
|
15799 | /**
|
15800 | * Emitted when a server side redirect occurs during navigation. For example a 302
|
15801 | * redirect.
|
15802 | *
|
15803 | * This event will be emitted after `did-start-navigation` and always before the
|
15804 | * `did-redirect-navigation` event for the same navigation.
|
15805 | *
|
15806 | * Calling `event.preventDefault()` will prevent the navigation (not just the
|
15807 | * redirect).
|
15808 | */
|
15809 | on(event: 'will-redirect', listener: (details: Event<WebContentsWillRedirectEventParams>,
|
15810 | /**
|
15811 | * @deprecated
|
15812 | */
|
15813 | url: string,
|
15814 | /**
|
15815 | * @deprecated
|
15816 | */
|
15817 | isInPlace: boolean,
|
15818 | /**
|
15819 | * @deprecated
|
15820 | */
|
15821 | isMainFrame: boolean,
|
15822 | /**
|
15823 | * @deprecated
|
15824 | */
|
15825 | frameProcessId: number,
|
15826 | /**
|
15827 | * @deprecated
|
15828 | */
|
15829 | frameRoutingId: number) => void): this;
|
15830 | off(event: 'will-redirect', listener: (details: Event<WebContentsWillRedirectEventParams>,
|
15831 | /**
|
15832 | * @deprecated
|
15833 | */
|
15834 | url: string,
|
15835 | /**
|
15836 | * @deprecated
|
15837 | */
|
15838 | isInPlace: boolean,
|
15839 | /**
|
15840 | * @deprecated
|
15841 | */
|
15842 | isMainFrame: boolean,
|
15843 | /**
|
15844 | * @deprecated
|
15845 | */
|
15846 | frameProcessId: number,
|
15847 | /**
|
15848 | * @deprecated
|
15849 | */
|
15850 | frameRoutingId: number) => void): this;
|
15851 | once(event: 'will-redirect', listener: (details: Event<WebContentsWillRedirectEventParams>,
|
15852 | /**
|
15853 | * @deprecated
|
15854 | */
|
15855 | url: string,
|
15856 | /**
|
15857 | * @deprecated
|
15858 | */
|
15859 | isInPlace: boolean,
|
15860 | /**
|
15861 | * @deprecated
|
15862 | */
|
15863 | isMainFrame: boolean,
|
15864 | /**
|
15865 | * @deprecated
|
15866 | */
|
15867 | frameProcessId: number,
|
15868 | /**
|
15869 | * @deprecated
|
15870 | */
|
15871 | frameRoutingId: number) => void): this;
|
15872 | addListener(event: 'will-redirect', listener: (details: Event<WebContentsWillRedirectEventParams>,
|
15873 | /**
|
15874 | * @deprecated
|
15875 | */
|
15876 | url: string,
|
15877 | /**
|
15878 | * @deprecated
|
15879 | */
|
15880 | isInPlace: boolean,
|
15881 | /**
|
15882 | * @deprecated
|
15883 | */
|
15884 | isMainFrame: boolean,
|
15885 | /**
|
15886 | * @deprecated
|
15887 | */
|
15888 | frameProcessId: number,
|
15889 | /**
|
15890 | * @deprecated
|
15891 | */
|
15892 | frameRoutingId: number) => void): this;
|
15893 | removeListener(event: 'will-redirect', listener: (details: Event<WebContentsWillRedirectEventParams>,
|
15894 | /**
|
15895 | * @deprecated
|
15896 | */
|
15897 | url: string,
|
15898 | /**
|
15899 | * @deprecated
|
15900 | */
|
15901 | isInPlace: boolean,
|
15902 | /**
|
15903 | * @deprecated
|
15904 | */
|
15905 | isMainFrame: boolean,
|
15906 | /**
|
15907 | * @deprecated
|
15908 | */
|
15909 | frameProcessId: number,
|
15910 | /**
|
15911 | * @deprecated
|
15912 | */
|
15913 | frameRoutingId: number) => void): this;
|
15914 | /**
|
15915 | * Emitted when the user is requesting to change the zoom level using the mouse
|
15916 | * wheel.
|
15917 | */
|
15918 | on(event: 'zoom-changed', listener: (event: Event,
|
15919 | /**
|
15920 | * Can be `in` or `out`.
|
15921 | */
|
15922 | zoomDirection: ('in' | 'out')) => void): this;
|
15923 | off(event: 'zoom-changed', listener: (event: Event,
|
15924 | /**
|
15925 | * Can be `in` or `out`.
|
15926 | */
|
15927 | zoomDirection: ('in' | 'out')) => void): this;
|
15928 | once(event: 'zoom-changed', listener: (event: Event,
|
15929 | /**
|
15930 | * Can be `in` or `out`.
|
15931 | */
|
15932 | zoomDirection: ('in' | 'out')) => void): this;
|
15933 | addListener(event: 'zoom-changed', listener: (event: Event,
|
15934 | /**
|
15935 | * Can be `in` or `out`.
|
15936 | */
|
15937 | zoomDirection: ('in' | 'out')) => void): this;
|
15938 | removeListener(event: 'zoom-changed', listener: (event: Event,
|
15939 | /**
|
15940 | * Can be `in` or `out`.
|
15941 | */
|
15942 | zoomDirection: ('in' | 'out')) => void): this;
|
15943 | /**
|
15944 | * Adds the specified path to DevTools workspace. Must be used after DevTools
|
15945 | * creation:
|
15946 | */
|
15947 | addWorkSpace(path: string): void;
|
15948 | /**
|
15949 | * Adjusts the current text selection starting and ending points in the focused
|
15950 | * frame by the given amounts. A negative amount moves the selection towards the
|
15951 | * beginning of the document, and a positive amount moves the selection towards the
|
15952 | * end of the document.
|
15953 | *
|
15954 | * Example:
|
15955 | *
|
15956 | * For a call of `win.webContents.adjustSelection({ start: 1, end: 5 })`
|
15957 | *
|
15958 | * Before:
|
15959 | *
|
15960 | * After:
|
15961 | */
|
15962 | adjustSelection(options: AdjustSelectionOptions): void;
|
15963 | /**
|
15964 | * Begin subscribing for presentation events and captured frames, the `callback`
|
15965 | * will be called with `callback(image, dirtyRect)` when there is a presentation
|
15966 | * event.
|
15967 | *
|
15968 | * The `image` is an instance of NativeImage that stores the captured frame.
|
15969 | *
|
15970 | * The `dirtyRect` is an object with `x, y, width, height` properties that
|
15971 | * describes which part of the page was repainted. If `onlyDirty` is set to `true`,
|
15972 | * `image` will only contain the repainted area. `onlyDirty` defaults to `false`.
|
15973 | */
|
15974 | beginFrameSubscription(onlyDirty: boolean, callback: (image: NativeImage, dirtyRect: Rectangle) => void): void;
|
15975 | /**
|
15976 | * Begin subscribing for presentation events and captured frames, the `callback`
|
15977 | * will be called with `callback(image, dirtyRect)` when there is a presentation
|
15978 | * event.
|
15979 | *
|
15980 | * The `image` is an instance of NativeImage that stores the captured frame.
|
15981 | *
|
15982 | * The `dirtyRect` is an object with `x, y, width, height` properties that
|
15983 | * describes which part of the page was repainted. If `onlyDirty` is set to `true`,
|
15984 | * `image` will only contain the repainted area. `onlyDirty` defaults to `false`.
|
15985 | */
|
15986 | beginFrameSubscription(callback: (image: NativeImage, dirtyRect: Rectangle) => void): void;
|
15987 | /**
|
15988 | * Whether the browser can go back to previous web page.
|
15989 | *
|
15990 | * **Deprecated:** Should use the new `contents.navigationHistory.canGoBack` API.
|
15991 | *
|
15992 | * @deprecated
|
15993 | */
|
15994 | canGoBack(): boolean;
|
15995 | /**
|
15996 | * Whether the browser can go forward to next web page.
|
15997 | *
|
15998 | * **Deprecated:** Should use the new `contents.navigationHistory.canGoForward`
|
15999 | * API.
|
16000 | *
|
16001 | * @deprecated
|
16002 | */
|
16003 | canGoForward(): boolean;
|
16004 | /**
|
16005 | * Whether the web page can go to `offset`.
|
16006 | *
|
16007 | * **Deprecated:** Should use the new `contents.navigationHistory.canGoToOffset`
|
16008 | * API.
|
16009 | *
|
16010 | * @deprecated
|
16011 | */
|
16012 | canGoToOffset(offset: number): boolean;
|
16013 | /**
|
16014 | * Resolves with a NativeImage
|
16015 | *
|
16016 | * Captures a snapshot of the page within `rect`. Omitting `rect` will capture the
|
16017 | * whole visible page. The page is considered visible when its browser window is
|
16018 | * hidden and the capturer count is non-zero. If you would like the page to stay
|
16019 | * hidden, you should ensure that `stayHidden` is set to true.
|
16020 | */
|
16021 | capturePage(rect?: Rectangle, opts?: Opts): Promise<Electron.NativeImage>;
|
16022 | /**
|
16023 | * Centers the current text selection in web page.
|
16024 | */
|
16025 | centerSelection(): void;
|
16026 | /**
|
16027 | * Clears the navigation history.
|
16028 | *
|
16029 | * **Deprecated:** Should use the new `contents.navigationHistory.clear` API.
|
16030 | *
|
16031 | * @deprecated
|
16032 | */
|
16033 | clearHistory(): void;
|
16034 | /**
|
16035 | * Closes the page, as if the web content had called `window.close()`.
|
16036 | *
|
16037 | * If the page is successfully closed (i.e. the unload is not prevented by the
|
16038 | * page, or `waitForBeforeUnload` is false or unspecified), the WebContents will be
|
16039 | * destroyed and no longer usable. The `destroyed` event will be emitted.
|
16040 | */
|
16041 | close(opts?: CloseOpts): void;
|
16042 | /**
|
16043 | * Closes the devtools.
|
16044 | */
|
16045 | closeDevTools(): void;
|
16046 | /**
|
16047 | * Executes the editing command `copy` in web page.
|
16048 | */
|
16049 | copy(): void;
|
16050 | /**
|
16051 | * Copy the image at the given position to the clipboard.
|
16052 | */
|
16053 | copyImageAt(x: number, y: number): void;
|
16054 | /**
|
16055 | * Executes the editing command `cut` in web page.
|
16056 | */
|
16057 | cut(): void;
|
16058 | /**
|
16059 | * Executes the editing command `delete` in web page.
|
16060 | */
|
16061 | delete(): void;
|
16062 | /**
|
16063 | * Disable device emulation enabled by `webContents.enableDeviceEmulation`.
|
16064 | */
|
16065 | disableDeviceEmulation(): void;
|
16066 | /**
|
16067 | * Initiates a download of the resource at `url` without navigating. The
|
16068 | * `will-download` event of `session` will be triggered.
|
16069 | */
|
16070 | downloadURL(url: string, options?: DownloadURLOptions): void;
|
16071 | /**
|
16072 | * Enable device emulation with the given parameters.
|
16073 | */
|
16074 | enableDeviceEmulation(parameters: Parameters): void;
|
16075 | /**
|
16076 | * End subscribing for frame presentation events.
|
16077 | */
|
16078 | endFrameSubscription(): void;
|
16079 | /**
|
16080 | * A promise that resolves with the result of the executed code or is rejected if
|
16081 | * the result of the code is a rejected promise.
|
16082 | *
|
16083 | * Evaluates `code` in page.
|
16084 | *
|
16085 | * In the browser window some HTML APIs like `requestFullScreen` can only be
|
16086 | * invoked by a gesture from the user. Setting `userGesture` to `true` will remove
|
16087 | * this limitation.
|
16088 | *
|
16089 | * Code execution will be suspended until web page stop loading.
|
16090 | */
|
16091 | executeJavaScript(code: string, userGesture?: boolean): Promise<any>;
|
16092 | /**
|
16093 | * A promise that resolves with the result of the executed code or is rejected if
|
16094 | * the result of the code is a rejected promise.
|
16095 | *
|
16096 | * Works like `executeJavaScript` but evaluates `scripts` in an isolated context.
|
16097 | */
|
16098 | executeJavaScriptInIsolatedWorld(worldId: number, scripts: WebSource[], userGesture?: boolean): Promise<any>;
|
16099 | /**
|
16100 | * The request id used for the request.
|
16101 | *
|
16102 | * Starts a request to find all matches for the `text` in the web page. The result
|
16103 | * of the request can be obtained by subscribing to `found-in-page` event.
|
16104 | */
|
16105 | findInPage(text: string, options?: FindInPageOptions): number;
|
16106 | /**
|
16107 | * Focuses the web page.
|
16108 | */
|
16109 | focus(): void;
|
16110 | /**
|
16111 | * Forcefully terminates the renderer process that is currently hosting this
|
16112 | * `webContents`. This will cause the `render-process-gone` event to be emitted
|
16113 | * with the `reason=killed || reason=crashed`. Please note that some webContents
|
16114 | * share renderer processes and therefore calling this method may also crash the
|
16115 | * host process for other webContents as well.
|
16116 | *
|
16117 | * Calling `reload()` immediately after calling this method will force the reload
|
16118 | * to occur in a new process. This should be used when this process is unstable or
|
16119 | * unusable, for instance in order to recover from the `unresponsive` event.
|
16120 | */
|
16121 | forcefullyCrashRenderer(): void;
|
16122 | /**
|
16123 | * Information about all Shared Workers.
|
16124 | */
|
16125 | getAllSharedWorkers(): SharedWorkerInfo[];
|
16126 | /**
|
16127 | * whether or not this WebContents will throttle animations and timers when the
|
16128 | * page becomes backgrounded. This also affects the Page Visibility API.
|
16129 | */
|
16130 | getBackgroundThrottling(): boolean;
|
16131 | /**
|
16132 | * the current title of the DevTools window. This will only be visible if DevTools
|
16133 | * is opened in `undocked` or `detach` mode.
|
16134 | */
|
16135 | getDevToolsTitle(): string;
|
16136 | /**
|
16137 | * If _offscreen rendering_ is enabled returns the current frame rate.
|
16138 | */
|
16139 | getFrameRate(): number;
|
16140 | /**
|
16141 | * The identifier of a WebContents stream. This identifier can be used with
|
16142 | * `navigator.mediaDevices.getUserMedia` using a `chromeMediaSource` of `tab`. The
|
16143 | * identifier is restricted to the web contents that it is registered to and is
|
16144 | * only valid for 10 seconds.
|
16145 | */
|
16146 | getMediaSourceId(requestWebContents: WebContents): string;
|
16147 | /**
|
16148 | * The operating system `pid` of the associated renderer process.
|
16149 | */
|
16150 | getOSProcessId(): number;
|
16151 | /**
|
16152 | * Get the system printer list.
|
16153 | *
|
16154 | * Resolves with a `PrinterInfo[]`
|
16155 | */
|
16156 | getPrintersAsync(): Promise<Electron.PrinterInfo[]>;
|
16157 | /**
|
16158 | * The Chromium internal `pid` of the associated renderer. Can be compared to the
|
16159 | * `frameProcessId` passed by frame specific navigation events (e.g.
|
16160 | * `did-frame-navigate`)
|
16161 | */
|
16162 | getProcessId(): number;
|
16163 | /**
|
16164 | * The title of the current web page.
|
16165 | */
|
16166 | getTitle(): string;
|
16167 | /**
|
16168 | * the type of the webContent. Can be `backgroundPage`, `window`, `browserView`,
|
16169 | * `remote`, `webview` or `offscreen`.
|
16170 | */
|
16171 | getType(): ('backgroundPage' | 'window' | 'browserView' | 'remote' | 'webview' | 'offscreen');
|
16172 | /**
|
16173 | * The URL of the current web page.
|
16174 | */
|
16175 | getURL(): string;
|
16176 | /**
|
16177 | * The user agent for this web page.
|
16178 | */
|
16179 | getUserAgent(): string;
|
16180 | /**
|
16181 | * Returns the WebRTC IP Handling Policy.
|
16182 | */
|
16183 | getWebRTCIPHandlingPolicy(): string;
|
16184 | /**
|
16185 | * * `min` Integer - The minimum UDP port number that WebRTC should use.
|
16186 | * * `max` Integer - The maximum UDP port number that WebRTC should use.
|
16187 | *
|
16188 | * By default this value is `{ min: 0, max: 0 }` , which would apply no restriction
|
16189 | * on the udp port range.
|
16190 | */
|
16191 | getWebRTCUDPPortRange(): WebRTCUDPPortRange;
|
16192 | /**
|
16193 | * the current zoom factor.
|
16194 | */
|
16195 | getZoomFactor(): number;
|
16196 | /**
|
16197 | * the current zoom level.
|
16198 | */
|
16199 | getZoomLevel(): number;
|
16200 | /**
|
16201 | * Makes the browser go back a web page.
|
16202 | *
|
16203 | * **Deprecated:** Should use the new `contents.navigationHistory.goBack` API.
|
16204 | *
|
16205 | * @deprecated
|
16206 | */
|
16207 | goBack(): void;
|
16208 | /**
|
16209 | * Makes the browser go forward a web page.
|
16210 | *
|
16211 | * **Deprecated:** Should use the new `contents.navigationHistory.goForward` API.
|
16212 | *
|
16213 | * @deprecated
|
16214 | */
|
16215 | goForward(): void;
|
16216 | /**
|
16217 | * Navigates browser to the specified absolute web page index.
|
16218 | *
|
16219 | * **Deprecated:** Should use the new `contents.navigationHistory.goToIndex` API.
|
16220 | *
|
16221 | * @deprecated
|
16222 | */
|
16223 | goToIndex(index: number): void;
|
16224 | /**
|
16225 | * Navigates to the specified offset from the "current entry".
|
16226 | *
|
16227 | * **Deprecated:** Should use the new `contents.navigationHistory.goToOffset` API.
|
16228 | *
|
16229 | * @deprecated
|
16230 | */
|
16231 | goToOffset(offset: number): void;
|
16232 | /**
|
16233 | * A promise that resolves with a key for the inserted CSS that can later be used
|
16234 | * to remove the CSS via `contents.removeInsertedCSS(key)`.
|
16235 | *
|
16236 | * Injects CSS into the current web page and returns a unique key for the inserted
|
16237 | * stylesheet.
|
16238 | */
|
16239 | insertCSS(css: string, options?: InsertCSSOptions): Promise<string>;
|
16240 | /**
|
16241 | * Inserts `text` to the focused element.
|
16242 | */
|
16243 | insertText(text: string): Promise<void>;
|
16244 | /**
|
16245 | * Starts inspecting element at position (`x`, `y`).
|
16246 | */
|
16247 | inspectElement(x: number, y: number): void;
|
16248 | /**
|
16249 | * Opens the developer tools for the service worker context.
|
16250 | */
|
16251 | inspectServiceWorker(): void;
|
16252 | /**
|
16253 | * Opens the developer tools for the shared worker context.
|
16254 | */
|
16255 | inspectSharedWorker(): void;
|
16256 | /**
|
16257 | * Inspects the shared worker based on its ID.
|
16258 | */
|
16259 | inspectSharedWorkerById(workerId: string): void;
|
16260 | /**
|
16261 | * Schedules a full repaint of the window this web contents is in.
|
16262 | *
|
16263 | * If _offscreen rendering_ is enabled invalidates the frame and generates a new
|
16264 | * one through the `'paint'` event.
|
16265 | */
|
16266 | invalidate(): void;
|
16267 | /**
|
16268 | * Whether this page has been muted.
|
16269 | */
|
16270 | isAudioMuted(): boolean;
|
16271 | /**
|
16272 | * Whether this page is being captured. It returns true when the capturer count is
|
16273 | * greater than 0.
|
16274 | */
|
16275 | isBeingCaptured(): boolean;
|
16276 | /**
|
16277 | * Whether the renderer process has crashed.
|
16278 | */
|
16279 | isCrashed(): boolean;
|
16280 | /**
|
16281 | * Whether audio is currently playing.
|
16282 | */
|
16283 | isCurrentlyAudible(): boolean;
|
16284 | /**
|
16285 | * Whether the web page is destroyed.
|
16286 | */
|
16287 | isDestroyed(): boolean;
|
16288 | /**
|
16289 | * Whether the devtools view is focused .
|
16290 | */
|
16291 | isDevToolsFocused(): boolean;
|
16292 | /**
|
16293 | * Whether the devtools is opened.
|
16294 | */
|
16295 | isDevToolsOpened(): boolean;
|
16296 | /**
|
16297 | * Whether the web page is focused.
|
16298 | */
|
16299 | isFocused(): boolean;
|
16300 | /**
|
16301 | * Whether web page is still loading resources.
|
16302 | */
|
16303 | isLoading(): boolean;
|
16304 | /**
|
16305 | * Whether the main frame (and not just iframes or frames within it) is still
|
16306 | * loading.
|
16307 | */
|
16308 | isLoadingMainFrame(): boolean;
|
16309 | /**
|
16310 | * Indicates whether _offscreen rendering_ is enabled.
|
16311 | */
|
16312 | isOffscreen(): boolean;
|
16313 | /**
|
16314 | * If _offscreen rendering_ is enabled returns whether it is currently painting.
|
16315 | */
|
16316 | isPainting(): boolean;
|
16317 | /**
|
16318 | * Whether the web page is waiting for a first-response from the main resource of
|
16319 | * the page.
|
16320 | */
|
16321 | isWaitingForResponse(): boolean;
|
16322 | /**
|
16323 | * the promise will resolve when the page has finished loading (see
|
16324 | * `did-finish-load`), and rejects if the page fails to load (see `did-fail-load`).
|
16325 | *
|
16326 | * Loads the given file in the window, `filePath` should be a path to an HTML file
|
16327 | * relative to the root of your application. For instance an app structure like
|
16328 | * this:
|
16329 | *
|
16330 | * Would require code like this
|
16331 | */
|
16332 | loadFile(filePath: string, options?: LoadFileOptions): Promise<void>;
|
16333 | /**
|
16334 | * the promise will resolve when the page has finished loading (see
|
16335 | * `did-finish-load`), and rejects if the page fails to load (see `did-fail-load`).
|
16336 | * A noop rejection handler is already attached, which avoids unhandled rejection
|
16337 | * errors.
|
16338 | *
|
16339 | * Loads the `url` in the window. The `url` must contain the protocol prefix, e.g.
|
16340 | * the `http://` or `file://`. If the load should bypass http cache then use the
|
16341 | * `pragma` header to achieve it.
|
16342 | */
|
16343 | loadURL(url: string, options?: LoadURLOptions): Promise<void>;
|
16344 | /**
|
16345 | * Opens the devtools.
|
16346 | *
|
16347 | * When `contents` is a `<webview>` tag, the `mode` would be `detach` by default,
|
16348 | * explicitly passing an empty `mode` can force using last used dock state.
|
16349 | *
|
16350 | * On Windows, if Windows Control Overlay is enabled, Devtools will be opened with
|
16351 | * `mode: 'detach'`.
|
16352 | */
|
16353 | openDevTools(options?: OpenDevToolsOptions): void;
|
16354 | /**
|
16355 | * Executes the editing command `paste` in web page.
|
16356 | */
|
16357 | paste(): void;
|
16358 | /**
|
16359 | * Executes the editing command `pasteAndMatchStyle` in web page.
|
16360 | */
|
16361 | pasteAndMatchStyle(): void;
|
16362 | /**
|
16363 | * Send a message to the renderer process, optionally transferring ownership of
|
16364 | * zero or more `MessagePortMain` objects.
|
16365 | *
|
16366 | * The transferred `MessagePortMain` objects will be available in the renderer
|
16367 | * process by accessing the `ports` property of the emitted event. When they arrive
|
16368 | * in the renderer, they will be native DOM `MessagePort` objects.
|
16369 | *
|
16370 | * For example:
|
16371 | */
|
16372 | postMessage(channel: string, message: any, transfer?: MessagePortMain[]): void;
|
16373 | /**
|
16374 | * When a custom `pageSize` is passed, Chromium attempts to validate platform
|
16375 | * specific minimum values for `width_microns` and `height_microns`. Width and
|
16376 | * height must both be minimum 353 microns but may be higher on some operating
|
16377 | * systems.
|
16378 | *
|
16379 | * Prints window's web page. When `silent` is set to `true`, Electron will pick the
|
16380 | * system's default printer if `deviceName` is empty and the default settings for
|
16381 | * printing.
|
16382 | *
|
16383 | * Use `page-break-before: always;` CSS style to force to print to a new page.
|
16384 | *
|
16385 | * Example usage:
|
16386 | */
|
16387 | print(options?: WebContentsPrintOptions, callback?: (success: boolean, failureReason: string) => void): void;
|
16388 | /**
|
16389 | * Resolves with the generated PDF data.
|
16390 | *
|
16391 | * Prints the window's web page as PDF.
|
16392 | *
|
16393 | * The `landscape` will be ignored if `@page` CSS at-rule is used in the web page.
|
16394 | *
|
16395 | * An example of `webContents.printToPDF`:
|
16396 | *
|
16397 | * See Page.printToPdf for more information.
|
16398 | */
|
16399 | printToPDF(options: PrintToPDFOptions): Promise<Buffer>;
|
16400 | /**
|
16401 | * Executes the editing command `redo` in web page.
|
16402 | */
|
16403 | redo(): void;
|
16404 | /**
|
16405 | * Reloads the current web page.
|
16406 | */
|
16407 | reload(): void;
|
16408 | /**
|
16409 | * Reloads current page and ignores cache.
|
16410 | */
|
16411 | reloadIgnoringCache(): void;
|
16412 | /**
|
16413 | * Resolves if the removal was successful.
|
16414 | *
|
16415 | * Removes the inserted CSS from the current web page. The stylesheet is identified
|
16416 | * by its key, which is returned from `contents.insertCSS(css)`.
|
16417 | */
|
16418 | removeInsertedCSS(key: string): Promise<void>;
|
16419 | /**
|
16420 | * Removes the specified path from DevTools workspace.
|
16421 | */
|
16422 | removeWorkSpace(path: string): void;
|
16423 | /**
|
16424 | * Executes the editing command `replace` in web page.
|
16425 | */
|
16426 | replace(text: string): void;
|
16427 | /**
|
16428 | * Executes the editing command `replaceMisspelling` in web page.
|
16429 | */
|
16430 | replaceMisspelling(text: string): void;
|
16431 | /**
|
16432 | * resolves if the page is saved.
|
16433 | */
|
16434 | savePage(fullPath: string, saveType: 'HTMLOnly' | 'HTMLComplete' | 'MHTML'): Promise<void>;
|
16435 | /**
|
16436 | * Scrolls to the bottom of the current `webContents`.
|
16437 | */
|
16438 | scrollToBottom(): void;
|
16439 | /**
|
16440 | * Scrolls to the top of the current `webContents`.
|
16441 | */
|
16442 | scrollToTop(): void;
|
16443 | /**
|
16444 | * Executes the editing command `selectAll` in web page.
|
16445 | */
|
16446 | selectAll(): void;
|
16447 | /**
|
16448 | * Send an asynchronous message to the renderer process via `channel`, along with
|
16449 | * arguments. Arguments will be serialized with the Structured Clone Algorithm,
|
16450 | * just like `postMessage`, so prototype chains will not be included. Sending
|
16451 | * Functions, Promises, Symbols, WeakMaps, or WeakSets will throw an exception.
|
16452 | *
|
16453 | * :::warning
|
16454 | *
|
16455 | * Sending non-standard JavaScript types such as DOM objects or special Electron
|
16456 | * objects will throw an exception.
|
16457 | *
|
16458 | * :::
|
16459 | *
|
16460 | * For additional reading, refer to Electron's IPC guide.
|
16461 | */
|
16462 | send(channel: string, ...args: any[]): void;
|
16463 | /**
|
16464 | * Sends an input `event` to the page. **Note:** The `BrowserWindow` containing the
|
16465 | * contents needs to be focused for `sendInputEvent()` to work.
|
16466 | */
|
16467 | sendInputEvent(inputEvent: (MouseInputEvent) | (MouseWheelInputEvent) | (KeyboardInputEvent)): void;
|
16468 | /**
|
16469 | * Send an asynchronous message to a specific frame in a renderer process via
|
16470 | * `channel`, along with arguments. Arguments will be serialized with the
|
16471 | * Structured Clone Algorithm, just like `postMessage`, so prototype chains will
|
16472 | * not be included. Sending Functions, Promises, Symbols, WeakMaps, or WeakSets
|
16473 | * will throw an exception.
|
16474 | *
|
16475 | * > **NOTE:** Sending non-standard JavaScript types such as DOM objects or special
|
16476 | * Electron objects will throw an exception.
|
16477 | *
|
16478 | * The renderer process can handle the message by listening to `channel` with the
|
16479 | * `ipcRenderer` module.
|
16480 | *
|
16481 | * If you want to get the `frameId` of a given renderer context you should use the
|
16482 | * `webFrame.routingId` value. E.g.
|
16483 | *
|
16484 | * You can also read `frameId` from all incoming IPC messages in the main process.
|
16485 | */
|
16486 | sendToFrame(frameId: (number) | ([number, number]), channel: string, ...args: any[]): void;
|
16487 | /**
|
16488 | * Mute the audio on the current web page.
|
16489 | */
|
16490 | setAudioMuted(muted: boolean): void;
|
16491 | /**
|
16492 | * Controls whether or not this WebContents will throttle animations and timers
|
16493 | * when the page becomes backgrounded. This also affects the Page Visibility API.
|
16494 | */
|
16495 | setBackgroundThrottling(allowed: boolean): void;
|
16496 | /**
|
16497 | * Changes the title of the DevTools window to `title`. This will only be visible
|
16498 | * if DevTools is opened in `undocked` or `detach` mode.
|
16499 | */
|
16500 | setDevToolsTitle(title: string): void;
|
16501 | /**
|
16502 | * Uses the `devToolsWebContents` as the target `WebContents` to show devtools.
|
16503 | *
|
16504 | * The `devToolsWebContents` must not have done any navigation, and it should not
|
16505 | * be used for other purposes after the call.
|
16506 | *
|
16507 | * By default Electron manages the devtools by creating an internal `WebContents`
|
16508 | * with native view, which developers have very limited control of. With the
|
16509 | * `setDevToolsWebContents` method, developers can use any `WebContents` to show
|
16510 | * the devtools in it, including `BrowserWindow`, `BrowserView` and `<webview>`
|
16511 | * tag.
|
16512 | *
|
16513 | * Note that closing the devtools does not destroy the `devToolsWebContents`, it is
|
16514 | * caller's responsibility to destroy `devToolsWebContents`.
|
16515 | *
|
16516 | * An example of showing devtools in a `<webview>` tag:
|
16517 | *
|
16518 | * An example of showing devtools in a `BrowserWindow`:
|
16519 | */
|
16520 | setDevToolsWebContents(devToolsWebContents: WebContents): void;
|
16521 | /**
|
16522 | * If _offscreen rendering_ is enabled sets the frame rate to the specified number.
|
16523 | * Only values between 1 and 240 are accepted.
|
16524 | */
|
16525 | setFrameRate(fps: number): void;
|
16526 | /**
|
16527 | * Ignore application menu shortcuts while this web contents is focused.
|
16528 | */
|
16529 | setIgnoreMenuShortcuts(ignore: boolean): void;
|
16530 | /**
|
16531 | * Sets the image animation policy for this webContents. The policy only affects
|
16532 | * _new_ images, existing images that are currently being animated are unaffected.
|
16533 | * This is a known limitation in Chromium, you can force image animation to be
|
16534 | * recalculated with `img.src = img.src` which will result in no network traffic
|
16535 | * but will update the animation policy.
|
16536 | *
|
16537 | * This corresponds to the animationPolicy accessibility feature in Chromium.
|
16538 | */
|
16539 | setImageAnimationPolicy(policy: 'animate' | 'animateOnce' | 'noAnimation'): void;
|
16540 | /**
|
16541 | * Overrides the user agent for this web page.
|
16542 | */
|
16543 | setUserAgent(userAgent: string): void;
|
16544 | /**
|
16545 | * Sets the maximum and minimum pinch-to-zoom level.
|
16546 | *
|
16547 | * > **NOTE**: Visual zoom is disabled by default in Electron. To re-enable it,
|
16548 | * call:
|
16549 | */
|
16550 | setVisualZoomLevelLimits(minimumLevel: number, maximumLevel: number): Promise<void>;
|
16551 | /**
|
16552 | * Setting the WebRTC IP handling policy allows you to control which IPs are
|
16553 | * exposed via WebRTC. See BrowserLeaks for more details.
|
16554 | */
|
16555 | setWebRTCIPHandlingPolicy(policy: 'default' | 'default_public_interface_only' | 'default_public_and_private_interfaces' | 'disable_non_proxied_udp'): void;
|
16556 | /**
|
16557 | * Setting the WebRTC UDP Port Range allows you to restrict the udp port range used
|
16558 | * by WebRTC. By default the port range is unrestricted. **Note:** To reset to an
|
16559 | * unrestricted port range this value should be set to `{ min: 0, max: 0 }`.
|
16560 | */
|
16561 | setWebRTCUDPPortRange(udpPortRange: UdpPortRange): void;
|
16562 | /**
|
16563 | * Called before creating a window a new window is requested by the renderer, e.g.
|
16564 | * by `window.open()`, a link with `target="_blank"`, shift+clicking on a link, or
|
16565 | * submitting a form with `<form target="_blank">`. See `window.open()` for more
|
16566 | * details and how to use this in conjunction with `did-create-window`.
|
16567 | *
|
16568 | * An example showing how to customize the process of new `BrowserWindow` creation
|
16569 | * to be `BrowserView` attached to main window instead:
|
16570 | */
|
16571 | setWindowOpenHandler(handler: (details: HandlerDetails) => WindowOpenHandlerResponse): void;
|
16572 | /**
|
16573 | * Changes the zoom factor to the specified factor. Zoom factor is zoom percent
|
16574 | * divided by 100, so 300% = 3.0.
|
16575 | *
|
16576 | * The factor must be greater than 0.0.
|
16577 | */
|
16578 | setZoomFactor(factor: number): void;
|
16579 | /**
|
16580 | * Changes the zoom level to the specified level. The original size is 0 and each
|
16581 | * increment above or below represents zooming 20% larger or smaller to default
|
16582 | * limits of 300% and 50% of original size, respectively. The formula for this is
|
16583 | * `scale := 1.2 ^ level`.
|
16584 | *
|
16585 | * > **NOTE**: The zoom policy at the Chromium level is same-origin, meaning that
|
16586 | * the zoom level for a specific domain propagates across all instances of windows
|
16587 | * with the same domain. Differentiating the window URLs will make zoom work
|
16588 | * per-window.
|
16589 | */
|
16590 | setZoomLevel(level: number): void;
|
16591 | /**
|
16592 | * Shows pop-up dictionary that searches the selected word on the page.
|
16593 | *
|
16594 | * @platform darwin
|
16595 | */
|
16596 | showDefinitionForSelection(): void;
|
16597 | /**
|
16598 | * Sets the `item` as dragging item for current drag-drop operation, `file` is the
|
16599 | * absolute path of the file to be dragged, and `icon` is the image showing under
|
16600 | * the cursor when dragging.
|
16601 | */
|
16602 | startDrag(item: Item): void;
|
16603 | /**
|
16604 | * If _offscreen rendering_ is enabled and not painting, start painting.
|
16605 | */
|
16606 | startPainting(): void;
|
16607 | /**
|
16608 | * Stops any pending navigation.
|
16609 | */
|
16610 | stop(): void;
|
16611 | /**
|
16612 | * Stops any `findInPage` request for the `webContents` with the provided `action`.
|
16613 | */
|
16614 | stopFindInPage(action: 'clearSelection' | 'keepSelection' | 'activateSelection'): void;
|
16615 | /**
|
16616 | * If _offscreen rendering_ is enabled and painting, stop painting.
|
16617 | */
|
16618 | stopPainting(): void;
|
16619 | /**
|
16620 | * Indicates whether the snapshot has been created successfully.
|
16621 | *
|
16622 | * Takes a V8 heap snapshot and saves it to `filePath`.
|
16623 | */
|
16624 | takeHeapSnapshot(filePath: string): Promise<void>;
|
16625 | /**
|
16626 | * Toggles the developer tools.
|
16627 | */
|
16628 | toggleDevTools(): void;
|
16629 | /**
|
16630 | * Executes the editing command `undo` in web page.
|
16631 | */
|
16632 | undo(): void;
|
16633 | /**
|
16634 | * Executes the editing command `unselect` in web page.
|
16635 | */
|
16636 | unselect(): void;
|
16637 | /**
|
16638 | * A `boolean` property that determines whether this page is muted.
|
16639 | */
|
16640 | audioMuted: boolean;
|
16641 | /**
|
16642 | * A `boolean` property that determines whether or not this WebContents will
|
16643 | * throttle animations and timers when the page becomes backgrounded. This also
|
16644 | * affects the Page Visibility API.
|
16645 | */
|
16646 | backgroundThrottling: boolean;
|
16647 | /**
|
16648 | * A `Debugger` instance for this webContents.
|
16649 | *
|
16650 | */
|
16651 | readonly debugger: Debugger;
|
16652 | /**
|
16653 | * A `WebContents | null` property that represents the of DevTools `WebContents`
|
16654 | * associated with a given `WebContents`.
|
16655 | *
|
16656 | * **Note:** Users should never store this object because it may become `null` when
|
16657 | * the DevTools has been closed.
|
16658 | *
|
16659 | */
|
16660 | readonly devToolsWebContents: (WebContents) | (null);
|
16661 | /**
|
16662 | * An `Integer` property that sets the frame rate of the web contents to the
|
16663 | * specified number. Only values between 1 and 240 are accepted.
|
16664 | *
|
16665 | * Only applicable if _offscreen rendering_ is enabled.
|
16666 | */
|
16667 | frameRate: number;
|
16668 | /**
|
16669 | * A `WebContents` instance that might own this `WebContents`.
|
16670 | *
|
16671 | */
|
16672 | readonly hostWebContents: WebContents;
|
16673 | /**
|
16674 | * A `Integer` representing the unique ID of this WebContents. Each ID is unique
|
16675 | * among all `WebContents` instances of the entire Electron application.
|
16676 | *
|
16677 | */
|
16678 | readonly id: number;
|
16679 | /**
|
16680 | * An `IpcMain` scoped to just IPC messages sent from this WebContents.
|
16681 | *
|
16682 | * IPC messages sent with `ipcRenderer.send`, `ipcRenderer.sendSync` or
|
16683 | * `ipcRenderer.postMessage` will be delivered in the following order:
|
16684 | *
|
16685 | * * `contents.on('ipc-message')`
|
16686 | * * `contents.mainFrame.on(channel)`
|
16687 | * * `contents.ipc.on(channel)`
|
16688 | * * `ipcMain.on(channel)`
|
16689 | *
|
16690 | * Handlers registered with `invoke` will be checked in the following order. The
|
16691 | * first one that is defined will be called, the rest will be ignored.
|
16692 | *
|
16693 | * * `contents.mainFrame.handle(channel)`
|
16694 | * * `contents.handle(channel)`
|
16695 | * * `ipcMain.handle(channel)`
|
16696 | *
|
16697 | * A handler or event listener registered on the WebContents will receive IPC
|
16698 | * messages sent from any frame, including child frames. In most cases, only the
|
16699 | * main frame can send IPC messages. However, if the `nodeIntegrationInSubFrames`
|
16700 | * option is enabled, it is possible for child frames to send IPC messages also. In
|
16701 | * that case, handlers should check the `senderFrame` property of the IPC event to
|
16702 | * ensure that the message is coming from the expected frame. Alternatively,
|
16703 | * register handlers on the appropriate frame directly using the `WebFrameMain.ipc`
|
16704 | * interface.
|
16705 | *
|
16706 | */
|
16707 | readonly ipc: IpcMain;
|
16708 | /**
|
16709 | * A `WebFrameMain` property that represents the top frame of the page's frame
|
16710 | * hierarchy.
|
16711 | *
|
16712 | */
|
16713 | readonly mainFrame: WebFrameMain;
|
16714 | /**
|
16715 | * A `NavigationHistory` used by this webContents.
|
16716 | *
|
16717 | */
|
16718 | readonly navigationHistory: NavigationHistory;
|
16719 | /**
|
16720 | * A `WebFrameMain` property that represents the frame that opened this
|
16721 | * WebContents, either with open(), or by navigating a link with a target
|
16722 | * attribute.
|
16723 | *
|
16724 | */
|
16725 | readonly opener: WebFrameMain;
|
16726 | /**
|
16727 | * A `Session` used by this webContents.
|
16728 | *
|
16729 | */
|
16730 | readonly session: Session;
|
16731 | /**
|
16732 | * A `string` property that determines the user agent for this web page.
|
16733 | */
|
16734 | userAgent: string;
|
16735 | /**
|
16736 | * A `number` property that determines the zoom factor for this web contents.
|
16737 | *
|
16738 | * The zoom factor is the zoom percent divided by 100, so 300% = 3.0.
|
16739 | */
|
16740 | zoomFactor: number;
|
16741 | /**
|
16742 | * A `number` property that determines the zoom level for this web contents.
|
16743 | *
|
16744 | * The original size is 0 and each increment above or below represents zooming 20%
|
16745 | * larger or smaller to default limits of 300% and 50% of original size,
|
16746 | * respectively. The formula for this is `scale := 1.2 ^ level`.
|
16747 | */
|
16748 | zoomLevel: number;
|
16749 | }
|
16750 |
|
16751 | class WebContentsView extends View {
|
16752 |
|
16753 | // Docs: https://electronjs.org/docs/api/web-contents-view
|
16754 |
|
16755 | /**
|
16756 | * Emitted when the view's bounds have changed in response to being laid out. The
|
16757 | * new bounds can be retrieved with `view.getBounds()`.
|
16758 | */
|
16759 | on(event: 'bounds-changed', listener: () => void): this;
|
16760 | off(event: 'bounds-changed', listener: () => void): this;
|
16761 | once(event: 'bounds-changed', listener: () => void): this;
|
16762 | addListener(event: 'bounds-changed', listener: () => void): this;
|
16763 | removeListener(event: 'bounds-changed', listener: () => void): this;
|
16764 | /**
|
16765 | * WebContentsView
|
16766 | */
|
16767 | constructor(options?: WebContentsViewConstructorOptions);
|
16768 | /**
|
16769 | * A `WebContents` property containing a reference to the displayed `WebContents`.
|
16770 | * Use this to interact with the `WebContents`, for instance to load a URL.
|
16771 | *
|
16772 | */
|
16773 | readonly webContents: WebContents;
|
16774 | }
|
16775 |
|
16776 | interface WebFrame {
|
16777 |
|
16778 | // Docs: https://electronjs.org/docs/api/web-frame
|
16779 |
|
16780 | /**
|
16781 | * Attempts to free memory that is no longer being used (like images from a
|
16782 | * previous navigation).
|
16783 | *
|
16784 | * Note that blindly calling this method probably makes Electron slower since it
|
16785 | * will have to refill these emptied caches, you should only call it if an event in
|
16786 | * your app has occurred that makes you think your page is actually using less
|
16787 | * memory (i.e. you have navigated from a super heavy page to a mostly empty one,
|
16788 | * and intend to stay there).
|
16789 | */
|
16790 | clearCache(): void;
|
16791 | /**
|
16792 | * A promise that resolves with the result of the executed code or is rejected if
|
16793 | * execution throws or results in a rejected promise.
|
16794 | *
|
16795 | * Evaluates `code` in page.
|
16796 | *
|
16797 | * In the browser window some HTML APIs like `requestFullScreen` can only be
|
16798 | * invoked by a gesture from the user. Setting `userGesture` to `true` will remove
|
16799 | * this limitation.
|
16800 | */
|
16801 | executeJavaScript(code: string, userGesture?: boolean, callback?: (result: any, error: Error) => void): Promise<any>;
|
16802 | /**
|
16803 | * A promise that resolves with the result of the executed code or is rejected if
|
16804 | * execution could not start.
|
16805 | *
|
16806 | * Works like `executeJavaScript` but evaluates `scripts` in an isolated context.
|
16807 | *
|
16808 | * Note that when the execution of script fails, the returned promise will not
|
16809 | * reject and the `result` would be `undefined`. This is because Chromium does not
|
16810 | * dispatch errors of isolated worlds to foreign worlds.
|
16811 | */
|
16812 | executeJavaScriptInIsolatedWorld(worldId: number, scripts: WebSource[], userGesture?: boolean, callback?: (result: any, error: Error) => void): Promise<any>;
|
16813 | /**
|
16814 | * A child of `webFrame` with the supplied `name`, `null` would be returned if
|
16815 | * there's no such frame or if the frame is not in the current renderer process.
|
16816 | */
|
16817 | findFrameByName(name: string): WebFrame;
|
16818 | /**
|
16819 | * that has the supplied `routingId`, `null` if not found.
|
16820 | */
|
16821 | findFrameByRoutingId(routingId: number): WebFrame;
|
16822 | /**
|
16823 | * The frame element in `webFrame's` document selected by `selector`, `null` would
|
16824 | * be returned if `selector` does not select a frame or if the frame is not in the
|
16825 | * current renderer process.
|
16826 | */
|
16827 | getFrameForSelector(selector: string): WebFrame;
|
16828 | /**
|
16829 | * * `images` MemoryUsageDetails
|
16830 | * * `scripts` MemoryUsageDetails
|
16831 | * * `cssStyleSheets` MemoryUsageDetails
|
16832 | * * `xslStyleSheets` MemoryUsageDetails
|
16833 | * * `fonts` MemoryUsageDetails
|
16834 | * * `other` MemoryUsageDetails
|
16835 | *
|
16836 | * Returns an object describing usage information of Blink's internal memory
|
16837 | * caches.
|
16838 | *
|
16839 | * This will generate:
|
16840 | */
|
16841 | getResourceUsage(): ResourceUsage;
|
16842 | /**
|
16843 | * A list of suggested words for a given word. If the word is spelled correctly,
|
16844 | * the result will be empty.
|
16845 | */
|
16846 | getWordSuggestions(word: string): string[];
|
16847 | /**
|
16848 | * The current zoom factor.
|
16849 | */
|
16850 | getZoomFactor(): number;
|
16851 | /**
|
16852 | * The current zoom level.
|
16853 | */
|
16854 | getZoomLevel(): number;
|
16855 | /**
|
16856 | * A key for the inserted CSS that can later be used to remove the CSS via
|
16857 | * `webFrame.removeInsertedCSS(key)`.
|
16858 | *
|
16859 | * Injects CSS into the current web page and returns a unique key for the inserted
|
16860 | * stylesheet.
|
16861 | */
|
16862 | insertCSS(css: string, options?: InsertCSSOptions): string;
|
16863 | /**
|
16864 | * Inserts `text` to the focused element.
|
16865 | */
|
16866 | insertText(text: string): void;
|
16867 | /**
|
16868 | * True if the word is misspelled according to the built in spellchecker, false
|
16869 | * otherwise. If no dictionary is loaded, always return false.
|
16870 | */
|
16871 | isWordMisspelled(word: string): boolean;
|
16872 | /**
|
16873 | * Removes the inserted CSS from the current web page. The stylesheet is identified
|
16874 | * by its key, which is returned from `webFrame.insertCSS(css)`.
|
16875 | */
|
16876 | removeInsertedCSS(key: string): void;
|
16877 | /**
|
16878 | * Set the security origin, content security policy and name of the isolated world.
|
16879 | * Note: If the `csp` is specified, then the `securityOrigin` also has to be
|
16880 | * specified.
|
16881 | */
|
16882 | setIsolatedWorldInfo(worldId: number, info: Info): void;
|
16883 | /**
|
16884 | * Sets a provider for spell checking in input fields and text areas.
|
16885 | *
|
16886 | * If you want to use this method you must disable the builtin spellchecker when
|
16887 | * you construct the window.
|
16888 | *
|
16889 | * The `provider` must be an object that has a `spellCheck` method that accepts an
|
16890 | * array of individual words for spellchecking. The `spellCheck` function runs
|
16891 | * asynchronously and calls the `callback` function with an array of misspelt words
|
16892 | * when complete.
|
16893 | *
|
16894 | * An example of using node-spellchecker as provider:
|
16895 | */
|
16896 | setSpellCheckProvider(language: string, provider: Provider): void;
|
16897 | /**
|
16898 | * Sets the maximum and minimum pinch-to-zoom level.
|
16899 | *
|
16900 | * > **NOTE**: Visual zoom is disabled by default in Electron. To re-enable it,
|
16901 | * call:
|
16902 | *
|
16903 | * > **NOTE**: Visual zoom only applies to pinch-to-zoom behavior. Cmd+/-/0 zoom
|
16904 | * shortcuts are controlled by the 'zoomIn', 'zoomOut', and 'resetZoom' MenuItem
|
16905 | * roles in the application Menu. To disable shortcuts, manually define the Menu
|
16906 | * and omit zoom roles from the definition.
|
16907 | */
|
16908 | setVisualZoomLevelLimits(minimumLevel: number, maximumLevel: number): void;
|
16909 | /**
|
16910 | * Changes the zoom factor to the specified factor. Zoom factor is zoom percent
|
16911 | * divided by 100, so 300% = 3.0.
|
16912 | *
|
16913 | * The factor must be greater than 0.0.
|
16914 | */
|
16915 | setZoomFactor(factor: number): void;
|
16916 | /**
|
16917 | * Changes the zoom level to the specified level. The original size is 0 and each
|
16918 | * increment above or below represents zooming 20% larger or smaller to default
|
16919 | * limits of 300% and 50% of original size, respectively.
|
16920 | *
|
16921 | * > **NOTE**: The zoom policy at the Chromium level is same-origin, meaning that
|
16922 | * the zoom level for a specific domain propagates across all instances of windows
|
16923 | * with the same domain. Differentiating the window URLs will make zoom work
|
16924 | * per-window.
|
16925 | */
|
16926 | setZoomLevel(level: number): void;
|
16927 | /**
|
16928 | * A `WebFrame | null` representing the first child frame of `webFrame`, the
|
16929 | * property would be `null` if `webFrame` has no children or if first child is not
|
16930 | * in the current renderer process.
|
16931 | *
|
16932 | */
|
16933 | readonly firstChild: (WebFrame) | (null);
|
16934 | /**
|
16935 | * A `WebFrame | null` representing next sibling frame, the property would be
|
16936 | * `null` if `webFrame` is the last frame in its parent or if the next sibling is
|
16937 | * not in the current renderer process.
|
16938 | *
|
16939 | */
|
16940 | readonly nextSibling: (WebFrame) | (null);
|
16941 | /**
|
16942 | * A `WebFrame | null` representing the frame which opened `webFrame`, the property
|
16943 | * would be `null` if there's no opener or opener is not in the current renderer
|
16944 | * process.
|
16945 | *
|
16946 | */
|
16947 | readonly opener: (WebFrame) | (null);
|
16948 | /**
|
16949 | * A `WebFrame | null` representing parent frame of `webFrame`, the property would
|
16950 | * be `null` if `webFrame` is top or parent is not in the current renderer process.
|
16951 | *
|
16952 | */
|
16953 | readonly parent: (WebFrame) | (null);
|
16954 | /**
|
16955 | * An `Integer` representing the unique frame id in the current renderer process.
|
16956 | * Distinct WebFrame instances that refer to the same underlying frame will have
|
16957 | * the same `routingId`.
|
16958 | *
|
16959 | */
|
16960 | readonly routingId: number;
|
16961 | /**
|
16962 | * A `WebFrame | null` representing top frame in frame hierarchy to which
|
16963 | * `webFrame` belongs, the property would be `null` if top frame is not in the
|
16964 | * current renderer process.
|
16965 | *
|
16966 | */
|
16967 | readonly top: (WebFrame) | (null);
|
16968 | }
|
16969 |
|
16970 | class WebFrameMain extends NodeEventEmitter {
|
16971 |
|
16972 | // Docs: https://electronjs.org/docs/api/web-frame-main
|
16973 |
|
16974 | /**
|
16975 | * A frame with the given process and routing IDs, or `undefined` if there is no
|
16976 | * WebFrameMain associated with the given IDs.
|
16977 | */
|
16978 | static fromId(processId: number, routingId: number): (WebFrameMain) | (undefined);
|
16979 | /**
|
16980 | * Emitted when the document is loaded.
|
16981 | */
|
16982 | on(event: 'dom-ready', listener: () => void): this;
|
16983 | off(event: 'dom-ready', listener: () => void): this;
|
16984 | once(event: 'dom-ready', listener: () => void): this;
|
16985 | addListener(event: 'dom-ready', listener: () => void): this;
|
16986 | removeListener(event: 'dom-ready', listener: () => void): this;
|
16987 | /**
|
16988 | * A promise that resolves with the result of the executed code or is rejected if
|
16989 | * execution throws or results in a rejected promise.
|
16990 | *
|
16991 | * Evaluates `code` in page.
|
16992 | *
|
16993 | * In the browser window some HTML APIs like `requestFullScreen` can only be
|
16994 | * invoked by a gesture from the user. Setting `userGesture` to `true` will remove
|
16995 | * this limitation.
|
16996 | */
|
16997 | executeJavaScript(code: string, userGesture?: boolean): Promise<unknown>;
|
16998 | /**
|
16999 | * Send a message to the renderer process, optionally transferring ownership of
|
17000 | * zero or more `MessagePortMain` objects.
|
17001 | *
|
17002 | * The transferred `MessagePortMain` objects will be available in the renderer
|
17003 | * process by accessing the `ports` property of the emitted event. When they arrive
|
17004 | * in the renderer, they will be native DOM `MessagePort` objects.
|
17005 | *
|
17006 | * For example:
|
17007 | */
|
17008 | postMessage(channel: string, message: any, transfer?: MessagePortMain[]): void;
|
17009 | /**
|
17010 | * Whether the reload was initiated successfully. Only results in `false` when the
|
17011 | * frame has no history.
|
17012 | */
|
17013 | reload(): boolean;
|
17014 | /**
|
17015 | * Send an asynchronous message to the renderer process via `channel`, along with
|
17016 | * arguments. Arguments will be serialized with the Structured Clone Algorithm,
|
17017 | * just like `postMessage`, so prototype chains will not be included. Sending
|
17018 | * Functions, Promises, Symbols, WeakMaps, or WeakSets will throw an exception.
|
17019 | *
|
17020 | * The renderer process can handle the message by listening to `channel` with the
|
17021 | * `ipcRenderer` module.
|
17022 | */
|
17023 | send(channel: string, ...args: any[]): void;
|
17024 | /**
|
17025 | * A `WebFrameMain[]` collection containing the direct descendents of `frame`.
|
17026 | *
|
17027 | */
|
17028 | readonly frames: WebFrameMain[];
|
17029 | /**
|
17030 | * A `WebFrameMain[]` collection containing every frame in the subtree of `frame`,
|
17031 | * including itself. This can be useful when traversing through all frames.
|
17032 | *
|
17033 | */
|
17034 | readonly framesInSubtree: WebFrameMain[];
|
17035 | /**
|
17036 | * An `Integer` representing the id of the frame's internal FrameTreeNode instance.
|
17037 | * This id is browser-global and uniquely identifies a frame that hosts content.
|
17038 | * The identifier is fixed at the creation of the frame and stays constant for the
|
17039 | * lifetime of the frame. When the frame is removed, the id is not used again.
|
17040 | *
|
17041 | */
|
17042 | readonly frameTreeNodeId: number;
|
17043 | /**
|
17044 | * An `IpcMain` instance scoped to the frame.
|
17045 | *
|
17046 | * IPC messages sent with `ipcRenderer.send`, `ipcRenderer.sendSync` or
|
17047 | * `ipcRenderer.postMessage` will be delivered in the following order:
|
17048 | *
|
17049 | * * `contents.on('ipc-message')`
|
17050 | * * `contents.mainFrame.on(channel)`
|
17051 | * * `contents.ipc.on(channel)`
|
17052 | * * `ipcMain.on(channel)`
|
17053 | *
|
17054 | * Handlers registered with `invoke` will be checked in the following order. The
|
17055 | * first one that is defined will be called, the rest will be ignored.
|
17056 | *
|
17057 | * * `contents.mainFrame.handle(channel)`
|
17058 | * * `contents.handle(channel)`
|
17059 | * * `ipcMain.handle(channel)`
|
17060 | *
|
17061 | * In most cases, only the main frame of a WebContents can send or receive IPC
|
17062 | * messages. However, if the `nodeIntegrationInSubFrames` option is enabled, it is
|
17063 | * possible for child frames to send and receive IPC messages also. The
|
17064 | * `WebContents.ipc` interface may be more convenient when
|
17065 | * `nodeIntegrationInSubFrames` is not enabled.
|
17066 | *
|
17067 | */
|
17068 | readonly ipc: IpcMain;
|
17069 | /**
|
17070 | * A `string` representing the frame name.
|
17071 | *
|
17072 | */
|
17073 | readonly name: string;
|
17074 | /**
|
17075 | * A `string` representing the current origin of the frame, serialized according to
|
17076 | * RFC 6454. This may be different from the URL. For instance, if the frame is a
|
17077 | * child window opened to `about:blank`, then `frame.origin` will return the parent
|
17078 | * frame's origin, while `frame.url` will return the empty string. Pages without a
|
17079 | * scheme/host/port triple origin will have the serialized origin of `"null"` (that
|
17080 | * is, the string containing the letters n, u, l, l).
|
17081 | *
|
17082 | */
|
17083 | readonly origin: string;
|
17084 | /**
|
17085 | * An `Integer` representing the operating system `pid` of the process which owns
|
17086 | * this frame.
|
17087 | *
|
17088 | */
|
17089 | readonly osProcessId: number;
|
17090 | /**
|
17091 | * A `WebFrameMain | null` representing parent frame of `frame`, the property would
|
17092 | * be `null` if `frame` is the top frame in the frame hierarchy.
|
17093 | *
|
17094 | */
|
17095 | readonly parent: (WebFrameMain) | (null);
|
17096 | /**
|
17097 | * An `Integer` representing the Chromium internal `pid` of the process which owns
|
17098 | * this frame. This is not the same as the OS process ID; to read that use
|
17099 | * `frame.osProcessId`.
|
17100 | *
|
17101 | */
|
17102 | readonly processId: number;
|
17103 | /**
|
17104 | * An `Integer` representing the unique frame id in the current renderer process.
|
17105 | * Distinct `WebFrameMain` instances that refer to the same underlying frame will
|
17106 | * have the same `routingId`.
|
17107 | *
|
17108 | */
|
17109 | readonly routingId: number;
|
17110 | /**
|
17111 | * A `WebFrameMain | null` representing top frame in the frame hierarchy to which
|
17112 | * `frame` belongs.
|
17113 | *
|
17114 | */
|
17115 | readonly top: (WebFrameMain) | (null);
|
17116 | /**
|
17117 | * A `string` representing the current URL of the frame.
|
17118 | *
|
17119 | */
|
17120 | readonly url: string;
|
17121 | /**
|
17122 | * A `string` representing the visibility state of the frame.
|
17123 | *
|
17124 | * See also how the Page Visibility API is affected by other Electron APIs.
|
17125 | *
|
17126 | */
|
17127 | readonly visibilityState: string;
|
17128 | }
|
17129 |
|
17130 | interface WebPreferences {
|
17131 |
|
17132 | // Docs: https://electronjs.org/docs/api/structures/web-preferences
|
17133 |
|
17134 | /**
|
17135 | * An alternative title string provided only to accessibility tools such as screen
|
17136 | * readers. This string is not directly visible to users.
|
17137 | */
|
17138 | accessibleTitle?: string;
|
17139 | /**
|
17140 | * A list of strings that will be appended to `process.argv` in the renderer
|
17141 | * process of this app. Useful for passing small bits of data down to renderer
|
17142 | * process preload scripts.
|
17143 | */
|
17144 | additionalArguments?: string[];
|
17145 | /**
|
17146 | * Allow an https page to run JavaScript, CSS or plugins from http URLs. Default is
|
17147 | * `false`.
|
17148 | */
|
17149 | allowRunningInsecureContent?: boolean;
|
17150 | /**
|
17151 | * Autoplay policy to apply to content in the window, can be
|
17152 | * `no-user-gesture-required`, `user-gesture-required`,
|
17153 | * `document-user-activation-required`. Defaults to `no-user-gesture-required`.
|
17154 | */
|
17155 | autoplayPolicy?: ('no-user-gesture-required' | 'user-gesture-required' | 'document-user-activation-required');
|
17156 | /**
|
17157 | * Whether to throttle animations and timers when the page becomes background. This
|
17158 | * also affects the Page Visibility API. When at least one webContents displayed in
|
17159 | * a single browserWindow has disabled `backgroundThrottling` then frames will be
|
17160 | * drawn and swapped for the whole window and other webContents displayed by it.
|
17161 | * Defaults to `true`.
|
17162 | */
|
17163 | backgroundThrottling?: boolean;
|
17164 | /**
|
17165 | * Whether to run Electron APIs and the specified `preload` script in a separate
|
17166 | * JavaScript context. Defaults to `true`. The context that the `preload` script
|
17167 | * runs in will only have access to its own dedicated `document` and `window`
|
17168 | * globals, as well as its own set of JavaScript builtins (`Array`, `Object`,
|
17169 | * `JSON`, etc.), which are all invisible to the loaded content. The Electron API
|
17170 | * will only be available in the `preload` script and not the loaded page. This
|
17171 | * option should be used when loading potentially untrusted remote content to
|
17172 | * ensure the loaded content cannot tamper with the `preload` script and any
|
17173 | * Electron APIs being used. This option uses the same technique used by Chrome
|
17174 | * Content Scripts. You can access this context in the dev tools by selecting the
|
17175 | * 'Electron Isolated Context' entry in the combo box at the top of the Console
|
17176 | * tab.
|
17177 | */
|
17178 | contextIsolation?: boolean;
|
17179 | /**
|
17180 | * Defaults to `ISO-8859-1`.
|
17181 | */
|
17182 | defaultEncoding?: string;
|
17183 | /**
|
17184 | * Sets the default font for the font-family.
|
17185 | */
|
17186 | defaultFontFamily?: DefaultFontFamily;
|
17187 | /**
|
17188 | * Defaults to `16`.
|
17189 | */
|
17190 | defaultFontSize?: number;
|
17191 | /**
|
17192 | * Defaults to `13`.
|
17193 | */
|
17194 | defaultMonospaceFontSize?: number;
|
17195 | /**
|
17196 | * Whether to enable DevTools. If it is set to `false`, can not use
|
17197 | * `BrowserWindow.webContents.openDevTools()` to open DevTools. Default is `true`.
|
17198 | */
|
17199 | devTools?: boolean;
|
17200 | /**
|
17201 | * A list of feature strings separated by `,`, like `CSSVariables,KeyboardEventKey`
|
17202 | * to disable. The full list of supported feature strings can be found in the
|
17203 | * RuntimeEnabledFeatures.json5 file.
|
17204 | */
|
17205 | disableBlinkFeatures?: string;
|
17206 | /**
|
17207 | * Whether to disable dialogs completely. Overrides `safeDialogs`. Default is
|
17208 | * `false`.
|
17209 | */
|
17210 | disableDialogs?: boolean;
|
17211 | /**
|
17212 | * Whether to prevent the window from resizing when entering HTML Fullscreen.
|
17213 | * Default is `false`.
|
17214 | */
|
17215 | disableHtmlFullscreenWindowResize?: boolean;
|
17216 | /**
|
17217 | * A list of feature strings separated by `,`, like `CSSVariables,KeyboardEventKey`
|
17218 | * to enable. The full list of supported feature strings can be found in the
|
17219 | * RuntimeEnabledFeatures.json5 file.
|
17220 | */
|
17221 | enableBlinkFeatures?: string;
|
17222 | /**
|
17223 | * Whether to enable preferred size mode. The preferred size is the minimum size
|
17224 | * needed to contain the layout of the document—without requiring scrolling.
|
17225 | * Enabling this will cause the `preferred-size-changed` event to be emitted on the
|
17226 | * `WebContents` when the preferred size changes. Default is `false`.
|
17227 | */
|
17228 | enablePreferredSizeMode?: boolean;
|
17229 | /**
|
17230 | * Whether to enable the WebSQL api. Default is `true`.
|
17231 | */
|
17232 | enableWebSQL?: boolean;
|
17233 | /**
|
17234 | * Enables Chromium's experimental features. Default is `false`.
|
17235 | */
|
17236 | experimentalFeatures?: boolean;
|
17237 | /**
|
17238 | * Specifies how to run image animations (E.g. GIFs). Can be `animate`,
|
17239 | * `animateOnce` or `noAnimation`. Default is `animate`.
|
17240 | */
|
17241 | imageAnimationPolicy?: ('animate' | 'animateOnce' | 'noAnimation');
|
17242 | /**
|
17243 | * Enables image support. Default is `true`.
|
17244 | */
|
17245 | images?: boolean;
|
17246 | /**
|
17247 | * Enables JavaScript support. Default is `true`.
|
17248 | */
|
17249 | javascript?: boolean;
|
17250 | /**
|
17251 | * Defaults to `0`.
|
17252 | */
|
17253 | minimumFontSize?: number;
|
17254 | /**
|
17255 | * Whether dragging and dropping a file or link onto the page causes a navigation.
|
17256 | * Default is `false`.
|
17257 | */
|
17258 | navigateOnDragDrop?: boolean;
|
17259 | /**
|
17260 | * Whether node integration is enabled. Default is `false`.
|
17261 | */
|
17262 | nodeIntegration?: boolean;
|
17263 | /**
|
17264 | * Experimental option for enabling Node.js support in sub-frames such as iframes
|
17265 | * and child windows. All your preloads will load for every iframe, you can use
|
17266 | * `process.isMainFrame` to determine if you are in the main frame or not.
|
17267 | */
|
17268 | nodeIntegrationInSubFrames?: boolean;
|
17269 | /**
|
17270 | * Whether node integration is enabled in web workers. Default is `false`. More
|
17271 | * about this can be found in Multithreading.
|
17272 | */
|
17273 | nodeIntegrationInWorker?: boolean;
|
17274 | /**
|
17275 | * Whether to enable offscreen rendering for the browser window. Defaults to
|
17276 | * `false`. See the offscreen rendering tutorial for more details.
|
17277 | */
|
17278 | offscreen?: boolean;
|
17279 | /**
|
17280 | * Sets the session used by the page according to the session's partition string.
|
17281 | * If `partition` starts with `persist:`, the page will use a persistent session
|
17282 | * available to all pages in the app with the same `partition`. If there is no
|
17283 | * `persist:` prefix, the page will use an in-memory session. By assigning the same
|
17284 | * `partition`, multiple pages can share the same session. Default is the default
|
17285 | * session.
|
17286 | */
|
17287 | partition?: string;
|
17288 | /**
|
17289 | * Whether plugins should be enabled. Default is `false`.
|
17290 | */
|
17291 | plugins?: boolean;
|
17292 | /**
|
17293 | * Specifies a script that will be loaded before other scripts run in the page.
|
17294 | * This script will always have access to node APIs no matter whether node
|
17295 | * integration is turned on or off. The value should be the absolute file path to
|
17296 | * the script. When node integration is turned off, the preload script can
|
17297 | * reintroduce Node global symbols back to the global scope. See example here.
|
17298 | */
|
17299 | preload?: string;
|
17300 | /**
|
17301 | * Whether to enable browser style consecutive dialog protection. Default is
|
17302 | * `false`.
|
17303 | */
|
17304 | safeDialogs?: boolean;
|
17305 | /**
|
17306 | * The message to display when consecutive dialog protection is triggered. If not
|
17307 | * defined the default message would be used, note that currently the default
|
17308 | * message is in English and not localized.
|
17309 | */
|
17310 | safeDialogsMessage?: string;
|
17311 | /**
|
17312 | * If set, this will sandbox the renderer associated with the window, making it
|
17313 | * compatible with the Chromium OS-level sandbox and disabling the Node.js engine.
|
17314 | * This is not the same as the `nodeIntegration` option and the APIs available to
|
17315 | * the preload script are more limited. Read more about the option here.
|
17316 | */
|
17317 | sandbox?: boolean;
|
17318 | /**
|
17319 | * Enables scroll bounce (rubber banding) effect on macOS. Default is `false`.
|
17320 | *
|
17321 | * @platform darwin
|
17322 | */
|
17323 | scrollBounce?: boolean;
|
17324 | /**
|
17325 | * Sets the session used by the page. Instead of passing the Session object
|
17326 | * directly, you can also choose to use the `partition` option instead, which
|
17327 | * accepts a partition string. When both `session` and `partition` are provided,
|
17328 | * `session` will be preferred. Default is the default session.
|
17329 | */
|
17330 | session?: Session;
|
17331 | /**
|
17332 | * Whether to enable the builtin spellchecker. Default is `true`.
|
17333 | */
|
17334 | spellcheck?: boolean;
|
17335 | /**
|
17336 | * Make TextArea elements resizable. Default is `true`.
|
17337 | */
|
17338 | textAreasAreResizable?: boolean;
|
17339 | /**
|
17340 | * Whether to enable background transparency for the guest page. Default is `true`.
|
17341 | * **Note:** The guest page's text and background colors are derived from the color
|
17342 | * scheme of its root element. When transparency is enabled, the text color will
|
17343 | * still change accordingly but the background will remain transparent.
|
17344 | */
|
17345 | transparent?: boolean;
|
17346 | /**
|
17347 | * Enforces the v8 code caching policy used by blink. Accepted values are
|
17348 | */
|
17349 | v8CacheOptions?: ('none' | 'code' | 'bypassHeatCheck' | 'bypassHeatCheckAndEagerCompile');
|
17350 | /**
|
17351 | * Enables WebGL support. Default is `true`.
|
17352 | */
|
17353 | webgl?: boolean;
|
17354 | /**
|
17355 | * When `false`, it will disable the same-origin policy (usually using testing
|
17356 | * websites by people), and set `allowRunningInsecureContent` to `true` if this
|
17357 | * options has not been set by user. Default is `true`.
|
17358 | */
|
17359 | webSecurity?: boolean;
|
17360 | /**
|
17361 | * Whether to enable the `<webview>` tag. Defaults to `false`. **Note:** The
|
17362 | * `preload` script configured for the `<webview>` will have node integration
|
17363 | * enabled when it is executed so you should ensure remote/untrusted content is not
|
17364 | * able to create a `<webview>` tag with a possibly malicious `preload` script. You
|
17365 | * can use the `will-attach-webview` event on webContents to strip away the
|
17366 | * `preload` script and to validate or alter the `<webview>`'s initial settings.
|
17367 | */
|
17368 | webviewTag?: boolean;
|
17369 | /**
|
17370 | * The default zoom factor of the page, `3.0` represents `300%`. Default is `1.0`.
|
17371 | */
|
17372 | zoomFactor?: number;
|
17373 | }
|
17374 |
|
17375 | class WebRequest {
|
17376 |
|
17377 | // Docs: https://electronjs.org/docs/api/web-request
|
17378 |
|
17379 | /**
|
17380 | * The `listener` will be called with `listener(details)` when a server initiated
|
17381 | * redirect is about to occur.
|
17382 | */
|
17383 | onBeforeRedirect(filter: WebRequestFilter, listener: ((details: OnBeforeRedirectListenerDetails) => void) | (null)): void;
|
17384 | /**
|
17385 | * The `listener` will be called with `listener(details)` when a server initiated
|
17386 | * redirect is about to occur.
|
17387 | */
|
17388 | onBeforeRedirect(listener: ((details: OnBeforeRedirectListenerDetails) => void) | (null)): void;
|
17389 | /**
|
17390 | * The `listener` will be called with `listener(details, callback)` when a request
|
17391 | * is about to occur.
|
17392 | *
|
17393 | * The `uploadData` is an array of `UploadData` objects.
|
17394 | *
|
17395 | * The `callback` has to be called with an `response` object.
|
17396 | *
|
17397 | * Some examples of valid `urls`:
|
17398 | */
|
17399 | onBeforeRequest(filter: WebRequestFilter, listener: ((details: OnBeforeRequestListenerDetails, callback: (response: CallbackResponse) => void) => void) | (null)): void;
|
17400 | /**
|
17401 | * The `listener` will be called with `listener(details, callback)` when a request
|
17402 | * is about to occur.
|
17403 | *
|
17404 | * The `uploadData` is an array of `UploadData` objects.
|
17405 | *
|
17406 | * The `callback` has to be called with an `response` object.
|
17407 | *
|
17408 | * Some examples of valid `urls`:
|
17409 | */
|
17410 | onBeforeRequest(listener: ((details: OnBeforeRequestListenerDetails, callback: (response: CallbackResponse) => void) => void) | (null)): void;
|
17411 | /**
|
17412 | * The `listener` will be called with `listener(details, callback)` before sending
|
17413 | * an HTTP request, once the request headers are available. This may occur after a
|
17414 | * TCP connection is made to the server, but before any http data is sent.
|
17415 | *
|
17416 | * The `callback` has to be called with a `response` object.
|
17417 | */
|
17418 | onBeforeSendHeaders(filter: WebRequestFilter, listener: ((details: OnBeforeSendHeadersListenerDetails, callback: (beforeSendResponse: BeforeSendResponse) => void) => void) | (null)): void;
|
17419 | /**
|
17420 | * The `listener` will be called with `listener(details, callback)` before sending
|
17421 | * an HTTP request, once the request headers are available. This may occur after a
|
17422 | * TCP connection is made to the server, but before any http data is sent.
|
17423 | *
|
17424 | * The `callback` has to be called with a `response` object.
|
17425 | */
|
17426 | onBeforeSendHeaders(listener: ((details: OnBeforeSendHeadersListenerDetails, callback: (beforeSendResponse: BeforeSendResponse) => void) => void) | (null)): void;
|
17427 | /**
|
17428 | * The `listener` will be called with `listener(details)` when a request is
|
17429 | * completed.
|
17430 | */
|
17431 | onCompleted(filter: WebRequestFilter, listener: ((details: OnCompletedListenerDetails) => void) | (null)): void;
|
17432 | /**
|
17433 | * The `listener` will be called with `listener(details)` when a request is
|
17434 | * completed.
|
17435 | */
|
17436 | onCompleted(listener: ((details: OnCompletedListenerDetails) => void) | (null)): void;
|
17437 | /**
|
17438 | * The `listener` will be called with `listener(details)` when an error occurs.
|
17439 | */
|
17440 | onErrorOccurred(filter: WebRequestFilter, listener: ((details: OnErrorOccurredListenerDetails) => void) | (null)): void;
|
17441 | /**
|
17442 | * The `listener` will be called with `listener(details)` when an error occurs.
|
17443 | */
|
17444 | onErrorOccurred(listener: ((details: OnErrorOccurredListenerDetails) => void) | (null)): void;
|
17445 | /**
|
17446 | * The `listener` will be called with `listener(details, callback)` when HTTP
|
17447 | * response headers of a request have been received.
|
17448 | *
|
17449 | * The `callback` has to be called with a `response` object.
|
17450 | */
|
17451 | onHeadersReceived(filter: WebRequestFilter, listener: ((details: OnHeadersReceivedListenerDetails, callback: (headersReceivedResponse: HeadersReceivedResponse) => void) => void) | (null)): void;
|
17452 | /**
|
17453 | * The `listener` will be called with `listener(details, callback)` when HTTP
|
17454 | * response headers of a request have been received.
|
17455 | *
|
17456 | * The `callback` has to be called with a `response` object.
|
17457 | */
|
17458 | onHeadersReceived(listener: ((details: OnHeadersReceivedListenerDetails, callback: (headersReceivedResponse: HeadersReceivedResponse) => void) => void) | (null)): void;
|
17459 | /**
|
17460 | * The `listener` will be called with `listener(details)` when first byte of the
|
17461 | * response body is received. For HTTP requests, this means that the status line
|
17462 | * and response headers are available.
|
17463 | */
|
17464 | onResponseStarted(filter: WebRequestFilter, listener: ((details: OnResponseStartedListenerDetails) => void) | (null)): void;
|
17465 | /**
|
17466 | * The `listener` will be called with `listener(details)` when first byte of the
|
17467 | * response body is received. For HTTP requests, this means that the status line
|
17468 | * and response headers are available.
|
17469 | */
|
17470 | onResponseStarted(listener: ((details: OnResponseStartedListenerDetails) => void) | (null)): void;
|
17471 | /**
|
17472 | * The `listener` will be called with `listener(details)` just before a request is
|
17473 | * going to be sent to the server, modifications of previous `onBeforeSendHeaders`
|
17474 | * response are visible by the time this listener is fired.
|
17475 | */
|
17476 | onSendHeaders(filter: WebRequestFilter, listener: ((details: OnSendHeadersListenerDetails) => void) | (null)): void;
|
17477 | /**
|
17478 | * The `listener` will be called with `listener(details)` just before a request is
|
17479 | * going to be sent to the server, modifications of previous `onBeforeSendHeaders`
|
17480 | * response are visible by the time this listener is fired.
|
17481 | */
|
17482 | onSendHeaders(listener: ((details: OnSendHeadersListenerDetails) => void) | (null)): void;
|
17483 | }
|
17484 |
|
17485 | interface WebRequestFilter {
|
17486 |
|
17487 | // Docs: https://electronjs.org/docs/api/structures/web-request-filter
|
17488 |
|
17489 | /**
|
17490 | * Array of types that will be used to filter out the requests that do not match
|
17491 | * the types. When not specified, all types will be matched. Can be `mainFrame`,
|
17492 | * `subFrame`, `stylesheet`, `script`, `image`, `font`, `object`, `xhr`, `ping`,
|
17493 | * `cspReport`, `media` or `webSocket`.
|
17494 | */
|
17495 | types?: Array<'mainFrame' | 'subFrame' | 'stylesheet' | 'script' | 'image' | 'font' | 'object' | 'xhr' | 'ping' | 'cspReport' | 'media' | 'webSocket'>;
|
17496 | /**
|
17497 | * Array of URL patterns that will be used to filter out the requests that do not
|
17498 | * match the URL patterns.
|
17499 | */
|
17500 | urls: string[];
|
17501 | }
|
17502 |
|
17503 | interface WebSource {
|
17504 |
|
17505 | // Docs: https://electronjs.org/docs/api/structures/web-source
|
17506 |
|
17507 | code: string;
|
17508 | url?: string;
|
17509 | }
|
17510 |
|
17511 | interface WebUtils {
|
17512 |
|
17513 | // Docs: https://electronjs.org/docs/api/web-utils
|
17514 |
|
17515 | /**
|
17516 | * The file system path that this `File` object points to. In the case where the
|
17517 | * object passed in is not a `File` object an exception is thrown. In the case
|
17518 | * where the File object passed in was constructed in JS and is not backed by a
|
17519 | * file on disk an empty string is returned.
|
17520 | *
|
17521 | * This method superseded the previous augmentation to the `File` object with the
|
17522 | * `path` property. An example is included below.
|
17523 | */
|
17524 | getPathForFile(file: File): string;
|
17525 | }
|
17526 |
|
17527 | interface WebviewTag extends HTMLElement {
|
17528 |
|
17529 | // Docs: https://electronjs.org/docs/api/webview-tag
|
17530 |
|
17531 | /**
|
17532 | * Fired when a load has committed. This includes navigation within the current
|
17533 | * document as well as subframe document-level loads, but does not include
|
17534 | * asynchronous resource loads.
|
17535 | */
|
17536 | addEventListener(event: 'load-commit', listener: (event: LoadCommitEvent) => void, useCapture?: boolean): this;
|
17537 | removeEventListener(event: 'load-commit', listener: (event: LoadCommitEvent) => void): this;
|
17538 | /**
|
17539 | * Fired when the navigation is done, i.e. the spinner of the tab will stop
|
17540 | * spinning, and the `onload` event is dispatched.
|
17541 | */
|
17542 | addEventListener(event: 'did-finish-load', listener: (event: DOMEvent) => void, useCapture?: boolean): this;
|
17543 | removeEventListener(event: 'did-finish-load', listener: (event: DOMEvent) => void): this;
|
17544 | /**
|
17545 | * This event is like `did-finish-load`, but fired when the load failed or was
|
17546 | * cancelled, e.g. `window.stop()` is invoked.
|
17547 | */
|
17548 | addEventListener(event: 'did-fail-load', listener: (event: DidFailLoadEvent) => void, useCapture?: boolean): this;
|
17549 | removeEventListener(event: 'did-fail-load', listener: (event: DidFailLoadEvent) => void): this;
|
17550 | /**
|
17551 | * Fired when a frame has done navigation.
|
17552 | */
|
17553 | addEventListener(event: 'did-frame-finish-load', listener: (event: DidFrameFinishLoadEvent) => void, useCapture?: boolean): this;
|
17554 | removeEventListener(event: 'did-frame-finish-load', listener: (event: DidFrameFinishLoadEvent) => void): this;
|
17555 | /**
|
17556 | * Corresponds to the points in time when the spinner of the tab starts spinning.
|
17557 | */
|
17558 | addEventListener(event: 'did-start-loading', listener: (event: DOMEvent) => void, useCapture?: boolean): this;
|
17559 | removeEventListener(event: 'did-start-loading', listener: (event: DOMEvent) => void): this;
|
17560 | /**
|
17561 | * Corresponds to the points in time when the spinner of the tab stops spinning.
|
17562 | */
|
17563 | addEventListener(event: 'did-stop-loading', listener: (event: DOMEvent) => void, useCapture?: boolean): this;
|
17564 | removeEventListener(event: 'did-stop-loading', listener: (event: DOMEvent) => void): this;
|
17565 | /**
|
17566 | * Fired when attached to the embedder web contents.
|
17567 | */
|
17568 | addEventListener(event: 'did-attach', listener: (event: DOMEvent) => void, useCapture?: boolean): this;
|
17569 | removeEventListener(event: 'did-attach', listener: (event: DOMEvent) => void): this;
|
17570 | /**
|
17571 | * Fired when document in the given frame is loaded.
|
17572 | */
|
17573 | addEventListener(event: 'dom-ready', listener: (event: DOMEvent) => void, useCapture?: boolean): this;
|
17574 | removeEventListener(event: 'dom-ready', listener: (event: DOMEvent) => void): this;
|
17575 | /**
|
17576 | * Fired when page title is set during navigation. `explicitSet` is false when
|
17577 | * title is synthesized from file url.
|
17578 | */
|
17579 | addEventListener(event: 'page-title-updated', listener: (event: PageTitleUpdatedEvent) => void, useCapture?: boolean): this;
|
17580 | removeEventListener(event: 'page-title-updated', listener: (event: PageTitleUpdatedEvent) => void): this;
|
17581 | /**
|
17582 | * Fired when page receives favicon urls.
|
17583 | */
|
17584 | addEventListener(event: 'page-favicon-updated', listener: (event: PageFaviconUpdatedEvent) => void, useCapture?: boolean): this;
|
17585 | removeEventListener(event: 'page-favicon-updated', listener: (event: PageFaviconUpdatedEvent) => void): this;
|
17586 | /**
|
17587 | * Fired when page enters fullscreen triggered by HTML API.
|
17588 | */
|
17589 | addEventListener(event: 'enter-html-full-screen', listener: (event: DOMEvent) => void, useCapture?: boolean): this;
|
17590 | removeEventListener(event: 'enter-html-full-screen', listener: (event: DOMEvent) => void): this;
|
17591 | /**
|
17592 | * Fired when page leaves fullscreen triggered by HTML API.
|
17593 | */
|
17594 | addEventListener(event: 'leave-html-full-screen', listener: (event: DOMEvent) => void, useCapture?: boolean): this;
|
17595 | removeEventListener(event: 'leave-html-full-screen', listener: (event: DOMEvent) => void): this;
|
17596 | /**
|
17597 | * Fired when the guest window logs a console message.
|
17598 | *
|
17599 | * The following example code forwards all log messages to the embedder's console
|
17600 | * without regard for log level or other properties.
|
17601 | */
|
17602 | addEventListener(event: 'console-message', listener: (event: ConsoleMessageEvent) => void, useCapture?: boolean): this;
|
17603 | removeEventListener(event: 'console-message', listener: (event: ConsoleMessageEvent) => void): this;
|
17604 | /**
|
17605 | * Fired when a result is available for `webview.findInPage` request.
|
17606 | */
|
17607 | addEventListener(event: 'found-in-page', listener: (event: FoundInPageEvent) => void, useCapture?: boolean): this;
|
17608 | removeEventListener(event: 'found-in-page', listener: (event: FoundInPageEvent) => void): this;
|
17609 | /**
|
17610 | * Emitted when a user or the page wants to start navigation. It can happen when
|
17611 | * the `window.location` object is changed or a user clicks a link in the page.
|
17612 | *
|
17613 | * This event will not emit when the navigation is started programmatically with
|
17614 | * APIs like `<webview>.loadURL` and `<webview>.back`.
|
17615 | *
|
17616 | * It is also not emitted during in-page navigation, such as clicking anchor links
|
17617 | * or updating the `window.location.hash`. Use `did-navigate-in-page` event for
|
17618 | * this purpose.
|
17619 | *
|
17620 | * Calling `event.preventDefault()` does **NOT** have any effect.
|
17621 | */
|
17622 | addEventListener(event: 'will-navigate', listener: (event: WillNavigateEvent) => void, useCapture?: boolean): this;
|
17623 | removeEventListener(event: 'will-navigate', listener: (event: WillNavigateEvent) => void): this;
|
17624 | /**
|
17625 | * Emitted when a user or the page wants to start navigation anywhere in the
|
17626 | * `<webview>` or any frames embedded within. It can happen when the
|
17627 | * `window.location` object is changed or a user clicks a link in the page.
|
17628 | *
|
17629 | * This event will not emit when the navigation is started programmatically with
|
17630 | * APIs like `<webview>.loadURL` and `<webview>.back`.
|
17631 | *
|
17632 | * It is also not emitted during in-page navigation, such as clicking anchor links
|
17633 | * or updating the `window.location.hash`. Use `did-navigate-in-page` event for
|
17634 | * this purpose.
|
17635 | *
|
17636 | * Calling `event.preventDefault()` does **NOT** have any effect.
|
17637 | */
|
17638 | addEventListener(event: 'will-frame-navigate', listener: (event: WillFrameNavigateEvent) => void, useCapture?: boolean): this;
|
17639 | removeEventListener(event: 'will-frame-navigate', listener: (event: WillFrameNavigateEvent) => void): this;
|
17640 | /**
|
17641 | * Emitted when any frame (including main) starts navigating. `isInPlace` will be
|
17642 | * `true` for in-page navigations.
|
17643 | */
|
17644 | addEventListener(event: 'did-start-navigation', listener: (event: DidStartNavigationEvent) => void, useCapture?: boolean): this;
|
17645 | removeEventListener(event: 'did-start-navigation', listener: (event: DidStartNavigationEvent) => void): this;
|
17646 | /**
|
17647 | * Emitted after a server side redirect occurs during navigation. For example a 302
|
17648 | * redirect.
|
17649 | */
|
17650 | addEventListener(event: 'did-redirect-navigation', listener: (event: DidRedirectNavigationEvent) => void, useCapture?: boolean): this;
|
17651 | removeEventListener(event: 'did-redirect-navigation', listener: (event: DidRedirectNavigationEvent) => void): this;
|
17652 | /**
|
17653 | * Emitted when a navigation is done.
|
17654 | *
|
17655 | * This event is not emitted for in-page navigations, such as clicking anchor links
|
17656 | * or updating the `window.location.hash`. Use `did-navigate-in-page` event for
|
17657 | * this purpose.
|
17658 | */
|
17659 | addEventListener(event: 'did-navigate', listener: (event: DidNavigateEvent) => void, useCapture?: boolean): this;
|
17660 | removeEventListener(event: 'did-navigate', listener: (event: DidNavigateEvent) => void): this;
|
17661 | /**
|
17662 | * Emitted when any frame navigation is done.
|
17663 | *
|
17664 | * This event is not emitted for in-page navigations, such as clicking anchor links
|
17665 | * or updating the `window.location.hash`. Use `did-navigate-in-page` event for
|
17666 | * this purpose.
|
17667 | */
|
17668 | addEventListener(event: 'did-frame-navigate', listener: (event: DidFrameNavigateEvent) => void, useCapture?: boolean): this;
|
17669 | removeEventListener(event: 'did-frame-navigate', listener: (event: DidFrameNavigateEvent) => void): this;
|
17670 | /**
|
17671 | * Emitted when an in-page navigation happened.
|
17672 | *
|
17673 | * When in-page navigation happens, the page URL changes but does not cause
|
17674 | * navigation outside of the page. Examples of this occurring are when anchor links
|
17675 | * are clicked or when the DOM `hashchange` event is triggered.
|
17676 | */
|
17677 | addEventListener(event: 'did-navigate-in-page', listener: (event: DidNavigateInPageEvent) => void, useCapture?: boolean): this;
|
17678 | removeEventListener(event: 'did-navigate-in-page', listener: (event: DidNavigateInPageEvent) => void): this;
|
17679 | /**
|
17680 | * Fired when the guest page attempts to close itself.
|
17681 | *
|
17682 | * The following example code navigates the `webview` to `about:blank` when the
|
17683 | * guest attempts to close itself.
|
17684 | */
|
17685 | addEventListener(event: 'close', listener: (event: DOMEvent) => void, useCapture?: boolean): this;
|
17686 | removeEventListener(event: 'close', listener: (event: DOMEvent) => void): this;
|
17687 | /**
|
17688 | * Fired when the guest page has sent an asynchronous message to embedder page.
|
17689 | *
|
17690 | * With `sendToHost` method and `ipc-message` event you can communicate between
|
17691 | * guest page and embedder page:
|
17692 | */
|
17693 | addEventListener(event: 'ipc-message', listener: (event: IpcMessageEvent) => void, useCapture?: boolean): this;
|
17694 | removeEventListener(event: 'ipc-message', listener: (event: IpcMessageEvent) => void): this;
|
17695 | /**
|
17696 | * Fired when the renderer process unexpectedly disappears. This is normally
|
17697 | * because it was crashed or killed.
|
17698 | */
|
17699 | addEventListener(event: 'render-process-gone', listener: (event: RenderProcessGoneEvent) => void, useCapture?: boolean): this;
|
17700 | removeEventListener(event: 'render-process-gone', listener: (event: RenderProcessGoneEvent) => void): this;
|
17701 | /**
|
17702 | * Fired when a plugin process is crashed.
|
17703 | */
|
17704 | addEventListener(event: 'plugin-crashed', listener: (event: PluginCrashedEvent) => void, useCapture?: boolean): this;
|
17705 | removeEventListener(event: 'plugin-crashed', listener: (event: PluginCrashedEvent) => void): this;
|
17706 | /**
|
17707 | * Fired when the WebContents is destroyed.
|
17708 | */
|
17709 | addEventListener(event: 'destroyed', listener: (event: DOMEvent) => void, useCapture?: boolean): this;
|
17710 | removeEventListener(event: 'destroyed', listener: (event: DOMEvent) => void): this;
|
17711 | /**
|
17712 | * Emitted when media starts playing.
|
17713 | */
|
17714 | addEventListener(event: 'media-started-playing', listener: (event: DOMEvent) => void, useCapture?: boolean): this;
|
17715 | removeEventListener(event: 'media-started-playing', listener: (event: DOMEvent) => void): this;
|
17716 | /**
|
17717 | * Emitted when media is paused or done playing.
|
17718 | */
|
17719 | addEventListener(event: 'media-paused', listener: (event: DOMEvent) => void, useCapture?: boolean): this;
|
17720 | removeEventListener(event: 'media-paused', listener: (event: DOMEvent) => void): this;
|
17721 | /**
|
17722 | * Emitted when a page's theme color changes. This is usually due to encountering a
|
17723 | * meta tag:
|
17724 | */
|
17725 | addEventListener(event: 'did-change-theme-color', listener: (event: DidChangeThemeColorEvent) => void, useCapture?: boolean): this;
|
17726 | removeEventListener(event: 'did-change-theme-color', listener: (event: DidChangeThemeColorEvent) => void): this;
|
17727 | /**
|
17728 | * Emitted when mouse moves over a link or the keyboard moves the focus to a link.
|
17729 | */
|
17730 | addEventListener(event: 'update-target-url', listener: (event: UpdateTargetUrlEvent) => void, useCapture?: boolean): this;
|
17731 | removeEventListener(event: 'update-target-url', listener: (event: UpdateTargetUrlEvent) => void): this;
|
17732 | addEventListener(event: 'devtools-open-url', listener: (event: DevtoolsOpenUrlEvent) => void, useCapture?: boolean): this;
|
17733 | removeEventListener(event: 'devtools-open-url', listener: (event: DevtoolsOpenUrlEvent) => void): this;
|
17734 | /**
|
17735 | * Emitted when 'Search' is selected for text in its context menu.
|
17736 | */
|
17737 | addEventListener(event: 'devtools-search-query', listener: (event: DevtoolsSearchQueryEvent) => void, useCapture?: boolean): this;
|
17738 | removeEventListener(event: 'devtools-search-query', listener: (event: DevtoolsSearchQueryEvent) => void): this;
|
17739 | /**
|
17740 | * Emitted when DevTools is opened.
|
17741 | */
|
17742 | addEventListener(event: 'devtools-opened', listener: (event: DOMEvent) => void, useCapture?: boolean): this;
|
17743 | removeEventListener(event: 'devtools-opened', listener: (event: DOMEvent) => void): this;
|
17744 | /**
|
17745 | * Emitted when DevTools is closed.
|
17746 | */
|
17747 | addEventListener(event: 'devtools-closed', listener: (event: DOMEvent) => void, useCapture?: boolean): this;
|
17748 | removeEventListener(event: 'devtools-closed', listener: (event: DOMEvent) => void): this;
|
17749 | /**
|
17750 | * Emitted when DevTools is focused / opened.
|
17751 | */
|
17752 | addEventListener(event: 'devtools-focused', listener: (event: DOMEvent) => void, useCapture?: boolean): this;
|
17753 | removeEventListener(event: 'devtools-focused', listener: (event: DOMEvent) => void): this;
|
17754 | /**
|
17755 | * Emitted when there is a new context menu that needs to be handled.
|
17756 | */
|
17757 | addEventListener(event: 'context-menu', listener: (event: ContextMenuEvent) => void, useCapture?: boolean): this;
|
17758 | removeEventListener(event: 'context-menu', listener: (event: ContextMenuEvent) => void): this;
|
17759 | addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void;
|
17760 | addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
|
17761 | removeEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture?: boolean): void;
|
17762 | removeEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
|
17763 | /**
|
17764 | * Adjusts the current text selection starting and ending points in the focused
|
17765 | * frame by the given amounts. A negative amount moves the selection towards the
|
17766 | * beginning of the document, and a positive amount moves the selection towards the
|
17767 | * end of the document.
|
17768 | *
|
17769 | * See `webContents.adjustSelection` for examples.
|
17770 | */
|
17771 | adjustSelection(options: AdjustSelectionOptions): void;
|
17772 | /**
|
17773 | * Whether the guest page can go back.
|
17774 | */
|
17775 | canGoBack(): boolean;
|
17776 | /**
|
17777 | * Whether the guest page can go forward.
|
17778 | */
|
17779 | canGoForward(): boolean;
|
17780 | /**
|
17781 | * Whether the guest page can go to `offset`.
|
17782 | */
|
17783 | canGoToOffset(offset: number): boolean;
|
17784 | /**
|
17785 | * Resolves with a NativeImage
|
17786 | *
|
17787 | * Captures a snapshot of the page within `rect`. Omitting `rect` will capture the
|
17788 | * whole visible page.
|
17789 | */
|
17790 | capturePage(rect?: Rectangle): Promise<Electron.NativeImage>;
|
17791 | /**
|
17792 | * Centers the current text selection in page.
|
17793 | */
|
17794 | centerSelection(): void;
|
17795 | /**
|
17796 | * Clears the navigation history.
|
17797 | */
|
17798 | clearHistory(): void;
|
17799 | /**
|
17800 | * Closes the DevTools window of guest page.
|
17801 | */
|
17802 | closeDevTools(): void;
|
17803 | /**
|
17804 | * Executes editing command `copy` in page.
|
17805 | */
|
17806 | copy(): void;
|
17807 | /**
|
17808 | * Executes editing command `cut` in page.
|
17809 | */
|
17810 | cut(): void;
|
17811 | /**
|
17812 | * Executes editing command `delete` in page.
|
17813 | */
|
17814 | delete(): void;
|
17815 | /**
|
17816 | * Initiates a download of the resource at `url` without navigating.
|
17817 | */
|
17818 | downloadURL(url: string, options?: DownloadURLOptions): void;
|
17819 | /**
|
17820 | * A promise that resolves with the result of the executed code or is rejected if
|
17821 | * the result of the code is a rejected promise.
|
17822 | *
|
17823 | * Evaluates `code` in page. If `userGesture` is set, it will create the user
|
17824 | * gesture context in the page. HTML APIs like `requestFullScreen`, which require
|
17825 | * user action, can take advantage of this option for automation.
|
17826 | */
|
17827 | executeJavaScript(code: string, userGesture?: boolean): Promise<any>;
|
17828 | /**
|
17829 | * The request id used for the request.
|
17830 | *
|
17831 | * Starts a request to find all matches for the `text` in the web page. The result
|
17832 | * of the request can be obtained by subscribing to `found-in-page` event.
|
17833 | */
|
17834 | findInPage(text: string, options?: FindInPageOptions): number;
|
17835 | /**
|
17836 | * The title of guest page.
|
17837 | */
|
17838 | getTitle(): string;
|
17839 | /**
|
17840 | * The URL of guest page.
|
17841 | */
|
17842 | getURL(): string;
|
17843 | /**
|
17844 | * The user agent for guest page.
|
17845 | */
|
17846 | getUserAgent(): string;
|
17847 | /**
|
17848 | * The WebContents ID of this `webview`.
|
17849 | */
|
17850 | getWebContentsId(): number;
|
17851 | /**
|
17852 | * the current zoom factor.
|
17853 | */
|
17854 | getZoomFactor(): number;
|
17855 | /**
|
17856 | * the current zoom level.
|
17857 | */
|
17858 | getZoomLevel(): number;
|
17859 | /**
|
17860 | * Makes the guest page go back.
|
17861 | */
|
17862 | goBack(): void;
|
17863 | /**
|
17864 | * Makes the guest page go forward.
|
17865 | */
|
17866 | goForward(): void;
|
17867 | /**
|
17868 | * Navigates to the specified absolute index.
|
17869 | */
|
17870 | goToIndex(index: number): void;
|
17871 | /**
|
17872 | * Navigates to the specified offset from the "current entry".
|
17873 | */
|
17874 | goToOffset(offset: number): void;
|
17875 | /**
|
17876 | * A promise that resolves with a key for the inserted CSS that can later be used
|
17877 | * to remove the CSS via `<webview>.removeInsertedCSS(key)`.
|
17878 | *
|
17879 | * Injects CSS into the current web page and returns a unique key for the inserted
|
17880 | * stylesheet.
|
17881 | */
|
17882 | insertCSS(css: string): Promise<string>;
|
17883 | /**
|
17884 | * Inserts `text` to the focused element.
|
17885 | */
|
17886 | insertText(text: string): Promise<void>;
|
17887 | /**
|
17888 | * Starts inspecting element at position (`x`, `y`) of guest page.
|
17889 | */
|
17890 | inspectElement(x: number, y: number): void;
|
17891 | /**
|
17892 | * Opens the DevTools for the service worker context present in the guest page.
|
17893 | */
|
17894 | inspectServiceWorker(): void;
|
17895 | /**
|
17896 | * Opens the DevTools for the shared worker context present in the guest page.
|
17897 | */
|
17898 | inspectSharedWorker(): void;
|
17899 | /**
|
17900 | * Whether guest page has been muted.
|
17901 | */
|
17902 | isAudioMuted(): boolean;
|
17903 | /**
|
17904 | * Whether the renderer process has crashed.
|
17905 | */
|
17906 | isCrashed(): boolean;
|
17907 | /**
|
17908 | * Whether audio is currently playing.
|
17909 | */
|
17910 | isCurrentlyAudible(): boolean;
|
17911 | /**
|
17912 | * Whether DevTools window of guest page is focused.
|
17913 | */
|
17914 | isDevToolsFocused(): boolean;
|
17915 | /**
|
17916 | * Whether guest page has a DevTools window attached.
|
17917 | */
|
17918 | isDevToolsOpened(): boolean;
|
17919 | /**
|
17920 | * Whether guest page is still loading resources.
|
17921 | */
|
17922 | isLoading(): boolean;
|
17923 | /**
|
17924 | * Whether the main frame (and not just iframes or frames within it) is still
|
17925 | * loading.
|
17926 | */
|
17927 | isLoadingMainFrame(): boolean;
|
17928 | /**
|
17929 | * Whether the guest page is waiting for a first-response for the main resource of
|
17930 | * the page.
|
17931 | */
|
17932 | isWaitingForResponse(): boolean;
|
17933 | /**
|
17934 | * The promise will resolve when the page has finished loading (see
|
17935 | * `did-finish-load`), and rejects if the page fails to load (see `did-fail-load`).
|
17936 | *
|
17937 | * Loads the `url` in the webview, the `url` must contain the protocol prefix, e.g.
|
17938 | * the `http://` or `file://`.
|
17939 | */
|
17940 | loadURL(url: string, options?: LoadURLOptions): Promise<void>;
|
17941 | /**
|
17942 | * Opens a DevTools window for guest page.
|
17943 | */
|
17944 | openDevTools(): void;
|
17945 | /**
|
17946 | * Executes editing command `paste` in page.
|
17947 | */
|
17948 | paste(): void;
|
17949 | /**
|
17950 | * Executes editing command `pasteAndMatchStyle` in page.
|
17951 | */
|
17952 | pasteAndMatchStyle(): void;
|
17953 | /**
|
17954 | * Prints `webview`'s web page. Same as `webContents.print([options])`.
|
17955 | */
|
17956 | print(options?: WebviewTagPrintOptions): Promise<void>;
|
17957 | /**
|
17958 | * Resolves with the generated PDF data.
|
17959 | *
|
17960 | * Prints `webview`'s web page as PDF, Same as `webContents.printToPDF(options)`.
|
17961 | */
|
17962 | printToPDF(options: PrintToPDFOptions): Promise<Uint8Array>;
|
17963 | /**
|
17964 | * Executes editing command `redo` in page.
|
17965 | */
|
17966 | redo(): void;
|
17967 | /**
|
17968 | * Reloads the guest page.
|
17969 | */
|
17970 | reload(): void;
|
17971 | /**
|
17972 | * Reloads the guest page and ignores cache.
|
17973 | */
|
17974 | reloadIgnoringCache(): void;
|
17975 | /**
|
17976 | * Resolves if the removal was successful.
|
17977 | *
|
17978 | * Removes the inserted CSS from the current web page. The stylesheet is identified
|
17979 | * by its key, which is returned from `<webview>.insertCSS(css)`.
|
17980 | */
|
17981 | removeInsertedCSS(key: string): Promise<void>;
|
17982 | /**
|
17983 | * Executes editing command `replace` in page.
|
17984 | */
|
17985 | replace(text: string): void;
|
17986 | /**
|
17987 | * Executes editing command `replaceMisspelling` in page.
|
17988 | */
|
17989 | replaceMisspelling(text: string): void;
|
17990 | /**
|
17991 | * Scrolls to the bottom of the current `<webview>`.
|
17992 | */
|
17993 | scrollToBottom(): void;
|
17994 | /**
|
17995 | * Scrolls to the top of the current `<webview>`.
|
17996 | */
|
17997 | scrollToTop(): void;
|
17998 | /**
|
17999 | * Executes editing command `selectAll` in page.
|
18000 | */
|
18001 | selectAll(): void;
|
18002 | /**
|
18003 | * Send an asynchronous message to renderer process via `channel`, you can also
|
18004 | * send arbitrary arguments. The renderer process can handle the message by
|
18005 | * listening to the `channel` event with the `ipcRenderer` module.
|
18006 | *
|
18007 | * See webContents.send for examples.
|
18008 | */
|
18009 | send(channel: string, ...args: any[]): Promise<void>;
|
18010 | /**
|
18011 | * Sends an input `event` to the page.
|
18012 | *
|
18013 | * See webContents.sendInputEvent for detailed description of `event` object.
|
18014 | */
|
18015 | sendInputEvent(event: (MouseInputEvent) | (MouseWheelInputEvent) | (KeyboardInputEvent)): Promise<void>;
|
18016 | /**
|
18017 | * Send an asynchronous message to renderer process via `channel`, you can also
|
18018 | * send arbitrary arguments. The renderer process can handle the message by
|
18019 | * listening to the `channel` event with the `ipcRenderer` module.
|
18020 | *
|
18021 | * See webContents.sendToFrame for examples.
|
18022 | */
|
18023 | sendToFrame(frameId: [number, number], channel: string, ...args: any[]): Promise<void>;
|
18024 | /**
|
18025 | * Set guest page muted.
|
18026 | */
|
18027 | setAudioMuted(muted: boolean): void;
|
18028 | /**
|
18029 | * Overrides the user agent for the guest page.
|
18030 | */
|
18031 | setUserAgent(userAgent: string): void;
|
18032 | /**
|
18033 | * Sets the maximum and minimum pinch-to-zoom level.
|
18034 | */
|
18035 | setVisualZoomLevelLimits(minimumLevel: number, maximumLevel: number): Promise<void>;
|
18036 | /**
|
18037 | * Changes the zoom factor to the specified factor. Zoom factor is zoom percent
|
18038 | * divided by 100, so 300% = 3.0.
|
18039 | */
|
18040 | setZoomFactor(factor: number): void;
|
18041 | /**
|
18042 | * Changes the zoom level to the specified level. The original size is 0 and each
|
18043 | * increment above or below represents zooming 20% larger or smaller to default
|
18044 | * limits of 300% and 50% of original size, respectively. The formula for this is
|
18045 | * `scale := 1.2 ^ level`.
|
18046 | *
|
18047 | * > **NOTE**: The zoom policy at the Chromium level is same-origin, meaning that
|
18048 | * the zoom level for a specific domain propagates across all instances of windows
|
18049 | * with the same domain. Differentiating the window URLs will make zoom work
|
18050 | * per-window.
|
18051 | */
|
18052 | setZoomLevel(level: number): void;
|
18053 | /**
|
18054 | * Shows pop-up dictionary that searches the selected word on the page.
|
18055 | *
|
18056 | * @platform darwin
|
18057 | */
|
18058 | showDefinitionForSelection(): void;
|
18059 | /**
|
18060 | * Stops any pending navigation.
|
18061 | */
|
18062 | stop(): void;
|
18063 | /**
|
18064 | * Stops any `findInPage` request for the `webview` with the provided `action`.
|
18065 | */
|
18066 | stopFindInPage(action: 'clearSelection' | 'keepSelection' | 'activateSelection'): void;
|
18067 | /**
|
18068 | * Executes editing command `undo` in page.
|
18069 | */
|
18070 | undo(): void;
|
18071 | /**
|
18072 | * Executes editing command `unselect` in page.
|
18073 | */
|
18074 | unselect(): void;
|
18075 | /**
|
18076 | * A `boolean`. When this attribute is present the guest page will be allowed to
|
18077 | * open new windows. Popups are disabled by default.
|
18078 | */
|
18079 | allowpopups: boolean;
|
18080 | /**
|
18081 | * A `string` which is a list of strings which specifies the blink features to be
|
18082 | * disabled separated by `,`. The full list of supported feature strings can be
|
18083 | * found in the RuntimeEnabledFeatures.json5 file.
|
18084 | */
|
18085 | disableblinkfeatures: string;
|
18086 | /**
|
18087 | * A `boolean`. When this attribute is present the guest page will have web
|
18088 | * security disabled. Web security is enabled by default.
|
18089 | *
|
18090 | * This value can only be modified before the first navigation.
|
18091 | */
|
18092 | disablewebsecurity: boolean;
|
18093 | /**
|
18094 | * A `string` which is a list of strings which specifies the blink features to be
|
18095 | * enabled separated by `,`. The full list of supported feature strings can be
|
18096 | * found in the RuntimeEnabledFeatures.json5 file.
|
18097 | */
|
18098 | enableblinkfeatures: string;
|
18099 | /**
|
18100 | * A `string` that sets the referrer URL for the guest page.
|
18101 | */
|
18102 | httpreferrer: string;
|
18103 | /**
|
18104 | * A `boolean`. When this attribute is present the guest page in `webview` will
|
18105 | * have node integration and can use node APIs like `require` and `process` to
|
18106 | * access low level system resources. Node integration is disabled by default in
|
18107 | * the guest page.
|
18108 | */
|
18109 | nodeintegration: boolean;
|
18110 | /**
|
18111 | * A `boolean` for the experimental option for enabling NodeJS support in
|
18112 | * sub-frames such as iframes inside the `webview`. All your preloads will load for
|
18113 | * every iframe, you can use `process.isMainFrame` to determine if you are in the
|
18114 | * main frame or not. This option is disabled by default in the guest page.
|
18115 | */
|
18116 | nodeintegrationinsubframes: boolean;
|
18117 | /**
|
18118 | * A `string` that sets the session used by the page. If `partition` starts with
|
18119 | * `persist:`, the page will use a persistent session available to all pages in the
|
18120 | * app with the same `partition`. if there is no `persist:` prefix, the page will
|
18121 | * use an in-memory session. By assigning the same `partition`, multiple pages can
|
18122 | * share the same session. If the `partition` is unset then default session of the
|
18123 | * app will be used.
|
18124 | *
|
18125 | * This value can only be modified before the first navigation, since the session
|
18126 | * of an active renderer process cannot change. Subsequent attempts to modify the
|
18127 | * value will fail with a DOM exception.
|
18128 | */
|
18129 | partition: string;
|
18130 | /**
|
18131 | * A `boolean`. When this attribute is present the guest page in `webview` will be
|
18132 | * able to use browser plugins. Plugins are disabled by default.
|
18133 | */
|
18134 | plugins: boolean;
|
18135 | /**
|
18136 | * A `string` that specifies a script that will be loaded before other scripts run
|
18137 | * in the guest page. The protocol of script's URL must be `file:` (even when using
|
18138 | * `asar:` archives) because it will be loaded by Node's `require` under the hood,
|
18139 | * which treats `asar:` archives as virtual directories.
|
18140 | *
|
18141 | * When the guest page doesn't have node integration this script will still have
|
18142 | * access to all Node APIs, but global objects injected by Node will be deleted
|
18143 | * after this script has finished executing.
|
18144 | */
|
18145 | preload: string;
|
18146 | /**
|
18147 | * A `string` representing the visible URL. Writing to this attribute initiates
|
18148 | * top-level navigation.
|
18149 | *
|
18150 | * Assigning `src` its own value will reload the current page.
|
18151 | *
|
18152 | * The `src` attribute can also accept data URLs, such as `data:text/plain,Hello,
|
18153 | * world!`.
|
18154 | */
|
18155 | src: string;
|
18156 | /**
|
18157 | * A `string` that sets the user agent for the guest page before the page is
|
18158 | * navigated to. Once the page is loaded, use the `setUserAgent` method to change
|
18159 | * the user agent.
|
18160 | */
|
18161 | useragent: string;
|
18162 | /**
|
18163 | * A `string` which is a comma separated list of strings which specifies the web
|
18164 | * preferences to be set on the webview. The full list of supported preference
|
18165 | * strings can be found in BrowserWindow.
|
18166 | *
|
18167 | * The string follows the same format as the features string in `window.open`. A
|
18168 | * name by itself is given a `true` boolean value. A preference can be set to
|
18169 | * another value by including an `=`, followed by the value. Special values `yes`
|
18170 | * and `1` are interpreted as `true`, while `no` and `0` are interpreted as
|
18171 | * `false`.
|
18172 | */
|
18173 | webpreferences: string;
|
18174 | }
|
18175 |
|
18176 | interface WindowOpenHandlerResponse {
|
18177 |
|
18178 | // Docs: https://electronjs.org/docs/api/structures/window-open-handler-response
|
18179 |
|
18180 | /**
|
18181 | * Can be `allow` or `deny`. Controls whether new window should be created.
|
18182 | */
|
18183 | action: ('allow' | 'deny');
|
18184 | /**
|
18185 | * If specified, will be called instead of `new BrowserWindow` to create the new
|
18186 | * child window and event `did-create-window` will not be emitted. Constructed
|
18187 | * child window should use passed `options` object. This can be used for example to
|
18188 | * have the new window open as a BrowserView instead of in a separate window.
|
18189 | */
|
18190 | createWindow?: (options: BrowserWindowConstructorOptions) => WebContents;
|
18191 | /**
|
18192 | * By default, child windows are closed when their opener is closed. This can be
|
18193 | * changed by specifying `outlivesOpener: true`, in which case the opened window
|
18194 | * will not be closed when its opener is closed.
|
18195 | */
|
18196 | outlivesOpener?: boolean;
|
18197 | /**
|
18198 | * Allows customization of the created window.
|
18199 | */
|
18200 | overrideBrowserWindowOptions?: BrowserWindowConstructorOptions;
|
18201 | }
|
18202 |
|
18203 | interface AboutPanelOptionsOptions {
|
18204 | /**
|
18205 | * The app's name.
|
18206 | */
|
18207 | applicationName?: string;
|
18208 | /**
|
18209 | * The app's version.
|
18210 | */
|
18211 | applicationVersion?: string;
|
18212 | /**
|
18213 | * Copyright information.
|
18214 | */
|
18215 | copyright?: string;
|
18216 | /**
|
18217 | * The app's build version number.
|
18218 | *
|
18219 | * @platform darwin
|
18220 | */
|
18221 | version?: string;
|
18222 | /**
|
18223 | * Credit information.
|
18224 | *
|
18225 | * @platform darwin,win32
|
18226 | */
|
18227 | credits?: string;
|
18228 | /**
|
18229 | * List of app authors.
|
18230 | *
|
18231 | * @platform linux
|
18232 | */
|
18233 | authors?: string[];
|
18234 | /**
|
18235 | * The app's website.
|
18236 | *
|
18237 | * @platform linux
|
18238 | */
|
18239 | website?: string;
|
18240 | /**
|
18241 | * Path to the app's icon in a JPEG or PNG file format. On Linux, will be shown as
|
18242 | * 64x64 pixels while retaining aspect ratio. On Windows, a 48x48 PNG will result
|
18243 | * in the best visual quality.
|
18244 | *
|
18245 | * @platform linux,win32
|
18246 | */
|
18247 | iconPath?: string;
|
18248 | }
|
18249 |
|
18250 | interface AddRepresentationOptions {
|
18251 | /**
|
18252 | * The scale factor to add the image representation for.
|
18253 | */
|
18254 | scaleFactor?: number;
|
18255 | /**
|
18256 | * Defaults to 0. Required if a bitmap buffer is specified as `buffer`.
|
18257 | */
|
18258 | width?: number;
|
18259 | /**
|
18260 | * Defaults to 0. Required if a bitmap buffer is specified as `buffer`.
|
18261 | */
|
18262 | height?: number;
|
18263 | /**
|
18264 | * The buffer containing the raw image data.
|
18265 | */
|
18266 | buffer?: Buffer;
|
18267 | /**
|
18268 | * The data URL containing either a base 64 encoded PNG or JPEG image.
|
18269 | */
|
18270 | dataURL?: string;
|
18271 | }
|
18272 |
|
18273 | interface AdjustSelectionOptions {
|
18274 | /**
|
18275 | * Amount to shift the start index of the current selection.
|
18276 | */
|
18277 | start?: number;
|
18278 | /**
|
18279 | * Amount to shift the end index of the current selection.
|
18280 | */
|
18281 | end?: number;
|
18282 | }
|
18283 |
|
18284 | interface AnimationSettings {
|
18285 | /**
|
18286 | * Returns true if rich animations should be rendered. Looks at session type (e.g.
|
18287 | * remote desktop) and accessibility settings to give guidance for heavy
|
18288 | * animations.
|
18289 | */
|
18290 | shouldRenderRichAnimation: boolean;
|
18291 | /**
|
18292 | * Determines on a per-platform basis whether scroll animations (e.g. produced by
|
18293 | * home/end key) should be enabled.
|
18294 | */
|
18295 | scrollAnimationsEnabledBySystem: boolean;
|
18296 | /**
|
18297 | * Determines whether the user desires reduced motion based on platform APIs.
|
18298 | */
|
18299 | prefersReducedMotion: boolean;
|
18300 | }
|
18301 |
|
18302 | interface AppDetailsOptions {
|
18303 | /**
|
18304 | * Window's App User Model ID. It has to be set, otherwise the other options will
|
18305 | * have no effect.
|
18306 | */
|
18307 | appId?: string;
|
18308 | /**
|
18309 | * Window's Relaunch Icon.
|
18310 | */
|
18311 | appIconPath?: string;
|
18312 | /**
|
18313 | * Index of the icon in `appIconPath`. Ignored when `appIconPath` is not set.
|
18314 | * Default is `0`.
|
18315 | */
|
18316 | appIconIndex?: number;
|
18317 | /**
|
18318 | * Window's Relaunch Command.
|
18319 | */
|
18320 | relaunchCommand?: string;
|
18321 | /**
|
18322 | * Window's Relaunch Display Name.
|
18323 | */
|
18324 | relaunchDisplayName?: string;
|
18325 | }
|
18326 |
|
18327 | interface ApplicationInfoForProtocolReturnValue {
|
18328 | /**
|
18329 | * the display icon of the app handling the protocol.
|
18330 | */
|
18331 | icon: NativeImage;
|
18332 | /**
|
18333 | * installation path of the app handling the protocol.
|
18334 | */
|
18335 | path: string;
|
18336 | /**
|
18337 | * display name of the app handling the protocol.
|
18338 | */
|
18339 | name: string;
|
18340 | }
|
18341 |
|
18342 | interface AuthenticationResponseDetails {
|
18343 | url: string;
|
18344 | pid: number;
|
18345 | }
|
18346 |
|
18347 | interface AuthInfo {
|
18348 | isProxy: boolean;
|
18349 | scheme: string;
|
18350 | host: string;
|
18351 | port: number;
|
18352 | realm: string;
|
18353 | }
|
18354 |
|
18355 | interface AutoResizeOptions {
|
18356 | /**
|
18357 | * If `true`, the view's width will grow and shrink together with the window.
|
18358 | * `false` by default.
|
18359 | */
|
18360 | width?: boolean;
|
18361 | /**
|
18362 | * If `true`, the view's height will grow and shrink together with the window.
|
18363 | * `false` by default.
|
18364 | */
|
18365 | height?: boolean;
|
18366 | /**
|
18367 | * If `true`, the view's x position and width will grow and shrink proportionally
|
18368 | * with the window. `false` by default.
|
18369 | */
|
18370 | horizontal?: boolean;
|
18371 | /**
|
18372 | * If `true`, the view's y position and height will grow and shrink proportionally
|
18373 | * with the window. `false` by default.
|
18374 | */
|
18375 | vertical?: boolean;
|
18376 | }
|
18377 |
|
18378 | interface BeforeSendResponse {
|
18379 | cancel?: boolean;
|
18380 | /**
|
18381 | * When provided, request will be made with these headers.
|
18382 | */
|
18383 | requestHeaders?: Record<string, (string) | (string[])>;
|
18384 | }
|
18385 |
|
18386 | interface BitmapOptions {
|
18387 | /**
|
18388 | * Defaults to 1.0.
|
18389 | */
|
18390 | scaleFactor?: number;
|
18391 | }
|
18392 |
|
18393 | interface BlinkMemoryInfo {
|
18394 | /**
|
18395 | * Size of all allocated objects in Kilobytes.
|
18396 | */
|
18397 | allocated: number;
|
18398 | /**
|
18399 | * Total allocated space in Kilobytes.
|
18400 | */
|
18401 | total: number;
|
18402 | }
|
18403 |
|
18404 | interface BluetoothPairingHandlerHandlerDetails {
|
18405 | deviceId: string;
|
18406 | /**
|
18407 | * The type of pairing prompt being requested. One of the following values:
|
18408 | */
|
18409 | pairingKind: ('confirm' | 'confirmPin' | 'providePin');
|
18410 | frame: WebFrameMain;
|
18411 | /**
|
18412 | * The pin value to verify if `pairingKind` is `confirmPin`.
|
18413 | */
|
18414 | pin?: string;
|
18415 | }
|
18416 |
|
18417 | interface BrowserViewConstructorOptions {
|
18418 | /**
|
18419 | * Settings of web page's features.
|
18420 | */
|
18421 | webPreferences?: WebPreferences;
|
18422 | }
|
18423 |
|
18424 | interface CallbackResponse {
|
18425 | cancel?: boolean;
|
18426 | /**
|
18427 | * The original request is prevented from being sent or completed and is instead
|
18428 | * redirected to the given URL.
|
18429 | */
|
18430 | redirectURL?: string;
|
18431 | }
|
18432 |
|
18433 | interface CertificateTrustDialogOptions {
|
18434 | /**
|
18435 | * The certificate to trust/import.
|
18436 | */
|
18437 | certificate: Certificate;
|
18438 | /**
|
18439 | * The message to display to the user.
|
18440 | */
|
18441 | message: string;
|
18442 | }
|
18443 |
|
18444 | interface ClearCodeCachesOptions {
|
18445 | /**
|
18446 | * An array of url corresponding to the resource whose generated code cache needs
|
18447 | * to be removed. If the list is empty then all entries in the cache directory will
|
18448 | * be removed.
|
18449 | */
|
18450 | urls?: string[];
|
18451 | }
|
18452 |
|
18453 | interface ClearDataOptions {
|
18454 | /**
|
18455 | * The types of data to clear. By default, this will clear all types of data.
|
18456 | */
|
18457 | dataTypes?: Array<'backgroundFetch' | 'cache' | 'cookies' | 'downloads' | 'fileSystems' | 'indexedDB' | 'localStorage' | 'serviceWorkers' | 'webSQL'>;
|
18458 | /**
|
18459 | * Clear data for only these origins. Cannot be used with `excludeOrigins`.
|
18460 | */
|
18461 | origins?: string[];
|
18462 | /**
|
18463 | * Clear data for all origins except these ones. Cannot be used with `origins`.
|
18464 | */
|
18465 | excludeOrigins?: string[];
|
18466 | /**
|
18467 | * Skips deleting cookies that would close current network connections. (Default:
|
18468 | * `false`)
|
18469 | */
|
18470 | avoidClosingConnections?: boolean;
|
18471 | /**
|
18472 | * The behavior for matching data to origins.
|
18473 | */
|
18474 | originMatchingMode?: ('third-parties-included' | 'origin-in-all-contexts');
|
18475 | }
|
18476 |
|
18477 | interface ClearStorageDataOptions {
|
18478 | /**
|
18479 | * Should follow `window.location.origin`’s representation `scheme://host:port`.
|
18480 | */
|
18481 | origin?: string;
|
18482 | /**
|
18483 | * The types of storages to clear, can be `cookies`, `filesystem`, `indexdb`,
|
18484 | * `localstorage`, `shadercache`, `websql`, `serviceworkers`, `cachestorage`. If
|
18485 | * not specified, clear all storage types.
|
18486 | */
|
18487 | storages?: Array<'cookies' | 'filesystem' | 'indexdb' | 'localstorage' | 'shadercache' | 'websql' | 'serviceworkers' | 'cachestorage'>;
|
18488 | /**
|
18489 | * The types of quotas to clear, can be `temporary`, `syncable`. If not specified,
|
18490 | * clear all quotas.
|
18491 | */
|
18492 | quotas?: Array<'temporary' | 'syncable'>;
|
18493 | }
|
18494 |
|
18495 | interface ClientCertRequestParams {
|
18496 | /**
|
18497 | * the hostname of the site requiring a client certificate
|
18498 | */
|
18499 | hostname: string;
|
18500 | /**
|
18501 | * the token (or slot) name of the cryptographic device
|
18502 | */
|
18503 | tokenName: string;
|
18504 | /**
|
18505 | * whether there have been previous failed attempts at prompting the password
|
18506 | */
|
18507 | isRetry: boolean;
|
18508 | }
|
18509 |
|
18510 | interface ClientRequestConstructorOptions {
|
18511 | /**
|
18512 | * The HTTP request method. Defaults to the GET method.
|
18513 | */
|
18514 | method?: string;
|
18515 | /**
|
18516 | * The request URL. Must be provided in the absolute form with the protocol scheme
|
18517 | * specified as http or https.
|
18518 | */
|
18519 | url?: string;
|
18520 | /**
|
18521 | * Headers to be sent with the request.
|
18522 | */
|
18523 | headers?: Record<string, (string) | (string[])>;
|
18524 | /**
|
18525 | * The `Session` instance with which the request is associated.
|
18526 | */
|
18527 | session?: Session;
|
18528 | /**
|
18529 | * The name of the `partition` with which the request is associated. Defaults to
|
18530 | * the empty string. The `session` option supersedes `partition`. Thus if a
|
18531 | * `session` is explicitly specified, `partition` is ignored.
|
18532 | */
|
18533 | partition?: string;
|
18534 | /**
|
18535 | * Can be `include`, `omit` or `same-origin`. Whether to send credentials with this
|
18536 | * request. If set to `include`, credentials from the session associated with the
|
18537 | * request will be used. If set to `omit`, credentials will not be sent with the
|
18538 | * request (and the `'login'` event will not be triggered in the event of a 401).
|
18539 | * If set to `same-origin`, `origin` must also be specified. This matches the
|
18540 | * behavior of the fetch option of the same name. If this option is not specified,
|
18541 | * authentication data from the session will be sent, and cookies will not be sent
|
18542 | * (unless `useSessionCookies` is set).
|
18543 | */
|
18544 | credentials?: ('include' | 'omit' | 'same-origin');
|
18545 | /**
|
18546 | * Whether to send cookies with this request from the provided session. If
|
18547 | * `credentials` is specified, this option has no effect. Default is `false`.
|
18548 | */
|
18549 | useSessionCookies?: boolean;
|
18550 | /**
|
18551 | * Can be `http:` or `https:`. The protocol scheme in the form 'scheme:'. Defaults
|
18552 | * to 'http:'.
|
18553 | */
|
18554 | protocol?: ('http:' | 'https:');
|
18555 | /**
|
18556 | * The server host provided as a concatenation of the hostname and the port number
|
18557 | * 'hostname:port'.
|
18558 | */
|
18559 | host?: string;
|
18560 | /**
|
18561 | * The server host name.
|
18562 | */
|
18563 | hostname?: string;
|
18564 | /**
|
18565 | * The server's listening port number.
|
18566 | */
|
18567 | port?: number;
|
18568 | /**
|
18569 | * The path part of the request URL.
|
18570 | */
|
18571 | path?: string;
|
18572 | /**
|
18573 | * Can be `follow`, `error` or `manual`. The redirect mode for this request. When
|
18574 | * mode is `error`, any redirection will be aborted. When mode is `manual` the
|
18575 | * redirection will be cancelled unless `request.followRedirect` is invoked
|
18576 | * synchronously during the `redirect` event. Defaults to `follow`.
|
18577 | */
|
18578 | redirect?: ('follow' | 'error' | 'manual');
|
18579 | /**
|
18580 | * The origin URL of the request.
|
18581 | */
|
18582 | origin?: string;
|
18583 | /**
|
18584 | * can be "", `no-referrer`, `no-referrer-when-downgrade`, `origin`,
|
18585 | * `origin-when-cross-origin`, `unsafe-url`, `same-origin`, `strict-origin`, or
|
18586 | * `strict-origin-when-cross-origin`. Defaults to
|
18587 | * `strict-origin-when-cross-origin`.
|
18588 | */
|
18589 | referrerPolicy?: ('' | 'no-referrer' | 'no-referrer-when-downgrade' | 'origin' | 'origin-when-cross-origin' | 'unsafe-url' | 'same-origin' | 'strict-origin' | 'strict-origin-when-cross-origin');
|
18590 | /**
|
18591 | * can be `default`, `no-store`, `reload`, `no-cache`, `force-cache` or
|
18592 | * `only-if-cached`.
|
18593 | */
|
18594 | cache?: ('default' | 'no-store' | 'reload' | 'no-cache' | 'force-cache' | 'only-if-cached');
|
18595 | }
|
18596 |
|
18597 | interface CloseOpts {
|
18598 | /**
|
18599 | * if true, fire the `beforeunload` event before closing the page. If the page
|
18600 | * prevents the unload, the WebContents will not be closed. The
|
18601 | * `will-prevent-unload` will be fired if the page requests prevention of unload.
|
18602 | */
|
18603 | waitForBeforeUnload: boolean;
|
18604 | }
|
18605 |
|
18606 | interface Config {
|
18607 | /**
|
18608 | * Can be `tls1`, `tls1.1`, `tls1.2` or `tls1.3`. The minimum SSL version to allow
|
18609 | * when connecting to remote servers. Defaults to `tls1`.
|
18610 | */
|
18611 | minVersion?: ('tls1' | 'tls1.1' | 'tls1.2' | 'tls1.3');
|
18612 | /**
|
18613 | * Can be `tls1.2` or `tls1.3`. The maximum SSL version to allow when connecting to
|
18614 | * remote servers. Defaults to `tls1.3`.
|
18615 | */
|
18616 | maxVersion?: ('tls1.2' | 'tls1.3');
|
18617 | /**
|
18618 | * List of cipher suites which should be explicitly prevented from being used in
|
18619 | * addition to those disabled by the net built-in policy. Supported literal forms:
|
18620 | * 0xAABB, where AA is `cipher_suite[0]` and BB is `cipher_suite[1]`, as defined in
|
18621 | * RFC 2246, Section 7.4.1.2. Unrecognized but parsable cipher suites in this form
|
18622 | * will not return an error. Ex: To disable TLS_RSA_WITH_RC4_128_MD5, specify
|
18623 | * 0x0004, while to disable TLS_ECDH_ECDSA_WITH_RC4_128_SHA, specify 0xC002. Note
|
18624 | * that TLSv1.3 ciphers cannot be disabled using this mechanism.
|
18625 | */
|
18626 | disabledCipherSuites?: number[];
|
18627 | }
|
18628 |
|
18629 | interface ConfigureHostResolverOptions {
|
18630 | /**
|
18631 | * Whether the built-in host resolver is used in preference to getaddrinfo. When
|
18632 | * enabled, the built-in resolver will attempt to use the system's DNS settings to
|
18633 | * do DNS lookups itself. Enabled by default on macOS, disabled by default on
|
18634 | * Windows and Linux.
|
18635 | */
|
18636 | enableBuiltInResolver?: boolean;
|
18637 | /**
|
18638 | * Can be 'off', 'automatic' or 'secure'. Configures the DNS-over-HTTP mode. When
|
18639 | * 'off', no DoH lookups will be performed. When 'automatic', DoH lookups will be
|
18640 | * performed first if DoH is available, and insecure DNS lookups will be performed
|
18641 | * as a fallback. When 'secure', only DoH lookups will be performed. Defaults to
|
18642 | * 'automatic'.
|
18643 | */
|
18644 | secureDnsMode?: ('off' | 'automatic' | 'secure');
|
18645 | /**
|
18646 | * A list of DNS-over-HTTP server templates. See RFC8484 § 3 for details on the
|
18647 | * template format. Most servers support the POST method; the template for such
|
18648 | * servers is simply a URI. Note that for some DNS providers, the resolver will
|
18649 | * automatically upgrade to DoH unless DoH is explicitly disabled, even if there
|
18650 | * are no DoH servers provided in this list.
|
18651 | */
|
18652 | secureDnsServers?: string[];
|
18653 | /**
|
18654 | * Controls whether additional DNS query types, e.g. HTTPS (DNS type 65) will be
|
18655 | * allowed besides the traditional A and AAAA queries when a request is being made
|
18656 | * via insecure DNS. Has no effect on Secure DNS which always allows additional
|
18657 | * types. Defaults to true.
|
18658 | */
|
18659 | enableAdditionalDnsQueryTypes?: boolean;
|
18660 | }
|
18661 |
|
18662 | interface ConsoleMessageEvent extends DOMEvent {
|
18663 | /**
|
18664 | * The log level, from 0 to 3. In order it matches `verbose`, `info`, `warning` and
|
18665 | * `error`.
|
18666 | */
|
18667 | level: number;
|
18668 | /**
|
18669 | * The actual console message
|
18670 | */
|
18671 | message: string;
|
18672 | /**
|
18673 | * The line number of the source that triggered this console message
|
18674 | */
|
18675 | line: number;
|
18676 | sourceId: string;
|
18677 | }
|
18678 |
|
18679 | interface ContextMenuEvent extends DOMEvent {
|
18680 | params: Params;
|
18681 | }
|
18682 |
|
18683 | interface ContextMenuParams {
|
18684 | /**
|
18685 | * x coordinate.
|
18686 | */
|
18687 | x: number;
|
18688 | /**
|
18689 | * y coordinate.
|
18690 | */
|
18691 | y: number;
|
18692 | /**
|
18693 | * Frame from which the context menu was invoked.
|
18694 | */
|
18695 | frame: WebFrameMain;
|
18696 | /**
|
18697 | * URL of the link that encloses the node the context menu was invoked on.
|
18698 | */
|
18699 | linkURL: string;
|
18700 | /**
|
18701 | * Text associated with the link. May be an empty string if the contents of the
|
18702 | * link are an image.
|
18703 | */
|
18704 | linkText: string;
|
18705 | /**
|
18706 | * URL of the top level page that the context menu was invoked on.
|
18707 | */
|
18708 | pageURL: string;
|
18709 | /**
|
18710 | * URL of the subframe that the context menu was invoked on.
|
18711 | */
|
18712 | frameURL: string;
|
18713 | /**
|
18714 | * Source URL for the element that the context menu was invoked on. Elements with
|
18715 | * source URLs are images, audio and video.
|
18716 | */
|
18717 | srcURL: string;
|
18718 | /**
|
18719 | * Type of the node the context menu was invoked on. Can be `none`, `image`,
|
18720 | * `audio`, `video`, `canvas`, `file` or `plugin`.
|
18721 | */
|
18722 | mediaType: ('none' | 'image' | 'audio' | 'video' | 'canvas' | 'file' | 'plugin');
|
18723 | /**
|
18724 | * Whether the context menu was invoked on an image which has non-empty contents.
|
18725 | */
|
18726 | hasImageContents: boolean;
|
18727 | /**
|
18728 | * Whether the context is editable.
|
18729 | */
|
18730 | isEditable: boolean;
|
18731 | /**
|
18732 | * Text of the selection that the context menu was invoked on.
|
18733 | */
|
18734 | selectionText: string;
|
18735 | /**
|
18736 | * Title text of the selection that the context menu was invoked on.
|
18737 | */
|
18738 | titleText: string;
|
18739 | /**
|
18740 | * Alt text of the selection that the context menu was invoked on.
|
18741 | */
|
18742 | altText: string;
|
18743 | /**
|
18744 | * Suggested filename to be used when saving file through 'Save Link As' option of
|
18745 | * context menu.
|
18746 | */
|
18747 | suggestedFilename: string;
|
18748 | /**
|
18749 | * Rect representing the coordinates in the document space of the selection.
|
18750 | */
|
18751 | selectionRect: Rectangle;
|
18752 | /**
|
18753 | * Start position of the selection text.
|
18754 | */
|
18755 | selectionStartOffset: number;
|
18756 | /**
|
18757 | * The referrer policy of the frame on which the menu is invoked.
|
18758 | */
|
18759 | referrerPolicy: Referrer;
|
18760 | /**
|
18761 | * The misspelled word under the cursor, if any.
|
18762 | */
|
18763 | misspelledWord: string;
|
18764 | /**
|
18765 | * An array of suggested words to show the user to replace the `misspelledWord`.
|
18766 | * Only available if there is a misspelled word and spellchecker is enabled.
|
18767 | */
|
18768 | dictionarySuggestions: string[];
|
18769 | /**
|
18770 | * The character encoding of the frame on which the menu was invoked.
|
18771 | */
|
18772 | frameCharset: string;
|
18773 | /**
|
18774 | * The source that the context menu was invoked on. Possible values include `none`,
|
18775 | * `button-button`, `field-set`, `input-button`, `input-checkbox`, `input-color`,
|
18776 | * `input-date`, `input-datetime-local`, `input-email`, `input-file`,
|
18777 | * `input-hidden`, `input-image`, `input-month`, `input-number`, `input-password`,
|
18778 | * `input-radio`, `input-range`, `input-reset`, `input-search`, `input-submit`,
|
18779 | * `input-telephone`, `input-text`, `input-time`, `input-url`, `input-week`,
|
18780 | * `output`, `reset-button`, `select-list`, `select-list`, `select-multiple`,
|
18781 | * `select-one`, `submit-button`, and `text-area`,
|
18782 | */
|
18783 | formControlType: ('none' | 'button-button' | 'field-set' | 'input-button' | 'input-checkbox' | 'input-color' | 'input-date' | 'input-datetime-local' | 'input-email' | 'input-file' | 'input-hidden' | 'input-image' | 'input-month' | 'input-number' | 'input-password' | 'input-radio' | 'input-range' | 'input-reset' | 'input-search' | 'input-submit' | 'input-telephone' | 'input-text' | 'input-time' | 'input-url' | 'input-week' | 'output' | 'reset-button' | 'select-list' | 'select-list' | 'select-multiple' | 'select-one' | 'submit-button' | 'text-area');
|
18784 | /**
|
18785 | * If the context is editable, whether or not spellchecking is enabled.
|
18786 | */
|
18787 | spellcheckEnabled: boolean;
|
18788 | /**
|
18789 | * Input source that invoked the context menu. Can be `none`, `mouse`, `keyboard`,
|
18790 | * `touch`, `touchMenu`, `longPress`, `longTap`, `touchHandle`, `stylus`,
|
18791 | * `adjustSelection`, or `adjustSelectionReset`.
|
18792 | */
|
18793 | menuSourceType: ('none' | 'mouse' | 'keyboard' | 'touch' | 'touchMenu' | 'longPress' | 'longTap' | 'touchHandle' | 'stylus' | 'adjustSelection' | 'adjustSelectionReset');
|
18794 | /**
|
18795 | * The flags for the media element the context menu was invoked on.
|
18796 | */
|
18797 | mediaFlags: MediaFlags;
|
18798 | /**
|
18799 | * These flags indicate whether the renderer believes it is able to perform the
|
18800 | * corresponding action.
|
18801 | */
|
18802 | editFlags: EditFlags;
|
18803 | }
|
18804 |
|
18805 | interface ContinueActivityDetails {
|
18806 | /**
|
18807 | * A string identifying the URL of the webpage accessed by the activity on another
|
18808 | * device, if available.
|
18809 | */
|
18810 | webpageURL?: string;
|
18811 | }
|
18812 |
|
18813 | interface CookiesGetFilter {
|
18814 | /**
|
18815 | * Retrieves cookies which are associated with `url`. Empty implies retrieving
|
18816 | * cookies of all URLs.
|
18817 | */
|
18818 | url?: string;
|
18819 | /**
|
18820 | * Filters cookies by name.
|
18821 | */
|
18822 | name?: string;
|
18823 | /**
|
18824 | * Retrieves cookies whose domains match or are subdomains of `domains`.
|
18825 | */
|
18826 | domain?: string;
|
18827 | /**
|
18828 | * Retrieves cookies whose path matches `path`.
|
18829 | */
|
18830 | path?: string;
|
18831 | /**
|
18832 | * Filters cookies by their Secure property.
|
18833 | */
|
18834 | secure?: boolean;
|
18835 | /**
|
18836 | * Filters out session or persistent cookies.
|
18837 | */
|
18838 | session?: boolean;
|
18839 | /**
|
18840 | * Filters cookies by httpOnly.
|
18841 | */
|
18842 | httpOnly?: boolean;
|
18843 | }
|
18844 |
|
18845 | interface CookiesSetDetails {
|
18846 | /**
|
18847 | * The URL to associate the cookie with. The promise will be rejected if the URL is
|
18848 | * invalid.
|
18849 | */
|
18850 | url: string;
|
18851 | /**
|
18852 | * The name of the cookie. Empty by default if omitted.
|
18853 | */
|
18854 | name?: string;
|
18855 | /**
|
18856 | * The value of the cookie. Empty by default if omitted.
|
18857 | */
|
18858 | value?: string;
|
18859 | /**
|
18860 | * The domain of the cookie; this will be normalized with a preceding dot so that
|
18861 | * it's also valid for subdomains. Empty by default if omitted.
|
18862 | */
|
18863 | domain?: string;
|
18864 | /**
|
18865 | * The path of the cookie. Empty by default if omitted.
|
18866 | */
|
18867 | path?: string;
|
18868 | /**
|
18869 | * Whether the cookie should be marked as Secure. Defaults to false unless Same
|
18870 | * Site=None attribute is used.
|
18871 | */
|
18872 | secure?: boolean;
|
18873 | /**
|
18874 | * Whether the cookie should be marked as HTTP only. Defaults to false.
|
18875 | */
|
18876 | httpOnly?: boolean;
|
18877 | /**
|
18878 | * The expiration date of the cookie as the number of seconds since the UNIX epoch.
|
18879 | * If omitted then the cookie becomes a session cookie and will not be retained
|
18880 | * between sessions.
|
18881 | */
|
18882 | expirationDate?: number;
|
18883 | /**
|
18884 | * The Same Site policy to apply to this cookie. Can be `unspecified`,
|
18885 | * `no_restriction`, `lax` or `strict`. Default is `lax`.
|
18886 | */
|
18887 | sameSite?: ('unspecified' | 'no_restriction' | 'lax' | 'strict');
|
18888 | }
|
18889 |
|
18890 | interface CrashReporterStartOptions {
|
18891 | /**
|
18892 | * URL that crash reports will be sent to as POST. Required unless `uploadToServer`
|
18893 | * is `false`.
|
18894 | */
|
18895 | submitURL?: string;
|
18896 | /**
|
18897 | * Defaults to `app.name`.
|
18898 | */
|
18899 | productName?: string;
|
18900 | /**
|
18901 | * Deprecated alias for `{ globalExtra: { _companyName: ... } }`.
|
18902 | *
|
18903 | * @deprecated
|
18904 | */
|
18905 | companyName?: string;
|
18906 | /**
|
18907 | * Whether crash reports should be sent to the server. If false, crash reports will
|
18908 | * be collected and stored in the crashes directory, but not uploaded. Default is
|
18909 | * `true`.
|
18910 | */
|
18911 | uploadToServer?: boolean;
|
18912 | /**
|
18913 | * If true, crashes generated in the main process will not be forwarded to the
|
18914 | * system crash handler. Default is `false`.
|
18915 | */
|
18916 | ignoreSystemCrashHandler?: boolean;
|
18917 | /**
|
18918 | * If true, limit the number of crashes uploaded to 1/hour. Default is `false`.
|
18919 | *
|
18920 | * @platform darwin,win32
|
18921 | */
|
18922 | rateLimit?: boolean;
|
18923 | /**
|
18924 | * If true, crash reports will be compressed and uploaded with `Content-Encoding:
|
18925 | * gzip`. Default is `true`.
|
18926 | */
|
18927 | compress?: boolean;
|
18928 | /**
|
18929 | * Extra string key/value annotations that will be sent along with crash reports
|
18930 | * that are generated in the main process. Only string values are supported.
|
18931 | * Crashes generated in child processes will not contain these extra parameters to
|
18932 | * crash reports generated from child processes, call `addExtraParameter` from the
|
18933 | * child process.
|
18934 | */
|
18935 | extra?: Record<string, string>;
|
18936 | /**
|
18937 | * Extra string key/value annotations that will be sent along with any crash
|
18938 | * reports generated in any process. These annotations cannot be changed once the
|
18939 | * crash reporter has been started. If a key is present in both the global extra
|
18940 | * parameters and the process-specific extra parameters, then the global one will
|
18941 | * take precedence. By default, `productName` and the app version are included, as
|
18942 | * well as the Electron version.
|
18943 | */
|
18944 | globalExtra?: Record<string, string>;
|
18945 | }
|
18946 |
|
18947 | interface CreateFromBitmapOptions {
|
18948 | width: number;
|
18949 | height: number;
|
18950 | /**
|
18951 | * Defaults to 1.0.
|
18952 | */
|
18953 | scaleFactor?: number;
|
18954 | }
|
18955 |
|
18956 | interface CreateFromBufferOptions {
|
18957 | /**
|
18958 | * Required for bitmap buffers.
|
18959 | */
|
18960 | width?: number;
|
18961 | /**
|
18962 | * Required for bitmap buffers.
|
18963 | */
|
18964 | height?: number;
|
18965 | /**
|
18966 | * Defaults to 1.0.
|
18967 | */
|
18968 | scaleFactor?: number;
|
18969 | }
|
18970 |
|
18971 | interface CreateInterruptedDownloadOptions {
|
18972 | /**
|
18973 | * Absolute path of the download.
|
18974 | */
|
18975 | path: string;
|
18976 | /**
|
18977 | * Complete URL chain for the download.
|
18978 | */
|
18979 | urlChain: string[];
|
18980 | mimeType?: string;
|
18981 | /**
|
18982 | * Start range for the download.
|
18983 | */
|
18984 | offset: number;
|
18985 | /**
|
18986 | * Total length of the download.
|
18987 | */
|
18988 | length: number;
|
18989 | /**
|
18990 | * Last-Modified header value.
|
18991 | */
|
18992 | lastModified?: string;
|
18993 | /**
|
18994 | * ETag header value.
|
18995 | */
|
18996 | eTag?: string;
|
18997 | /**
|
18998 | * Time when download was started in number of seconds since UNIX epoch.
|
18999 | */
|
19000 | startTime?: number;
|
19001 | }
|
19002 |
|
19003 | interface Data {
|
19004 | text?: string;
|
19005 | html?: string;
|
19006 | image?: NativeImage;
|
19007 | rtf?: string;
|
19008 | /**
|
19009 | * The title of the URL at `text`.
|
19010 | */
|
19011 | bookmark?: string;
|
19012 | }
|
19013 |
|
19014 | interface DefaultFontFamily {
|
19015 | /**
|
19016 | * Defaults to `Times New Roman`.
|
19017 | */
|
19018 | standard?: string;
|
19019 | /**
|
19020 | * Defaults to `Times New Roman`.
|
19021 | */
|
19022 | serif?: string;
|
19023 | /**
|
19024 | * Defaults to `Arial`.
|
19025 | */
|
19026 | sansSerif?: string;
|
19027 | /**
|
19028 | * Defaults to `Courier New`.
|
19029 | */
|
19030 | monospace?: string;
|
19031 | /**
|
19032 | * Defaults to `Script`.
|
19033 | */
|
19034 | cursive?: string;
|
19035 | /**
|
19036 | * Defaults to `Impact`.
|
19037 | */
|
19038 | fantasy?: string;
|
19039 | /**
|
19040 | * Defaults to `Latin Modern Math`.
|
19041 | */
|
19042 | math?: string;
|
19043 | }
|
19044 |
|
19045 | interface Details {
|
19046 | /**
|
19047 | * Process type. One of the following values:
|
19048 | */
|
19049 | type: ('Utility' | 'Zygote' | 'Sandbox helper' | 'GPU' | 'Pepper Plugin' | 'Pepper Plugin Broker' | 'Unknown');
|
19050 | /**
|
19051 | * The reason the child process is gone. Possible values:
|
19052 | */
|
19053 | reason: ('clean-exit' | 'abnormal-exit' | 'killed' | 'crashed' | 'oom' | 'launch-failed' | 'integrity-failure');
|
19054 | /**
|
19055 | * The exit code for the process (e.g. status from waitpid if on posix, from
|
19056 | * GetExitCodeProcess on Windows).
|
19057 | */
|
19058 | exitCode: number;
|
19059 | /**
|
19060 | * The non-localized name of the process.
|
19061 | */
|
19062 | serviceName?: string;
|
19063 | /**
|
19064 | * The name of the process. Examples for utility: `Audio Service`, `Content
|
19065 | * Decryption Module Service`, `Network Service`, `Video Capture`, etc.
|
19066 | */
|
19067 | name?: string;
|
19068 | }
|
19069 |
|
19070 | interface DevicePermissionHandlerHandlerDetails {
|
19071 | /**
|
19072 | * The type of device that permission is being requested on, can be `hid`,
|
19073 | * `serial`, or `usb`.
|
19074 | */
|
19075 | deviceType: ('hid' | 'serial' | 'usb');
|
19076 | /**
|
19077 | * The origin URL of the device permission check.
|
19078 | */
|
19079 | origin: string;
|
19080 | /**
|
19081 | * the device that permission is being requested for.
|
19082 | */
|
19083 | device: (HIDDevice) | (SerialPort) | (USBDevice);
|
19084 | }
|
19085 |
|
19086 | interface DevtoolsOpenUrlEvent extends DOMEvent {
|
19087 | /**
|
19088 | * URL of the link that was clicked or selected.
|
19089 | */
|
19090 | url: string;
|
19091 | }
|
19092 |
|
19093 | interface DevtoolsSearchQueryEvent extends DOMEvent {
|
19094 | event: Event;
|
19095 | /**
|
19096 | * text to query for.
|
19097 | */
|
19098 | query: string;
|
19099 | }
|
19100 |
|
19101 | interface DidChangeThemeColorEvent extends DOMEvent {
|
19102 | themeColor: string;
|
19103 | }
|
19104 |
|
19105 | interface DidCreateWindowDetails {
|
19106 | /**
|
19107 | * URL for the created window.
|
19108 | */
|
19109 | url: string;
|
19110 | /**
|
19111 | * Name given to the created window in the `window.open()` call.
|
19112 | */
|
19113 | frameName: string;
|
19114 | /**
|
19115 | * The options used to create the BrowserWindow. They are merged in increasing
|
19116 | * precedence: parsed options from the `features` string from `window.open()`,
|
19117 | * security-related webPreferences inherited from the parent, and options given by
|
19118 | * `webContents.setWindowOpenHandler`. Unrecognized options are not filtered out.
|
19119 | */
|
19120 | options: BrowserWindowConstructorOptions;
|
19121 | /**
|
19122 | * The referrer that will be passed to the new window. May or may not result in the
|
19123 | * `Referer` header being sent, depending on the referrer policy.
|
19124 | */
|
19125 | referrer: Referrer;
|
19126 | /**
|
19127 | * The post data that will be sent to the new window, along with the appropriate
|
19128 | * headers that will be set. If no post data is to be sent, the value will be
|
19129 | * `null`. Only defined when the window is being created by a form that set
|
19130 | * `target=_blank`.
|
19131 | */
|
19132 | postBody?: PostBody;
|
19133 | /**
|
19134 | * Can be `default`, `foreground-tab`, `background-tab`, `new-window` or `other`.
|
19135 | */
|
19136 | disposition: ('default' | 'foreground-tab' | 'background-tab' | 'new-window' | 'other');
|
19137 | }
|
19138 |
|
19139 | interface DidFailLoadEvent extends DOMEvent {
|
19140 | errorCode: number;
|
19141 | errorDescription: string;
|
19142 | validatedURL: string;
|
19143 | isMainFrame: boolean;
|
19144 | }
|
19145 |
|
19146 | interface DidFrameFinishLoadEvent extends DOMEvent {
|
19147 | isMainFrame: boolean;
|
19148 | }
|
19149 |
|
19150 | interface DidFrameNavigateEvent extends DOMEvent {
|
19151 | url: string;
|
19152 | /**
|
19153 | * -1 for non HTTP navigations
|
19154 | */
|
19155 | httpResponseCode: number;
|
19156 | /**
|
19157 | * empty for non HTTP navigations,
|
19158 | */
|
19159 | httpStatusText: string;
|
19160 | isMainFrame: boolean;
|
19161 | frameProcessId: number;
|
19162 | frameRoutingId: number;
|
19163 | }
|
19164 |
|
19165 | interface DidNavigateEvent extends DOMEvent {
|
19166 | url: string;
|
19167 | }
|
19168 |
|
19169 | interface DidNavigateInPageEvent extends DOMEvent {
|
19170 | isMainFrame: boolean;
|
19171 | url: string;
|
19172 | }
|
19173 |
|
19174 | interface DidRedirectNavigationEvent extends DOMEvent {
|
19175 | url: string;
|
19176 | isInPlace: boolean;
|
19177 | isMainFrame: boolean;
|
19178 | frameProcessId: number;
|
19179 | frameRoutingId: number;
|
19180 | }
|
19181 |
|
19182 | interface DidStartNavigationEvent extends DOMEvent {
|
19183 | url: string;
|
19184 | isInPlace: boolean;
|
19185 | isMainFrame: boolean;
|
19186 | frameProcessId: number;
|
19187 | frameRoutingId: number;
|
19188 | }
|
19189 |
|
19190 | interface DisplayBalloonOptions {
|
19191 | /**
|
19192 | * Icon to use when `iconType` is `custom`.
|
19193 | */
|
19194 | icon?: (NativeImage) | (string);
|
19195 | /**
|
19196 | * Can be `none`, `info`, `warning`, `error` or `custom`. Default is `custom`.
|
19197 | */
|
19198 | iconType?: ('none' | 'info' | 'warning' | 'error' | 'custom');
|
19199 | title: string;
|
19200 | content: string;
|
19201 | /**
|
19202 | * The large version of the icon should be used. Default is `true`. Maps to
|
19203 | * `NIIF_LARGE_ICON`.
|
19204 | */
|
19205 | largeIcon?: boolean;
|
19206 | /**
|
19207 | * Do not play the associated sound. Default is `false`. Maps to `NIIF_NOSOUND`.
|
19208 | */
|
19209 | noSound?: boolean;
|
19210 | /**
|
19211 | * Do not display the balloon notification if the current user is in "quiet time".
|
19212 | * Default is `false`. Maps to `NIIF_RESPECT_QUIET_TIME`.
|
19213 | */
|
19214 | respectQuietTime?: boolean;
|
19215 | }
|
19216 |
|
19217 | interface DisplayMediaRequestHandlerHandlerRequest {
|
19218 | /**
|
19219 | * Frame that is requesting access to media.
|
19220 | */
|
19221 | frame: WebFrameMain;
|
19222 | /**
|
19223 | * Origin of the page making the request.
|
19224 | */
|
19225 | securityOrigin: string;
|
19226 | /**
|
19227 | * true if the web content requested a video stream.
|
19228 | */
|
19229 | videoRequested: boolean;
|
19230 | /**
|
19231 | * true if the web content requested an audio stream.
|
19232 | */
|
19233 | audioRequested: boolean;
|
19234 | /**
|
19235 | * Whether a user gesture was active when this request was triggered.
|
19236 | */
|
19237 | userGesture: boolean;
|
19238 | }
|
19239 |
|
19240 | interface DisplayMediaRequestHandlerOpts {
|
19241 | /**
|
19242 | * true if the available native system picker should be used. Default is `false`.
|
19243 | * _macOS_ _Experimental_
|
19244 | */
|
19245 | useSystemPicker: boolean;
|
19246 | }
|
19247 |
|
19248 | interface DownloadURLOptions {
|
19249 | /**
|
19250 | * HTTP request headers.
|
19251 | */
|
19252 | headers?: Record<string, string>;
|
19253 | }
|
19254 |
|
19255 | interface EnableNetworkEmulationOptions {
|
19256 | /**
|
19257 | * Whether to emulate network outage. Defaults to false.
|
19258 | */
|
19259 | offline?: boolean;
|
19260 | /**
|
19261 | * RTT in ms. Defaults to 0 which will disable latency throttling.
|
19262 | */
|
19263 | latency?: number;
|
19264 | /**
|
19265 | * Download rate in Bps. Defaults to 0 which will disable download throttling.
|
19266 | */
|
19267 | downloadThroughput?: number;
|
19268 | /**
|
19269 | * Upload rate in Bps. Defaults to 0 which will disable upload throttling.
|
19270 | */
|
19271 | uploadThroughput?: number;
|
19272 | }
|
19273 |
|
19274 | interface FeedURLOptions {
|
19275 | url: string;
|
19276 | /**
|
19277 | * HTTP request headers.
|
19278 | *
|
19279 | * @platform darwin
|
19280 | */
|
19281 | headers?: Record<string, string>;
|
19282 | /**
|
19283 | * Can be `json` or `default`, see the Squirrel.Mac README for more information.
|
19284 | *
|
19285 | * @platform darwin
|
19286 | */
|
19287 | serverType?: ('json' | 'default');
|
19288 | }
|
19289 |
|
19290 | interface FileIconOptions {
|
19291 | size: ('small' | 'normal' | 'large');
|
19292 | }
|
19293 |
|
19294 | interface FileSystemAccessRestrictedDetails {
|
19295 | /**
|
19296 | * The origin that initiated access to the blocked path.
|
19297 | */
|
19298 | origin: string;
|
19299 | /**
|
19300 | * Whether or not the path is a directory.
|
19301 | */
|
19302 | isDirectory: boolean;
|
19303 | /**
|
19304 | * The blocked path attempting to be accessed.
|
19305 | */
|
19306 | path: string;
|
19307 | }
|
19308 |
|
19309 | interface FindInPageOptions {
|
19310 | /**
|
19311 | * Whether to search forward or backward, defaults to `true`.
|
19312 | */
|
19313 | forward?: boolean;
|
19314 | /**
|
19315 | * Whether to begin a new text finding session with this request. Should be `true`
|
19316 | * for initial requests, and `false` for follow-up requests. Defaults to `false`.
|
19317 | */
|
19318 | findNext?: boolean;
|
19319 | /**
|
19320 | * Whether search should be case-sensitive, defaults to `false`.
|
19321 | */
|
19322 | matchCase?: boolean;
|
19323 | }
|
19324 |
|
19325 | interface FocusOptions {
|
19326 | /**
|
19327 | * Make the receiver the active app even if another app is currently active.
|
19328 | *
|
19329 | * @platform darwin
|
19330 | */
|
19331 | steal: boolean;
|
19332 | }
|
19333 |
|
19334 | interface ForkOptions {
|
19335 | /**
|
19336 | * Environment key-value pairs. Default is `process.env`.
|
19337 | */
|
19338 | env?: Env;
|
19339 | /**
|
19340 | * List of string arguments passed to the executable.
|
19341 | */
|
19342 | execArgv?: string[];
|
19343 | /**
|
19344 | * Current working directory of the child process.
|
19345 | */
|
19346 | cwd?: string;
|
19347 | /**
|
19348 | * Allows configuring the mode for `stdout` and `stderr` of the child process.
|
19349 | * Default is `inherit`. String value can be one of `pipe`, `ignore`, `inherit`,
|
19350 | * for more details on these values you can refer to stdio documentation from
|
19351 | * Node.js. Currently this option only supports configuring `stdout` and `stderr`
|
19352 | * to either `pipe`, `inherit` or `ignore`. Configuring `stdin` to any property
|
19353 | * other than `ignore` is not supported and will result in an error. For example,
|
19354 | * the supported values will be processed as following:
|
19355 | */
|
19356 | stdio?: (Array<'pipe' | 'ignore' | 'inherit'>) | (string);
|
19357 | /**
|
19358 | * Name of the process that will appear in `name` property of `ProcessMetric`
|
19359 | * returned by `app.getAppMetrics` and `child-process-gone` event of `app`. Default
|
19360 | * is `Node Utility Process`.
|
19361 | */
|
19362 | serviceName?: string;
|
19363 | /**
|
19364 | * With this flag, the utility process will be launched via the `Electron Helper
|
19365 | * (Plugin).app` helper executable on macOS, which can be codesigned with
|
19366 | * `com.apple.security.cs.disable-library-validation` and
|
19367 | * `com.apple.security.cs.allow-unsigned-executable-memory` entitlements. This will
|
19368 | * allow the utility process to load unsigned libraries. Unless you specifically
|
19369 | * need this capability, it is best to leave this disabled. Default is `false`.
|
19370 | *
|
19371 | * @platform darwin
|
19372 | */
|
19373 | allowLoadingUnsignedLibraries?: boolean;
|
19374 | /**
|
19375 | * With this flag, all HTTP 401 and 407 network requests created via the net module
|
19376 | * will allow responding to them via the `app#login` event in the main process
|
19377 | * instead of the default `login` event on the `ClientRequest` object.
|
19378 | */
|
19379 | respondToAuthRequestsFromMainProcess?: boolean;
|
19380 | }
|
19381 |
|
19382 | interface FoundInPageEvent extends DOMEvent {
|
19383 | result: FoundInPageResult;
|
19384 | }
|
19385 |
|
19386 | interface FrameCreatedDetails {
|
19387 | frame: WebFrameMain;
|
19388 | }
|
19389 |
|
19390 | interface FromPartitionOptions {
|
19391 | /**
|
19392 | * Whether to enable cache.
|
19393 | */
|
19394 | cache: boolean;
|
19395 | }
|
19396 |
|
19397 | interface FromPathOptions {
|
19398 | /**
|
19399 | * Whether to enable cache.
|
19400 | */
|
19401 | cache: boolean;
|
19402 | }
|
19403 |
|
19404 | interface HandlerDetails {
|
19405 | /**
|
19406 | * The _resolved_ version of the URL passed to `window.open()`. e.g. opening a
|
19407 | * window with `window.open('foo')` will yield something like
|
19408 | * `https://the-origin/the/current/path/foo`.
|
19409 | */
|
19410 | url: string;
|
19411 | /**
|
19412 | * Name of the window provided in `window.open()`
|
19413 | */
|
19414 | frameName: string;
|
19415 | /**
|
19416 | * Comma separated list of window features provided to `window.open()`.
|
19417 | */
|
19418 | features: string;
|
19419 | /**
|
19420 | * Can be `default`, `foreground-tab`, `background-tab`, `new-window` or `other`.
|
19421 | */
|
19422 | disposition: ('default' | 'foreground-tab' | 'background-tab' | 'new-window' | 'other');
|
19423 | /**
|
19424 | * The referrer that will be passed to the new window. May or may not result in the
|
19425 | * `Referer` header being sent, depending on the referrer policy.
|
19426 | */
|
19427 | referrer: Referrer;
|
19428 | /**
|
19429 | * The post data that will be sent to the new window, along with the appropriate
|
19430 | * headers that will be set. If no post data is to be sent, the value will be
|
19431 | * `null`. Only defined when the window is being created by a form that set
|
19432 | * `target=_blank`.
|
19433 | */
|
19434 | postBody?: PostBody;
|
19435 | }
|
19436 |
|
19437 | interface HeadersReceivedResponse {
|
19438 | cancel?: boolean;
|
19439 | /**
|
19440 | * When provided, the server is assumed to have responded with these headers.
|
19441 | */
|
19442 | responseHeaders?: Record<string, (string) | (string[])>;
|
19443 | /**
|
19444 | * Should be provided when overriding `responseHeaders` to change header status
|
19445 | * otherwise original response header's status will be used.
|
19446 | */
|
19447 | statusLine?: string;
|
19448 | }
|
19449 |
|
19450 | interface HeapStatistics {
|
19451 | totalHeapSize: number;
|
19452 | totalHeapSizeExecutable: number;
|
19453 | totalPhysicalSize: number;
|
19454 | totalAvailableSize: number;
|
19455 | usedHeapSize: number;
|
19456 | heapSizeLimit: number;
|
19457 | mallocedMemory: number;
|
19458 | peakMallocedMemory: number;
|
19459 | doesZapGarbage: boolean;
|
19460 | }
|
19461 |
|
19462 | interface HidDeviceAddedDetails {
|
19463 | device: HIDDevice;
|
19464 | frame: WebFrameMain;
|
19465 | }
|
19466 |
|
19467 | interface HidDeviceRemovedDetails {
|
19468 | device: HIDDevice;
|
19469 | frame: WebFrameMain;
|
19470 | }
|
19471 |
|
19472 | interface HidDeviceRevokedDetails {
|
19473 | device: HIDDevice;
|
19474 | /**
|
19475 | * The origin that the device has been revoked from.
|
19476 | */
|
19477 | origin?: string;
|
19478 | }
|
19479 |
|
19480 | interface IgnoreMouseEventsOptions {
|
19481 | /**
|
19482 | * If true, forwards mouse move messages to Chromium, enabling mouse related events
|
19483 | * such as `mouseleave`. Only used when `ignore` is true. If `ignore` is false,
|
19484 | * forwarding is always disabled regardless of this value.
|
19485 | *
|
19486 | * @platform darwin,win32
|
19487 | */
|
19488 | forward?: boolean;
|
19489 | }
|
19490 |
|
19491 | interface ImportCertificateOptions {
|
19492 | /**
|
19493 | * Path for the pkcs12 file.
|
19494 | */
|
19495 | certificate: string;
|
19496 | /**
|
19497 | * Passphrase for the certificate.
|
19498 | */
|
19499 | password: string;
|
19500 | }
|
19501 |
|
19502 | interface Info {
|
19503 | /**
|
19504 | * Security origin for the isolated world.
|
19505 | */
|
19506 | securityOrigin?: string;
|
19507 | /**
|
19508 | * Content Security Policy for the isolated world.
|
19509 | */
|
19510 | csp?: string;
|
19511 | /**
|
19512 | * Name for isolated world. Useful in devtools.
|
19513 | */
|
19514 | name?: string;
|
19515 | }
|
19516 |
|
19517 | interface Input {
|
19518 | /**
|
19519 | * Either `keyUp` or `keyDown`.
|
19520 | */
|
19521 | type: string;
|
19522 | /**
|
19523 | * Equivalent to KeyboardEvent.key.
|
19524 | */
|
19525 | key: string;
|
19526 | /**
|
19527 | * Equivalent to KeyboardEvent.code.
|
19528 | */
|
19529 | code: string;
|
19530 | /**
|
19531 | * Equivalent to KeyboardEvent.repeat.
|
19532 | */
|
19533 | isAutoRepeat: boolean;
|
19534 | /**
|
19535 | * Equivalent to KeyboardEvent.isComposing.
|
19536 | */
|
19537 | isComposing: boolean;
|
19538 | /**
|
19539 | * Equivalent to KeyboardEvent.shiftKey.
|
19540 | */
|
19541 | shift: boolean;
|
19542 | /**
|
19543 | * Equivalent to KeyboardEvent.controlKey.
|
19544 | */
|
19545 | control: boolean;
|
19546 | /**
|
19547 | * Equivalent to KeyboardEvent.altKey.
|
19548 | */
|
19549 | alt: boolean;
|
19550 | /**
|
19551 | * Equivalent to KeyboardEvent.metaKey.
|
19552 | */
|
19553 | meta: boolean;
|
19554 | /**
|
19555 | * Equivalent to KeyboardEvent.location.
|
19556 | */
|
19557 | location: number;
|
19558 | /**
|
19559 | * See InputEvent.modifiers.
|
19560 | */
|
19561 | modifiers: string[];
|
19562 | }
|
19563 |
|
19564 | interface InsertCSSOptions {
|
19565 | /**
|
19566 | * Can be 'user' or 'author'. Sets the cascade origin of the inserted stylesheet.
|
19567 | * Default is 'author'.
|
19568 | */
|
19569 | cssOrigin?: ('user' | 'author');
|
19570 | }
|
19571 |
|
19572 | interface IpcMessageEvent extends DOMEvent {
|
19573 | /**
|
19574 | * pair of `[processId, frameId]`.
|
19575 | */
|
19576 | frameId: [number, number];
|
19577 | channel: string;
|
19578 | args: any[];
|
19579 | }
|
19580 |
|
19581 | interface Item {
|
19582 | /**
|
19583 | * The path to the file being dragged.
|
19584 | */
|
19585 | file: string;
|
19586 | /**
|
19587 | * The paths to the files being dragged. (`files` will override `file` field)
|
19588 | */
|
19589 | files?: string[];
|
19590 | /**
|
19591 | * The image must be non-empty on macOS.
|
19592 | */
|
19593 | icon: (NativeImage) | (string);
|
19594 | }
|
19595 |
|
19596 | interface JumpListSettings {
|
19597 | /**
|
19598 | * The minimum number of items that will be shown in the Jump List (for a more
|
19599 | * detailed description of this value see the MSDN docs).
|
19600 | */
|
19601 | minItems: number;
|
19602 | /**
|
19603 | * Array of `JumpListItem` objects that correspond to items that the user has
|
19604 | * explicitly removed from custom categories in the Jump List. These items must not
|
19605 | * be re-added to the Jump List in the **next** call to `app.setJumpList()`,
|
19606 | * Windows will not display any custom category that contains any of the removed
|
19607 | * items.
|
19608 | */
|
19609 | removedItems: JumpListItem[];
|
19610 | }
|
19611 |
|
19612 | interface LoadCommitEvent extends DOMEvent {
|
19613 | url: string;
|
19614 | isMainFrame: boolean;
|
19615 | }
|
19616 |
|
19617 | interface LoadExtensionOptions {
|
19618 | /**
|
19619 | * Whether to allow the extension to read local files over `file://` protocol and
|
19620 | * inject content scripts into `file://` pages. This is required e.g. for loading
|
19621 | * devtools extensions on `file://` URLs. Defaults to false.
|
19622 | */
|
19623 | allowFileAccess: boolean;
|
19624 | }
|
19625 |
|
19626 | interface LoadFileOptions {
|
19627 | /**
|
19628 | * Passed to `url.format()`.
|
19629 | */
|
19630 | query?: Record<string, string>;
|
19631 | /**
|
19632 | * Passed to `url.format()`.
|
19633 | */
|
19634 | search?: string;
|
19635 | /**
|
19636 | * Passed to `url.format()`.
|
19637 | */
|
19638 | hash?: string;
|
19639 | }
|
19640 |
|
19641 | interface LoadURLOptions {
|
19642 | /**
|
19643 | * An HTTP Referrer url.
|
19644 | */
|
19645 | httpReferrer?: (string) | (Referrer);
|
19646 | /**
|
19647 | * A user agent originating the request.
|
19648 | */
|
19649 | userAgent?: string;
|
19650 | /**
|
19651 | * Extra headers separated by "\n"
|
19652 | */
|
19653 | extraHeaders?: string;
|
19654 | postData?: Array<(UploadRawData) | (UploadFile)>;
|
19655 | /**
|
19656 | * Base url (with trailing path separator) for files to be loaded by the data url.
|
19657 | * This is needed only if the specified `url` is a data url and needs to load other
|
19658 | * files.
|
19659 | */
|
19660 | baseURLForDataURL?: string;
|
19661 | }
|
19662 |
|
19663 | interface LoginAuthenticationResponseDetails {
|
19664 | url: string;
|
19665 | }
|
19666 |
|
19667 | interface LoginItemSettings {
|
19668 | /**
|
19669 | * `true` if the app is set to open at login.
|
19670 | */
|
19671 | openAtLogin: boolean;
|
19672 | /**
|
19673 | * `true` if the app is set to open as hidden at login. This does not work on macOS
|
19674 | * 13 and up.
|
19675 | *
|
19676 | * @deprecated
|
19677 | * @platform darwin
|
19678 | */
|
19679 | openAsHidden: boolean;
|
19680 | /**
|
19681 | * `true` if the app was opened at login automatically.
|
19682 | *
|
19683 | * @platform darwin
|
19684 | */
|
19685 | wasOpenedAtLogin: boolean;
|
19686 | /**
|
19687 | * `true` if the app was opened as a hidden login item. This indicates that the app
|
19688 | * should not open any windows at startup. This setting is not available on MAS
|
19689 | * builds or on macOS 13 and up.
|
19690 | *
|
19691 | * @deprecated
|
19692 | * @platform darwin
|
19693 | */
|
19694 | wasOpenedAsHidden: boolean;
|
19695 | /**
|
19696 | * `true` if the app was opened as a login item that should restore the state from
|
19697 | * the previous session. This indicates that the app should restore the windows
|
19698 | * that were open the last time the app was closed. This setting is not available
|
19699 | * on MAS builds or on macOS 13 and up.
|
19700 | *
|
19701 | * @deprecated
|
19702 | * @platform darwin
|
19703 | */
|
19704 | restoreState: boolean;
|
19705 | /**
|
19706 | * can be one of `not-registered`, `enabled`, `requires-approval`, or `not-found`.
|
19707 | *
|
19708 | * @platform darwin
|
19709 | */
|
19710 | status: string;
|
19711 | /**
|
19712 | * `true` if app is set to open at login and its run key is not deactivated. This
|
19713 | * differs from `openAtLogin` as it ignores the `args` option, this property will
|
19714 | * be true if the given executable would be launched at login with **any**
|
19715 | * arguments.
|
19716 | *
|
19717 | * @platform win32
|
19718 | */
|
19719 | executableWillLaunchAtLogin: boolean;
|
19720 | launchItems: LaunchItems[];
|
19721 | }
|
19722 |
|
19723 | interface LoginItemSettingsOptions {
|
19724 | /**
|
19725 | * Can be one of `mainAppService`, `agentService`, `daemonService`, or
|
19726 | * `loginItemService`. Defaults to `mainAppService`. Only available on macOS 13 and
|
19727 | * up. See app.setLoginItemSettings for more information about each type.
|
19728 | *
|
19729 | * @platform darwin
|
19730 | */
|
19731 | type?: string;
|
19732 | /**
|
19733 | * The name of the service. Required if `type` is non-default. Only available on
|
19734 | * macOS 13 and up.
|
19735 | *
|
19736 | * @platform darwin
|
19737 | */
|
19738 | serviceName?: string;
|
19739 | /**
|
19740 | * The executable path to compare against. Defaults to `process.execPath`.
|
19741 | *
|
19742 | * @platform win32
|
19743 | */
|
19744 | path?: string;
|
19745 | /**
|
19746 | * The command-line arguments to compare against. Defaults to an empty array.
|
19747 | *
|
19748 | * @platform win32
|
19749 | */
|
19750 | args?: string[];
|
19751 | }
|
19752 |
|
19753 | interface MenuItemConstructorOptions {
|
19754 | /**
|
19755 | * Will be called with `click(menuItem, window, event)` when the menu item is
|
19756 | * clicked.
|
19757 | */
|
19758 | click?: (menuItem: MenuItem, window: (BaseWindow) | (undefined), event: KeyboardEvent) => void;
|
19759 | /**
|
19760 | * Can be `undo`, `redo`, `cut`, `copy`, `paste`, `pasteAndMatchStyle`, `delete`,
|
19761 | * `selectAll`, `reload`, `forceReload`, `toggleDevTools`, `resetZoom`, `zoomIn`,
|
19762 | * `zoomOut`, `toggleSpellChecker`, `togglefullscreen`, `window`, `minimize`,
|
19763 | * `close`, `help`, `about`, `services`, `hide`, `hideOthers`, `unhide`, `quit`,
|
19764 | * `showSubstitutions`, `toggleSmartQuotes`, `toggleSmartDashes`,
|
19765 | * `toggleTextReplacement`, `startSpeaking`, `stopSpeaking`, `zoom`, `front`,
|
19766 | * `appMenu`, `fileMenu`, `editMenu`, `viewMenu`, `shareMenu`, `recentDocuments`,
|
19767 | * `toggleTabBar`, `selectNextTab`, `selectPreviousTab`, `showAllTabs`,
|
19768 | * `mergeAllWindows`, `clearRecentDocuments`, `moveTabToNewWindow` or `windowMenu`
|
19769 | * - Define the action of the menu item, when specified the `click` property will
|
19770 | * be ignored. See roles.
|
19771 | */
|
19772 | role?: ('undo' | 'redo' | 'cut' | 'copy' | 'paste' | 'pasteAndMatchStyle' | 'delete' | 'selectAll' | 'reload' | 'forceReload' | 'toggleDevTools' | 'resetZoom' | 'zoomIn' | 'zoomOut' | 'toggleSpellChecker' | 'togglefullscreen' | 'window' | 'minimize' | 'close' | 'help' | 'about' | 'services' | 'hide' | 'hideOthers' | 'unhide' | 'quit' | 'showSubstitutions' | 'toggleSmartQuotes' | 'toggleSmartDashes' | 'toggleTextReplacement' | 'startSpeaking' | 'stopSpeaking' | 'zoom' | 'front' | 'appMenu' | 'fileMenu' | 'editMenu' | 'viewMenu' | 'shareMenu' | 'recentDocuments' | 'toggleTabBar' | 'selectNextTab' | 'selectPreviousTab' | 'showAllTabs' | 'mergeAllWindows' | 'clearRecentDocuments' | 'moveTabToNewWindow' | 'windowMenu');
|
19773 | /**
|
19774 | * Can be `normal`, `separator`, `submenu`, `checkbox` or `radio`.
|
19775 | */
|
19776 | type?: ('normal' | 'separator' | 'submenu' | 'checkbox' | 'radio');
|
19777 | label?: string;
|
19778 | sublabel?: string;
|
19779 | /**
|
19780 | * Hover text for this menu item.
|
19781 | *
|
19782 | * @platform darwin
|
19783 | */
|
19784 | toolTip?: string;
|
19785 | accelerator?: Accelerator;
|
19786 | icon?: (NativeImage) | (string);
|
19787 | /**
|
19788 | * If false, the menu item will be greyed out and unclickable.
|
19789 | */
|
19790 | enabled?: boolean;
|
19791 | /**
|
19792 | * default is `true`, and when `false` will prevent the accelerator from triggering
|
19793 | * the item if the item is not visible.
|
19794 | *
|
19795 | * @platform darwin
|
19796 | */
|
19797 | acceleratorWorksWhenHidden?: boolean;
|
19798 | /**
|
19799 | * If false, the menu item will be entirely hidden.
|
19800 | */
|
19801 | visible?: boolean;
|
19802 | /**
|
19803 | * Should only be specified for `checkbox` or `radio` type menu items.
|
19804 | */
|
19805 | checked?: boolean;
|
19806 | /**
|
19807 | * If false, the accelerator won't be registered with the system, but it will still
|
19808 | * be displayed. Defaults to true.
|
19809 | *
|
19810 | * @platform linux,win32
|
19811 | */
|
19812 | registerAccelerator?: boolean;
|
19813 | /**
|
19814 | * The item to share when the `role` is `shareMenu`.
|
19815 | *
|
19816 | * @platform darwin
|
19817 | */
|
19818 | sharingItem?: SharingItem;
|
19819 | /**
|
19820 | * Should be specified for `submenu` type menu items. If `submenu` is specified,
|
19821 | * the `type: 'submenu'` can be omitted. If the value is not a `Menu` then it will
|
19822 | * be automatically converted to one using `Menu.buildFromTemplate`.
|
19823 | */
|
19824 | submenu?: (MenuItemConstructorOptions[]) | (Menu);
|
19825 | /**
|
19826 | * Unique within a single menu. If defined then it can be used as a reference to
|
19827 | * this item by the position attribute.
|
19828 | */
|
19829 | id?: string;
|
19830 | /**
|
19831 | * Inserts this item before the item with the specified id. If the referenced item
|
19832 | * doesn't exist the item will be inserted at the end of the menu. Also implies
|
19833 | * that the menu item in question should be placed in the same “group” as the item.
|
19834 | */
|
19835 | before?: string[];
|
19836 | /**
|
19837 | * Inserts this item after the item with the specified id. If the referenced item
|
19838 | * doesn't exist the item will be inserted at the end of the menu.
|
19839 | */
|
19840 | after?: string[];
|
19841 | /**
|
19842 | * Provides a means for a single context menu to declare the placement of their
|
19843 | * containing group before the containing group of the item with the specified id.
|
19844 | */
|
19845 | beforeGroupContaining?: string[];
|
19846 | /**
|
19847 | * Provides a means for a single context menu to declare the placement of their
|
19848 | * containing group after the containing group of the item with the specified id.
|
19849 | */
|
19850 | afterGroupContaining?: string[];
|
19851 | }
|
19852 |
|
19853 | interface MessageBoxOptions {
|
19854 | /**
|
19855 | * Content of the message box.
|
19856 | */
|
19857 | message: string;
|
19858 | /**
|
19859 | * Can be `none`, `info`, `error`, `question` or `warning`. On Windows, `question`
|
19860 | * displays the same icon as `info`, unless you set an icon using the `icon`
|
19861 | * option. On macOS, both `warning` and `error` display the same warning icon.
|
19862 | */
|
19863 | type?: ('none' | 'info' | 'error' | 'question' | 'warning');
|
19864 | /**
|
19865 | * Array of texts for buttons. On Windows, an empty array will result in one button
|
19866 | * labeled "OK".
|
19867 | */
|
19868 | buttons?: string[];
|
19869 | /**
|
19870 | * Index of the button in the buttons array which will be selected by default when
|
19871 | * the message box opens.
|
19872 | */
|
19873 | defaultId?: number;
|
19874 | /**
|
19875 | * Pass an instance of AbortSignal to optionally close the message box, the message
|
19876 | * box will behave as if it was cancelled by the user. On macOS, `signal` does not
|
19877 | * work with message boxes that do not have a parent window, since those message
|
19878 | * boxes run synchronously due to platform limitations.
|
19879 | */
|
19880 | signal?: AbortSignal;
|
19881 | /**
|
19882 | * Title of the message box, some platforms will not show it.
|
19883 | */
|
19884 | title?: string;
|
19885 | /**
|
19886 | * Extra information of the message.
|
19887 | */
|
19888 | detail?: string;
|
19889 | /**
|
19890 | * If provided, the message box will include a checkbox with the given label.
|
19891 | */
|
19892 | checkboxLabel?: string;
|
19893 | /**
|
19894 | * Initial checked state of the checkbox. `false` by default.
|
19895 | */
|
19896 | checkboxChecked?: boolean;
|
19897 | icon?: (NativeImage) | (string);
|
19898 | /**
|
19899 | * Custom width of the text in the message box.
|
19900 | *
|
19901 | * @platform darwin
|
19902 | */
|
19903 | textWidth?: number;
|
19904 | /**
|
19905 | * The index of the button to be used to cancel the dialog, via the `Esc` key. By
|
19906 | * default this is assigned to the first button with "cancel" or "no" as the label.
|
19907 | * If no such labeled buttons exist and this option is not set, `0` will be used as
|
19908 | * the return value.
|
19909 | */
|
19910 | cancelId?: number;
|
19911 | /**
|
19912 | * On Windows Electron will try to figure out which one of the `buttons` are common
|
19913 | * buttons (like "Cancel" or "Yes"), and show the others as command links in the
|
19914 | * dialog. This can make the dialog appear in the style of modern Windows apps. If
|
19915 | * you don't like this behavior, you can set `noLink` to `true`.
|
19916 | */
|
19917 | noLink?: boolean;
|
19918 | /**
|
19919 | * Normalize the keyboard access keys across platforms. Default is `false`.
|
19920 | * Enabling this assumes `&` is used in the button labels for the placement of the
|
19921 | * keyboard shortcut access key and labels will be converted so they work correctly
|
19922 | * on each platform, `&` characters are removed on macOS, converted to `_` on
|
19923 | * Linux, and left untouched on Windows. For example, a button label of `Vie&w`
|
19924 | * will be converted to `Vie_w` on Linux and `View` on macOS and can be selected
|
19925 | * via `Alt-W` on Windows and Linux.
|
19926 | */
|
19927 | normalizeAccessKeys?: boolean;
|
19928 | }
|
19929 |
|
19930 | interface MessageBoxReturnValue {
|
19931 | /**
|
19932 | * The index of the clicked button.
|
19933 | */
|
19934 | response: number;
|
19935 | /**
|
19936 | * The checked state of the checkbox if `checkboxLabel` was set. Otherwise `false`.
|
19937 | */
|
19938 | checkboxChecked: boolean;
|
19939 | }
|
19940 |
|
19941 | interface MessageBoxSyncOptions {
|
19942 | /**
|
19943 | * Content of the message box.
|
19944 | */
|
19945 | message: string;
|
19946 | /**
|
19947 | * Can be `none`, `info`, `error`, `question` or `warning`. On Windows, `question`
|
19948 | * displays the same icon as `info`, unless you set an icon using the `icon`
|
19949 | * option. On macOS, both `warning` and `error` display the same warning icon.
|
19950 | */
|
19951 | type?: ('none' | 'info' | 'error' | 'question' | 'warning');
|
19952 | /**
|
19953 | * Array of texts for buttons. On Windows, an empty array will result in one button
|
19954 | * labeled "OK".
|
19955 | */
|
19956 | buttons?: string[];
|
19957 | /**
|
19958 | * Index of the button in the buttons array which will be selected by default when
|
19959 | * the message box opens.
|
19960 | */
|
19961 | defaultId?: number;
|
19962 | /**
|
19963 | * Title of the message box, some platforms will not show it.
|
19964 | */
|
19965 | title?: string;
|
19966 | /**
|
19967 | * Extra information of the message.
|
19968 | */
|
19969 | detail?: string;
|
19970 | icon?: (NativeImage) | (string);
|
19971 | /**
|
19972 | * Custom width of the text in the message box.
|
19973 | *
|
19974 | * @platform darwin
|
19975 | */
|
19976 | textWidth?: number;
|
19977 | /**
|
19978 | * The index of the button to be used to cancel the dialog, via the `Esc` key. By
|
19979 | * default this is assigned to the first button with "cancel" or "no" as the label.
|
19980 | * If no such labeled buttons exist and this option is not set, `0` will be used as
|
19981 | * the return value.
|
19982 | */
|
19983 | cancelId?: number;
|
19984 | /**
|
19985 | * On Windows Electron will try to figure out which one of the `buttons` are common
|
19986 | * buttons (like "Cancel" or "Yes"), and show the others as command links in the
|
19987 | * dialog. This can make the dialog appear in the style of modern Windows apps. If
|
19988 | * you don't like this behavior, you can set `noLink` to `true`.
|
19989 | */
|
19990 | noLink?: boolean;
|
19991 | /**
|
19992 | * Normalize the keyboard access keys across platforms. Default is `false`.
|
19993 | * Enabling this assumes `&` is used in the button labels for the placement of the
|
19994 | * keyboard shortcut access key and labels will be converted so they work correctly
|
19995 | * on each platform, `&` characters are removed on macOS, converted to `_` on
|
19996 | * Linux, and left untouched on Windows. For example, a button label of `Vie&w`
|
19997 | * will be converted to `Vie_w` on Linux and `View` on macOS and can be selected
|
19998 | * via `Alt-W` on Windows and Linux.
|
19999 | */
|
20000 | normalizeAccessKeys?: boolean;
|
20001 | }
|
20002 |
|
20003 | interface MessageDetails {
|
20004 | /**
|
20005 | * The actual console message
|
20006 | */
|
20007 | message: string;
|
20008 | /**
|
20009 | * The version ID of the service worker that sent the log message
|
20010 | */
|
20011 | versionId: number;
|
20012 | /**
|
20013 | * The type of source for this message. Can be `javascript`, `xml`, `network`,
|
20014 | * `console-api`, `storage`, `rendering`, `security`, `deprecation`, `worker`,
|
20015 | * `violation`, `intervention`, `recommendation` or `other`.
|
20016 | */
|
20017 | source: ('javascript' | 'xml' | 'network' | 'console-api' | 'storage' | 'rendering' | 'security' | 'deprecation' | 'worker' | 'violation' | 'intervention' | 'recommendation' | 'other');
|
20018 | /**
|
20019 | * The log level, from 0 to 3. In order it matches `verbose`, `info`, `warning` and
|
20020 | * `error`.
|
20021 | */
|
20022 | level: number;
|
20023 | /**
|
20024 | * The URL the message came from
|
20025 | */
|
20026 | sourceUrl: string;
|
20027 | /**
|
20028 | * The line number of the source that triggered this console message
|
20029 | */
|
20030 | lineNumber: number;
|
20031 | }
|
20032 |
|
20033 | interface MessageEvent {
|
20034 | data: any;
|
20035 | ports: MessagePortMain[];
|
20036 | }
|
20037 |
|
20038 | interface MoveToApplicationsFolderOptions {
|
20039 | /**
|
20040 | * A handler for potential conflict in move failure.
|
20041 | */
|
20042 | conflictHandler?: (conflictType: 'exists' | 'existsAndRunning') => boolean;
|
20043 | }
|
20044 |
|
20045 | interface NotificationConstructorOptions {
|
20046 | /**
|
20047 | * A title for the notification, which will be displayed at the top of the
|
20048 | * notification window when it is shown.
|
20049 | */
|
20050 | title?: string;
|
20051 | /**
|
20052 | * A subtitle for the notification, which will be displayed below the title.
|
20053 | *
|
20054 | * @platform darwin
|
20055 | */
|
20056 | subtitle?: string;
|
20057 | /**
|
20058 | * The body text of the notification, which will be displayed below the title or
|
20059 | * subtitle.
|
20060 | */
|
20061 | body?: string;
|
20062 | /**
|
20063 | * Whether or not to suppress the OS notification noise when showing the
|
20064 | * notification.
|
20065 | */
|
20066 | silent?: boolean;
|
20067 | /**
|
20068 | * An icon to use in the notification. If a string is passed, it must be a valid
|
20069 | * path to a local icon file.
|
20070 | */
|
20071 | icon?: (string) | (NativeImage);
|
20072 | /**
|
20073 | * Whether or not to add an inline reply option to the notification.
|
20074 | *
|
20075 | * @platform darwin
|
20076 | */
|
20077 | hasReply?: boolean;
|
20078 | /**
|
20079 | * The timeout duration of the notification. Can be 'default' or 'never'.
|
20080 | *
|
20081 | * @platform linux,win32
|
20082 | */
|
20083 | timeoutType?: ('default' | 'never');
|
20084 | /**
|
20085 | * The placeholder to write in the inline reply input field.
|
20086 | *
|
20087 | * @platform darwin
|
20088 | */
|
20089 | replyPlaceholder?: string;
|
20090 | /**
|
20091 | * The name of the sound file to play when the notification is shown.
|
20092 | *
|
20093 | * @platform darwin
|
20094 | */
|
20095 | sound?: string;
|
20096 | /**
|
20097 | * The urgency level of the notification. Can be 'normal', 'critical', or 'low'.
|
20098 | *
|
20099 | * @platform linux
|
20100 | */
|
20101 | urgency?: ('normal' | 'critical' | 'low');
|
20102 | /**
|
20103 | * Actions to add to the notification. Please read the available actions and
|
20104 | * limitations in the `NotificationAction` documentation.
|
20105 | *
|
20106 | * @platform darwin
|
20107 | */
|
20108 | actions?: NotificationAction[];
|
20109 | /**
|
20110 | * A custom title for the close button of an alert. An empty string will cause the
|
20111 | * default localized text to be used.
|
20112 | *
|
20113 | * @platform darwin
|
20114 | */
|
20115 | closeButtonText?: string;
|
20116 | /**
|
20117 | * A custom description of the Notification on Windows superseding all properties
|
20118 | * above. Provides full customization of design and behavior of the notification.
|
20119 | *
|
20120 | * @platform win32
|
20121 | */
|
20122 | toastXml?: string;
|
20123 | }
|
20124 |
|
20125 | interface OnBeforeRedirectListenerDetails {
|
20126 | id: number;
|
20127 | url: string;
|
20128 | method: string;
|
20129 | webContentsId?: number;
|
20130 | webContents?: WebContents;
|
20131 | frame?: WebFrameMain;
|
20132 | /**
|
20133 | * Can be `mainFrame`, `subFrame`, `stylesheet`, `script`, `image`, `font`,
|
20134 | * `object`, `xhr`, `ping`, `cspReport`, `media`, `webSocket` or `other`.
|
20135 | */
|
20136 | resourceType: ('mainFrame' | 'subFrame' | 'stylesheet' | 'script' | 'image' | 'font' | 'object' | 'xhr' | 'ping' | 'cspReport' | 'media' | 'webSocket' | 'other');
|
20137 | referrer: string;
|
20138 | timestamp: number;
|
20139 | redirectURL: string;
|
20140 | statusCode: number;
|
20141 | statusLine: string;
|
20142 | /**
|
20143 | * The server IP address that the request was actually sent to.
|
20144 | */
|
20145 | ip?: string;
|
20146 | fromCache: boolean;
|
20147 | responseHeaders?: Record<string, string[]>;
|
20148 | }
|
20149 |
|
20150 | interface OnBeforeRequestListenerDetails {
|
20151 | id: number;
|
20152 | url: string;
|
20153 | method: string;
|
20154 | webContentsId?: number;
|
20155 | webContents?: WebContents;
|
20156 | frame?: WebFrameMain;
|
20157 | /**
|
20158 | * Can be `mainFrame`, `subFrame`, `stylesheet`, `script`, `image`, `font`,
|
20159 | * `object`, `xhr`, `ping`, `cspReport`, `media`, `webSocket` or `other`.
|
20160 | */
|
20161 | resourceType: ('mainFrame' | 'subFrame' | 'stylesheet' | 'script' | 'image' | 'font' | 'object' | 'xhr' | 'ping' | 'cspReport' | 'media' | 'webSocket' | 'other');
|
20162 | referrer: string;
|
20163 | timestamp: number;
|
20164 | uploadData: UploadData[];
|
20165 | }
|
20166 |
|
20167 | interface OnBeforeSendHeadersListenerDetails {
|
20168 | id: number;
|
20169 | url: string;
|
20170 | method: string;
|
20171 | webContentsId?: number;
|
20172 | webContents?: WebContents;
|
20173 | frame?: WebFrameMain;
|
20174 | /**
|
20175 | * Can be `mainFrame`, `subFrame`, `stylesheet`, `script`, `image`, `font`,
|
20176 | * `object`, `xhr`, `ping`, `cspReport`, `media`, `webSocket` or `other`.
|
20177 | */
|
20178 | resourceType: ('mainFrame' | 'subFrame' | 'stylesheet' | 'script' | 'image' | 'font' | 'object' | 'xhr' | 'ping' | 'cspReport' | 'media' | 'webSocket' | 'other');
|
20179 | referrer: string;
|
20180 | timestamp: number;
|
20181 | uploadData?: UploadData[];
|
20182 | requestHeaders: Record<string, string>;
|
20183 | }
|
20184 |
|
20185 | interface OnCompletedListenerDetails {
|
20186 | id: number;
|
20187 | url: string;
|
20188 | method: string;
|
20189 | webContentsId?: number;
|
20190 | webContents?: WebContents;
|
20191 | frame?: WebFrameMain;
|
20192 | /**
|
20193 | * Can be `mainFrame`, `subFrame`, `stylesheet`, `script`, `image`, `font`,
|
20194 | * `object`, `xhr`, `ping`, `cspReport`, `media`, `webSocket` or `other`.
|
20195 | */
|
20196 | resourceType: ('mainFrame' | 'subFrame' | 'stylesheet' | 'script' | 'image' | 'font' | 'object' | 'xhr' | 'ping' | 'cspReport' | 'media' | 'webSocket' | 'other');
|
20197 | referrer: string;
|
20198 | timestamp: number;
|
20199 | responseHeaders?: Record<string, string[]>;
|
20200 | fromCache: boolean;
|
20201 | statusCode: number;
|
20202 | statusLine: string;
|
20203 | error: string;
|
20204 | }
|
20205 |
|
20206 | interface OnErrorOccurredListenerDetails {
|
20207 | id: number;
|
20208 | url: string;
|
20209 | method: string;
|
20210 | webContentsId?: number;
|
20211 | webContents?: WebContents;
|
20212 | frame?: WebFrameMain;
|
20213 | /**
|
20214 | * Can be `mainFrame`, `subFrame`, `stylesheet`, `script`, `image`, `font`,
|
20215 | * `object`, `xhr`, `ping`, `cspReport`, `media`, `webSocket` or `other`.
|
20216 | */
|
20217 | resourceType: ('mainFrame' | 'subFrame' | 'stylesheet' | 'script' | 'image' | 'font' | 'object' | 'xhr' | 'ping' | 'cspReport' | 'media' | 'webSocket' | 'other');
|
20218 | referrer: string;
|
20219 | timestamp: number;
|
20220 | fromCache: boolean;
|
20221 | /**
|
20222 | * The error description.
|
20223 | */
|
20224 | error: string;
|
20225 | }
|
20226 |
|
20227 | interface OnHeadersReceivedListenerDetails {
|
20228 | id: number;
|
20229 | url: string;
|
20230 | method: string;
|
20231 | webContentsId?: number;
|
20232 | webContents?: WebContents;
|
20233 | frame?: WebFrameMain;
|
20234 | /**
|
20235 | * Can be `mainFrame`, `subFrame`, `stylesheet`, `script`, `image`, `font`,
|
20236 | * `object`, `xhr`, `ping`, `cspReport`, `media`, `webSocket` or `other`.
|
20237 | */
|
20238 | resourceType: ('mainFrame' | 'subFrame' | 'stylesheet' | 'script' | 'image' | 'font' | 'object' | 'xhr' | 'ping' | 'cspReport' | 'media' | 'webSocket' | 'other');
|
20239 | referrer: string;
|
20240 | timestamp: number;
|
20241 | statusLine: string;
|
20242 | statusCode: number;
|
20243 | responseHeaders?: Record<string, string[]>;
|
20244 | }
|
20245 |
|
20246 | interface OnResponseStartedListenerDetails {
|
20247 | id: number;
|
20248 | url: string;
|
20249 | method: string;
|
20250 | webContentsId?: number;
|
20251 | webContents?: WebContents;
|
20252 | frame?: WebFrameMain;
|
20253 | /**
|
20254 | * Can be `mainFrame`, `subFrame`, `stylesheet`, `script`, `image`, `font`,
|
20255 | * `object`, `xhr`, `ping`, `cspReport`, `media`, `webSocket` or `other`.
|
20256 | */
|
20257 | resourceType: ('mainFrame' | 'subFrame' | 'stylesheet' | 'script' | 'image' | 'font' | 'object' | 'xhr' | 'ping' | 'cspReport' | 'media' | 'webSocket' | 'other');
|
20258 | referrer: string;
|
20259 | timestamp: number;
|
20260 | responseHeaders?: Record<string, string[]>;
|
20261 | /**
|
20262 | * Indicates whether the response was fetched from disk cache.
|
20263 | */
|
20264 | fromCache: boolean;
|
20265 | statusCode: number;
|
20266 | statusLine: string;
|
20267 | }
|
20268 |
|
20269 | interface OnSendHeadersListenerDetails {
|
20270 | id: number;
|
20271 | url: string;
|
20272 | method: string;
|
20273 | webContentsId?: number;
|
20274 | webContents?: WebContents;
|
20275 | frame?: WebFrameMain;
|
20276 | /**
|
20277 | * Can be `mainFrame`, `subFrame`, `stylesheet`, `script`, `image`, `font`,
|
20278 | * `object`, `xhr`, `ping`, `cspReport`, `media`, `webSocket` or `other`.
|
20279 | */
|
20280 | resourceType: ('mainFrame' | 'subFrame' | 'stylesheet' | 'script' | 'image' | 'font' | 'object' | 'xhr' | 'ping' | 'cspReport' | 'media' | 'webSocket' | 'other');
|
20281 | referrer: string;
|
20282 | timestamp: number;
|
20283 | requestHeaders: Record<string, string>;
|
20284 | }
|
20285 |
|
20286 | interface OpenDevToolsOptions {
|
20287 | /**
|
20288 | * Opens the devtools with specified dock state, can be `left`, `right`, `bottom`,
|
20289 | * `undocked`, `detach`. Defaults to last used dock state. In `undocked` mode it's
|
20290 | * possible to dock back. In `detach` mode it's not.
|
20291 | */
|
20292 | mode: ('left' | 'right' | 'bottom' | 'undocked' | 'detach');
|
20293 | /**
|
20294 | * Whether to bring the opened devtools window to the foreground. The default is
|
20295 | * `true`.
|
20296 | */
|
20297 | activate?: boolean;
|
20298 | /**
|
20299 | * A title for the DevTools window (only in `undocked` or `detach` mode).
|
20300 | */
|
20301 | title?: string;
|
20302 | }
|
20303 |
|
20304 | interface OpenDialogOptions {
|
20305 | title?: string;
|
20306 | defaultPath?: string;
|
20307 | /**
|
20308 | * Custom label for the confirmation button, when left empty the default label will
|
20309 | * be used.
|
20310 | */
|
20311 | buttonLabel?: string;
|
20312 | filters?: FileFilter[];
|
20313 | /**
|
20314 | * Contains which features the dialog should use. The following values are
|
20315 | * supported:
|
20316 | */
|
20317 | properties?: Array<'openFile' | 'openDirectory' | 'multiSelections' | 'showHiddenFiles' | 'createDirectory' | 'promptToCreate' | 'noResolveAliases' | 'treatPackageAsDirectory' | 'dontAddToRecent'>;
|
20318 | /**
|
20319 | * Message to display above input boxes.
|
20320 | *
|
20321 | * @platform darwin
|
20322 | */
|
20323 | message?: string;
|
20324 | /**
|
20325 | * Create security scoped bookmarks when packaged for the Mac App Store.
|
20326 | *
|
20327 | * @platform darwin,mas
|
20328 | */
|
20329 | securityScopedBookmarks?: boolean;
|
20330 | }
|
20331 |
|
20332 | interface OpenDialogReturnValue {
|
20333 | /**
|
20334 | * whether or not the dialog was canceled.
|
20335 | */
|
20336 | canceled: boolean;
|
20337 | /**
|
20338 | * An array of file paths chosen by the user. If the dialog is cancelled this will
|
20339 | * be an empty array.
|
20340 | */
|
20341 | filePaths: string[];
|
20342 | /**
|
20343 | * An array matching the `filePaths` array of base64 encoded strings which contains
|
20344 | * security scoped bookmark data. `securityScopedBookmarks` must be enabled for
|
20345 | * this to be populated. (For return values, see table here.)
|
20346 | *
|
20347 | * @platform darwin,mas
|
20348 | */
|
20349 | bookmarks?: string[];
|
20350 | }
|
20351 |
|
20352 | interface OpenDialogSyncOptions {
|
20353 | title?: string;
|
20354 | defaultPath?: string;
|
20355 | /**
|
20356 | * Custom label for the confirmation button, when left empty the default label will
|
20357 | * be used.
|
20358 | */
|
20359 | buttonLabel?: string;
|
20360 | filters?: FileFilter[];
|
20361 | /**
|
20362 | * Contains which features the dialog should use. The following values are
|
20363 | * supported:
|
20364 | */
|
20365 | properties?: Array<'openFile' | 'openDirectory' | 'multiSelections' | 'showHiddenFiles' | 'createDirectory' | 'promptToCreate' | 'noResolveAliases' | 'treatPackageAsDirectory' | 'dontAddToRecent'>;
|
20366 | /**
|
20367 | * Message to display above input boxes.
|
20368 | *
|
20369 | * @platform darwin
|
20370 | */
|
20371 | message?: string;
|
20372 | /**
|
20373 | * Create security scoped bookmarks when packaged for the Mac App Store.
|
20374 | *
|
20375 | * @platform darwin,mas
|
20376 | */
|
20377 | securityScopedBookmarks?: boolean;
|
20378 | }
|
20379 |
|
20380 | interface OpenExternalOptions {
|
20381 | /**
|
20382 | * `true` to bring the opened application to the foreground. The default is `true`.
|
20383 | *
|
20384 | * @platform darwin
|
20385 | */
|
20386 | activate?: boolean;
|
20387 | /**
|
20388 | * The working directory.
|
20389 | *
|
20390 | * @platform win32
|
20391 | */
|
20392 | workingDirectory?: string;
|
20393 | /**
|
20394 | * Indicates a user initiated launch that enables tracking of frequently used
|
20395 | * programs and other behaviors. The default is `false`.
|
20396 | *
|
20397 | * @platform win32
|
20398 | */
|
20399 | logUsage?: boolean;
|
20400 | }
|
20401 |
|
20402 | interface Options {
|
20403 | }
|
20404 |
|
20405 | interface Opts {
|
20406 | /**
|
20407 | * Keep the page hidden instead of visible. Default is `false`.
|
20408 | */
|
20409 | stayHidden?: boolean;
|
20410 | /**
|
20411 | * Keep the system awake instead of allowing it to sleep. Default is `false`.
|
20412 | */
|
20413 | stayAwake?: boolean;
|
20414 | }
|
20415 |
|
20416 | interface PageFaviconUpdatedEvent extends DOMEvent {
|
20417 | /**
|
20418 | * Array of URLs.
|
20419 | */
|
20420 | favicons: string[];
|
20421 | }
|
20422 |
|
20423 | interface PageTitleUpdatedEvent extends DOMEvent {
|
20424 | title: string;
|
20425 | explicitSet: boolean;
|
20426 | }
|
20427 |
|
20428 | interface Parameters {
|
20429 | /**
|
20430 | * Specify the screen type to emulate (default: `desktop`):
|
20431 | */
|
20432 | screenPosition: ('desktop' | 'mobile');
|
20433 | /**
|
20434 | * Set the emulated screen size (screenPosition == mobile).
|
20435 | */
|
20436 | screenSize: Size;
|
20437 | /**
|
20438 | * Position the view on the screen (screenPosition == mobile) (default: `{ x: 0, y:
|
20439 | * 0 }`).
|
20440 | */
|
20441 | viewPosition: Point;
|
20442 | /**
|
20443 | * Set the device scale factor (if zero defaults to original device scale factor)
|
20444 | * (default: `0`).
|
20445 | */
|
20446 | deviceScaleFactor: number;
|
20447 | /**
|
20448 | * Set the emulated view size (empty means no override)
|
20449 | */
|
20450 | viewSize: Size;
|
20451 | /**
|
20452 | * Scale of emulated view inside available space (not in fit to view mode)
|
20453 | * (default: `1`).
|
20454 | */
|
20455 | scale: number;
|
20456 | }
|
20457 |
|
20458 | interface Payment {
|
20459 | /**
|
20460 | * The identifier of the purchased product.
|
20461 | */
|
20462 | productIdentifier: string;
|
20463 | /**
|
20464 | * The quantity purchased.
|
20465 | */
|
20466 | quantity: number;
|
20467 | /**
|
20468 | * An opaque identifier for the user’s account on your system.
|
20469 | */
|
20470 | applicationUsername: string;
|
20471 | /**
|
20472 | * The details of the discount offer to apply to the payment.
|
20473 | */
|
20474 | paymentDiscount?: PaymentDiscount;
|
20475 | }
|
20476 |
|
20477 | interface PermissionCheckHandlerHandlerDetails {
|
20478 | /**
|
20479 | * The origin of the frame embedding the frame that made the permission check.
|
20480 | * Only set for cross-origin sub frames making permission checks.
|
20481 | */
|
20482 | embeddingOrigin?: string;
|
20483 | /**
|
20484 | * The security origin of the `media` check.
|
20485 | */
|
20486 | securityOrigin?: string;
|
20487 | /**
|
20488 | * The type of media access being requested, can be `video`, `audio` or `unknown`
|
20489 | */
|
20490 | mediaType?: ('video' | 'audio' | 'unknown');
|
20491 | /**
|
20492 | * The last URL the requesting frame loaded. This is not provided for cross-origin
|
20493 | * sub frames making permission checks.
|
20494 | */
|
20495 | requestingUrl?: string;
|
20496 | /**
|
20497 | * Whether the frame making the request is the main frame
|
20498 | */
|
20499 | isMainFrame: boolean;
|
20500 | }
|
20501 |
|
20502 | interface PluginCrashedEvent extends DOMEvent {
|
20503 | name: string;
|
20504 | version: string;
|
20505 | }
|
20506 |
|
20507 | interface PopupOptions {
|
20508 | /**
|
20509 | * Default is the focused window.
|
20510 | */
|
20511 | window?: BrowserWindow;
|
20512 | /**
|
20513 | * Default is the current mouse cursor position. Must be declared if `y` is
|
20514 | * declared.
|
20515 | */
|
20516 | x?: number;
|
20517 | /**
|
20518 | * Default is the current mouse cursor position. Must be declared if `x` is
|
20519 | * declared.
|
20520 | */
|
20521 | y?: number;
|
20522 | /**
|
20523 | * The index of the menu item to be positioned under the mouse cursor at the
|
20524 | * specified coordinates. Default is -1.
|
20525 | *
|
20526 | * @platform darwin
|
20527 | */
|
20528 | positioningItem?: number;
|
20529 | /**
|
20530 | * This should map to the `menuSourceType` provided by the `context-menu` event. It
|
20531 | * is not recommended to set this value manually, only provide values you receive
|
20532 | * from other APIs or leave it `undefined`. Can be `none`, `mouse`, `keyboard`,
|
20533 | * `touch`, `touchMenu`, `longPress`, `longTap`, `touchHandle`, `stylus`,
|
20534 | * `adjustSelection`, or `adjustSelectionReset`.
|
20535 | *
|
20536 | * @platform win32,linux
|
20537 | */
|
20538 | sourceType?: ('none' | 'mouse' | 'keyboard' | 'touch' | 'touchMenu' | 'longPress' | 'longTap' | 'touchHandle' | 'stylus' | 'adjustSelection' | 'adjustSelectionReset');
|
20539 | /**
|
20540 | * Called when menu is closed.
|
20541 | */
|
20542 | callback?: () => void;
|
20543 | }
|
20544 |
|
20545 | interface PreconnectOptions {
|
20546 | /**
|
20547 | * URL for preconnect. Only the origin is relevant for opening the socket.
|
20548 | */
|
20549 | url: string;
|
20550 | /**
|
20551 | * number of sockets to preconnect. Must be between 1 and 6. Defaults to 1.
|
20552 | */
|
20553 | numSockets?: number;
|
20554 | }
|
20555 |
|
20556 | interface PrintToPDFOptions {
|
20557 | /**
|
20558 | * Paper orientation.`true` for landscape, `false` for portrait. Defaults to false.
|
20559 | */
|
20560 | landscape?: boolean;
|
20561 | /**
|
20562 | * Whether to display header and footer. Defaults to false.
|
20563 | */
|
20564 | displayHeaderFooter?: boolean;
|
20565 | /**
|
20566 | * Whether to print background graphics. Defaults to false.
|
20567 | */
|
20568 | printBackground?: boolean;
|
20569 | /**
|
20570 | * Scale of the webpage rendering. Defaults to 1.
|
20571 | */
|
20572 | scale?: number;
|
20573 | /**
|
20574 | * Specify page size of the generated PDF. Can be `A0`, `A1`, `A2`, `A3`, `A4`,
|
20575 | * `A5`, `A6`, `Legal`, `Letter`, `Tabloid`, `Ledger`, or an Object containing
|
20576 | * `height` and `width` in inches. Defaults to `Letter`.
|
20577 | */
|
20578 | pageSize?: (('A0' | 'A1' | 'A2' | 'A3' | 'A4' | 'A5' | 'A6' | 'Legal' | 'Letter' | 'Tabloid' | 'Ledger')) | (Size);
|
20579 | margins?: Margins;
|
20580 | /**
|
20581 | * Page ranges to print, e.g., '1-5, 8, 11-13'. Defaults to the empty string, which
|
20582 | * means print all pages.
|
20583 | */
|
20584 | pageRanges?: string;
|
20585 | /**
|
20586 | * HTML template for the print header. Should be valid HTML markup with following
|
20587 | * classes used to inject printing values into them: `date` (formatted print date),
|
20588 | * `title` (document title), `url` (document location), `pageNumber` (current page
|
20589 | * number) and `totalPages` (total pages in the document). For example, `<span
|
20590 | * class=title></span>` would generate span containing the title.
|
20591 | */
|
20592 | headerTemplate?: string;
|
20593 | /**
|
20594 | * HTML template for the print footer. Should use the same format as the
|
20595 | * `headerTemplate`.
|
20596 | */
|
20597 | footerTemplate?: string;
|
20598 | /**
|
20599 | * Whether or not to prefer page size as defined by css. Defaults to false, in
|
20600 | * which case the content will be scaled to fit the paper size.
|
20601 | */
|
20602 | preferCSSPageSize?: boolean;
|
20603 | /**
|
20604 | * Whether or not to generate a tagged (accessible) PDF. Defaults to false. As this
|
20605 | * property is experimental, the generated PDF may not adhere fully to PDF/UA and
|
20606 | * WCAG standards.
|
20607 | *
|
20608 | * @experimental
|
20609 | */
|
20610 | generateTaggedPDF?: boolean;
|
20611 | /**
|
20612 | * Whether or not to generate a PDF document outline from content headers. Defaults
|
20613 | * to false.
|
20614 | *
|
20615 | * @experimental
|
20616 | */
|
20617 | generateDocumentOutline?: boolean;
|
20618 | }
|
20619 |
|
20620 | interface Privileges {
|
20621 | /**
|
20622 | * Default false.
|
20623 | */
|
20624 | standard?: boolean;
|
20625 | /**
|
20626 | * Default false.
|
20627 | */
|
20628 | secure?: boolean;
|
20629 | /**
|
20630 | * Default false.
|
20631 | */
|
20632 | bypassCSP?: boolean;
|
20633 | /**
|
20634 | * Default false.
|
20635 | */
|
20636 | allowServiceWorkers?: boolean;
|
20637 | /**
|
20638 | * Default false.
|
20639 | */
|
20640 | supportFetchAPI?: boolean;
|
20641 | /**
|
20642 | * Default false.
|
20643 | */
|
20644 | corsEnabled?: boolean;
|
20645 | /**
|
20646 | * Default false.
|
20647 | */
|
20648 | stream?: boolean;
|
20649 | /**
|
20650 | * Enable V8 code cache for the scheme, only works when `standard` is also set to
|
20651 | * true. Default false.
|
20652 | */
|
20653 | codeCache?: boolean;
|
20654 | }
|
20655 |
|
20656 | interface ProgressBarOptions {
|
20657 | /**
|
20658 | * Mode for the progress bar. Can be `none`, `normal`, `indeterminate`, `error` or
|
20659 | * `paused`.
|
20660 | *
|
20661 | * @platform win32
|
20662 | */
|
20663 | mode: ('none' | 'normal' | 'indeterminate' | 'error' | 'paused');
|
20664 | }
|
20665 |
|
20666 | interface Provider {
|
20667 | spellCheck: (words: string[], callback: (misspeltWords: string[]) => void) => void;
|
20668 | }
|
20669 |
|
20670 | interface PurchaseProductOpts {
|
20671 | /**
|
20672 | * The number of items the user wants to purchase.
|
20673 | */
|
20674 | quantity?: number;
|
20675 | /**
|
20676 | * The string that associates the transaction with a user account on your service
|
20677 | * (applicationUsername).
|
20678 | */
|
20679 | username?: string;
|
20680 | }
|
20681 |
|
20682 | interface ReadBookmark {
|
20683 | title: string;
|
20684 | url: string;
|
20685 | }
|
20686 |
|
20687 | interface RegistrationCompletedDetails {
|
20688 | /**
|
20689 | * The base URL that a service worker is registered for
|
20690 | */
|
20691 | scope: string;
|
20692 | }
|
20693 |
|
20694 | interface RelaunchOptions {
|
20695 | args?: string[];
|
20696 | execPath?: string;
|
20697 | }
|
20698 |
|
20699 | interface RenderProcessGoneEvent extends DOMEvent {
|
20700 | details: RenderProcessGoneDetails;
|
20701 | }
|
20702 |
|
20703 | interface Request {
|
20704 | hostname: string;
|
20705 | certificate: Certificate;
|
20706 | validatedCertificate: Certificate;
|
20707 | /**
|
20708 | * `true` if Chromium recognises the root CA as a standard root. If it isn't then
|
20709 | * it's probably the case that this certificate was generated by a MITM proxy whose
|
20710 | * root has been installed locally (for example, by a corporate proxy). This should
|
20711 | * not be trusted if the `verificationResult` is not `OK`.
|
20712 | */
|
20713 | isIssuedByKnownRoot: boolean;
|
20714 | /**
|
20715 | * `OK` if the certificate is trusted, otherwise an error like `CERT_REVOKED`.
|
20716 | */
|
20717 | verificationResult: string;
|
20718 | /**
|
20719 | * Error code.
|
20720 | */
|
20721 | errorCode: number;
|
20722 | }
|
20723 |
|
20724 | interface ResizeOptions {
|
20725 | /**
|
20726 | * Defaults to the image's width.
|
20727 | */
|
20728 | width?: number;
|
20729 | /**
|
20730 | * Defaults to the image's height.
|
20731 | */
|
20732 | height?: number;
|
20733 | /**
|
20734 | * The desired quality of the resize image. Possible values include `good`,
|
20735 | * `better`, or `best`. The default is `best`. These values express a desired
|
20736 | * quality/speed tradeoff. They are translated into an algorithm-specific method
|
20737 | * that depends on the capabilities (CPU, GPU) of the underlying platform. It is
|
20738 | * possible for all three methods to be mapped to the same algorithm on a given
|
20739 | * platform.
|
20740 | */
|
20741 | quality?: ('good' | 'better' | 'best');
|
20742 | }
|
20743 |
|
20744 | interface ResolveHostOptions {
|
20745 | /**
|
20746 | * Requested DNS query type. If unspecified, resolver will pick A or AAAA (or both)
|
20747 | * based on IPv4/IPv6 settings:
|
20748 | */
|
20749 | queryType?: ('A' | 'AAAA');
|
20750 | /**
|
20751 | * The source to use for resolved addresses. Default allows the resolver to pick an
|
20752 | * appropriate source. Only affects use of big external sources (e.g. calling the
|
20753 | * system for resolution or using DNS). Even if a source is specified, results can
|
20754 | * still come from cache, resolving "localhost" or IP literals, etc. One of the
|
20755 | * following values:
|
20756 | */
|
20757 | source?: ('any' | 'system' | 'dns' | 'mdns' | 'localOnly');
|
20758 | /**
|
20759 | * Indicates what DNS cache entries, if any, can be used to provide a response. One
|
20760 | * of the following values:
|
20761 | */
|
20762 | cacheUsage?: ('allowed' | 'staleAllowed' | 'disallowed');
|
20763 | /**
|
20764 | * Controls the resolver's Secure DNS behavior for this request. One of the
|
20765 | * following values:
|
20766 | */
|
20767 | secureDnsPolicy?: ('allow' | 'disable');
|
20768 | }
|
20769 |
|
20770 | interface ResourceUsage {
|
20771 | images: MemoryUsageDetails;
|
20772 | scripts: MemoryUsageDetails;
|
20773 | cssStyleSheets: MemoryUsageDetails;
|
20774 | xslStyleSheets: MemoryUsageDetails;
|
20775 | fonts: MemoryUsageDetails;
|
20776 | other: MemoryUsageDetails;
|
20777 | }
|
20778 |
|
20779 | interface Response {
|
20780 | /**
|
20781 | * `false` should be passed in if the dialog is canceled. If the `pairingKind` is
|
20782 | * `confirm` or `confirmPin`, this value should indicate if the pairing is
|
20783 | * confirmed. If the `pairingKind` is `providePin` the value should be `true` when
|
20784 | * a value is provided.
|
20785 | */
|
20786 | confirmed: boolean;
|
20787 | /**
|
20788 | * When the `pairingKind` is `providePin` this value should be the required pin for
|
20789 | * the Bluetooth device.
|
20790 | */
|
20791 | pin?: (string) | (null);
|
20792 | }
|
20793 |
|
20794 | interface Result {
|
20795 | requestId: number;
|
20796 | /**
|
20797 | * Position of the active match.
|
20798 | */
|
20799 | activeMatchOrdinal: number;
|
20800 | /**
|
20801 | * Number of Matches.
|
20802 | */
|
20803 | matches: number;
|
20804 | /**
|
20805 | * Coordinates of first match region.
|
20806 | */
|
20807 | selectionArea: Rectangle;
|
20808 | finalUpdate: boolean;
|
20809 | }
|
20810 |
|
20811 | interface SaveDialogOptions {
|
20812 | /**
|
20813 | * The dialog title. Cannot be displayed on some _Linux_ desktop environments.
|
20814 | */
|
20815 | title?: string;
|
20816 | /**
|
20817 | * Absolute directory path, absolute file path, or file name to use by default.
|
20818 | */
|
20819 | defaultPath?: string;
|
20820 | /**
|
20821 | * Custom label for the confirmation button, when left empty the default label will
|
20822 | * be used.
|
20823 | */
|
20824 | buttonLabel?: string;
|
20825 | filters?: FileFilter[];
|
20826 | /**
|
20827 | * Message to display above text fields.
|
20828 | *
|
20829 | * @platform darwin
|
20830 | */
|
20831 | message?: string;
|
20832 | /**
|
20833 | * Custom label for the text displayed in front of the filename text field.
|
20834 | *
|
20835 | * @platform darwin
|
20836 | */
|
20837 | nameFieldLabel?: string;
|
20838 | /**
|
20839 | * Show the tags input box, defaults to `true`.
|
20840 | *
|
20841 | * @platform darwin
|
20842 | */
|
20843 | showsTagField?: boolean;
|
20844 | properties?: Array<'showHiddenFiles' | 'createDirectory' | 'treatPackageAsDirectory' | 'showOverwriteConfirmation' | 'dontAddToRecent'>;
|
20845 | /**
|
20846 | * Create a security scoped bookmark when packaged for the Mac App Store. If this
|
20847 | * option is enabled and the file doesn't already exist a blank file will be
|
20848 | * created at the chosen path.
|
20849 | *
|
20850 | * @platform darwin,mas
|
20851 | */
|
20852 | securityScopedBookmarks?: boolean;
|
20853 | }
|
20854 |
|
20855 | interface SaveDialogReturnValue {
|
20856 | /**
|
20857 | * whether or not the dialog was canceled.
|
20858 | */
|
20859 | canceled: boolean;
|
20860 | /**
|
20861 | * If the dialog is canceled, this will be an empty string.
|
20862 | */
|
20863 | filePath: string;
|
20864 | /**
|
20865 | * Base64 encoded string which contains the security scoped bookmark data for the
|
20866 | * saved file. `securityScopedBookmarks` must be enabled for this to be present.
|
20867 | * (For return values, see table here.)
|
20868 | *
|
20869 | * @platform darwin,mas
|
20870 | */
|
20871 | bookmark?: string;
|
20872 | }
|
20873 |
|
20874 | interface SaveDialogSyncOptions {
|
20875 | /**
|
20876 | * The dialog title. Cannot be displayed on some _Linux_ desktop environments.
|
20877 | */
|
20878 | title?: string;
|
20879 | /**
|
20880 | * Absolute directory path, absolute file path, or file name to use by default.
|
20881 | */
|
20882 | defaultPath?: string;
|
20883 | /**
|
20884 | * Custom label for the confirmation button, when left empty the default label will
|
20885 | * be used.
|
20886 | */
|
20887 | buttonLabel?: string;
|
20888 | filters?: FileFilter[];
|
20889 | /**
|
20890 | * Message to display above text fields.
|
20891 | *
|
20892 | * @platform darwin
|
20893 | */
|
20894 | message?: string;
|
20895 | /**
|
20896 | * Custom label for the text displayed in front of the filename text field.
|
20897 | *
|
20898 | * @platform darwin
|
20899 | */
|
20900 | nameFieldLabel?: string;
|
20901 | /**
|
20902 | * Show the tags input box, defaults to `true`.
|
20903 | *
|
20904 | * @platform darwin
|
20905 | */
|
20906 | showsTagField?: boolean;
|
20907 | properties?: Array<'showHiddenFiles' | 'createDirectory' | 'treatPackageAsDirectory' | 'showOverwriteConfirmation' | 'dontAddToRecent'>;
|
20908 | /**
|
20909 | * Create a security scoped bookmark when packaged for the Mac App Store. If this
|
20910 | * option is enabled and the file doesn't already exist a blank file will be
|
20911 | * created at the chosen path.
|
20912 | *
|
20913 | * @platform darwin,mas
|
20914 | */
|
20915 | securityScopedBookmarks?: boolean;
|
20916 | }
|
20917 |
|
20918 | interface SelectHidDeviceDetails {
|
20919 | deviceList: HIDDevice[];
|
20920 | frame: WebFrameMain;
|
20921 | }
|
20922 |
|
20923 | interface SelectUsbDeviceDetails {
|
20924 | deviceList: USBDevice[];
|
20925 | frame: WebFrameMain;
|
20926 | }
|
20927 |
|
20928 | interface SerialPortRevokedDetails {
|
20929 | port: SerialPort;
|
20930 | frame: WebFrameMain;
|
20931 | /**
|
20932 | * The origin that the device has been revoked from.
|
20933 | */
|
20934 | origin: string;
|
20935 | }
|
20936 |
|
20937 | interface Settings {
|
20938 | /**
|
20939 | * `true` to open the app at login, `false` to remove the app as a login item.
|
20940 | * Defaults to `false`.
|
20941 | */
|
20942 | openAtLogin?: boolean;
|
20943 | /**
|
20944 | * `true` to open the app as hidden. Defaults to `false`. The user can edit this
|
20945 | * setting from the System Preferences so
|
20946 | * `app.getLoginItemSettings().wasOpenedAsHidden` should be checked when the app is
|
20947 | * opened to know the current value. This setting is not available on MAS builds or
|
20948 | * on macOS 13 and up.
|
20949 | *
|
20950 | * @deprecated
|
20951 | * @platform darwin
|
20952 | */
|
20953 | openAsHidden?: boolean;
|
20954 | /**
|
20955 | * The type of service to add as a login item. Defaults to `mainAppService`. Only
|
20956 | * available on macOS 13 and up.
|
20957 | *
|
20958 | * @platform darwin
|
20959 | */
|
20960 | type?: ('mainAppService' | 'agentService' | 'daemonService' | 'loginItemService');
|
20961 | /**
|
20962 | * The name of the service. Required if `type` is non-default. Only available on
|
20963 | * macOS 13 and up.
|
20964 | *
|
20965 | * @platform darwin
|
20966 | */
|
20967 | serviceName?: string;
|
20968 | /**
|
20969 | * The executable to launch at login. Defaults to `process.execPath`.
|
20970 | *
|
20971 | * @platform win32
|
20972 | */
|
20973 | path?: string;
|
20974 | /**
|
20975 | * The command-line arguments to pass to the executable. Defaults to an empty
|
20976 | * array. Take care to wrap paths in quotes.
|
20977 | *
|
20978 | * @platform win32
|
20979 | */
|
20980 | args?: string[];
|
20981 | /**
|
20982 | * `true` will change the startup approved registry key and `enable / disable` the
|
20983 | * App in Task Manager and Windows Settings. Defaults to `true`.
|
20984 | *
|
20985 | * @platform win32
|
20986 | */
|
20987 | enabled?: boolean;
|
20988 | /**
|
20989 | * value name to write into registry. Defaults to the app's AppUserModelId().
|
20990 | *
|
20991 | * @platform win32
|
20992 | */
|
20993 | name?: string;
|
20994 | }
|
20995 |
|
20996 | interface SourcesOptions {
|
20997 | /**
|
20998 | * An array of strings that lists the types of desktop sources to be captured,
|
20999 | * available types can be `screen` and `window`.
|
21000 | */
|
21001 | types: Array<'screen' | 'window'>;
|
21002 | /**
|
21003 | * The size that the media source thumbnail should be scaled to. Default is `150` x
|
21004 | * `150`. Set width or height to 0 when you do not need the thumbnails. This will
|
21005 | * save the processing time required for capturing the content of each window and
|
21006 | * screen.
|
21007 | */
|
21008 | thumbnailSize?: Size;
|
21009 | /**
|
21010 | * Set to true to enable fetching window icons. The default value is false. When
|
21011 | * false the appIcon property of the sources return null. Same if a source has the
|
21012 | * type screen.
|
21013 | */
|
21014 | fetchWindowIcons?: boolean;
|
21015 | }
|
21016 |
|
21017 | interface StartLoggingOptions {
|
21018 | /**
|
21019 | * What kinds of data should be captured. By default, only metadata about requests
|
21020 | * will be captured. Setting this to `includeSensitive` will include cookies and
|
21021 | * authentication data. Setting it to `everything` will include all bytes
|
21022 | * transferred on sockets. Can be `default`, `includeSensitive` or `everything`.
|
21023 | */
|
21024 | captureMode?: ('default' | 'includeSensitive' | 'everything');
|
21025 | /**
|
21026 | * When the log grows beyond this size, logging will automatically stop. Defaults
|
21027 | * to unlimited.
|
21028 | */
|
21029 | maxFileSize?: number;
|
21030 | }
|
21031 |
|
21032 | interface Streams {
|
21033 | video?: (Video) | (WebFrameMain);
|
21034 | /**
|
21035 | * If a string is specified, can be `loopback` or `loopbackWithMute`. Specifying a
|
21036 | * loopback device will capture system audio, and is currently only supported on
|
21037 | * Windows. If a WebFrameMain is specified, will capture audio from that frame.
|
21038 | */
|
21039 | audio?: (('loopback' | 'loopbackWithMute')) | (WebFrameMain);
|
21040 | /**
|
21041 | * If `audio` is a WebFrameMain and this is set to `true`, then local playback of
|
21042 | * audio will not be muted (e.g. using `MediaRecorder` to record `WebFrameMain`
|
21043 | * with this flag set to `true` will allow audio to pass through to the speakers
|
21044 | * while recording). Default is `false`.
|
21045 | */
|
21046 | enableLocalEcho?: boolean;
|
21047 | }
|
21048 |
|
21049 | interface SystemMemoryInfo {
|
21050 | /**
|
21051 | * The total amount of physical memory in Kilobytes available to the system.
|
21052 | */
|
21053 | total: number;
|
21054 | /**
|
21055 | * The total amount of memory not being used by applications or disk cache.
|
21056 | */
|
21057 | free: number;
|
21058 | /**
|
21059 | * The total amount of swap memory in Kilobytes available to the system.
|
21060 | *
|
21061 | * @platform win32,linux
|
21062 | */
|
21063 | swapTotal: number;
|
21064 | /**
|
21065 | * The free amount of swap memory in Kilobytes available to the system.
|
21066 | *
|
21067 | * @platform win32,linux
|
21068 | */
|
21069 | swapFree: number;
|
21070 | }
|
21071 |
|
21072 | interface TitleBarOverlay {
|
21073 | /**
|
21074 | * The CSS color of the Window Controls Overlay when enabled. Default is the system
|
21075 | * color.
|
21076 | *
|
21077 | * @platform win32,linux
|
21078 | */
|
21079 | color?: string;
|
21080 | /**
|
21081 | * The CSS color of the symbols on the Window Controls Overlay when enabled.
|
21082 | * Default is the system color.
|
21083 | *
|
21084 | * @platform win32
|
21085 | */
|
21086 | symbolColor?: string;
|
21087 | /**
|
21088 | * The height of the title bar and Window Controls Overlay in pixels. Default is
|
21089 | * system height.
|
21090 | */
|
21091 | height?: number;
|
21092 | }
|
21093 |
|
21094 | interface TitleBarOverlayOptions {
|
21095 | /**
|
21096 | * The CSS color of the Window Controls Overlay when enabled.
|
21097 | */
|
21098 | color?: string;
|
21099 | /**
|
21100 | * The CSS color of the symbols on the Window Controls Overlay when enabled.
|
21101 | */
|
21102 | symbolColor?: string;
|
21103 | /**
|
21104 | * The height of the title bar and Window Controls Overlay in pixels.
|
21105 | */
|
21106 | height?: number;
|
21107 | }
|
21108 |
|
21109 | interface TitleOptions {
|
21110 | /**
|
21111 | * The font family variant to display, can be `monospaced` or `monospacedDigit`.
|
21112 | * `monospaced` is available in macOS 10.15+ When left blank, the title uses the
|
21113 | * default system font.
|
21114 | */
|
21115 | fontType?: ('monospaced' | 'monospacedDigit');
|
21116 | }
|
21117 |
|
21118 | interface ToBitmapOptions {
|
21119 | /**
|
21120 | * Defaults to 1.0.
|
21121 | */
|
21122 | scaleFactor?: number;
|
21123 | }
|
21124 |
|
21125 | interface ToDataURLOptions {
|
21126 | /**
|
21127 | * Defaults to 1.0.
|
21128 | */
|
21129 | scaleFactor?: number;
|
21130 | }
|
21131 |
|
21132 | interface ToPNGOptions {
|
21133 | /**
|
21134 | * Defaults to 1.0.
|
21135 | */
|
21136 | scaleFactor?: number;
|
21137 | }
|
21138 |
|
21139 | interface TouchBarButtonConstructorOptions {
|
21140 | /**
|
21141 | * Button text.
|
21142 | */
|
21143 | label?: string;
|
21144 | /**
|
21145 | * A short description of the button for use by screenreaders like VoiceOver.
|
21146 | */
|
21147 | accessibilityLabel?: string;
|
21148 | /**
|
21149 | * Button background color in hex format, i.e `#ABCDEF`.
|
21150 | */
|
21151 | backgroundColor?: string;
|
21152 | /**
|
21153 | * Button icon.
|
21154 | */
|
21155 | icon?: (NativeImage) | (string);
|
21156 | /**
|
21157 | * Can be `left`, `right` or `overlay`. Defaults to `overlay`.
|
21158 | */
|
21159 | iconPosition?: ('left' | 'right' | 'overlay');
|
21160 | /**
|
21161 | * Function to call when the button is clicked.
|
21162 | */
|
21163 | click?: () => void;
|
21164 | /**
|
21165 | * Whether the button is in an enabled state. Default is `true`.
|
21166 | */
|
21167 | enabled?: boolean;
|
21168 | }
|
21169 |
|
21170 | interface TouchBarColorPickerConstructorOptions {
|
21171 | /**
|
21172 | * Array of hex color strings to appear as possible colors to select.
|
21173 | */
|
21174 | availableColors?: string[];
|
21175 | /**
|
21176 | * The selected hex color in the picker, i.e `#ABCDEF`.
|
21177 | */
|
21178 | selectedColor?: string;
|
21179 | /**
|
21180 | * Function to call when a color is selected.
|
21181 | */
|
21182 | change?: (color: string) => void;
|
21183 | }
|
21184 |
|
21185 | interface TouchBarConstructorOptions {
|
21186 | items?: Array<(TouchBarButton) | (TouchBarColorPicker) | (TouchBarGroup) | (TouchBarLabel) | (TouchBarPopover) | (TouchBarScrubber) | (TouchBarSegmentedControl) | (TouchBarSlider) | (TouchBarSpacer)>;
|
21187 | escapeItem?: (TouchBarButton) | (TouchBarColorPicker) | (TouchBarGroup) | (TouchBarLabel) | (TouchBarPopover) | (TouchBarScrubber) | (TouchBarSegmentedControl) | (TouchBarSlider) | (TouchBarSpacer) | (null);
|
21188 | }
|
21189 |
|
21190 | interface TouchBarGroupConstructorOptions {
|
21191 | /**
|
21192 | * Items to display as a group.
|
21193 | */
|
21194 | items: TouchBar;
|
21195 | }
|
21196 |
|
21197 | interface TouchBarLabelConstructorOptions {
|
21198 | /**
|
21199 | * Text to display.
|
21200 | */
|
21201 | label?: string;
|
21202 | /**
|
21203 | * A short description of the button for use by screenreaders like VoiceOver.
|
21204 | */
|
21205 | accessibilityLabel?: string;
|
21206 | /**
|
21207 | * Hex color of text, i.e `#ABCDEF`.
|
21208 | */
|
21209 | textColor?: string;
|
21210 | }
|
21211 |
|
21212 | interface TouchBarPopoverConstructorOptions {
|
21213 | /**
|
21214 | * Popover button text.
|
21215 | */
|
21216 | label?: string;
|
21217 | /**
|
21218 | * Popover button icon.
|
21219 | */
|
21220 | icon?: NativeImage;
|
21221 | /**
|
21222 | * Items to display in the popover.
|
21223 | */
|
21224 | items: TouchBar;
|
21225 | /**
|
21226 | * `true` to display a close button on the left of the popover, `false` to not show
|
21227 | * it. Default is `true`.
|
21228 | */
|
21229 | showCloseButton?: boolean;
|
21230 | }
|
21231 |
|
21232 | interface TouchBarScrubberConstructorOptions {
|
21233 | /**
|
21234 | * An array of items to place in this scrubber.
|
21235 | */
|
21236 | items: ScrubberItem[];
|
21237 | /**
|
21238 | * Called when the user taps an item that was not the last tapped item.
|
21239 | */
|
21240 | select?: (selectedIndex: number) => void;
|
21241 | /**
|
21242 | * Called when the user taps any item.
|
21243 | */
|
21244 | highlight?: (highlightedIndex: number) => void;
|
21245 | /**
|
21246 | * Selected item style. Can be `background`, `outline` or `none`. Defaults to
|
21247 | * `none`.
|
21248 | */
|
21249 | selectedStyle?: ('background' | 'outline' | 'none');
|
21250 | /**
|
21251 | * Selected overlay item style. Can be `background`, `outline` or `none`. Defaults
|
21252 | * to `none`.
|
21253 | */
|
21254 | overlayStyle?: ('background' | 'outline' | 'none');
|
21255 | /**
|
21256 | * Whether to show arrow buttons. Defaults to `false` and is only shown if `items`
|
21257 | * is non-empty.
|
21258 | */
|
21259 | showArrowButtons?: boolean;
|
21260 | /**
|
21261 | * Can be `fixed` or `free`. The default is `free`.
|
21262 | */
|
21263 | mode?: ('fixed' | 'free');
|
21264 | /**
|
21265 | * Defaults to `true`.
|
21266 | */
|
21267 | continuous?: boolean;
|
21268 | }
|
21269 |
|
21270 | interface TouchBarSegmentedControlConstructorOptions {
|
21271 | /**
|
21272 | * Style of the segments:
|
21273 | */
|
21274 | segmentStyle?: ('automatic' | 'rounded' | 'textured-rounded' | 'round-rect' | 'textured-square' | 'capsule' | 'small-square' | 'separated');
|
21275 | /**
|
21276 | * The selection mode of the control:
|
21277 | */
|
21278 | mode?: ('single' | 'multiple' | 'buttons');
|
21279 | /**
|
21280 | * An array of segments to place in this control.
|
21281 | */
|
21282 | segments: SegmentedControlSegment[];
|
21283 | /**
|
21284 | * The index of the currently selected segment, will update automatically with user
|
21285 | * interaction. When the mode is `multiple` it will be the last selected item.
|
21286 | */
|
21287 | selectedIndex?: number;
|
21288 | /**
|
21289 | * Called when the user selects a new segment.
|
21290 | */
|
21291 | change?: (selectedIndex: number, isSelected: boolean) => void;
|
21292 | }
|
21293 |
|
21294 | interface TouchBarSliderConstructorOptions {
|
21295 | /**
|
21296 | * Label text.
|
21297 | */
|
21298 | label?: string;
|
21299 | /**
|
21300 | * Selected value.
|
21301 | */
|
21302 | value?: number;
|
21303 | /**
|
21304 | * Minimum value.
|
21305 | */
|
21306 | minValue?: number;
|
21307 | /**
|
21308 | * Maximum value.
|
21309 | */
|
21310 | maxValue?: number;
|
21311 | /**
|
21312 | * Function to call when the slider is changed.
|
21313 | */
|
21314 | change?: (newValue: number) => void;
|
21315 | }
|
21316 |
|
21317 | interface TouchBarSpacerConstructorOptions {
|
21318 | /**
|
21319 | * Size of spacer, possible values are:
|
21320 | */
|
21321 | size?: ('small' | 'large' | 'flexible');
|
21322 | }
|
21323 |
|
21324 | interface TraceBufferUsageReturnValue {
|
21325 | value: number;
|
21326 | percentage: number;
|
21327 | }
|
21328 |
|
21329 | interface UdpPortRange {
|
21330 | /**
|
21331 | * The minimum UDP port number that WebRTC should use.
|
21332 | */
|
21333 | min: number;
|
21334 | /**
|
21335 | * The maximum UDP port number that WebRTC should use.
|
21336 | */
|
21337 | max: number;
|
21338 | }
|
21339 |
|
21340 | interface UpdateTargetUrlEvent extends DOMEvent {
|
21341 | url: string;
|
21342 | }
|
21343 |
|
21344 | interface UploadProgress {
|
21345 | /**
|
21346 | * Whether the request is currently active. If this is false no other properties
|
21347 | * will be set
|
21348 | */
|
21349 | active: boolean;
|
21350 | /**
|
21351 | * Whether the upload has started. If this is false both `current` and `total` will
|
21352 | * be set to 0.
|
21353 | */
|
21354 | started: boolean;
|
21355 | /**
|
21356 | * The number of bytes that have been uploaded so far
|
21357 | */
|
21358 | current: number;
|
21359 | /**
|
21360 | * The number of bytes that will be uploaded this request
|
21361 | */
|
21362 | total: number;
|
21363 | }
|
21364 |
|
21365 | interface UsbDeviceRevokedDetails {
|
21366 | device: USBDevice;
|
21367 | /**
|
21368 | * The origin that the device has been revoked from.
|
21369 | */
|
21370 | origin?: string;
|
21371 | }
|
21372 |
|
21373 | interface USBProtectedClassesHandlerHandlerDetails {
|
21374 | /**
|
21375 | * The current list of protected USB classes. Possible class values include:
|
21376 | */
|
21377 | protectedClasses: Array<'audio' | 'audio-video' | 'hid' | 'mass-storage' | 'smart-card' | 'video' | 'wireless'>;
|
21378 | }
|
21379 |
|
21380 | interface VisibleOnAllWorkspacesOptions {
|
21381 | /**
|
21382 | * Sets whether the window should be visible above fullscreen windows.
|
21383 | *
|
21384 | * @platform darwin
|
21385 | */
|
21386 | visibleOnFullScreen?: boolean;
|
21387 | /**
|
21388 | * Calling setVisibleOnAllWorkspaces will by default transform the process type
|
21389 | * between UIElementApplication and ForegroundApplication to ensure the correct
|
21390 | * behavior. However, this will hide the window and dock for a short time every
|
21391 | * time it is called. If your window is already of type UIElementApplication, you
|
21392 | * can bypass this transformation by passing true to skipTransformProcessType.
|
21393 | *
|
21394 | * @platform darwin
|
21395 | */
|
21396 | skipTransformProcessType?: boolean;
|
21397 | }
|
21398 |
|
21399 | interface WebContentsAudioStateChangedEventParams {
|
21400 | /**
|
21401 | * True if one or more frames or child `webContents` are emitting audio.
|
21402 | */
|
21403 | audible: boolean;
|
21404 | }
|
21405 |
|
21406 | interface WebContentsDidRedirectNavigationEventParams {
|
21407 | /**
|
21408 | * The URL the frame is navigating to.
|
21409 | */
|
21410 | url: string;
|
21411 | /**
|
21412 | * Whether the navigation happened without changing document. Examples of same
|
21413 | * document navigations are reference fragment navigations, pushState/replaceState,
|
21414 | * and same page history navigation.
|
21415 | */
|
21416 | isSameDocument: boolean;
|
21417 | /**
|
21418 | * True if the navigation is taking place in a main frame.
|
21419 | */
|
21420 | isMainFrame: boolean;
|
21421 | /**
|
21422 | * The frame to be navigated.
|
21423 | */
|
21424 | frame: WebFrameMain;
|
21425 | /**
|
21426 | * The frame which initiated the navigation, which can be a parent frame (e.g. via
|
21427 | * `window.open` with a frame's name), or null if the navigation was not initiated
|
21428 | * by a frame. This can also be null if the initiating frame was deleted before the
|
21429 | * event was emitted.
|
21430 | */
|
21431 | initiator?: WebFrameMain;
|
21432 | }
|
21433 |
|
21434 | interface WebContentsDidStartNavigationEventParams {
|
21435 | /**
|
21436 | * The URL the frame is navigating to.
|
21437 | */
|
21438 | url: string;
|
21439 | /**
|
21440 | * Whether the navigation happened without changing document. Examples of same
|
21441 | * document navigations are reference fragment navigations, pushState/replaceState,
|
21442 | * and same page history navigation.
|
21443 | */
|
21444 | isSameDocument: boolean;
|
21445 | /**
|
21446 | * True if the navigation is taking place in a main frame.
|
21447 | */
|
21448 | isMainFrame: boolean;
|
21449 | /**
|
21450 | * The frame to be navigated.
|
21451 | */
|
21452 | frame: WebFrameMain;
|
21453 | /**
|
21454 | * The frame which initiated the navigation, which can be a parent frame (e.g. via
|
21455 | * `window.open` with a frame's name), or null if the navigation was not initiated
|
21456 | * by a frame. This can also be null if the initiating frame was deleted before the
|
21457 | * event was emitted.
|
21458 | */
|
21459 | initiator?: WebFrameMain;
|
21460 | }
|
21461 |
|
21462 | interface WebContentsPrintOptions {
|
21463 | /**
|
21464 | * Don't ask user for print settings. Default is `false`.
|
21465 | */
|
21466 | silent?: boolean;
|
21467 | /**
|
21468 | * Prints the background color and image of the web page. Default is `false`.
|
21469 | */
|
21470 | printBackground?: boolean;
|
21471 | /**
|
21472 | * Set the printer device name to use. Must be the system-defined name and not the
|
21473 | * 'friendly' name, e.g 'Brother_QL_820NWB' and not 'Brother QL-820NWB'.
|
21474 | */
|
21475 | deviceName?: string;
|
21476 | /**
|
21477 | * Set whether the printed web page will be in color or grayscale. Default is
|
21478 | * `true`.
|
21479 | */
|
21480 | color?: boolean;
|
21481 | margins?: Margins;
|
21482 | /**
|
21483 | * Whether the web page should be printed in landscape mode. Default is `false`.
|
21484 | */
|
21485 | landscape?: boolean;
|
21486 | /**
|
21487 | * The scale factor of the web page.
|
21488 | */
|
21489 | scaleFactor?: number;
|
21490 | /**
|
21491 | * The number of pages to print per page sheet.
|
21492 | */
|
21493 | pagesPerSheet?: number;
|
21494 | /**
|
21495 | * Whether the web page should be collated.
|
21496 | */
|
21497 | collate?: boolean;
|
21498 | /**
|
21499 | * The number of copies of the web page to print.
|
21500 | */
|
21501 | copies?: number;
|
21502 | /**
|
21503 | * The page range to print. On macOS, only one range is honored.
|
21504 | */
|
21505 | pageRanges?: PageRanges[];
|
21506 | /**
|
21507 | * Set the duplex mode of the printed web page. Can be `simplex`, `shortEdge`, or
|
21508 | * `longEdge`.
|
21509 | */
|
21510 | duplexMode?: ('simplex' | 'shortEdge' | 'longEdge');
|
21511 | dpi?: Record<string, number>;
|
21512 | /**
|
21513 | * string to be printed as page header.
|
21514 | */
|
21515 | header?: string;
|
21516 | /**
|
21517 | * string to be printed as page footer.
|
21518 | */
|
21519 | footer?: string;
|
21520 | /**
|
21521 | * Specify page size of the printed document. Can be `A0`, `A1`, `A2`, `A3`, `A4`,
|
21522 | * `A5`, `A6`, `Legal`, `Letter`, `Tabloid` or an Object containing `height` and
|
21523 | * `width`.
|
21524 | */
|
21525 | pageSize?: (('A0' | 'A1' | 'A2' | 'A3' | 'A4' | 'A5' | 'A6' | 'Legal' | 'Letter' | 'Tabloid')) | (Size);
|
21526 | }
|
21527 |
|
21528 | interface WebContentsViewConstructorOptions {
|
21529 | /**
|
21530 | * Settings of web page's features.
|
21531 | */
|
21532 | webPreferences?: WebPreferences;
|
21533 | /**
|
21534 | * If present, the given WebContents will be adopted by the WebContentsView. A
|
21535 | * WebContents may only be presented in one WebContentsView at a time.
|
21536 | */
|
21537 | webContents?: WebContents;
|
21538 | }
|
21539 |
|
21540 | interface WebContentsWillFrameNavigateEventParams {
|
21541 | /**
|
21542 | * The URL the frame is navigating to.
|
21543 | */
|
21544 | url: string;
|
21545 | /**
|
21546 | * This event does not fire for same document navigations using window.history api
|
21547 | * and reference fragment navigations. This property is always set to `false` for
|
21548 | * this event.
|
21549 | */
|
21550 | isSameDocument: boolean;
|
21551 | /**
|
21552 | * True if the navigation is taking place in a main frame.
|
21553 | */
|
21554 | isMainFrame: boolean;
|
21555 | /**
|
21556 | * The frame to be navigated.
|
21557 | */
|
21558 | frame: WebFrameMain;
|
21559 | /**
|
21560 | * The frame which initiated the navigation, which can be a parent frame (e.g. via
|
21561 | * `window.open` with a frame's name), or null if the navigation was not initiated
|
21562 | * by a frame. This can also be null if the initiating frame was deleted before the
|
21563 | * event was emitted.
|
21564 | */
|
21565 | initiator?: WebFrameMain;
|
21566 | }
|
21567 |
|
21568 | interface WebContentsWillNavigateEventParams {
|
21569 | /**
|
21570 | * The URL the frame is navigating to.
|
21571 | */
|
21572 | url: string;
|
21573 | /**
|
21574 | * This event does not fire for same document navigations using window.history api
|
21575 | * and reference fragment navigations. This property is always set to `false` for
|
21576 | * this event.
|
21577 | */
|
21578 | isSameDocument: boolean;
|
21579 | /**
|
21580 | * True if the navigation is taking place in a main frame.
|
21581 | */
|
21582 | isMainFrame: boolean;
|
21583 | /**
|
21584 | * The frame to be navigated.
|
21585 | */
|
21586 | frame: WebFrameMain;
|
21587 | /**
|
21588 | * The frame which initiated the navigation, which can be a parent frame (e.g. via
|
21589 | * `window.open` with a frame's name), or null if the navigation was not initiated
|
21590 | * by a frame. This can also be null if the initiating frame was deleted before the
|
21591 | * event was emitted.
|
21592 | */
|
21593 | initiator?: WebFrameMain;
|
21594 | }
|
21595 |
|
21596 | interface WebContentsWillRedirectEventParams {
|
21597 | /**
|
21598 | * The URL the frame is navigating to.
|
21599 | */
|
21600 | url: string;
|
21601 | /**
|
21602 | * Whether the navigation happened without changing document. Examples of same
|
21603 | * document navigations are reference fragment navigations, pushState/replaceState,
|
21604 | * and same page history navigation.
|
21605 | */
|
21606 | isSameDocument: boolean;
|
21607 | /**
|
21608 | * True if the navigation is taking place in a main frame.
|
21609 | */
|
21610 | isMainFrame: boolean;
|
21611 | /**
|
21612 | * The frame to be navigated.
|
21613 | */
|
21614 | frame: WebFrameMain;
|
21615 | /**
|
21616 | * The frame which initiated the navigation, which can be a parent frame (e.g. via
|
21617 | * `window.open` with a frame's name), or null if the navigation was not initiated
|
21618 | * by a frame. This can also be null if the initiating frame was deleted before the
|
21619 | * event was emitted.
|
21620 | */
|
21621 | initiator?: WebFrameMain;
|
21622 | }
|
21623 |
|
21624 | interface WebRTCUDPPortRange {
|
21625 | /**
|
21626 | * The minimum UDP port number that WebRTC should use.
|
21627 | */
|
21628 | min: number;
|
21629 | /**
|
21630 | * The maximum UDP port number that WebRTC should use.
|
21631 | */
|
21632 | max: number;
|
21633 | }
|
21634 |
|
21635 | interface WebviewTagPrintOptions {
|
21636 | /**
|
21637 | * Don't ask user for print settings. Default is `false`.
|
21638 | */
|
21639 | silent?: boolean;
|
21640 | /**
|
21641 | * Prints the background color and image of the web page. Default is `false`.
|
21642 | */
|
21643 | printBackground?: boolean;
|
21644 | /**
|
21645 | * Set the printer device name to use. Must be the system-defined name and not the
|
21646 | * 'friendly' name, e.g 'Brother_QL_820NWB' and not 'Brother QL-820NWB'.
|
21647 | */
|
21648 | deviceName?: string;
|
21649 | /**
|
21650 | * Set whether the printed web page will be in color or grayscale. Default is
|
21651 | * `true`.
|
21652 | */
|
21653 | color?: boolean;
|
21654 | margins?: Margins;
|
21655 | /**
|
21656 | * Whether the web page should be printed in landscape mode. Default is `false`.
|
21657 | */
|
21658 | landscape?: boolean;
|
21659 | /**
|
21660 | * The scale factor of the web page.
|
21661 | */
|
21662 | scaleFactor?: number;
|
21663 | /**
|
21664 | * The number of pages to print per page sheet.
|
21665 | */
|
21666 | pagesPerSheet?: number;
|
21667 | /**
|
21668 | * Whether the web page should be collated.
|
21669 | */
|
21670 | collate?: boolean;
|
21671 | /**
|
21672 | * The number of copies of the web page to print.
|
21673 | */
|
21674 | copies?: number;
|
21675 | /**
|
21676 | * The page range to print.
|
21677 | */
|
21678 | pageRanges?: PageRanges[];
|
21679 | /**
|
21680 | * Set the duplex mode of the printed web page. Can be `simplex`, `shortEdge`, or
|
21681 | * `longEdge`.
|
21682 | */
|
21683 | duplexMode?: ('simplex' | 'shortEdge' | 'longEdge');
|
21684 | dpi?: Record<string, number>;
|
21685 | /**
|
21686 | * string to be printed as page header.
|
21687 | */
|
21688 | header?: string;
|
21689 | /**
|
21690 | * string to be printed as page footer.
|
21691 | */
|
21692 | footer?: string;
|
21693 | /**
|
21694 | * Specify page size of the printed document. Can be `A3`, `A4`, `A5`, `Legal`,
|
21695 | * `Letter`, `Tabloid` or an Object containing `height` in microns.
|
21696 | */
|
21697 | pageSize?: (('A3' | 'A4' | 'A5' | 'Legal' | 'Letter' | 'Tabloid')) | (Size);
|
21698 | }
|
21699 |
|
21700 | interface WillFrameNavigateEvent extends DOMEvent {
|
21701 | url: string;
|
21702 | isMainFrame: boolean;
|
21703 | frameProcessId: number;
|
21704 | frameRoutingId: number;
|
21705 | }
|
21706 |
|
21707 | interface WillNavigateEvent extends DOMEvent {
|
21708 | url: string;
|
21709 | }
|
21710 |
|
21711 | interface WillResizeDetails {
|
21712 | /**
|
21713 | * The edge of the window being dragged for resizing. Can be `bottom`, `left`,
|
21714 | * `right`, `top-left`, `top-right`, `bottom-left` or `bottom-right`.
|
21715 | */
|
21716 | edge: ('bottom' | 'left' | 'right' | 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right');
|
21717 | }
|
21718 |
|
21719 | interface EditFlags {
|
21720 | /**
|
21721 | * Whether the renderer believes it can undo.
|
21722 | */
|
21723 | canUndo: boolean;
|
21724 | /**
|
21725 | * Whether the renderer believes it can redo.
|
21726 | */
|
21727 | canRedo: boolean;
|
21728 | /**
|
21729 | * Whether the renderer believes it can cut.
|
21730 | */
|
21731 | canCut: boolean;
|
21732 | /**
|
21733 | * Whether the renderer believes it can copy.
|
21734 | */
|
21735 | canCopy: boolean;
|
21736 | /**
|
21737 | * Whether the renderer believes it can paste.
|
21738 | */
|
21739 | canPaste: boolean;
|
21740 | /**
|
21741 | * Whether the renderer believes it can delete.
|
21742 | */
|
21743 | canDelete: boolean;
|
21744 | /**
|
21745 | * Whether the renderer believes it can select all.
|
21746 | */
|
21747 | canSelectAll: boolean;
|
21748 | /**
|
21749 | * Whether the renderer believes it can edit text richly.
|
21750 | */
|
21751 | canEditRichly: boolean;
|
21752 | }
|
21753 |
|
21754 | interface Env {
|
21755 | }
|
21756 |
|
21757 | interface FoundInPageResult {
|
21758 | requestId: number;
|
21759 | /**
|
21760 | * Position of the active match.
|
21761 | */
|
21762 | activeMatchOrdinal: number;
|
21763 | /**
|
21764 | * Number of Matches.
|
21765 | */
|
21766 | matches: number;
|
21767 | /**
|
21768 | * Coordinates of first match region.
|
21769 | */
|
21770 | selectionArea: Rectangle;
|
21771 | finalUpdate: boolean;
|
21772 | }
|
21773 |
|
21774 | interface LaunchItems {
|
21775 | /**
|
21776 | * name value of a registry entry.
|
21777 | *
|
21778 | * @platform win32
|
21779 | */
|
21780 | name: string;
|
21781 | /**
|
21782 | * The executable to an app that corresponds to a registry entry.
|
21783 | *
|
21784 | * @platform win32
|
21785 | */
|
21786 | path: string;
|
21787 | /**
|
21788 | * the command-line arguments to pass to the executable.
|
21789 | *
|
21790 | * @platform win32
|
21791 | */
|
21792 | args: string[];
|
21793 | /**
|
21794 | * one of `user` or `machine`. Indicates whether the registry entry is under
|
21795 | * `HKEY_CURRENT USER` or `HKEY_LOCAL_MACHINE`.
|
21796 | *
|
21797 | * @platform win32
|
21798 | */
|
21799 | scope: string;
|
21800 | /**
|
21801 | * `true` if the app registry key is startup approved and therefore shows as
|
21802 | * `enabled` in Task Manager and Windows settings.
|
21803 | *
|
21804 | * @platform win32
|
21805 | */
|
21806 | enabled: boolean;
|
21807 | }
|
21808 |
|
21809 | interface Margins {
|
21810 | /**
|
21811 | * Can be `default`, `none`, `printableArea`, or `custom`. If `custom` is chosen,
|
21812 | * you will also need to specify `top`, `bottom`, `left`, and `right`.
|
21813 | */
|
21814 | marginType?: ('default' | 'none' | 'printableArea' | 'custom');
|
21815 | /**
|
21816 | * The top margin of the printed web page, in pixels.
|
21817 | */
|
21818 | top?: number;
|
21819 | /**
|
21820 | * The bottom margin of the printed web page, in pixels.
|
21821 | */
|
21822 | bottom?: number;
|
21823 | /**
|
21824 | * The left margin of the printed web page, in pixels.
|
21825 | */
|
21826 | left?: number;
|
21827 | /**
|
21828 | * The right margin of the printed web page, in pixels.
|
21829 | */
|
21830 | right?: number;
|
21831 | }
|
21832 |
|
21833 | interface MediaFlags {
|
21834 | /**
|
21835 | * Whether the media element has crashed.
|
21836 | */
|
21837 | inError: boolean;
|
21838 | /**
|
21839 | * Whether the media element is paused.
|
21840 | */
|
21841 | isPaused: boolean;
|
21842 | /**
|
21843 | * Whether the media element is muted.
|
21844 | */
|
21845 | isMuted: boolean;
|
21846 | /**
|
21847 | * Whether the media element has audio.
|
21848 | */
|
21849 | hasAudio: boolean;
|
21850 | /**
|
21851 | * Whether the media element is looping.
|
21852 | */
|
21853 | isLooping: boolean;
|
21854 | /**
|
21855 | * Whether the media element's controls are visible.
|
21856 | */
|
21857 | isControlsVisible: boolean;
|
21858 | /**
|
21859 | * Whether the media element's controls are toggleable.
|
21860 | */
|
21861 | canToggleControls: boolean;
|
21862 | /**
|
21863 | * Whether the media element can be printed.
|
21864 | */
|
21865 | canPrint: boolean;
|
21866 | /**
|
21867 | * Whether or not the media element can be downloaded.
|
21868 | */
|
21869 | canSave: boolean;
|
21870 | /**
|
21871 | * Whether the media element can show picture-in-picture.
|
21872 | */
|
21873 | canShowPictureInPicture: boolean;
|
21874 | /**
|
21875 | * Whether the media element is currently showing picture-in-picture.
|
21876 | */
|
21877 | isShowingPictureInPicture: boolean;
|
21878 | /**
|
21879 | * Whether the media element can be rotated.
|
21880 | */
|
21881 | canRotate: boolean;
|
21882 | /**
|
21883 | * Whether the media element can be looped.
|
21884 | */
|
21885 | canLoop: boolean;
|
21886 | }
|
21887 |
|
21888 | interface PageRanges {
|
21889 | /**
|
21890 | * Index of the first page to print (0-based).
|
21891 | */
|
21892 | from: number;
|
21893 | /**
|
21894 | * Index of the last page to print (inclusive) (0-based).
|
21895 | */
|
21896 | to: number;
|
21897 | }
|
21898 |
|
21899 | interface Params {
|
21900 | /**
|
21901 | * x coordinate.
|
21902 | */
|
21903 | x: number;
|
21904 | /**
|
21905 | * y coordinate.
|
21906 | */
|
21907 | y: number;
|
21908 | /**
|
21909 | * URL of the link that encloses the node the context menu was invoked on.
|
21910 | */
|
21911 | linkURL: string;
|
21912 | /**
|
21913 | * Text associated with the link. May be an empty string if the contents of the
|
21914 | * link are an image.
|
21915 | */
|
21916 | linkText: string;
|
21917 | /**
|
21918 | * URL of the top level page that the context menu was invoked on.
|
21919 | */
|
21920 | pageURL: string;
|
21921 | /**
|
21922 | * URL of the subframe that the context menu was invoked on.
|
21923 | */
|
21924 | frameURL: string;
|
21925 | /**
|
21926 | * Source URL for the element that the context menu was invoked on. Elements with
|
21927 | * source URLs are images, audio and video.
|
21928 | */
|
21929 | srcURL: string;
|
21930 | /**
|
21931 | * Type of the node the context menu was invoked on. Can be `none`, `image`,
|
21932 | * `audio`, `video`, `canvas`, `file` or `plugin`.
|
21933 | */
|
21934 | mediaType: ('none' | 'image' | 'audio' | 'video' | 'canvas' | 'file' | 'plugin');
|
21935 | /**
|
21936 | * Whether the context menu was invoked on an image which has non-empty contents.
|
21937 | */
|
21938 | hasImageContents: boolean;
|
21939 | /**
|
21940 | * Whether the context is editable.
|
21941 | */
|
21942 | isEditable: boolean;
|
21943 | /**
|
21944 | * Text of the selection that the context menu was invoked on.
|
21945 | */
|
21946 | selectionText: string;
|
21947 | /**
|
21948 | * Title text of the selection that the context menu was invoked on.
|
21949 | */
|
21950 | titleText: string;
|
21951 | /**
|
21952 | * Alt text of the selection that the context menu was invoked on.
|
21953 | */
|
21954 | altText: string;
|
21955 | /**
|
21956 | * Suggested filename to be used when saving file through 'Save Link As' option of
|
21957 | * context menu.
|
21958 | */
|
21959 | suggestedFilename: string;
|
21960 | /**
|
21961 | * Rect representing the coordinates in the document space of the selection.
|
21962 | */
|
21963 | selectionRect: Rectangle;
|
21964 | /**
|
21965 | * Start position of the selection text.
|
21966 | */
|
21967 | selectionStartOffset: number;
|
21968 | /**
|
21969 | * The referrer policy of the frame on which the menu is invoked.
|
21970 | */
|
21971 | referrerPolicy: Referrer;
|
21972 | /**
|
21973 | * The misspelled word under the cursor, if any.
|
21974 | */
|
21975 | misspelledWord: string;
|
21976 | /**
|
21977 | * An array of suggested words to show the user to replace the `misspelledWord`.
|
21978 | * Only available if there is a misspelled word and spellchecker is enabled.
|
21979 | */
|
21980 | dictionarySuggestions: string[];
|
21981 | /**
|
21982 | * The character encoding of the frame on which the menu was invoked.
|
21983 | */
|
21984 | frameCharset: string;
|
21985 | /**
|
21986 | * The source that the context menu was invoked on. Possible values include `none`,
|
21987 | * `button-button`, `field-set`, `input-button`, `input-checkbox`, `input-color`,
|
21988 | * `input-date`, `input-datetime-local`, `input-email`, `input-file`,
|
21989 | * `input-hidden`, `input-image`, `input-month`, `input-number`, `input-password`,
|
21990 | * `input-radio`, `input-range`, `input-reset`, `input-search`, `input-submit`,
|
21991 | * `input-telephone`, `input-text`, `input-time`, `input-url`, `input-week`,
|
21992 | * `output`, `reset-button`, `select-list`, `select-list`, `select-multiple`,
|
21993 | * `select-one`, `submit-button`, and `text-area`,
|
21994 | */
|
21995 | formControlType: ('none' | 'button-button' | 'field-set' | 'input-button' | 'input-checkbox' | 'input-color' | 'input-date' | 'input-datetime-local' | 'input-email' | 'input-file' | 'input-hidden' | 'input-image' | 'input-month' | 'input-number' | 'input-password' | 'input-radio' | 'input-range' | 'input-reset' | 'input-search' | 'input-submit' | 'input-telephone' | 'input-text' | 'input-time' | 'input-url' | 'input-week' | 'output' | 'reset-button' | 'select-list' | 'select-list' | 'select-multiple' | 'select-one' | 'submit-button' | 'text-area');
|
21996 | /**
|
21997 | * If the context is editable, whether or not spellchecking is enabled.
|
21998 | */
|
21999 | spellcheckEnabled: boolean;
|
22000 | /**
|
22001 | * Input source that invoked the context menu. Can be `none`, `mouse`, `keyboard`,
|
22002 | * `touch`, `touchMenu`, `longPress`, `longTap`, `touchHandle`, `stylus`,
|
22003 | * `adjustSelection`, or `adjustSelectionReset`.
|
22004 | */
|
22005 | menuSourceType: ('none' | 'mouse' | 'keyboard' | 'touch' | 'touchMenu' | 'longPress' | 'longTap' | 'touchHandle' | 'stylus' | 'adjustSelection' | 'adjustSelectionReset');
|
22006 | /**
|
22007 | * The flags for the media element the context menu was invoked on.
|
22008 | */
|
22009 | mediaFlags: MediaFlags;
|
22010 | /**
|
22011 | * These flags indicate whether the renderer believes it is able to perform the
|
22012 | * corresponding action.
|
22013 | */
|
22014 | editFlags: EditFlags;
|
22015 | }
|
22016 |
|
22017 | interface Video {
|
22018 | /**
|
22019 | * The id of the stream being granted. This will usually come from a
|
22020 | * DesktopCapturerSource object.
|
22021 | */
|
22022 | id: string;
|
22023 | /**
|
22024 | * The name of the stream being granted. This will usually come from a
|
22025 | * DesktopCapturerSource object.
|
22026 | */
|
22027 | name: string;
|
22028 | }
|
22029 |
|
22030 |
|
22031 |
|
22032 | namespace Common {
|
22033 | type Event<Params extends object = {}> = Electron.Event<Params>;
|
22034 | const clipboard: Clipboard;
|
22035 | type Clipboard = Electron.Clipboard;
|
22036 | const crashReporter: CrashReporter;
|
22037 | type CrashReporter = Electron.CrashReporter;
|
22038 | const nativeImage: typeof NativeImage;
|
22039 | type NativeImage = Electron.NativeImage;
|
22040 | const shell: Shell;
|
22041 | type Shell = Electron.Shell;
|
22042 | type AboutPanelOptionsOptions = Electron.AboutPanelOptionsOptions;
|
22043 | type AddRepresentationOptions = Electron.AddRepresentationOptions;
|
22044 | type AdjustSelectionOptions = Electron.AdjustSelectionOptions;
|
22045 | type AnimationSettings = Electron.AnimationSettings;
|
22046 | type AppDetailsOptions = Electron.AppDetailsOptions;
|
22047 | type ApplicationInfoForProtocolReturnValue = Electron.ApplicationInfoForProtocolReturnValue;
|
22048 | type AuthenticationResponseDetails = Electron.AuthenticationResponseDetails;
|
22049 | type AuthInfo = Electron.AuthInfo;
|
22050 | type AutoResizeOptions = Electron.AutoResizeOptions;
|
22051 | type BeforeSendResponse = Electron.BeforeSendResponse;
|
22052 | type BitmapOptions = Electron.BitmapOptions;
|
22053 | type BlinkMemoryInfo = Electron.BlinkMemoryInfo;
|
22054 | type BluetoothPairingHandlerHandlerDetails = Electron.BluetoothPairingHandlerHandlerDetails;
|
22055 | type BrowserViewConstructorOptions = Electron.BrowserViewConstructorOptions;
|
22056 | type CallbackResponse = Electron.CallbackResponse;
|
22057 | type CertificateTrustDialogOptions = Electron.CertificateTrustDialogOptions;
|
22058 | type ClearCodeCachesOptions = Electron.ClearCodeCachesOptions;
|
22059 | type ClearDataOptions = Electron.ClearDataOptions;
|
22060 | type ClearStorageDataOptions = Electron.ClearStorageDataOptions;
|
22061 | type ClientCertRequestParams = Electron.ClientCertRequestParams;
|
22062 | type ClientRequestConstructorOptions = Electron.ClientRequestConstructorOptions;
|
22063 | type CloseOpts = Electron.CloseOpts;
|
22064 | type Config = Electron.Config;
|
22065 | type ConfigureHostResolverOptions = Electron.ConfigureHostResolverOptions;
|
22066 | type ConsoleMessageEvent = Electron.ConsoleMessageEvent;
|
22067 | type ContextMenuEvent = Electron.ContextMenuEvent;
|
22068 | type ContextMenuParams = Electron.ContextMenuParams;
|
22069 | type ContinueActivityDetails = Electron.ContinueActivityDetails;
|
22070 | type CookiesGetFilter = Electron.CookiesGetFilter;
|
22071 | type CookiesSetDetails = Electron.CookiesSetDetails;
|
22072 | type CrashReporterStartOptions = Electron.CrashReporterStartOptions;
|
22073 | type CreateFromBitmapOptions = Electron.CreateFromBitmapOptions;
|
22074 | type CreateFromBufferOptions = Electron.CreateFromBufferOptions;
|
22075 | type CreateInterruptedDownloadOptions = Electron.CreateInterruptedDownloadOptions;
|
22076 | type Data = Electron.Data;
|
22077 | type DefaultFontFamily = Electron.DefaultFontFamily;
|
22078 | type Details = Electron.Details;
|
22079 | type DevicePermissionHandlerHandlerDetails = Electron.DevicePermissionHandlerHandlerDetails;
|
22080 | type DevtoolsOpenUrlEvent = Electron.DevtoolsOpenUrlEvent;
|
22081 | type DevtoolsSearchQueryEvent = Electron.DevtoolsSearchQueryEvent;
|
22082 | type DidChangeThemeColorEvent = Electron.DidChangeThemeColorEvent;
|
22083 | type DidCreateWindowDetails = Electron.DidCreateWindowDetails;
|
22084 | type DidFailLoadEvent = Electron.DidFailLoadEvent;
|
22085 | type DidFrameFinishLoadEvent = Electron.DidFrameFinishLoadEvent;
|
22086 | type DidFrameNavigateEvent = Electron.DidFrameNavigateEvent;
|
22087 | type DidNavigateEvent = Electron.DidNavigateEvent;
|
22088 | type DidNavigateInPageEvent = Electron.DidNavigateInPageEvent;
|
22089 | type DidRedirectNavigationEvent = Electron.DidRedirectNavigationEvent;
|
22090 | type DidStartNavigationEvent = Electron.DidStartNavigationEvent;
|
22091 | type DisplayBalloonOptions = Electron.DisplayBalloonOptions;
|
22092 | type DisplayMediaRequestHandlerHandlerRequest = Electron.DisplayMediaRequestHandlerHandlerRequest;
|
22093 | type DisplayMediaRequestHandlerOpts = Electron.DisplayMediaRequestHandlerOpts;
|
22094 | type DownloadURLOptions = Electron.DownloadURLOptions;
|
22095 | type EnableNetworkEmulationOptions = Electron.EnableNetworkEmulationOptions;
|
22096 | type FeedURLOptions = Electron.FeedURLOptions;
|
22097 | type FileIconOptions = Electron.FileIconOptions;
|
22098 | type FileSystemAccessRestrictedDetails = Electron.FileSystemAccessRestrictedDetails;
|
22099 | type FindInPageOptions = Electron.FindInPageOptions;
|
22100 | type FocusOptions = Electron.FocusOptions;
|
22101 | type ForkOptions = Electron.ForkOptions;
|
22102 | type FoundInPageEvent = Electron.FoundInPageEvent;
|
22103 | type FrameCreatedDetails = Electron.FrameCreatedDetails;
|
22104 | type FromPartitionOptions = Electron.FromPartitionOptions;
|
22105 | type FromPathOptions = Electron.FromPathOptions;
|
22106 | type HandlerDetails = Electron.HandlerDetails;
|
22107 | type HeadersReceivedResponse = Electron.HeadersReceivedResponse;
|
22108 | type HeapStatistics = Electron.HeapStatistics;
|
22109 | type HidDeviceAddedDetails = Electron.HidDeviceAddedDetails;
|
22110 | type HidDeviceRemovedDetails = Electron.HidDeviceRemovedDetails;
|
22111 | type HidDeviceRevokedDetails = Electron.HidDeviceRevokedDetails;
|
22112 | type IgnoreMouseEventsOptions = Electron.IgnoreMouseEventsOptions;
|
22113 | type ImportCertificateOptions = Electron.ImportCertificateOptions;
|
22114 | type Info = Electron.Info;
|
22115 | type Input = Electron.Input;
|
22116 | type InsertCSSOptions = Electron.InsertCSSOptions;
|
22117 | type IpcMessageEvent = Electron.IpcMessageEvent;
|
22118 | type Item = Electron.Item;
|
22119 | type JumpListSettings = Electron.JumpListSettings;
|
22120 | type LoadCommitEvent = Electron.LoadCommitEvent;
|
22121 | type LoadExtensionOptions = Electron.LoadExtensionOptions;
|
22122 | type LoadFileOptions = Electron.LoadFileOptions;
|
22123 | type LoadURLOptions = Electron.LoadURLOptions;
|
22124 | type LoginAuthenticationResponseDetails = Electron.LoginAuthenticationResponseDetails;
|
22125 | type LoginItemSettings = Electron.LoginItemSettings;
|
22126 | type LoginItemSettingsOptions = Electron.LoginItemSettingsOptions;
|
22127 | type MenuItemConstructorOptions = Electron.MenuItemConstructorOptions;
|
22128 | type MessageBoxOptions = Electron.MessageBoxOptions;
|
22129 | type MessageBoxReturnValue = Electron.MessageBoxReturnValue;
|
22130 | type MessageBoxSyncOptions = Electron.MessageBoxSyncOptions;
|
22131 | type MessageDetails = Electron.MessageDetails;
|
22132 | type MessageEvent = Electron.MessageEvent;
|
22133 | type MoveToApplicationsFolderOptions = Electron.MoveToApplicationsFolderOptions;
|
22134 | type NotificationConstructorOptions = Electron.NotificationConstructorOptions;
|
22135 | type OnBeforeRedirectListenerDetails = Electron.OnBeforeRedirectListenerDetails;
|
22136 | type OnBeforeRequestListenerDetails = Electron.OnBeforeRequestListenerDetails;
|
22137 | type OnBeforeSendHeadersListenerDetails = Electron.OnBeforeSendHeadersListenerDetails;
|
22138 | type OnCompletedListenerDetails = Electron.OnCompletedListenerDetails;
|
22139 | type OnErrorOccurredListenerDetails = Electron.OnErrorOccurredListenerDetails;
|
22140 | type OnHeadersReceivedListenerDetails = Electron.OnHeadersReceivedListenerDetails;
|
22141 | type OnResponseStartedListenerDetails = Electron.OnResponseStartedListenerDetails;
|
22142 | type OnSendHeadersListenerDetails = Electron.OnSendHeadersListenerDetails;
|
22143 | type OpenDevToolsOptions = Electron.OpenDevToolsOptions;
|
22144 | type OpenDialogOptions = Electron.OpenDialogOptions;
|
22145 | type OpenDialogReturnValue = Electron.OpenDialogReturnValue;
|
22146 | type OpenDialogSyncOptions = Electron.OpenDialogSyncOptions;
|
22147 | type OpenExternalOptions = Electron.OpenExternalOptions;
|
22148 | type Options = Electron.Options;
|
22149 | type Opts = Electron.Opts;
|
22150 | type PageFaviconUpdatedEvent = Electron.PageFaviconUpdatedEvent;
|
22151 | type PageTitleUpdatedEvent = Electron.PageTitleUpdatedEvent;
|
22152 | type Parameters = Electron.Parameters;
|
22153 | type Payment = Electron.Payment;
|
22154 | type PermissionCheckHandlerHandlerDetails = Electron.PermissionCheckHandlerHandlerDetails;
|
22155 | type PluginCrashedEvent = Electron.PluginCrashedEvent;
|
22156 | type PopupOptions = Electron.PopupOptions;
|
22157 | type PreconnectOptions = Electron.PreconnectOptions;
|
22158 | type PrintToPDFOptions = Electron.PrintToPDFOptions;
|
22159 | type Privileges = Electron.Privileges;
|
22160 | type ProgressBarOptions = Electron.ProgressBarOptions;
|
22161 | type Provider = Electron.Provider;
|
22162 | type PurchaseProductOpts = Electron.PurchaseProductOpts;
|
22163 | type ReadBookmark = Electron.ReadBookmark;
|
22164 | type RegistrationCompletedDetails = Electron.RegistrationCompletedDetails;
|
22165 | type RelaunchOptions = Electron.RelaunchOptions;
|
22166 | type RenderProcessGoneEvent = Electron.RenderProcessGoneEvent;
|
22167 | type Request = Electron.Request;
|
22168 | type ResizeOptions = Electron.ResizeOptions;
|
22169 | type ResolveHostOptions = Electron.ResolveHostOptions;
|
22170 | type ResourceUsage = Electron.ResourceUsage;
|
22171 | type Response = Electron.Response;
|
22172 | type Result = Electron.Result;
|
22173 | type SaveDialogOptions = Electron.SaveDialogOptions;
|
22174 | type SaveDialogReturnValue = Electron.SaveDialogReturnValue;
|
22175 | type SaveDialogSyncOptions = Electron.SaveDialogSyncOptions;
|
22176 | type SelectHidDeviceDetails = Electron.SelectHidDeviceDetails;
|
22177 | type SelectUsbDeviceDetails = Electron.SelectUsbDeviceDetails;
|
22178 | type SerialPortRevokedDetails = Electron.SerialPortRevokedDetails;
|
22179 | type Settings = Electron.Settings;
|
22180 | type SourcesOptions = Electron.SourcesOptions;
|
22181 | type StartLoggingOptions = Electron.StartLoggingOptions;
|
22182 | type Streams = Electron.Streams;
|
22183 | type SystemMemoryInfo = Electron.SystemMemoryInfo;
|
22184 | type TitleBarOverlay = Electron.TitleBarOverlay;
|
22185 | type TitleBarOverlayOptions = Electron.TitleBarOverlayOptions;
|
22186 | type TitleOptions = Electron.TitleOptions;
|
22187 | type ToBitmapOptions = Electron.ToBitmapOptions;
|
22188 | type ToDataURLOptions = Electron.ToDataURLOptions;
|
22189 | type ToPNGOptions = Electron.ToPNGOptions;
|
22190 | type TouchBarButtonConstructorOptions = Electron.TouchBarButtonConstructorOptions;
|
22191 | type TouchBarColorPickerConstructorOptions = Electron.TouchBarColorPickerConstructorOptions;
|
22192 | type TouchBarConstructorOptions = Electron.TouchBarConstructorOptions;
|
22193 | type TouchBarGroupConstructorOptions = Electron.TouchBarGroupConstructorOptions;
|
22194 | type TouchBarLabelConstructorOptions = Electron.TouchBarLabelConstructorOptions;
|
22195 | type TouchBarPopoverConstructorOptions = Electron.TouchBarPopoverConstructorOptions;
|
22196 | type TouchBarScrubberConstructorOptions = Electron.TouchBarScrubberConstructorOptions;
|
22197 | type TouchBarSegmentedControlConstructorOptions = Electron.TouchBarSegmentedControlConstructorOptions;
|
22198 | type TouchBarSliderConstructorOptions = Electron.TouchBarSliderConstructorOptions;
|
22199 | type TouchBarSpacerConstructorOptions = Electron.TouchBarSpacerConstructorOptions;
|
22200 | type TraceBufferUsageReturnValue = Electron.TraceBufferUsageReturnValue;
|
22201 | type UdpPortRange = Electron.UdpPortRange;
|
22202 | type UpdateTargetUrlEvent = Electron.UpdateTargetUrlEvent;
|
22203 | type UploadProgress = Electron.UploadProgress;
|
22204 | type UsbDeviceRevokedDetails = Electron.UsbDeviceRevokedDetails;
|
22205 | type USBProtectedClassesHandlerHandlerDetails = Electron.USBProtectedClassesHandlerHandlerDetails;
|
22206 | type VisibleOnAllWorkspacesOptions = Electron.VisibleOnAllWorkspacesOptions;
|
22207 | type WebContentsAudioStateChangedEventParams = Electron.WebContentsAudioStateChangedEventParams;
|
22208 | type WebContentsDidRedirectNavigationEventParams = Electron.WebContentsDidRedirectNavigationEventParams;
|
22209 | type WebContentsDidStartNavigationEventParams = Electron.WebContentsDidStartNavigationEventParams;
|
22210 | type WebContentsPrintOptions = Electron.WebContentsPrintOptions;
|
22211 | type WebContentsViewConstructorOptions = Electron.WebContentsViewConstructorOptions;
|
22212 | type WebContentsWillFrameNavigateEventParams = Electron.WebContentsWillFrameNavigateEventParams;
|
22213 | type WebContentsWillNavigateEventParams = Electron.WebContentsWillNavigateEventParams;
|
22214 | type WebContentsWillRedirectEventParams = Electron.WebContentsWillRedirectEventParams;
|
22215 | type WebRTCUDPPortRange = Electron.WebRTCUDPPortRange;
|
22216 | type WebviewTagPrintOptions = Electron.WebviewTagPrintOptions;
|
22217 | type WillFrameNavigateEvent = Electron.WillFrameNavigateEvent;
|
22218 | type WillNavigateEvent = Electron.WillNavigateEvent;
|
22219 | type WillResizeDetails = Electron.WillResizeDetails;
|
22220 | type EditFlags = Electron.EditFlags;
|
22221 | type Env = Electron.Env;
|
22222 | type FoundInPageResult = Electron.FoundInPageResult;
|
22223 | type LaunchItems = Electron.LaunchItems;
|
22224 | type Margins = Electron.Margins;
|
22225 | type MediaFlags = Electron.MediaFlags;
|
22226 | type PageRanges = Electron.PageRanges;
|
22227 | type Params = Electron.Params;
|
22228 | type Video = Electron.Video;
|
22229 | type BaseWindowConstructorOptions = Electron.BaseWindowConstructorOptions;
|
22230 | type BrowserWindowConstructorOptions = Electron.BrowserWindowConstructorOptions;
|
22231 | type BluetoothDevice = Electron.BluetoothDevice;
|
22232 | type Certificate = Electron.Certificate;
|
22233 | type CertificatePrincipal = Electron.CertificatePrincipal;
|
22234 | type Cookie = Electron.Cookie;
|
22235 | type CPUUsage = Electron.CPUUsage;
|
22236 | type CrashReport = Electron.CrashReport;
|
22237 | type CustomScheme = Electron.CustomScheme;
|
22238 | type DesktopCapturerSource = Electron.DesktopCapturerSource;
|
22239 | type Display = Electron.Display;
|
22240 | type Extension = Electron.Extension;
|
22241 | type ExtensionInfo = Electron.ExtensionInfo;
|
22242 | type FileFilter = Electron.FileFilter;
|
22243 | type FilePathWithHeaders = Electron.FilePathWithHeaders;
|
22244 | type FilesystemPermissionRequest = Electron.FilesystemPermissionRequest;
|
22245 | type GPUFeatureStatus = Electron.GPUFeatureStatus;
|
22246 | type HIDDevice = Electron.HIDDevice;
|
22247 | type InputEvent = Electron.InputEvent;
|
22248 | type IpcMainEvent = Electron.IpcMainEvent;
|
22249 | type IpcMainInvokeEvent = Electron.IpcMainInvokeEvent;
|
22250 | type IpcRendererEvent = Electron.IpcRendererEvent;
|
22251 | type JumpListCategory = Electron.JumpListCategory;
|
22252 | type JumpListItem = Electron.JumpListItem;
|
22253 | type KeyboardEvent = Electron.KeyboardEvent;
|
22254 | type KeyboardInputEvent = Electron.KeyboardInputEvent;
|
22255 | type MediaAccessPermissionRequest = Electron.MediaAccessPermissionRequest;
|
22256 | type MemoryInfo = Electron.MemoryInfo;
|
22257 | type MemoryUsageDetails = Electron.MemoryUsageDetails;
|
22258 | type MimeTypedBuffer = Electron.MimeTypedBuffer;
|
22259 | type MouseInputEvent = Electron.MouseInputEvent;
|
22260 | type MouseWheelInputEvent = Electron.MouseWheelInputEvent;
|
22261 | type NavigationEntry = Electron.NavigationEntry;
|
22262 | type NotificationAction = Electron.NotificationAction;
|
22263 | type NotificationResponse = Electron.NotificationResponse;
|
22264 | type OpenExternalPermissionRequest = Electron.OpenExternalPermissionRequest;
|
22265 | type PaymentDiscount = Electron.PaymentDiscount;
|
22266 | type PermissionRequest = Electron.PermissionRequest;
|
22267 | type Point = Electron.Point;
|
22268 | type PostBody = Electron.PostBody;
|
22269 | type PrinterInfo = Electron.PrinterInfo;
|
22270 | type ProcessMemoryInfo = Electron.ProcessMemoryInfo;
|
22271 | type ProcessMetric = Electron.ProcessMetric;
|
22272 | type Product = Electron.Product;
|
22273 | type ProductDiscount = Electron.ProductDiscount;
|
22274 | type ProductSubscriptionPeriod = Electron.ProductSubscriptionPeriod;
|
22275 | type ProtocolRequest = Electron.ProtocolRequest;
|
22276 | type ProtocolResponse = Electron.ProtocolResponse;
|
22277 | type ProtocolResponseUploadData = Electron.ProtocolResponseUploadData;
|
22278 | type ProxyConfig = Electron.ProxyConfig;
|
22279 | type Rectangle = Electron.Rectangle;
|
22280 | type Referrer = Electron.Referrer;
|
22281 | type RenderProcessGoneDetails = Electron.RenderProcessGoneDetails;
|
22282 | type ResolvedEndpoint = Electron.ResolvedEndpoint;
|
22283 | type ResolvedHost = Electron.ResolvedHost;
|
22284 | type ScrubberItem = Electron.ScrubberItem;
|
22285 | type SegmentedControlSegment = Electron.SegmentedControlSegment;
|
22286 | type SerialPort = Electron.SerialPort;
|
22287 | type ServiceWorkerInfo = Electron.ServiceWorkerInfo;
|
22288 | type SharedWorkerInfo = Electron.SharedWorkerInfo;
|
22289 | type SharingItem = Electron.SharingItem;
|
22290 | type ShortcutDetails = Electron.ShortcutDetails;
|
22291 | type Size = Electron.Size;
|
22292 | type Task = Electron.Task;
|
22293 | type ThumbarButton = Electron.ThumbarButton;
|
22294 | type TraceCategoriesAndOptions = Electron.TraceCategoriesAndOptions;
|
22295 | type TraceConfig = Electron.TraceConfig;
|
22296 | type Transaction = Electron.Transaction;
|
22297 | type UploadData = Electron.UploadData;
|
22298 | type UploadFile = Electron.UploadFile;
|
22299 | type UploadRawData = Electron.UploadRawData;
|
22300 | type USBDevice = Electron.USBDevice;
|
22301 | type UserDefaultTypes = Electron.UserDefaultTypes;
|
22302 | type WebPreferences = Electron.WebPreferences;
|
22303 | type WebRequestFilter = Electron.WebRequestFilter;
|
22304 | type WebSource = Electron.WebSource;
|
22305 | type WindowOpenHandlerResponse = Electron.WindowOpenHandlerResponse;
|
22306 | }
|
22307 |
|
22308 | namespace Main {
|
22309 | type Event<Params extends object = {}> = Electron.Event<Params>;
|
22310 | const app: App;
|
22311 | type App = Electron.App;
|
22312 | const autoUpdater: AutoUpdater;
|
22313 | type AutoUpdater = Electron.AutoUpdater;
|
22314 | class BaseWindow extends Electron.BaseWindow {}
|
22315 | class BrowserView extends Electron.BrowserView {}
|
22316 | class BrowserWindow extends Electron.BrowserWindow {}
|
22317 | type ClientRequest = Electron.ClientRequest;
|
22318 | type CommandLine = Electron.CommandLine;
|
22319 | const contentTracing: ContentTracing;
|
22320 | type ContentTracing = Electron.ContentTracing;
|
22321 | type Cookies = Electron.Cookies;
|
22322 | type Debugger = Electron.Debugger;
|
22323 | const desktopCapturer: DesktopCapturer;
|
22324 | type DesktopCapturer = Electron.DesktopCapturer;
|
22325 | const dialog: Dialog;
|
22326 | type Dialog = Electron.Dialog;
|
22327 | type Dock = Electron.Dock;
|
22328 | type DownloadItem = Electron.DownloadItem;
|
22329 | const globalShortcut: GlobalShortcut;
|
22330 | type GlobalShortcut = Electron.GlobalShortcut;
|
22331 | const inAppPurchase: InAppPurchase;
|
22332 | type InAppPurchase = Electron.InAppPurchase;
|
22333 | type IncomingMessage = Electron.IncomingMessage;
|
22334 | const ipcMain: IpcMain;
|
22335 | type IpcMain = Electron.IpcMain;
|
22336 | class Menu extends Electron.Menu {}
|
22337 | class MenuItem extends Electron.MenuItem {}
|
22338 | class MessageChannelMain extends Electron.MessageChannelMain {}
|
22339 | type MessagePortMain = Electron.MessagePortMain;
|
22340 | const nativeTheme: NativeTheme;
|
22341 | type NativeTheme = Electron.NativeTheme;
|
22342 | type NavigationHistory = Electron.NavigationHistory;
|
22343 | const net: Net;
|
22344 | type Net = Electron.Net;
|
22345 | const netLog: NetLog;
|
22346 | type NetLog = Electron.NetLog;
|
22347 | class Notification extends Electron.Notification {}
|
22348 | const powerMonitor: PowerMonitor;
|
22349 | type PowerMonitor = Electron.PowerMonitor;
|
22350 | const powerSaveBlocker: PowerSaveBlocker;
|
22351 | type PowerSaveBlocker = Electron.PowerSaveBlocker;
|
22352 | const protocol: Protocol;
|
22353 | type Protocol = Electron.Protocol;
|
22354 | const pushNotifications: PushNotifications;
|
22355 | type PushNotifications = Electron.PushNotifications;
|
22356 | const safeStorage: SafeStorage;
|
22357 | type SafeStorage = Electron.SafeStorage;
|
22358 | const screen: Screen;
|
22359 | type Screen = Electron.Screen;
|
22360 | type ServiceWorkers = Electron.ServiceWorkers;
|
22361 | const session: typeof Session;
|
22362 | type Session = Electron.Session;
|
22363 | class ShareMenu extends Electron.ShareMenu {}
|
22364 | const systemPreferences: SystemPreferences;
|
22365 | type SystemPreferences = Electron.SystemPreferences;
|
22366 | class TouchBar extends Electron.TouchBar {}
|
22367 | type TouchBarButton = Electron.TouchBarButton;
|
22368 | type TouchBarColorPicker = Electron.TouchBarColorPicker;
|
22369 | type TouchBarGroup = Electron.TouchBarGroup;
|
22370 | type TouchBarLabel = Electron.TouchBarLabel;
|
22371 | type TouchBarOtherItemsProxy = Electron.TouchBarOtherItemsProxy;
|
22372 | type TouchBarPopover = Electron.TouchBarPopover;
|
22373 | type TouchBarScrubber = Electron.TouchBarScrubber;
|
22374 | type TouchBarSegmentedControl = Electron.TouchBarSegmentedControl;
|
22375 | type TouchBarSlider = Electron.TouchBarSlider;
|
22376 | type TouchBarSpacer = Electron.TouchBarSpacer;
|
22377 | class Tray extends Electron.Tray {}
|
22378 | const utilityProcess: typeof UtilityProcess;
|
22379 | type UtilityProcess = Electron.UtilityProcess;
|
22380 | class View extends Electron.View {}
|
22381 | const webContents: typeof WebContents;
|
22382 | type WebContents = Electron.WebContents;
|
22383 | class WebContentsView extends Electron.WebContentsView {}
|
22384 | const webFrameMain: typeof WebFrameMain;
|
22385 | type WebFrameMain = Electron.WebFrameMain;
|
22386 | type WebRequest = Electron.WebRequest;
|
22387 | type AboutPanelOptionsOptions = Electron.AboutPanelOptionsOptions;
|
22388 | type AddRepresentationOptions = Electron.AddRepresentationOptions;
|
22389 | type AdjustSelectionOptions = Electron.AdjustSelectionOptions;
|
22390 | type AnimationSettings = Electron.AnimationSettings;
|
22391 | type AppDetailsOptions = Electron.AppDetailsOptions;
|
22392 | type ApplicationInfoForProtocolReturnValue = Electron.ApplicationInfoForProtocolReturnValue;
|
22393 | type AuthenticationResponseDetails = Electron.AuthenticationResponseDetails;
|
22394 | type AuthInfo = Electron.AuthInfo;
|
22395 | type AutoResizeOptions = Electron.AutoResizeOptions;
|
22396 | type BeforeSendResponse = Electron.BeforeSendResponse;
|
22397 | type BitmapOptions = Electron.BitmapOptions;
|
22398 | type BlinkMemoryInfo = Electron.BlinkMemoryInfo;
|
22399 | type BluetoothPairingHandlerHandlerDetails = Electron.BluetoothPairingHandlerHandlerDetails;
|
22400 | type BrowserViewConstructorOptions = Electron.BrowserViewConstructorOptions;
|
22401 | type CallbackResponse = Electron.CallbackResponse;
|
22402 | type CertificateTrustDialogOptions = Electron.CertificateTrustDialogOptions;
|
22403 | type ClearCodeCachesOptions = Electron.ClearCodeCachesOptions;
|
22404 | type ClearDataOptions = Electron.ClearDataOptions;
|
22405 | type ClearStorageDataOptions = Electron.ClearStorageDataOptions;
|
22406 | type ClientCertRequestParams = Electron.ClientCertRequestParams;
|
22407 | type ClientRequestConstructorOptions = Electron.ClientRequestConstructorOptions;
|
22408 | type CloseOpts = Electron.CloseOpts;
|
22409 | type Config = Electron.Config;
|
22410 | type ConfigureHostResolverOptions = Electron.ConfigureHostResolverOptions;
|
22411 | type ConsoleMessageEvent = Electron.ConsoleMessageEvent;
|
22412 | type ContextMenuEvent = Electron.ContextMenuEvent;
|
22413 | type ContextMenuParams = Electron.ContextMenuParams;
|
22414 | type ContinueActivityDetails = Electron.ContinueActivityDetails;
|
22415 | type CookiesGetFilter = Electron.CookiesGetFilter;
|
22416 | type CookiesSetDetails = Electron.CookiesSetDetails;
|
22417 | type CrashReporterStartOptions = Electron.CrashReporterStartOptions;
|
22418 | type CreateFromBitmapOptions = Electron.CreateFromBitmapOptions;
|
22419 | type CreateFromBufferOptions = Electron.CreateFromBufferOptions;
|
22420 | type CreateInterruptedDownloadOptions = Electron.CreateInterruptedDownloadOptions;
|
22421 | type Data = Electron.Data;
|
22422 | type DefaultFontFamily = Electron.DefaultFontFamily;
|
22423 | type Details = Electron.Details;
|
22424 | type DevicePermissionHandlerHandlerDetails = Electron.DevicePermissionHandlerHandlerDetails;
|
22425 | type DevtoolsOpenUrlEvent = Electron.DevtoolsOpenUrlEvent;
|
22426 | type DevtoolsSearchQueryEvent = Electron.DevtoolsSearchQueryEvent;
|
22427 | type DidChangeThemeColorEvent = Electron.DidChangeThemeColorEvent;
|
22428 | type DidCreateWindowDetails = Electron.DidCreateWindowDetails;
|
22429 | type DidFailLoadEvent = Electron.DidFailLoadEvent;
|
22430 | type DidFrameFinishLoadEvent = Electron.DidFrameFinishLoadEvent;
|
22431 | type DidFrameNavigateEvent = Electron.DidFrameNavigateEvent;
|
22432 | type DidNavigateEvent = Electron.DidNavigateEvent;
|
22433 | type DidNavigateInPageEvent = Electron.DidNavigateInPageEvent;
|
22434 | type DidRedirectNavigationEvent = Electron.DidRedirectNavigationEvent;
|
22435 | type DidStartNavigationEvent = Electron.DidStartNavigationEvent;
|
22436 | type DisplayBalloonOptions = Electron.DisplayBalloonOptions;
|
22437 | type DisplayMediaRequestHandlerHandlerRequest = Electron.DisplayMediaRequestHandlerHandlerRequest;
|
22438 | type DisplayMediaRequestHandlerOpts = Electron.DisplayMediaRequestHandlerOpts;
|
22439 | type DownloadURLOptions = Electron.DownloadURLOptions;
|
22440 | type EnableNetworkEmulationOptions = Electron.EnableNetworkEmulationOptions;
|
22441 | type FeedURLOptions = Electron.FeedURLOptions;
|
22442 | type FileIconOptions = Electron.FileIconOptions;
|
22443 | type FileSystemAccessRestrictedDetails = Electron.FileSystemAccessRestrictedDetails;
|
22444 | type FindInPageOptions = Electron.FindInPageOptions;
|
22445 | type FocusOptions = Electron.FocusOptions;
|
22446 | type ForkOptions = Electron.ForkOptions;
|
22447 | type FoundInPageEvent = Electron.FoundInPageEvent;
|
22448 | type FrameCreatedDetails = Electron.FrameCreatedDetails;
|
22449 | type FromPartitionOptions = Electron.FromPartitionOptions;
|
22450 | type FromPathOptions = Electron.FromPathOptions;
|
22451 | type HandlerDetails = Electron.HandlerDetails;
|
22452 | type HeadersReceivedResponse = Electron.HeadersReceivedResponse;
|
22453 | type HeapStatistics = Electron.HeapStatistics;
|
22454 | type HidDeviceAddedDetails = Electron.HidDeviceAddedDetails;
|
22455 | type HidDeviceRemovedDetails = Electron.HidDeviceRemovedDetails;
|
22456 | type HidDeviceRevokedDetails = Electron.HidDeviceRevokedDetails;
|
22457 | type IgnoreMouseEventsOptions = Electron.IgnoreMouseEventsOptions;
|
22458 | type ImportCertificateOptions = Electron.ImportCertificateOptions;
|
22459 | type Info = Electron.Info;
|
22460 | type Input = Electron.Input;
|
22461 | type InsertCSSOptions = Electron.InsertCSSOptions;
|
22462 | type IpcMessageEvent = Electron.IpcMessageEvent;
|
22463 | type Item = Electron.Item;
|
22464 | type JumpListSettings = Electron.JumpListSettings;
|
22465 | type LoadCommitEvent = Electron.LoadCommitEvent;
|
22466 | type LoadExtensionOptions = Electron.LoadExtensionOptions;
|
22467 | type LoadFileOptions = Electron.LoadFileOptions;
|
22468 | type LoadURLOptions = Electron.LoadURLOptions;
|
22469 | type LoginAuthenticationResponseDetails = Electron.LoginAuthenticationResponseDetails;
|
22470 | type LoginItemSettings = Electron.LoginItemSettings;
|
22471 | type LoginItemSettingsOptions = Electron.LoginItemSettingsOptions;
|
22472 | type MenuItemConstructorOptions = Electron.MenuItemConstructorOptions;
|
22473 | type MessageBoxOptions = Electron.MessageBoxOptions;
|
22474 | type MessageBoxReturnValue = Electron.MessageBoxReturnValue;
|
22475 | type MessageBoxSyncOptions = Electron.MessageBoxSyncOptions;
|
22476 | type MessageDetails = Electron.MessageDetails;
|
22477 | type MessageEvent = Electron.MessageEvent;
|
22478 | type MoveToApplicationsFolderOptions = Electron.MoveToApplicationsFolderOptions;
|
22479 | type NotificationConstructorOptions = Electron.NotificationConstructorOptions;
|
22480 | type OnBeforeRedirectListenerDetails = Electron.OnBeforeRedirectListenerDetails;
|
22481 | type OnBeforeRequestListenerDetails = Electron.OnBeforeRequestListenerDetails;
|
22482 | type OnBeforeSendHeadersListenerDetails = Electron.OnBeforeSendHeadersListenerDetails;
|
22483 | type OnCompletedListenerDetails = Electron.OnCompletedListenerDetails;
|
22484 | type OnErrorOccurredListenerDetails = Electron.OnErrorOccurredListenerDetails;
|
22485 | type OnHeadersReceivedListenerDetails = Electron.OnHeadersReceivedListenerDetails;
|
22486 | type OnResponseStartedListenerDetails = Electron.OnResponseStartedListenerDetails;
|
22487 | type OnSendHeadersListenerDetails = Electron.OnSendHeadersListenerDetails;
|
22488 | type OpenDevToolsOptions = Electron.OpenDevToolsOptions;
|
22489 | type OpenDialogOptions = Electron.OpenDialogOptions;
|
22490 | type OpenDialogReturnValue = Electron.OpenDialogReturnValue;
|
22491 | type OpenDialogSyncOptions = Electron.OpenDialogSyncOptions;
|
22492 | type OpenExternalOptions = Electron.OpenExternalOptions;
|
22493 | type Options = Electron.Options;
|
22494 | type Opts = Electron.Opts;
|
22495 | type PageFaviconUpdatedEvent = Electron.PageFaviconUpdatedEvent;
|
22496 | type PageTitleUpdatedEvent = Electron.PageTitleUpdatedEvent;
|
22497 | type Parameters = Electron.Parameters;
|
22498 | type Payment = Electron.Payment;
|
22499 | type PermissionCheckHandlerHandlerDetails = Electron.PermissionCheckHandlerHandlerDetails;
|
22500 | type PluginCrashedEvent = Electron.PluginCrashedEvent;
|
22501 | type PopupOptions = Electron.PopupOptions;
|
22502 | type PreconnectOptions = Electron.PreconnectOptions;
|
22503 | type PrintToPDFOptions = Electron.PrintToPDFOptions;
|
22504 | type Privileges = Electron.Privileges;
|
22505 | type ProgressBarOptions = Electron.ProgressBarOptions;
|
22506 | type Provider = Electron.Provider;
|
22507 | type PurchaseProductOpts = Electron.PurchaseProductOpts;
|
22508 | type ReadBookmark = Electron.ReadBookmark;
|
22509 | type RegistrationCompletedDetails = Electron.RegistrationCompletedDetails;
|
22510 | type RelaunchOptions = Electron.RelaunchOptions;
|
22511 | type RenderProcessGoneEvent = Electron.RenderProcessGoneEvent;
|
22512 | type Request = Electron.Request;
|
22513 | type ResizeOptions = Electron.ResizeOptions;
|
22514 | type ResolveHostOptions = Electron.ResolveHostOptions;
|
22515 | type ResourceUsage = Electron.ResourceUsage;
|
22516 | type Response = Electron.Response;
|
22517 | type Result = Electron.Result;
|
22518 | type SaveDialogOptions = Electron.SaveDialogOptions;
|
22519 | type SaveDialogReturnValue = Electron.SaveDialogReturnValue;
|
22520 | type SaveDialogSyncOptions = Electron.SaveDialogSyncOptions;
|
22521 | type SelectHidDeviceDetails = Electron.SelectHidDeviceDetails;
|
22522 | type SelectUsbDeviceDetails = Electron.SelectUsbDeviceDetails;
|
22523 | type SerialPortRevokedDetails = Electron.SerialPortRevokedDetails;
|
22524 | type Settings = Electron.Settings;
|
22525 | type SourcesOptions = Electron.SourcesOptions;
|
22526 | type StartLoggingOptions = Electron.StartLoggingOptions;
|
22527 | type Streams = Electron.Streams;
|
22528 | type SystemMemoryInfo = Electron.SystemMemoryInfo;
|
22529 | type TitleBarOverlay = Electron.TitleBarOverlay;
|
22530 | type TitleBarOverlayOptions = Electron.TitleBarOverlayOptions;
|
22531 | type TitleOptions = Electron.TitleOptions;
|
22532 | type ToBitmapOptions = Electron.ToBitmapOptions;
|
22533 | type ToDataURLOptions = Electron.ToDataURLOptions;
|
22534 | type ToPNGOptions = Electron.ToPNGOptions;
|
22535 | type TouchBarButtonConstructorOptions = Electron.TouchBarButtonConstructorOptions;
|
22536 | type TouchBarColorPickerConstructorOptions = Electron.TouchBarColorPickerConstructorOptions;
|
22537 | type TouchBarConstructorOptions = Electron.TouchBarConstructorOptions;
|
22538 | type TouchBarGroupConstructorOptions = Electron.TouchBarGroupConstructorOptions;
|
22539 | type TouchBarLabelConstructorOptions = Electron.TouchBarLabelConstructorOptions;
|
22540 | type TouchBarPopoverConstructorOptions = Electron.TouchBarPopoverConstructorOptions;
|
22541 | type TouchBarScrubberConstructorOptions = Electron.TouchBarScrubberConstructorOptions;
|
22542 | type TouchBarSegmentedControlConstructorOptions = Electron.TouchBarSegmentedControlConstructorOptions;
|
22543 | type TouchBarSliderConstructorOptions = Electron.TouchBarSliderConstructorOptions;
|
22544 | type TouchBarSpacerConstructorOptions = Electron.TouchBarSpacerConstructorOptions;
|
22545 | type TraceBufferUsageReturnValue = Electron.TraceBufferUsageReturnValue;
|
22546 | type UdpPortRange = Electron.UdpPortRange;
|
22547 | type UpdateTargetUrlEvent = Electron.UpdateTargetUrlEvent;
|
22548 | type UploadProgress = Electron.UploadProgress;
|
22549 | type UsbDeviceRevokedDetails = Electron.UsbDeviceRevokedDetails;
|
22550 | type USBProtectedClassesHandlerHandlerDetails = Electron.USBProtectedClassesHandlerHandlerDetails;
|
22551 | type VisibleOnAllWorkspacesOptions = Electron.VisibleOnAllWorkspacesOptions;
|
22552 | type WebContentsAudioStateChangedEventParams = Electron.WebContentsAudioStateChangedEventParams;
|
22553 | type WebContentsDidRedirectNavigationEventParams = Electron.WebContentsDidRedirectNavigationEventParams;
|
22554 | type WebContentsDidStartNavigationEventParams = Electron.WebContentsDidStartNavigationEventParams;
|
22555 | type WebContentsPrintOptions = Electron.WebContentsPrintOptions;
|
22556 | type WebContentsViewConstructorOptions = Electron.WebContentsViewConstructorOptions;
|
22557 | type WebContentsWillFrameNavigateEventParams = Electron.WebContentsWillFrameNavigateEventParams;
|
22558 | type WebContentsWillNavigateEventParams = Electron.WebContentsWillNavigateEventParams;
|
22559 | type WebContentsWillRedirectEventParams = Electron.WebContentsWillRedirectEventParams;
|
22560 | type WebRTCUDPPortRange = Electron.WebRTCUDPPortRange;
|
22561 | type WebviewTagPrintOptions = Electron.WebviewTagPrintOptions;
|
22562 | type WillFrameNavigateEvent = Electron.WillFrameNavigateEvent;
|
22563 | type WillNavigateEvent = Electron.WillNavigateEvent;
|
22564 | type WillResizeDetails = Electron.WillResizeDetails;
|
22565 | type EditFlags = Electron.EditFlags;
|
22566 | type Env = Electron.Env;
|
22567 | type FoundInPageResult = Electron.FoundInPageResult;
|
22568 | type LaunchItems = Electron.LaunchItems;
|
22569 | type Margins = Electron.Margins;
|
22570 | type MediaFlags = Electron.MediaFlags;
|
22571 | type PageRanges = Electron.PageRanges;
|
22572 | type Params = Electron.Params;
|
22573 | type Video = Electron.Video;
|
22574 | type BaseWindowConstructorOptions = Electron.BaseWindowConstructorOptions;
|
22575 | type BrowserWindowConstructorOptions = Electron.BrowserWindowConstructorOptions;
|
22576 | type BluetoothDevice = Electron.BluetoothDevice;
|
22577 | type Certificate = Electron.Certificate;
|
22578 | type CertificatePrincipal = Electron.CertificatePrincipal;
|
22579 | type Cookie = Electron.Cookie;
|
22580 | type CPUUsage = Electron.CPUUsage;
|
22581 | type CrashReport = Electron.CrashReport;
|
22582 | type CustomScheme = Electron.CustomScheme;
|
22583 | type DesktopCapturerSource = Electron.DesktopCapturerSource;
|
22584 | type Display = Electron.Display;
|
22585 | type Extension = Electron.Extension;
|
22586 | type ExtensionInfo = Electron.ExtensionInfo;
|
22587 | type FileFilter = Electron.FileFilter;
|
22588 | type FilePathWithHeaders = Electron.FilePathWithHeaders;
|
22589 | type FilesystemPermissionRequest = Electron.FilesystemPermissionRequest;
|
22590 | type GPUFeatureStatus = Electron.GPUFeatureStatus;
|
22591 | type HIDDevice = Electron.HIDDevice;
|
22592 | type InputEvent = Electron.InputEvent;
|
22593 | type IpcMainEvent = Electron.IpcMainEvent;
|
22594 | type IpcMainInvokeEvent = Electron.IpcMainInvokeEvent;
|
22595 | type IpcRendererEvent = Electron.IpcRendererEvent;
|
22596 | type JumpListCategory = Electron.JumpListCategory;
|
22597 | type JumpListItem = Electron.JumpListItem;
|
22598 | type KeyboardEvent = Electron.KeyboardEvent;
|
22599 | type KeyboardInputEvent = Electron.KeyboardInputEvent;
|
22600 | type MediaAccessPermissionRequest = Electron.MediaAccessPermissionRequest;
|
22601 | type MemoryInfo = Electron.MemoryInfo;
|
22602 | type MemoryUsageDetails = Electron.MemoryUsageDetails;
|
22603 | type MimeTypedBuffer = Electron.MimeTypedBuffer;
|
22604 | type MouseInputEvent = Electron.MouseInputEvent;
|
22605 | type MouseWheelInputEvent = Electron.MouseWheelInputEvent;
|
22606 | type NavigationEntry = Electron.NavigationEntry;
|
22607 | type NotificationAction = Electron.NotificationAction;
|
22608 | type NotificationResponse = Electron.NotificationResponse;
|
22609 | type OpenExternalPermissionRequest = Electron.OpenExternalPermissionRequest;
|
22610 | type PaymentDiscount = Electron.PaymentDiscount;
|
22611 | type PermissionRequest = Electron.PermissionRequest;
|
22612 | type Point = Electron.Point;
|
22613 | type PostBody = Electron.PostBody;
|
22614 | type PrinterInfo = Electron.PrinterInfo;
|
22615 | type ProcessMemoryInfo = Electron.ProcessMemoryInfo;
|
22616 | type ProcessMetric = Electron.ProcessMetric;
|
22617 | type Product = Electron.Product;
|
22618 | type ProductDiscount = Electron.ProductDiscount;
|
22619 | type ProductSubscriptionPeriod = Electron.ProductSubscriptionPeriod;
|
22620 | type ProtocolRequest = Electron.ProtocolRequest;
|
22621 | type ProtocolResponse = Electron.ProtocolResponse;
|
22622 | type ProtocolResponseUploadData = Electron.ProtocolResponseUploadData;
|
22623 | type ProxyConfig = Electron.ProxyConfig;
|
22624 | type Rectangle = Electron.Rectangle;
|
22625 | type Referrer = Electron.Referrer;
|
22626 | type RenderProcessGoneDetails = Electron.RenderProcessGoneDetails;
|
22627 | type ResolvedEndpoint = Electron.ResolvedEndpoint;
|
22628 | type ResolvedHost = Electron.ResolvedHost;
|
22629 | type ScrubberItem = Electron.ScrubberItem;
|
22630 | type SegmentedControlSegment = Electron.SegmentedControlSegment;
|
22631 | type SerialPort = Electron.SerialPort;
|
22632 | type ServiceWorkerInfo = Electron.ServiceWorkerInfo;
|
22633 | type SharedWorkerInfo = Electron.SharedWorkerInfo;
|
22634 | type SharingItem = Electron.SharingItem;
|
22635 | type ShortcutDetails = Electron.ShortcutDetails;
|
22636 | type Size = Electron.Size;
|
22637 | type Task = Electron.Task;
|
22638 | type ThumbarButton = Electron.ThumbarButton;
|
22639 | type TraceCategoriesAndOptions = Electron.TraceCategoriesAndOptions;
|
22640 | type TraceConfig = Electron.TraceConfig;
|
22641 | type Transaction = Electron.Transaction;
|
22642 | type UploadData = Electron.UploadData;
|
22643 | type UploadFile = Electron.UploadFile;
|
22644 | type UploadRawData = Electron.UploadRawData;
|
22645 | type USBDevice = Electron.USBDevice;
|
22646 | type UserDefaultTypes = Electron.UserDefaultTypes;
|
22647 | type WebPreferences = Electron.WebPreferences;
|
22648 | type WebRequestFilter = Electron.WebRequestFilter;
|
22649 | type WebSource = Electron.WebSource;
|
22650 | type WindowOpenHandlerResponse = Electron.WindowOpenHandlerResponse;
|
22651 | }
|
22652 |
|
22653 | namespace Renderer {
|
22654 | type Event<Params extends object = {}> = Electron.Event<Params>;
|
22655 | const contextBridge: ContextBridge;
|
22656 | type ContextBridge = Electron.ContextBridge;
|
22657 | const ipcRenderer: IpcRenderer;
|
22658 | type IpcRenderer = Electron.IpcRenderer;
|
22659 | const webFrame: WebFrame;
|
22660 | type WebFrame = Electron.WebFrame;
|
22661 | const webUtils: WebUtils;
|
22662 | type WebUtils = Electron.WebUtils;
|
22663 | type WebviewTag = Electron.WebviewTag;
|
22664 | type AboutPanelOptionsOptions = Electron.AboutPanelOptionsOptions;
|
22665 | type AddRepresentationOptions = Electron.AddRepresentationOptions;
|
22666 | type AdjustSelectionOptions = Electron.AdjustSelectionOptions;
|
22667 | type AnimationSettings = Electron.AnimationSettings;
|
22668 | type AppDetailsOptions = Electron.AppDetailsOptions;
|
22669 | type ApplicationInfoForProtocolReturnValue = Electron.ApplicationInfoForProtocolReturnValue;
|
22670 | type AuthenticationResponseDetails = Electron.AuthenticationResponseDetails;
|
22671 | type AuthInfo = Electron.AuthInfo;
|
22672 | type AutoResizeOptions = Electron.AutoResizeOptions;
|
22673 | type BeforeSendResponse = Electron.BeforeSendResponse;
|
22674 | type BitmapOptions = Electron.BitmapOptions;
|
22675 | type BlinkMemoryInfo = Electron.BlinkMemoryInfo;
|
22676 | type BluetoothPairingHandlerHandlerDetails = Electron.BluetoothPairingHandlerHandlerDetails;
|
22677 | type BrowserViewConstructorOptions = Electron.BrowserViewConstructorOptions;
|
22678 | type CallbackResponse = Electron.CallbackResponse;
|
22679 | type CertificateTrustDialogOptions = Electron.CertificateTrustDialogOptions;
|
22680 | type ClearCodeCachesOptions = Electron.ClearCodeCachesOptions;
|
22681 | type ClearDataOptions = Electron.ClearDataOptions;
|
22682 | type ClearStorageDataOptions = Electron.ClearStorageDataOptions;
|
22683 | type ClientCertRequestParams = Electron.ClientCertRequestParams;
|
22684 | type ClientRequestConstructorOptions = Electron.ClientRequestConstructorOptions;
|
22685 | type CloseOpts = Electron.CloseOpts;
|
22686 | type Config = Electron.Config;
|
22687 | type ConfigureHostResolverOptions = Electron.ConfigureHostResolverOptions;
|
22688 | type ConsoleMessageEvent = Electron.ConsoleMessageEvent;
|
22689 | type ContextMenuEvent = Electron.ContextMenuEvent;
|
22690 | type ContextMenuParams = Electron.ContextMenuParams;
|
22691 | type ContinueActivityDetails = Electron.ContinueActivityDetails;
|
22692 | type CookiesGetFilter = Electron.CookiesGetFilter;
|
22693 | type CookiesSetDetails = Electron.CookiesSetDetails;
|
22694 | type CrashReporterStartOptions = Electron.CrashReporterStartOptions;
|
22695 | type CreateFromBitmapOptions = Electron.CreateFromBitmapOptions;
|
22696 | type CreateFromBufferOptions = Electron.CreateFromBufferOptions;
|
22697 | type CreateInterruptedDownloadOptions = Electron.CreateInterruptedDownloadOptions;
|
22698 | type Data = Electron.Data;
|
22699 | type DefaultFontFamily = Electron.DefaultFontFamily;
|
22700 | type Details = Electron.Details;
|
22701 | type DevicePermissionHandlerHandlerDetails = Electron.DevicePermissionHandlerHandlerDetails;
|
22702 | type DevtoolsOpenUrlEvent = Electron.DevtoolsOpenUrlEvent;
|
22703 | type DevtoolsSearchQueryEvent = Electron.DevtoolsSearchQueryEvent;
|
22704 | type DidChangeThemeColorEvent = Electron.DidChangeThemeColorEvent;
|
22705 | type DidCreateWindowDetails = Electron.DidCreateWindowDetails;
|
22706 | type DidFailLoadEvent = Electron.DidFailLoadEvent;
|
22707 | type DidFrameFinishLoadEvent = Electron.DidFrameFinishLoadEvent;
|
22708 | type DidFrameNavigateEvent = Electron.DidFrameNavigateEvent;
|
22709 | type DidNavigateEvent = Electron.DidNavigateEvent;
|
22710 | type DidNavigateInPageEvent = Electron.DidNavigateInPageEvent;
|
22711 | type DidRedirectNavigationEvent = Electron.DidRedirectNavigationEvent;
|
22712 | type DidStartNavigationEvent = Electron.DidStartNavigationEvent;
|
22713 | type DisplayBalloonOptions = Electron.DisplayBalloonOptions;
|
22714 | type DisplayMediaRequestHandlerHandlerRequest = Electron.DisplayMediaRequestHandlerHandlerRequest;
|
22715 | type DisplayMediaRequestHandlerOpts = Electron.DisplayMediaRequestHandlerOpts;
|
22716 | type DownloadURLOptions = Electron.DownloadURLOptions;
|
22717 | type EnableNetworkEmulationOptions = Electron.EnableNetworkEmulationOptions;
|
22718 | type FeedURLOptions = Electron.FeedURLOptions;
|
22719 | type FileIconOptions = Electron.FileIconOptions;
|
22720 | type FileSystemAccessRestrictedDetails = Electron.FileSystemAccessRestrictedDetails;
|
22721 | type FindInPageOptions = Electron.FindInPageOptions;
|
22722 | type FocusOptions = Electron.FocusOptions;
|
22723 | type ForkOptions = Electron.ForkOptions;
|
22724 | type FoundInPageEvent = Electron.FoundInPageEvent;
|
22725 | type FrameCreatedDetails = Electron.FrameCreatedDetails;
|
22726 | type FromPartitionOptions = Electron.FromPartitionOptions;
|
22727 | type FromPathOptions = Electron.FromPathOptions;
|
22728 | type HandlerDetails = Electron.HandlerDetails;
|
22729 | type HeadersReceivedResponse = Electron.HeadersReceivedResponse;
|
22730 | type HeapStatistics = Electron.HeapStatistics;
|
22731 | type HidDeviceAddedDetails = Electron.HidDeviceAddedDetails;
|
22732 | type HidDeviceRemovedDetails = Electron.HidDeviceRemovedDetails;
|
22733 | type HidDeviceRevokedDetails = Electron.HidDeviceRevokedDetails;
|
22734 | type IgnoreMouseEventsOptions = Electron.IgnoreMouseEventsOptions;
|
22735 | type ImportCertificateOptions = Electron.ImportCertificateOptions;
|
22736 | type Info = Electron.Info;
|
22737 | type Input = Electron.Input;
|
22738 | type InsertCSSOptions = Electron.InsertCSSOptions;
|
22739 | type IpcMessageEvent = Electron.IpcMessageEvent;
|
22740 | type Item = Electron.Item;
|
22741 | type JumpListSettings = Electron.JumpListSettings;
|
22742 | type LoadCommitEvent = Electron.LoadCommitEvent;
|
22743 | type LoadExtensionOptions = Electron.LoadExtensionOptions;
|
22744 | type LoadFileOptions = Electron.LoadFileOptions;
|
22745 | type LoadURLOptions = Electron.LoadURLOptions;
|
22746 | type LoginAuthenticationResponseDetails = Electron.LoginAuthenticationResponseDetails;
|
22747 | type LoginItemSettings = Electron.LoginItemSettings;
|
22748 | type LoginItemSettingsOptions = Electron.LoginItemSettingsOptions;
|
22749 | type MenuItemConstructorOptions = Electron.MenuItemConstructorOptions;
|
22750 | type MessageBoxOptions = Electron.MessageBoxOptions;
|
22751 | type MessageBoxReturnValue = Electron.MessageBoxReturnValue;
|
22752 | type MessageBoxSyncOptions = Electron.MessageBoxSyncOptions;
|
22753 | type MessageDetails = Electron.MessageDetails;
|
22754 | type MessageEvent = Electron.MessageEvent;
|
22755 | type MoveToApplicationsFolderOptions = Electron.MoveToApplicationsFolderOptions;
|
22756 | type NotificationConstructorOptions = Electron.NotificationConstructorOptions;
|
22757 | type OnBeforeRedirectListenerDetails = Electron.OnBeforeRedirectListenerDetails;
|
22758 | type OnBeforeRequestListenerDetails = Electron.OnBeforeRequestListenerDetails;
|
22759 | type OnBeforeSendHeadersListenerDetails = Electron.OnBeforeSendHeadersListenerDetails;
|
22760 | type OnCompletedListenerDetails = Electron.OnCompletedListenerDetails;
|
22761 | type OnErrorOccurredListenerDetails = Electron.OnErrorOccurredListenerDetails;
|
22762 | type OnHeadersReceivedListenerDetails = Electron.OnHeadersReceivedListenerDetails;
|
22763 | type OnResponseStartedListenerDetails = Electron.OnResponseStartedListenerDetails;
|
22764 | type OnSendHeadersListenerDetails = Electron.OnSendHeadersListenerDetails;
|
22765 | type OpenDevToolsOptions = Electron.OpenDevToolsOptions;
|
22766 | type OpenDialogOptions = Electron.OpenDialogOptions;
|
22767 | type OpenDialogReturnValue = Electron.OpenDialogReturnValue;
|
22768 | type OpenDialogSyncOptions = Electron.OpenDialogSyncOptions;
|
22769 | type OpenExternalOptions = Electron.OpenExternalOptions;
|
22770 | type Options = Electron.Options;
|
22771 | type Opts = Electron.Opts;
|
22772 | type PageFaviconUpdatedEvent = Electron.PageFaviconUpdatedEvent;
|
22773 | type PageTitleUpdatedEvent = Electron.PageTitleUpdatedEvent;
|
22774 | type Parameters = Electron.Parameters;
|
22775 | type Payment = Electron.Payment;
|
22776 | type PermissionCheckHandlerHandlerDetails = Electron.PermissionCheckHandlerHandlerDetails;
|
22777 | type PluginCrashedEvent = Electron.PluginCrashedEvent;
|
22778 | type PopupOptions = Electron.PopupOptions;
|
22779 | type PreconnectOptions = Electron.PreconnectOptions;
|
22780 | type PrintToPDFOptions = Electron.PrintToPDFOptions;
|
22781 | type Privileges = Electron.Privileges;
|
22782 | type ProgressBarOptions = Electron.ProgressBarOptions;
|
22783 | type Provider = Electron.Provider;
|
22784 | type PurchaseProductOpts = Electron.PurchaseProductOpts;
|
22785 | type ReadBookmark = Electron.ReadBookmark;
|
22786 | type RegistrationCompletedDetails = Electron.RegistrationCompletedDetails;
|
22787 | type RelaunchOptions = Electron.RelaunchOptions;
|
22788 | type RenderProcessGoneEvent = Electron.RenderProcessGoneEvent;
|
22789 | type Request = Electron.Request;
|
22790 | type ResizeOptions = Electron.ResizeOptions;
|
22791 | type ResolveHostOptions = Electron.ResolveHostOptions;
|
22792 | type ResourceUsage = Electron.ResourceUsage;
|
22793 | type Response = Electron.Response;
|
22794 | type Result = Electron.Result;
|
22795 | type SaveDialogOptions = Electron.SaveDialogOptions;
|
22796 | type SaveDialogReturnValue = Electron.SaveDialogReturnValue;
|
22797 | type SaveDialogSyncOptions = Electron.SaveDialogSyncOptions;
|
22798 | type SelectHidDeviceDetails = Electron.SelectHidDeviceDetails;
|
22799 | type SelectUsbDeviceDetails = Electron.SelectUsbDeviceDetails;
|
22800 | type SerialPortRevokedDetails = Electron.SerialPortRevokedDetails;
|
22801 | type Settings = Electron.Settings;
|
22802 | type SourcesOptions = Electron.SourcesOptions;
|
22803 | type StartLoggingOptions = Electron.StartLoggingOptions;
|
22804 | type Streams = Electron.Streams;
|
22805 | type SystemMemoryInfo = Electron.SystemMemoryInfo;
|
22806 | type TitleBarOverlay = Electron.TitleBarOverlay;
|
22807 | type TitleBarOverlayOptions = Electron.TitleBarOverlayOptions;
|
22808 | type TitleOptions = Electron.TitleOptions;
|
22809 | type ToBitmapOptions = Electron.ToBitmapOptions;
|
22810 | type ToDataURLOptions = Electron.ToDataURLOptions;
|
22811 | type ToPNGOptions = Electron.ToPNGOptions;
|
22812 | type TouchBarButtonConstructorOptions = Electron.TouchBarButtonConstructorOptions;
|
22813 | type TouchBarColorPickerConstructorOptions = Electron.TouchBarColorPickerConstructorOptions;
|
22814 | type TouchBarConstructorOptions = Electron.TouchBarConstructorOptions;
|
22815 | type TouchBarGroupConstructorOptions = Electron.TouchBarGroupConstructorOptions;
|
22816 | type TouchBarLabelConstructorOptions = Electron.TouchBarLabelConstructorOptions;
|
22817 | type TouchBarPopoverConstructorOptions = Electron.TouchBarPopoverConstructorOptions;
|
22818 | type TouchBarScrubberConstructorOptions = Electron.TouchBarScrubberConstructorOptions;
|
22819 | type TouchBarSegmentedControlConstructorOptions = Electron.TouchBarSegmentedControlConstructorOptions;
|
22820 | type TouchBarSliderConstructorOptions = Electron.TouchBarSliderConstructorOptions;
|
22821 | type TouchBarSpacerConstructorOptions = Electron.TouchBarSpacerConstructorOptions;
|
22822 | type TraceBufferUsageReturnValue = Electron.TraceBufferUsageReturnValue;
|
22823 | type UdpPortRange = Electron.UdpPortRange;
|
22824 | type UpdateTargetUrlEvent = Electron.UpdateTargetUrlEvent;
|
22825 | type UploadProgress = Electron.UploadProgress;
|
22826 | type UsbDeviceRevokedDetails = Electron.UsbDeviceRevokedDetails;
|
22827 | type USBProtectedClassesHandlerHandlerDetails = Electron.USBProtectedClassesHandlerHandlerDetails;
|
22828 | type VisibleOnAllWorkspacesOptions = Electron.VisibleOnAllWorkspacesOptions;
|
22829 | type WebContentsAudioStateChangedEventParams = Electron.WebContentsAudioStateChangedEventParams;
|
22830 | type WebContentsDidRedirectNavigationEventParams = Electron.WebContentsDidRedirectNavigationEventParams;
|
22831 | type WebContentsDidStartNavigationEventParams = Electron.WebContentsDidStartNavigationEventParams;
|
22832 | type WebContentsPrintOptions = Electron.WebContentsPrintOptions;
|
22833 | type WebContentsViewConstructorOptions = Electron.WebContentsViewConstructorOptions;
|
22834 | type WebContentsWillFrameNavigateEventParams = Electron.WebContentsWillFrameNavigateEventParams;
|
22835 | type WebContentsWillNavigateEventParams = Electron.WebContentsWillNavigateEventParams;
|
22836 | type WebContentsWillRedirectEventParams = Electron.WebContentsWillRedirectEventParams;
|
22837 | type WebRTCUDPPortRange = Electron.WebRTCUDPPortRange;
|
22838 | type WebviewTagPrintOptions = Electron.WebviewTagPrintOptions;
|
22839 | type WillFrameNavigateEvent = Electron.WillFrameNavigateEvent;
|
22840 | type WillNavigateEvent = Electron.WillNavigateEvent;
|
22841 | type WillResizeDetails = Electron.WillResizeDetails;
|
22842 | type EditFlags = Electron.EditFlags;
|
22843 | type Env = Electron.Env;
|
22844 | type FoundInPageResult = Electron.FoundInPageResult;
|
22845 | type LaunchItems = Electron.LaunchItems;
|
22846 | type Margins = Electron.Margins;
|
22847 | type MediaFlags = Electron.MediaFlags;
|
22848 | type PageRanges = Electron.PageRanges;
|
22849 | type Params = Electron.Params;
|
22850 | type Video = Electron.Video;
|
22851 | type BaseWindowConstructorOptions = Electron.BaseWindowConstructorOptions;
|
22852 | type BrowserWindowConstructorOptions = Electron.BrowserWindowConstructorOptions;
|
22853 | type BluetoothDevice = Electron.BluetoothDevice;
|
22854 | type Certificate = Electron.Certificate;
|
22855 | type CertificatePrincipal = Electron.CertificatePrincipal;
|
22856 | type Cookie = Electron.Cookie;
|
22857 | type CPUUsage = Electron.CPUUsage;
|
22858 | type CrashReport = Electron.CrashReport;
|
22859 | type CustomScheme = Electron.CustomScheme;
|
22860 | type DesktopCapturerSource = Electron.DesktopCapturerSource;
|
22861 | type Display = Electron.Display;
|
22862 | type Extension = Electron.Extension;
|
22863 | type ExtensionInfo = Electron.ExtensionInfo;
|
22864 | type FileFilter = Electron.FileFilter;
|
22865 | type FilePathWithHeaders = Electron.FilePathWithHeaders;
|
22866 | type FilesystemPermissionRequest = Electron.FilesystemPermissionRequest;
|
22867 | type GPUFeatureStatus = Electron.GPUFeatureStatus;
|
22868 | type HIDDevice = Electron.HIDDevice;
|
22869 | type InputEvent = Electron.InputEvent;
|
22870 | type IpcMainEvent = Electron.IpcMainEvent;
|
22871 | type IpcMainInvokeEvent = Electron.IpcMainInvokeEvent;
|
22872 | type IpcRendererEvent = Electron.IpcRendererEvent;
|
22873 | type JumpListCategory = Electron.JumpListCategory;
|
22874 | type JumpListItem = Electron.JumpListItem;
|
22875 | type KeyboardEvent = Electron.KeyboardEvent;
|
22876 | type KeyboardInputEvent = Electron.KeyboardInputEvent;
|
22877 | type MediaAccessPermissionRequest = Electron.MediaAccessPermissionRequest;
|
22878 | type MemoryInfo = Electron.MemoryInfo;
|
22879 | type MemoryUsageDetails = Electron.MemoryUsageDetails;
|
22880 | type MimeTypedBuffer = Electron.MimeTypedBuffer;
|
22881 | type MouseInputEvent = Electron.MouseInputEvent;
|
22882 | type MouseWheelInputEvent = Electron.MouseWheelInputEvent;
|
22883 | type NavigationEntry = Electron.NavigationEntry;
|
22884 | type NotificationAction = Electron.NotificationAction;
|
22885 | type NotificationResponse = Electron.NotificationResponse;
|
22886 | type OpenExternalPermissionRequest = Electron.OpenExternalPermissionRequest;
|
22887 | type PaymentDiscount = Electron.PaymentDiscount;
|
22888 | type PermissionRequest = Electron.PermissionRequest;
|
22889 | type Point = Electron.Point;
|
22890 | type PostBody = Electron.PostBody;
|
22891 | type PrinterInfo = Electron.PrinterInfo;
|
22892 | type ProcessMemoryInfo = Electron.ProcessMemoryInfo;
|
22893 | type ProcessMetric = Electron.ProcessMetric;
|
22894 | type Product = Electron.Product;
|
22895 | type ProductDiscount = Electron.ProductDiscount;
|
22896 | type ProductSubscriptionPeriod = Electron.ProductSubscriptionPeriod;
|
22897 | type ProtocolRequest = Electron.ProtocolRequest;
|
22898 | type ProtocolResponse = Electron.ProtocolResponse;
|
22899 | type ProtocolResponseUploadData = Electron.ProtocolResponseUploadData;
|
22900 | type ProxyConfig = Electron.ProxyConfig;
|
22901 | type Rectangle = Electron.Rectangle;
|
22902 | type Referrer = Electron.Referrer;
|
22903 | type RenderProcessGoneDetails = Electron.RenderProcessGoneDetails;
|
22904 | type ResolvedEndpoint = Electron.ResolvedEndpoint;
|
22905 | type ResolvedHost = Electron.ResolvedHost;
|
22906 | type ScrubberItem = Electron.ScrubberItem;
|
22907 | type SegmentedControlSegment = Electron.SegmentedControlSegment;
|
22908 | type SerialPort = Electron.SerialPort;
|
22909 | type ServiceWorkerInfo = Electron.ServiceWorkerInfo;
|
22910 | type SharedWorkerInfo = Electron.SharedWorkerInfo;
|
22911 | type SharingItem = Electron.SharingItem;
|
22912 | type ShortcutDetails = Electron.ShortcutDetails;
|
22913 | type Size = Electron.Size;
|
22914 | type Task = Electron.Task;
|
22915 | type ThumbarButton = Electron.ThumbarButton;
|
22916 | type TraceCategoriesAndOptions = Electron.TraceCategoriesAndOptions;
|
22917 | type TraceConfig = Electron.TraceConfig;
|
22918 | type Transaction = Electron.Transaction;
|
22919 | type UploadData = Electron.UploadData;
|
22920 | type UploadFile = Electron.UploadFile;
|
22921 | type UploadRawData = Electron.UploadRawData;
|
22922 | type USBDevice = Electron.USBDevice;
|
22923 | type UserDefaultTypes = Electron.UserDefaultTypes;
|
22924 | type WebPreferences = Electron.WebPreferences;
|
22925 | type WebRequestFilter = Electron.WebRequestFilter;
|
22926 | type WebSource = Electron.WebSource;
|
22927 | type WindowOpenHandlerResponse = Electron.WindowOpenHandlerResponse;
|
22928 | }
|
22929 |
|
22930 | namespace Utility {
|
22931 | type Event<Params extends object = {}> = Electron.Event<Params>;
|
22932 | type ClientRequest = Electron.ClientRequest;
|
22933 | type IncomingMessage = Electron.IncomingMessage;
|
22934 | const net: Net;
|
22935 | type Net = Electron.Net;
|
22936 | const systemPreferences: SystemPreferences;
|
22937 | type SystemPreferences = Electron.SystemPreferences;
|
22938 | type AboutPanelOptionsOptions = Electron.AboutPanelOptionsOptions;
|
22939 | type AddRepresentationOptions = Electron.AddRepresentationOptions;
|
22940 | type AdjustSelectionOptions = Electron.AdjustSelectionOptions;
|
22941 | type AnimationSettings = Electron.AnimationSettings;
|
22942 | type AppDetailsOptions = Electron.AppDetailsOptions;
|
22943 | type ApplicationInfoForProtocolReturnValue = Electron.ApplicationInfoForProtocolReturnValue;
|
22944 | type AuthenticationResponseDetails = Electron.AuthenticationResponseDetails;
|
22945 | type AuthInfo = Electron.AuthInfo;
|
22946 | type AutoResizeOptions = Electron.AutoResizeOptions;
|
22947 | type BeforeSendResponse = Electron.BeforeSendResponse;
|
22948 | type BitmapOptions = Electron.BitmapOptions;
|
22949 | type BlinkMemoryInfo = Electron.BlinkMemoryInfo;
|
22950 | type BluetoothPairingHandlerHandlerDetails = Electron.BluetoothPairingHandlerHandlerDetails;
|
22951 | type BrowserViewConstructorOptions = Electron.BrowserViewConstructorOptions;
|
22952 | type CallbackResponse = Electron.CallbackResponse;
|
22953 | type CertificateTrustDialogOptions = Electron.CertificateTrustDialogOptions;
|
22954 | type ClearCodeCachesOptions = Electron.ClearCodeCachesOptions;
|
22955 | type ClearDataOptions = Electron.ClearDataOptions;
|
22956 | type ClearStorageDataOptions = Electron.ClearStorageDataOptions;
|
22957 | type ClientCertRequestParams = Electron.ClientCertRequestParams;
|
22958 | type ClientRequestConstructorOptions = Electron.ClientRequestConstructorOptions;
|
22959 | type CloseOpts = Electron.CloseOpts;
|
22960 | type Config = Electron.Config;
|
22961 | type ConfigureHostResolverOptions = Electron.ConfigureHostResolverOptions;
|
22962 | type ConsoleMessageEvent = Electron.ConsoleMessageEvent;
|
22963 | type ContextMenuEvent = Electron.ContextMenuEvent;
|
22964 | type ContextMenuParams = Electron.ContextMenuParams;
|
22965 | type ContinueActivityDetails = Electron.ContinueActivityDetails;
|
22966 | type CookiesGetFilter = Electron.CookiesGetFilter;
|
22967 | type CookiesSetDetails = Electron.CookiesSetDetails;
|
22968 | type CrashReporterStartOptions = Electron.CrashReporterStartOptions;
|
22969 | type CreateFromBitmapOptions = Electron.CreateFromBitmapOptions;
|
22970 | type CreateFromBufferOptions = Electron.CreateFromBufferOptions;
|
22971 | type CreateInterruptedDownloadOptions = Electron.CreateInterruptedDownloadOptions;
|
22972 | type Data = Electron.Data;
|
22973 | type DefaultFontFamily = Electron.DefaultFontFamily;
|
22974 | type Details = Electron.Details;
|
22975 | type DevicePermissionHandlerHandlerDetails = Electron.DevicePermissionHandlerHandlerDetails;
|
22976 | type DevtoolsOpenUrlEvent = Electron.DevtoolsOpenUrlEvent;
|
22977 | type DevtoolsSearchQueryEvent = Electron.DevtoolsSearchQueryEvent;
|
22978 | type DidChangeThemeColorEvent = Electron.DidChangeThemeColorEvent;
|
22979 | type DidCreateWindowDetails = Electron.DidCreateWindowDetails;
|
22980 | type DidFailLoadEvent = Electron.DidFailLoadEvent;
|
22981 | type DidFrameFinishLoadEvent = Electron.DidFrameFinishLoadEvent;
|
22982 | type DidFrameNavigateEvent = Electron.DidFrameNavigateEvent;
|
22983 | type DidNavigateEvent = Electron.DidNavigateEvent;
|
22984 | type DidNavigateInPageEvent = Electron.DidNavigateInPageEvent;
|
22985 | type DidRedirectNavigationEvent = Electron.DidRedirectNavigationEvent;
|
22986 | type DidStartNavigationEvent = Electron.DidStartNavigationEvent;
|
22987 | type DisplayBalloonOptions = Electron.DisplayBalloonOptions;
|
22988 | type DisplayMediaRequestHandlerHandlerRequest = Electron.DisplayMediaRequestHandlerHandlerRequest;
|
22989 | type DisplayMediaRequestHandlerOpts = Electron.DisplayMediaRequestHandlerOpts;
|
22990 | type DownloadURLOptions = Electron.DownloadURLOptions;
|
22991 | type EnableNetworkEmulationOptions = Electron.EnableNetworkEmulationOptions;
|
22992 | type FeedURLOptions = Electron.FeedURLOptions;
|
22993 | type FileIconOptions = Electron.FileIconOptions;
|
22994 | type FileSystemAccessRestrictedDetails = Electron.FileSystemAccessRestrictedDetails;
|
22995 | type FindInPageOptions = Electron.FindInPageOptions;
|
22996 | type FocusOptions = Electron.FocusOptions;
|
22997 | type ForkOptions = Electron.ForkOptions;
|
22998 | type FoundInPageEvent = Electron.FoundInPageEvent;
|
22999 | type FrameCreatedDetails = Electron.FrameCreatedDetails;
|
23000 | type FromPartitionOptions = Electron.FromPartitionOptions;
|
23001 | type FromPathOptions = Electron.FromPathOptions;
|
23002 | type HandlerDetails = Electron.HandlerDetails;
|
23003 | type HeadersReceivedResponse = Electron.HeadersReceivedResponse;
|
23004 | type HeapStatistics = Electron.HeapStatistics;
|
23005 | type HidDeviceAddedDetails = Electron.HidDeviceAddedDetails;
|
23006 | type HidDeviceRemovedDetails = Electron.HidDeviceRemovedDetails;
|
23007 | type HidDeviceRevokedDetails = Electron.HidDeviceRevokedDetails;
|
23008 | type IgnoreMouseEventsOptions = Electron.IgnoreMouseEventsOptions;
|
23009 | type ImportCertificateOptions = Electron.ImportCertificateOptions;
|
23010 | type Info = Electron.Info;
|
23011 | type Input = Electron.Input;
|
23012 | type InsertCSSOptions = Electron.InsertCSSOptions;
|
23013 | type IpcMessageEvent = Electron.IpcMessageEvent;
|
23014 | type Item = Electron.Item;
|
23015 | type JumpListSettings = Electron.JumpListSettings;
|
23016 | type LoadCommitEvent = Electron.LoadCommitEvent;
|
23017 | type LoadExtensionOptions = Electron.LoadExtensionOptions;
|
23018 | type LoadFileOptions = Electron.LoadFileOptions;
|
23019 | type LoadURLOptions = Electron.LoadURLOptions;
|
23020 | type LoginAuthenticationResponseDetails = Electron.LoginAuthenticationResponseDetails;
|
23021 | type LoginItemSettings = Electron.LoginItemSettings;
|
23022 | type LoginItemSettingsOptions = Electron.LoginItemSettingsOptions;
|
23023 | type MenuItemConstructorOptions = Electron.MenuItemConstructorOptions;
|
23024 | type MessageBoxOptions = Electron.MessageBoxOptions;
|
23025 | type MessageBoxReturnValue = Electron.MessageBoxReturnValue;
|
23026 | type MessageBoxSyncOptions = Electron.MessageBoxSyncOptions;
|
23027 | type MessageDetails = Electron.MessageDetails;
|
23028 | type MessageEvent = Electron.MessageEvent;
|
23029 | type MoveToApplicationsFolderOptions = Electron.MoveToApplicationsFolderOptions;
|
23030 | type NotificationConstructorOptions = Electron.NotificationConstructorOptions;
|
23031 | type OnBeforeRedirectListenerDetails = Electron.OnBeforeRedirectListenerDetails;
|
23032 | type OnBeforeRequestListenerDetails = Electron.OnBeforeRequestListenerDetails;
|
23033 | type OnBeforeSendHeadersListenerDetails = Electron.OnBeforeSendHeadersListenerDetails;
|
23034 | type OnCompletedListenerDetails = Electron.OnCompletedListenerDetails;
|
23035 | type OnErrorOccurredListenerDetails = Electron.OnErrorOccurredListenerDetails;
|
23036 | type OnHeadersReceivedListenerDetails = Electron.OnHeadersReceivedListenerDetails;
|
23037 | type OnResponseStartedListenerDetails = Electron.OnResponseStartedListenerDetails;
|
23038 | type OnSendHeadersListenerDetails = Electron.OnSendHeadersListenerDetails;
|
23039 | type OpenDevToolsOptions = Electron.OpenDevToolsOptions;
|
23040 | type OpenDialogOptions = Electron.OpenDialogOptions;
|
23041 | type OpenDialogReturnValue = Electron.OpenDialogReturnValue;
|
23042 | type OpenDialogSyncOptions = Electron.OpenDialogSyncOptions;
|
23043 | type OpenExternalOptions = Electron.OpenExternalOptions;
|
23044 | type Options = Electron.Options;
|
23045 | type Opts = Electron.Opts;
|
23046 | type PageFaviconUpdatedEvent = Electron.PageFaviconUpdatedEvent;
|
23047 | type PageTitleUpdatedEvent = Electron.PageTitleUpdatedEvent;
|
23048 | type Parameters = Electron.Parameters;
|
23049 | type Payment = Electron.Payment;
|
23050 | type PermissionCheckHandlerHandlerDetails = Electron.PermissionCheckHandlerHandlerDetails;
|
23051 | type PluginCrashedEvent = Electron.PluginCrashedEvent;
|
23052 | type PopupOptions = Electron.PopupOptions;
|
23053 | type PreconnectOptions = Electron.PreconnectOptions;
|
23054 | type PrintToPDFOptions = Electron.PrintToPDFOptions;
|
23055 | type Privileges = Electron.Privileges;
|
23056 | type ProgressBarOptions = Electron.ProgressBarOptions;
|
23057 | type Provider = Electron.Provider;
|
23058 | type PurchaseProductOpts = Electron.PurchaseProductOpts;
|
23059 | type ReadBookmark = Electron.ReadBookmark;
|
23060 | type RegistrationCompletedDetails = Electron.RegistrationCompletedDetails;
|
23061 | type RelaunchOptions = Electron.RelaunchOptions;
|
23062 | type RenderProcessGoneEvent = Electron.RenderProcessGoneEvent;
|
23063 | type Request = Electron.Request;
|
23064 | type ResizeOptions = Electron.ResizeOptions;
|
23065 | type ResolveHostOptions = Electron.ResolveHostOptions;
|
23066 | type ResourceUsage = Electron.ResourceUsage;
|
23067 | type Response = Electron.Response;
|
23068 | type Result = Electron.Result;
|
23069 | type SaveDialogOptions = Electron.SaveDialogOptions;
|
23070 | type SaveDialogReturnValue = Electron.SaveDialogReturnValue;
|
23071 | type SaveDialogSyncOptions = Electron.SaveDialogSyncOptions;
|
23072 | type SelectHidDeviceDetails = Electron.SelectHidDeviceDetails;
|
23073 | type SelectUsbDeviceDetails = Electron.SelectUsbDeviceDetails;
|
23074 | type SerialPortRevokedDetails = Electron.SerialPortRevokedDetails;
|
23075 | type Settings = Electron.Settings;
|
23076 | type SourcesOptions = Electron.SourcesOptions;
|
23077 | type StartLoggingOptions = Electron.StartLoggingOptions;
|
23078 | type Streams = Electron.Streams;
|
23079 | type SystemMemoryInfo = Electron.SystemMemoryInfo;
|
23080 | type TitleBarOverlay = Electron.TitleBarOverlay;
|
23081 | type TitleBarOverlayOptions = Electron.TitleBarOverlayOptions;
|
23082 | type TitleOptions = Electron.TitleOptions;
|
23083 | type ToBitmapOptions = Electron.ToBitmapOptions;
|
23084 | type ToDataURLOptions = Electron.ToDataURLOptions;
|
23085 | type ToPNGOptions = Electron.ToPNGOptions;
|
23086 | type TouchBarButtonConstructorOptions = Electron.TouchBarButtonConstructorOptions;
|
23087 | type TouchBarColorPickerConstructorOptions = Electron.TouchBarColorPickerConstructorOptions;
|
23088 | type TouchBarConstructorOptions = Electron.TouchBarConstructorOptions;
|
23089 | type TouchBarGroupConstructorOptions = Electron.TouchBarGroupConstructorOptions;
|
23090 | type TouchBarLabelConstructorOptions = Electron.TouchBarLabelConstructorOptions;
|
23091 | type TouchBarPopoverConstructorOptions = Electron.TouchBarPopoverConstructorOptions;
|
23092 | type TouchBarScrubberConstructorOptions = Electron.TouchBarScrubberConstructorOptions;
|
23093 | type TouchBarSegmentedControlConstructorOptions = Electron.TouchBarSegmentedControlConstructorOptions;
|
23094 | type TouchBarSliderConstructorOptions = Electron.TouchBarSliderConstructorOptions;
|
23095 | type TouchBarSpacerConstructorOptions = Electron.TouchBarSpacerConstructorOptions;
|
23096 | type TraceBufferUsageReturnValue = Electron.TraceBufferUsageReturnValue;
|
23097 | type UdpPortRange = Electron.UdpPortRange;
|
23098 | type UpdateTargetUrlEvent = Electron.UpdateTargetUrlEvent;
|
23099 | type UploadProgress = Electron.UploadProgress;
|
23100 | type UsbDeviceRevokedDetails = Electron.UsbDeviceRevokedDetails;
|
23101 | type USBProtectedClassesHandlerHandlerDetails = Electron.USBProtectedClassesHandlerHandlerDetails;
|
23102 | type VisibleOnAllWorkspacesOptions = Electron.VisibleOnAllWorkspacesOptions;
|
23103 | type WebContentsAudioStateChangedEventParams = Electron.WebContentsAudioStateChangedEventParams;
|
23104 | type WebContentsDidRedirectNavigationEventParams = Electron.WebContentsDidRedirectNavigationEventParams;
|
23105 | type WebContentsDidStartNavigationEventParams = Electron.WebContentsDidStartNavigationEventParams;
|
23106 | type WebContentsPrintOptions = Electron.WebContentsPrintOptions;
|
23107 | type WebContentsViewConstructorOptions = Electron.WebContentsViewConstructorOptions;
|
23108 | type WebContentsWillFrameNavigateEventParams = Electron.WebContentsWillFrameNavigateEventParams;
|
23109 | type WebContentsWillNavigateEventParams = Electron.WebContentsWillNavigateEventParams;
|
23110 | type WebContentsWillRedirectEventParams = Electron.WebContentsWillRedirectEventParams;
|
23111 | type WebRTCUDPPortRange = Electron.WebRTCUDPPortRange;
|
23112 | type WebviewTagPrintOptions = Electron.WebviewTagPrintOptions;
|
23113 | type WillFrameNavigateEvent = Electron.WillFrameNavigateEvent;
|
23114 | type WillNavigateEvent = Electron.WillNavigateEvent;
|
23115 | type WillResizeDetails = Electron.WillResizeDetails;
|
23116 | type EditFlags = Electron.EditFlags;
|
23117 | type Env = Electron.Env;
|
23118 | type FoundInPageResult = Electron.FoundInPageResult;
|
23119 | type LaunchItems = Electron.LaunchItems;
|
23120 | type Margins = Electron.Margins;
|
23121 | type MediaFlags = Electron.MediaFlags;
|
23122 | type PageRanges = Electron.PageRanges;
|
23123 | type Params = Electron.Params;
|
23124 | type Video = Electron.Video;
|
23125 | type BaseWindowConstructorOptions = Electron.BaseWindowConstructorOptions;
|
23126 | type BrowserWindowConstructorOptions = Electron.BrowserWindowConstructorOptions;
|
23127 | type BluetoothDevice = Electron.BluetoothDevice;
|
23128 | type Certificate = Electron.Certificate;
|
23129 | type CertificatePrincipal = Electron.CertificatePrincipal;
|
23130 | type Cookie = Electron.Cookie;
|
23131 | type CPUUsage = Electron.CPUUsage;
|
23132 | type CrashReport = Electron.CrashReport;
|
23133 | type CustomScheme = Electron.CustomScheme;
|
23134 | type DesktopCapturerSource = Electron.DesktopCapturerSource;
|
23135 | type Display = Electron.Display;
|
23136 | type Extension = Electron.Extension;
|
23137 | type ExtensionInfo = Electron.ExtensionInfo;
|
23138 | type FileFilter = Electron.FileFilter;
|
23139 | type FilePathWithHeaders = Electron.FilePathWithHeaders;
|
23140 | type FilesystemPermissionRequest = Electron.FilesystemPermissionRequest;
|
23141 | type GPUFeatureStatus = Electron.GPUFeatureStatus;
|
23142 | type HIDDevice = Electron.HIDDevice;
|
23143 | type InputEvent = Electron.InputEvent;
|
23144 | type IpcMainEvent = Electron.IpcMainEvent;
|
23145 | type IpcMainInvokeEvent = Electron.IpcMainInvokeEvent;
|
23146 | type IpcRendererEvent = Electron.IpcRendererEvent;
|
23147 | type JumpListCategory = Electron.JumpListCategory;
|
23148 | type JumpListItem = Electron.JumpListItem;
|
23149 | type KeyboardEvent = Electron.KeyboardEvent;
|
23150 | type KeyboardInputEvent = Electron.KeyboardInputEvent;
|
23151 | type MediaAccessPermissionRequest = Electron.MediaAccessPermissionRequest;
|
23152 | type MemoryInfo = Electron.MemoryInfo;
|
23153 | type MemoryUsageDetails = Electron.MemoryUsageDetails;
|
23154 | type MimeTypedBuffer = Electron.MimeTypedBuffer;
|
23155 | type MouseInputEvent = Electron.MouseInputEvent;
|
23156 | type MouseWheelInputEvent = Electron.MouseWheelInputEvent;
|
23157 | type NavigationEntry = Electron.NavigationEntry;
|
23158 | type NotificationAction = Electron.NotificationAction;
|
23159 | type NotificationResponse = Electron.NotificationResponse;
|
23160 | type OpenExternalPermissionRequest = Electron.OpenExternalPermissionRequest;
|
23161 | type PaymentDiscount = Electron.PaymentDiscount;
|
23162 | type PermissionRequest = Electron.PermissionRequest;
|
23163 | type Point = Electron.Point;
|
23164 | type PostBody = Electron.PostBody;
|
23165 | type PrinterInfo = Electron.PrinterInfo;
|
23166 | type ProcessMemoryInfo = Electron.ProcessMemoryInfo;
|
23167 | type ProcessMetric = Electron.ProcessMetric;
|
23168 | type Product = Electron.Product;
|
23169 | type ProductDiscount = Electron.ProductDiscount;
|
23170 | type ProductSubscriptionPeriod = Electron.ProductSubscriptionPeriod;
|
23171 | type ProtocolRequest = Electron.ProtocolRequest;
|
23172 | type ProtocolResponse = Electron.ProtocolResponse;
|
23173 | type ProtocolResponseUploadData = Electron.ProtocolResponseUploadData;
|
23174 | type ProxyConfig = Electron.ProxyConfig;
|
23175 | type Rectangle = Electron.Rectangle;
|
23176 | type Referrer = Electron.Referrer;
|
23177 | type RenderProcessGoneDetails = Electron.RenderProcessGoneDetails;
|
23178 | type ResolvedEndpoint = Electron.ResolvedEndpoint;
|
23179 | type ResolvedHost = Electron.ResolvedHost;
|
23180 | type ScrubberItem = Electron.ScrubberItem;
|
23181 | type SegmentedControlSegment = Electron.SegmentedControlSegment;
|
23182 | type SerialPort = Electron.SerialPort;
|
23183 | type ServiceWorkerInfo = Electron.ServiceWorkerInfo;
|
23184 | type SharedWorkerInfo = Electron.SharedWorkerInfo;
|
23185 | type SharingItem = Electron.SharingItem;
|
23186 | type ShortcutDetails = Electron.ShortcutDetails;
|
23187 | type Size = Electron.Size;
|
23188 | type Task = Electron.Task;
|
23189 | type ThumbarButton = Electron.ThumbarButton;
|
23190 | type TraceCategoriesAndOptions = Electron.TraceCategoriesAndOptions;
|
23191 | type TraceConfig = Electron.TraceConfig;
|
23192 | type Transaction = Electron.Transaction;
|
23193 | type UploadData = Electron.UploadData;
|
23194 | type UploadFile = Electron.UploadFile;
|
23195 | type UploadRawData = Electron.UploadRawData;
|
23196 | type USBDevice = Electron.USBDevice;
|
23197 | type UserDefaultTypes = Electron.UserDefaultTypes;
|
23198 | type WebPreferences = Electron.WebPreferences;
|
23199 | type WebRequestFilter = Electron.WebRequestFilter;
|
23200 | type WebSource = Electron.WebSource;
|
23201 | type WindowOpenHandlerResponse = Electron.WindowOpenHandlerResponse;
|
23202 | }
|
23203 |
|
23204 | namespace CrossProcessExports {
|
23205 | type Event<Params extends object = {}> = Electron.Event<Params>;
|
23206 | const app: App;
|
23207 | type App = Electron.App;
|
23208 | const autoUpdater: AutoUpdater;
|
23209 | type AutoUpdater = Electron.AutoUpdater;
|
23210 | class BaseWindow extends Electron.BaseWindow {}
|
23211 | class BrowserView extends Electron.BrowserView {}
|
23212 | class BrowserWindow extends Electron.BrowserWindow {}
|
23213 | type ClientRequest = Electron.ClientRequest;
|
23214 | const clipboard: Clipboard;
|
23215 | type Clipboard = Electron.Clipboard;
|
23216 | type CommandLine = Electron.CommandLine;
|
23217 | const contentTracing: ContentTracing;
|
23218 | type ContentTracing = Electron.ContentTracing;
|
23219 | const contextBridge: ContextBridge;
|
23220 | type ContextBridge = Electron.ContextBridge;
|
23221 | type Cookies = Electron.Cookies;
|
23222 | const crashReporter: CrashReporter;
|
23223 | type CrashReporter = Electron.CrashReporter;
|
23224 | type Debugger = Electron.Debugger;
|
23225 | const desktopCapturer: DesktopCapturer;
|
23226 | type DesktopCapturer = Electron.DesktopCapturer;
|
23227 | const dialog: Dialog;
|
23228 | type Dialog = Electron.Dialog;
|
23229 | type Dock = Electron.Dock;
|
23230 | type DownloadItem = Electron.DownloadItem;
|
23231 | const globalShortcut: GlobalShortcut;
|
23232 | type GlobalShortcut = Electron.GlobalShortcut;
|
23233 | const inAppPurchase: InAppPurchase;
|
23234 | type InAppPurchase = Electron.InAppPurchase;
|
23235 | type IncomingMessage = Electron.IncomingMessage;
|
23236 | const ipcMain: IpcMain;
|
23237 | type IpcMain = Electron.IpcMain;
|
23238 | const ipcRenderer: IpcRenderer;
|
23239 | type IpcRenderer = Electron.IpcRenderer;
|
23240 | class Menu extends Electron.Menu {}
|
23241 | class MenuItem extends Electron.MenuItem {}
|
23242 | class MessageChannelMain extends Electron.MessageChannelMain {}
|
23243 | type MessagePortMain = Electron.MessagePortMain;
|
23244 | const nativeImage: typeof NativeImage;
|
23245 | type NativeImage = Electron.NativeImage;
|
23246 | const nativeTheme: NativeTheme;
|
23247 | type NativeTheme = Electron.NativeTheme;
|
23248 | type NavigationHistory = Electron.NavigationHistory;
|
23249 | const net: Net;
|
23250 | type Net = Electron.Net;
|
23251 | const netLog: NetLog;
|
23252 | type NetLog = Electron.NetLog;
|
23253 | class Notification extends Electron.Notification {}
|
23254 | const powerMonitor: PowerMonitor;
|
23255 | type PowerMonitor = Electron.PowerMonitor;
|
23256 | const powerSaveBlocker: PowerSaveBlocker;
|
23257 | type PowerSaveBlocker = Electron.PowerSaveBlocker;
|
23258 | const protocol: Protocol;
|
23259 | type Protocol = Electron.Protocol;
|
23260 | const pushNotifications: PushNotifications;
|
23261 | type PushNotifications = Electron.PushNotifications;
|
23262 | const safeStorage: SafeStorage;
|
23263 | type SafeStorage = Electron.SafeStorage;
|
23264 | const screen: Screen;
|
23265 | type Screen = Electron.Screen;
|
23266 | type ServiceWorkers = Electron.ServiceWorkers;
|
23267 | const session: typeof Session;
|
23268 | type Session = Electron.Session;
|
23269 | class ShareMenu extends Electron.ShareMenu {}
|
23270 | const shell: Shell;
|
23271 | type Shell = Electron.Shell;
|
23272 | const systemPreferences: SystemPreferences;
|
23273 | type SystemPreferences = Electron.SystemPreferences;
|
23274 | class TouchBar extends Electron.TouchBar {}
|
23275 | type TouchBarButton = Electron.TouchBarButton;
|
23276 | type TouchBarColorPicker = Electron.TouchBarColorPicker;
|
23277 | type TouchBarGroup = Electron.TouchBarGroup;
|
23278 | type TouchBarLabel = Electron.TouchBarLabel;
|
23279 | type TouchBarOtherItemsProxy = Electron.TouchBarOtherItemsProxy;
|
23280 | type TouchBarPopover = Electron.TouchBarPopover;
|
23281 | type TouchBarScrubber = Electron.TouchBarScrubber;
|
23282 | type TouchBarSegmentedControl = Electron.TouchBarSegmentedControl;
|
23283 | type TouchBarSlider = Electron.TouchBarSlider;
|
23284 | type TouchBarSpacer = Electron.TouchBarSpacer;
|
23285 | class Tray extends Electron.Tray {}
|
23286 | const utilityProcess: typeof UtilityProcess;
|
23287 | type UtilityProcess = Electron.UtilityProcess;
|
23288 | class View extends Electron.View {}
|
23289 | const webContents: typeof WebContents;
|
23290 | type WebContents = Electron.WebContents;
|
23291 | class WebContentsView extends Electron.WebContentsView {}
|
23292 | const webFrame: WebFrame;
|
23293 | type WebFrame = Electron.WebFrame;
|
23294 | const webFrameMain: typeof WebFrameMain;
|
23295 | type WebFrameMain = Electron.WebFrameMain;
|
23296 | type WebRequest = Electron.WebRequest;
|
23297 | const webUtils: WebUtils;
|
23298 | type WebUtils = Electron.WebUtils;
|
23299 | type WebviewTag = Electron.WebviewTag;
|
23300 | type AboutPanelOptionsOptions = Electron.AboutPanelOptionsOptions;
|
23301 | type AddRepresentationOptions = Electron.AddRepresentationOptions;
|
23302 | type AdjustSelectionOptions = Electron.AdjustSelectionOptions;
|
23303 | type AnimationSettings = Electron.AnimationSettings;
|
23304 | type AppDetailsOptions = Electron.AppDetailsOptions;
|
23305 | type ApplicationInfoForProtocolReturnValue = Electron.ApplicationInfoForProtocolReturnValue;
|
23306 | type AuthenticationResponseDetails = Electron.AuthenticationResponseDetails;
|
23307 | type AuthInfo = Electron.AuthInfo;
|
23308 | type AutoResizeOptions = Electron.AutoResizeOptions;
|
23309 | type BeforeSendResponse = Electron.BeforeSendResponse;
|
23310 | type BitmapOptions = Electron.BitmapOptions;
|
23311 | type BlinkMemoryInfo = Electron.BlinkMemoryInfo;
|
23312 | type BluetoothPairingHandlerHandlerDetails = Electron.BluetoothPairingHandlerHandlerDetails;
|
23313 | type BrowserViewConstructorOptions = Electron.BrowserViewConstructorOptions;
|
23314 | type CallbackResponse = Electron.CallbackResponse;
|
23315 | type CertificateTrustDialogOptions = Electron.CertificateTrustDialogOptions;
|
23316 | type ClearCodeCachesOptions = Electron.ClearCodeCachesOptions;
|
23317 | type ClearDataOptions = Electron.ClearDataOptions;
|
23318 | type ClearStorageDataOptions = Electron.ClearStorageDataOptions;
|
23319 | type ClientCertRequestParams = Electron.ClientCertRequestParams;
|
23320 | type ClientRequestConstructorOptions = Electron.ClientRequestConstructorOptions;
|
23321 | type CloseOpts = Electron.CloseOpts;
|
23322 | type Config = Electron.Config;
|
23323 | type ConfigureHostResolverOptions = Electron.ConfigureHostResolverOptions;
|
23324 | type ConsoleMessageEvent = Electron.ConsoleMessageEvent;
|
23325 | type ContextMenuEvent = Electron.ContextMenuEvent;
|
23326 | type ContextMenuParams = Electron.ContextMenuParams;
|
23327 | type ContinueActivityDetails = Electron.ContinueActivityDetails;
|
23328 | type CookiesGetFilter = Electron.CookiesGetFilter;
|
23329 | type CookiesSetDetails = Electron.CookiesSetDetails;
|
23330 | type CrashReporterStartOptions = Electron.CrashReporterStartOptions;
|
23331 | type CreateFromBitmapOptions = Electron.CreateFromBitmapOptions;
|
23332 | type CreateFromBufferOptions = Electron.CreateFromBufferOptions;
|
23333 | type CreateInterruptedDownloadOptions = Electron.CreateInterruptedDownloadOptions;
|
23334 | type Data = Electron.Data;
|
23335 | type DefaultFontFamily = Electron.DefaultFontFamily;
|
23336 | type Details = Electron.Details;
|
23337 | type DevicePermissionHandlerHandlerDetails = Electron.DevicePermissionHandlerHandlerDetails;
|
23338 | type DevtoolsOpenUrlEvent = Electron.DevtoolsOpenUrlEvent;
|
23339 | type DevtoolsSearchQueryEvent = Electron.DevtoolsSearchQueryEvent;
|
23340 | type DidChangeThemeColorEvent = Electron.DidChangeThemeColorEvent;
|
23341 | type DidCreateWindowDetails = Electron.DidCreateWindowDetails;
|
23342 | type DidFailLoadEvent = Electron.DidFailLoadEvent;
|
23343 | type DidFrameFinishLoadEvent = Electron.DidFrameFinishLoadEvent;
|
23344 | type DidFrameNavigateEvent = Electron.DidFrameNavigateEvent;
|
23345 | type DidNavigateEvent = Electron.DidNavigateEvent;
|
23346 | type DidNavigateInPageEvent = Electron.DidNavigateInPageEvent;
|
23347 | type DidRedirectNavigationEvent = Electron.DidRedirectNavigationEvent;
|
23348 | type DidStartNavigationEvent = Electron.DidStartNavigationEvent;
|
23349 | type DisplayBalloonOptions = Electron.DisplayBalloonOptions;
|
23350 | type DisplayMediaRequestHandlerHandlerRequest = Electron.DisplayMediaRequestHandlerHandlerRequest;
|
23351 | type DisplayMediaRequestHandlerOpts = Electron.DisplayMediaRequestHandlerOpts;
|
23352 | type DownloadURLOptions = Electron.DownloadURLOptions;
|
23353 | type EnableNetworkEmulationOptions = Electron.EnableNetworkEmulationOptions;
|
23354 | type FeedURLOptions = Electron.FeedURLOptions;
|
23355 | type FileIconOptions = Electron.FileIconOptions;
|
23356 | type FileSystemAccessRestrictedDetails = Electron.FileSystemAccessRestrictedDetails;
|
23357 | type FindInPageOptions = Electron.FindInPageOptions;
|
23358 | type FocusOptions = Electron.FocusOptions;
|
23359 | type ForkOptions = Electron.ForkOptions;
|
23360 | type FoundInPageEvent = Electron.FoundInPageEvent;
|
23361 | type FrameCreatedDetails = Electron.FrameCreatedDetails;
|
23362 | type FromPartitionOptions = Electron.FromPartitionOptions;
|
23363 | type FromPathOptions = Electron.FromPathOptions;
|
23364 | type HandlerDetails = Electron.HandlerDetails;
|
23365 | type HeadersReceivedResponse = Electron.HeadersReceivedResponse;
|
23366 | type HeapStatistics = Electron.HeapStatistics;
|
23367 | type HidDeviceAddedDetails = Electron.HidDeviceAddedDetails;
|
23368 | type HidDeviceRemovedDetails = Electron.HidDeviceRemovedDetails;
|
23369 | type HidDeviceRevokedDetails = Electron.HidDeviceRevokedDetails;
|
23370 | type IgnoreMouseEventsOptions = Electron.IgnoreMouseEventsOptions;
|
23371 | type ImportCertificateOptions = Electron.ImportCertificateOptions;
|
23372 | type Info = Electron.Info;
|
23373 | type Input = Electron.Input;
|
23374 | type InsertCSSOptions = Electron.InsertCSSOptions;
|
23375 | type IpcMessageEvent = Electron.IpcMessageEvent;
|
23376 | type Item = Electron.Item;
|
23377 | type JumpListSettings = Electron.JumpListSettings;
|
23378 | type LoadCommitEvent = Electron.LoadCommitEvent;
|
23379 | type LoadExtensionOptions = Electron.LoadExtensionOptions;
|
23380 | type LoadFileOptions = Electron.LoadFileOptions;
|
23381 | type LoadURLOptions = Electron.LoadURLOptions;
|
23382 | type LoginAuthenticationResponseDetails = Electron.LoginAuthenticationResponseDetails;
|
23383 | type LoginItemSettings = Electron.LoginItemSettings;
|
23384 | type LoginItemSettingsOptions = Electron.LoginItemSettingsOptions;
|
23385 | type MenuItemConstructorOptions = Electron.MenuItemConstructorOptions;
|
23386 | type MessageBoxOptions = Electron.MessageBoxOptions;
|
23387 | type MessageBoxReturnValue = Electron.MessageBoxReturnValue;
|
23388 | type MessageBoxSyncOptions = Electron.MessageBoxSyncOptions;
|
23389 | type MessageDetails = Electron.MessageDetails;
|
23390 | type MessageEvent = Electron.MessageEvent;
|
23391 | type MoveToApplicationsFolderOptions = Electron.MoveToApplicationsFolderOptions;
|
23392 | type NotificationConstructorOptions = Electron.NotificationConstructorOptions;
|
23393 | type OnBeforeRedirectListenerDetails = Electron.OnBeforeRedirectListenerDetails;
|
23394 | type OnBeforeRequestListenerDetails = Electron.OnBeforeRequestListenerDetails;
|
23395 | type OnBeforeSendHeadersListenerDetails = Electron.OnBeforeSendHeadersListenerDetails;
|
23396 | type OnCompletedListenerDetails = Electron.OnCompletedListenerDetails;
|
23397 | type OnErrorOccurredListenerDetails = Electron.OnErrorOccurredListenerDetails;
|
23398 | type OnHeadersReceivedListenerDetails = Electron.OnHeadersReceivedListenerDetails;
|
23399 | type OnResponseStartedListenerDetails = Electron.OnResponseStartedListenerDetails;
|
23400 | type OnSendHeadersListenerDetails = Electron.OnSendHeadersListenerDetails;
|
23401 | type OpenDevToolsOptions = Electron.OpenDevToolsOptions;
|
23402 | type OpenDialogOptions = Electron.OpenDialogOptions;
|
23403 | type OpenDialogReturnValue = Electron.OpenDialogReturnValue;
|
23404 | type OpenDialogSyncOptions = Electron.OpenDialogSyncOptions;
|
23405 | type OpenExternalOptions = Electron.OpenExternalOptions;
|
23406 | type Options = Electron.Options;
|
23407 | type Opts = Electron.Opts;
|
23408 | type PageFaviconUpdatedEvent = Electron.PageFaviconUpdatedEvent;
|
23409 | type PageTitleUpdatedEvent = Electron.PageTitleUpdatedEvent;
|
23410 | type Parameters = Electron.Parameters;
|
23411 | type Payment = Electron.Payment;
|
23412 | type PermissionCheckHandlerHandlerDetails = Electron.PermissionCheckHandlerHandlerDetails;
|
23413 | type PluginCrashedEvent = Electron.PluginCrashedEvent;
|
23414 | type PopupOptions = Electron.PopupOptions;
|
23415 | type PreconnectOptions = Electron.PreconnectOptions;
|
23416 | type PrintToPDFOptions = Electron.PrintToPDFOptions;
|
23417 | type Privileges = Electron.Privileges;
|
23418 | type ProgressBarOptions = Electron.ProgressBarOptions;
|
23419 | type Provider = Electron.Provider;
|
23420 | type PurchaseProductOpts = Electron.PurchaseProductOpts;
|
23421 | type ReadBookmark = Electron.ReadBookmark;
|
23422 | type RegistrationCompletedDetails = Electron.RegistrationCompletedDetails;
|
23423 | type RelaunchOptions = Electron.RelaunchOptions;
|
23424 | type RenderProcessGoneEvent = Electron.RenderProcessGoneEvent;
|
23425 | type Request = Electron.Request;
|
23426 | type ResizeOptions = Electron.ResizeOptions;
|
23427 | type ResolveHostOptions = Electron.ResolveHostOptions;
|
23428 | type ResourceUsage = Electron.ResourceUsage;
|
23429 | type Response = Electron.Response;
|
23430 | type Result = Electron.Result;
|
23431 | type SaveDialogOptions = Electron.SaveDialogOptions;
|
23432 | type SaveDialogReturnValue = Electron.SaveDialogReturnValue;
|
23433 | type SaveDialogSyncOptions = Electron.SaveDialogSyncOptions;
|
23434 | type SelectHidDeviceDetails = Electron.SelectHidDeviceDetails;
|
23435 | type SelectUsbDeviceDetails = Electron.SelectUsbDeviceDetails;
|
23436 | type SerialPortRevokedDetails = Electron.SerialPortRevokedDetails;
|
23437 | type Settings = Electron.Settings;
|
23438 | type SourcesOptions = Electron.SourcesOptions;
|
23439 | type StartLoggingOptions = Electron.StartLoggingOptions;
|
23440 | type Streams = Electron.Streams;
|
23441 | type SystemMemoryInfo = Electron.SystemMemoryInfo;
|
23442 | type TitleBarOverlay = Electron.TitleBarOverlay;
|
23443 | type TitleBarOverlayOptions = Electron.TitleBarOverlayOptions;
|
23444 | type TitleOptions = Electron.TitleOptions;
|
23445 | type ToBitmapOptions = Electron.ToBitmapOptions;
|
23446 | type ToDataURLOptions = Electron.ToDataURLOptions;
|
23447 | type ToPNGOptions = Electron.ToPNGOptions;
|
23448 | type TouchBarButtonConstructorOptions = Electron.TouchBarButtonConstructorOptions;
|
23449 | type TouchBarColorPickerConstructorOptions = Electron.TouchBarColorPickerConstructorOptions;
|
23450 | type TouchBarConstructorOptions = Electron.TouchBarConstructorOptions;
|
23451 | type TouchBarGroupConstructorOptions = Electron.TouchBarGroupConstructorOptions;
|
23452 | type TouchBarLabelConstructorOptions = Electron.TouchBarLabelConstructorOptions;
|
23453 | type TouchBarPopoverConstructorOptions = Electron.TouchBarPopoverConstructorOptions;
|
23454 | type TouchBarScrubberConstructorOptions = Electron.TouchBarScrubberConstructorOptions;
|
23455 | type TouchBarSegmentedControlConstructorOptions = Electron.TouchBarSegmentedControlConstructorOptions;
|
23456 | type TouchBarSliderConstructorOptions = Electron.TouchBarSliderConstructorOptions;
|
23457 | type TouchBarSpacerConstructorOptions = Electron.TouchBarSpacerConstructorOptions;
|
23458 | type TraceBufferUsageReturnValue = Electron.TraceBufferUsageReturnValue;
|
23459 | type UdpPortRange = Electron.UdpPortRange;
|
23460 | type UpdateTargetUrlEvent = Electron.UpdateTargetUrlEvent;
|
23461 | type UploadProgress = Electron.UploadProgress;
|
23462 | type UsbDeviceRevokedDetails = Electron.UsbDeviceRevokedDetails;
|
23463 | type USBProtectedClassesHandlerHandlerDetails = Electron.USBProtectedClassesHandlerHandlerDetails;
|
23464 | type VisibleOnAllWorkspacesOptions = Electron.VisibleOnAllWorkspacesOptions;
|
23465 | type WebContentsAudioStateChangedEventParams = Electron.WebContentsAudioStateChangedEventParams;
|
23466 | type WebContentsDidRedirectNavigationEventParams = Electron.WebContentsDidRedirectNavigationEventParams;
|
23467 | type WebContentsDidStartNavigationEventParams = Electron.WebContentsDidStartNavigationEventParams;
|
23468 | type WebContentsPrintOptions = Electron.WebContentsPrintOptions;
|
23469 | type WebContentsViewConstructorOptions = Electron.WebContentsViewConstructorOptions;
|
23470 | type WebContentsWillFrameNavigateEventParams = Electron.WebContentsWillFrameNavigateEventParams;
|
23471 | type WebContentsWillNavigateEventParams = Electron.WebContentsWillNavigateEventParams;
|
23472 | type WebContentsWillRedirectEventParams = Electron.WebContentsWillRedirectEventParams;
|
23473 | type WebRTCUDPPortRange = Electron.WebRTCUDPPortRange;
|
23474 | type WebviewTagPrintOptions = Electron.WebviewTagPrintOptions;
|
23475 | type WillFrameNavigateEvent = Electron.WillFrameNavigateEvent;
|
23476 | type WillNavigateEvent = Electron.WillNavigateEvent;
|
23477 | type WillResizeDetails = Electron.WillResizeDetails;
|
23478 | type EditFlags = Electron.EditFlags;
|
23479 | type Env = Electron.Env;
|
23480 | type FoundInPageResult = Electron.FoundInPageResult;
|
23481 | type LaunchItems = Electron.LaunchItems;
|
23482 | type Margins = Electron.Margins;
|
23483 | type MediaFlags = Electron.MediaFlags;
|
23484 | type PageRanges = Electron.PageRanges;
|
23485 | type Params = Electron.Params;
|
23486 | type Video = Electron.Video;
|
23487 | type BaseWindowConstructorOptions = Electron.BaseWindowConstructorOptions;
|
23488 | type BrowserWindowConstructorOptions = Electron.BrowserWindowConstructorOptions;
|
23489 | type BluetoothDevice = Electron.BluetoothDevice;
|
23490 | type Certificate = Electron.Certificate;
|
23491 | type CertificatePrincipal = Electron.CertificatePrincipal;
|
23492 | type Cookie = Electron.Cookie;
|
23493 | type CPUUsage = Electron.CPUUsage;
|
23494 | type CrashReport = Electron.CrashReport;
|
23495 | type CustomScheme = Electron.CustomScheme;
|
23496 | type DesktopCapturerSource = Electron.DesktopCapturerSource;
|
23497 | type Display = Electron.Display;
|
23498 | type Extension = Electron.Extension;
|
23499 | type ExtensionInfo = Electron.ExtensionInfo;
|
23500 | type FileFilter = Electron.FileFilter;
|
23501 | type FilePathWithHeaders = Electron.FilePathWithHeaders;
|
23502 | type FilesystemPermissionRequest = Electron.FilesystemPermissionRequest;
|
23503 | type GPUFeatureStatus = Electron.GPUFeatureStatus;
|
23504 | type HIDDevice = Electron.HIDDevice;
|
23505 | type InputEvent = Electron.InputEvent;
|
23506 | type IpcMainEvent = Electron.IpcMainEvent;
|
23507 | type IpcMainInvokeEvent = Electron.IpcMainInvokeEvent;
|
23508 | type IpcRendererEvent = Electron.IpcRendererEvent;
|
23509 | type JumpListCategory = Electron.JumpListCategory;
|
23510 | type JumpListItem = Electron.JumpListItem;
|
23511 | type KeyboardEvent = Electron.KeyboardEvent;
|
23512 | type KeyboardInputEvent = Electron.KeyboardInputEvent;
|
23513 | type MediaAccessPermissionRequest = Electron.MediaAccessPermissionRequest;
|
23514 | type MemoryInfo = Electron.MemoryInfo;
|
23515 | type MemoryUsageDetails = Electron.MemoryUsageDetails;
|
23516 | type MimeTypedBuffer = Electron.MimeTypedBuffer;
|
23517 | type MouseInputEvent = Electron.MouseInputEvent;
|
23518 | type MouseWheelInputEvent = Electron.MouseWheelInputEvent;
|
23519 | type NavigationEntry = Electron.NavigationEntry;
|
23520 | type NotificationAction = Electron.NotificationAction;
|
23521 | type NotificationResponse = Electron.NotificationResponse;
|
23522 | type OpenExternalPermissionRequest = Electron.OpenExternalPermissionRequest;
|
23523 | type PaymentDiscount = Electron.PaymentDiscount;
|
23524 | type PermissionRequest = Electron.PermissionRequest;
|
23525 | type Point = Electron.Point;
|
23526 | type PostBody = Electron.PostBody;
|
23527 | type PrinterInfo = Electron.PrinterInfo;
|
23528 | type ProcessMemoryInfo = Electron.ProcessMemoryInfo;
|
23529 | type ProcessMetric = Electron.ProcessMetric;
|
23530 | type Product = Electron.Product;
|
23531 | type ProductDiscount = Electron.ProductDiscount;
|
23532 | type ProductSubscriptionPeriod = Electron.ProductSubscriptionPeriod;
|
23533 | type ProtocolRequest = Electron.ProtocolRequest;
|
23534 | type ProtocolResponse = Electron.ProtocolResponse;
|
23535 | type ProtocolResponseUploadData = Electron.ProtocolResponseUploadData;
|
23536 | type ProxyConfig = Electron.ProxyConfig;
|
23537 | type Rectangle = Electron.Rectangle;
|
23538 | type Referrer = Electron.Referrer;
|
23539 | type RenderProcessGoneDetails = Electron.RenderProcessGoneDetails;
|
23540 | type ResolvedEndpoint = Electron.ResolvedEndpoint;
|
23541 | type ResolvedHost = Electron.ResolvedHost;
|
23542 | type ScrubberItem = Electron.ScrubberItem;
|
23543 | type SegmentedControlSegment = Electron.SegmentedControlSegment;
|
23544 | type SerialPort = Electron.SerialPort;
|
23545 | type ServiceWorkerInfo = Electron.ServiceWorkerInfo;
|
23546 | type SharedWorkerInfo = Electron.SharedWorkerInfo;
|
23547 | type SharingItem = Electron.SharingItem;
|
23548 | type ShortcutDetails = Electron.ShortcutDetails;
|
23549 | type Size = Electron.Size;
|
23550 | type Task = Electron.Task;
|
23551 | type ThumbarButton = Electron.ThumbarButton;
|
23552 | type TraceCategoriesAndOptions = Electron.TraceCategoriesAndOptions;
|
23553 | type TraceConfig = Electron.TraceConfig;
|
23554 | type Transaction = Electron.Transaction;
|
23555 | type UploadData = Electron.UploadData;
|
23556 | type UploadFile = Electron.UploadFile;
|
23557 | type UploadRawData = Electron.UploadRawData;
|
23558 | type USBDevice = Electron.USBDevice;
|
23559 | type UserDefaultTypes = Electron.UserDefaultTypes;
|
23560 | type WebPreferences = Electron.WebPreferences;
|
23561 | type WebRequestFilter = Electron.WebRequestFilter;
|
23562 | type WebSource = Electron.WebSource;
|
23563 | type WindowOpenHandlerResponse = Electron.WindowOpenHandlerResponse;
|
23564 | }
|
23565 |
|
23566 | const app: App;
|
23567 | const autoUpdater: AutoUpdater;
|
23568 | const clipboard: Clipboard;
|
23569 | const contentTracing: ContentTracing;
|
23570 | const contextBridge: ContextBridge;
|
23571 | const crashReporter: CrashReporter;
|
23572 | const desktopCapturer: DesktopCapturer;
|
23573 | const dialog: Dialog;
|
23574 | const globalShortcut: GlobalShortcut;
|
23575 | const inAppPurchase: InAppPurchase;
|
23576 | const ipcMain: IpcMain;
|
23577 | const ipcRenderer: IpcRenderer;
|
23578 | const nativeImage: typeof NativeImage;
|
23579 | const nativeTheme: NativeTheme;
|
23580 | const net: Net;
|
23581 | const netLog: NetLog;
|
23582 | const parentPort: ParentPort;
|
23583 | const powerMonitor: PowerMonitor;
|
23584 | const powerSaveBlocker: PowerSaveBlocker;
|
23585 | const protocol: Protocol;
|
23586 | const pushNotifications: PushNotifications;
|
23587 | const safeStorage: SafeStorage;
|
23588 | const screen: Screen;
|
23589 | const session: typeof Session;
|
23590 | const shell: Shell;
|
23591 | const systemPreferences: SystemPreferences;
|
23592 | const utilityProcess: typeof UtilityProcess;
|
23593 | const webContents: typeof WebContents;
|
23594 | const webFrame: WebFrame;
|
23595 | const webFrameMain: typeof WebFrameMain;
|
23596 | const webUtils: WebUtils;
|
23597 |
|
23598 | }
|
23599 |
|
23600 | declare module 'electron' {
|
23601 | export = Electron.CrossProcessExports;
|
23602 | }
|
23603 |
|
23604 | declare module 'electron/main' {
|
23605 | export = Electron.Main;
|
23606 | }
|
23607 |
|
23608 | declare module 'electron/common' {
|
23609 | export = Electron.Common;
|
23610 | }
|
23611 |
|
23612 | declare module 'electron/renderer' {
|
23613 | export = Electron.Renderer;
|
23614 | }
|
23615 |
|
23616 | declare module 'electron/utility' {
|
23617 | export = Electron.Utility;
|
23618 | }
|
23619 |
|
23620 | interface NodeRequireFunction {
|
23621 | (moduleName: 'electron'): typeof Electron.CrossProcessExports;
|
23622 | (moduleName: 'electron/main'): typeof Electron.Main;
|
23623 | (moduleName: 'electron/common'): typeof Electron.Common;
|
23624 | (moduleName: 'electron/renderer'): typeof Electron.Renderer;
|
23625 | (moduleName: 'electron/utility'): typeof Electron.Utility;
|
23626 | }
|
23627 |
|
23628 | interface NodeRequire {
|
23629 | (moduleName: 'electron'): typeof Electron.CrossProcessExports;
|
23630 | (moduleName: 'electron/main'): typeof Electron.Main;
|
23631 | (moduleName: 'electron/common'): typeof Electron.Common;
|
23632 | (moduleName: 'electron/renderer'): typeof Electron.Renderer;
|
23633 | (moduleName: 'electron/utility'): typeof Electron.Utility;
|
23634 | }
|
23635 |
|
23636 | interface File {
|
23637 | /**
|
23638 | * The real path to the file on the users filesystem
|
23639 | */
|
23640 | path: string;
|
23641 | }
|
23642 |
|
23643 | declare module 'original-fs' {
|
23644 | import * as fs from 'fs';
|
23645 | export = fs;
|
23646 | }
|
23647 |
|
23648 | declare module 'node:original-fs' {
|
23649 | import * as fs from 'fs';
|
23650 | export = fs;
|
23651 | }
|
23652 |
|
23653 | interface Document {
|
23654 | createElement(tagName: 'webview'): Electron.WebviewTag;
|
23655 | }
|
23656 |
|
23657 |
|
23658 | declare namespace NodeJS {
|
23659 | interface Process extends NodeJS.EventEmitter {
|
23660 |
|
23661 | // Docs: https://electronjs.org/docs/api/process
|
23662 |
|
23663 | /**
|
23664 | * Emitted when Electron has loaded its internal initialization script and is
|
23665 | * beginning to load the web page or the main script.
|
23666 | */
|
23667 | on(event: 'loaded', listener: () => void): this;
|
23668 | off(event: 'loaded', listener: () => void): this;
|
23669 | once(event: 'loaded', listener: () => void): this;
|
23670 | addListener(event: 'loaded', listener: () => void): this;
|
23671 | removeListener(event: 'loaded', listener: () => void): this;
|
23672 | on(eventName: string | symbol, listener: (...args: any[]) => void): this;
|
23673 | off(eventName: string | symbol, listener: (...args: any[]) => void): this;
|
23674 | once(eventName: string | symbol, listener: (...args: any[]) => void): this;
|
23675 | addListener(eventName: string | symbol, listener: (...args: any[]) => void): this;
|
23676 | removeListener(eventName: string | symbol, listener: (...args: any[]) => void): this;
|
23677 | /**
|
23678 | * Causes the main thread of the current process crash.
|
23679 | */
|
23680 | crash(): void;
|
23681 | /**
|
23682 | * * `allocated` Integer - Size of all allocated objects in Kilobytes.
|
23683 | * * `total` Integer - Total allocated space in Kilobytes.
|
23684 | *
|
23685 | * Returns an object with Blink memory information. It can be useful for debugging
|
23686 | * rendering / DOM related memory issues. Note that all values are reported in
|
23687 | * Kilobytes.
|
23688 | */
|
23689 | getBlinkMemoryInfo(): Electron.BlinkMemoryInfo;
|
23690 | getCPUUsage(): Electron.CPUUsage;
|
23691 | /**
|
23692 | * The number of milliseconds since epoch, or `null` if the information is
|
23693 | * unavailable
|
23694 | *
|
23695 | * Indicates the creation time of the application. The time is represented as
|
23696 | * number of milliseconds since epoch. It returns null if it is unable to get the
|
23697 | * process creation time.
|
23698 | */
|
23699 | getCreationTime(): (number) | (null);
|
23700 | /**
|
23701 | * * `totalHeapSize` Integer
|
23702 | * * `totalHeapSizeExecutable` Integer
|
23703 | * * `totalPhysicalSize` Integer
|
23704 | * * `totalAvailableSize` Integer
|
23705 | * * `usedHeapSize` Integer
|
23706 | * * `heapSizeLimit` Integer
|
23707 | * * `mallocedMemory` Integer
|
23708 | * * `peakMallocedMemory` Integer
|
23709 | * * `doesZapGarbage` boolean
|
23710 | *
|
23711 | * Returns an object with V8 heap statistics. Note that all statistics are reported
|
23712 | * in Kilobytes.
|
23713 | */
|
23714 | getHeapStatistics(): Electron.HeapStatistics;
|
23715 | /**
|
23716 | * Resolves with a ProcessMemoryInfo
|
23717 | *
|
23718 | * Returns an object giving memory usage statistics about the current process. Note
|
23719 | * that all statistics are reported in Kilobytes. This api should be called after
|
23720 | * app ready.
|
23721 | *
|
23722 | * Chromium does not provide `residentSet` value for macOS. This is because macOS
|
23723 | * performs in-memory compression of pages that haven't been recently used. As a
|
23724 | * result the resident set size value is not what one would expect. `private`
|
23725 | * memory is more representative of the actual pre-compression memory usage of the
|
23726 | * process on macOS.
|
23727 | */
|
23728 | getProcessMemoryInfo(): Promise<Electron.ProcessMemoryInfo>;
|
23729 | /**
|
23730 | * * `total` Integer - The total amount of physical memory in Kilobytes available
|
23731 | * to the system.
|
23732 | * * `free` Integer - The total amount of memory not being used by applications or
|
23733 | * disk cache.
|
23734 | * * `swapTotal` Integer _Windows_ _Linux_ - The total amount of swap memory in
|
23735 | * Kilobytes available to the system.
|
23736 | * * `swapFree` Integer _Windows_ _Linux_ - The free amount of swap memory in
|
23737 | * Kilobytes available to the system.
|
23738 | *
|
23739 | * Returns an object giving memory usage statistics about the entire system. Note
|
23740 | * that all statistics are reported in Kilobytes.
|
23741 | */
|
23742 | getSystemMemoryInfo(): Electron.SystemMemoryInfo;
|
23743 | /**
|
23744 | * The version of the host operating system.
|
23745 | *
|
23746 | * Example:
|
23747 | *
|
23748 | * **Note:** It returns the actual operating system version instead of kernel
|
23749 | * version on macOS unlike `os.release()`.
|
23750 | */
|
23751 | getSystemVersion(): string;
|
23752 | /**
|
23753 | * Causes the main thread of the current process hang.
|
23754 | */
|
23755 | hang(): void;
|
23756 | /**
|
23757 | * Sets the file descriptor soft limit to `maxDescriptors` or the OS hard limit,
|
23758 | * whichever is lower for the current process.
|
23759 | *
|
23760 | * @platform darwin,linux
|
23761 | */
|
23762 | setFdLimit(maxDescriptors: number): void;
|
23763 | /**
|
23764 | * Indicates whether the snapshot has been created successfully.
|
23765 | *
|
23766 | * Takes a V8 heap snapshot and saves it to `filePath`.
|
23767 | */
|
23768 | takeHeapSnapshot(filePath: string): boolean;
|
23769 | /**
|
23770 | * A `string` representing Chrome's version string.
|
23771 | *
|
23772 | */
|
23773 | readonly chrome: string;
|
23774 | /**
|
23775 | * A `string` (optional) representing a globally unique ID of the current
|
23776 | * JavaScript context. Each frame has its own JavaScript context. When
|
23777 | * contextIsolation is enabled, the isolated world also has a separate JavaScript
|
23778 | * context. This property is only available in the renderer process.
|
23779 | *
|
23780 | */
|
23781 | readonly contextId?: string;
|
23782 | /**
|
23783 | * A `boolean` that indicates whether the current renderer context has
|
23784 | * `contextIsolation` enabled. It is `undefined` in the main process.
|
23785 | *
|
23786 | */
|
23787 | readonly contextIsolated: boolean;
|
23788 | /**
|
23789 | * A `boolean`. When the app is started by being passed as parameter to the default
|
23790 | * Electron executable, this property is `true` in the main process, otherwise it
|
23791 | * is `undefined`. For example when running the app with `electron .`, it is
|
23792 | * `true`, even if the app is packaged (`isPackaged`) is `true`. This can be useful
|
23793 | * to determine how many arguments will need to be sliced off from `process.argv`.
|
23794 | *
|
23795 | */
|
23796 | readonly defaultApp: boolean;
|
23797 | /**
|
23798 | * A `string` representing Electron's version string.
|
23799 | *
|
23800 | */
|
23801 | readonly electron: string;
|
23802 | /**
|
23803 | * A `boolean`, `true` when the current renderer context is the "main" renderer
|
23804 | * frame. If you want the ID of the current frame you should use
|
23805 | * `webFrame.routingId`.
|
23806 | *
|
23807 | */
|
23808 | readonly isMainFrame: boolean;
|
23809 | /**
|
23810 | * A `boolean`. For Mac App Store build, this property is `true`, for other builds
|
23811 | * it is `undefined`.
|
23812 | *
|
23813 | */
|
23814 | readonly mas: boolean;
|
23815 | /**
|
23816 | * A `boolean` that controls ASAR support inside your application. Setting this to
|
23817 | * `true` will disable the support for `asar` archives in Node's built-in modules.
|
23818 | */
|
23819 | noAsar: boolean;
|
23820 | /**
|
23821 | * A `boolean` that controls whether or not deprecation warnings are printed to
|
23822 | * `stderr`. Setting this to `true` will silence deprecation warnings. This
|
23823 | * property is used instead of the `--no-deprecation` command line flag.
|
23824 | */
|
23825 | noDeprecation: boolean;
|
23826 | /**
|
23827 | * A `Electron.ParentPort` property if this is a `UtilityProcess` (or `null`
|
23828 | * otherwise) allowing communication with the parent process.
|
23829 | */
|
23830 | parentPort: Electron.ParentPort;
|
23831 | /**
|
23832 | * A `string` representing the path to the resources directory.
|
23833 | *
|
23834 | */
|
23835 | readonly resourcesPath: string;
|
23836 | /**
|
23837 | * A `boolean`. When the renderer process is sandboxed, this property is `true`,
|
23838 | * otherwise it is `undefined`.
|
23839 | *
|
23840 | */
|
23841 | readonly sandboxed: boolean;
|
23842 | /**
|
23843 | * A `boolean` that controls whether or not deprecation warnings will be thrown as
|
23844 | * exceptions. Setting this to `true` will throw errors for deprecations. This
|
23845 | * property is used instead of the `--throw-deprecation` command line flag.
|
23846 | */
|
23847 | throwDeprecation: boolean;
|
23848 | /**
|
23849 | * A `boolean` that controls whether or not deprecations printed to `stderr`
|
23850 | * include their stack trace. Setting this to `true` will print stack traces for
|
23851 | * deprecations. This property is instead of the `--trace-deprecation` command line
|
23852 | * flag.
|
23853 | */
|
23854 | traceDeprecation: boolean;
|
23855 | /**
|
23856 | * A `boolean` that controls whether or not process warnings printed to `stderr`
|
23857 | * include their stack trace. Setting this to `true` will print stack traces for
|
23858 | * process warnings (including deprecations). This property is instead of the
|
23859 | * `--trace-warnings` command line flag.
|
23860 | */
|
23861 | traceProcessWarnings: boolean;
|
23862 | /**
|
23863 | * A `string` representing the current process's type, can be:
|
23864 | *
|
23865 | * * `browser` - The main process
|
23866 | * * `renderer` - A renderer process
|
23867 | * * `worker` - In a web worker
|
23868 | * * `utility` - In a node process launched as a service
|
23869 | *
|
23870 | */
|
23871 | readonly type: ('browser' | 'renderer' | 'worker' | 'utility');
|
23872 | /**
|
23873 | * A `boolean`. If the app is running as a Windows Store app (appx), this property
|
23874 | * is `true`, for otherwise it is `undefined`.
|
23875 | *
|
23876 | */
|
23877 | readonly windowsStore: boolean;
|
23878 | }
|
23879 | interface ProcessVersions {
|
23880 | readonly electron: string;
|
23881 | readonly chrome: string;
|
23882 | }
|
23883 | } |
\ | No newline at end of file |