tests, refactoring, typings update

This commit is contained in:
sanex3339
2016-06-28 14:34:12 +03:00
parent 599429ddfc
commit 16950a802a
42 changed files with 620 additions and 4664 deletions
+3 -5
View File
@@ -1084,6 +1084,7 @@ var JavaScriptObfuscatorCLI = function () {
this.configureCommands();
if (!this.arguments.length || this.arguments.indexOf('--help') >= 0) {
this.commands.outputHelp();
return;
}
this.inputPath = this.getInputPath();
this.getData();
@@ -1112,13 +1113,10 @@ var JavaScriptObfuscatorCLI = function () {
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);
this.commands.on('--help', function () {
var isWindows = process.platform === 'win32',
commandName = isWindows ? 'type' : 'cat';
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('');
process.exit();
});
}
}, {
+2 -1
View File
@@ -32,6 +32,7 @@
"coveralls": "^2.11.9",
"istanbul": "1.1.0-alpha.1",
"mocha": "^2.5.3",
"sinon": "^1.17.4",
"ts-loader": "^0.8.2",
"ts-node": "^0.9.1",
"tslint": "^3.12.1",
@@ -58,7 +59,7 @@
"test": "scripts/test",
"tslint": "scripts/tslint",
"travis": "scripts/travis",
"typings": "srcipts/typings"
"typings": "scripts/typings"
},
"author": {
"name": "Timofey Kachalov"
+4 -7
View File
@@ -94,6 +94,8 @@ export class JavaScriptObfuscatorCLI {
if (!this.arguments.length || this.arguments.indexOf('--help') >= 0) {
this.commands.outputHelp();
return;
}
this.inputPath = this.getInputPath();
@@ -143,15 +145,10 @@ export class JavaScriptObfuscatorCLI {
.parse(this.rawArguments);
this.commands.on('--help', () => {
let isWindows: boolean = process.platform === 'win32',
commandName: string = isWindows ? 'type' : 'cat';
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('');
process.exit();
});
}
+49 -2
View File
@@ -1,11 +1,14 @@
import * as fs from 'fs';
import * as mkdirp from 'mkdirp';
import * as sinon from 'sinon';
import { StdoutWriteMock } from "../test/mocks/StdoutWriteMock";
import { JavaScriptObfuscator } from "../src/JavaScriptObfuscator";
const assert: Chai.AssertStatic = require('chai').assert;
describe('JavaScriptObfuscatorCLI', () => {
describe('JavaScriptObfuscatorCLI', function (): void {
let fixturesDirName: string = 'test/fixtures',
fixtureFileName: string = 'sample.js',
fixtureFilePath: string = `${fixturesDirName}/${fixtureFileName}`,
@@ -13,6 +16,8 @@ describe('JavaScriptObfuscatorCLI', () => {
outputFileName: string = 'sample-obfuscated.js',
outputFilePath: string = `${outputDirName}/${outputFileName}`;
this.timeout(5000);
describe('run (): void', () => {
before(() => {
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`, () => {
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(() => {
fs.rmdirSync(outputDirName);
});
+26
View File
@@ -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
View File
@@ -10,8 +10,6 @@
},
"exclude": [
"node_modules",
"test",
"typings/browser",
"typings/browser.d.ts"
"test"
]
}
+4 -3
View File
@@ -1,8 +1,8 @@
{
"name": "javascript-obfuscator",
"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",
"commander": "github:DefinitelyTyped/DefinitelyTyped/commander/commander.d.ts",
"estree": "github:DefinitelyTyped/DefinitelyTyped/estree/estree.d.ts",
@@ -11,6 +11,7 @@
"estraverse": "github:DefinitelyTyped/DefinitelyTyped/estraverse/estraverse.d.ts",
"mkdirp": "github:DefinitelyTyped/DefinitelyTyped/mkdirp/mkdirp.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"
}
}
-10
View File
@@ -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" />
-416
View File
@@ -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;
}
-224
View File
@@ -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;
}
-413
View File
@@ -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;
}
-370
View File
@@ -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;
}
}
@@ -1,16 +1,5 @@
// 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 {
+8
View File
@@ -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"
}
}
@@ -1,10 +1,5 @@
// 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 {
+8
View File
@@ -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"
}
}
@@ -1,11 +1,5 @@
// 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 {
/**
+8
View File
@@ -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"
}
}
@@ -1,10 +1,5 @@
// 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 {
+8
View File
@@ -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"
}
}
@@ -1,11 +1,5 @@
// 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;
+8
View File
@@ -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"
}
}
@@ -1,10 +1,5 @@
// 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;
+8
View File
@@ -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"
}
}
@@ -1,10 +1,5 @@
// 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;
+8
View File
@@ -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"
}
}
@@ -1,10 +1,5 @@
// 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;
+8
View File
@@ -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"
}
}
@@ -1,10 +1,5 @@
// 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;
+8
View File
@@ -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"
}
}
@@ -1,16 +1,5 @@
// 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;
}
+8
View File
@@ -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
View File
@@ -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
View File
@@ -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
View File
@@ -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" />
-10
View File
@@ -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" />
-180
View File
@@ -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;
}
-108
View File
@@ -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
}
-24
View File
@@ -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;
}
-17
View File
@@ -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;
}
-239
View File
@@ -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;
}
File diff suppressed because it is too large Load Diff