-
Notifications
You must be signed in to change notification settings - Fork 0
/
number.ts
31 lines (29 loc) · 836 Bytes
/
number.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
export type {
number,
}
import type { bigint } from "./bigint.js"
import type { int } from "./integer.js"
import type { nat } from "./natural.js"
import type { real as real_ } from "./real.js"
import type { boolean } from "../boolean/exports.js"
import type {
isNegative,
isOne,
isPositive,
isZero,
} from "./shared.js"
declare namespace number {
type is<x> = [x] extends [number] ? true : false
namespace is {
type big<x> = bigint.is<x>
type integer<x> = int.is<x>
type natural<x> = nat.is<x>
type negative<x> = isNegative<x>
type one<x> = isOne<x>
type positive<x> = isPositive<x>
type real<x> = real_.is<x>
type zero<x> = isZero<x>
type universal<x> = [number] extends [x] ? true : false
type literal<x> = boolean.all<[number.is<x>, boolean.not<number.is.universal<x>>]>
}
}