Clean up typings

This commit is contained in:
Jason Poon 2016-10-02 01:34:11 -07:00
parent 418b500fdc
commit eeb9d6fdb3
14 changed files with 11 additions and 18493 deletions

2
.gitignore vendored
View File

@ -6,5 +6,5 @@ node_modules
.DS_Store
*.vsix
*.log
typings
testing
test2

View File

@ -186,9 +186,9 @@ export async function activate(context: vscode.ExtensionContext) {
showCmdLine("", modeHandlerToEditorIdentity[new EditorIdentity(vscode.window.activeTextEditor).toString()]);
});
for (let { key } of packagejson.contributes.keybindings) {
let bracketedKey = AngleBracketNotation.Normalize(key);
registerCommand(context, `extension.vim_${ key.toLowerCase() }`, () => handleKeyEvent(`${ bracketedKey }`));
for (let keybinding of packagejson.contributes.keybindings) {
let bracketedKey = AngleBracketNotation.Normalize(keybinding.key);
registerCommand(context, keybinding.command, () => handleKeyEvent(`${ bracketedKey }`));
}
// Initialize mode handler for current active Text Editor at startup.

View File

@ -30,8 +30,8 @@ gulp.task('typings', function () {
gulp.task('typings-vscode-definitions', ['typings'], function() {
// add vscode definitions
var vscodeTypings = '/// <reference path="../node_modules/vscode/typings/index.d.ts" />\n';
var vscodeNodeTypings = '/// <reference path="../node_modules/vscode/typings/node.d.ts" />\n';
var vscodeTypings = '/// <reference path="vscode/index.d.ts" />\n';
var vscodeNodeTypings = '/// <reference path="vscode/node.d.ts" />\n';
return gulp.src('./typings/index.d.ts')
.pipe(inject.replace(vscodeTypings, ''))
.pipe(inject.replace(vscodeNodeTypings, ''))
@ -69,7 +69,7 @@ gulp.task('default', ['tslint', 'compile']);
gulp.task('compile', shell.task(['npm run vscode:prepublish']));
gulp.task('watch', shell.task(['npm run compile']));
gulp.task('init', ['typings']);
gulp.task('init', ['typings', 'typings-vscode-definitions']);
gulp.task('patch', ['default'], function() { return versionBump('patch'); })
gulp.task('minor', ['default'], function() { return versionBump('minor'); })

View File

@ -261,13 +261,11 @@
"gulp-soften": "^0.0.1",
"gulp-tag-version": "^1.3.0",
"gulp-trimlines": "^1.0.0",
"gulp-tslint": "^6.1.1",
"gulp-typescript": "^2.13.4",
"gulp-tslint": "^6.1.2",
"gulp-typings": "^2.0.0",
"merge-stream": "^1.0.0",
"tslint": "^3.10.2",
"typescript": "2.0.0",
"typings": "^1.0.4",
"vscode": "^0.11.16"
"typings": "^1.4.0"
}
}

View File

@ -5,6 +5,7 @@
"lodash": "registry:npm/lodash#4.0.0+20160416211519"
},
"globalDependencies": {
"copy-paste": "registry:dt/copy-paste#1.1.3+20160117130525"
"copy-paste": "registry:dt/copy-paste#1.1.3+20160117130525",
"diff-match-patch": "registry:dt/diff-match-patch#1.0.0+20160821140300"
}
}

View File

@ -1,39 +0,0 @@
// Type definitions for diff-match-patch v1.0.0
// Project: https://www.npmjs.com/package/diff-match-patch
// Definitions by: Asana <https://asana.com>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
declare module "diff-match-patch" {
type Diff = [number, string];
export class diff_match_patch {
static new (): diff_match_patch;
Diff_Timeout: number;
Diff_EditCost: number;
Match_Threshold: number;
Match_Distance: number;
Patch_DeleteThreshold: number;
Patch_Margin: number;
Match_MaxBits: number;
diff_main(text1: string, text2: string, opt_checklines?: boolean, opt_deadline?: number): Diff[];
diff_commonPrefix(text1: string, text2: string): number;
diff_commonSuffix(text1: string, text2: string): number;
diff_cleanupSemantic(diffs: Diff[]): void;
diff_cleanupSemanticLossless(diffs: Diff[]): void;
diff_cleanupEfficiency(diffs: Diff[]): void;
diff_cleanupMerge(diffs: Diff[]): void;
diff_xIndex(diffs: Diff[], loc: number): number;
diff_prettyHtml(diffs: Diff[]): string;
diff_text1(diffs: Diff[]): string;
diff_text2(diffs: Diff[]): string;
diff_levenshtein(diffs: Diff[]): number;
diff_toDelta(diffs: Diff[]): string;
diff_fromDelta(text1: string, delta: string): Diff[];
}
export var DIFF_DELETE: number;
export var DIFF_INSERT: number;
export var DIFF_EQUAL: number;
}

View File

@ -1,43 +0,0 @@
// Generated by typings
// Source: https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/5421783adfaf9b99e9274f4488cfc0ee73f17a56/copy-paste/copy-paste.d.ts
declare module 'copy-paste' {
export type CopyCallback = (err: Error) => void;
export type PasteCallback = (err: Error, content: string) => void;
/**
* Asynchronously replaces the current contents of the clip board with text.
*
* @param {T} content Takes either a string, array, object, or readable stream.
* @return {T} Returns the same value passed in.
*/
export function copy<T>(content: T): T;
/**
* Asynchronously replaces the current contents of the clip board with text.
*
* @param {T} content Takes either a string, array, object, or readable stream.
* @param {CopyCallback} callback will fire when the copy operation is complete.
* @return {T} Returns the same value passed in.
*/
export function copy<T>(content: T, callback: CopyCallback): T;
/**
* Synchronously returns the current contents of the system clip board.
*
* Note: The synchronous version of paste is not always availabled.
* An error message is shown if the synchronous version of paste is used on an unsupported platform.
* The asynchronous version of paste is always available.
*
* @return {string} Returns the current contents of the system clip board.
*/
export function paste(): string;
/**
* Asynchronously returns the current contents of the system clip board.
*
* @param {PasteCallback} callback The contents of the system clip board are passed to the callback as the second parameter.
*/
export function paste(callback: PasteCallback): void;
}

View File

@ -1,8 +0,0 @@
{
"resolution": "main",
"tree": {
"src": "https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/5421783adfaf9b99e9274f4488cfc0ee73f17a56/copy-paste/copy-paste.d.ts",
"raw": "registry:dt/copy-paste#1.1.3+20160117130525",
"typings": "https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/5421783adfaf9b99e9274f4488cfc0ee73f17a56/copy-paste/copy-paste.d.ts"
}
}

5
typings/index.d.ts vendored
View File

@ -1,5 +0,0 @@
/// <reference path="globals/copy-paste/index.d.ts" />
/// <reference path="modules/diff/index.d.ts" />
/// <reference path="modules/lodash/index.d.ts" />
/// <reference path="vscode/index.d.ts" />
/// <reference path="vscode/node.d.ts" />

View File

@ -1,69 +0,0 @@
// Generated by typings
// Source: https://raw.githubusercontent.com/typed-typings/npm-diff/9b748f41b48c9ddcca5c2a135edd57df25d578cd/lib/index.d.ts
declare module '~diff/lib/index' {
// Type definitions for diff
// Project: https://github.com/kpdecker/jsdiff
// Definitions by: vvakame <https://github.com/vvakame/>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
module JsDiff {
interface IDiffResult {
value: string;
added?: boolean;
removed?: boolean;
}
interface IBestPath {
newPos: number;
componenets: IDiffResult[];
}
class Diff {
ignoreWhitespace:boolean;
constructor(ignoreWhitespace?:boolean);
diff(oldString:string, newString:string):IDiffResult[];
pushComponent(components:IDiffResult[], value:string, added:boolean, removed:boolean):void;
extractCommon(basePath:IBestPath, newString:string, oldString:string, diagonalPath:number):number;
equals(left:string, right:string):boolean;
join(left:string, right:string):string;
tokenize(value:string):any; // return types are string or string[]
}
function diffChars(oldStr:string, newStr:string):IDiffResult[];
function diffWords(oldStr:string, newStr:string):IDiffResult[];
function diffWordsWithSpace(oldStr:string, newStr:string):IDiffResult[];
function diffJson(oldObj: Object, newObj: Object): IDiffResult[];
function diffLines(oldStr:string, newStr:string):IDiffResult[];
function diffCss(oldStr:string, newStr:string):IDiffResult[];
function createPatch(fileName:string, oldStr:string, newStr:string, oldHeader:string, newHeader:string):string;
function applyPatch(oldStr:string, uniDiff:string):string;
function convertChangesToXML(changes:IDiffResult[]):string;
function convertChangesToDMP(changes:IDiffResult[]):{0: number; 1:string;}[];
}
export = JsDiff;
}
declare module 'diff/lib/index' {
import main = require('~diff/lib/index');
export = main;
}
declare module 'diff' {
import main = require('~diff/lib/index');
export = main;
}

View File

@ -1,11 +0,0 @@
{
"resolution": "main",
"tree": {
"src": "https://raw.githubusercontent.com/typed-typings/npm-diff/9b748f41b48c9ddcca5c2a135edd57df25d578cd/typings.json",
"raw": "registry:npm/diff#2.0.0+20160211003958",
"main": "lib/index.d.ts",
"global": false,
"name": "diff",
"type": "typings"
}
}

File diff suppressed because it is too large Load Diff

View File

@ -1,12 +0,0 @@
{
"resolution": "main",
"tree": {
"src": "https://raw.githubusercontent.com/typed-typings/npm-lodash/7ccf9dc406a792d702067f4eab0fa8df4109fcaa/typings.json",
"raw": "registry:npm/lodash#4.0.0+20160416211519",
"main": "index.d.ts",
"version": "4.0.0",
"global": false,
"name": "lodash",
"type": "typings"
}
}

1
typings/tsd.d.ts vendored
View File

@ -1 +0,0 @@
/// <reference path="diff-match-patch/diff-match-patch.d.ts" />