Browse Source

tests, refactoring, typings update

sanex3339 9 years ago
parent
commit
16950a802a
42 changed files with 620 additions and 4664 deletions
  1. 3 5
      dist/index.js
  2. 2 1
      package.json
  3. 4 7
      src/cli/JavaScriptObfuscatorCLI.ts
  4. 49 2
      test/JavaScriptObfuscatorCLI.spec.ts
  5. 26 0
      test/mocks/StdoutWriteMock.ts
  6. 1 3
      tsconfig.json
  7. 4 3
      typings.json
  8. 0 10
      typings/browser.d.ts
  9. 0 416
      typings/browser/ambient/chai/index.d.ts
  10. 0 224
      typings/browser/ambient/chance/index.d.ts
  11. 0 413
      typings/browser/ambient/commander/index.d.ts
  12. 0 370
      typings/browser/ambient/estree/index.d.ts
  13. 0 11
      typings/globals/chai/index.d.ts
  14. 8 0
      typings/globals/chai/typings.json
  15. 0 5
      typings/globals/chance/index.d.ts
  16. 8 0
      typings/globals/chance/typings.json
  17. 0 6
      typings/globals/commander/index.d.ts
  18. 8 0
      typings/globals/commander/typings.json
  19. 0 5
      typings/globals/escodegen/index.d.ts
  20. 8 0
      typings/globals/escodegen/typings.json
  21. 0 6
      typings/globals/esprima/index.d.ts
  22. 8 0
      typings/globals/esprima/typings.json
  23. 0 5
      typings/globals/estraverse/index.d.ts
  24. 8 0
      typings/globals/estraverse/typings.json
  25. 0 5
      typings/globals/estree/index.d.ts
  26. 8 0
      typings/globals/estree/typings.json
  27. 0 5
      typings/globals/mkdirp/index.d.ts
  28. 8 0
      typings/globals/mkdirp/typings.json
  29. 0 5
      typings/globals/mocha/index.d.ts
  30. 8 0
      typings/globals/mocha/typings.json
  31. 0 11
      typings/globals/node/index.d.ts
  32. 8 0
      typings/globals/node/typings.json
  33. 432 0
      typings/globals/sinon/index.d.ts
  34. 8 0
      typings/globals/sinon/typings.json
  35. 11 0
      typings/index.d.ts
  36. 0 10
      typings/main.d.ts
  37. 0 180
      typings/main/ambient/escodegen/index.d.ts
  38. 0 108
      typings/main/ambient/esprima/index.d.ts
  39. 0 24
      typings/main/ambient/estraverse/index.d.ts
  40. 0 17
      typings/main/ambient/mkdirp/index.d.ts
  41. 0 239
      typings/main/ambient/mocha/index.d.ts
  42. 0 2568
      typings/main/ambient/node/index.d.ts

+ 3 - 5
dist/index.js

