Skip to content

Commit 109ee8f

Browse files
committed
Add @throws JSDoc comments for BigInt methods and constructor
1 parent d88d3a4 commit 109ee8f

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/lib/es2020.bigint.d.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ interface BigInt {
9090
/**
9191
* Returns a string representation of an object.
9292
* @param radix Specifies a radix for converting numeric values to strings.
93+
* @throws {RangeError} If `radix` is less than 2 or greater than 36.
9394
*/
9495
toString(radix?: number): string;
9596

@@ -103,6 +104,14 @@ interface BigInt {
103104
}
104105

105106
interface BigIntConstructor {
107+
/**
108+
* Creates a BigInt value from a number, string, boolean, or another BigInt.
109+
*
110+
* @param value The value to convert to a BigInt.
111+
* @throws {RangeError} If `value` is a non-integer number.
112+
* @throws {TypeError} If `value` cannot be converted to a primitive, or if the primitive is undefined, null, or a symbol.
113+
* @throws {SyntaxError} If `value` is a string that cannot be parsed as a BigInt.
114+
*/
106115
(value: bigint | boolean | number | string): bigint;
107116
readonly prototype: BigInt;
108117

@@ -111,13 +120,15 @@ interface BigIntConstructor {
111120
* All higher bits are discarded.
112121
* @param bits The number of low bits to use
113122
* @param int The BigInt whose bits to extract
123+
* @throws {RangeError} If `bits` is negative or greater than 2 ** 53 - 1.
114124
*/
115125
asIntN(bits: number, int: bigint): bigint;
116126
/**
117127
* Interprets the low bits of a BigInt as an unsigned integer.
118128
* All higher bits are discarded.
119129
* @param bits The number of low bits to use
120130
* @param int The BigInt whose bits to extract
131+
* @throws {RangeError} If `bits` is negative or greater than 2 ** 53 - 1.
121132
*/
122133
asUintN(bits: number, int: bigint): bigint;
123134
}

0 commit comments

Comments
 (0)