| 
									
										
										
										
											2019-02-06 10:27:20 -08:00
										 |  |  | /// <reference path="../electron.d.ts" />
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-10-13 03:29:08 +02:00
										 |  |  | /** | 
					
						
							| 
									
										
										
										
											2019-02-06 10:27:20 -08:00
										 |  |  |  * This file augments the Electron TS namespace with the internal APIs | 
					
						
							|  |  |  |  * that are not documented but are used by Electron internally | 
					
						
							|  |  |  |  */ | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | declare namespace Electron { | 
					
						
							| 
									
										
										
										
											2019-02-13 23:05:49 -08:00
										 |  |  |   enum ProcessType { | 
					
						
							|  |  |  |     browser = 'browser', | 
					
						
							|  |  |  |     renderer = 'renderer', | 
					
						
							|  |  |  |     worker = 'worker' | 
					
						
							|  |  |  |   } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-02-06 10:27:20 -08:00
										 |  |  |   interface App { | 
					
						
							| 
									
										
										
										
											2019-04-16 14:22:51 -04:00
										 |  |  |     _setDefaultAppPaths(packagePath: string | null): void; | 
					
						
							| 
									
										
										
										
											2019-02-06 10:27:20 -08:00
										 |  |  |     setVersion(version: string): void; | 
					
						
							|  |  |  |     setDesktopName(name: string): void; | 
					
						
							|  |  |  |     setAppPath(path: string | null): void; | 
					
						
							|  |  |  |   } | 
					
						
							| 
									
										
										
										
											2019-02-13 23:05:49 -08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-07-16 11:37:38 -07:00
										 |  |  |   type TouchBarItemType = NonNullable<Electron.TouchBarConstructorOptions['items']>[0]; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-10-08 03:01:23 +02:00
										 |  |  |   interface BaseWindow { | 
					
						
							|  |  |  |     _init(): void; | 
					
						
							|  |  |  |   } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-07-16 11:37:38 -07:00
										 |  |  |   interface BrowserWindow { | 
					
						
							| 
									
										
										
										
											2020-10-08 03:01:23 +02:00
										 |  |  |     _init(): void; | 
					
						
							| 
									
										
										
										
											2020-07-16 11:37:38 -07:00
										 |  |  |     _touchBar: Electron.TouchBar | null; | 
					
						
							|  |  |  |     _setTouchBarItems: (items: TouchBarItemType[]) => void; | 
					
						
							|  |  |  |     _setEscapeTouchBarItem: (item: TouchBarItemType | {}) => void; | 
					
						
							|  |  |  |     _refreshTouchBarItem: (itemID: string) => void; | 
					
						
							| 
									
										
										
										
											2021-01-19 19:12:09 +09:00
										 |  |  |     _getWindowButtonVisibility: () => boolean; | 
					
						
							| 
									
										
										
										
											2020-10-02 20:18:42 +02:00
										 |  |  |     frameName: string; | 
					
						
							| 
									
										
										
										
											2020-07-16 11:37:38 -07:00
										 |  |  |     on(event: '-touch-bar-interaction', listener: (event: Event, itemID: string, details: any) => void): this; | 
					
						
							|  |  |  |     removeListener(event: '-touch-bar-interaction', listener: (event: Event, itemID: string, details: any) => void): this; | 
					
						
							|  |  |  |   } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-01-29 21:41:59 +01:00
										 |  |  |   interface BrowserWindowConstructorOptions { | 
					
						
							|  |  |  |     webContents?: WebContents; | 
					
						
							|  |  |  |   } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-05-11 13:41:42 -07:00
										 |  |  |   interface ContextBridge { | 
					
						
							| 
									
										
										
										
											2021-01-29 21:41:59 +01:00
										 |  |  |     internalContextBridge?: { | 
					
						
							| 
									
										
										
										
											2020-05-11 13:41:42 -07:00
										 |  |  |       contextIsolationEnabled: boolean; | 
					
						
							|  |  |  |       overrideGlobalValueFromIsolatedWorld(keys: string[], value: any): void; | 
					
						
							|  |  |  |       overrideGlobalValueWithDynamicPropsFromIsolatedWorld(keys: string[], value: any): void; | 
					
						
							|  |  |  |       overrideGlobalPropertyFromIsolatedWorld(keys: string[], getter: Function, setter?: Function): void; | 
					
						
							|  |  |  |       isInMainWorld(): boolean; | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  |   } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-07-16 11:37:38 -07:00
										 |  |  |   interface TouchBar { | 
					
						
							|  |  |  |     _removeFromWindow: (win: BrowserWindow) => void; | 
					
						
							|  |  |  |   } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-07-17 19:23:52 +02:00
										 |  |  |   interface WebContents { | 
					
						
							| 
									
										
										
										
											2020-10-08 03:01:23 +02:00
										 |  |  |     _loadURL(url: string, options: ElectronInternal.LoadURLOptions): void; | 
					
						
							| 
									
										
										
										
											2019-07-17 19:23:52 +02:00
										 |  |  |     getOwnerBrowserWindow(): Electron.BrowserWindow; | 
					
						
							| 
									
										
										
										
											2020-07-06 10:50:03 -07:00
										 |  |  |     getWebPreferences(): Electron.WebPreferences; | 
					
						
							| 
									
										
										
										
											2020-06-25 10:19:08 -07:00
										 |  |  |     getLastWebPreferences(): Electron.WebPreferences; | 
					
						
							|  |  |  |     _getPreloadPaths(): string[]; | 
					
						
							| 
									
										
										
										
											2020-06-28 18:22:55 -07:00
										 |  |  |     equal(other: WebContents): boolean; | 
					
						
							| 
									
										
										
										
											2020-10-02 20:18:42 +02:00
										 |  |  |     browserWindowOptions: BrowserWindowConstructorOptions; | 
					
						
							| 
									
										
										
										
											2021-04-13 12:35:27 -07:00
										 |  |  |     _windowOpenHandler: ((details: Electron.HandlerDetails) => any) | null; | 
					
						
							|  |  |  |     _callWindowOpenHandler(event: any, details: Electron.HandlerDetails): Electron.BrowserWindowConstructorOptions | null; | 
					
						
							| 
									
										
										
										
											2020-11-10 09:06:03 -08:00
										 |  |  |     _setNextChildWebPreferences(prefs: Partial<Electron.BrowserWindowConstructorOptions['webPreferences']> & Pick<Electron.BrowserWindowConstructorOptions, 'backgroundColor'>): void; | 
					
						
							| 
									
										
										
										
											2020-12-03 07:55:50 +01:00
										 |  |  |     _send(internal: boolean, channel: string, args: any): boolean; | 
					
						
							| 
									
										
										
										
											2020-12-09 12:48:16 -08:00
										 |  |  |     _sendToFrameInternal(frameId: number | [number, number], channel: string, ...args: any[]): boolean; | 
					
						
							| 
									
										
										
										
											2019-03-13 20:03:17 +01:00
										 |  |  |     _sendInternal(channel: string, ...args: any[]): void; | 
					
						
							| 
									
										
										
										
											2020-07-06 10:50:03 -07:00
										 |  |  |     _printToPDF(options: any): Promise<Buffer>; | 
					
						
							|  |  |  |     _print(options: any, callback?: (success: boolean, failureReason: string) => void): void; | 
					
						
							|  |  |  |     _getPrinters(): Electron.PrinterInfo[]; | 
					
						
							|  |  |  |     _init(): void; | 
					
						
							|  |  |  |     canGoToIndex(index: number): boolean; | 
					
						
							|  |  |  |     getActiveIndex(): number; | 
					
						
							|  |  |  |     length(): number; | 
					
						
							| 
									
										
										
										
											2020-10-13 03:29:08 +02:00
										 |  |  |     destroy(): void; | 
					
						
							|  |  |  |     // <webview>
 | 
					
						
							|  |  |  |     attachToIframe(embedderWebContents: Electron.WebContents, embedderFrameId: number): void; | 
					
						
							|  |  |  |     detachFromOuterFrame(): void; | 
					
						
							|  |  |  |     setEmbedder(embedder: Electron.WebContents): void; | 
					
						
							|  |  |  |     attachParams?: Record<string, any>; | 
					
						
							|  |  |  |     viewInstanceId: number; | 
					
						
							| 
									
										
										
										
											2019-03-13 20:03:17 +01:00
										 |  |  |   } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-01-15 01:00:37 +01:00
										 |  |  |   interface WebFrameMain { | 
					
						
							|  |  |  |     _send(internal: boolean, channel: string, args: any): void; | 
					
						
							|  |  |  |     _sendInternal(channel: string, ...args: any[]): void; | 
					
						
							|  |  |  |     _postMessage(channel: string, message: any, transfer?: any[]): void; | 
					
						
							|  |  |  |   } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-10-02 04:52:29 +02:00
										 |  |  |   interface WebPreferences { | 
					
						
							|  |  |  |     guestInstanceId?: number; | 
					
						
							| 
									
										
										
										
											2021-01-29 21:41:59 +01:00
										 |  |  |     openerId?: number | null; | 
					
						
							| 
									
										
										
										
											2020-10-13 03:29:08 +02:00
										 |  |  |     disablePopups?: boolean; | 
					
						
							|  |  |  |     preloadURL?: string; | 
					
						
							|  |  |  |     embedder?: Electron.WebContents; | 
					
						
							|  |  |  |     type?: 'backgroundPage' | 'window' | 'browserView' | 'remote' | 'webview' | 'offscreen'; | 
					
						
							| 
									
										
										
										
											2020-10-02 04:52:29 +02:00
										 |  |  |   } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-07-06 13:24:54 -07:00
										 |  |  |   interface Menu { | 
					
						
							|  |  |  |     _init(): void; | 
					
						
							|  |  |  |     _isCommandIdChecked(id: string): boolean; | 
					
						
							|  |  |  |     _isCommandIdEnabled(id: string): boolean; | 
					
						
							|  |  |  |     _shouldCommandIdWorkWhenHidden(id: string): boolean; | 
					
						
							|  |  |  |     _isCommandIdVisible(id: string): boolean; | 
					
						
							|  |  |  |     _getAcceleratorForCommandId(id: string, useDefaultAccelerator: boolean): Accelerator | undefined; | 
					
						
							|  |  |  |     _shouldRegisterAcceleratorForCommandId(id: string): boolean; | 
					
						
							| 
									
										
										
										
											2020-10-20 10:33:06 +09:00
										 |  |  |     _getSharingItemForCommandId(id: string): SharingItem | null; | 
					
						
							| 
									
										
										
										
											2020-07-06 13:24:54 -07:00
										 |  |  |     _callMenuWillShow(): void; | 
					
						
							|  |  |  |     _executeCommand(event: any, id: number): void; | 
					
						
							|  |  |  |     _menuWillShow(): void; | 
					
						
							|  |  |  |     commandsMap: Record<string, MenuItem>; | 
					
						
							| 
									
										
										
										
											2021-06-03 07:59:56 +02:00
										 |  |  |     groupsMap: Record<string, MenuItem[]>; | 
					
						
							| 
									
										
										
										
											2020-07-06 13:24:54 -07:00
										 |  |  |     getItemCount(): number; | 
					
						
							|  |  |  |     popupAt(window: BaseWindow, x: number, y: number, positioning: number, callback: () => void): void; | 
					
						
							|  |  |  |     closePopupAt(id: number): void; | 
					
						
							|  |  |  |     setSublabel(index: number, label: string): void; | 
					
						
							|  |  |  |     setToolTip(index: number, tooltip: string): void; | 
					
						
							|  |  |  |     setIcon(index: number, image: string | NativeImage): void; | 
					
						
							|  |  |  |     setRole(index: number, role: string): void; | 
					
						
							|  |  |  |     insertItem(index: number, commandId: number, label: string): void; | 
					
						
							|  |  |  |     insertCheckItem(index: number, commandId: number, label: string): void; | 
					
						
							|  |  |  |     insertRadioItem(index: number, commandId: number, label: string, groupId: number): void; | 
					
						
							|  |  |  |     insertSeparator(index: number): void; | 
					
						
							|  |  |  |     insertSubMenu(index: number, commandId: number, label: string, submenu?: Menu): void; | 
					
						
							|  |  |  |     delegate?: any; | 
					
						
							|  |  |  |     getAcceleratorTextAt(index: number): string; | 
					
						
							|  |  |  |   } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   interface MenuItem { | 
					
						
							|  |  |  |     overrideReadOnlyProperty(property: string, value: any): void; | 
					
						
							|  |  |  |     groupId: number; | 
					
						
							|  |  |  |     getDefaultRoleAccelerator(): Accelerator | undefined; | 
					
						
							| 
									
										
										
										
											2020-11-12 00:29:18 +09:00
										 |  |  |     getCheckStatus(): boolean; | 
					
						
							| 
									
										
										
										
											2020-07-06 13:24:54 -07:00
										 |  |  |     acceleratorWorksWhenHidden?: boolean; | 
					
						
							|  |  |  |   } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-01-29 21:41:59 +01:00
										 |  |  |   interface IpcMainEvent { | 
					
						
							|  |  |  |     sendReply(value: any): void; | 
					
						
							|  |  |  |   } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-10-08 03:01:23 +02:00
										 |  |  |   interface IpcMainInvokeEvent { | 
					
						
							| 
									
										
										
										
											2021-01-29 21:41:59 +01:00
										 |  |  |     sendReply(value: any): void; | 
					
						
							| 
									
										
										
										
											2020-10-08 03:01:23 +02:00
										 |  |  |     _reply(value: any): void; | 
					
						
							| 
									
										
										
										
											2021-01-29 21:41:59 +01:00
										 |  |  |     _throw(error: Error | string): void; | 
					
						
							| 
									
										
										
										
											2020-10-08 03:01:23 +02:00
										 |  |  |   } | 
					
						
							| 
									
										
										
										
											2020-07-06 13:24:54 -07:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-02-14 14:29:20 -08:00
										 |  |  |   const deprecate: ElectronInternal.DeprecationUtil; | 
					
						
							| 
									
										
										
										
											2020-04-06 17:04:09 -07:00
										 |  |  | 
 | 
					
						
							|  |  |  |   namespace Main { | 
					
						
							|  |  |  |     const deprecate: ElectronInternal.DeprecationUtil; | 
					
						
							|  |  |  |   } | 
					
						
							| 
									
										
										
										
											2020-05-22 12:46:22 -07:00
										 |  |  | 
 | 
					
						
							|  |  |  |   class View {} | 
					
						
							| 
									
										
										
										
											2020-10-02 04:52:29 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-06-28 18:22:55 -07:00
										 |  |  |   // Experimental views API
 | 
					
						
							| 
									
										
										
										
											2020-06-29 16:06:20 +09:00
										 |  |  |   class BaseWindow { | 
					
						
							| 
									
										
										
										
											2020-06-28 18:22:55 -07:00
										 |  |  |     constructor(args: {show: boolean}) | 
					
						
							|  |  |  |     setContentView(view: View): void | 
					
						
							| 
									
										
										
										
											2020-06-29 16:06:20 +09:00
										 |  |  |     static fromId(id: number): BaseWindow; | 
					
						
							|  |  |  |     static getAllWindows(): BaseWindow[]; | 
					
						
							| 
									
										
										
										
											2020-06-28 18:22:55 -07:00
										 |  |  |     isFocused(): boolean; | 
					
						
							| 
									
										
										
										
											2020-06-29 16:06:20 +09:00
										 |  |  |     static getFocusedWindow(): BaseWindow | undefined; | 
					
						
							| 
									
										
										
										
											2020-07-06 13:24:54 -07:00
										 |  |  |     setMenu(menu: Menu): void; | 
					
						
							| 
									
										
										
										
											2020-06-28 18:22:55 -07:00
										 |  |  |   } | 
					
						
							|  |  |  |   class WebContentsView { | 
					
						
							|  |  |  |     constructor(options: BrowserWindowConstructorOptions) | 
					
						
							|  |  |  |   } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   // Deprecated / undocumented BrowserWindow methods
 | 
					
						
							|  |  |  |   interface BrowserWindow { | 
					
						
							|  |  |  |     getURL(): string; | 
					
						
							|  |  |  |     send(channel: string, ...args: any[]): void; | 
					
						
							|  |  |  |     openDevTools(options?: Electron.OpenDevToolsOptions): void; | 
					
						
							|  |  |  |     closeDevTools(): void; | 
					
						
							|  |  |  |     isDevToolsOpened(): void; | 
					
						
							|  |  |  |     isDevToolsFocused(): void; | 
					
						
							|  |  |  |     toggleDevTools(): void; | 
					
						
							|  |  |  |     inspectElement(x: number, y: number): void; | 
					
						
							|  |  |  |     inspectSharedWorker(): void; | 
					
						
							|  |  |  |     inspectServiceWorker(): void; | 
					
						
							|  |  |  |     getBackgroundThrottling(): void; | 
					
						
							|  |  |  |     setBackgroundThrottling(allowed: boolean): void; | 
					
						
							|  |  |  |   } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   namespace Main { | 
					
						
							| 
									
										
										
										
											2020-06-29 16:06:20 +09:00
										 |  |  |     class BaseWindow extends Electron.BaseWindow {} | 
					
						
							| 
									
										
										
										
											2020-06-28 18:22:55 -07:00
										 |  |  |     class View extends Electron.View {} | 
					
						
							|  |  |  |     class WebContentsView extends Electron.WebContentsView {} | 
					
						
							|  |  |  |   } | 
					
						
							| 
									
										
										
										
											2019-02-14 14:29:20 -08:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | declare namespace ElectronInternal { | 
					
						
							|  |  |  |   type DeprecationHandler = (message: string) => void; | 
					
						
							|  |  |  |   interface DeprecationUtil { | 
					
						
							| 
									
										
										
										
											2019-05-23 15:31:38 -07:00
										 |  |  |     warnOnce(oldName: string, newName?: string): () => void; | 
					
						
							| 
									
										
										
										
											2019-09-04 11:13:37 -07:00
										 |  |  |     setHandler(handler: DeprecationHandler | null): void; | 
					
						
							| 
									
										
										
										
											2019-02-14 14:29:20 -08:00
										 |  |  |     getHandler(): DeprecationHandler | null; | 
					
						
							|  |  |  |     warn(oldName: string, newName: string): void; | 
					
						
							|  |  |  |     log(message: string): void; | 
					
						
							| 
									
										
										
										
											2020-10-08 03:01:23 +02:00
										 |  |  |     removeFunction<T extends Function>(fn: T, removedName: string): T; | 
					
						
							|  |  |  |     renameFunction<T extends Function>(fn: T, newName: string): T; | 
					
						
							| 
									
										
										
										
											2019-02-14 14:29:20 -08:00
										 |  |  |     event(emitter: NodeJS.EventEmitter, oldName: string, newName: string): void; | 
					
						
							| 
									
										
										
										
											2020-02-26 14:03:52 -08:00
										 |  |  |     removeProperty<T, K extends (keyof T & string)>(object: T, propertyName: K, onlyForValues?: any[]): T; | 
					
						
							| 
									
										
										
										
											2019-02-14 14:29:20 -08:00
										 |  |  |     renameProperty<T, K extends (keyof T & string)>(object: T, oldName: string, newName: K): T; | 
					
						
							| 
									
										
										
										
											2020-06-30 12:49:08 -07:00
										 |  |  |     moveAPI<T extends Function>(fn: T, oldUsage: string, newUsage: string): T; | 
					
						
							| 
									
										
										
										
											2019-02-14 14:29:20 -08:00
										 |  |  |   } | 
					
						
							| 
									
										
										
										
											2019-02-19 09:24:19 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-06-15 12:44:18 +02:00
										 |  |  |   interface DesktopCapturer { | 
					
						
							|  |  |  |     startHandling(captureWindow: boolean, captureScreen: boolean, thumbnailSize: Electron.Size, fetchWindowIcons: boolean): void; | 
					
						
							| 
									
										
										
										
											2020-08-24 11:23:25 -07:00
										 |  |  |     _onerror?: (error: string) => void; | 
					
						
							|  |  |  |     _onfinished?: (sources: Electron.DesktopCapturerSource[], fetchWindowIcons: boolean) => void; | 
					
						
							| 
									
										
										
										
											2019-06-15 12:44:18 +02:00
										 |  |  |   } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   interface GetSourcesOptions { | 
					
						
							|  |  |  |     captureWindow: boolean; | 
					
						
							|  |  |  |     captureScreen: boolean; | 
					
						
							|  |  |  |     thumbnailSize: Electron.Size; | 
					
						
							|  |  |  |     fetchWindowIcons: boolean; | 
					
						
							|  |  |  |   } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   interface GetSourcesResult { | 
					
						
							|  |  |  |     id: string; | 
					
						
							|  |  |  |     name: string; | 
					
						
							| 
									
										
										
										
											2020-05-13 19:05:53 +02:00
										 |  |  |     thumbnail: Electron.NativeImage; | 
					
						
							| 
									
										
										
										
											2019-06-15 12:44:18 +02:00
										 |  |  |     display_id: string; | 
					
						
							| 
									
										
										
										
											2020-05-13 19:05:53 +02:00
										 |  |  |     appIcon: Electron.NativeImage | null; | 
					
						
							| 
									
										
										
										
											2019-06-15 12:44:18 +02:00
										 |  |  |   } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-10-02 04:52:29 +02:00
										 |  |  |   interface IpcRendererInternal extends Electron.IpcRenderer { | 
					
						
							|  |  |  |     invoke<T>(channel: string, ...args: any[]): Promise<T>; | 
					
						
							| 
									
										
										
										
											2019-11-21 13:32:31 +01:00
										 |  |  |   } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-02-19 09:24:19 +00:00
										 |  |  |   // Internal IPC has _replyInternal and NO reply method
 | 
					
						
							|  |  |  |   interface IpcMainInternalEvent extends Omit<Electron.IpcMainEvent, 'reply'> { | 
					
						
							|  |  |  |   } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-05-06 08:29:01 -07:00
										 |  |  |   interface IpcMainInternal extends NodeJS.EventEmitter { | 
					
						
							| 
									
										
										
										
											2019-08-24 00:45:50 +02:00
										 |  |  |     handle(channel: string, listener: (event: Electron.IpcMainInvokeEvent, ...args: any[]) => Promise<any> | any): void; | 
					
						
							| 
									
										
										
										
											2019-02-19 09:24:19 +00:00
										 |  |  |     on(channel: string, listener: (event: IpcMainInternalEvent, ...args: any[]) => void): this; | 
					
						
							|  |  |  |     once(channel: string, listener: (event: IpcMainInternalEvent, ...args: any[]) => void): this; | 
					
						
							|  |  |  |   } | 
					
						
							| 
									
										
										
										
											2019-03-07 15:26:23 -08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-01-29 21:41:59 +01:00
										 |  |  |   interface Event extends Electron.Event { | 
					
						
							|  |  |  |     sender: WebContents; | 
					
						
							|  |  |  |   } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-10-08 03:01:23 +02:00
										 |  |  |   interface LoadURLOptions extends Electron.LoadURLOptions { | 
					
						
							|  |  |  |     reloadIgnoringCache?: boolean; | 
					
						
							|  |  |  |   } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-01-29 21:41:59 +01:00
										 |  |  |   interface WebContentsPrintOptions extends Electron.WebContentsPrintOptions { | 
					
						
							|  |  |  |     mediaSize?: MediaSize; | 
					
						
							|  |  |  |   } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   type MediaSize = { | 
					
						
							|  |  |  |     name: string, | 
					
						
							|  |  |  |     custom_display_name: string, | 
					
						
							|  |  |  |     height_microns: number, | 
					
						
							|  |  |  |     width_microns: number, | 
					
						
							|  |  |  |     is_default?: 'true', | 
					
						
							|  |  |  |   } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-08-23 11:18:58 +02:00
										 |  |  |   type ModuleLoader = () => any; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   interface ModuleEntry { | 
					
						
							|  |  |  |     name: string; | 
					
						
							|  |  |  |     private?: boolean; | 
					
						
							|  |  |  |     loader: ModuleLoader; | 
					
						
							|  |  |  |   } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-03-19 16:55:49 -07:00
										 |  |  |   class WebViewElement extends HTMLElement { | 
					
						
							| 
									
										
										
										
											2019-03-07 15:26:23 -08:00
										 |  |  |     static observedAttributes: Array<string>; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     public contentWindow: Window; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-08-24 11:23:25 -07:00
										 |  |  |     public connectedCallback?(): void; | 
					
						
							|  |  |  |     public attributeChangedCallback?(): void; | 
					
						
							|  |  |  |     public disconnectedCallback?(): void; | 
					
						
							| 
									
										
										
										
											2019-03-07 15:26:23 -08:00
										 |  |  | 
 | 
					
						
							|  |  |  |     // Created in web-view-impl
 | 
					
						
							| 
									
										
										
										
											2019-03-26 02:57:27 +01:00
										 |  |  |     public getWebContentsId(): number; | 
					
						
							| 
									
										
										
										
											2019-11-12 21:56:17 +01:00
										 |  |  |     public capturePage(rect?: Electron.Rectangle): Promise<Electron.NativeImage>; | 
					
						
							| 
									
										
										
										
											2019-03-07 15:26:23 -08:00
										 |  |  |   } | 
					
						
							| 
									
										
										
										
											2020-10-13 03:29:08 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  |   class WebContents extends Electron.WebContents { | 
					
						
							|  |  |  |     static create(opts: Electron.WebPreferences): Electron.WebContents; | 
					
						
							|  |  |  |   } | 
					
						
							| 
									
										
										
										
											2019-02-06 10:27:20 -08:00
										 |  |  | } | 
					
						
							| 
									
										
										
										
											2019-02-19 13:09:44 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | declare namespace Chrome { | 
					
						
							|  |  |  |   namespace Tabs { | 
					
						
							|  |  |  |     // https://developer.chrome.com/extensions/tabs#method-executeScript
 | 
					
						
							|  |  |  |     interface ExecuteScriptDetails { | 
					
						
							|  |  |  |       code?: string; | 
					
						
							|  |  |  |       file?: string; | 
					
						
							|  |  |  |       allFrames?: boolean; | 
					
						
							|  |  |  |       frameId?: number; | 
					
						
							|  |  |  |       matchAboutBlank?: boolean; | 
					
						
							|  |  |  |       runAt?: 'document-start' | 'document-end' | 'document_idle'; | 
					
						
							|  |  |  |       cssOrigin: 'author' | 'user'; | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     type ExecuteScriptCallback = (result: Array<any>) => void; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     // https://developer.chrome.com/extensions/tabs#method-sendMessage
 | 
					
						
							|  |  |  |     interface SendMessageDetails { | 
					
						
							|  |  |  |       frameId?: number; | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     type SendMessageCallback = (result: any) => void; | 
					
						
							|  |  |  |   } | 
					
						
							|  |  |  | } | 
					
						
							| 
									
										
										
										
											2019-02-19 17:05:14 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | interface Global extends NodeJS.Global { | 
					
						
							|  |  |  |   require: NodeRequire; | 
					
						
							|  |  |  |   module: NodeModule; | 
					
						
							|  |  |  |   __filename: string; | 
					
						
							|  |  |  |   __dirname: string; | 
					
						
							|  |  |  | } |