Files
code-server/lib/vscode/src/vs/platform/native/electron-sandbox/nativeHostService.ts
2021-03-11 10:27:10 -07:00

30 lines
1.1 KiB
TypeScript

/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { INativeHostService } from 'vs/platform/native/electron-sandbox/native';
import { IMainProcessService } from 'vs/platform/ipc/electron-sandbox/services';
import { ProxyChannel } from 'vs/base/parts/ipc/common/ipc';
// @ts-ignore: interface is implemented via proxy
export class NativeHostService implements INativeHostService {
declare readonly _serviceBrand: undefined;
constructor(
readonly windowId: number,
@IMainProcessService mainProcessService: IMainProcessService
) {
return ProxyChannel.toService<INativeHostService>(mainProcessService.getChannel('nativeHost'), {
context: windowId,
properties: (() => {
const properties = new Map<string, unknown>();
properties.set('windowId', windowId);
return properties;
})()
});
}
}