1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 |
|
12 |
|
13 |
|
14 |
|
15 |
|
16 |
|
17 |
|
18 |
|
19 |
|
20 | declare class Integer {
|
21 | low: number
|
22 | high: number
|
23 |
|
24 | constructor(low?: number, high?: number)
|
25 |
|
26 | inSafeRange(): boolean
|
27 |
|
28 | toInt(): number
|
29 |
|
30 | toNumber(): number
|
31 |
|
32 | toString(radix: number): string
|
33 |
|
34 | getHighBits(): number
|
35 |
|
36 | getLowBits(): number
|
37 |
|
38 | getNumBitsAbs(): number
|
39 |
|
40 | isZero(): boolean
|
41 |
|
42 | isNegative(): boolean
|
43 |
|
44 | isPositive(): boolean
|
45 |
|
46 | isOdd(): boolean
|
47 |
|
48 | isEven(): boolean
|
49 |
|
50 | equals(other: Integer | number | string): boolean
|
51 |
|
52 | notEquals(other: Integer | number | string): boolean
|
53 |
|
54 | lessThan(other: Integer | number | string): boolean
|
55 |
|
56 | lessThanOrEqual(other: Integer | number | string): boolean
|
57 |
|
58 | greaterThan(other: Integer | number | string): boolean
|
59 |
|
60 | greaterThanOrEqual(other: Integer | number | string): boolean
|
61 |
|
62 | compare(other: Integer | number | string): number
|
63 |
|
64 | negate(): Integer
|
65 |
|
66 | add(addend: Integer | number | string): Integer
|
67 |
|
68 | subtract(subtrahend: Integer | number | string): Integer
|
69 |
|
70 | multiply(multiplier: Integer | number | string): Integer
|
71 |
|
72 | div(divisor: Integer | number | string): Integer
|
73 |
|
74 | modulo(divisor: Integer | number | string): Integer
|
75 |
|
76 | not(): Integer
|
77 |
|
78 | and(other: Integer | number | string): Integer
|
79 |
|
80 | or(other: Integer | number | string): Integer
|
81 |
|
82 | xor(other: Integer | number | string): Integer
|
83 |
|
84 | shiftLeft(numBits: Integer | number): Integer
|
85 |
|
86 | shiftRight(numBits: Integer | number): Integer
|
87 |
|
88 | static __isInteger__: true
|
89 |
|
90 | static isInteger(obj: object): boolean
|
91 |
|
92 | static fromInt(value: number): Integer
|
93 |
|
94 | static fromNumber(value: number): Integer
|
95 |
|
96 | static fromBits(lowBits: number, highBits: number): Integer
|
97 |
|
98 | static fromString(str: string, radix?: number): Integer
|
99 |
|
100 | static fromValue(
|
101 | value: Integer | number | string | { low: number; high: number }
|
102 | ): Integer
|
103 |
|
104 | static toNumber(
|
105 | value: Integer | number | string | { low: number; high: number }
|
106 | ): number
|
107 |
|
108 | static toString(
|
109 | value: Integer | number | string | { low: number; high: number },
|
110 | radix?: number
|
111 | ): string
|
112 |
|
113 | static inSafeRange(
|
114 | value: Integer | number | string | { low: number; high: number }
|
115 | ): boolean
|
116 |
|
117 | static ZERO: Integer
|
118 | static ONE: Integer
|
119 | static NEG_ONE: Integer
|
120 | static MAX_VALUE: Integer
|
121 | static MIN_VALUE: Integer
|
122 | static MIN_SAFE_VALUE: Integer
|
123 | static MAX_SAFE_VALUE: Integer
|
124 | }
|
125 |
|
126 | declare function int(
|
127 | value: Integer | number | string | { low: number; high: number }
|
128 | ): Integer
|
129 |
|
130 | declare function isInt(obj: object): boolean
|
131 |
|
132 | declare function inSafeRange(
|
133 | val: Integer | number | string | { low: number; high: number }
|
134 | ): boolean
|
135 |
|
136 | declare function toNumber(
|
137 | val: Integer | number | string | { low: number; high: number }
|
138 | ): number
|
139 |
|
140 | declare function toString(
|
141 | val: Integer | number | string | { low: number; high: number },
|
142 | radix?: number
|
143 | ): string
|
144 |
|
145 | export { int, isInt, inSafeRange, toNumber, toString }
|
146 |
|
147 | export default Integer
|