forked from zoubingwu/better-sqlite3-sqlcipher
-
Notifications
You must be signed in to change notification settings - Fork 1
/
integer.d.ts
110 lines (87 loc) · 3 KB
/
integer.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
// Type definitions for integer 1.0
// Project: https://github.com/JoshuaWise/integer#readme
// Definitions by: Ben Davies <https://github.com/Morfent>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// This can't just be written as a simple class since Integer instances can't
// be constructed by its actual constructor without throwing, but calling it as
// a regular function constructs new instances just fine...
declare function Integer(val: Integer.IntLike): Integer.IntClass;
declare namespace Integer {
type IntLike = number | string | IntClass;
function fromBits(low: number, high?: number): IntClass;
function fromNumber(val: number, defaultVal?: number | IntClass): IntClass;
function fromString(val: string, radix?: number, defaultVal?: string | IntClass): IntClass;
function isInstance(val: any): boolean;
const MAX_VALUE: IntClass;
const MIN_VALUE: IntClass;
const ZERO: IntClass;
const ONE: IntClass;
const NEG_ONE: IntClass;
class IntClass {
low: number;
high: number;
constructor(val: IntLike);
add(augend: IntLike): IntClass;
plus(augend: IntLike): IntClass;
sub(subtrahend: IntLike): IntClass;
subtract(subtrahend: IntLike): IntClass;
minus(subtrahend: IntLike): IntClass;
mul(multiplier: IntLike): IntClass;
multiply(multiplier: IntLike): IntClass;
times(multiplier: IntLike): IntClass;
div(divisor: IntLike): IntClass;
divide(divisor: IntLike): IntClass;
divideBy(divisor: IntLike): IntClass;
dividedBy(divisor: IntLike): IntClass;
over(divisor: IntLike): IntClass;
mod(divisor: IntLike): IntClass;
modulo(divisor: IntLike): IntClass;
neg(): IntClass;
negate(): IntClass;
abs(): IntClass;
absoluteValue(): IntClass;
and(bits: IntLike): IntClass;
or(bits: IntLike): IntClass;
xor(bits: IntLike): IntClass;
not(): IntClass;
shl(bits: number): IntClass;
shiftLeft(bits: number): IntClass;
shr(bits: number): IntClass;
shiftRight(bits: number): IntClass;
eq(val: IntLike): boolean;
equals(val: IntLike): boolean;
isEqualTo(val: IntLike): boolean;
neq(val: IntLike): boolean;
notEquals(val: IntLike): boolean;
isNotEqualTo(val: IntLike): boolean;
doesNotEqual(val: IntLike): boolean;
gt(val: IntLike): boolean;
greaterThan(val: IntLike): boolean;
isGreaterThan(val: IntLike): boolean;
gte(val: IntLike): boolean;
greaterThanOrEquals(val: IntLike): boolean;
isGreaterThanOrEqualTo(val: IntLike): boolean;
lt(val: IntLike): boolean;
lessThan(val: IntLike): boolean;
isLessThan(val: IntLike): boolean;
lte(val: IntLike): boolean;
lessThanOrEquals(val: IntLike): boolean;
isLessThanOrEqualTo(val: IntLike): boolean;
compare(val: IntLike): -1 | 0 | 1;
bitSizeAbs(): number;
isEven(): boolean;
isOdd(): boolean;
isPositive(): boolean;
isNegative(): boolean;
isZero(): boolean;
isNonZero(): boolean;
isNotZero(): boolean;
isSafe(): boolean;
isUnsafe(): boolean;
toNumber(): number;
toNumberUnsafe(): number;
toString(radix?: number): string;
valueOf(): number;
}
}
export = Integer;