|
1 |
| -// Automatically generated from TypeScript type definitions provided by |
2 |
| -// DefinitelyTyped (https://github.com/DefinitelyTyped/DefinitelyTyped), |
3 |
| -// which is licensed under the MIT license; see file DefinitelyTyped-LICENSE |
4 |
| -// in parent directory. |
5 |
| -// Type definitions for Node.js 10.5.x |
6 |
| -// Project: http://nodejs.org/ |
7 |
| -// Definitions by: Microsoft TypeScript <http://typescriptlang.org> |
8 |
| -// DefinitelyTyped <https://github.com/DefinitelyTyped/DefinitelyTyped> |
9 |
| -// Parambir Singh <https://github.com/parambirs> |
10 |
| -// Christian Vaagland Tellnes <https://github.com/tellnes> |
11 |
| -// Wilco Bakker <https://github.com/WilcoBakker> |
12 |
| -// Nicolas Voigt <https://github.com/octo-sniffle> |
13 |
| -// Chigozirim C. <https://github.com/smac89> |
14 |
| -// Flarna <https://github.com/Flarna> |
15 |
| -// Mariusz Wiktorczyk <https://github.com/mwiktorczyk> |
16 |
| -// wwwy3y3 <https://github.com/wwwy3y3> |
17 |
| -// Deividas Bakanas <https://github.com/DeividasBakanas> |
18 |
| -// Kelvin Jin <https://github.com/kjin> |
19 |
| -// Alvis HT Tang <https://github.com/alvis> |
20 |
| -// Sebastian Silbermann <https://github.com/eps1lon> |
21 |
| -// Hannes Magnusson <https://github.com/Hannes-Magnusson-CK> |
22 |
| -// Alberto Schiabel <https://github.com/jkomyno> |
23 |
| -// Klaus Meinhardt <https://github.com/ajafff> |
24 |
| -// Huw <https://github.com/hoo29> |
25 |
| -// Nicolas Even <https://github.com/n-e> |
26 |
| -// Bruno Scheufler <https://github.com/brunoscheufler> |
27 |
| -// Mohsen Azimi <https://github.com/mohsen1> |
28 |
| -// Hoàng Văn Khải <https://github.com/KSXGitHub> |
29 |
| -// Alexander T. <https://github.com/a-tarasyuk> |
30 |
| -// Lishude <https://github.com/islishude> |
31 |
| -// Andrew Makarov <https://github.com/r3nya> |
32 |
| -// Zane Hannan AU <https://github.com/ZaneHannanAU> |
33 |
| -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped |
| 1 | +/* |
| 2 | + * Copyright 2012 The Closure Compiler Authors. |
| 3 | + * |
| 4 | + * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | + * you may not use this file except in compliance with the License. |
| 6 | + * You may obtain a copy of the License at |
| 7 | + * |
| 8 | + * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | + * |
| 10 | + * Unless required by applicable law or agreed to in writing, software |
| 11 | + * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | + * See the License for the specific language governing permissions and |
| 14 | + * limitations under the License. |
| 15 | + */ |
34 | 16 |
|
35 | 17 | /**
|
36 |
| - * @externs |
37 |
| - * @fileoverview Definitions for module "assert" |
| 18 | + * @fileoverview Definitions for node's assert module |
| 19 | + * @see http://nodejs.org/api/assert.html |
| 20 | + * @see https://github.com/joyent/node/blob/master/lib/assert.js |
38 | 21 | */
|
39 | 22 |
|
40 | 23 | /**
|
41 | 24 | * @param {*} value
|
42 |
| - * @param {string=} message |
| 25 | + * @param {string} message |
43 | 26 | * @return {void}
|
| 27 | + * @throws {assert.AssertionError} |
44 | 28 | */
|
45 |
| -var internal = function(value, message) {}; |
46 |
| - |
47 |
| -var internal = internal || {}; |
| 29 | +var assert = function(value, message) {}; |
48 | 30 |
|
49 | 31 | /**
|
50 |
| - * @param {{message: string, actual: *, expected: *, operator: string, stackStartFunction: Function}=} options |
51 |
| - * @return {internal.AssertionError} |
| 32 | + * @param {{message: string, actual: *, expected: *, operator: string}} options |
52 | 33 | * @constructor
|
| 34 | + * @extends Error |
53 | 35 | */
|
54 |
| -internal.AssertionError = function(options) {}; |
55 |
| - |
56 |
| -/** |
57 |
| - * @type {string} |
58 |
| - */ |
59 |
| -internal.AssertionError.prototype.name; |
60 |
| - |
61 |
| -/** |
62 |
| - * @type {string} |
63 |
| - */ |
64 |
| -internal.AssertionError.prototype.message; |
65 |
| - |
66 |
| -/** |
67 |
| - * @type {*} |
68 |
| - */ |
69 |
| -internal.AssertionError.prototype.actual; |
| 36 | +assert.AssertionError = function(options) {}; |
70 | 37 |
|
71 | 38 | /**
|
72 |
| - * @type {*} |
| 39 | + * @return {string} |
73 | 40 | */
|
74 |
| -internal.AssertionError.prototype.expected; |
| 41 | +assert.AssertionError.prototype.toString; |
75 | 42 |
|
76 | 43 | /**
|
77 |
| - * @type {string} |
78 |
| - */ |
79 |
| -internal.AssertionError.prototype.operator; |
80 |
| - |
81 |
| -/** |
82 |
| - * @type {boolean} |
| 44 | + * @param {*} value |
| 45 | + * @param {string=} message |
| 46 | + * @return {void} |
| 47 | + * @throws {assert.AssertionError} |
83 | 48 | */
|
84 |
| -internal.AssertionError.prototype.generatedMessage; |
| 49 | +assert.ok; |
85 | 50 |
|
86 | 51 | /**
|
87 | 52 | * @param {*} actual
|
88 | 53 | * @param {*} expected
|
89 | 54 | * @param {string} message
|
90 | 55 | * @param {string} operator
|
91 | 56 | * @return {void}
|
| 57 | + * @throws {assert.AssertionError} |
92 | 58 | */
|
93 |
| -internal.fail = function(actual, expected, message, operator) {}; |
94 |
| - |
95 |
| -/** |
96 |
| - * @param {*} value |
97 |
| - * @param {string=} message |
98 |
| - * @return {void} |
99 |
| - */ |
100 |
| -internal.ok = function(value, message) {}; |
| 59 | +assert.fail; |
101 | 60 |
|
102 | 61 | /**
|
103 | 62 | * @param {*} actual
|
104 | 63 | * @param {*} expected
|
105 |
| - * @param {string=} message |
| 64 | + * @param {string} message |
106 | 65 | * @return {void}
|
| 66 | + * @throws {assert.AssertionError} |
107 | 67 | */
|
108 |
| -internal.equal = function(actual, expected, message) {}; |
| 68 | +assert.equal; |
109 | 69 |
|
110 | 70 | /**
|
111 | 71 | * @param {*} actual
|
112 | 72 | * @param {*} expected
|
113 |
| - * @param {string=} message |
| 73 | + * @param {string} message |
114 | 74 | * @return {void}
|
| 75 | + * @throws {assert.AssertionError} |
115 | 76 | */
|
116 |
| -internal.notEqual = function(actual, expected, message) {}; |
| 77 | +assert.notEqual; |
117 | 78 |
|
118 | 79 | /**
|
119 | 80 | * @param {*} actual
|
120 | 81 | * @param {*} expected
|
121 |
| - * @param {string=} message |
| 82 | + * @param {string} message |
122 | 83 | * @return {void}
|
| 84 | + * @throws {assert.AssertionError} |
123 | 85 | */
|
124 |
| -internal.deepEqual = function(actual, expected, message) {}; |
| 86 | +assert.deepEqual; |
125 | 87 |
|
126 | 88 | /**
|
127 |
| - * @param {*} acutal |
| 89 | + * @param {*} actual |
128 | 90 | * @param {*} expected
|
129 |
| - * @param {string=} message |
| 91 | + * @param {string} message |
130 | 92 | * @return {void}
|
| 93 | + * @throws {assert.AssertionError} |
131 | 94 | */
|
132 |
| -internal.notDeepEqual = function(acutal, expected, message) {}; |
| 95 | +assert.notDeepEqual; |
133 | 96 |
|
134 | 97 | /**
|
135 | 98 | * @param {*} actual
|
136 | 99 | * @param {*} expected
|
137 |
| - * @param {string=} message |
| 100 | + * @param {string} message |
138 | 101 | * @return {void}
|
| 102 | + * @throws {assert.AssertionError} |
139 | 103 | */
|
140 |
| -internal.strictEqual = function(actual, expected, message) {}; |
| 104 | +assert.strictEqual; |
141 | 105 |
|
142 | 106 | /**
|
143 | 107 | * @param {*} actual
|
144 | 108 | * @param {*} expected
|
145 |
| - * @param {string=} message |
| 109 | + * @param {string} message |
146 | 110 | * @return {void}
|
| 111 | + * @throws {assert.AssertionError} |
147 | 112 | */
|
148 |
| -internal.notStrictEqual = function(actual, expected, message) {}; |
| 113 | +assert.notStrictEqual; |
149 | 114 |
|
150 | 115 | /**
|
151 |
| - * @param {*} actual |
152 |
| - * @param {*} expected |
| 116 | + * @name assert.throws |
| 117 | + * @function |
| 118 | + * @param {function()} block |
| 119 | + * @param {Function|RegExp|function(*)} error |
153 | 120 | * @param {string=} message
|
154 | 121 | * @return {void}
|
| 122 | + * @throws {assert.AssertionError} |
155 | 123 | */
|
156 |
| -internal.deepStrictEqual = function(actual, expected, message) {}; |
| 124 | +assert.throws; |
157 | 125 |
|
158 | 126 | /**
|
159 |
| - * @param {*} actual |
160 |
| - * @param {*} expected |
| 127 | + * @param {function()} block |
| 128 | + * @param {Function|RegExp|function(*)} error |
161 | 129 | * @param {string=} message
|
162 | 130 | * @return {void}
|
| 131 | + * @throws {assert.AssertionError} |
163 | 132 | */
|
164 |
| -internal.notDeepStrictEqual = function(actual, expected, message) {}; |
165 |
| - |
166 |
| -/** |
167 |
| - * @type {(function(Function, string=): void)|(function(Function, Function, string=): void)|(function(Function, RegExp, string=): void)|(function(Function, (function(*): boolean), string=): void)} |
168 |
| - */ |
169 |
| -internal.throws; |
170 |
| - |
171 |
| -/** |
172 |
| - * @type {(function(Function, string=): void)|(function(Function, Function, string=): void)|(function(Function, RegExp, string=): void)|(function(Function, (function(*): boolean), string=): void)} |
173 |
| - */ |
174 |
| -internal.doesNotThrow; |
| 133 | +assert.doesNotThrow; |
175 | 134 |
|
176 | 135 | /**
|
177 | 136 | * @param {*} value
|
178 | 137 | * @return {void}
|
| 138 | + * @throws {assert.AssertionError} |
179 | 139 | */
|
180 |
| -internal.ifError = function(value) {}; |
181 |
| - |
182 |
| - |
183 |
| -module.exports = internal; |
| 140 | +assert.ifError; |
184 | 141 |
|
| 142 | +module.exports = assert; |
0 commit comments