From 99b13b8fbfea262f03d4ec818c857003b463c7b2 Mon Sep 17 00:00:00 2001 From: Benjamin Pasero Date: Thu, 17 Sep 2020 12:45:22 +0200 Subject: [PATCH] sandbox - update electron types --- .../base/parts/sandbox/common/electronTypes.ts | 16 ++++++++++------ .../parts/sandbox/electron-browser/preload.js | 1 + 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/src/vs/base/parts/sandbox/common/electronTypes.ts b/src/vs/base/parts/sandbox/common/electronTypes.ts index bfd996a31da..e67112f5122 100644 --- a/src/vs/base/parts/sandbox/common/electronTypes.ts +++ b/src/vs/base/parts/sandbox/common/electronTypes.ts @@ -7,7 +7,7 @@ // ####################################################################### // ### ### // ### electron.d.ts types we need in a common layer for reuse ### -// ### (copied from Electron 7.x) ### +// ### (copied from Electron 9.x) ### // ### ### // ####################################################################### @@ -132,6 +132,7 @@ export interface SaveDialogOptions { * @platform darwin */ showsTagField?: boolean; + properties?: Array<'showHiddenFiles' | 'createDirectory' | 'treatPackageAsDirectory' | 'showOverwriteConfirmation' | 'dontAddToRecent'>; /** * Create a security scoped bookmark when packaged for the Mac App Store. If this * option is enabled and the file doesn't already exist a blank file will be @@ -155,7 +156,7 @@ export interface OpenDialogOptions { * Contains which features the dialog should use. The following values are * supported: */ - properties?: Array<'openFile' | 'openDirectory' | 'multiSelections' | 'showHiddenFiles' | 'createDirectory' | 'promptToCreate' | 'noResolveAliases' | 'treatPackageAsDirectory'>; + properties?: Array<'openFile' | 'openDirectory' | 'multiSelections' | 'showHiddenFiles' | 'createDirectory' | 'promptToCreate' | 'noResolveAliases' | 'treatPackageAsDirectory' | 'dontAddToRecent'>; /** * Message to display above input boxes. * @@ -222,11 +223,11 @@ export interface InputEvent { // Docs: http://electronjs.org/docs/api/structures/input-event /** - * An array of modifiers of the event, can be `shift`, `control`, `alt`, `meta`, - * `isKeypad`, `isAutoRepeat`, `leftButtonDown`, `middleButtonDown`, - * `rightButtonDown`, `capsLock`, `numLock`, `left`, `right`. + * An array of modifiers of the event, can be `shift`, `control`, `ctrl`, `alt`, + * `meta`, `command`, `cmd`, `isKeypad`, `isAutoRepeat`, `leftButtonDown`, + * `middleButtonDown`, `rightButtonDown`, `capsLock`, `numLock`, `left`, `right`. */ - modifiers: Array<'shift' | 'control' | 'alt' | 'meta' | 'isKeypad' | 'isAutoRepeat' | 'leftButtonDown' | 'middleButtonDown' | 'rightButtonDown' | 'capsLock' | 'numLock' | 'left' | 'right'>; + modifiers?: Array<'shift' | 'control' | 'ctrl' | 'alt' | 'meta' | 'command' | 'cmd' | 'isKeypad' | 'isAutoRepeat' | 'leftButtonDown' | 'middleButtonDown' | 'rightButtonDown' | 'capsLock' | 'numLock' | 'left' | 'right'>; } export interface MouseInputEvent extends InputEvent { @@ -311,6 +312,9 @@ export interface CrashReporterStartOptions { } export interface ProcessMemoryInfo { + + // Docs: http://electronjs.org/docs/api/structures/process-memory-info + /** * The amount of memory not shared by other processes, such as JS heap or HTML * content in Kilobytes. diff --git a/src/vs/base/parts/sandbox/electron-browser/preload.js b/src/vs/base/parts/sandbox/electron-browser/preload.js index 9be3747b0a8..d0cb6d4286b 100644 --- a/src/vs/base/parts/sandbox/electron-browser/preload.js +++ b/src/vs/base/parts/sandbox/electron-browser/preload.js @@ -12,6 +12,7 @@ // ####################################################################### // ### ### // ### !!! DO NOT USE GET/SET PROPERTIES ANYWHERE HERE !!! ### + // ### !!! UNLESS THE ACCESS IS WITHOUT SIDE EFFECTS !!! ### // ### (https://github.com/electron/electron/issues/25516) ### // ### ### // ####################################################################### -- GitLab