mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-22 17:48:56 +01:00
When the core references `vscode`, we only want to import the types and never generate a real import (which will fail to load). Use `import type` to better enforce this
25 lines
893 B
TypeScript
25 lines
893 B
TypeScript
/*---------------------------------------------------------------------------------------------
|
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
*--------------------------------------------------------------------------------------------*/
|
|
|
|
import { IMainContext, MainContext, MainThreadClipboardShape } from 'vs/workbench/api/common/extHost.protocol';
|
|
import type * as vscode from 'vscode';
|
|
|
|
export class ExtHostClipboard implements vscode.Clipboard {
|
|
|
|
private readonly _proxy: MainThreadClipboardShape;
|
|
|
|
constructor(mainContext: IMainContext) {
|
|
this._proxy = mainContext.getProxy(MainContext.MainThreadClipboard);
|
|
}
|
|
|
|
readText(): Promise<string> {
|
|
return this._proxy.$readText();
|
|
}
|
|
|
|
writeText(value: string): Promise<void> {
|
|
return this._proxy.$writeText(value);
|
|
}
|
|
}
|