Implement new structure
This commit is contained in:
@ -1 +0,0 @@
|
||||
httpolyglot.d.ts
|
52
typings/api.d.ts
vendored
52
typings/api.d.ts
vendored
@ -1,52 +0,0 @@
|
||||
import * as vscode from "vscode";
|
||||
|
||||
// Only export the subset of VS Code we have implemented.
|
||||
export interface VSCodeApi {
|
||||
EventEmitter: typeof vscode.EventEmitter;
|
||||
FileSystemError: typeof vscode.FileSystemError;
|
||||
FileType: typeof vscode.FileType;
|
||||
StatusBarAlignment: typeof vscode.StatusBarAlignment;
|
||||
ThemeColor: typeof vscode.ThemeColor;
|
||||
TreeItemCollapsibleState: typeof vscode.TreeItemCollapsibleState;
|
||||
Uri: typeof vscode.Uri;
|
||||
commands: {
|
||||
executeCommand: typeof vscode.commands.executeCommand;
|
||||
registerCommand: typeof vscode.commands.registerCommand;
|
||||
};
|
||||
window: {
|
||||
createStatusBarItem: typeof vscode.window.createStatusBarItem;
|
||||
registerTreeDataProvider: typeof vscode.window.registerTreeDataProvider;
|
||||
showErrorMessage: typeof vscode.window.showErrorMessage;
|
||||
};
|
||||
workspace: {
|
||||
registerFileSystemProvider: typeof vscode.workspace.registerFileSystemProvider;
|
||||
};
|
||||
}
|
||||
|
||||
export interface CoderApi {
|
||||
registerView: (viewId: string, viewName: string, containerId: string, containerName: string, icon: string) => void;
|
||||
}
|
||||
|
||||
export interface IdeReadyEvent extends CustomEvent<void> {
|
||||
readonly vscode: VSCodeApi;
|
||||
readonly ide: CoderApi;
|
||||
}
|
||||
|
||||
declare global {
|
||||
interface Window {
|
||||
/**
|
||||
* Full VS Code extension API.
|
||||
*/
|
||||
vscode?: VSCodeApi;
|
||||
|
||||
/**
|
||||
* Coder API.
|
||||
*/
|
||||
ide?: CoderApi;
|
||||
|
||||
/**
|
||||
* Listen for when the IDE API has been set and is ready to use.
|
||||
*/
|
||||
addEventListener(event: "ide-ready", callback: (event: IdeReadyEvent) => void): void;
|
||||
}
|
||||
}
|
7
typings/httpolyglot.d.ts
vendored
7
typings/httpolyglot.d.ts
vendored
@ -1,7 +0,0 @@
|
||||
declare module "httpolyglot" {
|
||||
import * as http from "http";
|
||||
import * as https from "https";
|
||||
|
||||
function createServer(requestListener?: (req: http.IncomingMessage, res: http.ServerResponse) => void): http.Server;
|
||||
function createServer(options: https.ServerOptions, requestListener?: (req: http.IncomingMessage, res: http.ServerResponse) => void): https.Server;
|
||||
}
|
10
typings/httpolyglot/index.d.ts
vendored
Normal file
10
typings/httpolyglot/index.d.ts
vendored
Normal file
@ -0,0 +1,10 @@
|
||||
declare module "httpolyglot" {
|
||||
import * as http from "http"
|
||||
import * as https from "https"
|
||||
|
||||
function createServer(requestListener?: (req: http.IncomingMessage, res: http.ServerResponse) => void): http.Server
|
||||
function createServer(
|
||||
options: https.ServerOptions,
|
||||
requestListener?: (req: http.IncomingMessage, res: http.ServerResponse) => void
|
||||
): https.Server
|
||||
}
|
@ -1,11 +0,0 @@
|
||||
{
|
||||
"name": "@coder/ide-api",
|
||||
"version": "2.0.3",
|
||||
"typings": "api.d.ts",
|
||||
"license": "MIT",
|
||||
"author": "Coder",
|
||||
"description": "API for interfacing with the API created for content-scripts.",
|
||||
"dependencies": {
|
||||
"@types/vscode": "^1.37.0"
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user