/*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ import { MessageBoxOptions, MessageBoxReturnValue, OpenDevToolsOptions, SaveDialogOptions, OpenDialogOptions, OpenDialogReturnValue, SaveDialogReturnValue, CrashReporterStartOptions } from 'electron'; import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; import { INativeOpenDialogOptions } from 'vs/platform/windows/common/windows'; import { ISerializableCommandAction } from 'vs/platform/actions/common/actions'; export const IElectronService = createDecorator('electronService'); export interface IElectronService { _serviceBrand: undefined; // Window windowCount(): Promise; openEmptyWindow(options?: { reuse?: boolean, remoteAuthority?: string }): Promise; toggleFullScreen(): Promise; handleTitleDoubleClick(): Promise; isMaximized(): Promise; maximizeWindow(): Promise; unmaximizeWindow(): Promise; minimizeWindow(): Promise; // Dialogs showMessageBox(options: MessageBoxOptions): Promise; showSaveDialog(options: SaveDialogOptions): Promise; showOpenDialog(options: OpenDialogOptions): Promise; pickFileFolderAndOpen(options: INativeOpenDialogOptions): Promise; pickFileAndOpen(options: INativeOpenDialogOptions): Promise; pickFolderAndOpen(options: INativeOpenDialogOptions): Promise; pickWorkspaceAndOpen(options: INativeOpenDialogOptions): Promise; // OS showItemInFolder(path: string): Promise; setRepresentedFilename(path: string): Promise; setDocumentEdited(edited: boolean): Promise; openExternal(url: string): Promise; updateTouchBar(items: ISerializableCommandAction[][]): Promise; // macOS Touchbar newWindowTab(): Promise; showPreviousWindowTab(): Promise; showNextWindowTab(): Promise; moveWindowTabToNewWindow(): Promise; mergeAllWindowTabs(): Promise; toggleWindowTabsBar(): Promise; // Lifecycle relaunch(options?: { addArgs?: string[], removeArgs?: string[] }): Promise; reload(): Promise; closeWorkpsace(): Promise; closeWindow(): Promise; quit(): Promise; // Development openDevTools(options?: OpenDevToolsOptions): Promise; toggleDevTools(): Promise; startCrashReporter(options: CrashReporterStartOptions): Promise; // Connectivity resolveProxy(url: string): Promise; }