Archived
1
0

Implement new structure

This commit is contained in:
Asher
2020-02-04 13:27:46 -06:00
parent ef8da3864f
commit b29346ecdf
94 changed files with 12427 additions and 4936 deletions

View File

@ -1 +0,0 @@
httpolyglot.d.ts

52
typings/api.d.ts vendored
View File

@ -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;
}
}

View File

@ -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
View 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
}

View File

@ -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"
}
}