UNPKG

3.49 kBTypeScriptView Raw
1/**
2 * Copyright (c) 2002-2019 "Neo4j,"
3 * Neo4j Sweden AB [http://neo4j.com]
4 *
5 * This file is part of Neo4j.
6 *
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
10 *
11 * http://www.apache.org/licenses/LICENSE-2.0
12 *
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
18 */
19
20declare 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
126declare function int(
127 value: Integer | number | string | { low: number; high: number }
128): Integer
129
130declare function isInt(obj: object): boolean
131
132declare function inSafeRange(
133 val: Integer | number | string | { low: number; high: number }
134): boolean
135
136declare function toNumber(
137 val: Integer | number | string | { low: number; high: number }
138): number
139
140declare function toString(
141 val: Integer | number | string | { low: number; high: number },
142 radix?: number
143): string
144
145export { int, isInt, inSafeRange, toNumber, toString }
146
147export default Integer