VSCode Sync API Client

This npm module implements a client that allows accessing VS Code API in sync from from a worker different than the extension host worker. The actually implementation
depends on @vscode/syc-api-common
.
Example
Extension host worker that offers access to VS Code extension host API. The setup in the extension host code looks like this:
import { ServiceConnection } from '@vscode/sync-api-common/node';
import { APIRequests, ApiService } from '@vscode/sync-api-service';
const worker = new Worker(...);
const connection = new ServiceConnection<APIRequests>(worker);
const apiService = new ApiService('Worker Name', connection);
const terminal = window.createTerminal({ name: 'Worker name', pty: apiService.getPty() });
terminal.show();
connection.signalReady();
The worker side looks as follows:
import { ClientConnection } from '@vscode/sync-api-common/node';
import { ApiClient, APIRequests } from '@vscode/sync-api-client';
const connection = new ClientConnection<APIRequests>(parentPort);
await connection.serviceReady();
const apiClient = new ApiClient(connection);
const workspaceFolders = apiClient.vscode.workspace.workspaceFolders;
const content = apiClient.vscode.workspace.filesystem.readFile(uri);
For code executed in the browser exchange the import @vscode/sync-api-common/node
with @vscode/sync-api-common/browser
.