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,9 +5,6 @@
* @format * @format
*/ */
type Electron$BrowserWindow = any;
type Electron$NativeImage = any;
type Electron$MenuRoles = type Electron$MenuRoles =
| 'undo' | 'undo'
| 'redo' | 'redo'
@@ -38,7 +35,7 @@ type Electron$MenuType =
| 'checkbox' | 'checkbox'
| 'radio'; | 'radio';
type Electron$MenuItemOptions = { type MenuItemConstructorOptions = {|
click?: ( click?: (
menuItem: Electron$MenuItem, menuItem: Electron$MenuItem,
browserWindow: Object, browserWindow: Object,
@@ -53,33 +50,14 @@ type Electron$MenuItemOptions = {
enabled?: boolean, enabled?: boolean,
visible?: boolean, visible?: boolean,
checked?: boolean, checked?: boolean,
submenu?: Electron$Menu | Array<Electron$MenuItemOptions>, submenu?: Array<MenuItemConstructorOptions>,
id?: string, id?: string,
position?: string, position?: string,
}; |};
declare class Electron$MenuItem { declare class Electron$MenuItem {
constructor(options: Electron$MenuItemOptions): Electron$MenuItem; constructor(options: MenuItemConstructorOptions): Electron$MenuItem;
enabled: boolean; enabled: boolean;
visible: boolean; visible: boolean;
checked: boolean; checked: boolean;
} }
declare class Electron$Menu {
static setApplicationMenu: (menu: Electron$Menu) => void;
static getApplicationMenu: () => ?Electron$Menu;
static sendActionToFirstResponder: (action: string) => void;
static buildFromTemplate: (
templates: Array<Electron$MenuItemOptions>,
) => Electron$Menu;
popup: (
browserWindow: Object,
x?: number,
y?: number,
positioningItem?: number,
) => void;
popup: (x?: number, y?: number, positioningItem?: number) => void;
append: (menuItem: Electron$MenuItem) => void;
insert: (pos: number, menuItem: Electron$MenuItem) => void;
items: Array<Electron$MenuItem>;
}

View File

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

View File

@@ -36,7 +36,7 @@
] ]
}, },
"resolutions": { "resolutions": {
"@jest-runner/electron/electron": "4.0.8" "@jest-runner/electron/electron": "5.0.2"
}, },
"jest": { "jest": {
"transform": { "transform": {
@@ -50,9 +50,9 @@
} }
}, },
"devDependencies": { "devDependencies": {
"@jest-runner/electron": "^1.1.1", "@jest-runner/electron": "^2.0.1",
"babel-eslint": "^10.0.1", "babel-eslint": "^10.0.1",
"electron": "^4.0.8", "electron": "^5.0.2",
"electron-builder": "^20.38.5", "electron-builder": "^20.38.5",
"eslint": "^5.12.1", "eslint": "^5.12.1",
"eslint-config-fbjs": "^2.0.1", "eslint-config-fbjs": "^2.0.1",

View File

@@ -127,7 +127,7 @@ export function setupMenuBar(
} }
function appendMenuItem( function appendMenuItem(
template: Array<MenuItem>, template: Array<MenuItemConstructorOptions>,
actionHandler: (action: string) => void, actionHandler: (action: string) => void,
item: ?KeyboardAction, item: ?KeyboardAction,
) { ) {
@@ -185,7 +185,7 @@ function getTemplate(
app: Object, app: Object,
shell: Object, shell: Object,
store: Store, store: Store,
): Array<MenuItem> { ): Array<MenuItemConstructorOptions> {
const exportSubmenu = [ const exportSubmenu = [
{ {
label: 'File...', label: 'File...',

View File

@@ -62,7 +62,7 @@ exports[`Empty app state matches snapshot 1`] = `
className="css-1swhxtd" className="css-1swhxtd"
onClick={[Function]} onClick={[Function]}
> >
4.0.8-dev 5.0.2-dev
</span> </span>
<div <div
className="css-1cecbfb" className="css-1cecbfb"

View File

@@ -57,7 +57,7 @@ class UserAccount extends PureComponent<UserAccountProps> {
}; };
showDetails = () => { showDetails = () => {
const menuTemplate = [ const menuTemplate: Array<MenuItemConstructorOptions> = [
{ {
label: 'Sign Out', label: 'Sign Out',
click: this.props.logout, click: this.props.logout,

View File

@@ -190,7 +190,7 @@ type Props = {
/** /**
* Dropdown menu template shown on click. * Dropdown menu template shown on click.
*/ */
dropdown?: Array<Electron$MenuItemOptions>, dropdown?: Array<MenuItemConstructorOptions>,
/** /**
* Name of the icon dispalyed next to the text * Name of the icon dispalyed next to the text
*/ */

View File

@@ -9,7 +9,7 @@ import * as React from 'react';
import FlexColumn from './FlexColumn.js'; import FlexColumn from './FlexColumn.js';
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';
export type MenuTemplate = Array<Electron$MenuItemOptions>; export type MenuTemplate = Array<MenuItemConstructorOptions>;
type Props = { type Props = {
/** List of items in the context menu. Used for static menus. */ /** List of items in the context menu. Used for static menus. */

View File

@@ -11,7 +11,7 @@ import electron from 'electron';
const PropTypes = require('prop-types'); const PropTypes = require('prop-types');
type MenuTemplate = Array<Electron$MenuItemOptions>; type MenuTemplate = Array<MenuItemConstructorOptions>;
const Container = styled('div')({ const Container = styled('div')({
display: 'contents', display: 'contents',

View File

@@ -178,17 +178,17 @@ const defaultValueExtractor: DataValueExtractor = (value: any) => {
const rootContextMenuCache: WeakMap< const rootContextMenuCache: WeakMap<
Object, Object,
Array<Electron$MenuItemOptions>, Array<MenuItemConstructorOptions>,
> = new WeakMap(); > = new WeakMap();
function getRootContextMenu(data: Object): Array<Electron$MenuItemOptions> { function getRootContextMenu(data: Object): Array<MenuItemConstructorOptions> {
const cached = rootContextMenuCache.get(data); const cached = rootContextMenuCache.get(data);
if (cached != null) { if (cached != null) {
return cached; return cached;
} }
const stringValue = JSON.stringify(data, null, 2); const stringValue = JSON.stringify(data, null, 2);
const menu: Array<Electron$MenuItemOptions> = [ const menu: Array<MenuItemConstructorOptions> = [
{ {
label: 'Copy entire tree', label: 'Copy entire tree',
click: () => clipboard.writeText(stringValue), click: () => clipboard.writeText(stringValue),

View File

@@ -221,7 +221,7 @@ class ElementsRow extends PureComponent<ElementsRowProps, ElementsRowState> {
interaction: (name: string, data: any) => void; interaction: (name: string, data: any) => void;
getContextMenu = (): Array<Electron$MenuItemOptions> => { getContextMenu = (): Array<MenuItemConstructorOptions> => {
const {props} = this; const {props} = this;
const items = [ const items = [
{ {

View File

@@ -105,7 +105,7 @@ export default class FilterToken extends PureComponent<Props> {
}; };
showDetails = () => { showDetails = () => {
const menuTemplate = []; const menuTemplate: Array<MenuItemConstructorOptions> = [];
if (this.props.filter.type === 'enum') { if (this.props.filter.type === 'enum') {
menuTemplate.push( menuTemplate.push(

View File

@@ -469,7 +469,7 @@ class ManagedTable extends React.Component<
clipboard.writeText(cellText); clipboard.writeText(cellText);
}; };
buildContextMenuItems: () => Array<Electron$MenuItemOptions> = () => { buildContextMenuItems: () => Array<MenuItemConstructorOptions> = () => {
const {highlightedRows} = this.state; const {highlightedRows} = this.state;
if (highlightedRows.size === 0) { if (highlightedRows.size === 0) {
return []; return [];

View File

@@ -25,7 +25,7 @@ import FlexRow from '../FlexRow.js';
const invariant = require('invariant'); const invariant = require('invariant');
type MenuTemplate = Array<Electron$MenuItemOptions>; type MenuTemplate = Array<MenuItemConstructorOptions>;
const TableHeaderArrow = styled('span')({ const TableHeaderArrow = styled('span')({
float: 'right', float: 'right',

View File

@@ -251,6 +251,7 @@ function tryCreateWindow() {
webSecurity: false, webSecurity: false,
scrollBounce: true, scrollBounce: true,
experimentalFeatures: true, experimentalFeatures: true,
nodeIntegration: true,
}, },
}); });
win.once('ready-to-show', () => win.show()); win.once('ready-to-show', () => win.show());

View File

@@ -900,38 +900,39 @@
version "0.8.1" version "0.8.1"
resolved "https://registry.yarnpkg.com/@emotion/utils/-/utils-0.8.1.tgz#f3a81587ad8d0ef33cdad6f3b4310774fcc1053e" resolved "https://registry.yarnpkg.com/@emotion/utils/-/utils-0.8.1.tgz#f3a81587ad8d0ef33cdad6f3b4310774fcc1053e"
"@jest-runner/core@^1.0.2": "@jest-runner/core@^2.0.0":
version "1.0.2" version "2.0.0"
resolved "https://registry.yarnpkg.com/@jest-runner/core/-/core-1.0.2.tgz#0e21d082c4b3489c8e632a4a722168826fae40b0" resolved "https://registry.yarnpkg.com/@jest-runner/core/-/core-2.0.0.tgz#444d0351d0872c0981ee4e87252ccb408cf27543"
integrity sha512-LR4XiSFawSWO9qyx4/J7D09XTy0PKDvSf3maXXXkxlPavcjUOnsmL5ReI86LJ4YyxJCFSKpQj3eriZSGqrjcng== integrity sha512-EEc+W5t1hj0uNga8aoEkrBhLnrXS7JBxTabkTz+29VrUxBjCfgKSas+lLaqS+bnqIknRHoKrhZ3N6PIXungDdw==
dependencies: dependencies:
jest-message-util "^24.0.0" jest-message-util "^24.0.0"
node-ipc "^9.1.1" node-ipc "^9.1.1"
"@jest-runner/electron@^1.1.1": "@jest-runner/electron@^2.0.1":
version "1.1.1" version "2.0.1"
resolved "https://registry.yarnpkg.com/@jest-runner/electron/-/electron-1.1.1.tgz#01b7b15435306da0aee235763bae584d532dea86" resolved "https://registry.yarnpkg.com/@jest-runner/electron/-/electron-2.0.1.tgz#083003afccfe066ceefe37007081951c4ea60509"
integrity sha512-+yfDVoOzuuhubSG9oRENrv0muPuqQvVz8bIqb/tW/omSwi5WGZY5zENFr27043nnTx7cNxTWu/6soAHZM/ELIg== integrity sha512-py1YWlRnvMTJXjdJQP2uWD4/MWDVyl7UkXTQ3LnAjamlS2ct+9R4tUBME3ZG3caW2jjNn7zsjYoqCb+nSNhd+A==
dependencies: dependencies:
"@jest-runner/core" "^1.0.2" "@jest-runner/core" "^2.0.0"
"@jest-runner/rpc" "^1.1.0" "@jest-runner/rpc" "^2.0.0"
electron "^2.0.8"
jest-haste-map "^24.0.0" jest-haste-map "^24.0.0"
jest-mock "^24.0.0" jest-mock "^24.0.0"
jest-runner "^24.0.0" jest-runner "^24.0.0"
jest-runtime "^24.0.0" jest-runtime "^24.0.0"
jest-util "^24.0.0" jest-util "^24.0.0"
throat "^4.1.0"
"@jest-runner/rpc@^1.1.0": "@jest-runner/rpc@^2.0.0":
version "1.1.0" version "2.0.0"
resolved "https://registry.yarnpkg.com/@jest-runner/rpc/-/rpc-1.1.0.tgz#fa998ec51779d9cf17ebc49800fd68faa08a3b90" resolved "https://registry.yarnpkg.com/@jest-runner/rpc/-/rpc-2.0.0.tgz#aebbd8a1fae96b37acfb28da8ce9b1ab9a90dfc0"
integrity sha512-u7ZCQ1MpTPPCy12xQXm9K1LNZbUHWsttm7JPLuH+SP5JgU+5+WykCOBIKJ33giITHNj8tib/DGxiXWWkVo7VYw== integrity sha512-EP1ljCKb0Z3hWlDgFv5MW0PTogs5MOh8EFb5lsS/UP72R6fM4cYlE3GT3xYaGjZS8vawCgSqF475TRK8noDAFA==
dependencies: dependencies:
"@jest-runner/core" "^1.0.2" "@jest-runner/core" "^2.0.0"
glob "^7.1.3" glob "^7.1.3"
jscodeshift "^0.6.3" jscodeshift "^0.6.3"
node-ipc "^9.1.1" node-ipc "^9.1.1"
prettier "^1.14.2" prettier "^1.14.2"
uuid "^3.3.2"
yargs "^12.0.1" yargs "^12.0.1"
"@jest/console@^24.7.1": "@jest/console@^24.7.1":
@@ -2740,10 +2741,10 @@ electron-to-chromium@^1.3.122:
resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.124.tgz#861fc0148748a11b3e5ccebdf8b795ff513fa11f" resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.124.tgz#861fc0148748a11b3e5ccebdf8b795ff513fa11f"
integrity sha512-glecGr/kFdfeXUHOHAWvGcXrxNU+1wSO/t5B23tT1dtlvYB26GY8aHzZSWD7HqhqC800Lr+w/hQul6C5AF542w== integrity sha512-glecGr/kFdfeXUHOHAWvGcXrxNU+1wSO/t5B23tT1dtlvYB26GY8aHzZSWD7HqhqC800Lr+w/hQul6C5AF542w==
electron@4.0.8, electron@^2.0.8, electron@^4.0.8: electron@5.0.2, electron@^5.0.2:
version "4.0.8" version "5.0.2"
resolved "https://registry.yarnpkg.com/electron/-/electron-4.0.8.tgz#b7998b16543d2094f081757a0c5afdb8875ea510" resolved "https://registry.yarnpkg.com/electron/-/electron-5.0.2.tgz#0f6b38ae7e344b94f433d9171e50568f56962fc7"
integrity sha512-FOBJIHkuv8wc15N+ZyqwDzPavYVu5CHMBEf14jHDWv7QW2vkEIpJjVK+PIT31kfZfvjsIP0j2wvA/FBsiqB7pw== integrity sha512-bUHKQhyuOen/q8iHTkrnzqB9CAwBDI+vHbeu21kpq2bqAD+t25yfrmUEcYHaPL4fZOAhk6nnRqskF6/Xd+aZxg==
dependencies: dependencies:
"@types/node" "^10.12.18" "@types/node" "^10.12.18"
electron-download "^4.1.0" electron-download "^4.1.0"
@@ -7632,7 +7633,7 @@ text-table@^0.2.0:
resolved "https://registry.yarnpkg.com/text-table/-/text-table-0.2.0.tgz#7f5ee823ae805207c00af2df4a84ec3fcfa570b4" resolved "https://registry.yarnpkg.com/text-table/-/text-table-0.2.0.tgz#7f5ee823ae805207c00af2df4a84ec3fcfa570b4"
integrity sha1-f17oI66AUgfACvLfSoTsP8+lcLQ= integrity sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=
throat@^4.0.0: throat@^4.0.0, throat@^4.1.0:
version "4.1.0" version "4.1.0"
resolved "https://registry.yarnpkg.com/throat/-/throat-4.1.0.tgz#89037cbc92c56ab18926e6ba4cbb200e15672a6a" resolved "https://registry.yarnpkg.com/throat/-/throat-4.1.0.tgz#89037cbc92c56ab18926e6ba4cbb200e15672a6a"
integrity sha1-iQN8vJLFarGJJua6TLsgDhVnKmo= integrity sha1-iQN8vJLFarGJJua6TLsgDhVnKmo=