Bumped electron version

Summary:
We in React VR were need newer Chrome DevTools version to make our plugin work properly. Chromium version with required fixes were shipped in electron 5.0.0.

This diff bumps electron version and explicitly allows node integration (accessing require, process and other node related functions from window object in index.html), because it was disabled by default in 5.0.0.

Reviewed By: jknoxville

Differential Revision: D15693539

fbshipit-source-id: 4f71a07b2afaa489aec46940c924f4ad30ad0413
This commit is contained in:
Daniel Büchele
2019-06-10 10:31:42 -07:00
committed by Facebook Github Bot
parent 844cabd5d3
commit 79414aa3e1
16 changed files with 382 additions and 169 deletions

View File

@@ -5,33 +5,44 @@
* @format
* @flow
*
* This is an autogenerated libdef for: electron-v4.0.5 renderer process
* This is an autogenerated libdef for: electron-v5.0.2 renderer process
*/
declare module 'electron' {
declare module.exports: {
clipboard: {
readText: (type?: ?string) => string,
writeText: (text: string, type?: ?string) => void,
readHTML: (type?: ?string) => string,
writeHTML: (markup: string, type?: ?string) => void,
readImage: (type?: ?string) => NativeImage,
writeImage: (image: NativeImage, type?: ?string) => void,
readRTF: (type?: ?string) => string,
writeRTF: (text: string, type?: ?string) => void,
readText: (type?: ?'selection' | 'clipboard') => string,
writeText: (text: string, type?: ?'selection' | 'clipboard') => void,
readHTML: (type?: ?'selection' | 'clipboard') => string,
writeHTML: (markup: string, type?: ?'selection' | 'clipboard') => void,
readImage: (type?: ?'selection' | 'clipboard') => NativeImage,
writeImage: (
image: NativeImage,
type?: ?'selection' | 'clipboard',
) => void,
readRTF: (type?: ?'selection' | 'clipboard') => string,
writeRTF: (text: string, type?: ?'selection' | 'clipboard') => void,
readBookmark: () => {
title: string,
url: string,
},
writeBookmark: (title: string, url: string, type?: ?string) => void,
writeBookmark: (
title: string,
url: string,
type?: ?'selection' | 'clipboard',
) => void,
readFindText: () => string,
writeFindText: (text: string) => void,
clear: (type?: ?string) => void,
availableFormats: (type?: ?string) => Array<string>,
has: (format: string, type?: ?string) => boolean,
clear: (type?: ?'selection' | 'clipboard') => void,
availableFormats: (type?: ?'selection' | 'clipboard') => Array<string>,
has: (format: string, type?: ?'selection' | 'clipboard') => boolean,
read: (format: string) => string,
readBuffer: (format: string) => Buffer,
writeBuffer: (format: string, buffer: Buffer, type?: ?string) => void,
writeBuffer: (
format: string,
buffer: Buffer,
type?: ?'selection' | 'clipboard',
) => void,
write: (
data: {
text?: ?string,
@@ -40,7 +51,7 @@ declare module 'electron' {
rtf?: ?string,
bookmark?: ?string,
},
type?: ?string,
type?: ?'selection' | 'clipboard',
) => void,
},
crashReporter: {
@@ -66,9 +77,15 @@ declare module 'electron' {
options: {
types: Array<string>,
thumbnailSize?: ?Size,
fetchWindowIcons?: ?boolean,
},
callback: Function,
) => void,
getSources: (options: {
types: Array<string>,
thumbnailSize?: ?Size,
fetchWindowIcons?: ?boolean,
}) => Promise<any>,
},
ipcRenderer: {
on: (channel: string, listener: Function) => void,
@@ -134,9 +151,11 @@ declare module 'electron' {
on: (eventName: 'loaded', callback: () => void) => void,
once: (eventName: 'loaded', callback: () => void) => void,
defaultApp?: ?boolean,
isMainFrame?: ?boolean,
mas?: ?boolean,
noAsar?: ?boolean,
noDeprecation?: ?boolean,
enablePromiseAPIs?: ?boolean,
resourcesPath?: ?string,
sandboxed?: ?boolean,
throwDeprecation?: ?boolean,
@@ -178,11 +197,18 @@ declare module 'electron' {
},
callback: Function,
) => void,
getFileIcon: (
path: string,
options?: ?{
size: 'small' | 'normal' | 'large',
},
) => Promise<any>,
setPath: (name: string, path: string) => void,
getVersion: () => string,
getName: () => string,
setName: (name: string) => void,
getLocale: () => string,
getLocaleCountryCode: () => string,
addRecentDocument: (path: string) => void,
clearRecentDocuments: () => void,
setAsDefaultProtocolClient: (
@@ -262,14 +288,15 @@ declare module 'electron' {
applicationName?: ?string,
applicationVersion?: ?string,
copyright?: ?string,
credits?: ?string,
version?: ?string,
credits?: ?string,
website?: ?string,
iconPath?: ?string,
}) => void,
startAccessingSecurityScopedResource: (
bookmarkData: string,
) => Function,
enableSandbox: () => void,
enableMixedSandbox: () => void,
isInApplicationsFolder: () => boolean,
moveToApplicationsFolder: () => boolean,
on: ((
@@ -403,6 +430,10 @@ declare module 'electron' {
workingDirectory: string,
) => void,
) => void) &
((
eventName: 'desktop-capturer-get-sources',
callback: (event: Event, webContents: WebContents) => void,
) => void) &
((
eventName: 'remote-require',
callback: (
@@ -574,6 +605,10 @@ declare module 'electron' {
workingDirectory: string,
) => void,
) => void) &
((
eventName: 'desktop-capturer-get-sources',
callback: (event: Event, webContents: WebContents) => void,
) => void) &
((
eventName: 'remote-require',
callback: (
@@ -618,6 +653,8 @@ declare module 'electron' {
commandLine: {
appendSwitch?: ?Function,
appendArgument?: ?Function,
hasSwitch?: ?Function,
getSwitchValue?: ?Function,
},
dock: {
bounce?: ?Function,
@@ -673,27 +710,38 @@ declare module 'electron' {
((eventName: 'before-quit-for-update', callback: () => void) => void),
},
clipboard: {
readText: (type?: ?string) => string,
writeText: (text: string, type?: ?string) => void,
readHTML: (type?: ?string) => string,
writeHTML: (markup: string, type?: ?string) => void,
readImage: (type?: ?string) => NativeImage,
writeImage: (image: NativeImage, type?: ?string) => void,
readRTF: (type?: ?string) => string,
writeRTF: (text: string, type?: ?string) => void,
readText: (type?: ?'selection' | 'clipboard') => string,
writeText: (text: string, type?: ?'selection' | 'clipboard') => void,
readHTML: (type?: ?'selection' | 'clipboard') => string,
writeHTML: (markup: string, type?: ?'selection' | 'clipboard') => void,
readImage: (type?: ?'selection' | 'clipboard') => NativeImage,
writeImage: (
image: NativeImage,
type?: ?'selection' | 'clipboard',
) => void,
readRTF: (type?: ?'selection' | 'clipboard') => string,
writeRTF: (text: string, type?: ?'selection' | 'clipboard') => void,
readBookmark: () => {
title: string,
url: string,
},
writeBookmark: (title: string, url: string, type?: ?string) => void,
writeBookmark: (
title: string,
url: string,
type?: ?'selection' | 'clipboard',
) => void,
readFindText: () => string,
writeFindText: (text: string) => void,
clear: (type?: ?string) => void,
availableFormats: (type?: ?string) => Array<string>,
has: (format: string, type?: ?string) => boolean,
clear: (type?: ?'selection' | 'clipboard') => void,
availableFormats: (type?: ?'selection' | 'clipboard') => Array<string>,
has: (format: string, type?: ?'selection' | 'clipboard') => boolean,
read: (format: string) => string,
readBuffer: (format: string) => Buffer,
writeBuffer: (format: string, buffer: Buffer, type?: ?string) => void,
writeBuffer: (
format: string,
buffer: Buffer,
type?: ?'selection' | 'clipboard',
) => void,
write: (
data: {
text?: ?string,
@@ -702,28 +750,21 @@ declare module 'electron' {
rtf?: ?string,
bookmark?: ?string,
},
type?: ?string,
type?: ?'selection' | 'clipboard',
) => void,
},
contentTracing: {
getCategories: (callback: Function) => void,
getCategories: () => Promise<any>,
startRecording: (
options: TraceCategoriesAndOptions | TraceConfig,
callback: Function,
) => void,
startRecording: (
options: TraceCategoriesAndOptions | TraceConfig,
) => Promise<any>,
stopRecording: (resultFilePath: string, callback: Function) => void,
startMonitoring: (
options: {
categoryFilter: string,
traceOptions: string,
},
callback: Function,
) => void,
stopMonitoring: (callback: Function) => void,
captureMonitoringSnapshot: (
resultFilePath: string,
callback: Function,
) => void,
stopRecording: (resultFilePath: string) => Promise<any>,
getTraceBufferUsage: (callback: Function) => void,
},
crashReporter: {
@@ -766,7 +807,7 @@ declare module 'electron' {
securityScopedBookmarks?: ?boolean,
},
callback?: ?Function,
) => Array<string>) &
) => Array<String> | typeof undefined) &
((
options: {
title?: ?string,
@@ -787,7 +828,7 @@ declare module 'electron' {
securityScopedBookmarks?: ?boolean,
},
callback?: ?Function,
) => Array<string>),
) => Array<String> | typeof undefined),
showSaveDialog: ((
browserWindow?: ?BrowserWindow,
options: {
@@ -801,7 +842,7 @@ declare module 'electron' {
securityScopedBookmarks?: ?boolean,
},
callback?: ?Function,
) => string) &
) => string | typeof undefined) &
((
options: {
title?: ?string,
@@ -814,7 +855,7 @@ declare module 'electron' {
securityScopedBookmarks?: ?boolean,
},
callback?: ?Function,
) => string),
) => string | typeof undefined),
showMessageBox: ((
browserWindow?: ?BrowserWindow,
options: {
@@ -868,7 +909,8 @@ declare module 'electron' {
) => void),
},
globalShortcut: {
register: (accelerator: Accelerator, callback: Function) => void,
register: (accelerator: Accelerator, callback: Function) => boolean,
registerAll: (accelerators: Array<string>, callback: Function) => void,
isRegistered: (accelerator: Accelerator) => boolean,
unregister: (accelerator: Accelerator) => void,
unregisterAll: () => void,
@@ -981,9 +1023,11 @@ declare module 'electron' {
on: (eventName: 'loaded', callback: () => void) => void,
once: (eventName: 'loaded', callback: () => void) => void,
defaultApp?: ?boolean,
isMainFrame?: ?boolean,
mas?: ?boolean,
noAsar?: ?boolean,
noDeprecation?: ?boolean,
enablePromiseAPIs?: ?boolean,
resourcesPath?: ?string,
sandboxed?: ?boolean,
throwDeprecation?: ?boolean,
@@ -997,13 +1041,9 @@ declare module 'electron' {
},
},
protocol: {
registerStandardSchemes: (
schemes: Array<string>,
options?: ?{
secure?: ?boolean,
},
registerSchemesAsPrivileged: (
customSchemes: Array<CustomScheme>,
) => void,
registerServiceWorkerSchemes: (schemes: Array<string>) => void,
registerFileProtocol: (
scheme: string,
handler: Function,
@@ -1031,6 +1071,7 @@ declare module 'electron' {
) => void,
unregisterProtocol: (scheme: string, completion?: ?Function) => void,
isProtocolHandled: (scheme: string, callback: Function) => void,
isProtocolHandled: (scheme: string) => Promise<any>,
interceptFileProtocol: (
scheme: string,
handler: Function,
@@ -1119,14 +1160,20 @@ declare module 'electron' {
shell: {
showItemInFolder: (fullPath: string) => boolean,
openItem: (fullPath: string) => boolean,
openExternalSync: (
url: string,
options?: ?{
activate?: ?boolean,
workingDirectory?: ?string,
},
) => boolean,
openExternal: (
url: string,
options?: ?{
activate?: ?boolean,
workingDirectory?: ?string,
},
callback?: ?Function,
) => boolean,
) => Promise<any>,
moveItemToTrash: (fullPath: string) => boolean,
beep: () => void,
writeShortcutLink: (
@@ -1139,7 +1186,11 @@ declare module 'electron' {
systemPreferences: {
isDarkMode: () => boolean,
isSwipeTrackingFromScrollEventsEnabled: () => boolean,
postNotification: (event: string, userInfo: {}) => void,
postNotification: (
event: string,
userInfo: {},
deliverImmediately?: ?boolean,
) => void,
postLocalNotification: (event: string, userInfo: {}) => void,
postWorkspaceNotification: (event: string, userInfo: {}) => void,
subscribeNotification: (event: string, callback: Function) => number,
@@ -1173,6 +1224,7 @@ declare module 'electron' {
getAccentColor: () => string,
getColor: (
color:
| '3d-dark-shadow'
| '3d-dark-shadow'
| '3d-face'
| '3d-highlight'
@@ -1202,9 +1254,56 @@ declare module 'electron' {
| 'scrollbar'
| 'window'
| 'window-frame'
| 'window-text',
| 'window-text'
| 'alternate-selected-control-text'
| 'alternate-selected-control-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'
| '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,
getSystemColor: (
color:
| 'blue'
| 'brown'
| 'gray'
| 'green'
| 'orange'
| 'pink'
| 'purple'
| 'red'
| 'yellow',
) => void,
isInvertedColorScheme: () => boolean,
isHighContrastColorScheme: () => boolean,
getEffectiveAppearance: () => 'dark' | 'light' | 'unknown',
getAppLevelAppearance: () => 'dark' | 'light' | 'unknown',
setAppLevelAppearance: (appearance: string | null) => void,
@@ -1225,6 +1324,10 @@ declare module 'electron' {
eventName: 'inverted-color-scheme-changed',
callback: (event: Event, invertedColorScheme: boolean) => void,
) => void) &
((
eventName: 'high-contrast-color-scheme-changed',
callback: (event: Event, highContrastColorScheme: boolean) => void,
) => void) &
((
eventName: 'appearance-changed',
callback: (newAppearance: 'dark' | 'light') => void,
@@ -1241,6 +1344,10 @@ declare module 'electron' {
eventName: 'inverted-color-scheme-changed',
callback: (event: Event, invertedColorScheme: boolean) => void,
) => void) &
((
eventName: 'high-contrast-color-scheme-changed',
callback: (event: Event, highContrastColorScheme: boolean) => void,
) => void) &
((
eventName: 'appearance-changed',
callback: (newAppearance: 'dark' | 'light') => void,
@@ -1320,14 +1427,20 @@ declare module 'electron' {
shell: {
showItemInFolder: (fullPath: string) => boolean,
openItem: (fullPath: string) => boolean,
openExternalSync: (
url: string,
options?: ?{
activate?: ?boolean,
workingDirectory?: ?string,
},
) => boolean,
openExternal: (
url: string,
options?: ?{
activate?: ?boolean,
workingDirectory?: ?string,
},
callback?: ?Function,
) => boolean,
) => Promise<any>,
moveItemToTrash: (fullPath: string) => boolean,
beep: () => void,
writeShortcutLink: (
@@ -1352,22 +1465,10 @@ declare module 'electron' {
) => void,
setSpellCheckProvider: (
language: string,
autoCorrectWord: boolean,
provider: {
spellCheck: Function,
},
) => void,
registerURLSchemeAsBypassingCSP: (scheme: string) => void,
registerURLSchemeAsPrivileged: (
scheme: string,
options?: ?{
secure?: ?boolean,
bypassCSP?: ?boolean,
allowServiceWorkers?: ?boolean,
supportFetchAPI?: ?boolean,
corsEnabled?: ?boolean,
},
) => void,
insertText: (text: string) => void,
executeJavaScript: (
code: string,
@@ -1392,6 +1493,14 @@ declare module 'electron' {
worldId: number,
securityOrigin: string,
) => void,
setIsolatedWorldInfo: (
worldId: number,
info: {
securityOrigin?: ?string,
csp?: ?string,
name?: ?string,
},
) => void,
getResourceUsage: () => {
images: MemoryUsageDetails,
scripts: MemoryUsageDetails,
@@ -1457,11 +1566,23 @@ declare module 'electron' {
date: Date,
id: string,
};
declare type CustomScheme = {
scheme: string,
privileges?: ?{
standard?: ?boolean,
secure?: ?boolean,
bypassCSP?: ?boolean,
allowServiceWorkers?: ?boolean,
supportFetchAPI?: ?boolean,
corsEnabled?: ?boolean,
},
};
declare type DesktopCapturerSource = {
id: string,
name: string,
thumbnail: NativeImage,
display_id: string,
appIcon: NativeImage,
};
declare type Display = {
id: number,
@@ -1774,13 +1895,14 @@ declare module 'electron' {
callback: Function,
) => void;
capturePage: ((rect?: ?Rectangle, callback: Function) => void) &
((callback: Function) => void);
((callback: Function) => void) &
((rect?: ?Rectangle) => void);
send: (channel: string, ...args: Array<any>) => void;
sendInputEvent: (event: {}) => void;
setZoomFactor: (factor: number) => void;
setZoomLevel: (level: number) => void;
getZoomFactor: (callback: Function) => void;
getZoomLevel: (callback: Function) => void;
getZoomFactor: () => number;
getZoomLevel: () => number;
setVisualZoomLevelLimits: (
minimumLevel: number,
maximumLevel: number,
@@ -1868,7 +1990,6 @@ declare module 'electron' {
callback: (channel: string, args: Array<any>) => void,
) => void) &
((eventName: 'crashed', callback: () => void) => void) &
((eventName: 'gpu-crashed', callback: () => void) => void) &
((
eventName: 'plugin-crashed',
callback: (name: string, version: string) => void,
@@ -1964,7 +2085,6 @@ declare module 'electron' {
callback: (channel: string, args: Array<any>) => void,
) => void) &
((eventName: 'crashed', callback: () => void) => void) &
((eventName: 'gpu-crashed', callback: () => void) => void) &
((
eventName: 'plugin-crashed',
callback: (name: string, version: string) => void,
@@ -2069,6 +2189,7 @@ declare module 'electron' {
devTools?: ?boolean,
nodeIntegration?: ?boolean,
nodeIntegrationInWorker?: ?boolean,
nodeIntegrationInSubFrames?: ?boolean,
preload?: ?string,
sandbox?: ?boolean,
enableRemoteModule?: ?boolean,
@@ -2109,6 +2230,10 @@ declare module 'electron' {
safeDialogs?: ?boolean,
safeDialogsMessage?: ?string,
navigateOnDragDrop?: ?boolean,
autoplayPolicy?:
| ?'no-user-gesture-required'
| 'user-gesture-required'
| 'document-user-activation-required',
},
},
): BrowserWindow;
@@ -2212,7 +2337,8 @@ declare module 'electron' {
focusOnWebView: () => void;
blurWebView: () => void;
capturePage: ((rect?: ?Rectangle, callback: Function) => void) &
((callback: Function) => void);
((callback: Function) => void) &
((rect?: ?Rectangle) => void);
loadURL: (
url: string,
options?: ?{
@@ -2225,7 +2351,7 @@ declare module 'electron' {
| Array<UploadBlob>,
baseURLForDataURL?: ?string,
},
) => void;
) => Promise<any>;
loadFile: (
filePath: string,
options?: ?{
@@ -2233,9 +2359,10 @@ declare module 'electron' {
search?: ?string,
hash?: ?string,
},
) => void;
) => Promise<any>;
reload: () => void;
setMenu: (menu: Menu | null) => void;
removeMenu: () => void;
setProgressBar: (
progress: number,
options?: ?{
@@ -2306,11 +2433,14 @@ declare module 'electron' {
setTouchBar: (touchBar: TouchBar) => void;
setBrowserView: (browserView: BrowserView) => void;
getBrowserView: () => BrowserView | null;
addBrowserView: (browserView: BrowserView) => void;
removeBrowserView: (browserView: BrowserView) => void;
getBrowserViews: () => void;
webContents: WebContents;
id: number;
on: ((
eventName: 'page-title-updated',
callback: (event: Event, title: string) => void,
callback: (event: Event, title: string, explicitSet: boolean) => void,
) => void) &
((eventName: 'close', callback: (event: Event) => void) => void) &
((eventName: 'closed', callback: () => void) => void) &
@@ -2361,7 +2491,7 @@ declare module 'electron' {
((eventName: 'new-window-for-tab', callback: () => void) => void);
once: ((
eventName: 'page-title-updated',
callback: (event: Event, title: string) => void,
callback: (event: Event, title: string, explicitSet: boolean) => void,
) => void) &
((eventName: 'close', callback: (event: Event) => void) => void) &
((eventName: 'closed', callback: () => void) => void) &
@@ -2512,6 +2642,14 @@ declare module 'electron' {
) => void);
}
declare class Cookies {
get: (filter: {
url?: ?string,
name?: ?string,
domain?: ?string,
path?: ?string,
secure?: ?boolean,
session?: ?boolean,
}) => Promise<any>;
get: (
filter: {
url?: ?string,
@@ -2523,6 +2661,16 @@ declare module 'electron' {
},
callback: Function,
) => void;
set: (details: {
url: string,
name?: ?string,
value?: ?string,
domain?: ?string,
path?: ?string,
secure?: ?boolean,
httpOnly?: ?boolean,
expirationDate?: ?number,
}) => Promise<any>;
set: (
details: {
url: string,
@@ -2536,7 +2684,9 @@ declare module 'electron' {
},
callback: Function,
) => void;
remove: (url: string, name: string) => Promise<any>;
remove: (url: string, name: string, callback: Function) => void;
flushStore: () => Promise<any>;
flushStore: (callback: Function) => void;
on: (
eventName: 'changed',
@@ -2576,6 +2726,7 @@ declare module 'electron' {
commandParams?: ?{},
callback?: ?Function,
) => void;
sendCommand: (method: string, commandParams?: ?{}) => Promise<any>;
on: ((
eventName: 'detach',
callback: (event: Event, reason: string) => void,
@@ -2596,6 +2747,8 @@ declare module 'electron' {
declare class DownloadItem {
setSavePath: (path: string) => void;
getSavePath: () => string;
setSaveDialogOptions: (options: SaveDialogOptions) => void;
getSaveDialogOptions: () => SaveDialogOptions;
pause: () => void;
isPaused: () => boolean;
resume: () => void;
@@ -2658,7 +2811,7 @@ declare module 'electron' {
static getApplicationMenu: () => Menu | null;
static sendActionToFirstResponder: (action: string) => void;
static buildFromTemplate: (
template: Array<MenuItemConstructorOptions>,
template: Array<MenuItemConstructorOptions> | Array<MenuItem>,
) => Menu;
popup: (
options?: ?{
@@ -2694,7 +2847,38 @@ declare module 'electron' {
declare class MenuItem {
constructor(options: {
click?: ?Function,
role?: ?string,
role?:
| ?'undo'
| 'redo'
| 'cut'
| 'copy'
| 'paste'
| 'pasteandmatchstyle'
| 'delete'
| 'selectall'
| 'reload'
| 'forcereload'
| 'toggledevtools'
| 'resetzoom'
| 'zoomin'
| 'zoomout'
| 'togglefullscreen'
| 'window'
| 'minimize'
| 'close'
| 'help'
| 'about'
| 'services'
| 'hide'
| 'hideothers'
| 'unhide'
| 'quit'
| 'startspeaking'
| 'stopspeaking'
| 'close'
| 'minimize'
| 'zoom'
| 'front',
type?: ?'normal' | 'separator' | 'submenu' | 'checkbox' | 'radio',
label?: ?string,
sublabel?: ?string,
@@ -3021,7 +3205,7 @@ declare module 'electron' {
| Array<UploadBlob>,
baseURLForDataURL?: ?string,
},
) => void;
) => Promise<any>;
loadFile: (
filePath: string,
options?: ?{
@@ -3029,7 +3213,7 @@ declare module 'electron' {
search?: ?string,
hash?: ?string,
},
) => void;
) => Promise<any>;
downloadURL: (url: string) => void;
getURL: () => string;
getTitle: () => string;
@@ -3064,9 +3248,9 @@ declare module 'electron' {
isAudioMuted: () => boolean;
isCurrentlyAudible: () => boolean;
setZoomFactor: (factor: number) => void;
getZoomFactor: (callback: Function) => void;
getZoomFactor: () => number;
setZoomLevel: (level: number) => void;
getZoomLevel: (callback: Function) => void;
getZoomLevel: () => number;
setVisualZoomLevelLimits: (
minimumLevel: number,
maximumLevel: number,
@@ -3103,6 +3287,7 @@ declare module 'electron' {
) => void;
capturePage: ((rect?: ?Rectangle, callback: Function) => void) &
((callback: Function) => void);
capturePage: (rect?: ?Rectangle) => void;
hasServiceWorker: (callback: Function) => void;
unregisterServiceWorker: (callback: Function) => void;
getPrinters: () => Array<PrinterInfo>;
@@ -3131,6 +3316,7 @@ declare module 'electron' {
openDevTools: (
options?: ?{
mode: 'right' | 'bottom' | 'undocked' | 'detach',
activate?: ?boolean,
},
) => void;
closeDevTools: () => void;
@@ -3140,6 +3326,11 @@ declare module 'electron' {
inspectElement: (x: number, y: number) => void;
inspectServiceWorker: () => void;
send: (channel: string, ...args: Array<any>) => void;
sendToFrame: (
frameId: number,
channel: string,
...args: Array<any>
) => void;
enableDeviceEmulation: (parameters: {
screenPosition: 'desktop' | 'mobile',
screenSize: Size,
@@ -3235,6 +3426,10 @@ declare module 'electron' {
((eventName: 'did-start-loading', callback: () => void) => void) &
((eventName: 'did-stop-loading', callback: () => void) => void) &
((eventName: 'dom-ready', callback: (event: Event) => void) => void) &
((
eventName: 'page-title-updated',
callback: (event: Event, title: string, explicitSet: boolean) => void,
) => void) &
((
eventName: 'page-favicon-updated',
callback: (event: Event, favicons: Array<string>) => void,
@@ -3521,6 +3716,22 @@ declare module 'electron' {
sourceId: string,
) => void,
) => void) &
((
eventName: 'preload-error',
callback: (event: Event, preloadPath: string, error: Error) => void,
) => void) &
((
eventName: 'ipc-message',
callback: (event: Event, channel: string, ...args: Array<any>) => void,
) => void) &
((
eventName: 'ipc-message-sync',
callback: (event: Event, channel: string, ...args: Array<any>) => void,
) => void) &
((
eventName: 'desktop-capturer-get-sources',
callback: (event: Event) => void,
) => void) &
((
eventName: 'remote-require',
callback: (event: Event, moduleName: string) => void,
@@ -3570,6 +3781,10 @@ declare module 'electron' {
((eventName: 'did-start-loading', callback: () => void) => void) &
((eventName: 'did-stop-loading', callback: () => void) => void) &
((eventName: 'dom-ready', callback: (event: Event) => void) => void) &
((
eventName: 'page-title-updated',
callback: (event: Event, title: string, explicitSet: boolean) => void,
) => void) &
((
eventName: 'page-favicon-updated',
callback: (event: Event, favicons: Array<string>) => void,
@@ -3856,6 +4071,22 @@ declare module 'electron' {
sourceId: string,
) => void,
) => void) &
((
eventName: 'preload-error',
callback: (event: Event, preloadPath: string, error: Error) => void,
) => void) &
((
eventName: 'ipc-message',
callback: (event: Event, channel: string, ...args: Array<any>) => void,
) => void) &
((
eventName: 'ipc-message-sync',
callback: (event: Event, channel: string, ...args: Array<any>) => void,
) => void) &
((
eventName: 'desktop-capturer-get-sources',
callback: (event: Event) => void,
) => void) &
((
eventName: 'remote-require',
callback: (event: Event, moduleName: string) => void,
@@ -3886,58 +4117,58 @@ declare module 'electron' {
filter?: ?{
urls: Array<string>,
},
listener: Function,
listener: Function | null,
) => void) &
((listener: Function) => void);
((listener: Function | null) => void);
onBeforeSendHeaders: ((
filter?: ?{
urls: Array<string>,
},
listener: Function,
listener: Function | null,
) => void) &
((listener: Function) => void);
((listener: Function | null) => void);
onSendHeaders: ((
filter?: ?{
urls: Array<string>,
},
listener: Function,
listener: Function | null,
) => void) &
((listener: Function) => void);
((listener: Function | null) => void);
onHeadersReceived: ((
filter?: ?{
urls: Array<string>,
},
listener: Function,
listener: Function | null,
) => void) &
((listener: Function) => void);
((listener: Function | null) => void);
onResponseStarted: ((
filter?: ?{
urls: Array<string>,
},
listener: Function,
listener: Function | null,
) => void) &
((listener: Function) => void);
((listener: Function | null) => void);
onBeforeRedirect: ((
filter?: ?{
urls: Array<string>,
},
listener: Function,
listener: Function | null,
) => void) &
((listener: Function) => void);
((listener: Function | null) => void);
onCompleted: ((
filter?: ?{
urls: Array<string>,
},
listener: Function,
listener: Function | null,
) => void) &
((listener: Function) => void);
((listener: Function | null) => void);
onErrorOccurred: ((
filter?: ?{
urls: Array<string>,
},
listener: Function,
listener: Function | null,
) => void) &
((listener: Function) => void);
((listener: Function | null) => void);
}
declare class TouchBarButton {
constructor(options: {
@@ -4039,10 +4270,12 @@ declare module 'electron' {
size?: ?'small' | 'large' | 'flexible',
}): TouchBarSpacer;
}
declare type URL = any;
declare type Accelerator = any;
declare type WebFrame = any;
declare type ReadableStream = any;
declare type MenuItemConstructorOptions = any;
declare type SaveDialogOptions = any;
declare type Protocol = any;
declare type NetLog = any;
declare type TouchBarItem = any;