Welcome to mirror list, hosted at ThFree Co, Russian Federation.

driver.ts « electron-sandbox « driver « platform « vs « src - github.com/microsoft/vscode.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: fb9b9a596ff84056ecb60e0ede1ec8858370f414 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
/*---------------------------------------------------------------------------------------------
 *  Copyright (c) Microsoft Corporation. All rights reserved.
 *  Licensed under the MIT License. See License.txt in the project root for license information.
 *--------------------------------------------------------------------------------------------*/

import { BrowserWindowDriver } from 'vs/platform/driver/browser/driver';

interface INativeWindowDriverHelper {
	exitApplication(): Promise<void>;
}

class NativeWindowDriver extends BrowserWindowDriver {

	constructor(private readonly helper: INativeWindowDriverHelper) {
		super();
	}

	override exitApplication(): Promise<void> {
		return this.helper.exitApplication();
	}
}

export function registerWindowDriver(helper: INativeWindowDriverHelper): void {
	Object.assign(window, { driver: new NativeWindowDriver(helper) });
}