UNPKG

983 BTypeScriptView Raw
1declare module "bn.js" {
2 export class BN {
3 constructor(value: string | number, radix?: number);
4
5 add(other: BN): BN;
6 sub(other: BN): BN;
7 div(other: BN): BN;
8 mod(other: BN): BN;
9 mul(other: BN): BN;
10
11 pow(other: BN): BN;
12 umod(other: BN): BN;
13
14 eq(other: BN): boolean;
15 lt(other: BN): boolean;
16 lte(other: BN): boolean;
17 gt(other: BN): boolean;
18 gte(other: BN): boolean;
19
20 isNeg(): boolean;
21 isZero(): boolean;
22
23 toTwos(other: number): BN;
24 fromTwos(other: number): BN;
25
26 or(other: BN): BN;
27 and(other: BN): BN;
28 xor(other: BN): BN;
29 shln(other: number): BN;
30 shrn(other: number): BN;
31 maskn(other: number): BN;
32
33 toString(radix: number): string;
34 toNumber(): number;
35 toArray(endian: string, width: number): Uint8Array;
36 encode(encoding: string, compact: boolean): Uint8Array;
37 }
38}