Skip to content

Commit 01e78ca

Browse files
committed
Add BigInt support to TypeScript definitions
1 parent 928b4cf commit 01e78ca

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ An arbitrary-precision Decimal type for JavaScript.
55
[![npm version](https://img.shields.io/npm/v/decimal.js.svg)](https://www.npmjs.com/package/decimal.js)
66
[![npm downloads](https://img.shields.io/npm/dw/decimal.js)](https://www.npmjs.com/package/decimal.js)
77
[![CDNJS](https://img.shields.io/cdnjs/v/decimal.js.svg)](https://cdnjs.com/libraries/decimal.js)
8+
[![](https://data.jsdelivr.com/v1/package/npm/decimal.js/badge)](https://www.jsdelivr.com/package/npm/decimal.js)
89

910
<br>
1011

decimal.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ export namespace Decimal {
3636
export type Instance = Decimal;
3737
export type Rounding = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8;
3838
export type Modulo = Rounding | 9;
39-
export type Value = string | number | Decimal;
39+
export type Value = string | number | bigint | Decimal;
4040

4141
// http://mikemcl.github.io/decimal.js/#constructor-properties
4242
export interface Config {
@@ -63,7 +63,7 @@ export declare class Decimal {
6363
abs(): Decimal;
6464

6565
ceil(): Decimal;
66-
66+
6767
clampedTo(min: Decimal.Value, max: Decimal.Value): Decimal;
6868
clamp(min: Decimal.Value, max: Decimal.Value): Decimal;
6969

decimal.global.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ declare global {
5656

5757
type DecimalInstance = Decimal;
5858
type DecimalConstructor = typeof Decimal;
59-
type DecimalValue = string | number | Decimal;
59+
type DecimalValue = string | number | bigint |Decimal;
6060
type DecimalRounding = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8;
6161
type DecimalModulo = DecimalRounding | 9;
6262

@@ -84,7 +84,7 @@ export declare class Decimal {
8484
abs(): Decimal;
8585

8686
ceil(): Decimal;
87-
87+
8888
clampedTo(min: Decimal.Value, max: Decimal.Value): Decimal;
8989
clamp(min: Decimal.Value, max: Decimal.Value): Decimal;
9090

0 commit comments

Comments
 (0)