Skip to content

Commit 57d52cb

Browse files
committed
#383 Refactor type declarations
Rename bignumber.d.ts to types.d.ts Rename bignumber.d.cts to bignumber.d.ts Add `export as namespace` to bignumber.d.ts Remove subpath exports from package.json Refactor named export from bignumber.d.mts #383 Remove `?` from export-related BigNunmber static properties Add blank lines after titles in CHANGELOG.md
1 parent a626ba7 commit 57d52cb

File tree

6 files changed

+1895
-1828
lines changed

6 files changed

+1895
-1828
lines changed

CHANGELOG.md

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,28 @@
11
#### 9.2.1
2+
23
* 08/04/25
34
* ##371 #382 Add `BigNumber` as named export.
45

56
#### 9.2.0
7+
68
* 03/04/25
79
* #355 Support `BigInt` argument.
810
* #371 Provide separate type definitions for CommonJS and ES modules.
911
* #374 Correct `comparedTo` return type.
1012

1113
#### 9.1.2
14+
1215
* 28/08/23
1316
* #354 Amend `round` to avoid bug in v8 Maglev compiler.
1417
* [BUGFIX] #344 `minimum(0, -0)` should be `-0`.
1518

1619
#### 9.1.1
20+
1721
* 04/12/22
1822
* #338 [BUGFIX] `exponentiatedBy`: ensure `0**-n === Infinity` for very large `n`.
1923

2024
#### 9.1.0
25+
2126
* 08/08/22
2227
* #329 Remove `import` example.
2328
* #277 Resolve lint warnings and add number `toString` note.
@@ -27,26 +32,31 @@
2732
* #251 (#308) Amend *bignumber.d.ts* to allow instantiating a BigNumber without `new`.
2833

2934
#### 9.0.2
35+
3036
* 12/12/21
3137
* #250 [BUGFIX] Allow use of user-defined alphabet for base 10.
3238
* #295 Remove *bignumber.min.js* and amend *README.md*.
3339
* Update *.travis.yml* and *LICENCE.md*.
3440

3541
#### 9.0.1
42+
3643
* 28/09/20
3744
* [BUGFIX] #276 Correct `sqrt` initial estimate.
3845
* Update *.travis.yml*, *LICENCE.md* and *README.md*.
3946

4047
#### 9.0.0
48+
4149
* 27/05/2019
4250
* For compatibility with legacy browsers, remove `Symbol` references.
4351

4452
#### 8.1.1
53+
4554
* 24/02/2019
4655
* [BUGFIX] #222 Restore missing `var` to `export BigNumber`.
4756
* Allow any key in BigNumber.Instance in *bignumber.d.ts*.
4857

4958
#### 8.1.0
59+
5060
* 23/02/2019
5161
* [NEW FEATURE] #220 Create a BigNumber using `{s, e, c}`.
5262
* [NEW FEATURE] `isBigNumber`: if `BigNumber.DEBUG` is `true`, also check that the BigNumber instance is well-formed.
@@ -56,17 +66,20 @@
5666
* Update *API.html*.
5767

5868
#### 8.0.2
69+
5970
* 13/01/2019
6071
* #209 `toPrecision` without argument should follow `toString`.
6172
* Improve *Use* section of *README*.
6273
* Optimise `toString(10)`.
6374
* Add verson number to API doc.
6475

6576
#### 8.0.1
77+
6678
* 01/11/2018
6779
* Rest parameter must be array type in *bignumber.d.ts*.
6880

6981
#### 8.0.0
82+
7083
* 01/11/2018
7184
* [NEW FEATURE] Add `BigNumber.sum` method.
7285
* [NEW FEATURE]`toFormat`: add `prefix` and `suffix` options.
@@ -82,27 +95,33 @@
8295
* Remove *bower.json*.
8396

8497
#### 7.2.1
98+
8599
* 24/05/2018
86100
* Add `browser` field to *package.json*.
87101

88102
#### 7.2.0
103+
89104
* 22/05/2018
90105
* #166 Correct *.mjs* file. Remove extension from `main` field in *package.json*.
91106

92107
#### 7.1.0
108+
93109
* 18/05/2018
94110
* Add `module` field to *package.json* for *bignumber.mjs*.
95111

96112
#### 7.0.2
113+
97114
* 17/05/2018
98115
* #165 Bugfix: upper-case letters for bases 11-36 in a custom alphabet.
99116
* Add note to *README* regarding creating BigNumbers from Number values.
100117

101118
#### 7.0.1
119+
102120
* 26/04/2018
103121
* #158 Fix global object variable name typo.
104122

105123
#### 7.0.0
124+
106125
* 26/04/2018
107126
* #143 Remove global BigNumber from typings.
108127
* #144 Enable compatibility with `Object.freeze(Object.prototype)`.
@@ -115,6 +134,7 @@
115134
* Amend indentation and other spacing.
116135

117136
#### 6.0.0
137+
118138
* 26/01/2018
119139
* #137 Implement `APLHABET` configuration option.
120140
* Remove `ERRORS` configuration option.
@@ -131,119 +151,147 @@
131151
* Redo API image.
132152

133153
#### 5.0.0
154+
134155
* 27/11/2017
135156
* #81 Don't throw on constructor call without `new`.
136157

137158
#### 4.1.0
159+
138160
* 26/09/2017
139161
* Remove node 0.6 from *.travis.yml*.
140162
* Add *bignumber.mjs*.
141163

142164
#### 4.0.4
165+
143166
* 03/09/2017
144167
* Add missing aliases to *bignumber.d.ts*.
145168

146169
#### 4.0.3
170+
147171
* 30/08/2017
148172
* Add types: *bignumber.d.ts*.
149173

