Files
vscode/src/vs/workbench/api/browser/mainThreadClipboard.ts
SteVen Batten 305d5be119 implement browser clipboard service (#75293)
* implement browser clipboard service

* actually register the clipboard service

* update all refs to newly async funcs

* addressing comments

* small fixes

* all asyncs as a result of readText

* fix unit test

* cleanup for writeText refs

* cleanup and reduce diff noise

* qfix

* address feedback
2019-07-11 09:49:28 +02:00

30 lines
1.0 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 { extHostNamedCustomer } from 'vs/workbench/api/common/extHostCustomers';
import { MainContext, MainThreadClipboardShape } from '../common/extHost.protocol';
import { IClipboardService } from 'vs/platform/clipboard/common/clipboardService';
@extHostNamedCustomer(MainContext.MainThreadClipboard)
export class MainThreadClipboard implements MainThreadClipboardShape {
constructor(
_context: any,
@IClipboardService private readonly _clipboardService: IClipboardService,
) { }
dispose(): void {
// nothing
}
$readText(): Promise<string> {
return this._clipboardService.readText();
}
$writeText(value: string): Promise<void> {
return this._clipboardService.writeText(value);
}
}