💄 bootstrap types

This commit is contained in:
Benjamin Pasero 2021-03-31 11:14:28 +02:00
parent 970f799890
commit 8a4d271f43
No known key found for this signature in database
GPG key ID: E6380CC4C8219E65
7 changed files with 20 additions and 9 deletions

View file

@ -32,8 +32,15 @@
/**
* @param {string[]} modulePaths
* @param {(result: unknown, configuration: object) => Promise<unknown> | undefined} resultCallback
* @param {{ forceEnableDeveloperKeybindings?: boolean, disallowReloadKeybinding?: boolean, removeDeveloperKeybindingsAfterLoad?: boolean, canModifyDOM?: (config: object) => void, beforeLoaderConfig?: (config: object, loaderConfig: object) => void, beforeRequire?: () => void }=} options
* @param {(result: unknown, configuration: import('./vs/base/parts/sandbox/common/sandboxTypes').ISandboxConfiguration) => Promise<unknown> | undefined} resultCallback
* @param {{
* forceEnableDeveloperKeybindings?: boolean,
* disallowReloadKeybinding?: boolean,
* removeDeveloperKeybindingsAfterLoad?: boolean,
* canModifyDOM?: (config: import('./vs/base/parts/sandbox/common/sandboxTypes').ISandboxConfiguration) => void,
* beforeLoaderConfig?: (config: import('./vs/base/parts/sandbox/common/sandboxTypes').ISandboxConfiguration, loaderConfig: object) => void,
* beforeRequire?: () => void
* }} options
*/
async function load(modulePaths, resultCallback, options) {
performance.mark('code/willWaitForWindowConfig');

View file

@ -27,7 +27,9 @@
}
/**
* @returns {{ load: (modules: string[], resultCallback: (result, configuration: object) => unknown, options?: object) => unknown }}
* @returns {{
* load: (modules: string[], resultCallback: (result, configuration: import('../../../base/parts/sandbox/common/sandboxTypes').ISandboxConfiguration) => unknown) => unknown
* }}
*/
function bootstrapWindowLib() {
// @ts-ignore (defined in bootstrap-window.js)

View file

@ -67,7 +67,6 @@
/**
* @returns {{
* load: (modules: string[], resultCallback: (result, configuration: import('../../../platform/windows/common/windows').INativeWindowConfiguration) => unknown, options: object) => unknown,
* globals: () => typeof import('../../../base/parts/sandbox/electron-sandbox/globals')
* }}
*/
function bootstrapWindowLib() {

View file

@ -15,7 +15,9 @@
}, { forceEnableDeveloperKeybindings: true, disallowReloadKeybinding: true });
/**
* @returns {{ load: (modules: string[], resultCallback: (result, configuration: object) => unknown, options?: object) => unknown }}
* @returns {{
* load: (modules: string[], resultCallback: (result, configuration: import('../../../base/parts/sandbox/common/sandboxTypes').ISandboxConfiguration) => unknown, options?: { forceEnableDeveloperKeybindings?: boolean, disallowReloadKeybinding?: boolean }) => unknown
* }}
*/
function bootstrapWindowLib() {
// @ts-ignore (defined in bootstrap-window.js)

View file

@ -11,11 +11,13 @@
// Load process explorer into window
bootstrapWindow.load(['vs/code/electron-sandbox/processExplorer/processExplorerMain'], function (processExplorer, configuration) {
processExplorer.startup(configuration.windowId, configuration.data);
processExplorer.startup(configuration);
}, { forceEnableDeveloperKeybindings: true });
/**
* @returns {{ load: (modules: string[], resultCallback: (result, configuration: object) => unknown, options?: object) => unknown }}
* @returns {{
* load: (modules: string[], resultCallback: (result, configuration: import('../../../base/parts/sandbox/common/sandboxTypes').ISandboxConfiguration) => unknown, options?: { forceEnableDeveloperKeybindings?: boolean }) => unknown
* }}
*/
function bootstrapWindowLib() {
// @ts-ignore (defined in bootstrap-window.js)

View file

@ -483,7 +483,7 @@ class ProcessExplorer {
}
}
export function startup(windowId: number, data: ProcessExplorerData): void {
export function startup({ windowId, data }: { windowId: number, data: ProcessExplorerData }): void {
const platformClass = data.platform === 'win32' ? 'windows' : data.platform === 'linux' ? 'linux' : 'mac';
document.body.classList.add(platformClass); // used by our fonts
applyZoom(data.zoomLevel);

View file

@ -67,7 +67,6 @@
/**
* @returns {{
* load: (modules: string[], resultCallback: (result, configuration: import('../../../platform/windows/common/windows').INativeWindowConfiguration) => unknown, options: object) => unknown,
* globals: () => typeof import('../../../base/parts/sandbox/electron-sandbox/globals')
* }}
*/
function bootstrapWindowLib() {