Archived
1
0

Add package.json for publishing API types

This commit is contained in:
Asher
2019-09-03 17:55:58 -05:00
parent da7d8b04a8
commit a26844ea45
5 changed files with 84 additions and 50 deletions

1
typings/.npmignore Normal file
View File

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

35
typings/api.d.ts vendored
View File

@ -1,10 +1,35 @@
import * as vscode from "vscode";
export { 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: typeof vscode;
readonly ide: typeof coder;
readonly vscode: VSCodeApi;
readonly ide: CoderApi;
}
declare global {
@ -12,12 +37,12 @@ declare global {
/**
* Full VS Code extension API.
*/
vscode?: typeof vscode;
vscode?: VSCodeApi;
/**
* Coder API.
*/
ide?: typeof coder;
ide?: CoderApi;
/**
* Listen for when the IDE API has been set and is ready to use.

3
typings/coder.d.ts vendored
View File

@ -1,3 +0,0 @@
declare namespace coder {
export const registerView: (viewId: string, viewName: string, containerId: string, containerName: string, icon: string) => void;
}

11
typings/package.json Normal file
View File

@ -0,0 +1,11 @@
{
"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"
}
}