ts-data-forge 11.0.0 → 12.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/dist/number/branded-types/finite-number.d.mts +47 -61
- package/dist/number/branded-types/finite-number.d.mts.map +1 -1
- package/dist/number/branded-types/finite-number.mjs +37 -41
- package/dist/number/branded-types/finite-number.mjs.map +1 -1
- package/dist/number/branded-types/int.d.mts +40 -46
- package/dist/number/branded-types/int.d.mts.map +1 -1
- package/dist/number/branded-types/int.mjs +29 -31
- package/dist/number/branded-types/int.mjs.map +1 -1
- package/dist/number/branded-types/int16.d.mts +71 -59
- package/dist/number/branded-types/int16.d.mts.map +1 -1
- package/dist/number/branded-types/int16.mjs +56 -47
- package/dist/number/branded-types/int16.mjs.map +1 -1
- package/dist/number/branded-types/int32.d.mts +71 -59
- package/dist/number/branded-types/int32.d.mts.map +1 -1
- package/dist/number/branded-types/int32.mjs +56 -47
- package/dist/number/branded-types/int32.mjs.map +1 -1
- package/dist/number/branded-types/negative-finite-number.d.mts +76 -60
- package/dist/number/branded-types/negative-finite-number.d.mts.map +1 -1
- package/dist/number/branded-types/negative-finite-number.mjs +62 -49
- package/dist/number/branded-types/negative-finite-number.mjs.map +1 -1
- package/dist/number/branded-types/negative-int.d.mts +66 -49
- package/dist/number/branded-types/negative-int.d.mts.map +1 -1
- package/dist/number/branded-types/negative-int.mjs +48 -39
- package/dist/number/branded-types/negative-int.mjs.map +1 -1
- package/dist/number/branded-types/negative-safe-int.d.mts +64 -57
- package/dist/number/branded-types/negative-safe-int.d.mts.map +1 -1
- package/dist/number/branded-types/negative-safe-int.mjs +49 -44
- package/dist/number/branded-types/negative-safe-int.mjs.map +1 -1
- package/dist/number/branded-types/non-negative-finite-number.d.mts +80 -65
- package/dist/number/branded-types/non-negative-finite-number.d.mts.map +1 -1
- package/dist/number/branded-types/non-negative-finite-number.mjs +65 -53
- package/dist/number/branded-types/non-negative-finite-number.mjs.map +1 -1
- package/dist/number/branded-types/non-negative-int16.d.mts +71 -58
- package/dist/number/branded-types/non-negative-int16.d.mts.map +1 -1
- package/dist/number/branded-types/non-negative-int16.mjs +55 -45
- package/dist/number/branded-types/non-negative-int16.mjs.map +1 -1
- package/dist/number/branded-types/non-negative-int32.d.mts +71 -59
- package/dist/number/branded-types/non-negative-int32.d.mts.map +1 -1
- package/dist/number/branded-types/non-negative-int32.mjs +55 -46
- package/dist/number/branded-types/non-negative-int32.mjs.map +1 -1
- package/dist/number/branded-types/non-positive-finite-number.d.mts +70 -55
- package/dist/number/branded-types/non-positive-finite-number.d.mts.map +1 -1
- package/dist/number/branded-types/non-positive-finite-number.mjs +55 -43
- package/dist/number/branded-types/non-positive-finite-number.mjs.map +1 -1
- package/dist/number/branded-types/non-positive-int.d.mts +46 -146
- package/dist/number/branded-types/non-positive-int.d.mts.map +1 -1
- package/dist/number/branded-types/non-positive-int.mjs +33 -108
- package/dist/number/branded-types/non-positive-int.mjs.map +1 -1
- package/dist/number/branded-types/non-positive-safe-int.d.mts +62 -54
- package/dist/number/branded-types/non-positive-safe-int.d.mts.map +1 -1
- package/dist/number/branded-types/non-positive-safe-int.mjs +46 -41
- package/dist/number/branded-types/non-positive-safe-int.mjs.map +1 -1
- package/dist/number/branded-types/non-zero-finite-number.d.mts +62 -49
- package/dist/number/branded-types/non-zero-finite-number.d.mts.map +1 -1
- package/dist/number/branded-types/non-zero-finite-number.mjs +46 -37
- package/dist/number/branded-types/non-zero-finite-number.mjs.map +1 -1
- package/dist/number/branded-types/non-zero-int.d.mts +51 -38
- package/dist/number/branded-types/non-zero-int.d.mts.map +1 -1
- package/dist/number/branded-types/non-zero-int.mjs +31 -27
- package/dist/number/branded-types/non-zero-int.mjs.map +1 -1
- package/dist/number/branded-types/non-zero-int16.d.mts +59 -54
- package/dist/number/branded-types/non-zero-int16.d.mts.map +1 -1
- package/dist/number/branded-types/non-zero-int16.mjs +44 -41
- package/dist/number/branded-types/non-zero-int16.mjs.map +1 -1
- package/dist/number/branded-types/non-zero-int32.d.mts +59 -55
- package/dist/number/branded-types/non-zero-int32.d.mts.map +1 -1
- package/dist/number/branded-types/non-zero-int32.mjs +44 -42
- package/dist/number/branded-types/non-zero-int32.mjs.map +1 -1
- package/dist/number/branded-types/non-zero-safe-int.d.mts +60 -55
- package/dist/number/branded-types/non-zero-safe-int.d.mts.map +1 -1
- package/dist/number/branded-types/non-zero-safe-int.mjs +44 -42
- package/dist/number/branded-types/non-zero-safe-int.mjs.map +1 -1
- package/dist/number/branded-types/non-zero-uint16.d.mts +59 -54
- package/dist/number/branded-types/non-zero-uint16.d.mts.map +1 -1
- package/dist/number/branded-types/non-zero-uint16.mjs +43 -41
- package/dist/number/branded-types/non-zero-uint16.mjs.map +1 -1
- package/dist/number/branded-types/non-zero-uint32.d.mts +59 -54
- package/dist/number/branded-types/non-zero-uint32.d.mts.map +1 -1
- package/dist/number/branded-types/non-zero-uint32.mjs +43 -41
- package/dist/number/branded-types/non-zero-uint32.mjs.map +1 -1
- package/dist/number/branded-types/positive-finite-number.d.mts +82 -64
- package/dist/number/branded-types/positive-finite-number.d.mts.map +1 -1
- package/dist/number/branded-types/positive-finite-number.mjs +67 -52
- package/dist/number/branded-types/positive-finite-number.mjs.map +1 -1
- package/dist/number/branded-types/positive-int.d.mts +53 -70
- package/dist/number/branded-types/positive-int.d.mts.map +1 -1
- package/dist/number/branded-types/positive-int.mjs +42 -52
- package/dist/number/branded-types/positive-int.mjs.map +1 -1
- package/dist/number/branded-types/positive-int16.d.mts +68 -58
- package/dist/number/branded-types/positive-int16.d.mts.map +1 -1
- package/dist/number/branded-types/positive-int16.mjs +52 -45
- package/dist/number/branded-types/positive-int16.mjs.map +1 -1
- package/dist/number/branded-types/positive-int32.d.mts +68 -58
- package/dist/number/branded-types/positive-int32.d.mts.map +1 -1
- package/dist/number/branded-types/positive-int32.mjs +52 -45
- package/dist/number/branded-types/positive-int32.mjs.map +1 -1
- package/dist/number/branded-types/positive-safe-int.d.mts +72 -61
- package/dist/number/branded-types/positive-safe-int.d.mts.map +1 -1
- package/dist/number/branded-types/positive-safe-int.mjs +56 -48
- package/dist/number/branded-types/positive-safe-int.mjs.map +1 -1
- package/dist/number/branded-types/positive-uint16.d.mts +68 -58
- package/dist/number/branded-types/positive-uint16.d.mts.map +1 -1
- package/dist/number/branded-types/positive-uint16.mjs +52 -45
- package/dist/number/branded-types/positive-uint16.mjs.map +1 -1
- package/dist/number/branded-types/positive-uint32.d.mts +68 -59
- package/dist/number/branded-types/positive-uint32.d.mts.map +1 -1
- package/dist/number/branded-types/positive-uint32.mjs +52 -46
- package/dist/number/branded-types/positive-uint32.mjs.map +1 -1
- package/dist/number/branded-types/safe-int.d.mts +52 -66
- package/dist/number/branded-types/safe-int.d.mts.map +1 -1
- package/dist/number/branded-types/safe-int.mjs +45 -47
- package/dist/number/branded-types/safe-int.mjs.map +1 -1
- package/dist/number/branded-types/safe-uint.d.mts +68 -58
- package/dist/number/branded-types/safe-uint.d.mts.map +1 -1
- package/dist/number/branded-types/safe-uint.mjs +53 -46
- package/dist/number/branded-types/safe-uint.mjs.map +1 -1
- package/dist/number/branded-types/uint.d.mts +72 -55
- package/dist/number/branded-types/uint.d.mts.map +1 -1
- package/dist/number/branded-types/uint.mjs +52 -45
- package/dist/number/branded-types/uint.mjs.map +1 -1
- package/dist/number/branded-types/uint16.d.mts +66 -59
- package/dist/number/branded-types/uint16.d.mts.map +1 -1
- package/dist/number/branded-types/uint16.mjs +51 -45
- package/dist/number/branded-types/uint16.mjs.map +1 -1
- package/dist/number/branded-types/uint32.d.mts +66 -57
- package/dist/number/branded-types/uint32.d.mts.map +1 -1
- package/dist/number/branded-types/uint32.mjs +50 -45
- package/dist/number/branded-types/uint32.mjs.map +1 -1
- package/dist/number/enum/int8.d.mts +62 -66
- package/dist/number/enum/int8.d.mts.map +1 -1
- package/dist/number/enum/int8.mjs +57 -51
- package/dist/number/enum/int8.mjs.map +1 -1
- package/dist/number/enum/uint8.d.mts +66 -59
- package/dist/number/enum/uint8.d.mts.map +1 -1
- package/dist/number/enum/uint8.mjs +57 -51
- package/dist/number/enum/uint8.mjs.map +1 -1
- package/dist/number/refined-number-utils.d.mts +9 -9
- package/dist/number/refined-number-utils.d.mts.map +1 -1
- package/dist/number/refined-number-utils.mjs +7 -7
- package/dist/number/refined-number-utils.mjs.map +1 -1
- package/package.json +2 -1
- package/src/number/branded-types/finite-number.mts +47 -61
- package/src/number/branded-types/int.mts +40 -46
- package/src/number/branded-types/int16.mts +72 -60
- package/src/number/branded-types/int32.mts +72 -60
- package/src/number/branded-types/negative-finite-number.mts +78 -71
- package/src/number/branded-types/negative-finite-number.test.mts +4 -4
- package/src/number/branded-types/negative-int.mts +68 -60
- package/src/number/branded-types/negative-int.test.mts +5 -5
- package/src/number/branded-types/negative-safe-int.mts +66 -68
- package/src/number/branded-types/negative-safe-int.test.mts +4 -4
- package/src/number/branded-types/non-negative-finite-number.mts +81 -66
- package/src/number/branded-types/non-negative-int16.mts +72 -59
- package/src/number/branded-types/non-negative-int32.mts +72 -60
- package/src/number/branded-types/non-positive-finite-number.mts +71 -56
- package/src/number/branded-types/non-positive-finite-number.test.mts +7 -7
- package/src/number/branded-types/non-positive-int.mts +47 -147
- package/src/number/branded-types/non-positive-int.test.mts +7 -7
- package/src/number/branded-types/non-positive-safe-int.mts +63 -55
- package/src/number/branded-types/non-positive-safe-int.test.mts +7 -7
- package/src/number/branded-types/non-zero-finite-number.mts +62 -51
- package/src/number/branded-types/non-zero-int.mts +51 -38
- package/src/number/branded-types/non-zero-int16.mts +60 -55
- package/src/number/branded-types/non-zero-int32.mts +60 -56
- package/src/number/branded-types/non-zero-safe-int.mts +61 -56
- package/src/number/branded-types/non-zero-uint16.mts +60 -55
- package/src/number/branded-types/non-zero-uint32.mts +60 -55
- package/src/number/branded-types/positive-finite-number.mts +83 -65
- package/src/number/branded-types/positive-int.mts +54 -71
- package/src/number/branded-types/positive-int16.mts +69 -59
- package/src/number/branded-types/positive-int32.mts +69 -59
- package/src/number/branded-types/positive-safe-int.mts +73 -62
- package/src/number/branded-types/positive-uint16.mts +69 -59
- package/src/number/branded-types/positive-uint32.mts +69 -60
- package/src/number/branded-types/safe-int.mts +53 -67
- package/src/number/branded-types/safe-uint.mts +69 -59
- package/src/number/branded-types/uint.mts +73 -56
- package/src/number/branded-types/uint16.mts +67 -60
- package/src/number/branded-types/uint32.mts +67 -58
- package/src/number/enum/int8.mts +70 -73
- package/src/number/enum/int8.test.mts +7 -4
- package/src/number/enum/uint8.mts +74 -66
- package/src/number/enum/uint8.test.mts +7 -4
- package/src/number/refined-number-utils.mts +22 -19
|
@@ -1,19 +1,24 @@
|
|
|
1
1
|
import { type NonPositiveSafeInt as TtfImported_NonPositiveSafeInt } from 'ts-type-forge';
|
|
2
2
|
export type NonPositiveSafeInt = TtfImported_NonPositiveSafeInt;
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
5
|
-
* range [Number.MIN_SAFE_INTEGER, 0]).
|
|
4
|
+
* Type guard that checks if a value is a non-positive safe integer.
|
|
6
5
|
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
6
|
+
* Returns `true` for a non-positive safe integer — a value with no fractional
|
|
7
|
+
* component.
|
|
8
|
+
*
|
|
9
|
+
* @param value - The value to check
|
|
10
|
+
* @returns `true` if the value is a non-positive safe integer, `false` otherwise
|
|
9
11
|
*/
|
|
10
12
|
export declare const isNonPositiveSafeInt: (a: number) => a is TtfImported_NonPositiveSafeInt;
|
|
11
13
|
/**
|
|
12
|
-
* Casts a number to
|
|
14
|
+
* Casts a `number` to the `NonPositiveSafeInt` branded type.
|
|
15
|
+
*
|
|
16
|
+
* Validates that the value is a non-positive safe integer and returns it with
|
|
17
|
+
* the `NonPositiveSafeInt` brand. Throws a `TypeError` otherwise.
|
|
13
18
|
*
|
|
14
|
-
* @param value The value to cast
|
|
15
|
-
* @returns The value as a NonPositiveSafeInt
|
|
16
|
-
* @throws {TypeError} If the value is not a non-positive safe integer
|
|
19
|
+
* @param value - The value to cast
|
|
20
|
+
* @returns The value as a `NonPositiveSafeInt`
|
|
21
|
+
* @throws {TypeError} If the value is not a non-positive safe integer
|
|
17
22
|
*/
|
|
18
23
|
export declare const asNonPositiveSafeInt: <N extends number>(x: N) => number & {
|
|
19
24
|
readonly "< 2^15": true;
|
|
@@ -29,90 +34,93 @@ export declare const asNonPositiveSafeInt: <N extends number>(x: N) => number &
|
|
|
29
34
|
'TSTypeForgeInternals--edd2f9ce-7ca5-45b0-9d1a-bd61b9b5d9c3': unknown;
|
|
30
35
|
}> & N;
|
|
31
36
|
/**
|
|
32
|
-
* Namespace providing type-safe
|
|
33
|
-
*
|
|
37
|
+
* Namespace providing type-safe operations for the `NonPositiveSafeInt` branded
|
|
38
|
+
* type.
|
|
34
39
|
*
|
|
35
|
-
*
|
|
36
|
-
*
|
|
37
|
-
* maintains the non-positive safe integer constraint, with positive results
|
|
38
|
-
* clamped to 0 and underflow results clamped to MIN_VALUE.
|
|
40
|
+
* The `NonPositiveSafeInt` type represents a non-positive safe integer.
|
|
41
|
+
* Division (`div`) uses floor division.
|
|
39
42
|
*/
|
|
40
43
|
export declare const NonPositiveSafeInt: {
|
|
41
44
|
/**
|
|
42
|
-
* Type guard
|
|
45
|
+
* Type guard that checks if a value is a non-positive safe integer.
|
|
43
46
|
*
|
|
44
|
-
* @param value The value to check
|
|
45
|
-
* @returns `true` if the value is a non-positive safe integer, `false`
|
|
46
|
-
*
|
|
47
|
+
* @param value - The value to check
|
|
48
|
+
* @returns `true` if the value is a non-positive safe integer, `false` otherwise
|
|
49
|
+
* @see {@link isNonPositiveSafeInt} for usage examples
|
|
47
50
|
*/
|
|
48
51
|
readonly is: (a: number) => a is TtfImported_NonPositiveSafeInt;
|
|
49
52
|
/**
|
|
50
|
-
* The
|
|
51
|
-
*
|
|
52
|
-
* @readonly
|
|
53
|
+
* The smallest value representable as `NonPositiveSafeInt` (the lower
|
|
54
|
+
* saturation target of `fromNumber`).
|
|
53
55
|
*/
|
|
54
56
|
readonly MIN_VALUE: number;
|
|
55
57
|
/**
|
|
56
|
-
* The
|
|
57
|
-
*
|
|
58
|
-
* @readonly
|
|
58
|
+
* The largest value representable as `NonPositiveSafeInt` (the upper
|
|
59
|
+
* saturation target of `fromNumber`).
|
|
59
60
|
*/
|
|
60
61
|
readonly MAX_VALUE: 0;
|
|
61
62
|
/**
|
|
62
|
-
* Returns the
|
|
63
|
+
* Returns the smallest of the given non-positive safe integers.
|
|
63
64
|
*
|
|
64
|
-
* @param
|
|
65
|
-
* @
|
|
66
|
-
* @returns The minimum value as a NonPositiveSafeInt.
|
|
65
|
+
* @param values - The non-positive safe integers to compare (at least one required)
|
|
66
|
+
* @returns The smallest value as a `NonPositiveSafeInt`
|
|
67
67
|
*/
|
|
68
68
|
readonly min: (...values: readonly import("ts-type-forge").WithSmallInt<TtfImported_NonPositiveSafeInt>[]) => TtfImported_NonPositiveSafeInt;
|
|
69
69
|
/**
|
|
70
|
-
* Returns the
|
|
70
|
+
* Returns the largest of the given non-positive safe integers.
|
|
71
71
|
*
|
|
72
|
-
* @param
|
|
73
|
-
* @
|
|
74
|
-
* @returns The maximum value as a NonPositiveSafeInt.
|
|
72
|
+
* @param values - The non-positive safe integers to compare (at least one required)
|
|
73
|
+
* @returns The largest value as a `NonPositiveSafeInt`
|
|
75
74
|
*/
|
|
76
75
|
readonly max: (...values: readonly import("ts-type-forge").WithSmallInt<TtfImported_NonPositiveSafeInt>[]) => TtfImported_NonPositiveSafeInt;
|
|
77
76
|
/**
|
|
78
|
-
*
|
|
77
|
+
* Converts an arbitrary `number` into a `NonPositiveSafeInt`, rounding to the
|
|
78
|
+
* nearest integer and saturating the result into the range `[MIN_VALUE,
|
|
79
|
+
* MAX_VALUE]`.
|
|
80
|
+
*
|
|
81
|
+
* Unlike `asNonPositiveSafeInt`, this is total: out-of-range inputs are
|
|
82
|
+
* clamped to the nearest representable `NonPositiveSafeInt` instead of
|
|
83
|
+
* throwing.
|
|
79
84
|
*
|
|
80
|
-
* @param value The
|
|
81
|
-
* @returns The value
|
|
82
|
-
* NonPositiveSafeInt.
|
|
85
|
+
* @param value - The value to convert
|
|
86
|
+
* @returns The value as a `NonPositiveSafeInt`
|
|
83
87
|
*/
|
|
84
|
-
readonly
|
|
88
|
+
readonly fromNumber: (x: number) => TtfImported_NonPositiveSafeInt;
|
|
85
89
|
/**
|
|
86
|
-
* Generates a random NonPositiveSafeInt
|
|
90
|
+
* Generates a random `NonPositiveSafeInt` within the given range.
|
|
91
|
+
*
|
|
92
|
+
* The range is inclusive on both ends.
|
|
87
93
|
*
|
|
88
|
-
* @
|
|
94
|
+
* @param min - The minimum value (inclusive)
|
|
95
|
+
* @param max - The maximum value (inclusive)
|
|
96
|
+
* @returns A random `NonPositiveSafeInt` in `[min, max]`
|
|
89
97
|
*/
|
|
90
98
|
readonly random: (min?: import("ts-type-forge").WithSmallInt<TtfImported_NonPositiveSafeInt> | undefined, max?: import("ts-type-forge").WithSmallInt<TtfImported_NonPositiveSafeInt> | undefined) => TtfImported_NonPositiveSafeInt;
|
|
91
99
|
/**
|
|
92
|
-
* Raises a
|
|
100
|
+
* Raises `a` to the power `b`, returning `a ** b` as a `NonPositiveSafeInt`
|
|
101
|
+
* (floored to an integer).
|
|
93
102
|
*
|
|
94
|
-
* @param a The base
|
|
95
|
-
* @param b The exponent
|
|
96
|
-
* @returns `a ** b`
|
|
97
|
-
* NonPositiveSafeInt.
|
|
103
|
+
* @param a - The base non-positive safe integer
|
|
104
|
+
* @param b - The exponent non-positive safe integer
|
|
105
|
+
* @returns `a ** b` as a `NonPositiveSafeInt`
|
|
98
106
|
*/
|
|
99
107
|
readonly pow: (x: import("ts-type-forge").WithSmallInt<TtfImported_NonPositiveSafeInt>, y: import("ts-type-forge").WithSmallInt<TtfImported_NonPositiveSafeInt>) => TtfImported_NonPositiveSafeInt;
|
|
100
108
|
/**
|
|
101
|
-
* Adds two
|
|
109
|
+
* Adds two non-positive safe integers, returning `a + b` as a
|
|
110
|
+
* `NonPositiveSafeInt`.
|
|
102
111
|
*
|
|
103
|
-
* @param a The first
|
|
104
|
-
* @param b The second
|
|
105
|
-
* @returns `a
|
|
106
|
-
* NonPositiveSafeInt.
|
|
112
|
+
* @param a - The first non-positive safe integer
|
|
113
|
+
* @param b - The second non-positive safe integer
|
|
114
|
+
* @returns The sum of `a` and `b` as a `NonPositiveSafeInt`
|
|
107
115
|
*/
|
|
108
116
|
readonly add: (x: import("ts-type-forge").WithSmallInt<TtfImported_NonPositiveSafeInt>, y: import("ts-type-forge").WithSmallInt<TtfImported_NonPositiveSafeInt>) => TtfImported_NonPositiveSafeInt;
|
|
109
117
|
/**
|
|
110
|
-
* Subtracts
|
|
118
|
+
* Subtracts two non-positive safe integers, returning `a - b` as a
|
|
119
|
+
* `NonPositiveSafeInt`.
|
|
111
120
|
*
|
|
112
|
-
* @param a The
|
|
113
|
-
* @param b The
|
|
114
|
-
* @returns `a
|
|
115
|
-
* NonPositiveSafeInt (maximum 0).
|
|
121
|
+
* @param a - The first non-positive safe integer
|
|
122
|
+
* @param b - The second non-positive safe integer
|
|
123
|
+
* @returns The difference of `a` and `b` as a `NonPositiveSafeInt`
|
|
116
124
|
*/
|
|
117
125
|
readonly sub: (x: import("ts-type-forge").WithSmallInt<TtfImported_NonPositiveSafeInt>, y: import("ts-type-forge").WithSmallInt<TtfImported_NonPositiveSafeInt>) => TtfImported_NonPositiveSafeInt;
|
|
118
126
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"non-positive-safe-int.d.mts","sourceRoot":"","sources":["../../../src/number/branded-types/non-positive-safe-int.mts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,kBAAkB,IAAI,8BAA8B,EAAE,MAAM,eAAe,CAAC;AAG1F,MAAM,MAAM,kBAAkB,GAAG,8BAA8B,CAAC;AA6BhE
|
|
1
|
+
{"version":3,"file":"non-positive-safe-int.d.mts","sourceRoot":"","sources":["../../../src/number/branded-types/non-positive-safe-int.mts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,kBAAkB,IAAI,8BAA8B,EAAE,MAAM,eAAe,CAAC;AAG1F,MAAM,MAAM,kBAAkB,GAAG,8BAA8B,CAAC;AA6BhE;;;;;;;;GAQG;AACH,eAAO,MAAM,oBAAoB,oDAAK,CAAC;AAEvC;;;;;;;;;GASG;AACH,eAAO,MAAM,oBAAoB;;;;;;;;;;;;MAAW,CAAC;AAE7C;;;;;;GAMG;AACH,eAAO,MAAM,kBAAkB;IAC7B;;;;;;OAMG;;IAGH;;;OAGG;;IAGH;;;OAGG;;IAGH;;;;;OAKG;;IAGH;;;;;OAKG;;IAGH;;;;;;;;;;;OAWG;;IAGH;;;;;;;;OAQG;;IAGH;;;;;;;OAOG;;IAGH;;;;;;;OAOG;;IAGH;;;;;;;OAOG;;CAEK,CAAC"}
|
|
@@ -6,7 +6,7 @@ const {
|
|
|
6
6
|
MIN_VALUE,
|
|
7
7
|
add,
|
|
8
8
|
castType,
|
|
9
|
-
|
|
9
|
+
fromNumber,
|
|
10
10
|
is,
|
|
11
11
|
max: max_,
|
|
12
12
|
min: min_,
|
|
@@ -23,80 +23,85 @@ const isNonPositiveSafeInt = is;
|
|
|
23
23
|
const asNonPositiveSafeInt = castType;
|
|
24
24
|
const NonPositiveSafeInt = {
|
|
25
25
|
/**
|
|
26
|
-
* Type guard
|
|
26
|
+
* Type guard that checks if a value is a non-positive safe integer.
|
|
27
27
|
*
|
|
28
|
-
* @param value The value to check
|
|
29
|
-
* @returns `true` if the value is a non-positive safe integer, `false`
|
|
30
|
-
*
|
|
28
|
+
* @param value - The value to check
|
|
29
|
+
* @returns `true` if the value is a non-positive safe integer, `false` otherwise
|
|
30
|
+
* @see {@link isNonPositiveSafeInt} for usage examples
|
|
31
31
|
*/
|
|
32
32
|
is,
|
|
33
33
|
/**
|
|
34
|
-
* The
|
|
35
|
-
*
|
|
36
|
-
* @readonly
|
|
34
|
+
* The smallest value representable as `NonPositiveSafeInt` (the lower
|
|
35
|
+
* saturation target of `fromNumber`).
|
|
37
36
|
*/
|
|
38
37
|
MIN_VALUE,
|
|
39
38
|
/**
|
|
40
|
-
* The
|
|
41
|
-
*
|
|
42
|
-
* @readonly
|
|
39
|
+
* The largest value representable as `NonPositiveSafeInt` (the upper
|
|
40
|
+
* saturation target of `fromNumber`).
|
|
43
41
|
*/
|
|
44
42
|
MAX_VALUE,
|
|
45
43
|
/**
|
|
46
|
-
* Returns the
|
|
44
|
+
* Returns the smallest of the given non-positive safe integers.
|
|
47
45
|
*
|
|
48
|
-
* @param
|
|
49
|
-
* @
|
|
50
|
-
* @returns The minimum value as a NonPositiveSafeInt.
|
|
46
|
+
* @param values - The non-positive safe integers to compare (at least one required)
|
|
47
|
+
* @returns The smallest value as a `NonPositiveSafeInt`
|
|
51
48
|
*/
|
|
52
49
|
min: min_,
|
|
53
50
|
/**
|
|
54
|
-
* Returns the
|
|
51
|
+
* Returns the largest of the given non-positive safe integers.
|
|
55
52
|
*
|
|
56
|
-
* @param
|
|
57
|
-
* @
|
|
58
|
-
* @returns The maximum value as a NonPositiveSafeInt.
|
|
53
|
+
* @param values - The non-positive safe integers to compare (at least one required)
|
|
54
|
+
* @returns The largest value as a `NonPositiveSafeInt`
|
|
59
55
|
*/
|
|
60
56
|
max: max_,
|
|
61
57
|
/**
|
|
62
|
-
*
|
|
58
|
+
* Converts an arbitrary `number` into a `NonPositiveSafeInt`, rounding to the
|
|
59
|
+
* nearest integer and saturating the result into the range `[MIN_VALUE,
|
|
60
|
+
* MAX_VALUE]`.
|
|
63
61
|
*
|
|
64
|
-
*
|
|
65
|
-
*
|
|
66
|
-
*
|
|
62
|
+
* Unlike `asNonPositiveSafeInt`, this is total: out-of-range inputs are
|
|
63
|
+
* clamped to the nearest representable `NonPositiveSafeInt` instead of
|
|
64
|
+
* throwing.
|
|
65
|
+
*
|
|
66
|
+
* @param value - The value to convert
|
|
67
|
+
* @returns The value as a `NonPositiveSafeInt`
|
|
67
68
|
*/
|
|
68
|
-
|
|
69
|
+
fromNumber,
|
|
69
70
|
/**
|
|
70
|
-
* Generates a random NonPositiveSafeInt
|
|
71
|
+
* Generates a random `NonPositiveSafeInt` within the given range.
|
|
72
|
+
*
|
|
73
|
+
* The range is inclusive on both ends.
|
|
71
74
|
*
|
|
72
|
-
* @
|
|
75
|
+
* @param min - The minimum value (inclusive)
|
|
76
|
+
* @param max - The maximum value (inclusive)
|
|
77
|
+
* @returns A random `NonPositiveSafeInt` in `[min, max]`
|
|
73
78
|
*/
|
|
74
79
|
random,
|
|
75
80
|
/**
|
|
76
|
-
* Raises a
|
|
81
|
+
* Raises `a` to the power `b`, returning `a ** b` as a `NonPositiveSafeInt`
|
|
82
|
+
* (floored to an integer).
|
|
77
83
|
*
|
|
78
|
-
* @param a The base
|
|
79
|
-
* @param b The exponent
|
|
80
|
-
* @returns `a ** b`
|
|
81
|
-
* NonPositiveSafeInt.
|
|
84
|
+
* @param a - The base non-positive safe integer
|
|
85
|
+
* @param b - The exponent non-positive safe integer
|
|
86
|
+
* @returns `a ** b` as a `NonPositiveSafeInt`
|
|
82
87
|
*/
|
|
83
88
|
pow,
|
|
84
89
|
/**
|
|
85
|
-
* Adds two
|
|
90
|
+
* Adds two non-positive safe integers, returning `a + b` as a
|
|
91
|
+
* `NonPositiveSafeInt`.
|
|
86
92
|
*
|
|
87
|
-
* @param a The first
|
|
88
|
-
* @param b The second
|
|
89
|
-
* @returns `a
|
|
90
|
-
* NonPositiveSafeInt.
|
|
93
|
+
* @param a - The first non-positive safe integer
|
|
94
|
+
* @param b - The second non-positive safe integer
|
|
95
|
+
* @returns The sum of `a` and `b` as a `NonPositiveSafeInt`
|
|
91
96
|
*/
|
|
92
97
|
add,
|
|
93
98
|
/**
|
|
94
|
-
* Subtracts
|
|
99
|
+
* Subtracts two non-positive safe integers, returning `a - b` as a
|
|
100
|
+
* `NonPositiveSafeInt`.
|
|
95
101
|
*
|
|
96
|
-
* @param a The
|
|
97
|
-
* @param b The
|
|
98
|
-
* @returns `a
|
|
99
|
-
* NonPositiveSafeInt (maximum 0).
|
|
102
|
+
* @param a - The first non-positive safe integer
|
|
103
|
+
* @param b - The second non-positive safe integer
|
|
104
|
+
* @returns The difference of `a` and `b` as a `NonPositiveSafeInt`
|
|
100
105
|
*/
|
|
101
106
|
sub
|
|
102
107
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"non-positive-safe-int.mjs","sources":["../../../src/number/branded-types/non-positive-safe-int.mts"],"sourcesContent":["import { type NonPositiveSafeInt as TtfImported_NonPositiveSafeInt } from 'ts-type-forge';\nimport { TsDataForgeInternals } from '../refined-number-utils.mjs';\n\nexport type NonPositiveSafeInt = TtfImported_NonPositiveSafeInt;\n\ntype ElementType = NonPositiveSafeInt;\n\nconst typeNameInMessage = 'a non-positive safe integer';\n\nconst {\n MAX_VALUE,\n MIN_VALUE,\n add,\n castType,\n
|
|
1
|
+
{"version":3,"file":"non-positive-safe-int.mjs","sources":["../../../src/number/branded-types/non-positive-safe-int.mts"],"sourcesContent":["import { type NonPositiveSafeInt as TtfImported_NonPositiveSafeInt } from 'ts-type-forge';\nimport { TsDataForgeInternals } from '../refined-number-utils.mjs';\n\nexport type NonPositiveSafeInt = TtfImported_NonPositiveSafeInt;\n\ntype ElementType = NonPositiveSafeInt;\n\nconst typeNameInMessage = 'a non-positive safe integer';\n\nconst {\n MAX_VALUE,\n MIN_VALUE,\n add,\n castType,\n fromNumber,\n is,\n max: max_,\n min: min_,\n pow,\n random,\n sub,\n} = TsDataForgeInternals.RefinedNumberUtils.operatorsForInteger<\n ElementType,\n number,\n 0\n>({\n integerOrSafeInteger: 'SafeInteger',\n MIN_VALUE: Number.MIN_SAFE_INTEGER,\n MAX_VALUE: 0,\n typeNameInMessage,\n} as const);\n\n/**\n * Type guard that checks if a value is a non-positive safe integer.\n *\n * Returns `true` for a non-positive safe integer — a value with no fractional\n * component.\n *\n * @param value - The value to check\n * @returns `true` if the value is a non-positive safe integer, `false` otherwise\n */\nexport const isNonPositiveSafeInt = is;\n\n/**\n * Casts a `number` to the `NonPositiveSafeInt` branded type.\n *\n * Validates that the value is a non-positive safe integer and returns it with\n * the `NonPositiveSafeInt` brand. Throws a `TypeError` otherwise.\n *\n * @param value - The value to cast\n * @returns The value as a `NonPositiveSafeInt`\n * @throws {TypeError} If the value is not a non-positive safe integer\n */\nexport const asNonPositiveSafeInt = castType;\n\n/**\n * Namespace providing type-safe operations for the `NonPositiveSafeInt` branded\n * type.\n *\n * The `NonPositiveSafeInt` type represents a non-positive safe integer.\n * Division (`div`) uses floor division.\n */\nexport const NonPositiveSafeInt = {\n /**\n * Type guard that checks if a value is a non-positive safe integer.\n *\n * @param value - The value to check\n * @returns `true` if the value is a non-positive safe integer, `false` otherwise\n * @see {@link isNonPositiveSafeInt} for usage examples\n */\n is,\n\n /**\n * The smallest value representable as `NonPositiveSafeInt` (the lower\n * saturation target of `fromNumber`).\n */\n MIN_VALUE,\n\n /**\n * The largest value representable as `NonPositiveSafeInt` (the upper\n * saturation target of `fromNumber`).\n */\n MAX_VALUE,\n\n /**\n * Returns the smallest of the given non-positive safe integers.\n *\n * @param values - The non-positive safe integers to compare (at least one required)\n * @returns The smallest value as a `NonPositiveSafeInt`\n */\n min: min_,\n\n /**\n * Returns the largest of the given non-positive safe integers.\n *\n * @param values - The non-positive safe integers to compare (at least one required)\n * @returns The largest value as a `NonPositiveSafeInt`\n */\n max: max_,\n\n /**\n * Converts an arbitrary `number` into a `NonPositiveSafeInt`, rounding to the\n * nearest integer and saturating the result into the range `[MIN_VALUE,\n * MAX_VALUE]`.\n *\n * Unlike `asNonPositiveSafeInt`, this is total: out-of-range inputs are\n * clamped to the nearest representable `NonPositiveSafeInt` instead of\n * throwing.\n *\n * @param value - The value to convert\n * @returns The value as a `NonPositiveSafeInt`\n */\n fromNumber,\n\n /**\n * Generates a random `NonPositiveSafeInt` within the given range.\n *\n * The range is inclusive on both ends.\n *\n * @param min - The minimum value (inclusive)\n * @param max - The maximum value (inclusive)\n * @returns A random `NonPositiveSafeInt` in `[min, max]`\n */\n random,\n\n /**\n * Raises `a` to the power `b`, returning `a ** b` as a `NonPositiveSafeInt`\n * (floored to an integer).\n *\n * @param a - The base non-positive safe integer\n * @param b - The exponent non-positive safe integer\n * @returns `a ** b` as a `NonPositiveSafeInt`\n */\n pow,\n\n /**\n * Adds two non-positive safe integers, returning `a + b` as a\n * `NonPositiveSafeInt`.\n *\n * @param a - The first non-positive safe integer\n * @param b - The second non-positive safe integer\n * @returns The sum of `a` and `b` as a `NonPositiveSafeInt`\n */\n add,\n\n /**\n * Subtracts two non-positive safe integers, returning `a - b` as a\n * `NonPositiveSafeInt`.\n *\n * @param a - The first non-positive safe integer\n * @param b - The second non-positive safe integer\n * @returns The difference of `a` and `b` as a `NonPositiveSafeInt`\n */\n sub,\n} as const;\n"],"names":[],"mappings":";;AAOA,MAAM,iBAAA,GAAoB,6BAAA;AAE1B,MAAM;AAAA,EACJ,SAAA;AAAA,EACA,SAAA;AAAA,EACA,GAAA;AAAA,EACA,QAAA;AAAA,EACA,UAAA;AAAA,EACA,EAAA;AAAA,EACA,GAAA,EAAK,IAAA;AAAA,EACL,GAAA,EAAK,IAAA;AAAA,EACL,GAAA;AAAA,EACA,MAAA;AAAA,EACA;AACF,CAAA,GAAI,oBAAA,CAAqB,mBAAmB,mBAAA,CAI1C;AAAA,EACA,oBAAA,EAAsB,aAAA;AAAA,EACtB,WAAW,MAAA,CAAO,gBAAA;AAAA,EAClB,SAAA,EAAW,CAAA;AAAA,EACX;AACF,CAAU,CAAA;AAWH,MAAM,oBAAA,GAAuB;AAY7B,MAAM,oBAAA,GAAuB;AAS7B,MAAM,kBAAA,GAAqB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQhC,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,SAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,SAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQA,GAAA,EAAK,IAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQL,GAAA,EAAK,IAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAcL,UAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAWA,MAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAUA,GAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAUA,GAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAUA;AACF;;;;"}
|
|
@@ -3,18 +3,24 @@ import { TsDataForgeInternals } from '../refined-number-utils.mjs';
|
|
|
3
3
|
export type NonZeroFiniteNumber = TtfImported_NonZeroFiniteNumber;
|
|
4
4
|
type ElementType = NonZeroFiniteNumber;
|
|
5
5
|
/**
|
|
6
|
-
*
|
|
6
|
+
* Type guard that checks if a value is a non-zero finite number.
|
|
7
7
|
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
8
|
+
* Returns `true` only for a finite value — never `NaN`, `Infinity`, or
|
|
9
|
+
* `-Infinity`.
|
|
10
|
+
*
|
|
11
|
+
* @param value - The value to check
|
|
12
|
+
* @returns `true` if the value is a non-zero finite number, `false` otherwise
|
|
10
13
|
*/
|
|
11
14
|
export declare const isNonZeroFiniteNumber: (a: number) => a is TtfImported_NonZeroFiniteNumber;
|
|
12
15
|
/**
|
|
13
|
-
* Casts a number to
|
|
16
|
+
* Casts a `number` to the `NonZeroFiniteNumber` branded type.
|
|
17
|
+
*
|
|
18
|
+
* Validates that the value is a non-zero finite number and returns it with the
|
|
19
|
+
* `NonZeroFiniteNumber` brand. Throws a `TypeError` otherwise.
|
|
14
20
|
*
|
|
15
|
-
* @param value The value to cast
|
|
16
|
-
* @returns The value as a NonZeroFiniteNumber
|
|
17
|
-
* @throws {TypeError} If the value is not a non-zero finite number
|
|
21
|
+
* @param value - The value to cast
|
|
22
|
+
* @returns The value as a `NonZeroFiniteNumber`
|
|
23
|
+
* @throws {TypeError} If the value is not a non-zero finite number
|
|
18
24
|
*/
|
|
19
25
|
export declare const asNonZeroFiniteNumber: <N extends number>(x: N) => number & {
|
|
20
26
|
readonly "!=0": true;
|
|
@@ -24,98 +30,105 @@ export declare const asNonZeroFiniteNumber: <N extends number>(x: N) => number &
|
|
|
24
30
|
'TSTypeForgeInternals--edd2f9ce-7ca5-45b0-9d1a-bd61b9b5d9c3': unknown;
|
|
25
31
|
}> & N;
|
|
26
32
|
/**
|
|
27
|
-
* Namespace providing type-safe
|
|
28
|
-
*
|
|
33
|
+
* Namespace providing type-safe operations for the `NonZeroFiniteNumber`
|
|
34
|
+
* branded type.
|
|
29
35
|
*
|
|
30
|
-
*
|
|
31
|
-
* finite (excluding NaN and Infinity). This type is useful for values that must
|
|
32
|
-
* never be zero, such as denominators, scaling factors, and ratios.
|
|
36
|
+
* The `NonZeroFiniteNumber` type represents a non-zero finite number.
|
|
33
37
|
*/
|
|
34
38
|
export declare const NonZeroFiniteNumber: {
|
|
35
39
|
/**
|
|
36
|
-
* Type guard
|
|
40
|
+
* Type guard that checks if a value is a non-zero finite number.
|
|
37
41
|
*
|
|
38
|
-
* @param value The value to check
|
|
39
|
-
* @returns `true` if the value is a non-zero finite number, `false`
|
|
40
|
-
*
|
|
42
|
+
* @param value - The value to check
|
|
43
|
+
* @returns `true` if the value is a non-zero finite number, `false` otherwise
|
|
44
|
+
* @see {@link isNonZeroFiniteNumber} for usage examples
|
|
41
45
|
*/
|
|
42
46
|
readonly is: (a: number) => a is TtfImported_NonZeroFiniteNumber;
|
|
43
47
|
/**
|
|
44
48
|
* Returns the absolute value of a non-zero finite number.
|
|
45
49
|
*
|
|
46
|
-
*
|
|
47
|
-
*
|
|
50
|
+
* The result is non-negative and keeps the `NonZeroFiniteNumber` brand.
|
|
51
|
+
*
|
|
52
|
+
* @param a - The non-zero finite number value
|
|
53
|
+
* @returns The absolute value as a non-negative `NonZeroFiniteNumber`
|
|
48
54
|
*/
|
|
49
55
|
readonly abs: (x: TtfImported_NonZeroFiniteNumber) => import("ts-type-forge").IntersectBrand<TtfImported_NonZeroFiniteNumber, import("ts-type-forge").PositiveNumber>;
|
|
50
56
|
/**
|
|
51
|
-
* Returns the
|
|
57
|
+
* Returns the smallest of the given non-zero finite numbers.
|
|
52
58
|
*
|
|
53
|
-
* @param
|
|
54
|
-
* @
|
|
55
|
-
* @returns The minimum value as a NonZeroFiniteNumber.
|
|
59
|
+
* @param values - The non-zero finite numbers to compare (at least one required)
|
|
60
|
+
* @returns The smallest value as a `NonZeroFiniteNumber`
|
|
56
61
|
*/
|
|
57
62
|
readonly min: (...values: readonly TtfImported_NonZeroFiniteNumber[]) => TtfImported_NonZeroFiniteNumber;
|
|
58
63
|
/**
|
|
59
|
-
* Returns the
|
|
64
|
+
* Returns the largest of the given non-zero finite numbers.
|
|
60
65
|
*
|
|
61
|
-
* @param
|
|
62
|
-
* @
|
|
63
|
-
* @returns The maximum value as a NonZeroFiniteNumber.
|
|
66
|
+
* @param values - The non-zero finite numbers to compare (at least one required)
|
|
67
|
+
* @returns The largest value as a `NonZeroFiniteNumber`
|
|
64
68
|
*/
|
|
65
69
|
readonly max: (...values: readonly TtfImported_NonZeroFiniteNumber[]) => TtfImported_NonZeroFiniteNumber;
|
|
66
70
|
/**
|
|
67
|
-
*
|
|
71
|
+
* Returns the greatest integer less than or equal to a non-zero finite
|
|
72
|
+
* number.
|
|
68
73
|
*
|
|
69
|
-
* @param
|
|
70
|
-
* @returns The
|
|
74
|
+
* @param a - The non-zero finite number value
|
|
75
|
+
* @returns The floored value as an integer
|
|
71
76
|
*/
|
|
72
77
|
readonly floor: (x: ElementType) => TsDataForgeInternals.RefinedNumberUtils.ToInt<ElementType>;
|
|
73
78
|
/**
|
|
74
|
-
*
|
|
79
|
+
* Returns the smallest integer greater than or equal to a non-zero finite
|
|
80
|
+
* number.
|
|
75
81
|
*
|
|
76
|
-
* @param
|
|
77
|
-
* @returns The
|
|
82
|
+
* @param a - The non-zero finite number value
|
|
83
|
+
* @returns The ceiled value as an integer
|
|
78
84
|
*/
|
|
79
85
|
readonly ceil: (x: ElementType) => TsDataForgeInternals.RefinedNumberUtils.ToInt<ElementType>;
|
|
80
86
|
/**
|
|
81
|
-
*
|
|
87
|
+
* Returns the value of a non-zero finite number rounded to the nearest
|
|
88
|
+
* integer.
|
|
82
89
|
*
|
|
83
|
-
* @param
|
|
84
|
-
* @returns The rounded value as
|
|
90
|
+
* @param a - The non-zero finite number value
|
|
91
|
+
* @returns The rounded value as an integer
|
|
85
92
|
*/
|
|
86
93
|
readonly round: (x: ElementType) => TsDataForgeInternals.RefinedNumberUtils.ToInt<ElementType>;
|
|
87
94
|
/**
|
|
88
|
-
* Generates a random NonZeroFiniteNumber
|
|
95
|
+
* Generates a random `NonZeroFiniteNumber` within the given range.
|
|
96
|
+
*
|
|
97
|
+
* The range is inclusive on both ends.
|
|
89
98
|
*
|
|
90
|
-
* @
|
|
99
|
+
* @param min - The minimum value (inclusive)
|
|
100
|
+
* @param max - The maximum value (inclusive)
|
|
101
|
+
* @returns A random `NonZeroFiniteNumber` in `[min, max]`
|
|
91
102
|
*/
|
|
92
103
|
readonly random: (min?: TtfImported_NonZeroFiniteNumber | undefined, max?: TtfImported_NonZeroFiniteNumber | undefined) => TtfImported_NonZeroFiniteNumber;
|
|
93
104
|
/**
|
|
94
|
-
* Raises a
|
|
105
|
+
* Raises `a` to the power `b`, returning `a ** b` as a `NonZeroFiniteNumber`.
|
|
95
106
|
*
|
|
96
|
-
* @param a The base
|
|
97
|
-
* @param b The exponent
|
|
98
|
-
* @returns `a ** b` as a NonZeroFiniteNumber
|
|
107
|
+
* @param a - The base non-zero finite number
|
|
108
|
+
* @param b - The exponent non-zero finite number
|
|
109
|
+
* @returns `a ** b` as a `NonZeroFiniteNumber`
|
|
99
110
|
*/
|
|
100
111
|
readonly pow: (x: TtfImported_NonZeroFiniteNumber, y: TtfImported_NonZeroFiniteNumber) => TtfImported_NonZeroFiniteNumber;
|
|
101
112
|
/**
|
|
102
|
-
* Multiplies two
|
|
113
|
+
* Multiplies two non-zero finite numbers, returning `a * b` as a
|
|
114
|
+
* `NonZeroFiniteNumber`.
|
|
103
115
|
*
|
|
104
|
-
* @param a The first
|
|
105
|
-
* @param b The second
|
|
106
|
-
* @returns `a
|
|
116
|
+
* @param a - The first non-zero finite number
|
|
117
|
+
* @param b - The second non-zero finite number
|
|
118
|
+
* @returns The product of `a` and `b` as a `NonZeroFiniteNumber`
|
|
107
119
|
*/
|
|
108
120
|
readonly mul: (x: TtfImported_NonZeroFiniteNumber, y: TtfImported_NonZeroFiniteNumber) => TtfImported_NonZeroFiniteNumber;
|
|
109
121
|
/**
|
|
110
|
-
* Divides
|
|
122
|
+
* Divides two non-zero finite numbers, returning `a / b` as a
|
|
123
|
+
* `NonZeroFiniteNumber`.
|
|
111
124
|
*
|
|
112
125
|
* Exact (non-flooring) division of two non-zero finite numbers is always
|
|
113
126
|
* non-zero, so this stays closed. For the non-closed operations (`add`/`sub`,
|
|
114
127
|
* whose result may be `0`) use {@link Num.add}/{@link Num.sub}.
|
|
115
128
|
*
|
|
116
|
-
* @param a The dividend
|
|
117
|
-
* @param b The divisor
|
|
118
|
-
* @returns `a / b` as a NonZeroFiniteNumber
|
|
129
|
+
* @param a - The dividend
|
|
130
|
+
* @param b - The divisor (must be non-zero)
|
|
131
|
+
* @returns `a / b` as a `NonZeroFiniteNumber`
|
|
119
132
|
*/
|
|
120
133
|
readonly div: (x: TtfImported_NonZeroFiniteNumber, y: number & {
|
|
121
134
|
readonly "!=0": true;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"non-zero-finite-number.d.mts","sourceRoot":"","sources":["../../../src/number/branded-types/non-zero-finite-number.mts"],"names":[],"mappings":"AAAA,OAAO,EAIL,KAAK,mBAAmB,IAAI,+BAA+B,EAC5D,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AAEnE,MAAM,MAAM,mBAAmB,GAAG,+BAA+B,CAAC;AAElE,KAAK,WAAW,GAAG,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"non-zero-finite-number.d.mts","sourceRoot":"","sources":["../../../src/number/branded-types/non-zero-finite-number.mts"],"names":[],"mappings":"AAAA,OAAO,EAIL,KAAK,mBAAmB,IAAI,+BAA+B,EAC5D,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AAEnE,MAAM,MAAM,mBAAmB,GAAG,+BAA+B,CAAC;AAElE,KAAK,WAAW,GAAG,mBAAmB,CAAC;AAuDvC;;;;;;;;GAQG;AACH,eAAO,MAAM,qBAAqB,qDAAK,CAAC;AAExC;;;;;;;;;GASG;AACH,eAAO,MAAM,qBAAqB;;;;;;MAAW,CAAC;AAE9C;;;;;GAKG;AACH,eAAO,MAAM,mBAAmB;IAC9B;;;;;;OAMG;;IAGH;;;;;;;OAOG;;IAGH;;;;;OAKG;;IAGH;;;;;OAKG;;IAGH;;;;;;OAMG;wBApGA,WAAW,KACb,oBAAoB,CAAC,kBAAkB,CAAC,KAAK,CAAC,WAAW,CAAC;IAsG3D;;;;;;OAMG;uBAvGA,WAAW,KACb,oBAAoB,CAAC,kBAAkB,CAAC,KAAK,CAAC,WAAW,CAAC;IAyG3D;;;;;;OAMG;wBA1GA,WAAW,KACb,oBAAoB,CAAC,kBAAkB,CAAC,KAAK,CAAC,WAAW,CAAC;IA4G3D;;;;;;;;OAQG;;IAGH;;;;;;OAMG;;IAGH;;;;;;;OAOG;;IAGH;;;;;;;;;;;OAWG;;;;;;;;CAEK,CAAC"}
|