mirror of
https://github.com/coder/code-server.git
synced 2025-07-29 13:02:10 +08:00
Expose API on the client
This commit is contained in:
27
typings/api.d.ts
vendored
Normal file
27
typings/api.d.ts
vendored
Normal file
@ -0,0 +1,27 @@
|
||||
import * as vscode from "vscode";
|
||||
|
||||
export { vscode };
|
||||
|
||||
export interface IdeReadyEvent extends CustomEvent<void> {
|
||||
readonly vscode: typeof vscode;
|
||||
readonly ide: typeof coder;
|
||||
}
|
||||
|
||||
declare global {
|
||||
interface Window {
|
||||
/**
|
||||
* Full VS Code extension API.
|
||||
*/
|
||||
vscode?: typeof vscode;
|
||||
|
||||
/**
|
||||
* Coder API.
|
||||
*/
|
||||
ide?: typeof coder;
|
||||
|
||||
/**
|
||||
* Listen for when the IDE API has been set and is ready to use.
|
||||
*/
|
||||
addEventListener(event: "ide-ready", callback: (event: IdeReadyEvent) => void): void;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user