microsoft/vscode-react-native
Publicmirrored fromhttps://github.com/microsoft/vscode-react-nativeAvailable
src/typings/should/should.d.ts
170lines · modecode
| 1 | // Type definitions for should.js v8.1.1 |
| 2 | // Project: https://github.com/shouldjs/should.js |
| 3 | // Definitions by: Alex Varju <https://github.com/varju/>, Maxime LUCE <https://github.com/SomaticIT/> |
| 4 | // Definitions: https://github.com/borisyankov/DefinitelyTyped |
| 5 | |
| 6 | interface Object { |
| 7 | should: ShouldAssertion; |
| 8 | } |
| 9 | |
| 10 | interface ShouldAssertion { |
| 11 | // basic grammar |
| 12 | a: ShouldAssertion; |
| 13 | an: ShouldAssertion; |
| 14 | and: ShouldAssertion; |
| 15 | be: ShouldAssertion; |
| 16 | has: ShouldAssertion; |
| 17 | have: ShouldAssertion; |
| 18 | is: ShouldAssertion; |
| 19 | it: ShouldAssertion; |
| 20 | with: ShouldAssertion; |
| 21 | which: ShouldAssertion; |
| 22 | the: ShouldAssertion; |
| 23 | of: ShouldAssertion; |
| 24 | not: ShouldAssertion; |
| 25 | |
| 26 | // validators |
| 27 | arguments(): ShouldAssertion; |
| 28 | empty(): ShouldAssertion; |
| 29 | ok(): ShouldAssertion; |
| 30 | true(): ShouldAssertion; |
| 31 | false(): ShouldAssertion; |
| 32 | NaN(): ShouldAssertion; |
| 33 | Infinity(): ShouldAssertion; |
| 34 | Array(): ShouldAssertion; |
| 35 | Object(): ShouldAssertion; |
| 36 | String(): ShouldAssertion; |
| 37 | Boolean(): ShouldAssertion; |
| 38 | Number(): ShouldAssertion; |
| 39 | Error(): ShouldAssertion; |
| 40 | Function(): ShouldAssertion; |
| 41 | Date(): ShouldAssertion; |
| 42 | Class(): ShouldAssertion; |
| 43 | generator(): ShouldAssertion; |
| 44 | iterable(): ShouldAssertion; |
| 45 | iterator(): ShouldAssertion; |
| 46 | eql(expected: any, description?: string): ShouldAssertion; |
| 47 | equal(expected: any, description?: string): ShouldAssertion; |
| 48 | equalOneOf(...values: any[]): ShouldAssertion; |
| 49 | within(start: number, finish: number, description?: string): ShouldAssertion; |
| 50 | approximately(value: number, delta: number, description?: string): ShouldAssertion; |
| 51 | type(expected: any, description?: string): ShouldAssertion; |
| 52 | instanceof(constructor: Function, description?: string): ShouldAssertion; |
| 53 | above(n: number, description?: string): ShouldAssertion; |
| 54 | below(n: number, description?: string): ShouldAssertion; |
| 55 | aboveOrEqual(n: number, description?: string): ShouldAssertion; |
| 56 | greaterThanOrEqual(n: number, description?: string): ShouldAssertion; |
| 57 | belowOrEqual(n: number, description?: string): ShouldAssertion; |
| 58 | lessThanOrEqual(n: number, description?: string): ShouldAssertion; |
| 59 | match(other: {}, description?: string): ShouldAssertion; |
| 60 | match(other: (val: any) => any, description?: string): ShouldAssertion; |
| 61 | match(regexp: RegExp, description?: string): ShouldAssertion; |
| 62 | match(other: any, description?: string): ShouldAssertion; |
| 63 | matchEach(other: {}, description?: string): ShouldAssertion; |
| 64 | matchEach(other: (val: any) => any, description?: string): ShouldAssertion; |
| 65 | matchEach(regexp: RegExp, description?: string): ShouldAssertion; |
| 66 | matchEach(other: any, description?: string): ShouldAssertion; |
| 67 | matchAny(other: {}, description?: string): ShouldAssertion; |
| 68 | matchAny(other: (val: any) => any, description?: string): ShouldAssertion; |
| 69 | matchAny(regexp: RegExp, description?: string): ShouldAssertion; |
| 70 | matchAny(other: any, description?: string): ShouldAssertion; |
| 71 | length(n: number, description?: string): ShouldAssertion; |
| 72 | property(name: string, description?: string): ShouldAssertion; |
| 73 | property(name: string, val: any, description?: string): ShouldAssertion; |
| 74 | properties(names: string[]): ShouldAssertion; |
| 75 | properties(name: string): ShouldAssertion; |
| 76 | properties(descriptor: any): ShouldAssertion; |
| 77 | properties(...properties: string[]): ShouldAssertion; |
| 78 | propertyByPath(...properties: string[]): ShouldAssertion; |
| 79 | propertyWithDescriptor(name: string, descriptor: PropertyDescriptor): ShouldAssertion; |
| 80 | oneOf(...values: any[]): ShouldAssertion; |
| 81 | ownProperty(name: string, description?: string): ShouldAssertion; |
| 82 | containEql(obj: any): ShouldAssertion; |
| 83 | containDeep(obj: any): ShouldAssertion; |
| 84 | containDeepOrdered(obj: any): ShouldAssertion; |
| 85 | keys(...allKeys: string[]): ShouldAssertion; |
| 86 | keys(allKeys: string[]): ShouldAssertion; |
| 87 | enumerable(property: string, value?: any): ShouldAssertion; |
| 88 | enumerables(...properties: string[]): ShouldAssertion; |
| 89 | startWith(expected: string, message?: any): ShouldAssertion; |
| 90 | endWith(expected: string, message?: any): ShouldAssertion; |
| 91 | throw(message?: any): ShouldAssertion; |
| 92 | |
| 93 | //http |
| 94 | header(field: string, val?: string): ShouldAssertion; |
| 95 | status(code: number): ShouldAssertion; |
| 96 | json(): ShouldAssertion; |
| 97 | html(): ShouldAssertion; |
| 98 | |
| 99 | //stubs |
| 100 | alwaysCalledOn(thisTarget: any): ShouldAssertion; |
| 101 | alwaysCalledWith(...arguments: any[]): ShouldAssertion; |
| 102 | alwaysCalledWithExactly(...arguments: any[]): ShouldAssertion; |
| 103 | alwaysCalledWithMatch(...arguments: any[]): ShouldAssertion; |
| 104 | alwaysCalledWithNew(): ShouldAssertion; |
| 105 | alwaysThrew(exception?: any): ShouldAssertion; |
| 106 | callCount(count: number): ShouldAssertion; |
| 107 | called(): ShouldAssertion; |
| 108 | calledOn(thisTarget: any): ShouldAssertion; |
| 109 | calledOnce(): ShouldAssertion; |
| 110 | calledTwice(): ShouldAssertion; |
| 111 | calledThrice(): ShouldAssertion; |
| 112 | calledWith(...arguments: any[]): ShouldAssertion; |
| 113 | calledWithExactly(...arguments: any[]): ShouldAssertion; |
| 114 | calledWithMatch(...arguments: any[]): ShouldAssertion; |
| 115 | calledWithNew(): ShouldAssertion; |
| 116 | neverCalledWith(...arguments: any[]): ShouldAssertion; |
| 117 | neverCalledWithMatch(...arguments: any[]): ShouldAssertion; |
| 118 | threw(exception?: any): ShouldAssertion; |
| 119 | |
| 120 | // aliases |
| 121 | True(): ShouldAssertion; |
| 122 | False(): ShouldAssertion; |
| 123 | Arguments(): ShouldAssertion; |
| 124 | class(): ShouldAssertion; |
| 125 | deepEqual(expected: any, description?: string): ShouldAssertion; |
| 126 | exactly(expected: any, description?: string): ShouldAssertion; |
| 127 | instanceOf(constructor: Function, description?: string): ShouldAssertion; |
| 128 | throwError(message?: any): ShouldAssertion; |
| 129 | lengthOf(n: number, description?: string): ShouldAssertion; |
| 130 | key(key: string): ShouldAssertion; |
| 131 | hasOwnProperty(name: string, description?: string): ShouldAssertion; |
| 132 | greaterThan(n: number, description?: string): ShouldAssertion; |
| 133 | lessThan(n: number, description?: string): ShouldAssertion; |
| 134 | } |
| 135 | |
| 136 | interface ShouldInternal { |
| 137 | // should.js's extras |
| 138 | exist(actual: any, msg?: string): void; |
| 139 | exists(actual: any, msg?: string): void; |
| 140 | not: ShouldInternal; |
| 141 | } |
| 142 | |
| 143 | interface Internal extends ShouldInternal { |
| 144 | (obj: any): ShouldAssertion; |
| 145 | |
| 146 | // node.js's assert functions |
| 147 | fail(actual: any, expected: any, message: string, operator: string): void; |
| 148 | assert(value: any, message: string): void; |
| 149 | ok(value: any, message?: string): void; |
| 150 | equal(actual: any, expected: any, message?: string): void; |
| 151 | notEqual(actual: any, expected: any, message?: string): void; |
| 152 | deepEqual(actual: any, expected: any, message?: string): void; |
| 153 | notDeepEqual(actual: any, expected: any, message?: string): void; |
| 154 | strictEqual(actual: any, expected: any, message?: string): void; |
| 155 | notStrictEqual(actual: any, expected: any, message?: string): void; |
| 156 | throws(block: any, error?: any, message?: string): void; |
| 157 | doesNotThrow(block: any, message?: string): void; |
| 158 | ifError(value: any): void; |
| 159 | inspect(value: any, obj: any): any; |
| 160 | } |
| 161 | |
| 162 | declare var should: Internal; |
| 163 | declare var Should: Internal; |
| 164 | interface Window { |
| 165 | Should: Internal; |
| 166 | } |
| 167 | |
| 168 | declare module "should" { |
| 169 | export = should; |
| 170 | } |
| 171 | |