mirror of
https://github.com/coder/code-server.git
synced 2026-05-07 21:07:26 +02:00
Clean up client API
- Don't use "any" for the API type. - Remove everything from the Coder API that can eventually be done through the VS Code API. - Move the event emission to our own client to minimize patching.
This commit is contained in:
@@ -1 +1,18 @@
|
||||
import 'vs/css!./media/firefox';
|
||||
import { coderApi, vscodeApi } from "vs/server/src/api";
|
||||
import "vs/css!./media/firefox";
|
||||
import { ServiceCollection } from "vs/platform/instantiation/common/serviceCollection";
|
||||
|
||||
/**
|
||||
* This is called by vs/workbench/browser/web.main.ts after the workbench has
|
||||
* been initialized so we can initialize our own client-side code.
|
||||
*/
|
||||
export const initialize = (services: ServiceCollection): void => {
|
||||
const target = window as any;
|
||||
target.ide = coderApi(services);
|
||||
target.vscode = vscodeApi(services);
|
||||
|
||||
const event = new CustomEvent('ide-ready');
|
||||
(event as any).ide = target.ide;
|
||||
(event as any).vscode = target.vscode;
|
||||
window.dispatchEvent(event);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user