diff --git a/should/should.d.ts b/should/should.d.ts
index 7241c0389b..b3c37846a2 100644
--- a/should/should.d.ts
+++ b/should/should.d.ts
@@ -1,6 +1,6 @@
-// Type definitions for should.js 1.2.2
+// Type definitions for should.js 3.1.2
// Project: https://github.com/visionmedia/should.js
-// Definitions by: Alex Varju
+// Definitions by: Alex Varju and Maxime LUCE (1.3+)
// Definitions: https://github.com/borisyankov/DefinitelyTyped
interface Object {
@@ -9,12 +9,13 @@ interface Object {
interface ShouldAssertion {
// basic grammar
+ a: ShouldAssertion;
an: ShouldAssertion;
- // a: ShouldAssertion;
and: ShouldAssertion;
be: ShouldAssertion;
have: ShouldAssertion;
with: ShouldAssertion;
+ of: ShouldAssertion;
not: ShouldAssertion;
// validators
@@ -23,31 +24,58 @@ interface ShouldAssertion {
ok: ShouldAssertion;
true: ShouldAssertion;
false: ShouldAssertion;
+ NaN: ShouldAssertion;
+ Infinity: ShouldAssertion;
+ Array: ShouldAssertion;
+ Object: ShouldAssertion;
+ String: ShouldAssertion;
+ Boolean: ShouldAssertion;
+ Number: ShouldAssertion;
+ Error: ShouldAssertion;
+ Function: ShouldAssertion;
eql(expected: any, description?: string): ShouldAssertion;
equal(expected: any, description?: string): ShouldAssertion;
within(start: number, finish: number, description?: string): ShouldAssertion;
approximately(value: number, delta: number, description?: string): ShouldAssertion;
- a(expected: any, description?: string): ShouldAssertion;
+ type(expected: any, description?: string): ShouldAssertion;
instanceof(constructor: Function, description?: string): ShouldAssertion;
above(n: number, description?: string): ShouldAssertion;
below(n: number, description?: string): ShouldAssertion;
+ match(other: {}, description?: string): ShouldAssertion;
+ match(other: (val: any) => any, description?: string): ShouldAssertion;
match(regexp: RegExp, description?: string): ShouldAssertion;
+ match(other: any, description?: string): ShouldAssertion;
+ matchEach(other: {}, description?: string): ShouldAssertion;
+ matchEach(other: (val: any) => any, description?: string): ShouldAssertion;
+ matchEach(regexp: RegExp, description?: string): ShouldAssertion;
+ matchEach(other: any, description?: string): ShouldAssertion;
length(n: number, description?: string): ShouldAssertion;
property(name: string, description?: string): ShouldAssertion;
property(name: string, val: any, description?: string): ShouldAssertion;
+ properties(names: string[]): ShouldAssertion;
+ properties(name: string): ShouldAssertion;
+ properties(descriptor: any): ShouldAssertion;
+ properties(...properties: string[]): ShouldAssertion;
ownProperty(name: string, description?: string): ShouldAssertion;
- include(obj: any, description?: string): ShouldAssertion;
- includeEql(obj: any[], description?: string): ShouldAssertion;
contain(obj: any): ShouldAssertion;
+ containEql(obj: any): ShouldAssertion;
+ containDeep(obj: any): ShouldAssertion;
keys(...allKeys: string[]): ShouldAssertion;
keys(allKeys: string[]): ShouldAssertion;
header(field: string, val?: string): ShouldAssertion;
status(code: number): ShouldAssertion;
json: ShouldAssertion;
html: ShouldAssertion;
+ startWith(expected: string, message?: any): ShouldAssertion;
+ endWith(expected: string, message?: any): ShouldAssertion;
throw(message?: any): ShouldAssertion;
+ // deprecated
+ include(obj: any, description?: string): ShouldAssertion;
+ includeEql(obj: any[], description?: string): ShouldAssertion;
+
// aliases
+ exactly(expected: any, description?: string): ShouldAssertion;
instanceOf(constructor: Function, description?: string): ShouldAssertion;
throwError(message?: any): ShouldAssertion;
lengthOf(n: number, description?: string): ShouldAssertion;
@@ -65,6 +93,8 @@ interface ShouldInternal {
}
interface Internal extends ShouldInternal {
+ (obj: any): ShouldAssertion;
+
// node.js's assert functions
fail(actual: any, expected: any, message: string, operator: string): void;
assert(value: any, message: string): void;
@@ -78,8 +108,11 @@ interface Internal extends ShouldInternal {
throws(block: any, error?: any, message?: string): void;
doesNotThrow(block: any, message?: string): void;
ifError(value: any): void;
+ inspect(value: any, obj: any): any;
}
declare module "should" {
export = Internal;
}
+
+declare var should: Internal;