2019-08-03 00:26:41 +00:00
|
|
|
import { ServiceCollection } from "vs/platform/instantiation/common/serviceCollection";
|
|
|
|
|
2019-07-31 17:32:04 +00:00
|
|
|
import { coderApi, vscodeApi } from "vs/server/src/api";
|
2019-08-03 00:26:41 +00:00
|
|
|
|
2019-07-31 17:32:04 +00:00
|
|
|
import "vs/css!./media/firefox";
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 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.
|
|
|
|
*/
|
2019-08-03 00:26:41 +00:00
|
|
|
export const initialize = async (services: ServiceCollection): Promise<void> => {
|
2019-07-31 17:32:04 +00:00
|
|
|
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);
|
|
|
|
};
|