@@ -1084,6 +1084,7 @@ var JavaScriptObfuscatorCLI = function () {
             this.configureCommands();
             this.configureCommands();
             if (!this.arguments.length || this.arguments.indexOf('--help') >= 0) {
             if (!this.arguments.length || this.arguments.indexOf('--help') >= 0) {
                 this.commands.outputHelp();
                 this.commands.outputHelp();
+                return;
             }
             }
             this.inputPath = this.getInputPath();
             this.inputPath = this.getInputPath();
             this.getData();
             this.getData();
@@ -1112,13 +1113,10 @@ var JavaScriptObfuscatorCLI = function () {
                 return val.split(',');
                 return val.split(',');
             }).option('--rotateUnicodeArray <boolean>', 'Disable rotation of unicode array values during obfuscation', JavaScriptObfuscatorCLI.parseBoolean).option('--selfDefending <boolean>', 'Disables self-defending for obfuscated code', JavaScriptObfuscatorCLI.parseBoolean).option('--unicodeArray <boolean>', 'Disables gathering of all literal strings into an array and replacing every literal string with an array call', JavaScriptObfuscatorCLI.parseBoolean).option('--unicodeArrayThreshold <number>', 'The probability that the literal string will be inserted into unicodeArray (Default: 0.8, Min: 0, Max: 1)', parseFloat).option('--wrapUnicodeArrayCalls <boolean>', 'Disables usage of special access function instead of direct array call', JavaScriptObfuscatorCLI.parseBoolean).parse(this.rawArguments);
             }).option('--rotateUnicodeArray <boolean>', 'Disable rotation of unicode array values during obfuscation', JavaScriptObfuscatorCLI.parseBoolean).option('--selfDefending <boolean>', 'Disables self-defending for obfuscated code', JavaScriptObfuscatorCLI.parseBoolean).option('--unicodeArray <boolean>', 'Disables gathering of all literal strings into an array and replacing every literal string with an array call', JavaScriptObfuscatorCLI.parseBoolean).option('--unicodeArrayThreshold <number>', 'The probability that the literal string will be inserted into unicodeArray (Default: 0.8, Min: 0, Max: 1)', parseFloat).option('--wrapUnicodeArrayCalls <boolean>', 'Disables usage of special access function instead of direct array call', JavaScriptObfuscatorCLI.parseBoolean).parse(this.rawArguments);
             this.commands.on('--help', function () {
             this.commands.on('--help', function () {
-                var isWindows = process.platform === 'win32',
-                    commandName = isWindows ? 'type' : 'cat';
                 console.log('  Examples:\n');
                 console.log('  Examples:\n');
-                console.log('    %> javascript-obfuscator < in.js > out.js');
-                console.log('    %> ' + commandName + ' in1.js in2.js | javascript-obfuscator > out.js');
+                console.log('    %> javascript-obfuscator in.js --compact true --selfDefending false');
+                console.log('    %> javascript-obfuscator in.js --output out.js --compact true --selfDefending false');
                 console.log('');
                 console.log('');
-                process.exit();
             });
             });
         }
         }
     }, {
     }, {

+ 2 - 1
package.json

@@ -32,6 +32,7 @@
     "coveralls": "^2.11.9",
     "coveralls": "^2.11.9",
     "istanbul": "1.1.0-alpha.1",
     "istanbul": "1.1.0-alpha.1",
     "mocha": "^2.5.3",
     "mocha": "^2.5.3",
+    "sinon": "^1.17.4",
     "ts-loader": "^0.8.2",
     "ts-loader": "^0.8.2",
     "ts-node": "^0.9.1",
     "ts-node": "^0.9.1",
     "tslint": "^3.12.1",
     "tslint": "^3.12.1",
@@ -58,7 +59,7 @@
     "test": "scripts/test",
     "test": "scripts/test",
     "tslint": "scripts/tslint",
     "tslint": "scripts/tslint",
     "travis": "scripts/travis",
     "travis": "scripts/travis",
-    "typings": "srcipts/typings"
+    "typings": "scripts/typings"
   },
   },
   "author": {
   "author": {
     "name": "Timofey Kachalov"
     "name": "Timofey Kachalov"

+ 4 - 7
src/cli/JavaScriptObfuscatorCLI.ts

@@ -94,6 +94,8 @@ export class JavaScriptObfuscatorCLI {
 
 
         if (!this.arguments.length || this.arguments.indexOf('--help') >= 0) {
         if (!this.arguments.length || this.arguments.indexOf('--help') >= 0) {
             this.commands.outputHelp();
             this.commands.outputHelp();
+
+            return;
         }
         }
 
 
         this.inputPath = this.getInputPath();
         this.inputPath = this.getInputPath();
@@ -143,15 +145,10 @@ export class JavaScriptObfuscatorCLI {
             .parse(this.rawArguments);
             .parse(this.rawArguments);
 
 
         this.commands.on('--help', () => {
         this.commands.on('--help', () => {
-            let isWindows: boolean = process.platform === 'win32',
-                commandName: string = isWindows ? 'type' : 'cat';
-
             console.log('  Examples:\n');
             console.log('  Examples:\n');
-            console.log('    %> javascript-obfuscator < in.js > out.js');
-            console.log(`    %> ${commandName} in1.js in2.js | javascript-obfuscator > out.js`);
+            console.log('    %> javascript-obfuscator in.js --compact true --selfDefending false');
+            console.log('    %> javascript-obfuscator in.js --output out.js --compact true --selfDefending false');
             console.log('');
             console.log('');
-
-            process.exit();
         });
         });
     }
     }
 
 

+ 49 - 2
test/JavaScriptObfuscatorCLI.spec.ts

@@ -1,11 +1,14 @@
 import * as fs from 'fs';
 import * as fs from 'fs';
 import * as mkdirp from 'mkdirp';
 import * as mkdirp from 'mkdirp';
+import * as sinon from 'sinon';
+
+import { StdoutWriteMock } from "../test/mocks/StdoutWriteMock";
 
 
 import { JavaScriptObfuscator } from "../src/JavaScriptObfuscator";
 import { JavaScriptObfuscator } from "../src/JavaScriptObfuscator";
 
 
 const assert: Chai.AssertStatic = require('chai').assert;
 const assert: Chai.AssertStatic = require('chai').assert;
 
 
-describe('JavaScriptObfuscatorCLI', () => {
+describe('JavaScriptObfuscatorCLI', function (): void {
     let fixturesDirName: string = 'test/fixtures',
     let fixturesDirName: string = 'test/fixtures',
         fixtureFileName: string = 'sample.js',
         fixtureFileName: string = 'sample.js',
         fixtureFilePath: string = `${fixturesDirName}/${fixtureFileName}`,
         fixtureFilePath: string = `${fixturesDirName}/${fixtureFileName}`,
@@ -13,6 +16,8 @@ describe('JavaScriptObfuscatorCLI', () => {
         outputFileName: string = 'sample-obfuscated.js',
         outputFileName: string = 'sample-obfuscated.js',
         outputFilePath: string = `${outputDirName}/${outputFileName}`;
         outputFilePath: string = `${outputDirName}/${outputFileName}`;
 
 
+    this.timeout(5000);
+
     describe('run (): void', () => {
     describe('run (): void', () => {
         before(() => {
         before(() => {
             mkdirp.sync(outputDirName);
             mkdirp.sync(outputDirName);
@@ -40,7 +45,7 @@ describe('JavaScriptObfuscatorCLI', () => {
             });
             });
         });
         });
 
 
-        describe('output option is not set', () => {
+        describe('--output option is not set', () => {
             it(`should creates file called \`${outputFileName}\` with obfuscated JS code in \`${fixturesDirName}\` directory`, () => {
             it(`should creates file called \`${outputFileName}\` with obfuscated JS code in \`${fixturesDirName}\` directory`, () => {
                 let outputFixturesFilePath: string = `${fixturesDirName}/${outputFileName}`;
                 let outputFixturesFilePath: string = `${fixturesDirName}/${outputFileName}`;
 
 
@@ -79,6 +84,48 @@ describe('JavaScriptObfuscatorCLI', () => {
             });
             });
         });
         });
 
 
+        describe('help output', () => {
+            let callback: Sinon.SinonSpy,
+                stdoutWriteMock: StdoutWriteMock;
+
+            beforeEach(() => {
+                callback = sinon.spy(console, 'log');
+                stdoutWriteMock = new StdoutWriteMock(process.stdout.write);
+            });
+
+            it('should print `console.log` help if `--help` option is set', () => {
+                stdoutWriteMock.mute();
+
+                JavaScriptObfuscator.runCLI([
+                    'node',
+                    'javascript-obfuscator',
+                    fixtureFilePath,
+                    '--help'
+                ]);
+
+                stdoutWriteMock.restore();
+
+                assert.equal(callback.called, true);
+            });
+
+            it('should print `console.log` help if no options is passed', () => {
+                stdoutWriteMock.mute();
+
+                JavaScriptObfuscator.runCLI([
+                    'node',
+                    'javascript-obfuscator'
+                ]);
+
+                stdoutWriteMock.restore();
+
+                assert.equal(callback.called, true);
+            });
+
+            afterEach(() => {
+                callback.restore();
+            });
+        });
+
         after(() => {
         after(() => {
             fs.rmdirSync(outputDirName);
             fs.rmdirSync(outputDirName);
         });
         });

+ 26 - 0
test/mocks/StdoutWriteMock.ts

@@ -0,0 +1,26 @@
+export class StdoutWriteMock {
+    /**
+     * @type any
+     */
+    private stdoutWrite: any;
+
+    /**
+     * @type any
+     */
+    private stdoutWriteMock: any = (() => {});
+
+    /**
+     * @param stdoutWrite
+     */
+    constructor (stdoutWrite: any) {
+        this.stdoutWrite = stdoutWrite;
+    }
+
+    public mute (): void {
+        process.stdout.write = this.stdoutWriteMock;
+    }
+
+    public restore (): void {
+        process.stdout.write = this.stdoutWrite;
+    }
+}

+ 1 - 3
tsconfig.json

@@ -10,8 +10,6 @@
   },
   },
   "exclude": [
   "exclude": [
     "node_modules",
     "node_modules",
-    "test",
-    "typings/browser",
-    "typings/browser.d.ts"
+    "test"
   ]
   ]
 }
 }

+ 4 - 3
typings.json

@@ -1,8 +1,8 @@
 {
 {
   "name": "javascript-obfuscator",
   "name": "javascript-obfuscator",
   "version": false,
   "version": false,
-  "ambientDependencies": {
-    "node": "github:DefinitelyTyped/DefinitelyTyped/node/node.d.ts",
+  "globalDependencies": {
+    "chai": "github:DefinitelyTyped/DefinitelyTyped/chai/chai.d.ts",
     "chance": "github:DefinitelyTyped/DefinitelyTyped/chance/chance.d.ts",
     "chance": "github:DefinitelyTyped/DefinitelyTyped/chance/chance.d.ts",
     "commander": "github:DefinitelyTyped/DefinitelyTyped/commander/commander.d.ts",
     "commander": "github:DefinitelyTyped/DefinitelyTyped/commander/commander.d.ts",
     "estree": "github:DefinitelyTyped/DefinitelyTyped/estree/estree.d.ts",
     "estree": "github:DefinitelyTyped/DefinitelyTyped/estree/estree.d.ts",
@@ -11,6 +11,7 @@
     "estraverse": "github:DefinitelyTyped/DefinitelyTyped/estraverse/estraverse.d.ts",
     "estraverse": "github:DefinitelyTyped/DefinitelyTyped/estraverse/estraverse.d.ts",
     "mkdirp": "github:DefinitelyTyped/DefinitelyTyped/mkdirp/mkdirp.d.ts",
     "mkdirp": "github:DefinitelyTyped/DefinitelyTyped/mkdirp/mkdirp.d.ts",
     "mocha": "github:DefinitelyTyped/DefinitelyTyped/mocha/mocha.d.ts",
     "mocha": "github:DefinitelyTyped/DefinitelyTyped/mocha/mocha.d.ts",
-    "chai": "github:DefinitelyTyped/DefinitelyTyped/chai/chai.d.ts"
+    "node": "github:DefinitelyTyped/DefinitelyTyped/node/node.d.ts",
+    "sinon": "github:DefinitelyTyped/DefinitelyTyped/sinon/sinon.d.ts"
   }
   }
 }
 }

+ 0 - 10
typings/browser.d.ts

@@ -1,10 +0,0 @@
-/// <reference path="browser/ambient/chai/index.d.ts" />
-/// <reference path="browser/ambient/chance/index.d.ts" />
-/// <reference path="browser/ambient/commander/index.d.ts" />
-/// <reference path="browser/ambient/escodegen/index.d.ts" />
-/// <reference path="browser/ambient/esprima/index.d.ts" />
-/// <reference path="browser/ambient/estraverse/index.d.ts" />
-/// <reference path="browser/ambient/estree/index.d.ts" />
-/// <reference path="browser/ambient/mkdirp/index.d.ts" />
-/// <reference path="browser/ambient/mocha/index.d.ts" />
-/// <reference path="browser/ambient/node/index.d.ts" />

+ 0 - 416
typings/browser/ambient/chai/index.d.ts

@@ -1,416 +0,0 @@
-// Generated by typings
-// Source: https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/master/chai/chai.d.ts
-// Type definitions for chai 3.4.0
-// Project: http://chaijs.com/
-// Definitions by: Jed Mao <https://github.com/jedmao/>,
-//                 Bart van der Schoor <https://github.com/Bartvds>,
-//                 Andrew Brown <https://github.com/AGBrown>,
-//                 Olivier Chevet <https://github.com/olivr70>,
-//                 Matt Wistrand <https://github.com/mwistrand>
-// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
-
-// <reference path="../assertion-error/assertion-error.d.ts"/>
-
-declare namespace Chai {
-
-    interface ChaiStatic {
-        expect: ExpectStatic;
-        should(): Should;
-        /**
-         * Provides a way to extend the internals of Chai
-         */
-        use(fn: (chai: any, utils: any) => void): ChaiStatic;
-        assert: AssertStatic;
-        config: Config;
-        AssertionError: typeof AssertionError;
-    }
-
-    export interface ExpectStatic extends AssertionStatic {
-        fail(actual?: any, expected?: any, message?: string, operator?: string): void;
-    }
-
-    export interface AssertStatic extends Assert {
-    }
-
-    export interface AssertionStatic {
-        (target: any, message?: string): Assertion;
-    }
-
-    interface ShouldAssertion {
-        equal(value1: any, value2: any, message?: string): void;
-        Throw: ShouldThrow;
-        throw: ShouldThrow;
-        exist(value: any, message?: string): void;
-    }
-
-    interface Should extends ShouldAssertion {
-        not: ShouldAssertion;
-        fail(actual: any, expected: any, message?: string, operator?: string): void;
-    }
-
-    interface ShouldThrow {
-        (actual: Function): void;
-        (actual: Function, expected: string|RegExp, message?: string): void;
-        (actual: Function, constructor: Error|Function, expected?: string|RegExp, message?: string): void;
-    }
-
-    interface Assertion extends LanguageChains, NumericComparison, TypeComparison {
-        not: Assertion;
-        deep: Deep;
-        any: KeyFilter;
-        all: KeyFilter;
-        a: TypeComparison;
-        an: TypeComparison;
-        include: Include;
-        includes: Include;
-        contain: Include;
-        contains: Include;
-        ok: Assertion;
-        true: Assertion;
-        false: Assertion;
-        null: Assertion;
-        undefined: Assertion;
-        NaN: Assertion;
-        exist: Assertion;
-        empty: Assertion;
-        arguments: Assertion;
-        Arguments: Assertion;
-        equal: Equal;
-        equals: Equal;
-        eq: Equal;
-        eql: Equal;
-        eqls: Equal;
-        property: Property;
-        ownProperty: OwnProperty;
-        haveOwnProperty: OwnProperty;
-        ownPropertyDescriptor: OwnPropertyDescriptor;
-        haveOwnPropertyDescriptor: OwnPropertyDescriptor;
-        length: Length;
-        lengthOf: Length;
-        match: Match;
-        matches: Match;
-        string(string: string, message?: string): Assertion;
-        keys: Keys;
-        key(string: string): Assertion;
-        throw: Throw;
-        throws: Throw;
-        Throw: Throw;
-        respondTo: RespondTo;
-        respondsTo: RespondTo;
-        itself: Assertion;
-        satisfy: Satisfy;
-        satisfies: Satisfy;
-        closeTo: CloseTo;
-        approximately: CloseTo;
-        members: Members;
-        increase: PropertyChange;
-        increases: PropertyChange;
-        decrease: PropertyChange;
-        decreases: PropertyChange;
-        change: PropertyChange;
-        changes: PropertyChange;
-        extensible: Assertion;
-        sealed: Assertion;
-        frozen: Assertion;
-        oneOf(list: any[], message?: string): Assertion;
-    }
-
-    interface LanguageChains {
-        to: Assertion;
-        be: Assertion;
-        been: Assertion;
-        is: Assertion;
-        that: Assertion;
-        which: Assertion;
-        and: Assertion;
-        has: Assertion;
-        have: Assertion;
-        with: Assertion;
-        at: Assertion;
-        of: Assertion;
-        same: Assertion;
-    }
-
-    interface NumericComparison {
-        above: NumberComparer;
-        gt: NumberComparer;
-        greaterThan: NumberComparer;
-        least: NumberComparer;
-        gte: NumberComparer;
-        below: NumberComparer;
-        lt: NumberComparer;
-        lessThan: NumberComparer;
-        most: NumberComparer;
-        lte: NumberComparer;
-        within(start: number, finish: number, message?: string): Assertion;
-    }
-
-    interface NumberComparer {
-        (value: number, message?: string): Assertion;
-    }
-
-    interface TypeComparison {
-        (type: string, message?: string): Assertion;
-        instanceof: InstanceOf;
-        instanceOf: InstanceOf;
-    }
-
-    interface InstanceOf {
-        (constructor: Object, message?: string): Assertion;
-    }
-
-    interface CloseTo {
-        (expected: number, delta: number, message?: string): Assertion;
-    }
-
-    interface Deep {
-        equal: Equal;
-        include: Include;
-        property: Property;
-        members: Members;
-    }
-
-    interface KeyFilter {
-        keys: Keys;
-    }
-
-    interface Equal {
-        (value: any, message?: string): Assertion;
-    }
-
-    interface Property {
-        (name: string, value?: any, message?: string): Assertion;
-    }
-
-    interface OwnProperty {
-        (name: string, message?: string): Assertion;
-    }
-
-    interface OwnPropertyDescriptor {
-        (name: string, descriptor: PropertyDescriptor, message?: string): Assertion;
-        (name: string, message?: string): Assertion;
-    }
-
-    interface Length extends LanguageChains, NumericComparison {
-        (length: number, message?: string): Assertion;
-    }
-
-    interface Include {
-        (value: Object, message?: string): Assertion;
-        (value: string, message?: string): Assertion;
-        (value: number, message?: string): Assertion;
-        keys: Keys;
-        members: Members;
-        any: KeyFilter;
-        all: KeyFilter;
-    }
-
-    interface Match {
-        (regexp: RegExp|string, message?: string): Assertion;
-    }
-
-    interface Keys {
-        (...keys: string[]): Assertion;
-        (keys: any[]): Assertion;
-        (keys: Object): Assertion;
-    }
-
-    interface Throw {
-        (): Assertion;
-        (expected: string, message?: string): Assertion;
-        (expected: RegExp, message?: string): Assertion;
-        (constructor: Error, expected?: string, message?: string): Assertion;
-        (constructor: Error, expected?: RegExp, message?: string): Assertion;
-        (constructor: Function, expected?: string, message?: string): Assertion;
-        (constructor: Function, expected?: RegExp, message?: string): Assertion;
-    }
-
-    interface RespondTo {
-        (method: string, message?: string): Assertion;
-    }
-
-    interface Satisfy {
-        (matcher: Function, message?: string): Assertion;
-    }
-
-    interface Members {
-        (set: any[], message?: string): Assertion;
-    }
-
-    interface PropertyChange {
-        (object: Object, prop: string, msg?: string): Assertion;
-    }
-
-    export interface Assert {
-        /**
-         * @param expression Expression to test for truthiness.
-         * @param message Message to display on error.
-         */
-        (expression: any, message?: string): void;
-
-        fail(actual?: any, expected?: any, msg?: string, operator?: string): void;
-
-        ok(val: any, msg?: string): void;
-        isOk(val: any, msg?: string): void;
-        notOk(val: any, msg?: string): void;
-        isNotOk(val: any, msg?: string): void;
-
-        equal(act: any, exp: any, msg?: string): void;
-        notEqual(act: any, exp: any, msg?: string): void;
-
-        strictEqual(act: any, exp: any, msg?: string): void;
-        notStrictEqual(act: any, exp: any, msg?: string): void;
-
-        deepEqual(act: any, exp: any, msg?: string): void;
-        notDeepEqual(act: any, exp: any, msg?: string): void;
-
-        isTrue(val: any, msg?: string): void;
-        isFalse(val: any, msg?: string): void;
-
-        isNotTrue(val: any, msg?: string): void;
-        isNotFalse(val: any, msg?: string): void;
-
-        isNull(val: any, msg?: string): void;
-        isNotNull(val: any, msg?: string): void;
-
-        isUndefined(val: any, msg?: string): void;
-        isDefined(val: any, msg?: string): void;
-
-        isNaN(val: any, msg?: string): void;
-        isNotNaN(val: any, msg?: string): void;
-
-        isAbove(val: number, abv: number, msg?: string): void;
-        isBelow(val: number, blw: number, msg?: string): void;
-
-        isAtLeast(val: number, atlst: number, msg?: string): void;
-        isAtMost(val: number, atmst: number, msg?: string): void;
-
-        isFunction(val: any, msg?: string): void;
-        isNotFunction(val: any, msg?: string): void;
-
-        isObject(val: any, msg?: string): void;
-        isNotObject(val: any, msg?: string): void;
-
-        isArray(val: any, msg?: string): void;
-        isNotArray(val: any, msg?: string): void;
-
-        isString(val: any, msg?: string): void;
-        isNotString(val: any, msg?: string): void;
-
-        isNumber(val: any, msg?: string): void;
-        isNotNumber(val: any, msg?: string): void;
-
-        isBoolean(val: any, msg?: string): void;
-        isNotBoolean(val: any, msg?: string): void;
-
-        typeOf(val: any, type: string, msg?: string): void;
-        notTypeOf(val: any, type: string, msg?: string): void;
-
-        instanceOf(val: any, type: Function, msg?: string): void;
-        notInstanceOf(val: any, type: Function, msg?: string): void;
-
-        include(exp: string, inc: any, msg?: string): void;
-        include(exp: any[], inc: any, msg?: string): void;
-
-        notInclude(exp: string, inc: any, msg?: string): void;
-        notInclude(exp: any[], inc: any, msg?: string): void;
-
-        match(exp: any, re: RegExp, msg?: string): void;
-        notMatch(exp: any, re: RegExp, msg?: string): void;
-
-        property(obj: Object, prop: string, msg?: string): void;
-        notProperty(obj: Object, prop: string, msg?: string): void;
-        deepProperty(obj: Object, prop: string, msg?: string): void;
-        notDeepProperty(obj: Object, prop: string, msg?: string): void;
-
-        propertyVal(obj: Object, prop: string, val: any, msg?: string): void;
-        propertyNotVal(obj: Object, prop: string, val: any, msg?: string): void;
-
-        deepPropertyVal(obj: Object, prop: string, val: any, msg?: string): void;
-        deepPropertyNotVal(obj: Object, prop: string, val: any, msg?: string): void;
-
-        lengthOf(exp: any, len: number, msg?: string): void;
-        //alias frenzy
-        throw(fn: Function, msg?: string): void;
-        throw(fn: Function, regExp: RegExp): void;
-        throw(fn: Function, errType: Function, msg?: string): void;
-        throw(fn: Function, errType: Function, regExp: RegExp): void;
-
-        throws(fn: Function, msg?: string): void;
-        throws(fn: Function, regExp: RegExp): void;
-        throws(fn: Function, errType: Function, msg?: string): void;
-        throws(fn: Function, errType: Function, regExp: RegExp): void;
-
-        Throw(fn: Function, msg?: string): void;
-        Throw(fn: Function, regExp: RegExp): void;
-        Throw(fn: Function, errType: Function, msg?: string): void;
-        Throw(fn: Function, errType: Function, regExp: RegExp): void;
-
-        doesNotThrow(fn: Function, msg?: string): void;
-        doesNotThrow(fn: Function, regExp: RegExp): void;
-        doesNotThrow(fn: Function, errType: Function, msg?: string): void;
-        doesNotThrow(fn: Function, errType: Function, regExp: RegExp): void;
-
-        operator(val: any, operator: string, val2: any, msg?: string): void;
-        closeTo(act: number, exp: number, delta: number, msg?: string): void;
-        approximately(act: number, exp: number, delta: number, msg?: string): void;
-
-        sameMembers(set1: any[], set2: any[], msg?: string): void;
-        sameDeepMembers(set1: any[], set2: any[], msg?: string): void;
-        includeMembers(superset: any[], subset: any[], msg?: string): void;
-
-        ifError(val: any, msg?: string): void;
-
-        isExtensible(obj: {}, msg?: string): void;
-        extensible(obj: {}, msg?: string): void;
-        isNotExtensible(obj: {}, msg?: string): void;
-        notExtensible(obj: {}, msg?: string): void;
-
-        isSealed(obj: {}, msg?: string): void;
-        sealed(obj: {}, msg?: string): void;
-        isNotSealed(obj: {}, msg?: string): void;
-        notSealed(obj: {}, msg?: string): void;
-
-        isFrozen(obj: Object, msg?: string): void;
-        frozen(obj: Object, msg?: string): void;
-        isNotFrozen(obj: Object, msg?: string): void;
-        notFrozen(obj: Object, msg?: string): void;
-
-        oneOf(inList: any, list: any[], msg?: string): void;
-    }
-
-    export interface Config {
-        /**
-         * Default: false
-         */
-        includeStack: boolean;
-
-        /**
-         * Default: true
-         */
-        showDiff: boolean;
-
-        /**
-         * Default: 40
-         */
-        truncateThreshold: number;
-    }
-
-    export class AssertionError {
-        constructor(message: string, _props?: any, ssf?: Function);
-        name: string;
-        message: string;
-        showDiff: boolean;
-        stack: string;
-    }
-}
-
-declare var chai: Chai.ChaiStatic;
-
-declare module "chai" {
-    export = chai;
-}
-
-interface Object {
-    should: Chai.Assertion;
-}

+ 0 - 224
typings/browser/ambient/chance/index.d.ts

@@ -1,224 +0,0 @@
-// Generated by typings
-// Source: https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/master/chance/chance.d.ts
-// Type definitions for Chance 0.7.3
-// Project: http://chancejs.com
-// Definitions by: Chris Bowdon <https://github.com/cbowdon/>
-// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
-
-declare namespace Chance {
-
-    interface ChanceStatic {
-        (): Chance
-        (seed: number): Chance
-        (generator: () => any): Chance
-
-        new(): Chance;
-        new(seed: number): Chance;
-        new(generator: () => any): Chance;
-    }
-
-    interface Chance {
-
-        // Basics
-        bool(opts?: Options): boolean;
-        character(opts?: Options): string;
-        floating(opts?: Options): number;
-        integer(opts?: Options): number;
-        natural(opts?: Options): number;
-        string(opts?: Options): string;
-
-        // Text
-        paragraph(opts?: Options): string;
-        sentence(opts?: Options): string;
-        syllable(opts?: Options): string;
-        word(opts?: Options): string;
-
-        // Person
-        age(opts?: Options): number;
-        birthday(): Date;
-        birthday(opts?: Options): Date|string;
-        cpf(): string;
-        first(opts?: Options): string;
-        last(opts?: Options): string;
-        name(opts?: Options): string;
-        name_prefix(opts?: Options): string;
-        name_suffix(opts?: Options): string;
-        prefix(opts?: Options): string;
-        ssn(opts?: Options): string;
-        suffix(opts?: Options): string;
-
-        // Mobile
-        android_id(): string;
-        apple_token(): string;
-        bb_pin(): string;
-        wp7_anid(): string;
-        wp8_anid2(): string;
-
-        // Web
-        color(opts?: Options): string;
-        domain(opts?: Options): string;
-        email(opts?: Options): string;
-        fbid(): string;
-        google_analytics(): string;
-        hashtag(): string;
-        ip(): string;
-        ipv6(): string;
-        klout(): string;
-        tld(): string;
-        twitter(): string;
-        url(opts?: Options): string;
-
-        // Location
-        address(opts?: Options): string;
-        altitude(opts?: Options): number;
-        areacode(): string;
-        city(): string;
-        coordinates(opts?: Options): string;
-        country(opts?: Options): string;
-        depth(opts?: Options): number;
-        geohash(opts?: Options): string;
-        latitude(opts?: Options): number;
-        longitude(opts?: Options): number;
-        phone(opts?: Options): string;
-        postal(): string;
-        province(opts?: Options): string;
-        state(opts?: Options): string;
-        street(opts?: Options): string;
-        zip(opts?: Options): string;
-
-        // Time
-        ampm(): string;
-        date(): Date;
-        date(opts: DateOptions): Date|string;
-        hammertime(): number;
-        hour(opts?: Options): number;
-        millisecond(): number;
-        minute(): number;
-        month(): string;
-        month(opts: Options): Month;
-        second(): number;
-        timestamp(): number;
-        year(opts?: Options): string;
-
-        // Finance
-        cc(opts?: Options): string;
-        cc_type(): string;
-        cc_type(opts: Options): string|CreditCardType;
-        currency(): Currency;
-        currency_pair(): [ Currency, Currency ];
-        dollar(opts?: Options): string;
-        exp(): string;
-        exp(opts: Options): string|CreditCardExpiration;
-        exp_month(opts?: Options): string;
-        exp_year(opts?: Options): string;
-
-        // Helpers
-        capitalize(str: string): string;
-        mixin(desc: MixinDescriptor): any;
-        pad(num: number, width: number, padChar?: string): string;
-        pick<T>(arr: T[]): T;
-        pick<T>(arr: T[], count: number): T[];
-        set: Setter;
-        shuffle<T>(arr: T[]): T[];
-
-        // Miscellaneous
-        d4(): number;
-        d6(): number;
-        d8(): number;
-        d10(): number;
-        d12(): number;
-        d20(): number;
-        d30(): number;
-        d100(): number;
-        guid(): string;
-        hash(opts?: Options): string;
-        n<T>(generator: () => T, count: number, opts?: Options): T[];
-        normal(opts?: Options): number;
-        radio(opts?: Options): string;
-        rpg(dice: string): number[];
-        rpg(dice: string, opts?: Options): number[]|number;
-        tv(opts?: Options): string;
-        unique<T>(generator: () => T, count: number, opts?: Options): T[];
-        weighted<T>(values: T[], weights: number[]): T;
-
-        // "Hidden"
-        cc_types(): CreditCardType[];
-        mersenne_twister(seed?: number): any; // API return type not defined in docs
-        months(): Month[];
-        name_prefixes(): Name[];
-        provinces(): Name[];
-        states(): Name[];
-        street_suffix(): Name;
-        street_suffixes(): Name[];
-    }
-
-    // A more rigorous approach might be to produce
-    // the correct options interfaces for each method
-    interface Options { [id: string]: any; }
-
-    interface DateOptions {
-        string?: boolean;
-        american?: boolean;
-        year?: number;
-        month?: number;
-        day?: number;
-    }
-
-    interface Month {
-        name: string;
-        short_name: string;
-        numeric: string;
-    }
-
-    interface CreditCardType {
-        name: string;
-        short_name: string;
-        prefix: string;
-        length: number;
-    }
-
-    interface Currency {
-        code: string;
-        name: string;
-    }
-
-    interface CreditCardExpiration {
-        month: string;
-        year: string;
-    }
-
-    interface MixinDescriptor { [id: string]: () => any; }
-
-    interface Setter {
-        (key: 'firstNames', values: string[]): any;
-        (key: 'lastNames', values: string[]): any;
-        (key: 'provinces', values: string[]): any;
-        (key: 'us_states_and_dc', values: string[]): any;
-        (key: 'territories', values: string[]): any;
-        (key: 'armed_forces', values: string[]): any;
-        (key: 'street_suffixes', values: string[]): any;
-        (key: 'months', values: string[]): any;
-        (key: 'cc_types', values: string[]): any;
-        (key: 'currency_types', values: string[]): any;
-        <T>(key: string, values: T[]): any;
-    }
-
-    interface Name {
-        name: string;
-        abbreviation: string;
-    }
-}
-
-// window.chance
-declare var chance: Chance.Chance;
-declare var Chance: Chance.ChanceStatic;
-
-// import Chance = require('chance');
-declare module 'chance' {
-    interface ExportedChance extends Chance.ChanceStatic {
-        Chance: ExportedChance;
-    }
-    var Chance: ExportedChance;
-
-    export = Chance;
-}

+ 0 - 413
typings/browser/ambient/commander/index.d.ts

@@ -1,413 +0,0 @@
-// Generated by typings
-// Source: https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/master/commander/commander.d.ts
-// Type definitions for commanderjs 2.3.0
-// Project: https://github.com/visionmedia/commander.js
-// Definitions by: Marcelo Dezem <http://github.com/mdezem>, vvakame <http://github.com/vvakame>
-// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
-
-
-declare namespace commander {
-    interface ICommandStatic {
-        /**
-         * Initialize a new `Command`.
-         *
-         * @param {String} name
-         * @api public
-         */
-        new (name?:string):ICommand;
-    }
-
-    interface ICommand extends NodeJS.EventEmitter {
-        args: string[];
-        _args: { required:boolean; name: string; }[];
-
-        /**
-         * Add command `name`.
-         *
-         * The `.action()` callback is invoked when the
-         * command `name` is specified via __ARGV__,
-         * and the remaining arguments are applied to the
-         * function for access.
-         *
-         * When the `name` is "*" an un-matched command
-         * will be passed as the first arg, followed by
-         * the rest of __ARGV__ remaining.
-         *
-         * Examples:
-         *
-         *      program
-         *        .version('0.0.1')
-         *        .option('-C, --chdir <path>', 'change the working directory')
-         *        .option('-c, --config <path>', 'set config path. defaults to ./deploy.conf')
-         *        .option('-T, --no-tests', 'ignore test hook')
-         *
-         *      program
-         *        .command('setup')
-         *        .description('run remote setup commands')
-         *        .action(function(){
-         *          console.log('setup');
-         *        });
-         *
-         *      program
-         *        .command('exec <cmd>')
-         *        .description('run the given remote command')
-         *        .action(function(cmd){
-         *          console.log('exec "%s"', cmd);
-         *        });
-         *
-         *      program
-         *        .command('*')
-         *        .description('deploy the given env')
-         *        .action(function(env){
-         *          console.log('deploying "%s"', env);
-         *        });
-         *
-         *      program.parse(process.argv);
-         *
-         * @param {String} name
-         * @param {String} [desc]
-         * @param {Mixed} [opts]
-         * @return {Command} the new command
-         * @api public
-         */
-        command(name:string, desc?:string, opts?: any):ICommand;
-
-        /**
-         * Add an implicit `help [cmd]` subcommand
-         * which invokes `--help` for the given command.
-         *
-         * @api private
-         */
-        addImplicitHelpCommand():void;
-
-        /**
-         * Parse expected `args`.
-         *
-         * For example `["[type]"]` becomes `[{ required: false, name: 'type' }]`.
-         *
-         * @param {Array} args
-         * @return {Command} for chaining
-         * @api public
-         */
-        parseExpectedArgs(args:string[]):ICommand;
-
-        /**
-         * Register callback `fn` for the command.
-         *
-         * Examples:
-         *
-         *      program
-         *        .command('help')
-         *        .description('display verbose help')
-         *        .action(function(){
-         *           // output help here
-         *        });
-         *
-         * @param {Function} fn
-         * @return {Command} for chaining
-         * @api public
-         */
-        action(fn:(...args:any[])=>void):ICommand;
-
-        /**
-         * Define option with `flags`, `description` and optional
-         * coercion `fn`.
-         *
-         * The `flags` string should contain both the short and long flags,
-         * separated by comma, a pipe or space. The following are all valid
-         * all will output this way when `--help` is used.
-         *
-         *    "-p, --pepper"
-         *    "-p|--pepper"
-         *    "-p --pepper"
-         *
-         * Examples:
-         *
-         *     // simple boolean defaulting to false
-         *     program.option('-p, --pepper', 'add pepper');
-         *
-         *     --pepper
-         *     program.pepper
-         *     // => Boolean
-         *
-         *     // simple boolean defaulting to true
-         *     program.option('-C, --no-cheese', 'remove cheese');
-         *
-         *     program.cheese
-         *     // => true
-         *
-         *     --no-cheese
-         *     program.cheese
-         *     // => false
-         *
-         *     // required argument
-         *     program.option('-C, --chdir <path>', 'change the working directory');
-         *
-         *     --chdir /tmp
-         *     program.chdir
-         *     // => "/tmp"
-         *
-         *     // optional argument
-         *     program.option('-c, --cheese [type]', 'add cheese [marble]');
-         *
-         * @param {String} flags
-         * @param {String} description
-         * @param {Function|Mixed} fn or default
-         * @param {Mixed} defaultValue
-         * @return {Command} for chaining
-         * @api public
-         */
-        option(flags:string, description?:string, fn?:((arg1:any, arg2:any)=>void)|RegExp, defaultValue?:any):ICommand;
-        option(flags:string, description?:string, defaultValue?:any):ICommand;
-
-        /**
-         * Allow unknown options on the command line.
-         *
-         * @param {Boolean} arg if `true` or omitted, no error will be thrown
-         * for unknown options.
-         * @api public
-         */
-        allowUnknownOption(arg?: boolean):ICommand;
-
-        /**
-         * Parse `argv`, settings options and invoking commands when defined.
-         *
-         * @param {Array} argv
-         * @return {Command} for chaining
-         * @api public
-         */
-        parse(argv:string[]):ICommand;
-
-        /**
-         * Execute a sub-command executable.
-         *
-         * @param {Array} argv
-         * @param {Array} args
-         * @param {Array} unknown
-         * @api private
-         */
-        executeSubCommand(argv:string[], args:string[], unknown:string[]):any; /* child_process.ChildProcess */
-
-        /**
-         * Normalize `args`, splitting joined short flags. For example
-         * the arg "-abc" is equivalent to "-a -b -c".
-         * This also normalizes equal sign and splits "--abc=def" into "--abc def".
-         *
-         * @param {Array} args
-         * @return {Array}
-         * @api private
-         */
-        normalize(args:string[]):string[];
-
-        /**
-         * Parse command `args`.
-         *
-         * When listener(s) are available those
-         * callbacks are invoked, otherwise the "*"
-         * event is emitted and those actions are invoked.
-         *
-         * @param {Array} args
-         * @return {Command} for chaining
-         * @api private
-         */
-        parseArgs(args:string[], unknown:string[]):ICommand;
-
-        /**
-         * Return an option matching `arg` if any.
-         *
-         * @param {String} arg
-         * @return {Option}
-         * @api private
-         */
-        optionFor(arg:string):IOption;
-
-        /**
-         * Parse options from `argv` returning `argv`
-         * void of these options.
-         *
-         * @param {Array} argv
-         * @return {Array}
-         * @api public
-         */
-        parseOptions(argv:string[]): {args:string[]; unknown:string[];};
-
-        /**
-         * Return an object containing options as key-value pairs
-         *
-         * @return {Object}
-         * @api public
-         */
-        opts():any;
-
-        /**
-         * Argument `name` is missing.
-         *
-         * @param {String} name
-         * @api private
-         */
-        missingArgument(name:string):void;
-
-        /**
-         * `Option` is missing an argument, but received `flag` or nothing.
-         *
-         * @param {String} option
-         * @param {String} flag
-         * @api private
-         */
-        optionMissingArgument(option:{flags:string;}, flag?:string):void;
-
-        /**
-         * Unknown option `flag`.
-         *
-         * @param {String} flag
-         * @api private
-         */
-        unknownOption(flag:string):void;
-
-        /**
-         * Set the program version to `str`.
-         *
-         * This method auto-registers the "-V, --version" flag
-         * which will print the version number when passed.
-         *
-         * @param {String} str
-         * @param {String} flags
-         * @return {Command} for chaining
-         * @api public
-         */
-        version(str:string, flags?:string):ICommand;
-
-        /**
-         * Set the description to `str`.
-         *
-         * @param {String} str
-         * @return {String|Command}
-         * @api public
-         */
-        description(str:string):ICommand;
-        description():string;
-
-        /**
-         * Set an alias for the command
-         *
-         * @param {String} alias
-         * @return {String|Command}
-         * @api public
-         */
-        alias(alias:string):ICommand;
-        alias():string;
-
-        /**
-         * Set / get the command usage `str`.
-         *
-         * @param {String} str
-         * @return {String|Command}
-         * @api public
-         */
-        usage(str:string):ICommand;
-        usage():string;
-
-        /**
-         * Get the name of the command
-         *
-         * @param {String} name
-         * @return {String|Command}
-         * @api public
-         */
-        name():string;
-
-        /**
-         * Return the largest option length.
-         *
-         * @return {Number}
-         * @api private
-         */
-        largestOptionLength():number;
-
-        /**
-         * Return help for options.
-         *
-         * @return {String}
-         * @api private
-         */
-        optionHelp():string;
-
-        /**
-         * Return command help documentation.
-         *
-         * @return {String}
-         * @api private
-         */
-        commandHelp():string;
-
-        /**
-         * Return program help documentation.
-         *
-         * @return {String}
-         * @api private
-         */
-        helpInformation():string;
-
-        /**
-         * Output help information for this command
-         *
-         * @api public
-         */
-        outputHelp():void;
-
-        /**
-         * Output help information and exit.
-         *
-         * @api public
-         */
-        help():void;
-    }
-
-    interface IOptionStatic {
-        /**
-         * Initialize a new `Option` with the given `flags` and `description`.
-         *
-         * @param {String} flags
-         * @param {String} description
-         * @api public
-         */
-        new (flags:string, description?:string):IOption;
-    }
-
-    interface IOption {
-        flags:string;
-        required:boolean;
-        optional:boolean;
-        bool:boolean;
-        short?:string;
-        long:string;
-        description:string;
-
-        /**
-         * Return option name.
-         *
-         * @return {String}
-         * @api private
-         */
-        name():string;
-
-        /**
-         * Check if `arg` matches the short or long flag.
-         *
-         * @param {String} arg
-         * @return {Boolean}
-         * @api private
-         */
-        is(arg:string):boolean;
-    }
-
-    interface IExportedCommand extends ICommand {
-        Command: commander.ICommandStatic;
-        Option: commander.IOptionStatic;
-    }
-}
-
-declare module "commander" {
-    var _tmp:commander.IExportedCommand;
-    export = _tmp;
-}

+ 0 - 370
typings/browser/ambient/estree/index.d.ts

@@ -1,370 +0,0 @@
-// Generated by typings
-// Source: https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/master/estree/estree.d.ts
-// Type definitions for ESTree AST specification
-// Project: https://github.com/estree/estree
-// Definitions by: RReverser <https://github.com/RReverser>
-// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
-
-declare namespace ESTree {
-  interface Node {
-    type: string;
-    loc?: SourceLocation;
-    range?: [number, number];
-  }
-
-  interface SourceLocation {
-    source?: string;
-    start: Position;
-    end: Position;
-  }
-
-  interface Position {
-    line: number;
-    column: number;
-  }
-
-  interface Program extends Node {
-    body: Array<Statement | ModuleDeclaration>;
-    sourceType: string;
-  }
-
-  interface Function extends Node {
-    id?: Identifier;
-    params: Array<Pattern>;
-    body: BlockStatement | Expression;
-    generator: boolean;
-  }
-
-  interface Statement extends Node {}
-
-  interface EmptyStatement extends Statement {}
-
-  interface BlockStatement extends Statement {
-    body: Array<Statement>;
-  }
-
-  interface ExpressionStatement extends Statement {
-    expression: Expression;
-  }
-
-  interface IfStatement extends Statement {
-    test: Expression;
-    consequent: Statement;
-    alternate?: Statement;
-  }
-
-  interface LabeledStatement extends Statement {
-    label: Identifier;
-    body: Statement;
-  }
-
-  interface BreakStatement extends Statement {
-    label?: Identifier;
-  }
-
-  interface ContinueStatement extends Statement {
-    label?: Identifier;
-  }
-
-  interface WithStatement extends Statement {
-    object: Expression;
-    body: Statement;
-  }
-
-  interface SwitchStatement extends Statement {
-    discriminant: Expression;
-    cases: Array<SwitchCase>;
-  }
-
-  interface ReturnStatement extends Statement {
-    argument?: Expression;
-  }
-
-  interface ThrowStatement extends Statement {
-    argument: Expression;
-  }
-
-  interface TryStatement extends Statement {
-    block: BlockStatement;
-    handler?: CatchClause;
-    finalizer?: BlockStatement;
-  }
-
-  interface WhileStatement extends Statement {
-    test: Expression;
-    body: Statement;
-  }
-
-  interface DoWhileStatement extends Statement {
-    body: Statement;
-    test: Expression;
-  }
-
-  interface ForStatement extends Statement {
-    init?: VariableDeclaration | Expression;
-    test?: Expression;
-    update?: Expression;
-    body: Statement;
-  }
-
-  interface ForInStatement extends Statement {
-    left: VariableDeclaration | Expression;
-    right: Expression;
-    body: Statement;
-  }
-
-  interface DebuggerStatement extends Statement {}
-
-  interface Declaration extends Statement {}
-
-  interface FunctionDeclaration extends Function, Declaration {
-    id: Identifier;
-  }
-
-  interface VariableDeclaration extends Declaration {
-    declarations: Array<VariableDeclarator>;
-    kind: string;
-  }
-
-  interface VariableDeclarator extends Node {
-    id: Pattern;
-    init?: Expression;
-  }
-
-  interface Expression extends Node {}
-
-  interface ThisExpression extends Expression {}
-
-  interface ArrayExpression extends Expression {
-    elements: Array<Expression | SpreadElement>;
-  }
-
-  interface ObjectExpression extends Expression {
-    properties: Array<Property>;
-  }
-
-  interface Property extends Node {
-    key: Expression;
-    value: Expression;
-    kind: string;
-    method: boolean;
-    shorthand: boolean;
-    computed: boolean;
-  }
-
-  interface FunctionExpression extends Function, Expression {}
-
-  interface SequenceExpression extends Expression {
-    expressions: Array<Expression>;
-  }
-
-  interface UnaryExpression extends Expression {
-    operator: UnaryOperator;
-    prefix: boolean;
-    argument: Expression;
-  }
-
-  interface BinaryExpression extends Expression {
-    operator: BinaryOperator;
-    left: Expression;
-    right: Expression;
-  }
-
-  interface AssignmentExpression extends Expression {
-    operator: AssignmentOperator;
-    left: Pattern | MemberExpression;
-    right: Expression;
-  }
-
-  interface UpdateExpression extends Expression {
-    operator: UpdateOperator;
-    argument: Expression;
-    prefix: boolean;
-  }
-
-  interface LogicalExpression extends Expression {
-    operator: LogicalOperator;
-    left: Expression;
-    right: Expression;
-  }
-
-  interface ConditionalExpression extends Expression {
-    test: Expression;
-    alternate: Expression;
-    consequent: Expression;
-  }
-
-  interface CallExpression extends Expression {
-    callee: Expression | Super;
-    arguments: Array<Expression | SpreadElement>;
-  }
-
-  interface NewExpression extends CallExpression {}
-
-  interface MemberExpression extends Expression, Pattern {
-    object: Expression | Super;
-    property: Expression;
-    computed: boolean;
-  }
-
-  interface Pattern extends Node {}
-
-  interface SwitchCase extends Node {
-    test?: Expression;
-    consequent: Array<Statement>;
-  }
-
-  interface CatchClause extends Node {
-    param: Pattern;
-    body: BlockStatement;
-  }
-
-  interface Identifier extends Node, Expression, Pattern {
-    name: string;
-  }
-
-  interface Literal extends Node, Expression {
-    value?: string | boolean | number | RegExp;
-  }
-
-  interface RegExpLiteral extends Literal {
-    regex: {
-      pattern: string;
-      flags: string;
-    };
-  }
-
-  type UnaryOperator = string;
-
-  type BinaryOperator = string;
-
-  type LogicalOperator = string;
-
-  type AssignmentOperator = string;
-
-  type UpdateOperator = string;
-
-  interface ForOfStatement extends ForInStatement {}
-
-  interface Super extends Node {}
-
-  interface SpreadElement extends Node {
-    argument: Expression;
-  }
-
-  interface ArrowFunctionExpression extends Function, Expression {
-    expression: boolean;
-  }
-
-  interface YieldExpression extends Expression {
-    argument?: Expression;
-    delegate: boolean;
-  }
-
-  interface TemplateLiteral extends Expression {
-    quasis: Array<TemplateElement>;
-    expressions: Array<Expression>;
-  }
-
-  interface TaggedTemplateExpression extends Expression {
-    tag: Expression;
-    quasi: TemplateLiteral;
-  }
-
-  interface TemplateElement extends Node {
-    tail: boolean;
-    value: {
-      cooked: string;
-      raw: string;
-    };
-  }
-
-  interface AssignmentProperty extends Property {
-    value: Pattern;
-    kind: string;
-    method: boolean;
-  }
-
-  interface ObjectPattern extends Pattern {
-    properties: Array<AssignmentProperty>;
-  }
-
-  interface ArrayPattern extends Pattern {
-    elements: Array<Pattern>;
-  }
-
-  interface RestElement extends Pattern {
-    argument: Pattern;
-  }
-
-  interface AssignmentPattern extends Pattern {
-    left: Pattern;
-    right: Expression;
-  }
-
-  interface Class extends Node {
-    id?: Identifier;
-    superClass: Expression;
-    body: ClassBody;
-  }
-
-  interface ClassBody extends Node {
-    body: Array<MethodDefinition>;
-  }
-
-  interface MethodDefinition extends Node {
-    key: Expression;
-    value: FunctionExpression;
-    kind: string;
-    computed: boolean;
-    static: boolean;
-  }
-
-  interface ClassDeclaration extends Class, Declaration {
-    id: Identifier;
-  }
-
-  interface ClassExpression extends Class, Expression {}
-
-  interface MetaProperty extends Expression {
-    meta: Identifier;
-    property: Identifier;
-  }
-
-  interface ModuleDeclaration extends Node {}
-
-  interface ModuleSpecifier extends Node {
-    local: Identifier;
-  }
-
-  interface ImportDeclaration extends ModuleDeclaration {
-    specifiers: Array<ImportSpecifier | ImportDefaultSpecifier | ImportNamespaceSpecifier>;
-    source: Literal;
-  }
-
-  interface ImportSpecifier extends ModuleSpecifier {
-    imported: Identifier;
-  }
-
-  interface ImportDefaultSpecifier extends ModuleSpecifier {}
-
-  interface ImportNamespaceSpecifier extends ModuleSpecifier {}
-
-  interface ExportNamedDeclaration extends ModuleDeclaration {
-    declaration?: Declaration;
-    specifiers: Array<ExportSpecifier>;
-    source?: Literal;
-  }
-
-  interface ExportSpecifier extends ModuleSpecifier {
-    exported: Identifier;
-  }
-
-  interface ExportDefaultDeclaration extends ModuleDeclaration {
-    declaration: Declaration | Expression;
-  }
-
-  interface ExportAllDeclaration extends ModuleDeclaration {
-    source: Literal;
-  }
-}

+ 0 - 11
typings/main/ambient/chai/index.d.ts → typings/globals/chai/index.d.ts

@@ -1,16 +1,5 @@
 // Generated by typings
 // Generated by typings
 // Source: https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/master/chai/chai.d.ts
 // Source: https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/master/chai/chai.d.ts
-// Type definitions for chai 3.4.0
-// Project: http://chaijs.com/
-// Definitions by: Jed Mao <https://github.com/jedmao/>,
-//                 Bart van der Schoor <https://github.com/Bartvds>,
-//                 Andrew Brown <https://github.com/AGBrown>,
-//                 Olivier Chevet <https://github.com/olivr70>,
-//                 Matt Wistrand <https://github.com/mwistrand>
-// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
-
-// <reference path="../assertion-error/assertion-error.d.ts"/>
-
 declare namespace Chai {
 declare namespace Chai {
 
 
     interface ChaiStatic {
     interface ChaiStatic {

+ 8 - 0
typings/globals/chai/typings.json

@@ -0,0 +1,8 @@
+{
+  "resolution": "main",
+  "tree": {
+    "src": "https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/master/chai/chai.d.ts",
+    "raw": "github:DefinitelyTyped/DefinitelyTyped/chai/chai.d.ts",
+    "typings": "https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/master/chai/chai.d.ts"
+  }
+}

+ 0 - 5
typings/main/ambient/chance/index.d.ts → typings/globals/chance/index.d.ts

@@ -1,10 +1,5 @@
 // Generated by typings
 // Generated by typings
 // Source: https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/master/chance/chance.d.ts
 // Source: https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/master/chance/chance.d.ts
-// Type definitions for Chance 0.7.3
-// Project: http://chancejs.com
-// Definitions by: Chris Bowdon <https://github.com/cbowdon/>
-// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
-
 declare namespace Chance {
 declare namespace Chance {
 
 
     interface ChanceStatic {
     interface ChanceStatic {

+ 8 - 0
typings/globals/chance/typings.json

@@ -0,0 +1,8 @@
+{
+  "resolution": "main",
+  "tree": {
+    "src": "https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/master/chance/chance.d.ts",
+    "raw": "github:DefinitelyTyped/DefinitelyTyped/chance/chance.d.ts",
+    "typings": "https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/master/chance/chance.d.ts"
+  }
+}

+ 0 - 6
typings/main/ambient/commander/index.d.ts → typings/globals/commander/index.d.ts

@@ -1,11 +1,5 @@
 // Generated by typings
 // Generated by typings
 // Source: https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/master/commander/commander.d.ts
 // Source: https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/master/commander/commander.d.ts
-// Type definitions for commanderjs 2.3.0
-// Project: https://github.com/visionmedia/commander.js
-// Definitions by: Marcelo Dezem <http://github.com/mdezem>, vvakame <http://github.com/vvakame>
-// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
-
-
 declare namespace commander {
 declare namespace commander {
     interface ICommandStatic {
     interface ICommandStatic {
         /**
         /**

+ 8 - 0
typings/globals/commander/typings.json

@@ -0,0 +1,8 @@
+{
+  "resolution": "main",
+  "tree": {
+    "src": "https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/master/commander/commander.d.ts",
+    "raw": "github:DefinitelyTyped/DefinitelyTyped/commander/commander.d.ts",
+    "typings": "https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/master/commander/commander.d.ts"
+  }
+}

+ 0 - 5
typings/browser/ambient/escodegen/index.d.ts → typings/globals/escodegen/index.d.ts

@@ -1,10 +1,5 @@
 // Generated by typings
 // Generated by typings
 // Source: https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/master/escodegen/escodegen.d.ts
 // Source: https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/master/escodegen/escodegen.d.ts
-// Type definitions for escodegen
-// Project: https://github.com/estools/escodegen
-// Definitions by: Simon de Lang <https://github.com/simondel>
-// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
-
 declare module 'escodegen' {
 declare module 'escodegen' {
 
 
   export interface FormatOptions {
   export interface FormatOptions {

+ 8 - 0
typings/globals/escodegen/typings.json

@@ -0,0 +1,8 @@
+{
+  "resolution": "main",
+  "tree": {
+    "src": "https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/master/escodegen/escodegen.d.ts",
+    "raw": "github:DefinitelyTyped/DefinitelyTyped/escodegen/escodegen.d.ts",
+    "typings": "https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/master/escodegen/escodegen.d.ts"
+  }
+}

+ 0 - 6
typings/browser/ambient/esprima/index.d.ts → typings/globals/esprima/index.d.ts

@@ -1,11 +1,5 @@
 // Generated by typings
 // Generated by typings
 // Source: https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/master/esprima/esprima.d.ts
 // Source: https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/master/esprima/esprima.d.ts
-// Type definitions for Esprima v2.1.0
-// Project: http://esprima.org
-// Definitions by: teppeis <https://github.com/teppeis>, RReverser <https://github.com/RReverser>
-// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
-
-
 declare namespace esprima {
 declare namespace esprima {
 
 
     const version: string;
     const version: string;

+ 8 - 0
typings/globals/esprima/typings.json

@@ -0,0 +1,8 @@
+{
+  "resolution": "main",
+  "tree": {
+    "src": "https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/master/esprima/esprima.d.ts",
+    "raw": "github:DefinitelyTyped/DefinitelyTyped/esprima/esprima.d.ts",
+    "typings": "https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/master/esprima/esprima.d.ts"
+  }
+}

+ 0 - 5
typings/browser/ambient/estraverse/index.d.ts → typings/globals/estraverse/index.d.ts

@@ -1,10 +1,5 @@
 // Generated by typings
 // Generated by typings
 // Source: https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/master/estraverse/estraverse.d.ts
 // Source: https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/master/estraverse/estraverse.d.ts
-// Type definitions for estraverse
-// Project: https://github.com/estools/estraverse
-// Definitions by: Sanex3339 <https://github.com/sanex3339>
-// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
-
 declare module 'estraverse' {
 declare module 'estraverse' {
     export interface Visitor {
     export interface Visitor {
         enter?: (node: any, parentNode: any) => any;
         enter?: (node: any, parentNode: any) => any;

+ 8 - 0
typings/globals/estraverse/typings.json

@@ -0,0 +1,8 @@
+{
+  "resolution": "main",
+  "tree": {
+    "src": "https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/master/estraverse/estraverse.d.ts",
+    "raw": "github:DefinitelyTyped/DefinitelyTyped/estraverse/estraverse.d.ts",
+    "typings": "https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/master/estraverse/estraverse.d.ts"
+  }
+}

+ 0 - 5
typings/main/ambient/estree/index.d.ts → typings/globals/estree/index.d.ts

@@ -1,10 +1,5 @@
 // Generated by typings
 // Generated by typings
 // Source: https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/master/estree/estree.d.ts
 // Source: https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/master/estree/estree.d.ts
-// Type definitions for ESTree AST specification
-// Project: https://github.com/estree/estree
-// Definitions by: RReverser <https://github.com/RReverser>
-// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
-
 declare namespace ESTree {
 declare namespace ESTree {
   interface Node {
   interface Node {
     type: string;
     type: string;

+ 8 - 0
typings/globals/estree/typings.json

@@ -0,0 +1,8 @@
+{
+  "resolution": "main",
+  "tree": {
+    "src": "https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/master/estree/estree.d.ts",
+    "raw": "github:DefinitelyTyped/DefinitelyTyped/estree/estree.d.ts",
+    "typings": "https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/master/estree/estree.d.ts"
+  }
+}

+ 0 - 5
typings/browser/ambient/mkdirp/index.d.ts → typings/globals/mkdirp/index.d.ts

@@ -1,10 +1,5 @@
 // Generated by typings
 // Generated by typings
 // Source: https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/master/mkdirp/mkdirp.d.ts
 // Source: https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/master/mkdirp/mkdirp.d.ts
-// Type definitions for mkdirp 0.3.0
-// Project: http://github.com/substack/node-mkdirp
-// Definitions by: Bart van der Schoor <https://github.com/Bartvds>
-// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
-
 declare module 'mkdirp' {
 declare module 'mkdirp' {
 
 
 	function mkdirp(dir: string, cb: (err: any, made: string) => void): void;
 	function mkdirp(dir: string, cb: (err: any, made: string) => void): void;

+ 8 - 0
typings/globals/mkdirp/typings.json

@@ -0,0 +1,8 @@
+{
+  "resolution": "main",
+  "tree": {
+    "src": "https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/master/mkdirp/mkdirp.d.ts",
+    "raw": "github:DefinitelyTyped/DefinitelyTyped/mkdirp/mkdirp.d.ts",
+    "typings": "https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/master/mkdirp/mkdirp.d.ts"
+  }
+}

+ 0 - 5
typings/browser/ambient/mocha/index.d.ts → typings/globals/mocha/index.d.ts

@@ -1,10 +1,5 @@
 // Generated by typings
 // Generated by typings
 // Source: https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/master/mocha/mocha.d.ts
 // Source: https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/master/mocha/mocha.d.ts
-// Type definitions for mocha 2.2.5
-// Project: http://mochajs.org/
-// Definitions by: Kazi Manzur Rashid <https://github.com/kazimanzurrashid/>, otiai10 <https://github.com/otiai10>, jt000 <https://github.com/jt000>, Vadim Macagon <https://github.com/enlight>
-// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
-
 interface MochaSetupOptions {
 interface MochaSetupOptions {
     //milliseconds to wait before considering a test slow
     //milliseconds to wait before considering a test slow
     slow?: number;
     slow?: number;

+ 8 - 0
typings/globals/mocha/typings.json

@@ -0,0 +1,8 @@
+{
+  "resolution": "main",
+  "tree": {
+    "src": "https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/master/mocha/mocha.d.ts",
+    "raw": "github:DefinitelyTyped/DefinitelyTyped/mocha/mocha.d.ts",
+    "typings": "https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/master/mocha/mocha.d.ts"
+  }
+}

+ 0 - 11
typings/browser/ambient/node/index.d.ts → typings/globals/node/index.d.ts

@@ -1,16 +1,5 @@
 // Generated by typings
 // Generated by typings
 // Source: https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/master/node/node.d.ts
 // Source: https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/master/node/node.d.ts
-// Type definitions for Node.js v6.x
-// Project: http://nodejs.org/
-// Definitions by: Microsoft TypeScript <http://typescriptlang.org>, DefinitelyTyped <https://github.com/DefinitelyTyped/DefinitelyTyped>
-// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
-
-/************************************************
-*                                               *
-*               Node.js v6.x API                *
-*                                               *
-************************************************/
-
 interface Error {
 interface Error {
     stack?: string;
     stack?: string;
 }
 }

+ 8 - 0
typings/globals/node/typings.json

@@ -0,0 +1,8 @@
+{
+  "resolution": "main",
+  "tree": {
+    "src": "https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/master/node/node.d.ts",
+    "raw": "github:DefinitelyTyped/DefinitelyTyped/node/node.d.ts",
+    "typings": "https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/master/node/node.d.ts"
+  }
+}

+ 432 - 0
typings/globals/sinon/index.d.ts

@@ -0,0 +1,432 @@
+// Generated by typings
+// Source: https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/master/sinon/sinon.d.ts
+declare namespace Sinon {
+    interface SinonSpyCallApi {
+        // Properties
+        thisValue: any;
+        args: any[];
+        exception: any;
+        returnValue: any;
+
+        // Methods
+        calledOn(obj: any): boolean;
+        calledWith(...args: any[]): boolean;
+        calledWithExactly(...args: any[]): boolean;
+        calledWithMatch(...args: any[]): boolean;
+        notCalledWith(...args: any[]): boolean;
+        notCalledWithMatch(...args: any[]): boolean;
+        returned(value: any): boolean;
+        threw(): boolean;
+        threw(type: string): boolean;
+        threw(obj: any): boolean;
+        callArg(pos: number): void;
+        callArgOn(pos: number, obj: any, ...args: any[]): void;
+        callArgWith(pos: number, ...args: any[]): void;
+        callArgOnWith(pos: number, obj: any, ...args: any[]): void;
+        yield(...args: any[]): void;
+        yieldOn(obj: any, ...args: any[]): void;
+        yieldTo(property: string, ...args: any[]): void;
+        yieldToOn(property: string, obj: any, ...args: any[]): void;
+    }
+
+    interface SinonSpyCall extends SinonSpyCallApi {
+        calledBefore(call: SinonSpyCall): boolean;
+        calledAfter(call: SinonSpyCall): boolean;
+        calledWithNew(call: SinonSpyCall): boolean;
+    }
+
+    interface SinonSpy extends SinonSpyCallApi {
+        // Properties
+        callCount: number;
+        called: boolean;
+        notCalled: boolean;
+        calledOnce: boolean;
+        calledTwice: boolean;
+        calledThrice: boolean;
+        firstCall: SinonSpyCall;
+        secondCall: SinonSpyCall;
+        thirdCall: SinonSpyCall;
+        lastCall: SinonSpyCall;
+        thisValues: any[];
+        args: any[][];
+        exceptions: any[];
+        returnValues: any[];
+
+        // Methods
+        (...args: any[]): any;
+        calledBefore(anotherSpy: SinonSpy): boolean;
+        calledAfter(anotherSpy: SinonSpy): boolean;
+        calledWithNew(): boolean;
+        withArgs(...args: any[]): SinonSpy;
+        alwaysCalledOn(obj: any): boolean;
+        alwaysCalledWith(...args: any[]): boolean;
+        alwaysCalledWithExactly(...args: any[]): boolean;
+        alwaysCalledWithMatch(...args: any[]): boolean;
+        neverCalledWith(...args: any[]): boolean;
+        neverCalledWithMatch(...args: any[]): boolean;
+        alwaysThrew(): boolean;
+        alwaysThrew(type: string): boolean;
+        alwaysThrew(obj: any): boolean;
+        alwaysReturned(): boolean;
+        invokeCallback(...args: any[]): void;
+        getCall(n: number): SinonSpyCall;
+        reset(): void;
+        printf(format: string, ...args: any[]): string;
+        restore(): void;
+    }
+
+    interface SinonSpyStatic {
+        (): SinonSpy;
+        (func: any): SinonSpy;
+        (obj: any, method: string): SinonSpy;
+    }
+
+    interface SinonStatic {
+        spy: SinonSpyStatic;
+    }
+
+    interface SinonStub extends SinonSpy {
+        resetBehavior(): void;
+        returns(obj: any): SinonStub;
+        returnsArg(index: number): SinonStub;
+        returnsThis(): SinonStub;
+        throws(type?: string): SinonStub;
+        throws(obj: any): SinonStub;
+        callsArg(index: number): SinonStub;
+        callsArgOn(index: number, context: any): SinonStub;
+        callsArgWith(index: number, ...args: any[]): SinonStub;
+        callsArgOnWith(index: number, context: any, ...args: any[]): SinonStub;
+        callsArgAsync(index: number): SinonStub;
+        callsArgOnAsync(index: number, context: any): SinonStub;
+        callsArgWithAsync(index: number, ...args: any[]): SinonStub;
+        callsArgOnWithAsync(index: number, context: any, ...args: any[]): SinonStub;
+        onCall(n: number): SinonStub;
+        onFirstCall(): SinonStub;
+        onSecondCall(): SinonStub;
+        onThirdCall(): SinonStub;
+        yields(...args: any[]): SinonStub;
+        yieldsOn(context: any, ...args: any[]): SinonStub;
+        yieldsTo(property: string, ...args: any[]): SinonStub;
+        yieldsToOn(property: string, context: any, ...args: any[]): SinonStub;
+        yieldsAsync(...args: any[]): SinonStub;
+        yieldsOnAsync(context: any, ...args: any[]): SinonStub;
+        yieldsToAsync(property: string, ...args: any[]): SinonStub;
+        yieldsToOnAsync(property: string, context: any, ...args: any[]): SinonStub;
+        withArgs(...args: any[]): SinonStub;
+    }
+
+    interface SinonStubStatic {
+        (): SinonStub;
+        (obj: any): SinonStub;
+        (obj: any, method: string): SinonStub;
+        (obj: any, method: string, func: any): SinonStub;
+    }
+
+    interface SinonStatic {
+        stub: SinonStubStatic;
+    }
+
+    interface SinonExpectation extends SinonStub {
+        atLeast(n: number): SinonExpectation;
+        atMost(n: number): SinonExpectation;
+        never(): SinonExpectation;
+        once(): SinonExpectation;
+        twice(): SinonExpectation;
+        thrice(): SinonExpectation;
+        exactly(n: number): SinonExpectation;
+        withArgs(...args: any[]): SinonExpectation;
+        withExactArgs(...args: any[]): SinonExpectation;
+        on(obj: any): SinonExpectation;
+        verify(): SinonExpectation;
+        restore(): void;
+    }
+
+    interface SinonExpectationStatic {
+        create(methodName?: string): SinonExpectation;
+    }
+
+    interface SinonMock {
+        expects(method: string): SinonExpectation;
+        restore(): void;
+        verify(): void;
+    }
+
+    interface SinonMockStatic {
+        (): SinonExpectation;
+        (obj: any): SinonMock;
+    }
+
+    interface SinonStatic {
+        expectation: SinonExpectationStatic;
+        mock: SinonMockStatic;
+    }
+
+    interface SinonFakeTimers {
+        now: number;
+        create(now: number): SinonFakeTimers;
+        setTimeout(callback: (...args: any[]) => void, timeout: number, ...args: any[]): number;
+        clearTimeout(id: number): void;
+        setInterval(callback: (...args: any[]) => void, timeout: number, ...args: any[]): number;
+        clearInterval(id: number): void;
+        tick(ms: number): number;
+        reset(): void;
+        Date(): Date;
+        Date(year: number): Date;
+        Date(year: number, month: number): Date;
+        Date(year: number, month: number, day: number): Date;
+        Date(year: number, month: number, day: number, hour: number): Date;
+        Date(year: number, month: number, day: number, hour: number, minute: number): Date;
+        Date(year: number, month: number, day: number, hour: number, minute: number, second: number): Date;
+        Date(year: number, month: number, day: number, hour: number, minute: number, second: number, ms: number): Date;
+        restore(): void;
+
+		/**
+		 * Simulate the user changing the system clock while your program is running. It changes the 'now' timestamp
+		 * without affecting timers, intervals or immediates.
+		 * @param now The new 'now' in unix milliseconds
+		 */
+		setSystemTime(now: number): void;
+		/**
+		 * Simulate the user changing the system clock while your program is running. It changes the 'now' timestamp
+		 * without affecting timers, intervals or immediates.
+		 * @param now The new 'now' as a JavaScript Date
+		 */
+		setSystemTime(date: Date): void;
+	}
+
+    interface SinonFakeTimersStatic {
+        (): SinonFakeTimers;
+        (...timers: string[]): SinonFakeTimers;
+        (now: number, ...timers: string[]): SinonFakeTimers;
+    }
+
+    interface SinonStatic {
+        useFakeTimers: SinonFakeTimersStatic;
+        clock: SinonFakeTimers;
+    }
+
+    interface SinonFakeUploadProgress {
+        eventListeners: {
+            progress: any[];
+            load: any[];
+            abort: any[];
+            error: any[];
+        };
+
+        addEventListener(event: string, listener: (e: Event) => any): void;
+        removeEventListener(event: string, listener: (e: Event) => any): void;
+        dispatchEvent(event: Event): void;
+    }
+
+    interface SinonFakeXMLHttpRequest {
+        // Properties
+        onCreate: (xhr: SinonFakeXMLHttpRequest) => void;
+        url: string;
+        method: string;
+        requestHeaders: any;
+        requestBody: string;
+        status: number;
+        statusText: string;
+        async: boolean;
+        username: string;
+        password: string;
+        withCredentials: boolean;
+        upload: SinonFakeUploadProgress;
+        responseXML: Document;
+        getResponseHeader(header: string): string;
+        getAllResponseHeaders(): any;
+
+        // Methods
+        restore(): void;
+        useFilters: boolean;
+        addFilter(filter: (method: string, url: string, async: boolean, username: string, password: string) => boolean): void;
+        setResponseHeaders(headers: any): void;
+        setResponseBody(body: string): void;
+        respond(status: number, headers: any, body: string): void;
+        autoRespond(ms: number): void;
+    }
+
+    interface SinonFakeXMLHttpRequestStatic {
+        (): SinonFakeXMLHttpRequest;
+    }
+
+    interface SinonStatic {
+        useFakeXMLHttpRequest: SinonFakeXMLHttpRequestStatic;
+        FakeXMLHttpRequest: SinonFakeXMLHttpRequest;
+    }
+
+    interface SinonFakeServer {
+        // Properties
+        autoRespond: boolean;
+        autoRespondAfter: number;
+        fakeHTTPMethods: boolean;
+        getHTTPMethod: (request: SinonFakeXMLHttpRequest) => string;
+        requests: SinonFakeXMLHttpRequest[];
+        respondImmediately: boolean;
+
+        // Methods
+        respondWith(body: string): void;
+        respondWith(response: any[]): void;
+        respondWith(fn: (xhr: SinonFakeXMLHttpRequest) => void): void;
+        respondWith(url: string, body: string): void;
+        respondWith(url: string, response: any[]): void;
+        respondWith(url: string, fn: (xhr: SinonFakeXMLHttpRequest) => void): void;
+        respondWith(method: string, url: string, body: string): void;
+        respondWith(method: string, url: string, response: any[]): void;
+        respondWith(method: string, url: string, fn: (xhr: SinonFakeXMLHttpRequest) => void): void;
+        respondWith(url: RegExp, body: string): void;
+        respondWith(url: RegExp, response: any[]): void;
+        respondWith(url: RegExp, fn: (xhr: SinonFakeXMLHttpRequest) => void): void;
+        respondWith(method: string, url: RegExp, body: string): void;
+        respondWith(method: string, url: RegExp, response: any[]): void;
+        respondWith(method: string, url: RegExp, fn: (xhr: SinonFakeXMLHttpRequest) => void): void;
+        respond(): void;
+        restore(): void;
+    }
+
+    interface SinonFakeServerStatic {
+        create(): SinonFakeServer;
+    }
+
+    interface SinonStatic {
+        fakeServer: SinonFakeServerStatic;
+        fakeServerWithClock: SinonFakeServerStatic;
+    }
+
+    interface SinonExposeOptions {
+        prefix?: string;
+        includeFail?: boolean;
+    }
+
+    interface SinonAssert {
+        // Properties
+        failException: string;
+        fail: (message?: string) => void; // Overridable
+        pass: (assertion: any) => void; // Overridable
+
+        // Methods
+        notCalled(spy: SinonSpy): void;
+        called(spy: SinonSpy): void;
+        calledOnce(spy: SinonSpy): void;
+        calledTwice(spy: SinonSpy): void;
+        calledThrice(spy: SinonSpy): void;
+        callCount(spy: SinonSpy, count: number): void;
+        callOrder(...spies: SinonSpy[]): void;
+        calledOn(spy: SinonSpy, obj: any): void;
+        alwaysCalledOn(spy: SinonSpy, obj: any): void;
+        calledWith(spy: SinonSpy, ...args: any[]): void;
+        alwaysCalledWith(spy: SinonSpy, ...args: any[]): void;
+        neverCalledWith(spy: SinonSpy, ...args: any[]): void;
+        calledWithExactly(spy: SinonSpy, ...args: any[]): void;
+        alwaysCalledWithExactly(spy: SinonSpy, ...args: any[]): void;
+        calledWithMatch(spy: SinonSpy, ...args: any[]): void;
+        alwaysCalledWithMatch(spy: SinonSpy, ...args: any[]): void;
+        neverCalledWithMatch(spy: SinonSpy, ...args: any[]): void;
+        threw(spy: SinonSpy): void;
+        threw(spy: SinonSpy, exception: string): void;
+        threw(spy: SinonSpy, exception: any): void;
+        alwaysThrew(spy: SinonSpy): void;
+        alwaysThrew(spy: SinonSpy, exception: string): void;
+        alwaysThrew(spy: SinonSpy, exception: any): void;
+        expose(obj: any, options?: SinonExposeOptions): void;
+    }
+
+    interface SinonStatic {
+        assert: SinonAssert;
+    }
+
+    interface SinonMatcher {
+        and(expr: SinonMatcher): SinonMatcher;
+        or(expr: SinonMatcher): SinonMatcher;
+    }
+
+    interface SinonMatch {
+        (value: number): SinonMatcher;
+        (value: string): SinonMatcher;
+        (expr: RegExp): SinonMatcher;
+        (obj: any): SinonMatcher;
+        (callback: (value: any) => boolean): SinonMatcher;
+        any: SinonMatcher;
+        defined: SinonMatcher;
+        truthy: SinonMatcher;
+        falsy: SinonMatcher;
+        bool: SinonMatcher;
+        number: SinonMatcher;
+        string: SinonMatcher;
+        object: SinonMatcher;
+        func: SinonMatcher;
+        array: SinonMatcher;
+        regexp: SinonMatcher;
+        date: SinonMatcher;
+        same(obj: any): SinonMatcher;
+        typeOf(type: string): SinonMatcher;
+        instanceOf(type: any): SinonMatcher;
+        has(property: string, expect?: any): SinonMatcher;
+        hasOwn(property: string, expect?: any): SinonMatcher;
+    }
+
+    interface SinonStatic {
+        match: SinonMatch;
+    }
+
+    interface SinonSandboxConfig {
+        injectInto?: any;
+        properties?: string[];
+        useFakeTimers?: any;
+        useFakeServer?: any;
+    }
+
+    interface SinonSandbox {
+        clock: SinonFakeTimers;
+        requests: SinonFakeXMLHttpRequest;
+        server: SinonFakeServer;
+        spy: SinonSpyStatic;
+        stub: SinonStubStatic;
+        mock: SinonMockStatic;
+        useFakeTimers: SinonFakeTimersStatic;
+        useFakeXMLHttpRequest: SinonFakeXMLHttpRequestStatic;
+        useFakeServer(): SinonFakeServer;
+        restore(): void;
+    }
+
+    interface SinonSandboxStatic {
+        create(): SinonSandbox;
+        create(config: SinonSandboxConfig): SinonSandbox;
+    }
+
+    interface SinonStatic {
+        sandbox: SinonSandboxStatic;
+    }
+
+    interface SinonTestConfig {
+        injectIntoThis?: boolean;
+        injectInto?: any;
+        properties?: string[];
+        useFakeTimers?: boolean;
+        useFakeServer?: boolean;
+    }
+
+    interface SinonTestWrapper extends SinonSandbox {
+        (...args: any[]): any;
+    }
+
+    interface SinonStatic {
+        config: SinonTestConfig;
+        test(fn: (...args: any[]) => any): SinonTestWrapper;
+        testCase(tests: any): any;
+    }
+
+    // Utility overridables
+    interface SinonStatic {
+        createStubInstance(constructor: any): SinonStub;
+        format(obj: any): string;
+        log(message: string): void;
+        restore(object: any): void;
+    }
+}
+
+declare var sinon: Sinon.SinonStatic;
+
+declare module "sinon" {
+    export = sinon;
+}

+ 8 - 0
typings/globals/sinon/typings.json

@@ -0,0 +1,8 @@
+{
+  "resolution": "main",
+  "tree": {
+    "src": "https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/master/sinon/sinon.d.ts",
+    "raw": "github:DefinitelyTyped/DefinitelyTyped/sinon/sinon.d.ts",
+    "typings": "https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/master/sinon/sinon.d.ts"
+  }
+}

+ 11 - 0
typings/index.d.ts

@@ -0,0 +1,11 @@
+/// <reference path="globals/chai/index.d.ts" />
+/// <reference path="globals/chance/index.d.ts" />
+/// <reference path="globals/commander/index.d.ts" />
+/// <reference path="globals/escodegen/index.d.ts" />
+/// <reference path="globals/esprima/index.d.ts" />
+/// <reference path="globals/estraverse/index.d.ts" />
+/// <reference path="globals/estree/index.d.ts" />
+/// <reference path="globals/mkdirp/index.d.ts" />
+/// <reference path="globals/mocha/index.d.ts" />
+/// <reference path="globals/node/index.d.ts" />
+/// <reference path="globals/sinon/index.d.ts" />

+ 0 - 10
typings/main.d.ts

@@ -1,10 +0,0 @@
-/// <reference path="main/ambient/chai/index.d.ts" />
-/// <reference path="main/ambient/chance/index.d.ts" />
-/// <reference path="main/ambient/commander/index.d.ts" />
-/// <reference path="main/ambient/escodegen/index.d.ts" />
-/// <reference path="main/ambient/esprima/index.d.ts" />
-/// <reference path="main/ambient/estraverse/index.d.ts" />
-/// <reference path="main/ambient/estree/index.d.ts" />
-/// <reference path="main/ambient/mkdirp/index.d.ts" />
-/// <reference path="main/ambient/mocha/index.d.ts" />
-/// <reference path="main/ambient/node/index.d.ts" />

+ 0 - 180
typings/main/ambient/escodegen/index.d.ts

@@ -1,180 +0,0 @@
-// Generated by typings
-// Source: https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/master/escodegen/escodegen.d.ts
-// Type definitions for escodegen
-// Project: https://github.com/estools/escodegen
-// Definitions by: Simon de Lang <https://github.com/simondel>
-// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
-
-declare module 'escodegen' {
-
-  export interface FormatOptions {
-    /**
-     * The indent options
-     */
-    indent?: IndentOptions;
-    /**
-     * New line string. Default is '\n'.
-     */
-    newline?: string;
-    /**
-     * White space string. Default is standard ' ' (\x20).
-     */
-    space?: string;
-    /**
-     * Enforce JSON format of numeric and string literals. This option takes precedence over option.format.hexadecimal and option.format.quotes. Default is false.
-     */
-    json?: boolean;
-    /**
-     * Try to generate shorter numeric literals than toString() (9.8.1). Default is false.
-     */
-    renumber?: boolean;
-    /**
-     * Generate hexadecimal a numeric literal if it is shorter than its equivalents. Requires option.format.renumber. Default is false.
-     */
-    hexadecimal?: boolean;
-    /**
-     * Delimiter to use for string literals. Accepted values are: 'single', 'double', and 'auto'. When 'auto' is specified, escodegen selects a delimiter that results in a shorter literal. Default is 'single'.
-     */
-    quotes?: string;
-    /**
-     * Escape as few characters in string literals as necessary. Default is false.
-     */
-    escapeless?: boolean;
-    /**
-     * Do not include superfluous whitespace characters and line terminators. Default is false.
-     */
-    compact?: boolean;
-    /**
-     * Preserve parentheses in new expressions that have no arguments. Default is true.
-     */
-    parentheses?: boolean;
-    /**
-     * Preserve semicolons at the end of blocks and programs. Default is true.
-     */
-    semicolons?: boolean;
-    safeConcatenation?: boolean;
-    preserveBlankLines?: boolean;
-  }
-
-  export interface IndentOptions {
-    /**
-     * Indent string. Default is 4 spaces ('    ').
-     */
-    style?: string;
-    /**
-     * Base indent level. Default is 0.
-     */
-    base?: number;
-    /**
-     * Adjust the indentation of multiline comments to keep asterisks vertically aligned. Default is false.
-     */
-    adjustMultilineComment?: boolean;
-  }
-
-  export interface MozillaOptions {
-    /**
-     * Default: false
-     */
-    starlessGenerator?: boolean;
-    /**
-     * Default: false
-     */
-    parenthesizedComprehensionBlock?: boolean;
-    /**
-     * Default: false
-     */
-    comprehensionExpressionStartsWithAssignment?: boolean;
-  }
-
-  export interface GenerateOptions {
-    /**
-     * The format options
-     */
-    format?: FormatOptions;
-    moz?: MozillaOptions;
-    /**
-     * Mozilla Parser API compatible parse function, e.g., the parse function exported by esprima. If it is provided, generator tries to use the 'raw' representation. See esprima raw information. Default is null.
-     */
-    parse?: Function;
-    /**
-     * If comments are attached to AST, escodegen is going to emit comments to output code. Default is false.
-     */
-    comment?: boolean;
-    /**
-     * sourceMap is the source maps's source filename, that's a name that will show up in the browser debugger for the generated source (if source-maps is enabled).
-     * If a non-empty string value is provided, generate a source map.
-     */
-    sourceMap?: string;
-    /**
-     * . If sourceMapWithCode is true generator returns output hash, where output.map is a source-map representation, which can be serialized as output.map.toString(). output.code is a string with generated JS code (note that it's not going to have //@ sourceMappingURL comment in it).
-     */
-    sourceMapWithCode?: boolean;
-    /**
-     * Optionally option.sourceContent string can be passed (which represents original source of the file, for example it could be a source of coffeescript from which JS is being generated), if provided generated source map will have original source embedded in it.
-     */
-    sourceContent?: string;
-    sourceCode?: string;
-    /**
-     * Optionally option.sourceMapRoot can be provided, in which case option.sourceMap will be treated as relative to it. For more information about source map itself, see source map library document, V3 draft and HTML5Rocks introduction. Default is undefined
-     * sourceMapRoot is the source root for the source map (see the Mozilla documentation). If sourceMapWithCode is truthy, an object is returned from generate() of the form: { code: .. , map: .. }. If file is provided, it will be used as file property of generated source map.
-     */
-    sourceMapRoot?: string;
-    /**
-     * Recognize DirectiveStatement and distinguish it from ExpressionStatement. Default: false
-     */
-    directive?: boolean;
-    /**
-     * If file is provided, it will be used as file property of generated source map.
-     */
-    file?: string;
-    /**
-     * Providing verbatim code generation option to Expression nodes.
-     * verbatim option is provided by user as string. When generating Expression code,
-     * looking up node[option.verbatim] value and dump it instead of normal code generation.
-     *
-     * @example
-     *
-     */
-    verbatim?: string;
-  }
-  
-  /**
-   * https://github.com/estools/escodegen/commit/adf113333cd4888cf59bfc4f957df98bf7db82b6
-   */
-  export enum Precedence {
-    Sequence,
-    Yield,
-    Await,
-    Assignment,
-    Conditional,
-    ArrowFunction,
-    LogicalOR,
-    LogicalAND,
-    BitwiseOR,
-    BitwiseXOR,
-    BitwiseAND,
-    Equality,
-    Relational,
-    BitwiseSHIFT,
-    Additive,
-    Multiplicative,
-    Unary,
-    Postfix,
-    Call,
-    New,
-    TaggedTemplate,
-    Member,
-    Primary
-  }
-
-  /**
-   * Produces given Abstract Syntax Tree as javascript code
-   * @param ast The Abstract Syntax Tree to generate code from
-   * @param options The generation options
-   */
-  export function generate(ast: any, options?: GenerateOptions): string;
-  /**
-   * Attaching the comments is needed to keep the comments and to allow blank lines to be preserved.
-   */
-  export function attachComments(ast: any, comments: any, tokens: any): any;
-}

+ 0 - 108
typings/main/ambient/esprima/index.d.ts

@@ -1,108 +0,0 @@
-// Generated by typings
-// Source: https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/master/esprima/esprima.d.ts
-// Type definitions for Esprima v2.1.0
-// Project: http://esprima.org
-// Definitions by: teppeis <https://github.com/teppeis>, RReverser <https://github.com/RReverser>
-// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
-
-
-declare namespace esprima {
-
-    const version: string;
-
-    function parse(code: string, options?: Options): ESTree.Program;
-    function tokenize(code: string, options?: Options): Array<Token>;
-
-    interface Token {
-        type: string;
-        value: string;
-    }
-
-    interface Comment extends ESTree.Node {
-        value: string;
-    }
-
-    interface Options {
-        loc?: boolean;
-        range?: boolean;
-        raw?: boolean;
-        tokens?: boolean;
-        comment?: boolean;
-        attachComment?: boolean;
-        tolerant?: boolean;
-        source?: boolean;
-    }
-
-    const Syntax: {
-        AssignmentExpression: string,
-        AssignmentPattern: string,
-        ArrayExpression: string,
-        ArrayPattern: string,
-        ArrowFunctionExpression: string,
-        BlockStatement: string,
-        BinaryExpression: string,
-        BreakStatement: string,
-        CallExpression: string,
-        CatchClause: string,
-        ClassBody: string,
-        ClassDeclaration: string,
-        ClassExpression: string,
-        ConditionalExpression: string,
-        ContinueStatement: string,
-        DoWhileStatement: string,
-        DebuggerStatement: string,
-        EmptyStatement: string,
-        ExportAllDeclaration: string,
-        ExportDefaultDeclaration: string,
-        ExportNamedDeclaration: string,
-        ExportSpecifier: string,
-        ExpressionStatement: string,
-        ForStatement: string,
-        ForOfStatement: string,
-        ForInStatement: string,
-        FunctionDeclaration: string,
-        FunctionExpression: string,
-        Identifier: string,
-        IfStatement: string,
-        ImportDeclaration: string,
-        ImportDefaultSpecifier: string,
-        ImportNamespaceSpecifier: string,
-        ImportSpecifier: string,
-        Literal: string,
-        LabeledStatement: string,
-        LogicalExpression: string,
-        MemberExpression: string,
-        MetaProperty: string,
-        MethodDefinition: string,
-        NewExpression: string,
-        ObjectExpression: string,
-        ObjectPattern: string,
-        Program: string,
-        Property: string,
-        RestElement: string,
-        ReturnStatement: string,
-        SequenceExpression: string,
-        SpreadElement: string,
-        Super: string,
-        SwitchCase: string,
-        SwitchStatement: string,
-        TaggedTemplateExpression: string,
-        TemplateElement: string,
-        TemplateLiteral: string,
-        ThisExpression: string,
-        ThrowStatement: string,
-        TryStatement: string,
-        UnaryExpression: string,
-        UpdateExpression: string,
-        VariableDeclaration: string,
-        VariableDeclarator: string,
-        WhileStatement: string,
-        WithStatement: string,
-        YieldExpression: string
-    };
-
-}
-
-declare module "esprima" {
-    export = esprima
-}

+ 0 - 24
typings/main/ambient/estraverse/index.d.ts

@@ -1,24 +0,0 @@
-// Generated by typings
-// Source: https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/master/estraverse/estraverse.d.ts
-// Type definitions for estraverse
-// Project: https://github.com/estools/estraverse
-// Definitions by: Sanex3339 <https://github.com/sanex3339>
-// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
-
-declare module 'estraverse' {
-    export interface Visitor {
-        enter?: (node: any, parentNode: any) => any;
-        leave?: (node: any, parentNode: any) => any;
-
-        fallback?: string;
-
-        keys?: {};
-    }
-
-    export enum VisitorOption {
-        Skip, Break, Remove
-    }
-
-    export function traverse (ast: any, visitor: Visitor): any;
-    export function replace (ast: any, visitor: Visitor): any;
-}

+ 0 - 17
typings/main/ambient/mkdirp/index.d.ts

@@ -1,17 +0,0 @@
-// Generated by typings
-// Source: https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/master/mkdirp/mkdirp.d.ts
-// Type definitions for mkdirp 0.3.0
-// Project: http://github.com/substack/node-mkdirp
-// Definitions by: Bart van der Schoor <https://github.com/Bartvds>
-// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
-
-declare module 'mkdirp' {
-
-	function mkdirp(dir: string, cb: (err: any, made: string) => void): void;
-	function mkdirp(dir: string, flags: any, cb: (err: any, made: string) => void): void;
-
-	namespace mkdirp {
-		function sync(dir: string, flags?: any): string;
-	}
-	export = mkdirp;
-}

+ 0 - 239
typings/main/ambient/mocha/index.d.ts

@@ -1,239 +0,0 @@
-// Generated by typings
-// Source: https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/master/mocha/mocha.d.ts
-// Type definitions for mocha 2.2.5
-// Project: http://mochajs.org/
-// Definitions by: Kazi Manzur Rashid <https://github.com/kazimanzurrashid/>, otiai10 <https://github.com/otiai10>, jt000 <https://github.com/jt000>, Vadim Macagon <https://github.com/enlight>
-// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
-
-interface MochaSetupOptions {
-    //milliseconds to wait before considering a test slow
-    slow?: number;
-
-    // timeout in milliseconds
-    timeout?: number;
-
-    // ui name "bdd", "tdd", "exports" etc
-    ui?: string;
-
-    //array of accepted globals
-    globals?: any[];
-
-    // reporter instance (function or string), defaults to `mocha.reporters.Spec`
-    reporter?: any;
-
-    // bail on the first test failure
-    bail?: boolean;
-
-    // ignore global leaks
-    ignoreLeaks?: boolean;
-
-    // grep string or regexp to filter tests with
-    grep?: any;
-}
-
-interface MochaDone {
-    (error?: Error): void;
-}
-
-declare var mocha: Mocha;
-declare var describe: Mocha.IContextDefinition;
-declare var xdescribe: Mocha.IContextDefinition;
-// alias for `describe`
-declare var context: Mocha.IContextDefinition;
-// alias for `describe`
-declare var suite: Mocha.IContextDefinition;
-declare var it: Mocha.ITestDefinition;
-declare var xit: Mocha.ITestDefinition;
-// alias for `it`
-declare var test: Mocha.ITestDefinition;
-declare var specify: Mocha.ITestDefinition;
-
-declare function before(action: () => void): void;
-
-declare function before(action: (done: MochaDone) => void): void;
-
-declare function before(description: string, action: () => void): void;
-
-declare function before(description: string, action: (done: MochaDone) => void): void;
-
-declare function setup(action: () => void): void;
-
-declare function setup(action: (done: MochaDone) => void): void;
-
-declare function after(action: () => void): void;
-
-declare function after(action: (done: MochaDone) => void): void;
-
-declare function after(description: string, action: () => void): void;
-
-declare function after(description: string, action: (done: MochaDone) => void): void;
-
-declare function teardown(action: () => void): void;
-
-declare function teardown(action: (done: MochaDone) => void): void;
-
-declare function beforeEach(action: () => void): void;
-
-declare function beforeEach(action: (done: MochaDone) => void): void;
-
-declare function beforeEach(description: string, action: () => void): void;
-
-declare function beforeEach(description: string, action: (done: MochaDone) => void): void;
-
-declare function suiteSetup(action: () => void): void;
-
-declare function suiteSetup(action: (done: MochaDone) => void): void;
-
-declare function afterEach(action: () => void): void;
-
-declare function afterEach(action: (done: MochaDone) => void): void;
-
-declare function afterEach(description: string, action: () => void): void;
-
-declare function afterEach(description: string, action: (done: MochaDone) => void): void;
-
-declare function suiteTeardown(action: () => void): void;
-
-declare function suiteTeardown(action: (done: MochaDone) => void): void;
-
-declare class Mocha {
-    constructor(options?: {
-        grep?: RegExp;
-        ui?: string;
-        reporter?: string;
-        timeout?: number;
-        bail?: boolean;
-    });
-
-    /** Setup mocha with the given options. */
-    setup(options: MochaSetupOptions): Mocha;
-    bail(value?: boolean): Mocha;
-    addFile(file: string): Mocha;
-    /** Sets reporter by name, defaults to "spec". */
-    reporter(name: string): Mocha;
-    /** Sets reporter constructor, defaults to mocha.reporters.Spec. */
-    reporter(reporter: (runner: Mocha.IRunner, options: any) => any): Mocha;
-    ui(value: string): Mocha;
-    grep(value: string): Mocha;
-    grep(value: RegExp): Mocha;
-    invert(): Mocha;
-    ignoreLeaks(value: boolean): Mocha;
-    checkLeaks(): Mocha;
-    /**
-     * Function to allow assertion libraries to throw errors directly into mocha.
-     * This is useful when running tests in a browser because window.onerror will
-     * only receive the 'message' attribute of the Error.
-     */
-    throwError(error: Error): void;
-    /** Enables growl support. */
-    growl(): Mocha;
-    globals(value: string): Mocha;
-    globals(values: string[]): Mocha;
-    useColors(value: boolean): Mocha;
-    useInlineDiffs(value: boolean): Mocha;
-    timeout(value: number): Mocha;
-    slow(value: number): Mocha;
-    enableTimeouts(value: boolean): Mocha;
-    asyncOnly(value: boolean): Mocha;
-    noHighlighting(value: boolean): Mocha;
-    /** Runs tests and invokes `onComplete()` when finished. */
-    run(onComplete?: (failures: number) => void): Mocha.IRunner;
-}
-
-// merge the Mocha class declaration with a module
-declare namespace Mocha {
-    /** Partial interface for Mocha's `Runnable` class. */
-    interface IRunnable {
-        title: string;
-        fn: Function;
-        async: boolean;
-        sync: boolean;
-        timedOut: boolean;
-    }
-
-    /** Partial interface for Mocha's `Suite` class. */
-    interface ISuite {
-        parent: ISuite;
-        title: string;
-
-        fullTitle(): string;
-    }
-
-    /** Partial interface for Mocha's `Test` class. */
-    interface ITest extends IRunnable {
-        parent: ISuite;
-        pending: boolean;
-
-        fullTitle(): string;
-    }
-
-    /** Partial interface for Mocha's `Runner` class. */
-    interface IRunner {}
-
-    interface IContextDefinition {
-        (description: string, spec: () => void): ISuite;
-        only(description: string, spec: () => void): ISuite;
-        skip(description: string, spec: () => void): void;
-        timeout(ms: number): void;
-    }
-
-    interface ITestDefinition {
-        (expectation: string, assertion?: () => void): ITest;
-        (expectation: string, assertion?: (done: MochaDone) => void): ITest;
-        only(expectation: string, assertion?: () => void): ITest;
-        only(expectation: string, assertion?: (done: MochaDone) => void): ITest;
-        skip(expectation: string, assertion?: () => void): void;
-        skip(expectation: string, assertion?: (done: MochaDone) => void): void;
-        timeout(ms: number): void;
-    }
-
-    export module reporters {
-        export class Base {
-            stats: {
-                suites: number;
-                tests: number;
-                passes: number;
-                pending: number;
-                failures: number;
-            };
-
-            constructor(runner: IRunner);
-        }
-
-        export class Doc extends Base {}
-        export class Dot extends Base {}
-        export class HTML extends Base {}
-        export class HTMLCov extends Base {}
-        export class JSON extends Base {}
-        export class JSONCov extends Base {}
-        export class JSONStream extends Base {}
-        export class Landing extends Base {}
-        export class List extends Base {}
-        export class Markdown extends Base {}
-        export class Min extends Base {}
-        export class Nyan extends Base {}
-        export class Progress extends Base {
-            /**
-             * @param options.open String used to indicate the start of the progress bar.
-             * @param options.complete String used to indicate a complete test on the progress bar.
-             * @param options.incomplete String used to indicate an incomplete test on the progress bar.
-             * @param options.close String used to indicate the end of the progress bar.
-             */
-            constructor(runner: IRunner, options?: {
-                open?: string;
-                complete?: string;
-                incomplete?: string;
-                close?: string;
-            });
-        }
-        export class Spec extends Base {}
-        export class TAP extends Base {}
-        export class XUnit extends Base {
-            constructor(runner: IRunner, options?: any);
-        }
-    }
-}
-
-declare module "mocha" {
-    export = Mocha;
-}

+ 0 - 2568
typings/main/ambient/node/index.d.ts

@@ -1,2568 +0,0 @@
-// Generated by typings
-// Source: https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/master/node/node.d.ts
-// Type definitions for Node.js v6.x
-// Project: http://nodejs.org/
-// Definitions by: Microsoft TypeScript <http://typescriptlang.org>, DefinitelyTyped <https://github.com/DefinitelyTyped/DefinitelyTyped>
-// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
-
-/************************************************
-*                                               *
-*               Node.js v6.x API                *
-*                                               *
-************************************************/
-
-interface Error {
-    stack?: string;
-}
-
-interface ErrorConstructor {
-    captureStackTrace(targetObject: Object, constructorOpt?: Function): void;
-    stackTraceLimit: number;
-}
-
-// compat for TypeScript 1.8
-// if you use with --target es3 or --target es5 and use below definitions,
-// use the lib.es6.d.ts that is bundled with TypeScript 1.8.
-interface MapConstructor {}
-interface WeakMapConstructor {}
-interface SetConstructor {}
-interface WeakSetConstructor {}
-
-/************************************************
-*                                               *
-*                   GLOBAL                      *
-*                                               *
-************************************************/
-declare var process: NodeJS.Process;
-declare var global: NodeJS.Global;
-
-declare var __filename: string;
-declare var __dirname: string;
-
-declare function setTimeout(callback: (...args: any[]) => void, ms: number, ...args: any[]): NodeJS.Timer;
-declare function clearTimeout(timeoutId: NodeJS.Timer): void;
-declare function setInterval(callback: (...args: any[]) => void, ms: number, ...args: any[]): NodeJS.Timer;
-declare function clearInterval(intervalId: NodeJS.Timer): void;
-declare function setImmediate(callback: (...args: any[]) => void, ...args: any[]): any;
-declare function clearImmediate(immediateId: any): void;
-
-interface NodeRequireFunction {
-    (id: string): any;
-}
-
-interface NodeRequire extends NodeRequireFunction {
-    resolve(id:string): string;
-    cache: any;
-    extensions: any;
-    main: any;
-}
-
-declare var require: NodeRequire;
-
-interface NodeModule {
-    exports: any;
-    require: NodeRequireFunction;
-    id: string;
-    filename: string;
-    loaded: boolean;
-    parent: any;
-    children: any[];
-}
-
-declare var module: NodeModule;
-
-// Same as module.exports
-declare var exports: any;
-declare var SlowBuffer: {
-    new (str: string, encoding?: string): Buffer;
-    new (size: number): Buffer;
-    new (size: Uint8Array): Buffer;
-    new (array: any[]): Buffer;
-    prototype: Buffer;
-    isBuffer(obj: any): boolean;
-    byteLength(string: string, encoding?: string): number;
-    concat(list: Buffer[], totalLength?: number): Buffer;
-};
-
-
-// Buffer class
-type BufferEncoding = "ascii" | "utf8" | "utf16le" | "ucs2" | "binary" | "hex";
-interface Buffer extends NodeBuffer {}
-
-/**
- * Raw data is stored in instances of the Buffer class.
- * A Buffer is similar to an array of integers but corresponds to a raw memory allocation outside the V8 heap.  A Buffer cannot be resized.
- * Valid string encodings: 'ascii'|'utf8'|'utf16le'|'ucs2'(alias of 'utf16le')|'base64'|'binary'(deprecated)|'hex'
- */
-declare var Buffer: {
-    /**
-     * Allocates a new buffer containing the given {str}.
-     *
-     * @param str String to store in buffer.
-     * @param encoding encoding to use, optional.  Default is 'utf8'
-     */
-    new (str: string, encoding?: string): Buffer;
-    /**
-     * Allocates a new buffer of {size} octets.
-     *
-     * @param size count of octets to allocate.
-     */
-    new (size: number): Buffer;
-    /**
-     * Allocates a new buffer containing the given {array} of octets.
-     *
-     * @param array The octets to store.
-     */
-    new (array: Uint8Array): Buffer;
-    /**
-     * Produces a Buffer backed by the same allocated memory as
-     * the given {ArrayBuffer}.
-     *
-     *
-     * @param arrayBuffer The ArrayBuffer with which to share memory.
-     */
-    new (arrayBuffer: ArrayBuffer): Buffer;
-    /**
-     * Allocates a new buffer containing the given {array} of octets.
-     *
-     * @param array The octets to store.
-     */
-    new (array: any[]): Buffer;
-    /**
-     * Copies the passed {buffer} data onto a new {Buffer} instance.
-     *
-     * @param buffer The buffer to copy.
-     */
-    new (buffer: Buffer): Buffer;
-    prototype: Buffer;
-    /**
-     * Allocates a new Buffer using an {array} of octets.
-     *
-     * @param array
-     */
-    from(array: any[]): Buffer;
-    /**
-     * When passed a reference to the .buffer property of a TypedArray instance,
-     * the newly created Buffer will share the same allocated memory as the TypedArray.
-     * The optional {byteOffset} and {length} arguments specify a memory range
-     * within the {arrayBuffer} that will be shared by the Buffer.
-     *
-     * @param arrayBuffer The .buffer property of a TypedArray or a new ArrayBuffer()
-     * @param byteOffset
-     * @param length
-     */
-    from(arrayBuffer: ArrayBuffer, byteOffset?: number, length?:number): Buffer;
-    /**
-     * Copies the passed {buffer} data onto a new Buffer instance.
-     *
-     * @param buffer
-     */
-    from(buffer: Buffer): Buffer;
-    /**
-     * Creates a new Buffer containing the given JavaScript string {str}.
-     * If provided, the {encoding} parameter identifies the character encoding.
-     * If not provided, {encoding} defaults to 'utf8'.
-     *
-     * @param str
-     */
-    from(str: string, encoding?: string): Buffer;
-    /**
-     * Returns true if {obj} is a Buffer
-     *
-     * @param obj object to test.
-     */
-    isBuffer(obj: any): obj is Buffer;
-    /**
-     * Returns true if {encoding} is a valid encoding argument.
-     * Valid string encodings in Node 0.12: 'ascii'|'utf8'|'utf16le'|'ucs2'(alias of 'utf16le')|'base64'|'binary'(deprecated)|'hex'
-     *
-     * @param encoding string to test.
-     */
-    isEncoding(encoding: string): boolean;
-    /**
-     * Gives the actual byte length of a string. encoding defaults to 'utf8'.
-     * This is not the same as String.prototype.length since that returns the number of characters in a string.
-     *
-     * @param string string to test.
-     * @param encoding encoding used to evaluate (defaults to 'utf8')
-     */
-    byteLength(string: string, encoding?: string): number;
-    /**
-     * Returns a buffer which is the result of concatenating all the buffers in the list together.
-     *
-     * If the list has no items, or if the totalLength is 0, then it returns a zero-length buffer.
-     * If the list has exactly one item, then the first item of the list is returned.
-     * If the list has more than one item, then a new Buffer is created.
-     *
-     * @param list An array of Buffer objects to concatenate
-     * @param totalLength Total length of the buffers when concatenated.
-     *   If totalLength is not provided, it is read from the buffers in the list. However, this adds an additional loop to the function, so it is faster to provide the length explicitly.
-     */
-    concat(list: Buffer[], totalLength?: number): Buffer;
-    /**
-     * The same as buf1.compare(buf2).
-     */
-    compare(buf1: Buffer, buf2: Buffer): number;
-    /**
-     * Allocates a new buffer of {size} octets.
-     *
-     * @param size count of octets to allocate.
-     * @param fill if specified, buffer will be initialized by calling buf.fill(fill).
-     *    If parameter is omitted, buffer will be filled with zeros.
-     * @param encoding encoding used for call to buf.fill while initalizing
-     */
-    alloc(size: number, fill?: string|Buffer|number, encoding?: string): Buffer;
-     /**
-      * Allocates a new buffer of {size} octets, leaving memory not initialized, so the contents
-      * of the newly created Buffer are unknown and may contain sensitive data.
-      *
-      * @param size count of octets to allocate
-      */
-    allocUnsafe(size: number): Buffer;
-     /**
-      * Allocates a new non-pooled buffer of {size} octets, leaving memory not initialized, so the contents
-      * of the newly created Buffer are unknown and may contain sensitive data.
-      *
-      * @param size count of octets to allocate
-      */
-    allocUnsafeSlow(size: number): Buffer;
-};
-
-/************************************************
-*                                               *
-*               GLOBAL INTERFACES               *
-*                                               *
-************************************************/
-declare namespace NodeJS {
-    export interface ErrnoException extends Error {
-        errno?: number;
-        code?: string;
-        path?: string;
-        syscall?: string;
-        stack?: string;
-    }
-
-    export interface EventEmitter {
-        addListener(event: string, listener: Function): this;
-        on(event: string, listener: Function): this;
-        once(event: string, listener: Function): this;
-        removeListener(event: string, listener: Function): this;
-        removeAllListeners(event?: string): this;
-        setMaxListeners(n: number): this;
-        getMaxListeners(): number;
-        listeners(event: string): Function[];
-        emit(event: string, ...args: any[]): boolean;
-        listenerCount(type: string): number;
-    }
-
-    export interface ReadableStream extends EventEmitter {
-        readable: boolean;
-        read(size?: number): string|Buffer;
-        setEncoding(encoding: string): void;
-        pause(): void;
-        resume(): void;
-        pipe<T extends WritableStream>(destination: T, options?: { end?: boolean; }): T;
-        unpipe<T extends WritableStream>(destination?: T): void;
-        unshift(chunk: string): void;
-        unshift(chunk: Buffer): void;
-        wrap(oldStream: ReadableStream): ReadableStream;
-    }
-
-    export interface WritableStream extends EventEmitter {
-        writable: boolean;
-        write(buffer: Buffer|string, cb?: Function): boolean;
-        write(str: string, encoding?: string, cb?: Function): boolean;
-        end(): void;
-        end(buffer: Buffer, cb?: Function): void;
-        end(str: string, cb?: Function): void;
-        end(str: string, encoding?: string, cb?: Function): void;
-    }
-
-    export interface ReadWriteStream extends ReadableStream, WritableStream {}
-
-    export interface Events extends EventEmitter { }
-
-    export interface Domain extends Events {
-        run(fn: Function): void;
-        add(emitter: Events): void;
-        remove(emitter: Events): void;
-        bind(cb: (err: Error, data: any) => any): any;
-        intercept(cb: (data: any) => any): any;
-        dispose(): void;
-
-        addListener(event: string, listener: Function): this;
-        on(event: string, listener: Function): this;
-        once(event: string, listener: Function): this;
-        removeListener(event: string, listener: Function): this;
-        removeAllListeners(event?: string): this;
-    }
-
-    export interface MemoryUsage {
-        rss: number;
-        heapTotal: number;
-        heapUsed: number;
-    }
-
-    export interface Process extends EventEmitter {
-        stdout: WritableStream;
-        stderr: WritableStream;
-        stdin: ReadableStream;
-        argv: string[];
-        execArgv: string[];
-        execPath: string;
-        abort(): void;
-        chdir(directory: string): void;
-        cwd(): string;
-        env: any;
-        exit(code?: number): void;
-        getgid(): number;
-        setgid(id: number): void;
-        setgid(id: string): void;
-        getuid(): number;
-        setuid(id: number): void;
-        setuid(id: string): void;
-        version: string;
-        versions: {
-            http_parser: string;
-            node: string;
-            v8: string;
-            ares: string;
-            uv: string;
-            zlib: string;
-            modules: string;
-            openssl: string;
-        };
-        config: {
-            target_defaults: {
-                cflags: any[];
-                default_configuration: string;
-                defines: string[];
-                include_dirs: string[];
-                libraries: string[];
-            };
-            variables: {
-                clang: number;
-                host_arch: string;
-                node_install_npm: boolean;
-                node_install_waf: boolean;
-                node_prefix: string;
-                node_shared_openssl: boolean;
-                node_shared_v8: boolean;
-                node_shared_zlib: boolean;
-                node_use_dtrace: boolean;
-                node_use_etw: boolean;
-                node_use_openssl: boolean;
-                target_arch: string;
-                v8_no_strict_aliasing: number;
-                v8_use_snapshot: boolean;
-                visibility: string;
-            };
-        };
-        kill(pid:number, signal?: string|number): void;
-        pid: number;
-        title: string;
-        arch: string;
-        platform: string;
-        memoryUsage(): MemoryUsage;
-        nextTick(callback: Function): void;
-        umask(mask?: number): number;
-        uptime(): number;
-        hrtime(time?:number[]): number[];
-        domain: Domain;
-
-        // Worker
-        send?(message: any, sendHandle?: any): void;
-        disconnect(): void;
-        connected: boolean;
-    }
-
-    export interface Global {
-        Array: typeof Array;
-        ArrayBuffer: typeof ArrayBuffer;
-        Boolean: typeof Boolean;
-        Buffer: typeof Buffer;
-        DataView: typeof DataView;
-        Date: typeof Date;
-        Error: typeof Error;
-        EvalError: typeof EvalError;
-        Float32Array: typeof Float32Array;
-        Float64Array: typeof Float64Array;
-        Function: typeof Function;
-        GLOBAL: Global;
-        Infinity: typeof Infinity;
-        Int16Array: typeof Int16Array;
-        Int32Array: typeof Int32Array;
-        Int8Array: typeof Int8Array;
-        Intl: typeof Intl;
-        JSON: typeof JSON;
-        Map: MapConstructor;
-        Math: typeof Math;
-        NaN: typeof NaN;
-        Number: typeof Number;
-        Object: typeof Object;
-        Promise: Function;
-        RangeError: typeof RangeError;
-        ReferenceError: typeof ReferenceError;
-        RegExp: typeof RegExp;
-        Set: SetConstructor;
-        String: typeof String;
-        Symbol: Function;
-        SyntaxError: typeof SyntaxError;
-        TypeError: typeof TypeError;
-        URIError: typeof URIError;
-        Uint16Array: typeof Uint16Array;
-        Uint32Array: typeof Uint32Array;
-        Uint8Array: typeof Uint8Array;
-        Uint8ClampedArray: Function;
-        WeakMap: WeakMapConstructor;
-        WeakSet: WeakSetConstructor;
-        clearImmediate: (immediateId: any) => void;
-        clearInterval: (intervalId: NodeJS.Timer) => void;
-        clearTimeout: (timeoutId: NodeJS.Timer) => void;
-        console: typeof console;
-        decodeURI: typeof decodeURI;
-        decodeURIComponent: typeof decodeURIComponent;
-        encodeURI: typeof encodeURI;
-        encodeURIComponent: typeof encodeURIComponent;
-        escape: (str: string) => string;
-        eval: typeof eval;
-        global: Global;
-        isFinite: typeof isFinite;
-        isNaN: typeof isNaN;
-        parseFloat: typeof parseFloat;
-        parseInt: typeof parseInt;
-        process: Process;
-        root: Global;
-        setImmediate: (callback: (...args: any[]) => void, ...args: any[]) => any;
-        setInterval: (callback: (...args: any[]) => void, ms: number, ...args: any[]) => NodeJS.Timer;
-        setTimeout: (callback: (...args: any[]) => void, ms: number, ...args: any[]) => NodeJS.Timer;
-        undefined: typeof undefined;
-        unescape: (str: string) => string;
-        gc: () => void;
-        v8debug?: any;
-    }
-
-    export interface Timer {
-        ref() : void;
-        unref() : void;
-    }
-}
-
-/**
- * @deprecated
- */
-interface NodeBuffer extends Uint8Array {
-    write(string: string, offset?: number, length?: number, encoding?: string): number;
-    toString(encoding?: string, start?: number, end?: number): string;
-    toJSON(): any;
-    equals(otherBuffer: Buffer): boolean;
-    compare(otherBuffer: Buffer): number;
-    copy(targetBuffer: Buffer, targetStart?: number, sourceStart?: number, sourceEnd?: number): number;
-    slice(start?: number, end?: number): Buffer;
-    writeUIntLE(value: number, offset: number, byteLength: number, noAssert?: boolean): number;
-    writeUIntBE(value: number, offset: number, byteLength: number, noAssert?: boolean): number;
-    writeIntLE(value: number, offset: number, byteLength: number, noAssert?: boolean): number;
-    writeIntBE(value: number, offset: number, byteLength: number, noAssert?: boolean): number;
-    readUIntLE(offset: number, byteLength: number, noAssert?: boolean): number;
-    readUIntBE(offset: number, byteLength: number, noAssert?: boolean): number;
-    readIntLE(offset: number, byteLength: number, noAssert?: boolean): number;
-    readIntBE(offset: number, byteLength: number, noAssert?: boolean): number;
-    readUInt8(offset: number, noAssert?: boolean): number;
-    readUInt16LE(offset: number, noAssert?: boolean): number;
-    readUInt16BE(offset: number, noAssert?: boolean): number;
-    readUInt32LE(offset: number, noAssert?: boolean): number;
-    readUInt32BE(offset: number, noAssert?: boolean): number;
-    readInt8(offset: number, noAssert?: boolean): number;
-    readInt16LE(offset: number, noAssert?: boolean): number;
-    readInt16BE(offset: number, noAssert?: boolean): number;
-    readInt32LE(offset: number, noAssert?: boolean): number;
-    readInt32BE(offset: number, noAssert?: boolean): number;
-    readFloatLE(offset: number, noAssert?: boolean): number;
-    readFloatBE(offset: number, noAssert?: boolean): number;
-    readDoubleLE(offset: number, noAssert?: boolean): number;
-    readDoubleBE(offset: number, noAssert?: boolean): number;
-    writeUInt8(value: number, offset: number, noAssert?: boolean): number;
-    writeUInt16LE(value: number, offset: number, noAssert?: boolean): number;
-    writeUInt16BE(value: number, offset: number, noAssert?: boolean): number;
-    writeUInt32LE(value: number, offset: number, noAssert?: boolean): number;
-    writeUInt32BE(value: number, offset: number, noAssert?: boolean): number;
-    writeInt8(value: number, offset: number, noAssert?: boolean): number;
-    writeInt16LE(value: number, offset: number, noAssert?: boolean): number;
-    writeInt16BE(value: number, offset: number, noAssert?: boolean): number;
-    writeInt32LE(value: number, offset: number, noAssert?: boolean): number;
-    writeInt32BE(value: number, offset: number, noAssert?: boolean): number;
-    writeFloatLE(value: number, offset: number, noAssert?: boolean): number;
-    writeFloatBE(value: number, offset: number, noAssert?: boolean): number;
-    writeDoubleLE(value: number, offset: number, noAssert?: boolean): number;
-    writeDoubleBE(value: number, offset: number, noAssert?: boolean): number;
-    fill(value: any, offset?: number, end?: number): this;
-    // TODO: encoding param
-    indexOf(value: string | number | Buffer, byteOffset?: number): number;
-    // TODO: entries
-    // TODO: includes
-    // TODO: keys
-    // TODO: values
-}
-
-/************************************************
-*                                               *
-*                   MODULES                     *
-*                                               *
-************************************************/
-declare module "buffer" {
-    export var INSPECT_MAX_BYTES: number;
-    var BuffType: typeof Buffer;
-    var SlowBuffType: typeof SlowBuffer;
-    export { BuffType as Buffer, SlowBuffType as SlowBuffer };
-}
-
-declare module "querystring" {
-    export interface StringifyOptions {
-        encodeURIComponent?: Function;
-    }
-
-    export interface ParseOptions {
-        maxKeys?: number;
-        decodeURIComponent?: Function;
-    }
-
-    export function stringify<T>(obj: T, sep?: string, eq?: string, options?: StringifyOptions): string;
-    export function parse(str: string, sep?: string, eq?: string, options?: ParseOptions): any;
-    export function parse<T extends {}>(str: string, sep?: string, eq?: string, options?: ParseOptions): T;
-    export function escape(str: string): string;
-    export function unescape(str: string): string;
-}
-
-declare module "events" {
-    export class EventEmitter implements NodeJS.EventEmitter {
-        static EventEmitter: EventEmitter;
-        static listenerCount(emitter: EventEmitter, event: string): number; // deprecated
-        static defaultMaxListeners: number;
-
-        addListener(event: string, listener: Function): this;
-        on(event: string, listener: Function): this;
-        once(event: string, listener: Function): this;
-        prependListener(event: string, listener: Function): this;
-        prependOnceListener(event: string, listener: Function): this;
-        removeListener(event: string, listener: Function): this;
-        removeAllListeners(event?: string): this;
-        setMaxListeners(n: number): this;
-        getMaxListeners(): number;
-        listeners(event: string): Function[];
-        emit(event: string, ...args: any[]): boolean;
-        eventNames(): string[];
-        listenerCount(type: string): number;
-    }
-}
-
-declare module "http" {
-    import * as events from "events";
-    import * as net from "net";
-    import * as stream from "stream";
-
-    export interface RequestOptions {
-        protocol?: string;
-        host?: string;
-        hostname?: string;
-        family?: number;
-        port?: number;
-        localAddress?: string;
-        socketPath?: string;
-        method?: string;
-        path?: string;
-        headers?: { [key: string]: any };
-        auth?: string;
-        agent?: Agent|boolean;
-    }
-
-    export interface Server extends events.EventEmitter, net.Server {
-        setTimeout(msecs: number, callback: Function): void;
-        maxHeadersCount: number;
-        timeout: number;
-    }
-    /**
-     * @deprecated Use IncomingMessage
-     */
-    export interface ServerRequest extends IncomingMessage {
-        connection: net.Socket;
-    }
-    export interface ServerResponse extends events.EventEmitter, stream.Writable {
-        // Extended base methods
-        write(buffer: Buffer): boolean;
-        write(buffer: Buffer, cb?: Function): boolean;
-        write(str: string, cb?: Function): boolean;
-        write(str: string, encoding?: string, cb?: Function): boolean;
-        write(str: string, encoding?: string, fd?: string): boolean;
-
-        writeContinue(): void;
-        writeHead(statusCode: number, reasonPhrase?: string, headers?: any): void;
-        writeHead(statusCode: number, headers?: any): void;
-        statusCode: number;
-        statusMessage: string;
-        headersSent: boolean;
-        setHeader(name: string, value: string | string[]): void;
-        sendDate: boolean;
-        getHeader(name: string): string;
-        removeHeader(name: string): void;
-        write(chunk: any, encoding?: string): any;
-        addTrailers(headers: any): void;
-
-        // Extended base methods
-        end(): void;
-        end(buffer: Buffer, cb?: Function): void;
-        end(str: string, cb?: Function): void;
-        end(str: string, encoding?: string, cb?: Function): void;
-        end(data?: any, encoding?: string): void;
-    }
-    export interface ClientRequest extends events.EventEmitter, stream.Writable {
-        // Extended base methods
-        write(buffer: Buffer): boolean;
-        write(buffer: Buffer, cb?: Function): boolean;
-        write(str: string, cb?: Function): boolean;
-        write(str: string, encoding?: string, cb?: Function): boolean;
-        write(str: string, encoding?: string, fd?: string): boolean;
-
-        write(chunk: any, encoding?: string): void;
-        abort(): void;
-        setTimeout(timeout: number, callback?: Function): void;
-        setNoDelay(noDelay?: boolean): void;
-        setSocketKeepAlive(enable?: boolean, initialDelay?: number): void;
-
-        setHeader(name: string, value: string | string[]): void;
-        getHeader(name: string): string;
-        removeHeader(name: string): void;
-        addTrailers(headers: any): void;
-
-        // Extended base methods
-        end(): void;
-        end(buffer: Buffer, cb?: Function): void;
-        end(str: string, cb?: Function): void;
-        end(str: string, encoding?: string, cb?: Function): void;
-        end(data?: any, encoding?: string): void;
-    }
-    export interface IncomingMessage extends events.EventEmitter, stream.Readable {
-        httpVersion: string;
-        headers: any;
-        rawHeaders: string[];
-        trailers: any;
-        rawTrailers: any;
-        setTimeout(msecs: number, callback: Function): NodeJS.Timer;
-        /**
-         * Only valid for request obtained from http.Server.
-         */
-        method?: string;
-        /**
-         * Only valid for request obtained from http.Server.
-         */
-        url?: string;
-        /**
-         * Only valid for response obtained from http.ClientRequest.
-         */
-        statusCode?: number;
-        /**
-         * Only valid for response obtained from http.ClientRequest.
-         */
-        statusMessage?: string;
-        socket: net.Socket;
-    }
-    /**
-     * @deprecated Use IncomingMessage
-     */
-    export interface ClientResponse extends IncomingMessage { }
-
-    export interface AgentOptions {
-        /**
-         * Keep sockets around in a pool to be used by other requests in the future. Default = false
-         */
-        keepAlive?: boolean;
-        /**
-         * When using HTTP KeepAlive, how often to send TCP KeepAlive packets over sockets being kept alive. Default = 1000.
-         * Only relevant if keepAlive is set to true.
-         */
-        keepAliveMsecs?: number;
-        /**
-         * Maximum number of sockets to allow per host. Default for Node 0.10 is 5, default for Node 0.12 is Infinity
-         */
-        maxSockets?: number;
-        /**
-         * Maximum number of sockets to leave open in a free state. Only relevant if keepAlive is set to true. Default = 256.
-         */
-        maxFreeSockets?: number;
-    }
-
-    export class Agent {
-        maxSockets: number;
-        sockets: any;
-        requests: any;
-
-        constructor(opts?: AgentOptions);
-
-        /**
-         * Destroy any sockets that are currently in use by the agent.
-         * It is usually not necessary to do this. However, if you are using an agent with KeepAlive enabled,
-         * then it is best to explicitly shut down the agent when you know that it will no longer be used. Otherwise,
-         * sockets may hang open for quite a long time before the server terminates them.
-         */
-        destroy(): void;
-    }
-
-    export var METHODS: string[];
-
-    export var STATUS_CODES: {
-        [errorCode: number]: string;
-        [errorCode: string]: string;
-    };
-    export function createServer(requestListener?: (request: IncomingMessage, response: ServerResponse) =>void ): Server;
-    export function createClient(port?: number, host?: string): any;
-    export function request(options: RequestOptions, callback?: (res: IncomingMessage) => void): ClientRequest;
-    export function get(options: any, callback?: (res: IncomingMessage) => void): ClientRequest;
-    export var globalAgent: Agent;
-}
-
-declare module "cluster" {
-    import * as child from "child_process";
-    import * as events from "events";
-
-    export interface ClusterSettings {
-        exec?: string;
-        args?: string[];
-        silent?: boolean;
-    }
-
-    export interface Address {
-        address: string;
-        port: number;
-        addressType: string;
-    }
-
-    export class Worker extends events.EventEmitter {
-        id: string;
-        process: child.ChildProcess;
-        suicide: boolean;
-        send(message: any, sendHandle?: any): void;
-        kill(signal?: string): void;
-        destroy(signal?: string): void;
-        disconnect(): void;
-        isConnected(): boolean;
-        isDead(): boolean;
-    }
-
-    export var settings: ClusterSettings;
-    export var isMaster: boolean;
-    export var isWorker: boolean;
-    export function setupMaster(settings?: ClusterSettings): void;
-    export function fork(env?: any): Worker;
-    export function disconnect(callback?: Function): void;
-    export var worker: Worker;
-    export var workers: {
-        [index: string]: Worker
-    };
-
-    // Event emitter
-    export function addListener(event: string, listener: Function): void;
-    export function on(event: "disconnect", listener: (worker: Worker) => void): void;
-    export function on(event: "exit", listener: (worker: Worker, code: number, signal: string) => void): void;
-    export function on(event: "fork", listener: (worker: Worker) => void): void;
-    export function on(event: "listening", listener: (worker: Worker, address: any) => void): void;
-    export function on(event: "message", listener: (worker: Worker, message: any) => void): void;
-    export function on(event: "online", listener: (worker: Worker) => void): void;
-    export function on(event: "setup", listener: (settings: any) => void): void;
-    export function on(event: string, listener: Function): any;
-    export function once(event: string, listener: Function): void;
-    export function removeListener(event: string, listener: Function): void;
-    export function removeAllListeners(event?: string): void;
-    export function setMaxListeners(n: number): void;
-    export function listeners(event: string): Function[];
-    export function emit(event: string, ...args: any[]): boolean;
-}
-
-declare module "zlib" {
-    import * as stream from "stream";
-    export interface ZlibOptions { chunkSize?: number; windowBits?: number; level?: number; memLevel?: number; strategy?: number; dictionary?: any; }
-
-    export interface Gzip extends stream.Transform { }
-    export interface Gunzip extends stream.Transform { }
-    export interface Deflate extends stream.Transform { }
-    export interface Inflate extends stream.Transform { }
-    export interface DeflateRaw extends stream.Transform { }
-    export interface InflateRaw extends stream.Transform { }
-    export interface Unzip extends stream.Transform { }
-
-    export function createGzip(options?: ZlibOptions): Gzip;
-    export function createGunzip(options?: ZlibOptions): Gunzip;
-    export function createDeflate(options?: ZlibOptions): Deflate;
-    export function createInflate(options?: ZlibOptions): Inflate;
-    export function createDeflateRaw(options?: ZlibOptions): DeflateRaw;
-    export function createInflateRaw(options?: ZlibOptions): InflateRaw;
-    export function createUnzip(options?: ZlibOptions): Unzip;
-
-    export function deflate(buf: Buffer, callback: (error: Error, result: any) =>void ): void;
-    export function deflateSync(buf: Buffer, options?: ZlibOptions): any;
-    export function deflateRaw(buf: Buffer, callback: (error: Error, result: any) =>void ): void;
-    export function deflateRawSync(buf: Buffer, options?: ZlibOptions): any;
-    export function gzip(buf: Buffer, callback: (error: Error, result: any) =>void ): void;
-    export function gzipSync(buf: Buffer, options?: ZlibOptions): any;
-    export function gunzip(buf: Buffer, callback: (error: Error, result: any) =>void ): void;
-    export function gunzipSync(buf: Buffer, options?: ZlibOptions): any;
-    export function inflate(buf: Buffer, callback: (error: Error, result: any) =>void ): void;
-    export function inflateSync(buf: Buffer, options?: ZlibOptions): any;
-    export function inflateRaw(buf: Buffer, callback: (error: Error, result: any) =>void ): void;
-    export function inflateRawSync(buf: Buffer, options?: ZlibOptions): any;
-    export function unzip(buf: Buffer, callback: (error: Error, result: any) =>void ): void;
-    export function unzipSync(buf: Buffer, options?: ZlibOptions): any;
-
-    // Constants
-    export var Z_NO_FLUSH: number;
-    export var Z_PARTIAL_FLUSH: number;
-    export var Z_SYNC_FLUSH: number;
-    export var Z_FULL_FLUSH: number;
-    export var Z_FINISH: number;
-    export var Z_BLOCK: number;
-    export var Z_TREES: number;
-    export var Z_OK: number;
-    export var Z_STREAM_END: number;
-    export var Z_NEED_DICT: number;
-    export var Z_ERRNO: number;
-    export var Z_STREAM_ERROR: number;
-    export var Z_DATA_ERROR: number;
-    export var Z_MEM_ERROR: number;
-    export var Z_BUF_ERROR: number;
-    export var Z_VERSION_ERROR: number;
-    export var Z_NO_COMPRESSION: number;
-    export var Z_BEST_SPEED: number;
-    export var Z_BEST_COMPRESSION: number;
-    export var Z_DEFAULT_COMPRESSION: number;
-    export var Z_FILTERED: number;
-    export var Z_HUFFMAN_ONLY: number;
-    export var Z_RLE: number;
-    export var Z_FIXED: number;
-    export var Z_DEFAULT_STRATEGY: number;
-    export var Z_BINARY: number;
-    export var Z_TEXT: number;
-    export var Z_ASCII: number;
-    export var Z_UNKNOWN: number;
-    export var Z_DEFLATED: number;
-    export var Z_NULL: number;
-}
-
-declare module "os" {
-    export interface CpuInfo {
-        model: string;
-        speed: number;
-        times: {
-            user: number;
-            nice: number;
-            sys: number;
-            idle: number;
-            irq: number;
-        };
-    }
-
-    export interface NetworkInterfaceInfo {
-        address: string;
-        netmask: string;
-        family: string;
-        mac: string;
-        internal: boolean;
-    }
-
-    export function tmpdir(): string;
-    export function homedir(): string;
-    export function endianness(): "BE" | "LE";
-    export function hostname(): string;
-    export function type(): string;
-    export function platform(): string;
-    export function arch(): string;
-    export function release(): string;
-    export function uptime(): number;
-    export function loadavg(): number[];
-    export function totalmem(): number;
-    export function freemem(): number;
-    export function cpus(): CpuInfo[];
-    export function networkInterfaces(): {[index: string]: NetworkInterfaceInfo[]};
-    export var EOL: string;
-}
-
-declare module "https" {
-    import * as tls from "tls";
-    import * as events from "events";
-    import * as http from "http";
-
-    export interface ServerOptions {
-        pfx?: any;
-        key?: any;
-        passphrase?: string;
-        cert?: any;
-        ca?: any;
-        crl?: any;
-        ciphers?: string;
-        honorCipherOrder?: boolean;
-        requestCert?: boolean;
-        rejectUnauthorized?: boolean;
-        NPNProtocols?: any;
-        SNICallback?: (servername: string) => any;
-    }
-
-    export interface RequestOptions extends http.RequestOptions {
-        pfx?: any;
-        key?: any;
-        passphrase?: string;
-        cert?: any;
-        ca?: any;
-        ciphers?: string;
-        rejectUnauthorized?: boolean;
-        secureProtocol?: string;
-    }
-
-    export interface Agent extends http.Agent { }
-
-    export interface AgentOptions extends http.AgentOptions {
-        maxCachedSessions?: number;
-    }
-
-    export var Agent: {
-        new (options?: AgentOptions): Agent;
-    };
-    export interface Server extends tls.Server { }
-    export function createServer(options: ServerOptions, requestListener?: Function): Server;
-    export function request(options: RequestOptions, callback?: (res: http.IncomingMessage) =>void ): http.ClientRequest;
-    export function get(options: RequestOptions, callback?: (res: http.IncomingMessage) =>void ): http.ClientRequest;
-    export var globalAgent: Agent;
-}
-
-declare module "punycode" {
-    export function decode(string: string): string;
-    export function encode(string: string): string;
-    export function toUnicode(domain: string): string;
-    export function toASCII(domain: string): string;
-    export var ucs2: ucs2;
-    interface ucs2 {
-        decode(string: string): number[];
-        encode(codePoints: number[]): string;
-    }
-    export var version: any;
-}
-
-declare module "repl" {
-    import * as stream from "stream";
-    import * as events from "events";
-
-    export interface ReplOptions {
-        prompt?: string;
-        input?: NodeJS.ReadableStream;
-        output?: NodeJS.WritableStream;
-        terminal?: boolean;
-        eval?: Function;
-        useColors?: boolean;
-        useGlobal?: boolean;
-        ignoreUndefined?: boolean;
-        writer?: Function;
-    }
-    export function start(options: ReplOptions): events.EventEmitter;
-}
-
-declare module "readline" {
-    import * as events from "events";
-    import * as stream from "stream";
-
-    export interface Key {
-        sequence?: string;
-        name?: string;
-        ctrl?: boolean;
-        meta?: boolean;
-        shift?: boolean;
-    }
-
-    export interface ReadLine extends events.EventEmitter {
-        setPrompt(prompt: string): void;
-        prompt(preserveCursor?: boolean): void;
-        question(query: string, callback: (answer: string) => void): void;
-        pause(): ReadLine;
-        resume(): ReadLine;
-        close(): void;
-        write(data: string|Buffer, key?: Key): void;
-    }
-
-    export interface Completer {
-        (line: string): CompleterResult;
-        (line: string, callback: (err: any, result: CompleterResult) => void): any;
-    }
-
-    export interface CompleterResult {
-        completions: string[];
-        line: string;
-    }
-
-    export interface ReadLineOptions {
-        input: NodeJS.ReadableStream;
-        output?: NodeJS.WritableStream;
-        completer?: Completer;
-        terminal?: boolean;
-        historySize?: number;
-    }
-
-    export function createInterface(input: NodeJS.ReadableStream, output?: NodeJS.WritableStream, completer?: Completer, terminal?: boolean): ReadLine;
-    export function createInterface(options: ReadLineOptions): ReadLine;
-
-    export function cursorTo(stream: NodeJS.WritableStream, x: number, y: number): void;
-    export function moveCursor(stream: NodeJS.WritableStream, dx: number|string, dy: number|string): void;
-    export function clearLine(stream: NodeJS.WritableStream, dir: number): void;
-    export function clearScreenDown(stream: NodeJS.WritableStream): void;
-}
-
-declare module "vm" {
-    export interface Context { }
-    export interface ScriptOptions {
-        filename?: string;
-        lineOffset?: number;
-        columnOffset?: number;
-        displayErrors?: boolean;
-        timeout?: number;
-        cachedData?: Buffer;
-        produceCachedData?: boolean;
-    }
-    export interface RunningScriptOptions {
-        filename?: string;
-        lineOffset?: number;
-        columnOffset?: number;
-        displayErrors?: boolean;
-        timeout?: number;
-    }
-    export class Script {
-        constructor(code: string, options?: ScriptOptions);
-        runInContext(contextifiedSandbox: Context, options?: RunningScriptOptions): any;
-        runInNewContext(sandbox?: Context, options?: RunningScriptOptions): any;
-        runInThisContext(options?: RunningScriptOptions): any;
-    }
-    export function createContext(sandbox?: Context): Context;
-    export function isContext(sandbox: Context): boolean;
-    export function runInContext(code: string, contextifiedSandbox: Context, options?: RunningScriptOptions): any;
-    export function runInDebugContext(code: string): any;
-    export function runInNewContext(code: string, sandbox?: Context, options?: RunningScriptOptions): any;
-    export function runInThisContext(code: string, options?: RunningScriptOptions): any;
-}
-
-declare module "child_process" {
-    import * as events from "events";
-    import * as stream from "stream";
-
-    export interface ChildProcess extends events.EventEmitter {
-        stdin:  stream.Writable;
-        stdout: stream.Readable;
-        stderr: stream.Readable;
-        stdio: [stream.Writable, stream.Readable, stream.Readable];
-        pid: number;
-        kill(signal?: string): void;
-        send(message: any, sendHandle?: any): void;
-        connected: boolean;
-        disconnect(): void;
-        unref(): void;
-    }
-
-    export interface SpawnOptions {
-        cwd?: string;
-        env?: any;
-        stdio?: any;
-        detached?: boolean;
-        uid?: number;
-        gid?: number;
-        shell?: boolean | string;
-    }
-    export function spawn(command: string, args?: string[], options?: SpawnOptions): ChildProcess;
-
-    export interface ExecOptions {
-        cwd?: string;
-        env?: any;
-        shell?: string;
-        timeout?: number;
-        maxBuffer?: number;
-        killSignal?: string;
-        uid?: number;
-        gid?: number;
-    }
-    export interface ExecOptionsWithStringEncoding extends ExecOptions {
-        encoding: BufferEncoding;
-    }
-    export interface ExecOptionsWithBufferEncoding extends ExecOptions {
-        encoding: string; // specify `null`.
-    }
-    export function exec(command: string, callback?: (error: Error, stdout: string, stderr: string) =>void ): ChildProcess;
-    export function exec(command: string, options: ExecOptionsWithStringEncoding, callback?: (error: Error, stdout: string, stderr: string) =>void ): ChildProcess;
-    // usage. child_process.exec("tsc", {encoding: null as string}, (err, stdout, stderr) => {});
-    export function exec(command: string, options: ExecOptionsWithBufferEncoding, callback?: (error: Error, stdout: Buffer, stderr: Buffer) =>void ): ChildProcess;
-    export function exec(command: string, options: ExecOptions, callback?: (error: Error, stdout: string, stderr: string) =>void ): ChildProcess;
-
-    export interface ExecFileOptions {
-        cwd?: string;
-        env?: any;
-        timeout?: number;
-        maxBuffer?: number;
-        killSignal?: string;
-        uid?: number;
-        gid?: number;
-    }
-    export interface ExecFileOptionsWithStringEncoding extends ExecFileOptions {
-        encoding: BufferEncoding;
-    }
-    export interface ExecFileOptionsWithBufferEncoding extends ExecFileOptions {
-        encoding: string; // specify `null`.
-    }
-    export function execFile(file: string, callback?: (error: Error, stdout: string, stderr: string) =>void ): ChildProcess;
-    export function execFile(file: string, options?: ExecFileOptionsWithStringEncoding, callback?: (error: Error, stdout: string, stderr: string) =>void ): ChildProcess;
-    // usage. child_process.execFile("file.sh", {encoding: null as string}, (err, stdout, stderr) => {});
-    export function execFile(file: string, options?: ExecFileOptionsWithBufferEncoding, callback?: (error: Error, stdout: Buffer, stderr: Buffer) =>void ): ChildProcess;
-    export function execFile(file: string, options?: ExecFileOptions, callback?: (error: Error, stdout: string, stderr: string) =>void ): ChildProcess;
-    export function execFile(file: string, args?: string[], callback?: (error: Error, stdout: string, stderr: string) =>void ): ChildProcess;
-    export function execFile(file: string, args?: string[], options?: ExecFileOptionsWithStringEncoding, callback?: (error: Error, stdout: string, stderr: string) =>void ): ChildProcess;
-    // usage. child_process.execFile("file.sh", ["foo"], {encoding: null as string}, (err, stdout, stderr) => {});
-    export function execFile(file: string, args?: string[], options?: ExecFileOptionsWithBufferEncoding, callback?: (error: Error, stdout: Buffer, stderr: Buffer) =>void ): ChildProcess;
-    export function execFile(file: string, args?: string[], options?: ExecFileOptions, callback?: (error: Error, stdout: string, stderr: string) =>void ): ChildProcess;
-
-    export interface ForkOptions {
-        cwd?: string;
-        env?: any;
-        execPath?: string;
-        execArgv?: string[];
-        silent?: boolean;
-        uid?: number;
-        gid?: number;
-    }
-    export function fork(modulePath: string, args?: string[], options?: ForkOptions): ChildProcess;
-
-    export interface SpawnSyncOptions {
-        cwd?: string;
-        input?: string | Buffer;
-        stdio?: any;
-        env?: any;
-        uid?: number;
-        gid?: number;
-        timeout?: number;
-        killSignal?: string;
-        maxBuffer?: number;
-        encoding?: string;
-        shell?: boolean | string;
-    }
-    export interface SpawnSyncOptionsWithStringEncoding extends SpawnSyncOptions {
-        encoding: BufferEncoding;
-    }
-    export interface SpawnSyncOptionsWithBufferEncoding extends SpawnSyncOptions {
-        encoding: string; // specify `null`.
-    }
-    export interface SpawnSyncReturns<T> {
-        pid: number;
-        output: string[];
-        stdout: T;
-        stderr: T;
-        status: number;
-        signal: string;
-        error: Error;
-    }
-    export function spawnSync(command: string): SpawnSyncReturns<Buffer>;
-    export function spawnSync(command: string, options?: SpawnSyncOptionsWithStringEncoding): SpawnSyncReturns<string>;
-    export function spawnSync(command: string, options?: SpawnSyncOptionsWithBufferEncoding): SpawnSyncReturns<Buffer>;
-    export function spawnSync(command: string, options?: SpawnSyncOptions): SpawnSyncReturns<Buffer>;
-    export function spawnSync(command: string, args?: string[], options?: SpawnSyncOptionsWithStringEncoding): SpawnSyncReturns<string>;
-    export function spawnSync(command: string, args?: string[], options?: SpawnSyncOptionsWithBufferEncoding): SpawnSyncReturns<Buffer>;
-    export function spawnSync(command: string, args?: string[], options?: SpawnSyncOptions): SpawnSyncReturns<Buffer>;
-
-    export interface ExecSyncOptions {
-        cwd?: string;
-        input?: string | Buffer;
-        stdio?: any;
-        env?: any;
-        shell?: string;
-        uid?: number;
-        gid?: number;
-        timeout?: number;
-        killSignal?: string;
-        maxBuffer?: number;
-        encoding?: string;
-    }
-    export interface ExecSyncOptionsWithStringEncoding extends ExecSyncOptions {
-        encoding: BufferEncoding;
-    }
-    export interface ExecSyncOptionsWithBufferEncoding extends ExecSyncOptions {
-        encoding: string; // specify `null`.
-    }
-    export function execSync(command: string): Buffer;
-    export function execSync(command: string, options?: ExecSyncOptionsWithStringEncoding): string;
-    export function execSync(command: string, options?: ExecSyncOptionsWithBufferEncoding): Buffer;
-    export function execSync(command: string, options?: ExecSyncOptions): Buffer;
-
-    export interface ExecFileSyncOptions {
-        cwd?: string;
-        input?: string | Buffer;
-        stdio?: any;
-        env?: any;
-        uid?: number;
-        gid?: number;
-        timeout?: number;
-        killSignal?: string;
-        maxBuffer?: number;
-        encoding?: string;
-    }
-    export interface ExecFileSyncOptionsWithStringEncoding extends ExecFileSyncOptions {
-        encoding: BufferEncoding;
-    }
-    export interface ExecFileSyncOptionsWithBufferEncoding extends ExecFileSyncOptions {
-        encoding: string; // specify `null`.
-    }
-    export function execFileSync(command: string): Buffer;
-    export function execFileSync(command: string, options?: ExecFileSyncOptionsWithStringEncoding): string;
-    export function execFileSync(command: string, options?: ExecFileSyncOptionsWithBufferEncoding): Buffer;
-    export function execFileSync(command: string, options?: ExecFileSyncOptions): Buffer;
-    export function execFileSync(command: string, args?: string[], options?: ExecFileSyncOptionsWithStringEncoding): string;
-    export function execFileSync(command: string, args?: string[], options?: ExecFileSyncOptionsWithBufferEncoding): Buffer;
-    export function execFileSync(command: string, args?: string[], options?: ExecFileSyncOptions): Buffer;
-}
-
-declare module "url" {
-    export interface Url {
-        href?: string;
-        protocol?: string;
-        auth?: string;
-        hostname?: string;
-        port?: string;
-        host?: string;
-        pathname?: string;
-        search?: string;
-        query?: string | any;
-        slashes?: boolean;
-        hash?: string;
-        path?: string;
-    }
-
-    export function parse(urlStr: string, parseQueryString?: boolean , slashesDenoteHost?: boolean ): Url;
-    export function format(url: Url): string;
-    export function resolve(from: string, to: string): string;
-}
-
-declare module "dns" {
-    export function lookup(domain: string, family: number, callback: (err: Error, address: string, family: number) =>void ): string;
-    export function lookup(domain: string, callback: (err: Error, address: string, family: number) =>void ): string;
-    export function resolve(domain: string, rrtype: string, callback: (err: Error, addresses: string[]) =>void ): string[];
-    export function resolve(domain: string, callback: (err: Error, addresses: string[]) =>void ): string[];
-    export function resolve4(domain: string, callback: (err: Error, addresses: string[]) =>void ): string[];
-    export function resolve6(domain: string, callback: (err: Error, addresses: string[]) =>void ): string[];
-    export function resolveMx(domain: string, callback: (err: Error, addresses: string[]) =>void ): string[];
-    export function resolveTxt(domain: string, callback: (err: Error, addresses: string[]) =>void ): string[];
-    export function resolveSrv(domain: string, callback: (err: Error, addresses: string[]) =>void ): string[];
-    export function resolveNs(domain: string, callback: (err: Error, addresses: string[]) =>void ): string[];
-    export function resolveCname(domain: string, callback: (err: Error, addresses: string[]) =>void ): string[];
-    export function reverse(ip: string, callback: (err: Error, domains: string[]) =>void ): string[];
-}
-
-declare module "net" {
-    import * as stream from "stream";
-
-    export interface Socket extends stream.Duplex {
-        // Extended base methods
-        write(buffer: Buffer): boolean;
-        write(buffer: Buffer, cb?: Function): boolean;
-        write(str: string, cb?: Function): boolean;
-        write(str: string, encoding?: string, cb?: Function): boolean;
-        write(str: string, encoding?: string, fd?: string): boolean;
-
-        connect(port: number, host?: string, connectionListener?: Function): void;
-        connect(path: string, connectionListener?: Function): void;
-        bufferSize: number;
-        setEncoding(encoding?: string): void;
-        write(data: any, encoding?: string, callback?: Function): void;
-        destroy(): void;
-        pause(): void;
-        resume(): void;
-        setTimeout(timeout: number, callback?: Function): void;
-        setNoDelay(noDelay?: boolean): void;
-        setKeepAlive(enable?: boolean, initialDelay?: number): void;
-        address(): { port: number; family: string; address: string; };
-        unref(): void;
-        ref(): void;
-
-        remoteAddress: string;
-        remoteFamily: string;
-        remotePort: number;
-        localAddress: string;
-        localPort: number;
-        bytesRead: number;
-        bytesWritten: number;
-
-        // Extended base methods
-        end(): void;
-        end(buffer: Buffer, cb?: Function): void;
-        end(str: string, cb?: Function): void;
-        end(str: string, encoding?: string, cb?: Function): void;
-        end(data?: any, encoding?: string): void;
-    }
-
-    export var Socket: {
-        new (options?: { fd?: string; type?: string; allowHalfOpen?: boolean; }): Socket;
-    };
-
-    export interface ListenOptions {
-        port?: number;
-        host?: string;
-        backlog?: number;
-        path?: string;
-        exclusive?: boolean;
-    }
-
-    export interface Server extends Socket {
-        listen(port: number, hostname?: string, backlog?: number, listeningListener?: Function): Server;
-        listen(port: number, hostname?: string, listeningListener?: Function): Server;
-        listen(port: number, backlog?: number, listeningListener?: Function): Server;
-        listen(port: number, listeningListener?: Function): Server;
-        listen(path: string, backlog?: number, listeningListener?: Function): Server;
-        listen(path: string, listeningListener?: Function): Server;
-        listen(handle: any, backlog?: number, listeningListener?: Function): Server;
-        listen(handle: any, listeningListener?: Function): Server;
-        listen(options: ListenOptions, listeningListener?: Function): Server;
-        close(callback?: Function): Server;
-        address(): { port: number; family: string; address: string; };
-        getConnections(cb: (error: Error, count: number) => void): void;
-        ref(): Server;
-        unref(): Server;
-        maxConnections: number;
-        connections: number;
-    }
-    export function createServer(connectionListener?: (socket: Socket) =>void ): Server;
-    export function createServer(options?: { allowHalfOpen?: boolean; }, connectionListener?: (socket: Socket) =>void ): Server;
-    export function connect(options: { port: number, host?: string, localAddress? : string, localPort? : string, family? : number, allowHalfOpen?: boolean; }, connectionListener?: Function): Socket;
-    export function connect(port: number, host?: string, connectionListener?: Function): Socket;
-    export function connect(path: string, connectionListener?: Function): Socket;
-    export function createConnection(options: { port: number, host?: string, localAddress? : string, localPort? : string, family? : number, allowHalfOpen?: boolean; }, connectionListener?: Function): Socket;
-    export function createConnection(port: number, host?: string, connectionListener?: Function): Socket;
-    export function createConnection(path: string, connectionListener?: Function): Socket;
-    export function isIP(input: string): number;
-    export function isIPv4(input: string): boolean;
-    export function isIPv6(input: string): boolean;
-}
-
-declare module "dgram" {
-    import * as events from "events";
-
-    interface RemoteInfo {
-        address: string;
-        port: number;
-        size: number;
-    }
-
-    interface AddressInfo {
-        address: string;
-        family: string;
-        port: number;
-    }
-
-    export function createSocket(type: string, callback?: (msg: Buffer, rinfo: RemoteInfo) => void): Socket;
-
-    interface Socket extends events.EventEmitter {
-        send(buf: Buffer, offset: number, length: number, port: number, address: string, callback?: (error: Error, bytes: number) => void): void;
-        bind(port: number, address?: string, callback?: () => void): void;
-        close(): void;
-        address(): AddressInfo;
-        setBroadcast(flag: boolean): void;
-        setMulticastTTL(ttl: number): void;
-        setMulticastLoopback(flag: boolean): void;
-        addMembership(multicastAddress: string, multicastInterface?: string): void;
-        dropMembership(multicastAddress: string, multicastInterface?: string): void;
-    }
-}
-
-declare module "fs" {
-    import * as stream from "stream";
-    import * as events from "events";
-
-    interface Stats {
-        isFile(): boolean;
-        isDirectory(): boolean;
-        isBlockDevice(): boolean;
-        isCharacterDevice(): boolean;
-        isSymbolicLink(): boolean;
-        isFIFO(): boolean;
-        isSocket(): boolean;
-        dev: number;
-        ino: number;
-        mode: number;
-        nlink: number;
-        uid: number;
-        gid: number;
-        rdev: number;
-        size: number;
-        blksize: number;
-        blocks: number;
-        atime: Date;
-        mtime: Date;
-        ctime: Date;
-        birthtime: Date;
-    }
-
-    interface FSWatcher extends events.EventEmitter {
-        close(): void;
-    }
-
-    export interface ReadStream extends stream.Readable {
-        close(): void;
-        destroy(): void;
-    }
-    export interface WriteStream extends stream.Writable {
-        close(): void;
-        bytesWritten: number;
-    }
-
-    /**
-     * Asynchronous rename.
-     * @param oldPath
-     * @param newPath
-     * @param callback No arguments other than a possible exception are given to the completion callback.
-     */
-    export function rename(oldPath: string, newPath: string, callback?: (err?: NodeJS.ErrnoException) => void): void;
-    /**
-     * Synchronous rename
-     * @param oldPath
-     * @param newPath
-     */
-    export function renameSync(oldPath: string, newPath: string): void;
-    export function truncate(path: string | Buffer, callback?: (err?: NodeJS.ErrnoException) => void): void;
-    export function truncate(path: string | Buffer, len: number, callback?: (err?: NodeJS.ErrnoException) => void): void;
-    export function truncateSync(path: string | Buffer, len?: number): void;
-    export function ftruncate(fd: number, callback?: (err?: NodeJS.ErrnoException) => void): void;
-    export function ftruncate(fd: number, len: number, callback?: (err?: NodeJS.ErrnoException) => void): void;
-    export function ftruncateSync(fd: number, len?: number): void;
-    export function chown(path: string | Buffer, uid: number, gid: number, callback?: (err?: NodeJS.ErrnoException) => void): void;
-    export function chownSync(path: string | Buffer, uid: number, gid: number): void;
-    export function fchown(fd: number, uid: number, gid: number, callback?: (err?: NodeJS.ErrnoException) => void): void;
-    export function fchownSync(fd: number, uid: number, gid: number): void;
-    export function lchown(path: string | Buffer, uid: number, gid: number, callback?: (err?: NodeJS.ErrnoException) => void): void;
-    export function lchownSync(path: string | Buffer, uid: number, gid: number): void;
-    export function chmod(path: string | Buffer, mode: number, callback?: (err?: NodeJS.ErrnoException) => void): void;
-    export function chmod(path: string | Buffer, mode: string, callback?: (err?: NodeJS.ErrnoException) => void): void;
-    export function chmodSync(path: string | Buffer, mode: number): void;
-    export function chmodSync(path: string | Buffer, mode: string): void;
-    export function fchmod(fd: number, mode: number, callback?: (err?: NodeJS.ErrnoException) => void): void;
-    export function fchmod(fd: number, mode: string, callback?: (err?: NodeJS.ErrnoException) => void): void;
-    export function fchmodSync(fd: number, mode: number): void;
-    export function fchmodSync(fd: number, mode: string): void;
-    export function lchmod(path: string | Buffer, mode: number, callback?: (err?: NodeJS.ErrnoException) => void): void;
-    export function lchmod(path: string | Buffer, mode: string, callback?: (err?: NodeJS.ErrnoException) => void): void;
-    export function lchmodSync(path: string | Buffer, mode: number): void;
-    export function lchmodSync(path: string | Buffer, mode: string): void;
-    export function stat(path: string | Buffer, callback?: (err: NodeJS.ErrnoException, stats: Stats) => any): void;
-    export function lstat(path: string | Buffer, callback?: (err: NodeJS.ErrnoException, stats: Stats) => any): void;
-    export function fstat(fd: number, callback?: (err: NodeJS.ErrnoException, stats: Stats) => any): void;
-    export function statSync(path: string | Buffer): Stats;
-    export function lstatSync(path: string | Buffer): Stats;
-    export function fstatSync(fd: number): Stats;
-    export function link(srcpath: string | Buffer, dstpath: string | Buffer, callback?: (err?: NodeJS.ErrnoException) => void): void;
-    export function linkSync(srcpath: string | Buffer, dstpath: string | Buffer): void;
-    export function symlink(srcpath: string | Buffer, dstpath: string | Buffer, type?: string, callback?: (err?: NodeJS.ErrnoException) => void): void;
-    export function symlinkSync(srcpath: string | Buffer, dstpath: string | Buffer, type?: string): void;
-    export function readlink(path: string | Buffer, callback?: (err: NodeJS.ErrnoException, linkString: string) => any): void;
-    export function readlinkSync(path: string | Buffer): string;
-    export function realpath(path: string | Buffer, callback?: (err: NodeJS.ErrnoException, resolvedPath: string) => any): void;
-    export function realpath(path: string | Buffer, cache: {[path: string]: string}, callback: (err: NodeJS.ErrnoException, resolvedPath: string) => any): void;
-    export function realpathSync(path: string | Buffer, cache?: { [path: string]: string }): string;
-    /*
-     * Asynchronous unlink - deletes the file specified in {path}
-     *
-     * @param path
-     * @param callback No arguments other than a possible exception are given to the completion callback.
-     */
-    export function unlink(path: string | Buffer, callback?: (err?: NodeJS.ErrnoException) => void): void;
-    /*
-     * Synchronous unlink - deletes the file specified in {path}
-     *
-     * @param path
-     */
-    export function unlinkSync(path: string | Buffer): void;
-    /*
-     * Asynchronous rmdir - removes the directory specified in {path}
-     *
-     * @param path
-     * @param callback No arguments other than a possible exception are given to the completion callback.
-     */
-    export function rmdir(path: string | Buffer, callback?: (err?: NodeJS.ErrnoException) => void): void;
-    /*
-     * Synchronous rmdir - removes the directory specified in {path}
-     *
-     * @param path
-     */
-    export function rmdirSync(path: string | Buffer): void;
-    /*
-     * Asynchronous mkdir - creates the directory specified in {path}.  Parameter {mode} defaults to 0777.
-     *
-     * @param path
-     * @param callback No arguments other than a possible exception are given to the completion callback.
-     */
-    export function mkdir(path: string | Buffer, callback?: (err?: NodeJS.ErrnoException) => void): void;
-    /*
-     * Asynchronous mkdir - creates the directory specified in {path}.  Parameter {mode} defaults to 0777.
-     *
-     * @param path
-     * @param mode
-     * @param callback No arguments other than a possible exception are given to the completion callback.
-     */
-    export function mkdir(path: string | Buffer, mode: number, callback?: (err?: NodeJS.ErrnoException) => void): void;
-    /*
-     * Asynchronous mkdir - creates the directory specified in {path}.  Parameter {mode} defaults to 0777.
-     *
-     * @param path
-     * @param mode
-     * @param callback No arguments other than a possible exception are given to the completion callback.
-     */
-    export function mkdir(path: string | Buffer, mode: string, callback?: (err?: NodeJS.ErrnoException) => void): void;
-    /*
-     * Synchronous mkdir - creates the directory specified in {path}.  Parameter {mode} defaults to 0777.
-     *
-     * @param path
-     * @param mode
-     * @param callback No arguments other than a possible exception are given to the completion callback.
-     */
-    export function mkdirSync(path: string | Buffer, mode?: number): void;
-    /*
-     * Synchronous mkdir - creates the directory specified in {path}.  Parameter {mode} defaults to 0777.
-     *
-     * @param path
-     * @param mode
-     * @param callback No arguments other than a possible exception are given to the completion callback.
-     */
-    export function mkdirSync(path: string | Buffer, mode?: string): void;
-    /*
-     * Asynchronous mkdtemp - Creates a unique temporary directory. Generates six random characters to be appended behind a required prefix to create a unique temporary directory.
-     *
-     * @param prefix
-     * @param callback The created folder path is passed as a string to the callback's second parameter.
-     */
-    export function mkdtemp(prefix: string, callback?: (err: NodeJS.ErrnoException, folder: string) => void): void;
-    /*
-     * Synchronous mkdtemp - Creates a unique temporary directory. Generates six random characters to be appended behind a required prefix to create a unique temporary directory.
-     *
-     * @param prefix
-     * @returns Returns the created folder path.
-     */
-    export function mkdtempSync(prefix: string): string;
-    export function readdir(path: string | Buffer, callback?: (err: NodeJS.ErrnoException, files: string[]) => void): void;
-    export function readdirSync(path: string | Buffer): string[];
-    export function close(fd: number, callback?: (err?: NodeJS.ErrnoException) => void): void;
-    export function closeSync(fd: number): void;
-    export function open(path: string | Buffer, flags: string, callback?: (err: NodeJS.ErrnoException, fd: number) => any): void;
-    export function open(path: string | Buffer, flags: string, mode: number, callback?: (err: NodeJS.ErrnoException, fd: number) => any): void;
-    export function open(path: string | Buffer, flags: string, mode: string, callback?: (err: NodeJS.ErrnoException, fd: number) => any): void;
-    export function openSync(path: string | Buffer, flags: string, mode?: number): number;
-    export function openSync(path: string | Buffer, flags: string, mode?: string): number;
-    export function utimes(path: string | Buffer, atime: number, mtime: number, callback?: (err?: NodeJS.ErrnoException) => void): void;
-    export function utimes(path: string | Buffer, atime: Date, mtime: Date, callback?: (err?: NodeJS.ErrnoException) => void): void;
-    export function utimesSync(path: string | Buffer, atime: number, mtime: number): void;
-    export function utimesSync(path: string | Buffer, atime: Date, mtime: Date): void;
-    export function futimes(fd: number, atime: number, mtime: number, callback?: (err?: NodeJS.ErrnoException) => void): void;
-    export function futimes(fd: number, atime: Date, mtime: Date, callback?: (err?: NodeJS.ErrnoException) => void): void;
-    export function futimesSync(fd: number, atime: number, mtime: number): void;
-    export function futimesSync(fd: number, atime: Date, mtime: Date): void;
-    export function fsync(fd: number, callback?: (err?: NodeJS.ErrnoException) => void): void;
-    export function fsyncSync(fd: number): void;
-    export function write(fd: number, buffer: Buffer, offset: number, length: number, position: number, callback?: (err: NodeJS.ErrnoException, written: number, buffer: Buffer) => void): void;
-    export function write(fd: number, buffer: Buffer, offset: number, length: number, callback?: (err: NodeJS.ErrnoException, written: number, buffer: Buffer) => void): void;
-    export function write(fd: number, data: any, callback?: (err: NodeJS.ErrnoException, written: number, str: string) => void): void;
-    export function write(fd: number, data: any, offset: number, callback?: (err: NodeJS.ErrnoException, written: number, str: string) => void): void;
-    export function write(fd: number, data: any, offset: number, encoding: string, callback?: (err: NodeJS.ErrnoException, written: number, str: string) => void): void;
-    export function writeSync(fd: number, buffer: Buffer, offset: number, length: number, position?: number): number;
-    export function writeSync(fd: number, data: any, position?: number, enconding?: string): number;
-    export function read(fd: number, buffer: Buffer, offset: number, length: number, position: number, callback?: (err: NodeJS.ErrnoException, bytesRead: number, buffer: Buffer) => void): void;
-    export function readSync(fd: number, buffer: Buffer, offset: number, length: number, position: number): number;
-    /*
-     * Asynchronous readFile - Asynchronously reads the entire contents of a file.
-     *
-     * @param fileName
-     * @param encoding
-     * @param callback - The callback is passed two arguments (err, data), where data is the contents of the file.
-     */
-    export function readFile(filename: string, encoding: string, callback: (err: NodeJS.ErrnoException, data: string) => void): void;
-    /*
-     * Asynchronous readFile - Asynchronously reads the entire contents of a file.
-     *
-     * @param fileName
-     * @param options An object with optional {encoding} and {flag} properties.  If {encoding} is specified, readFile returns a string; otherwise it returns a Buffer.
-     * @param callback - The callback is passed two arguments (err, data), where data is the contents of the file.
-     */
-    export function readFile(filename: string, options: { encoding: string; flag?: string; }, callback: (err: NodeJS.ErrnoException, data: string) => void): void;
-    /*
-     * Asynchronous readFile - Asynchronously reads the entire contents of a file.
-     *
-     * @param fileName
-     * @param options An object with optional {encoding} and {flag} properties.  If {encoding} is specified, readFile returns a string; otherwise it returns a Buffer.
-     * @param callback - The callback is passed two arguments (err, data), where data is the contents of the file.
-     */
-    export function readFile(filename: string, options: { flag?: string; }, callback: (err: NodeJS.ErrnoException, data: Buffer) => void): void;
-    /*
-     * Asynchronous readFile - Asynchronously reads the entire contents of a file.
-     *
-     * @param fileName
-     * @param callback - The callback is passed two arguments (err, data), where data is the contents of the file.
-     */
-    export function readFile(filename: string, callback: (err: NodeJS.ErrnoException, data: Buffer) => void): void;
-    /*
-     * Synchronous readFile - Synchronously reads the entire contents of a file.
-     *
-     * @param fileName
-     * @param encoding
-     */
-    export function readFileSync(filename: string, encoding: string): string;
-    /*
-     * Synchronous readFile - Synchronously reads the entire contents of a file.
-     *
-     * @param fileName
-     * @param options An object with optional {encoding} and {flag} properties.  If {encoding} is specified, readFileSync returns a string; otherwise it returns a Buffer.
-     */
-    export function readFileSync(filename: string, options: { encoding: string; flag?: string; }): string;
-    /*
-     * Synchronous readFile - Synchronously reads the entire contents of a file.
-     *
-     * @param fileName
-     * @param options An object with optional {encoding} and {flag} properties.  If {encoding} is specified, readFileSync returns a string; otherwise it returns a Buffer.
-     */
-    export function readFileSync(filename: string, options?: { flag?: string; }): Buffer;
-    export function writeFile(filename: string, data: any, callback?: (err: NodeJS.ErrnoException) => void): void;
-    export function writeFile(filename: string, data: any, options: { encoding?: string; mode?: number; flag?: string; }, callback?: (err: NodeJS.ErrnoException) => void): void;
-    export function writeFile(filename: string, data: any, options: { encoding?: string; mode?: string; flag?: string; }, callback?: (err: NodeJS.ErrnoException) => void): void;
-    export function writeFileSync(filename: string, data: any, options?: { encoding?: string; mode?: number; flag?: string; }): void;
-    export function writeFileSync(filename: string, data: any, options?: { encoding?: string; mode?: string; flag?: string; }): void;
-    export function appendFile(filename: string, data: any, options: { encoding?: string; mode?: number; flag?: string; }, callback?: (err: NodeJS.ErrnoException) => void): void;
-    export function appendFile(filename: string, data: any, options: { encoding?: string; mode?: string; flag?: string; }, callback?: (err: NodeJS.ErrnoException) => void): void;
-    export function appendFile(filename: string, data: any, callback?: (err: NodeJS.ErrnoException) => void): void;
-    export function appendFileSync(filename: string, data: any, options?: { encoding?: string; mode?: number; flag?: string; }): void;
-    export function appendFileSync(filename: string, data: any, options?: { encoding?: string; mode?: string; flag?: string; }): void;
-    export function watchFile(filename: string, listener: (curr: Stats, prev: Stats) => void): void;
-    export function watchFile(filename: string, options: { persistent?: boolean; interval?: number; }, listener: (curr: Stats, prev: Stats) => void): void;
-    export function unwatchFile(filename: string, listener?: (curr: Stats, prev: Stats) => void): void;
-    export function watch(filename: string, listener?: (event: string, filename: string) => any): FSWatcher;
-    export function watch(filename: string, encoding: string, listener?: (event: string, filename: string) => any): FSWatcher;
-    export function watch(filename: string, options: { persistent?: boolean; recursive?: boolean; encoding?: string }, listener?: (event: string, filename: string) => any): FSWatcher;
-    export function exists(path: string | Buffer, callback?: (exists: boolean) => void): void;
-    export function existsSync(path: string | Buffer): boolean;
-    /** Constant for fs.access(). File is visible to the calling process. */
-    export var F_OK: number;
-    /** Constant for fs.access(). File can be read by the calling process. */
-    export var R_OK: number;
-    /** Constant for fs.access(). File can be written by the calling process. */
-    export var W_OK: number;
-    /** Constant for fs.access(). File can be executed by the calling process. */
-    export var X_OK: number;
-    /** Tests a user's permissions for the file specified by path. */
-    export function access(path: string | Buffer, callback: (err: NodeJS.ErrnoException) => void): void;
-    export function access(path: string | Buffer, mode: number, callback: (err: NodeJS.ErrnoException) => void): void;
-    /** Synchronous version of fs.access. This throws if any accessibility checks fail, and does nothing otherwise. */
-    export function accessSync(path: string | Buffer, mode ?: number): void;
-    export function createReadStream(path: string | Buffer, options?: {
-        flags?: string;
-        encoding?: string;
-        fd?: number;
-        mode?: number;
-        autoClose?: boolean;
-        start?: number;
-        end?: number;
-    }): ReadStream;
-    export function createWriteStream(path: string | Buffer, options?: {
-        flags?: string;
-        encoding?: string;
-        fd?: number;
-        mode?: number;
-    }): WriteStream;
-}
-
-declare module "path" {
-
-    /**
-     * A parsed path object generated by path.parse() or consumed by path.format().
-     */
-    export interface ParsedPath {
-        /**
-         * The root of the path such as '/' or 'c:\'
-         */
-        root: string;
-        /**
-         * The full directory path such as '/home/user/dir' or 'c:\path\dir'
-         */
-        dir: string;
-        /**
-         * The file name including extension (if any) such as 'index.html'
-         */
-        base: string;
-        /**
-         * The file extension (if any) such as '.html'
-         */
-        ext: string;
-        /**
-         * The file name without extension (if any) such as 'index'
-         */
-        name: string;
-    }
-
-    /**
-     * Normalize a string path, reducing '..' and '.' parts.
-     * When multiple slashes are found, they're replaced by a single one; when the path contains a trailing slash, it is preserved. On Windows backslashes are used.
-     *
-     * @param p string path to normalize.
-     */
-    export function normalize(p: string): string;
-    /**
-     * Join all arguments together and normalize the resulting path.
-     * Arguments must be strings. In v0.8, non-string arguments were silently ignored. In v0.10 and up, an exception is thrown.
-     *
-     * @param paths string paths to join.
-     */
-    export function join(...paths: any[]): string;
-    /**
-     * Join all arguments together and normalize the resulting path.
-     * Arguments must be strings. In v0.8, non-string arguments were silently ignored. In v0.10 and up, an exception is thrown.
-     *
-     * @param paths string paths to join.
-     */
-    export function join(...paths: string[]): string;
-    /**
-     * The right-most parameter is considered {to}.  Other parameters are considered an array of {from}.
-     *
-     * Starting from leftmost {from} paramter, resolves {to} to an absolute path.
-     *
-     * If {to} isn't already absolute, {from} arguments are prepended in right to left order, until an absolute path is found. If after using all {from} paths still no absolute path is found, the current working directory is used as well. The resulting path is normalized, and trailing slashes are removed unless the path gets resolved to the root directory.
-     *
-     * @param pathSegments string paths to join.  Non-string arguments are ignored.
-     */
-    export function resolve(...pathSegments: any[]): string;
-    /**
-     * Determines whether {path} is an absolute path. An absolute path will always resolve to the same location, regardless of the working directory.
-     *
-     * @param path path to test.
-     */
-    export function isAbsolute(path: string): boolean;
-    /**
-     * Solve the relative path from {from} to {to}.
-     * At times we have two absolute paths, and we need to derive the relative path from one to the other. This is actually the reverse transform of path.resolve.
-     *
-     * @param from
-     * @param to
-     */
-    export function relative(from: string, to: string): string;
-    /**
-     * Return the directory name of a path. Similar to the Unix dirname command.
-     *
-     * @param p the path to evaluate.
-     */
-    export function dirname(p: string): string;
-    /**
-     * Return the last portion of a path. Similar to the Unix basename command.
-     * Often used to extract the file name from a fully qualified path.
-     *
-     * @param p the path to evaluate.
-     * @param ext optionally, an extension to remove from the result.
-     */
-    export function basename(p: string, ext?: string): string;
-    /**
-     * Return the extension of the path, from the last '.' to end of string in the last portion of the path.
-     * If there is no '.' in the last portion of the path or the first character of it is '.', then it returns an empty string
-     *
-     * @param p the path to evaluate.
-     */
-    export function extname(p: string): string;
-    /**
-     * The platform-specific file separator. '\\' or '/'.
-     */
-    export var sep: string;
-    /**
-     * The platform-specific file delimiter. ';' or ':'.
-     */
-    export var delimiter: string;
-    /**
-     * Returns an object from a path string - the opposite of format().
-     *
-     * @param pathString path to evaluate.
-     */
-    export function parse(pathString: string): ParsedPath;
-    /**
-     * Returns a path string from an object - the opposite of parse().
-     *
-     * @param pathString path to evaluate.
-     */
-    export function format(pathObject: ParsedPath): string;
-
-    export module posix {
-      export function normalize(p: string): string;
-      export function join(...paths: any[]): string;
-      export function resolve(...pathSegments: any[]): string;
-      export function isAbsolute(p: string): boolean;
-      export function relative(from: string, to: string): string;
-      export function dirname(p: string): string;
-      export function basename(p: string, ext?: string): string;
-      export function extname(p: string): string;
-      export var sep: string;
-      export var delimiter: string;
-      export function parse(p: string): ParsedPath;
-      export function format(pP: ParsedPath): string;
-    }
-
-    export module win32 {
-      export function normalize(p: string): string;
-      export function join(...paths: any[]): string;
-      export function resolve(...pathSegments: any[]): string;
-      export function isAbsolute(p: string): boolean;
-      export function relative(from: string, to: string): string;
-      export function dirname(p: string): string;
-      export function basename(p: string, ext?: string): string;
-      export function extname(p: string): string;
-      export var sep: string;
-      export var delimiter: string;
-      export function parse(p: string): ParsedPath;
-      export function format(pP: ParsedPath): string;
-    }
-}
-
-declare module "string_decoder" {
-    export interface NodeStringDecoder {
-        write(buffer: Buffer): string;
-        detectIncompleteChar(buffer: Buffer): number;
-    }
-    export var StringDecoder: {
-        new (encoding: string): NodeStringDecoder;
-    };
-}
-
-declare module "tls" {
-    import * as crypto from "crypto";
-    import * as net from "net";
-    import * as stream from "stream";
-
-    var CLIENT_RENEG_LIMIT: number;
-    var CLIENT_RENEG_WINDOW: number;
-    
-    export interface Certificate {
-        /**
-         * Country code.
-         */
-        C: string;
-        /**
-         * Street.
-         */
-        ST: string;
-        /**
-         * Locality.
-         */
-        L: string;
-        /**
-         * Organization.
-         */
-        O: string;
-        /**
-         * Organizational unit.
-         */
-        OU: string;
-        /**
-         * Common name.
-         */
-        CN: string;
-    }
-
-    export interface CipherNameAndProtocol {
-        /**
-         * The cipher name.
-         */
-        name: string;
-        /**
-         * SSL/TLS protocol version.
-         */
-        version: string;
-    }
-
-    export class TLSSocket extends stream.Duplex {
-        /**
-         * Returns the bound address, the address family name and port of the underlying socket as reported by
-         * the operating system. 
-         * @returns {any} - An object with three properties, e.g. { port: 12346, family: 'IPv4', address: '127.0.0.1' }.
-         */
-        address(): { port: number; family: string; address: string };
-        /**
-         * A boolean that is true if the peer certificate was signed by one of the specified CAs, otherwise false.
-         */
-        authorized: boolean;
-        /**
-         * The reason why the peer's certificate has not been verified.
-         * This property becomes available only when tlsSocket.authorized === false.
-         */
-        authorizationError: Error;
-        /**
-         * Static boolean value, always true.
-         * May be used to distinguish TLS sockets from regular ones.
-         */
-        encrypted: boolean;
-        /**
-         * Returns an object representing the cipher name and the SSL/TLS protocol version of the current connection.
-         * @returns {CipherNameAndProtocol} - Returns an object representing the cipher name
-         * and the SSL/TLS protocol version of the current connection.
-         */
-        getCipher(): CipherNameAndProtocol;
-        /**
-         * Returns an object representing the peer's certificate.
-         * The returned object has some properties corresponding to the field of the certificate.
-         * If detailed argument is true the full chain with issuer property will be returned,
-         * if false only the top certificate without issuer property.
-         * If the peer does not provide a certificate, it returns null or an empty object.
-         * @param {boolean} detailed - If true; the full chain with issuer property will be returned.
-         * @returns {any} - An object representing the peer's certificate.
-         */
-        getPeerCertificate(detailed?: boolean): {
-            subject: Certificate;
-            issuerInfo: Certificate;
-            issuer: Certificate;
-            raw: any;
-            valid_from: string;
-            valid_to: string;
-            fingerprint: string;
-            serialNumber: string;
-        };
-        /**
-         * Could be used to speed up handshake establishment when reconnecting to the server.
-         * @returns {any} - ASN.1 encoded TLS session or undefined if none was negotiated.
-         */
-        getSession(): any;
-        /**
-         * NOTE: Works only with client TLS sockets.
-         * Useful only for debugging, for session reuse provide session option to tls.connect().
-         * @returns {any} - TLS session ticket or undefined if none was negotiated.
-         */
-        getTLSTicket(): any;
-        /**
-         * The string representation of the local IP address.
-         */
-        localAddress: string;
-        /**
-         * The numeric representation of the local port.
-         */
-        localPort: string;
-        /**
-         * The string representation of the remote IP address.
-         * For example, '74.125.127.100' or '2001:4860:a005::68'.
-         */
-        remoteAddress: string;
-        /**
-         * The string representation of the remote IP family. 'IPv4' or 'IPv6'.
-         */
-        remoteFamily: string;
-        /**
-         * The numeric representation of the remote port. For example, 443.
-         */
-        remotePort: number;
-        /**
-         * Initiate TLS renegotiation process.
-         *  
-         * NOTE: Can be used to request peer's certificate after the secure connection has been established.
-         * ANOTHER NOTE: When running as the server, socket will be destroyed with an error after handshakeTimeout timeout.
-         * @param {TlsOptions} options - The options may contain the following fields: rejectUnauthorized,
-         * requestCert (See tls.createServer() for details).
-         * @param {Function} callback - callback(err) will be executed with null as err, once the renegotiation
-         * is successfully completed.
-         */
-        renegotiate(options: TlsOptions, callback: (err: Error) => any): any;
-        /**
-         * Set maximum TLS fragment size (default and maximum value is: 16384, minimum is: 512).
-         * Smaller fragment size decreases buffering latency on the client: large fragments are buffered by
-         * the TLS layer until the entire fragment is received and its integrity is verified;
-         * large fragments can span multiple roundtrips, and their processing can be delayed due to packet
-         * loss or reordering. However, smaller fragments add extra TLS framing bytes and CPU overhead,
-         * which may decrease overall server throughput.
-         * @param {number} size - TLS fragment size (default and maximum value is: 16384, minimum is: 512).
-         * @returns {boolean} - Returns true on success, false otherwise.
-         */
-        setMaxSendFragment(size: number): boolean;
-    }
-    
-    export interface TlsOptions {
-        host?: string;
-        port?: number;
-        pfx?: any;   //string or buffer
-        key?: any;   //string or buffer
-        passphrase?: string;
-        cert?: any;
-        ca?: any;    //string or buffer
-        crl?: any;   //string or string array
-        ciphers?: string;
-        honorCipherOrder?: any;
-        requestCert?: boolean;
-        rejectUnauthorized?: boolean;
-        NPNProtocols?: any;  //array or Buffer;
-        SNICallback?: (servername: string) => any;
-    }
-
-    export interface ConnectionOptions {
-        host?: string;
-        port?: number;
-        socket?: net.Socket;
-        pfx?: string | Buffer
-        key?: string | Buffer
-        passphrase?: string;
-        cert?: string | Buffer
-        ca?: (string | Buffer)[];
-        rejectUnauthorized?: boolean;
-        NPNProtocols?: (string | Buffer)[];
-        servername?: string;
-    }
-
-    export interface Server extends net.Server {
-        close(): Server;
-        address(): { port: number; family: string; address: string; };
-        addContext(hostName: string, credentials: {
-            key: string;
-            cert: string;
-            ca: string;
-        }): void;
-        maxConnections: number;
-        connections: number;
-    }
-
-    export interface ClearTextStream extends stream.Duplex {
-        authorized: boolean;
-        authorizationError: Error;
-        getPeerCertificate(): any;
-        getCipher: {
-            name: string;
-            version: string;
-        };
-        address: {
-            port: number;
-            family: string;
-            address: string;
-        };
-        remoteAddress: string;
-        remotePort: number;
-    }
-
-    export interface SecurePair {
-        encrypted: any;
-        cleartext: any;
-    }
-
-    export interface SecureContextOptions {
-        pfx?: string | Buffer;
-        key?: string | Buffer;
-        passphrase?: string;
-        cert?: string | Buffer;
-        ca?: string | Buffer;
-        crl?: string | string[]
-        ciphers?: string;
-        honorCipherOrder?: boolean;
-    }
-
-    export interface SecureContext {
-        context: any;
-    }
-
-    export function createServer(options: TlsOptions, secureConnectionListener?: (cleartextStream: ClearTextStream) =>void ): Server;
-    export function connect(options: TlsOptions, secureConnectionListener?: () =>void ): ClearTextStream;
-    export function connect(port: number, host?: string, options?: ConnectionOptions, secureConnectListener?: () =>void ): ClearTextStream;
-    export function connect(port: number, options?: ConnectionOptions, secureConnectListener?: () =>void ): ClearTextStream;
-    export function createSecurePair(credentials?: crypto.Credentials, isServer?: boolean, requestCert?: boolean, rejectUnauthorized?: boolean): SecurePair;
-    export function createSecureContext(details: SecureContextOptions): SecureContext;
-}
-
-declare module "crypto" {
-    export interface CredentialDetails {
-        pfx: string;
-        key: string;
-        passphrase: string;
-        cert: string;
-        ca: string | string[];
-        crl: string | string[];
-        ciphers: string;
-    }
-    export interface Credentials { context?: any; }
-    export function createCredentials(details: CredentialDetails): Credentials;
-    export function createHash(algorithm: string): Hash;
-    export function createHmac(algorithm: string, key: string): Hmac;
-    export function createHmac(algorithm: string, key: Buffer): Hmac;
-    export interface Hash {
-        update(data: any, input_encoding?: string): Hash;
-        digest(encoding: 'buffer'): Buffer;
-        digest(encoding: string): any;
-        digest(): Buffer;
-    }
-    export interface Hmac extends NodeJS.ReadWriteStream {
-        update(data: any, input_encoding?: string): Hmac;
-        digest(encoding: 'buffer'): Buffer;
-        digest(encoding: string): any;
-        digest(): Buffer;
-    }
-    export function createCipher(algorithm: string, password: any): Cipher;
-    export function createCipheriv(algorithm: string, key: any, iv: any): Cipher;
-    export interface Cipher extends NodeJS.ReadWriteStream {
-        update(data: Buffer): Buffer;
-        update(data: string, input_encoding: "utf8"|"ascii"|"binary"): Buffer;
-        update(data: Buffer, input_encoding: any, output_encoding: "binary"|"base64"|"hex"): string;
-        update(data: string, input_encoding: "utf8"|"ascii"|"binary", output_encoding: "binary"|"base64"|"hex"): string;
-        final(): Buffer;
-        final(output_encoding: string): string;
-        setAutoPadding(auto_padding: boolean): void;
-        getAuthTag(): Buffer;
-    }
-    export function createDecipher(algorithm: string, password: any): Decipher;
-    export function createDecipheriv(algorithm: string, key: any, iv: any): Decipher;
-    export interface Decipher extends NodeJS.ReadWriteStream {
-        update(data: Buffer): Buffer;
-        update(data: string, input_encoding: "binary"|"base64"|"hex"): Buffer;
-        update(data: Buffer, input_encoding: any, output_encoding: "utf8"|"ascii"|"binary"): string;
-        update(data: string, input_encoding: "binary"|"base64"|"hex", output_encoding: "utf8"|"ascii"|"binary"): string;
-        final(): Buffer;
-        final(output_encoding: string): string;
-        setAutoPadding(auto_padding: boolean): void;
-        setAuthTag(tag: Buffer): void;
-    }
-    export function createSign(algorithm: string): Signer;
-    export interface Signer extends NodeJS.WritableStream {
-        update(data: any): void;
-        sign(private_key: string, output_format: string): string;
-    }
-    export function createVerify(algorith: string): Verify;
-    export interface Verify extends NodeJS.WritableStream {
-        update(data: any): void;
-        verify(object: string, signature: string, signature_format?: string): boolean;
-    }
-    export function createDiffieHellman(prime_length: number): DiffieHellman;
-    export function createDiffieHellman(prime: number, encoding?: string): DiffieHellman;
-    export interface DiffieHellman {
-        generateKeys(encoding?: string): string;
-        computeSecret(other_public_key: string, input_encoding?: string, output_encoding?: string): string;
-        getPrime(encoding?: string): string;
-        getGenerator(encoding: string): string;
-        getPublicKey(encoding?: string): string;
-        getPrivateKey(encoding?: string): string;
-        setPublicKey(public_key: string, encoding?: string): void;
-        setPrivateKey(public_key: string, encoding?: string): void;
-    }
-    export function getDiffieHellman(group_name: string): DiffieHellman;
-    export function pbkdf2(password: string|Buffer, salt: string|Buffer, iterations: number, keylen: number, callback: (err: Error, derivedKey: Buffer) => any): void;
-    export function pbkdf2(password: string|Buffer, salt: string|Buffer, iterations: number, keylen: number, digest: string, callback: (err: Error, derivedKey: Buffer) => any): void;
-    export function pbkdf2Sync(password: string|Buffer, salt: string|Buffer, iterations: number, keylen: number) : Buffer;
-    export function pbkdf2Sync(password: string|Buffer, salt: string|Buffer, iterations: number, keylen: number, digest: string) : Buffer;
-    export function randomBytes(size: number): Buffer;
-    export function randomBytes(size: number, callback: (err: Error, buf: Buffer) =>void ): void;
-    export function pseudoRandomBytes(size: number): Buffer;
-    export function pseudoRandomBytes(size: number, callback: (err: Error, buf: Buffer) =>void ): void;
-    export interface RsaPublicKey {
-        key: string;
-        padding?: any;
-    }
-    export interface RsaPrivateKey {
-        key: string;
-        passphrase?: string,
-        padding?: any;
-    }
-    export function publicEncrypt(public_key: string|RsaPublicKey, buffer: Buffer): Buffer
-    export function privateDecrypt(private_key: string|RsaPrivateKey, buffer: Buffer): Buffer
-}
-
-declare module "stream" {
-    import * as events from "events";
-
-    export class Stream extends events.EventEmitter {
-        pipe<T extends NodeJS.WritableStream>(destination: T, options?: { end?: boolean; }): T;
-    }
-
-    export interface ReadableOptions {
-        highWaterMark?: number;
-        encoding?: string;
-        objectMode?: boolean;
-    }
-
-    export class Readable extends events.EventEmitter implements NodeJS.ReadableStream {
-        readable: boolean;
-        constructor(opts?: ReadableOptions);
-        _read(size: number): void;
-        read(size?: number): any;
-        setEncoding(encoding: string): void;
-        pause(): void;
-        resume(): void;
-        pipe<T extends NodeJS.WritableStream>(destination: T, options?: { end?: boolean; }): T;
-        unpipe<T extends NodeJS.WritableStream>(destination?: T): void;
-        unshift(chunk: any): void;
-        wrap(oldStream: NodeJS.ReadableStream): NodeJS.ReadableStream;
-        push(chunk: any, encoding?: string): boolean;
-    }
-
-    export interface WritableOptions {
-        highWaterMark?: number;
-        decodeStrings?: boolean;
-        objectMode?: boolean;
-    }
-
-    export class Writable extends events.EventEmitter implements NodeJS.WritableStream {
-        writable: boolean;
-        constructor(opts?: WritableOptions);
-        _write(chunk: any, encoding: string, callback: Function): void;
-        write(chunk: any, cb?: Function): boolean;
-        write(chunk: any, encoding?: string, cb?: Function): boolean;
-        end(): void;
-        end(chunk: any, cb?: Function): void;
-        end(chunk: any, encoding?: string, cb?: Function): void;
-    }
-
-    export interface DuplexOptions extends ReadableOptions, WritableOptions {
-        allowHalfOpen?: boolean;
-    }
-
-    // Note: Duplex extends both Readable and Writable.
-    export class Duplex extends Readable implements NodeJS.ReadWriteStream {
-        writable: boolean;
-        constructor(opts?: DuplexOptions);
-        _write(chunk: any, encoding: string, callback: Function): void;
-        write(chunk: any, cb?: Function): boolean;
-        write(chunk: any, encoding?: string, cb?: Function): boolean;
-        end(): void;
-        end(chunk: any, cb?: Function): void;
-        end(chunk: any, encoding?: string, cb?: Function): void;
-    }
-
-    export interface TransformOptions extends ReadableOptions, WritableOptions {}
-
-    // Note: Transform lacks the _read and _write methods of Readable/Writable.
-    export class Transform extends events.EventEmitter implements NodeJS.ReadWriteStream {
-        readable: boolean;
-        writable: boolean;
-        constructor(opts?: TransformOptions);
-        _transform(chunk: any, encoding: string, callback: Function): void;
-        _flush(callback: Function): void;
-        read(size?: number): any;
-        setEncoding(encoding: string): void;
-        pause(): void;
-        resume(): void;
-        pipe<T extends NodeJS.WritableStream>(destination: T, options?: { end?: boolean; }): T;
-        unpipe<T extends NodeJS.WritableStream>(destination?: T): void;
-        unshift(chunk: any): void;
-        wrap(oldStream: NodeJS.ReadableStream): NodeJS.ReadableStream;
-        push(chunk: any, encoding?: string): boolean;
-        write(chunk: any, cb?: Function): boolean;
-        write(chunk: any, encoding?: string, cb?: Function): boolean;
-        end(): void;
-        end(chunk: any, cb?: Function): void;
-        end(chunk: any, encoding?: string, cb?: Function): void;
-    }
-
-    export class PassThrough extends Transform {}
-}
-
-declare module "util" {
-    export interface InspectOptions {
-        showHidden?: boolean;
-        depth?: number;
-        colors?: boolean;
-        customInspect?: boolean;
-    }
-
-    export function format(format: any, ...param: any[]): string;
-    export function debug(string: string): void;
-    export function error(...param: any[]): void;
-    export function puts(...param: any[]): void;
-    export function print(...param: any[]): void;
-    export function log(string: string): void;
-    export function inspect(object: any, showHidden?: boolean, depth?: number, color?: boolean): string;
-    export function inspect(object: any, options: InspectOptions): string;
-    export function isArray(object: any): boolean;
-    export function isRegExp(object: any): boolean;
-    export function isDate(object: any): boolean;
-    export function isError(object: any): boolean;
-    export function inherits(constructor: any, superConstructor: any): void;
-    export function debuglog(key:string): (msg:string,...param: any[])=>void;
-}
-
-declare module "assert" {
-    function internal (value: any, message?: string): void;
-    namespace internal {
-        export class AssertionError implements Error {
-            name: string;
-            message: string;
-            actual: any;
-            expected: any;
-            operator: string;
-            generatedMessage: boolean;
-
-            constructor(options?: {message?: string; actual?: any; expected?: any;
-                                  operator?: string; stackStartFunction?: Function});
-        }
-
-        export function fail(actual?: any, expected?: any, message?: string, operator?: string): void;
-        export function ok(value: any, message?: string): void;
-        export function equal(actual: any, expected: any, message?: string): void;
-        export function notEqual(actual: any, expected: any, message?: string): void;
-        export function deepEqual(actual: any, expected: any, message?: string): void;
-        export function notDeepEqual(acutal: any, expected: any, message?: string): void;
-        export function strictEqual(actual: any, expected: any, message?: string): void;
-        export function notStrictEqual(actual: any, expected: any, message?: string): void;
-        export function deepStrictEqual(actual: any, expected: any, message?: string): void;
-        export function notDeepStrictEqual(actual: any, expected: any, message?: string): void;
-        export var throws: {
-            (block: Function, message?: string): void;
-            (block: Function, error: Function, message?: string): void;
-            (block: Function, error: RegExp, message?: string): void;
-            (block: Function, error: (err: any) => boolean, message?: string): void;
-        };
-
-        export var doesNotThrow: {
-            (block: Function, message?: string): void;
-            (block: Function, error: Function, message?: string): void;
-            (block: Function, error: RegExp, message?: string): void;
-            (block: Function, error: (err: any) => boolean, message?: string): void;
-        };
-
-        export function ifError(value: any): void;
-    }
-
-    export = internal;
-}
-
-declare module "tty" {
-    import * as net from "net";
-
-    export function isatty(fd: number): boolean;
-    export interface ReadStream extends net.Socket {
-        isRaw: boolean;
-        setRawMode(mode: boolean): void;
-        isTTY: boolean;
-    }
-    export interface WriteStream extends net.Socket {
-        columns: number;
-        rows: number;
-        isTTY: boolean;
-    }
-}
-
-declare module "domain" {
-    import * as events from "events";
-
-    export class Domain extends events.EventEmitter implements NodeJS.Domain {
-        run(fn: Function): void;
-        add(emitter: events.EventEmitter): void;
-        remove(emitter: events.EventEmitter): void;
-        bind(cb: (err: Error, data: any) => any): any;
-        intercept(cb: (data: any) => any): any;
-        dispose(): void;
-    }
-
-    export function create(): Domain;
-}
-
-declare module "constants" {
-    export var E2BIG: number;
-    export var EACCES: number;
-    export var EADDRINUSE: number;
-    export var EADDRNOTAVAIL: number;
-    export var EAFNOSUPPORT: number;
-    export var EAGAIN: number;
-    export var EALREADY: number;
-    export var EBADF: number;
-    export var EBADMSG: number;
-    export var EBUSY: number;
-    export var ECANCELED: number;
-    export var ECHILD: number;
-    export var ECONNABORTED: number;
-    export var ECONNREFUSED: number;
-    export var ECONNRESET: number;
-    export var EDEADLK: number;
-    export var EDESTADDRREQ: number;
-    export var EDOM: number;
-    export var EEXIST: number;
-    export var EFAULT: number;
-    export var EFBIG: number;
-    export var EHOSTUNREACH: number;
-    export var EIDRM: number;
-    export var EILSEQ: number;
-    export var EINPROGRESS: number;
-    export var EINTR: number;
-    export var EINVAL: number;
-    export var EIO: number;
-    export var EISCONN: number;
-    export var EISDIR: number;
-    export var ELOOP: number;
-    export var EMFILE: number;
-    export var EMLINK: number;
-    export var EMSGSIZE: number;
-    export var ENAMETOOLONG: number;
-    export var ENETDOWN: number;
-    export var ENETRESET: number;
-    export var ENETUNREACH: number;
-    export var ENFILE: number;
-    export var ENOBUFS: number;
-    export var ENODATA: number;
-    export var ENODEV: number;
-    export var ENOENT: number;
-    export var ENOEXEC: number;
-    export var ENOLCK: number;
-    export var ENOLINK: number;
-    export var ENOMEM: number;
-    export var ENOMSG: number;
-    export var ENOPROTOOPT: number;
-    export var ENOSPC: number;
-    export var ENOSR: number;
-    export var ENOSTR: number;
-    export var ENOSYS: number;
-    export var ENOTCONN: number;
-    export var ENOTDIR: number;
-    export var ENOTEMPTY: number;
-    export var ENOTSOCK: number;
-    export var ENOTSUP: number;
-    export var ENOTTY: number;
-    export var ENXIO: number;
-    export var EOPNOTSUPP: number;
-    export var EOVERFLOW: number;
-    export var EPERM: number;
-    export var EPIPE: number;
-    export var EPROTO: number;
-    export var EPROTONOSUPPORT: number;
-    export var EPROTOTYPE: number;
-    export var ERANGE: number;
-    export var EROFS: number;
-    export var ESPIPE: number;
-    export var ESRCH: number;
-    export var ETIME: number;
-    export var ETIMEDOUT: number;
-    export var ETXTBSY: number;
-    export var EWOULDBLOCK: number;
-    export var EXDEV: number;
-    export var WSAEINTR: number;
-    export var WSAEBADF: number;
-    export var WSAEACCES: number;
-    export var WSAEFAULT: number;
-    export var WSAEINVAL: number;
-    export var WSAEMFILE: number;
-    export var WSAEWOULDBLOCK: number;
-    export var WSAEINPROGRESS: number;
-    export var WSAEALREADY: number;
-    export var WSAENOTSOCK: number;
-    export var WSAEDESTADDRREQ: number;
-    export var WSAEMSGSIZE: number;
-    export var WSAEPROTOTYPE: number;
-    export var WSAENOPROTOOPT: number;
-    export var WSAEPROTONOSUPPORT: number;
-    export var WSAESOCKTNOSUPPORT: number;
-    export var WSAEOPNOTSUPP: number;
-    export var WSAEPFNOSUPPORT: number;
-    export var WSAEAFNOSUPPORT: number;
-    export var WSAEADDRINUSE: number;
-    export var WSAEADDRNOTAVAIL: number;
-    export var WSAENETDOWN: number;
-    export var WSAENETUNREACH: number;
-    export var WSAENETRESET: number;
-    export var WSAECONNABORTED: number;
-    export var WSAECONNRESET: number;
-    export var WSAENOBUFS: number;
-    export var WSAEISCONN: number;
-    export var WSAENOTCONN: number;
-    export var WSAESHUTDOWN: number;
-    export var WSAETOOMANYREFS: number;
-    export var WSAETIMEDOUT: number;
-    export var WSAECONNREFUSED: number;
-    export var WSAELOOP: number;
-    export var WSAENAMETOOLONG: number;
-    export var WSAEHOSTDOWN: number;
-    export var WSAEHOSTUNREACH: number;
-    export var WSAENOTEMPTY: number;
-    export var WSAEPROCLIM: number;
-    export var WSAEUSERS: number;
-    export var WSAEDQUOT: number;
-    export var WSAESTALE: number;
-    export var WSAEREMOTE: number;
-    export var WSASYSNOTREADY: number;
-    export var WSAVERNOTSUPPORTED: number;
-    export var WSANOTINITIALISED: number;
-    export var WSAEDISCON: number;
-    export var WSAENOMORE: number;
-    export var WSAECANCELLED: number;
-    export var WSAEINVALIDPROCTABLE: number;
-    export var WSAEINVALIDPROVIDER: number;
-    export var WSAEPROVIDERFAILEDINIT: number;
-    export var WSASYSCALLFAILURE: number;
-    export var WSASERVICE_NOT_FOUND: number;
-    export var WSATYPE_NOT_FOUND: number;
-    export var WSA_E_NO_MORE: number;
-    export var WSA_E_CANCELLED: number;
-    export var WSAEREFUSED: number;
-    export var SIGHUP: number;
-    export var SIGINT: number;
-    export var SIGILL: number;
-    export var SIGABRT: number;
-    export var SIGFPE: number;
-    export var SIGKILL: number;
-    export var SIGSEGV: number;
-    export var SIGTERM: number;
-    export var SIGBREAK: number;
-    export var SIGWINCH: number;
-    export var SSL_OP_ALL: number;
-    export var SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION: number;
-    export var SSL_OP_CIPHER_SERVER_PREFERENCE: number;
-    export var SSL_OP_CISCO_ANYCONNECT: number;
-    export var SSL_OP_COOKIE_EXCHANGE: number;
-    export var SSL_OP_CRYPTOPRO_TLSEXT_BUG: number;
-    export var SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS: number;
-    export var SSL_OP_EPHEMERAL_RSA: number;
-    export var SSL_OP_LEGACY_SERVER_CONNECT: number;
-    export var SSL_OP_MICROSOFT_BIG_SSLV3_BUFFER: number;
-    export var SSL_OP_MICROSOFT_SESS_ID_BUG: number;
-    export var SSL_OP_MSIE_SSLV2_RSA_PADDING: number;
-    export var SSL_OP_NETSCAPE_CA_DN_BUG: number;
-    export var SSL_OP_NETSCAPE_CHALLENGE_BUG: number;
-    export var SSL_OP_NETSCAPE_DEMO_CIPHER_CHANGE_BUG: number;
-    export var SSL_OP_NETSCAPE_REUSE_CIPHER_CHANGE_BUG: number;
-    export var SSL_OP_NO_COMPRESSION: number;
-    export var SSL_OP_NO_QUERY_MTU: number;
-    export var SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION: number;
-    export var SSL_OP_NO_SSLv2: number;
-    export var SSL_OP_NO_SSLv3: number;
-    export var SSL_OP_NO_TICKET: number;
-    export var SSL_OP_NO_TLSv1: number;
-    export var SSL_OP_NO_TLSv1_1: number;
-    export var SSL_OP_NO_TLSv1_2: number;
-    export var SSL_OP_PKCS1_CHECK_1: number;
-    export var SSL_OP_PKCS1_CHECK_2: number;
-    export var SSL_OP_SINGLE_DH_USE: number;
-    export var SSL_OP_SINGLE_ECDH_USE: number;
-    export var SSL_OP_SSLEAY_080_CLIENT_DH_BUG: number;
-    export var SSL_OP_SSLREF2_REUSE_CERT_TYPE_BUG: number;
-    export var SSL_OP_TLS_BLOCK_PADDING_BUG: number;
-    export var SSL_OP_TLS_D5_BUG: number;
-    export var SSL_OP_TLS_ROLLBACK_BUG: number;
-    export var ENGINE_METHOD_DSA: number;
-    export var ENGINE_METHOD_DH: number;
-    export var ENGINE_METHOD_RAND: number;
-    export var ENGINE_METHOD_ECDH: number;
-    export var ENGINE_METHOD_ECDSA: number;
-    export var ENGINE_METHOD_CIPHERS: number;
-    export var ENGINE_METHOD_DIGESTS: number;
-    export var ENGINE_METHOD_STORE: number;
-    export var ENGINE_METHOD_PKEY_METHS: number;
-    export var ENGINE_METHOD_PKEY_ASN1_METHS: number;
-    export var ENGINE_METHOD_ALL: number;
-    export var ENGINE_METHOD_NONE: number;
-    export var DH_CHECK_P_NOT_SAFE_PRIME: number;
-    export var DH_CHECK_P_NOT_PRIME: number;
-    export var DH_UNABLE_TO_CHECK_GENERATOR: number;
-    export var DH_NOT_SUITABLE_GENERATOR: number;
-    export var NPN_ENABLED: number;
-    export var RSA_PKCS1_PADDING: number;
-    export var RSA_SSLV23_PADDING: number;
-    export var RSA_NO_PADDING: number;
-    export var RSA_PKCS1_OAEP_PADDING: number;
-    export var RSA_X931_PADDING: number;
-    export var RSA_PKCS1_PSS_PADDING: number;
-    export var POINT_CONVERSION_COMPRESSED: number;
-    export var POINT_CONVERSION_UNCOMPRESSED: number;
-    export var POINT_CONVERSION_HYBRID: number;
-    export var O_RDONLY: number;
-    export var O_WRONLY: number;
-    export var O_RDWR: number;
-    export var S_IFMT: number;
-    export var S_IFREG: number;
-    export var S_IFDIR: number;
-    export var S_IFCHR: number;
-    export var S_IFLNK: number;
-    export var O_CREAT: number;
-    export var O_EXCL: number;
-    export var O_TRUNC: number;
-    export var O_APPEND: number;
-    export var F_OK: number;
-    export var R_OK: number;
-    export var W_OK: number;
-    export var X_OK: number;
-    export var UV_UDP_REUSEADDR: number;
-}