150174
#### 4.0.2
175+
151176
* 03/05/2017
152177
* #120 Workaround Safari/Webkit bug.
153178

154179
#### 4.0.1
180+
155181
* 05/04/2017
156182
* #121 BigNumber.default to BigNumber['default'].
157183

158184
#### 4.0.0
185+
159186
* 09/01/2017
160187
* Replace BigNumber.isBigNumber method with isBigNumber prototype property.
161188

162189
#### 3.1.2
190+
163191
* 08/01/2017
164192
* Minor documentation edit.
165193

166194
#### 3.1.1
195+
167196
* 08/01/2017
168197
* Uncomment `isBigNumber` tests.
169198
* Ignore dot files.
170199

171200
#### 3.1.0
201+
172202
* 08/01/2017
173203
* Add `isBigNumber` method.
174204

175205
#### 3.0.2
206+
176207
* 08/01/2017
177208
* Bugfix: Possible incorrect value of `ERRORS` after a `BigNumber.another` call (due to `parseNumeric` declaration in outer scope).
178209

179210
#### 3.0.1
211+
180212
* 23/11/2016
181213
* Apply fix for old ipads with `%` issue, see #57 and #102.
182214
* Correct error message.
183215

184216
#### 3.0.0
217+
185218
* 09/11/2016
186219
* Remove `require('crypto')` - leave it to the user.
187220
* Add `BigNumber.set` as `BigNumber.config` alias.
188221
* Default `POW_PRECISION` to `0`.
189222

190223
#### 2.4.0
224+
191225
* 14/07/2016
192226
* #97 Add exports to support ES6 imports.
193227

194228
#### 2.3.0
229+
195230
* 07/03/2016
196231
* #86 Add modulus parameter to `toPower`.
197232

198233
#### 2.2.0
234+
199235
* 03/03/2016
200236
* #91 Permit larger JS integers.
201237

202238
#### 2.1.4
239+
203240
* 15/12/2015
204241
* Correct UMD.
205242

206243
#### 2.1.3
244+
207245
* 13/12/2015
208246
* Refactor re global object and crypto availability when bundling.
209247

210248
#### 2.1.2
249+
211250
* 10/12/2015
212251
* Bugfix: `window.crypto` not assigned to `crypto`.
213252

214253
#### 2.1.1
254+
215255
* 09/12/2015
216256
* Prevent code bundler from adding `crypto` shim.
217257

218258
#### 2.1.0
259+
219260
* 26/10/2015
220261
* For `valueOf` and `toJSON`, include the minus sign with negative zero.
221262

222263
#### 2.0.8
264+
223265
* 2/10/2015
224266
* Internal round function bugfix.
225267

226268
#### 2.0.6
269+
227270
* 31/03/2015
228271
* Add bower.json. Tweak division after in-depth review.
229272

230273
#### 2.0.5
274+
231275
* 25/03/2015
232276
* Amend README. Remove bitcoin address.
233277

234278
#### 2.0.4
279+
235280
* 25/03/2015
236281
* Critical bugfix #58: division.
237282

238283
#### 2.0.3
284+
239285
* 18/02/2015
240286
* Amend README. Add source map.
241287

242288
#### 2.0.2
289+
243290
* 18/02/2015
244291
* Correct links.
245292

246293
#### 2.0.1
294+
247295
* 18/02/2015
248296
* Add `max`, `min`, `precision`, `random`, `shiftedBy`, `toDigits` and `truncated` methods.
249297
* Add the short-forms: `add`, `mul`, `sd`, `sub` and `trunc`.
@@ -257,6 +305,7 @@
257305
* Improve documentation.
258306

259307
#### 2.0.0
308+
260309
* 29/12/2014
261310
* Add `dividedToIntegerBy`, `isInteger` and `toFormat` methods.
262311
* Remove the following short-forms: `isF`, `isZ`, `toE`, `toF`, `toFr`, `toN`, `toP`, `toS`.
@@ -265,41 +314,51 @@
265314
* Incorporate the library into the online documentation.
266315

267316
#### 1.5.0
317+
268318
* 13/11/2014
269319
* Add `toJSON` and `decimalPlaces` methods.
270320

271321
#### 1.4.1
322+
272323
* 08/06/2014
273324
* Amend README.
274325

275326
#### 1.4.0
327+
276328
* 08/05/2014
277329
* Add `toNumber`.
278330

279331
#### 1.3.0
332+
280333
* 08/11/2013
281334
* Ensure correct rounding of `sqrt` in all, rather than almost all, cases.
282335
* Maximum radix to 64.
283336

284337
#### 1.2.1
338+
285339
* 17/10/2013
286340
* Sign of zero when x < 0 and x + (-x) = 0.
287341

288342
#### 1.2.0
343+
289344
* 19/9/2013
290345
* Throw Error objects for stack.
291346

292347
#### 1.1.1
348+
293349
* 22/8/2013
294350
* Show original value in constructor error message.
295351

296352
#### 1.1.0
353+
297354
* 1/8/2013
298355
* Allow numbers with trailing radix point.
299356

300357
#### 1.0.1
358+
301359
* Bugfix: error messages with incorrect method name
302360

303361
#### 1.0.0
362+
304363
* 8/11/2012
305364
* Initial release

bignumber.d.cts

Lines changed: 0 additions & 2 deletions
This file was deleted.

bignumber.d.mts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1-
/// <reference path="./bignumber.d.ts" />
1+
/// <reference path="./types.d.ts" />
2+
23
export default BigNumber;
3-
export { BigNumber };
4+
5+
declare const BigNumberType: typeof BigNumber;
6+
export { BigNumberType as BigNumber };

0 commit comments

Comments
 (0)