curvy 1.0.8 → 2.0.0-alpha.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.
Files changed (139) hide show
  1. package/dist/characteristic/index.d.mts +88 -0
  2. package/dist/characteristic/index.mjs +2 -0
  3. package/dist/curve/index.d.mts +2 -0
  4. package/dist/curve/index.mjs +2 -0
  5. package/dist/interval/index.d.mts +2 -0
  6. package/dist/interval/index.mjs +2 -0
  7. package/dist/matrix/index.d.mts +2 -0
  8. package/dist/matrix/index.mjs +267 -0
  9. package/dist/matrix/index.mjs.map +1 -0
  10. package/dist/number.d.mts +280 -0
  11. package/dist/number.mjs +140 -0
  12. package/dist/number.mjs.map +1 -0
  13. package/dist/path/index.d.mts +241 -0
  14. package/dist/path/index.mjs +292 -0
  15. package/dist/path/index.mjs.map +1 -0
  16. package/dist/polynomial/index.d.mts +2 -0
  17. package/dist/polynomial/index.mjs +3 -0
  18. package/dist/shared/characteristic-BGRxcxUH.mjs +104 -0
  19. package/dist/shared/characteristic-BGRxcxUH.mjs.map +1 -0
  20. package/dist/shared/chunk-25Hzd3z8.mjs +13 -0
  21. package/dist/shared/cubic-CYYEUHNm.mjs +479 -0
  22. package/dist/shared/cubic-CYYEUHNm.mjs.map +1 -0
  23. package/dist/shared/cubic-Dfn6DB02.d.mts +1099 -0
  24. package/dist/shared/interval-CCEqzPgA.mjs +376 -0
  25. package/dist/shared/interval-CCEqzPgA.mjs.map +1 -0
  26. package/dist/shared/interval-hQDiKqj0.d.mts +494 -0
  27. package/dist/shared/matrix4x4-Bt_DBlP0.d.mts +1182 -0
  28. package/dist/shared/matrix4x4-Ck2WROK-.mjs +440 -0
  29. package/dist/shared/matrix4x4-Ck2WROK-.mjs.map +1 -0
  30. package/dist/shared/quadratic-DEhuAKuE.mjs +330 -0
  31. package/dist/shared/quadratic-DEhuAKuE.mjs.map +1 -0
  32. package/dist/shared/rationalCubic2d-BPLohNuI.d.mts +787 -0
  33. package/dist/shared/rationalCubic2d-CP4oGpnk.mjs +658 -0
  34. package/dist/shared/rationalCubic2d-CP4oGpnk.mjs.map +1 -0
  35. package/dist/shared/rationalCubic2d-CXa7Yren.mjs +278 -0
  36. package/dist/shared/rationalCubic2d-CXa7Yren.mjs.map +1 -0
  37. package/dist/shared/rationalCubic2d-D_-XWxcm.d.mts +297 -0
  38. package/dist/shared/solution-BjoW7ov4.d.mts +251 -0
  39. package/dist/shared/solution-CbSWzXCn.mjs +306 -0
  40. package/dist/shared/solution-CbSWzXCn.mjs.map +1 -0
  41. package/dist/{pipe.d.mts → shared/utils-DqTGyXrP.d.mts} +44 -26
  42. package/dist/shared/vector2-CL1HDdPr.mjs +187 -0
  43. package/dist/shared/vector2-CL1HDdPr.mjs.map +1 -0
  44. package/dist/shared/vector2-TV0UnlxY.d.mts +1168 -0
  45. package/dist/shared/vector2.internal-DU_E808S.mjs +97 -0
  46. package/dist/shared/vector2.internal-DU_E808S.mjs.map +1 -0
  47. package/dist/shared/vector3-D-tv_aKL.mjs +204 -0
  48. package/dist/shared/vector3-D-tv_aKL.mjs.map +1 -0
  49. package/dist/shared/vector4-5KbjoHVj.mjs +109 -0
  50. package/dist/shared/vector4-5KbjoHVj.mjs.map +1 -0
  51. package/dist/shared/vector4.internal-5XcaX12X.mjs +163 -0
  52. package/dist/shared/vector4.internal-5XcaX12X.mjs.map +1 -0
  53. package/dist/solution/index.d.mts +2 -0
  54. package/dist/solution/index.mjs +2 -0
  55. package/dist/splines/index.d.mts +701 -0
  56. package/dist/splines/index.mjs +734 -0
  57. package/dist/splines/index.mjs.map +1 -0
  58. package/dist/utils.d.mts +2 -27
  59. package/dist/utils.mjs +88 -43
  60. package/dist/utils.mjs.map +1 -0
  61. package/dist/vector/index.d.mts +2 -0
  62. package/dist/vector/index.mjs +4 -0
  63. package/package.json +49 -92
  64. package/dist/curve/cubic2d.d.mts +0 -31
  65. package/dist/curve/cubic2d.d.ts +0 -31
  66. package/dist/curve/cubic2d.mjs +0 -97
  67. package/dist/curve/linear2d.d.mts +0 -28
  68. package/dist/curve/linear2d.d.ts +0 -28
  69. package/dist/curve/linear2d.mjs +0 -49
  70. package/dist/curve/quadratic2d.d.mts +0 -33
  71. package/dist/curve/quadratic2d.d.ts +0 -33
  72. package/dist/curve/quadratic2d.mjs +0 -87
  73. package/dist/interval.d.mts +0 -58
  74. package/dist/interval.d.ts +0 -58
  75. package/dist/interval.mjs +0 -89
  76. package/dist/matrix/matrix2x2.d.mts +0 -49
  77. package/dist/matrix/matrix2x2.d.ts +0 -49
  78. package/dist/matrix/matrix2x2.mjs +0 -24
  79. package/dist/matrix/matrix3x3.d.mts +0 -63
  80. package/dist/matrix/matrix3x3.d.ts +0 -63
  81. package/dist/matrix/matrix3x3.mjs +0 -27
  82. package/dist/matrix/matrix4x4.d.mts +0 -72
  83. package/dist/matrix/matrix4x4.d.ts +0 -72
  84. package/dist/matrix/matrix4x4.mjs +0 -215
  85. package/dist/path/cubic2d.d.mts +0 -29
  86. package/dist/path/cubic2d.d.ts +0 -29
  87. package/dist/path/cubic2d.mjs +0 -62
  88. package/dist/path/linear2d.d.mts +0 -29
  89. package/dist/path/linear2d.d.ts +0 -29
  90. package/dist/path/linear2d.mjs +0 -55
  91. package/dist/path/quadratic2d.d.mts +0 -30
  92. package/dist/path/quadratic2d.d.ts +0 -30
  93. package/dist/path/quadratic2d.mjs +0 -61
  94. package/dist/pipe.d.ts +0 -58
  95. package/dist/pipe.mjs +0 -91
  96. package/dist/polynomial/cubic.d.mts +0 -7
  97. package/dist/polynomial/cubic.d.ts +0 -7
  98. package/dist/polynomial/cubic.mjs +0 -148
  99. package/dist/polynomial/linear.d.mts +0 -7
  100. package/dist/polynomial/linear.d.ts +0 -7
  101. package/dist/polynomial/linear.mjs +0 -23
  102. package/dist/polynomial/quadratic.d.mts +0 -7
  103. package/dist/polynomial/quadratic.d.ts +0 -7
  104. package/dist/polynomial/quadratic.mjs +0 -24
  105. package/dist/shared/curvy.BDhiZ7He.mjs +0 -80
  106. package/dist/shared/curvy.BZ_mTkJe.mjs +0 -60
  107. package/dist/shared/curvy.Bf5TIk31.d.mts +0 -22
  108. package/dist/shared/curvy.Bf5TIk31.d.ts +0 -22
  109. package/dist/shared/curvy.BsHoYJNv.d.ts +0 -155
  110. package/dist/shared/curvy.BzVmUIKm.mjs +0 -131
  111. package/dist/shared/curvy.C2XGH0R0.mjs +0 -75
  112. package/dist/shared/curvy.CE4X6_Is.mjs +0 -181
  113. package/dist/shared/curvy.Cps2R_RU.mjs +0 -120
  114. package/dist/shared/curvy.Cv-wIzDr.mjs +0 -124
  115. package/dist/shared/curvy.DmVFTi0N.mjs +0 -34
  116. package/dist/shared/curvy.NsmY7zcr.d.mts +0 -155
  117. package/dist/shared/curvy.wYJQhFW-.mjs +0 -87
  118. package/dist/splines/basis2d.d.mts +0 -38
  119. package/dist/splines/basis2d.d.ts +0 -38
  120. package/dist/splines/basis2d.mjs +0 -89
  121. package/dist/splines/bezier2d.d.mts +0 -48
  122. package/dist/splines/bezier2d.d.ts +0 -48
  123. package/dist/splines/bezier2d.mjs +0 -22
  124. package/dist/splines/cardinal2d.d.mts +0 -49
  125. package/dist/splines/cardinal2d.d.ts +0 -49
  126. package/dist/splines/cardinal2d.mjs +0 -123
  127. package/dist/splines/hermite2d.d.mts +0 -33
  128. package/dist/splines/hermite2d.d.ts +0 -33
  129. package/dist/splines/hermite2d.mjs +0 -77
  130. package/dist/utils.d.ts +0 -27
  131. package/dist/vector/vector2.d.mts +0 -66
  132. package/dist/vector/vector2.d.ts +0 -66
  133. package/dist/vector/vector2.mjs +0 -28
  134. package/dist/vector/vector3.d.mts +0 -77
  135. package/dist/vector/vector3.d.ts +0 -77
  136. package/dist/vector/vector3.mjs +0 -32
  137. package/dist/vector/vector4.d.mts +0 -43
  138. package/dist/vector/vector4.d.ts +0 -43
  139. package/dist/vector/vector4.mjs +0 -18
@@ -0,0 +1,280 @@
1
+ //#region src/number.d.ts
2
+ /**
3
+ * Default tolerance for approximate equality between floating-point numbers.
4
+ *
5
+ * @since 1.1.0
6
+ */
7
+ declare const EPSILON = 1e-10;
8
+ /**
9
+ * Approximate equality between two numbers, within an absolute tolerance.
10
+ *
11
+ * @param a - The first value.
12
+ * @param b - The second value.
13
+ * @param eps - The maximum allowed absolute difference. Defaults to {@link EPSILON}.
14
+ * @returns `true` when `|a - b| <= eps`.
15
+ * @since 1.1.0
16
+ */
17
+ declare function epsEquals(a: number, b: number, eps?: number): boolean;
18
+ /**
19
+ * Snaps near-zero values to exactly zero for stable sign tests.
20
+ *
21
+ * @param value - The value to test.
22
+ * @param eps - The threshold below which `value` is considered zero.
23
+ * @returns `0` when `|value| < eps`, otherwise `value` unchanged.
24
+ * @since 1.1.0
25
+ */
26
+ declare function clampToZero(value: number, eps: number): number;
27
+ /**
28
+ * Rounding function that rounds a number to a specified precision.
29
+ *
30
+ * @param value - The number to round.
31
+ * @param precision - The number of decimal places to round to (default is 8).
32
+ * @returns The rounded number.
33
+ * @example
34
+ * ```ts
35
+ * import { round } from 'curvy/utils'
36
+ *
37
+ * const roundedValue = round(1.23456789, 4) // 1.2346
38
+ * const roundedValue2 = round(1.23456789) // 1.23456789
39
+ * ```
40
+ * @since 1.0.0
41
+ */
42
+ declare function round(value: number, precision?: number): number;
43
+ /**
44
+ * Rounding function that rounds a number down to a specified precision.
45
+ *
46
+ * @param value - The number to round down.
47
+ * @param precision - The number of decimal places to round down to (default is 8).
48
+ * @returns The rounded down number.
49
+ * @example
50
+ * ```ts
51
+ * import { roundDown } from 'curvy/utils'
52
+ *
53
+ * const roundedDownValue = roundDown(1.23456789, 4) // 1.2345
54
+ * const roundedDownValue2 = roundDown(1.23456789) // 1.23456789
55
+ * ```
56
+ * @since 1.0.0
57
+ */
58
+ declare function roundDown(value: number, precision?: number): number;
59
+ /**
60
+ * Rounding function that rounds a number up to a specified precision.
61
+ *
62
+ * @param value - The number to round up.
63
+ * @param precision - The number of decimal places to round up to (default is 8).
64
+ * @returns The rounded up number.
65
+ * @example
66
+ * ```ts
67
+ * import { roundUp } from 'curvy/utils'
68
+ *
69
+ * const roundedUpValue = roundUp(1.23456789, 4) // 1.2346
70
+ * const roundedUpValue2 = roundUp(1.23456789) // 1.23456789
71
+ * ```
72
+ * @since 1.0.0
73
+ */
74
+ declare function roundUp(value: number, precision?: number): number;
75
+ declare const lerp: {
76
+ /**
77
+ * Linearly interpolates between two values.
78
+ *
79
+ * @param t - The interpolation factor (between 0 and 1).
80
+ * @param a - The start value.
81
+ * @param b - The end value.
82
+ * @returns The interpolated value.
83
+ * @example
84
+ * ```ts
85
+ * import { lerp } from 'curvy/utils'
86
+ *
87
+ * lerp(0.5, 10, 20) // 15
88
+ * ```
89
+ * @since 1.0.0
90
+ */
91
+ (t: number, a: number, b: number): number;
92
+ /**
93
+ * Linearly interpolates between two values.
94
+ *
95
+ * @param a - The start value.
96
+ * @param b - The end value.
97
+ * @returns A function that takes the interpolation factor and returns the interpolated value.
98
+ * @example
99
+ * ```ts
100
+ * import { lerp } from 'curvy/utils'
101
+ *
102
+ * lerp(10, 20)(0.5) // 15
103
+ * ```
104
+ * @since 1.0.0
105
+ */
106
+ (a: number, b: number): (t: number) => number;
107
+ };
108
+ declare const normalize: {
109
+ /**
110
+ * Normalizes a value between two bounds to the unit interval.
111
+ *
112
+ * @param x - The value to normalize.
113
+ * @param a - The lower bound.
114
+ * @param b - The upper bound.
115
+ * @returns The normalized value.
116
+ * @example
117
+ * ```ts
118
+ * import { normalize } from 'curvy/utils'
119
+ *
120
+ * normalize(15, 10, 20) // 0.5
121
+ * ```
122
+ * @since 1.0.0
123
+ */
124
+ (x: number, a: number, b: number): number;
125
+ /**
126
+ * Normalizes a value between two bounds to the unit interval.
127
+ *
128
+ * @param a - The lower bound.
129
+ * @param b - The upper bound.
130
+ * @returns A function that takes a value and returns the normalized value.
131
+ * @example
132
+ * ```ts
133
+ * import { normalize } from 'curvy/utils'
134
+ *
135
+ * normalize(10, 20)(15) // 0.5
136
+ * ```
137
+ * @since 1.0.0
138
+ */
139
+ (a: number, b: number): (x: number) => number;
140
+ };
141
+ declare const remap: {
142
+ /**
143
+ * Remaps a value from one range to another.
144
+ *
145
+ * @param x - The value to remap.
146
+ * @param x1 - The lower bound of the original range.
147
+ * @param x2 - The upper bound of the original range.
148
+ * @param y1 - The lower bound of the new range.
149
+ * @param y2 - The upper bound of the new range.
150
+ * @returns The remapped value.
151
+ * @example
152
+ * ```ts
153
+ * import { remap } from 'curvy/utils'
154
+ *
155
+ * remap(15, 10, 20, 0, 100) // 50
156
+ * ```
157
+ * @since 1.0.0
158
+ */
159
+ (x: number, x1: number, x2: number, y1: number, y2: number): number;
160
+ /**
161
+ * Remaps a value from one range to another.
162
+ *
163
+ * @param x1 - The lower bound of the original range.
164
+ * @param x2 - The upper bound of the original range.
165
+ * @param y1 - The lower bound of the new range.
166
+ * @param y2 - The upper bound of the new range.
167
+ * @returns A function that takes a value and returns the remapped value.
168
+ * @example
169
+ * ```ts
170
+ * import { remap } from 'curvy/utils'
171
+ *
172
+ * remap(10, 20, 0, 100)(15) // 50
173
+ * ```
174
+ * @since 1.0.0
175
+ */
176
+ (x1: number, x2: number, y1: number, y2: number): (x: number) => number;
177
+ };
178
+ declare const clamp: {
179
+ /**
180
+ * Clamps a value between two bounds.
181
+ *
182
+ * @param value - The value to clamp.
183
+ * @param min - The lower bound.
184
+ * @param max - The upper bound.
185
+ * @returns The clamped value.
186
+ * @example
187
+ * ```ts
188
+ * import { clamp } from 'curvy/utils'
189
+ *
190
+ * clamp(25, 10, 20) // 20
191
+ * ```
192
+ * @since 1.0.0
193
+ */
194
+ (value: number, min: number, max: number): number;
195
+ /**
196
+ * Clamps a value between two bounds.
197
+ *
198
+ * @param min - The lower bound.
199
+ * @param max - The upper bound.
200
+ * @returns A function that takes a value and returns the clamped value.
201
+ * @example
202
+ * ```ts
203
+ * import { clamp } from 'curvy/utils'
204
+ *
205
+ * clamp(10, 20)(25) // 20
206
+ * ```
207
+ * @since 1.0.0
208
+ */
209
+ (min: number, max: number): (value: number) => number;
210
+ };
211
+ declare const clip: {
212
+ /**
213
+ * Clips a value to a specified range, returning a fallback value if the value is outside the range.
214
+ *
215
+ * @param value - The value to clip.
216
+ * @param min - The lower bound.
217
+ * @param max - The upper bound.
218
+ * @param onClip - The fallback value to return if the value is outside the range.
219
+ * @returns The original value if within range, otherwise the fallback.
220
+ * @example
221
+ * ```ts
222
+ * import { clip } from 'curvy/utils'
223
+ *
224
+ * clip(25, 10, 20, 15) // 15
225
+ * ```
226
+ * @since 1.0.0
227
+ */
228
+ <T>(value: number, min: number, max: number, onClip: T): T | number;
229
+ /**
230
+ * Clips a value to a specified range, returning a fallback value if the value is outside the range.
231
+ *
232
+ * @param min - The lower bound.
233
+ * @param max - The upper bound.
234
+ * @param onClip - The fallback value to return if the value is outside the range.
235
+ * @returns A function that takes a value and returns it if within range, otherwise the fallback.
236
+ * @example
237
+ * ```ts
238
+ * import { clip } from 'curvy/utils'
239
+ *
240
+ * clip(10, 20, 15)(25) // 15
241
+ * ```
242
+ * @since 1.0.0
243
+ */
244
+ <T>(min: number, max: number, onClip: T): (value: number) => T | number;
245
+ };
246
+ /**
247
+ * Returns the minimum and maximum of two numbers.
248
+ *
249
+ * @param a - The first number.
250
+ * @param b - The second number.
251
+ * @returns A tuple containing the minimum and maximum values.
252
+ * @example
253
+ * ```ts
254
+ * import { minMax } from 'curvy/utils'
255
+ *
256
+ * const [minValue, maxValue] = minMax(10, 20) // [10, 20]
257
+ * const [minValue2, maxValue2] = minMax(20, 10) // [10, 20]
258
+ * ```
259
+ * @since 1.0.0
260
+ */
261
+ declare function minMax(a: number, b: number): [number, number];
262
+ /**
263
+ * Calculates the modulus of a number.
264
+ *
265
+ * @param n - The number to calculate the modulus of.
266
+ * @param m - The modulus.
267
+ * @returns The modulus of the number.
268
+ * @example
269
+ * ```ts
270
+ * import { mod } from 'curvy/utils'
271
+ *
272
+ * const modulus = mod(10, 3) // 1
273
+ * const modulus2 = mod(-10, 3) // 2
274
+ * ```
275
+ * @since 1.0.0
276
+ */
277
+ declare function mod(n: number, m: number): number;
278
+ //#endregion
279
+ export { EPSILON, clamp, clampToZero, clip, epsEquals, lerp, minMax, mod, normalize, remap, round, roundDown, roundUp };
280
+ //# sourceMappingURL=number.d.mts.map
@@ -0,0 +1,140 @@
1
+ import { dual } from "./utils.mjs";
2
+ //#region src/number.ts
3
+ const PRECISION = 8;
4
+ /**
5
+ * Default tolerance for approximate equality between floating-point numbers.
6
+ *
7
+ * @since 1.1.0
8
+ */
9
+ const EPSILON = 1e-10;
10
+ /**
11
+ * Approximate equality between two numbers, within an absolute tolerance.
12
+ *
13
+ * @param a - The first value.
14
+ * @param b - The second value.
15
+ * @param eps - The maximum allowed absolute difference. Defaults to {@link EPSILON}.
16
+ * @returns `true` when `|a - b| <= eps`.
17
+ * @since 1.1.0
18
+ */
19
+ function epsEquals(a, b, eps = EPSILON) {
20
+ return Math.abs(a - b) <= eps;
21
+ }
22
+ /**
23
+ * Snaps near-zero values to exactly zero for stable sign tests.
24
+ *
25
+ * @param value - The value to test.
26
+ * @param eps - The threshold below which `value` is considered zero.
27
+ * @returns `0` when `|value| < eps`, otherwise `value` unchanged.
28
+ * @since 1.1.0
29
+ */
30
+ function clampToZero(value, eps) {
31
+ return Math.abs(value) < eps ? 0 : value;
32
+ }
33
+ /**
34
+ * Rounding function that rounds a number to a specified precision.
35
+ *
36
+ * @param value - The number to round.
37
+ * @param precision - The number of decimal places to round to (default is 8).
38
+ * @returns The rounded number.
39
+ * @example
40
+ * ```ts
41
+ * import { round } from 'curvy/utils'
42
+ *
43
+ * const roundedValue = round(1.23456789, 4) // 1.2346
44
+ * const roundedValue2 = round(1.23456789) // 1.23456789
45
+ * ```
46
+ * @since 1.0.0
47
+ */
48
+ function round(value, precision = PRECISION) {
49
+ const scale = 10 ** precision;
50
+ const result = Math.round(value * scale) / scale;
51
+ if (result === 0) return 0;
52
+ return result;
53
+ }
54
+ /**
55
+ * Rounding function that rounds a number down to a specified precision.
56
+ *
57
+ * @param value - The number to round down.
58
+ * @param precision - The number of decimal places to round down to (default is 8).
59
+ * @returns The rounded down number.
60
+ * @example
61
+ * ```ts
62
+ * import { roundDown } from 'curvy/utils'
63
+ *
64
+ * const roundedDownValue = roundDown(1.23456789, 4) // 1.2345
65
+ * const roundedDownValue2 = roundDown(1.23456789) // 1.23456789
66
+ * ```
67
+ * @since 1.0.0
68
+ */
69
+ function roundDown(value, precision = PRECISION) {
70
+ const scale = 10 ** precision;
71
+ const result = Math.floor(value * scale) / scale;
72
+ if (result === 0) return 0;
73
+ return result;
74
+ }
75
+ /**
76
+ * Rounding function that rounds a number up to a specified precision.
77
+ *
78
+ * @param value - The number to round up.
79
+ * @param precision - The number of decimal places to round up to (default is 8).
80
+ * @returns The rounded up number.
81
+ * @example
82
+ * ```ts
83
+ * import { roundUp } from 'curvy/utils'
84
+ *
85
+ * const roundedUpValue = roundUp(1.23456789, 4) // 1.2346
86
+ * const roundedUpValue2 = roundUp(1.23456789) // 1.23456789
87
+ * ```
88
+ * @since 1.0.0
89
+ */
90
+ function roundUp(value, precision = PRECISION) {
91
+ const scale = 10 ** precision;
92
+ const result = Math.ceil(value * scale) / scale;
93
+ if (result === 0) return 0;
94
+ return result;
95
+ }
96
+ const lerp = dual(3, (t, a, b) => b * t + a * (1 - t));
97
+ const normalize = dual(3, (x, a, b) => (x - a) / (b - a));
98
+ const remap = dual(5, (x, x1, x2, y1, y2) => y1 + (x - x1) / (x2 - x1) * (y2 - y1));
99
+ const clamp = dual(3, (value, min, max) => value < min ? min : value > max ? max : value);
100
+ const clip = dual(4, (value, min, max, onClip) => value < min ? onClip : value > max ? onClip : value);
101
+ /**
102
+ * Returns the minimum and maximum of two numbers.
103
+ *
104
+ * @param a - The first number.
105
+ * @param b - The second number.
106
+ * @returns A tuple containing the minimum and maximum values.
107
+ * @example
108
+ * ```ts
109
+ * import { minMax } from 'curvy/utils'
110
+ *
111
+ * const [minValue, maxValue] = minMax(10, 20) // [10, 20]
112
+ * const [minValue2, maxValue2] = minMax(20, 10) // [10, 20]
113
+ * ```
114
+ * @since 1.0.0
115
+ */
116
+ function minMax(a, b) {
117
+ return a < b ? [a, b] : [b, a];
118
+ }
119
+ /**
120
+ * Calculates the modulus of a number.
121
+ *
122
+ * @param n - The number to calculate the modulus of.
123
+ * @param m - The modulus.
124
+ * @returns The modulus of the number.
125
+ * @example
126
+ * ```ts
127
+ * import { mod } from 'curvy/utils'
128
+ *
129
+ * const modulus = mod(10, 3) // 1
130
+ * const modulus2 = mod(-10, 3) // 2
131
+ * ```
132
+ * @since 1.0.0
133
+ */
134
+ function mod(n, m) {
135
+ return (n % m + m) % m;
136
+ }
137
+ //#endregion
138
+ export { EPSILON, clamp, clampToZero, clip, epsEquals, lerp, minMax, mod, normalize, remap, round, roundDown, roundUp };
139
+
140
+ //# sourceMappingURL=number.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"number.mjs","names":[],"sources":["../src/number.ts"],"sourcesContent":["import { dual } from './utils'\n\nconst PRECISION = 8\n\n/**\n * Default tolerance for approximate equality between floating-point numbers.\n *\n * @since 1.1.0\n */\nexport const EPSILON = 1e-10\n\n/**\n * Approximate equality between two numbers, within an absolute tolerance.\n *\n * @param a - The first value.\n * @param b - The second value.\n * @param eps - The maximum allowed absolute difference. Defaults to {@link EPSILON}.\n * @returns `true` when `|a - b| <= eps`.\n * @since 1.1.0\n */\nexport function epsEquals(a: number, b: number, eps: number = EPSILON): boolean {\n return Math.abs(a - b) <= eps\n}\n\n/**\n * Snaps near-zero values to exactly zero for stable sign tests.\n *\n * @param value - The value to test.\n * @param eps - The threshold below which `value` is considered zero.\n * @returns `0` when `|value| < eps`, otherwise `value` unchanged.\n * @since 1.1.0\n */\nexport function clampToZero(value: number, eps: number): number {\n return Math.abs(value) < eps ? 0 : value\n}\n\n/**\n * Rounding function that rounds a number to a specified precision.\n *\n * @param value - The number to round.\n * @param precision - The number of decimal places to round to (default is 8).\n * @returns The rounded number.\n * @example\n * ```ts\n * import { round } from 'curvy/utils'\n *\n * const roundedValue = round(1.23456789, 4) // 1.2346\n * const roundedValue2 = round(1.23456789) // 1.23456789\n * ```\n * @since 1.0.0\n */\nexport function round(value: number, precision = PRECISION): number {\n const scale = 10 ** precision\n const result = Math.round(value * scale) / scale\n if (result === 0) {\n return 0\n }\n return result\n}\n\n/**\n * Rounding function that rounds a number down to a specified precision.\n *\n * @param value - The number to round down.\n * @param precision - The number of decimal places to round down to (default is 8).\n * @returns The rounded down number.\n * @example\n * ```ts\n * import { roundDown } from 'curvy/utils'\n *\n * const roundedDownValue = roundDown(1.23456789, 4) // 1.2345\n * const roundedDownValue2 = roundDown(1.23456789) // 1.23456789\n * ```\n * @since 1.0.0\n */\nexport function roundDown(value: number, precision = PRECISION): number {\n const scale = 10 ** precision\n const result = Math.floor(value * scale) / scale\n if (result === 0) {\n return 0\n }\n return result\n}\n\n/**\n * Rounding function that rounds a number up to a specified precision.\n *\n * @param value - The number to round up.\n * @param precision - The number of decimal places to round up to (default is 8).\n * @returns The rounded up number.\n * @example\n * ```ts\n * import { roundUp } from 'curvy/utils'\n *\n * const roundedUpValue = roundUp(1.23456789, 4) // 1.2346\n * const roundedUpValue2 = roundUp(1.23456789) // 1.23456789\n * ```\n * @since 1.0.0\n */\nexport function roundUp(value: number, precision = PRECISION): number {\n const scale = 10 ** precision\n const result = Math.ceil(value * scale) / scale\n if (result === 0) {\n return 0\n }\n return result\n}\n\nexport const lerp: {\n /**\n * Linearly interpolates between two values.\n *\n * @param t - The interpolation factor (between 0 and 1).\n * @param a - The start value.\n * @param b - The end value.\n * @returns The interpolated value.\n * @example\n * ```ts\n * import { lerp } from 'curvy/utils'\n *\n * lerp(0.5, 10, 20) // 15\n * ```\n * @since 1.0.0\n */\n (t: number, a: number, b: number): number\n /**\n * Linearly interpolates between two values.\n *\n * @param a - The start value.\n * @param b - The end value.\n * @returns A function that takes the interpolation factor and returns the interpolated value.\n * @example\n * ```ts\n * import { lerp } from 'curvy/utils'\n *\n * lerp(10, 20)(0.5) // 15\n * ```\n * @since 1.0.0\n */\n (a: number, b: number): (t: number) => number\n} = dual(3, (t: number, a: number, b: number) => b * t + a * (1 - t))\n\nexport const normalize: {\n /**\n * Normalizes a value between two bounds to the unit interval.\n *\n * @param x - The value to normalize.\n * @param a - The lower bound.\n * @param b - The upper bound.\n * @returns The normalized value.\n * @example\n * ```ts\n * import { normalize } from 'curvy/utils'\n *\n * normalize(15, 10, 20) // 0.5\n * ```\n * @since 1.0.0\n */\n (x: number, a: number, b: number): number\n /**\n * Normalizes a value between two bounds to the unit interval.\n *\n * @param a - The lower bound.\n * @param b - The upper bound.\n * @returns A function that takes a value and returns the normalized value.\n * @example\n * ```ts\n * import { normalize } from 'curvy/utils'\n *\n * normalize(10, 20)(15) // 0.5\n * ```\n * @since 1.0.0\n */\n (a: number, b: number): (x: number) => number\n} = dual(3, (x: number, a: number, b: number) => (x - a) / (b - a))\n\nexport const remap: {\n /**\n * Remaps a value from one range to another.\n *\n * @param x - The value to remap.\n * @param x1 - The lower bound of the original range.\n * @param x2 - The upper bound of the original range.\n * @param y1 - The lower bound of the new range.\n * @param y2 - The upper bound of the new range.\n * @returns The remapped value.\n * @example\n * ```ts\n * import { remap } from 'curvy/utils'\n *\n * remap(15, 10, 20, 0, 100) // 50\n * ```\n * @since 1.0.0\n */\n (x: number, x1: number, x2: number, y1: number, y2: number): number\n /**\n * Remaps a value from one range to another.\n *\n * @param x1 - The lower bound of the original range.\n * @param x2 - The upper bound of the original range.\n * @param y1 - The lower bound of the new range.\n * @param y2 - The upper bound of the new range.\n * @returns A function that takes a value and returns the remapped value.\n * @example\n * ```ts\n * import { remap } from 'curvy/utils'\n *\n * remap(10, 20, 0, 100)(15) // 50\n * ```\n * @since 1.0.0\n */\n (x1: number, x2: number, y1: number, y2: number): (x: number) => number\n} = dual(\n 5,\n (x: number, x1: number, x2: number, y1: number, y2: number) =>\n y1 + ((x - x1) / (x2 - x1)) * (y2 - y1),\n)\n\nexport const clamp: {\n /**\n * Clamps a value between two bounds.\n *\n * @param value - The value to clamp.\n * @param min - The lower bound.\n * @param max - The upper bound.\n * @returns The clamped value.\n * @example\n * ```ts\n * import { clamp } from 'curvy/utils'\n *\n * clamp(25, 10, 20) // 20\n * ```\n * @since 1.0.0\n */\n (value: number, min: number, max: number): number\n /**\n * Clamps a value between two bounds.\n *\n * @param min - The lower bound.\n * @param max - The upper bound.\n * @returns A function that takes a value and returns the clamped value.\n * @example\n * ```ts\n * import { clamp } from 'curvy/utils'\n *\n * clamp(10, 20)(25) // 20\n * ```\n * @since 1.0.0\n */\n (min: number, max: number): (value: number) => number\n} = dual(3, (value: number, min: number, max: number) =>\n value < min ? min : value > max ? max : value,\n)\n\nexport const clip: {\n /**\n * Clips a value to a specified range, returning a fallback value if the value is outside the range.\n *\n * @param value - The value to clip.\n * @param min - The lower bound.\n * @param max - The upper bound.\n * @param onClip - The fallback value to return if the value is outside the range.\n * @returns The original value if within range, otherwise the fallback.\n * @example\n * ```ts\n * import { clip } from 'curvy/utils'\n *\n * clip(25, 10, 20, 15) // 15\n * ```\n * @since 1.0.0\n */\n <T>(value: number, min: number, max: number, onClip: T): T | number\n /**\n * Clips a value to a specified range, returning a fallback value if the value is outside the range.\n *\n * @param min - The lower bound.\n * @param max - The upper bound.\n * @param onClip - The fallback value to return if the value is outside the range.\n * @returns A function that takes a value and returns it if within range, otherwise the fallback.\n * @example\n * ```ts\n * import { clip } from 'curvy/utils'\n *\n * clip(10, 20, 15)(25) // 15\n * ```\n * @since 1.0.0\n */\n <T>(min: number, max: number, onClip: T): (value: number) => T | number\n} = dual(4, (value: number, min: number, max: number, onClip: unknown) =>\n value < min ? onClip : value > max ? onClip : value,\n)\n\n/**\n * Returns the minimum and maximum of two numbers.\n *\n * @param a - The first number.\n * @param b - The second number.\n * @returns A tuple containing the minimum and maximum values.\n * @example\n * ```ts\n * import { minMax } from 'curvy/utils'\n *\n * const [minValue, maxValue] = minMax(10, 20) // [10, 20]\n * const [minValue2, maxValue2] = minMax(20, 10) // [10, 20]\n * ```\n * @since 1.0.0\n */\nexport function minMax(a: number, b: number): [number, number] {\n return a < b ? [a, b] : [b, a]\n}\n\n/**\n * Calculates the modulus of a number.\n *\n * @param n - The number to calculate the modulus of.\n * @param m - The modulus.\n * @returns The modulus of the number.\n * @example\n * ```ts\n * import { mod } from 'curvy/utils'\n *\n * const modulus = mod(10, 3) // 1\n * const modulus2 = mod(-10, 3) // 2\n * ```\n * @since 1.0.0\n */\nexport function mod(n: number, m: number): number {\n return ((n % m) + m) % m\n}\n\n"],"mappings":";;AAEA,MAAM,YAAY;;;;;;AAOlB,MAAa,UAAU;;;;;;;;;;AAWvB,SAAgB,UAAU,GAAW,GAAW,MAAc,SAAkB;CAC9E,OAAO,KAAK,IAAI,IAAI,EAAE,IAAI;;;;;;;;;;AAW5B,SAAgB,YAAY,OAAe,KAAqB;CAC9D,OAAO,KAAK,IAAI,MAAM,GAAG,MAAM,IAAI;;;;;;;;;;;;;;;;;AAkBrC,SAAgB,MAAM,OAAe,YAAY,WAAmB;CAClE,MAAM,QAAQ,MAAM;CACpB,MAAM,SAAS,KAAK,MAAM,QAAQ,MAAM,GAAG;CAC3C,IAAI,WAAW,GACb,OAAO;CAET,OAAO;;;;;;;;;;;;;;;;;AAkBT,SAAgB,UAAU,OAAe,YAAY,WAAmB;CACtE,MAAM,QAAQ,MAAM;CACpB,MAAM,SAAS,KAAK,MAAM,QAAQ,MAAM,GAAG;CAC3C,IAAI,WAAW,GACb,OAAO;CAET,OAAO;;;;;;;;;;;;;;;;;AAkBT,SAAgB,QAAQ,OAAe,YAAY,WAAmB;CACpE,MAAM,QAAQ,MAAM;CACpB,MAAM,SAAS,KAAK,KAAK,QAAQ,MAAM,GAAG;CAC1C,IAAI,WAAW,GACb,OAAO;CAET,OAAO;;AAGT,MAAa,OAgCT,KAAK,IAAI,GAAW,GAAW,MAAc,IAAI,IAAI,KAAK,IAAI,GAAG;AAErE,MAAa,YAgCT,KAAK,IAAI,GAAW,GAAW,OAAe,IAAI,MAAM,IAAI,GAAG;AAEnE,MAAa,QAoCT,KACF,IACC,GAAW,IAAY,IAAY,IAAY,OAC9C,MAAO,IAAI,OAAO,KAAK,OAAQ,KAAK,IACvC;AAED,MAAa,QAgCT,KAAK,IAAI,OAAe,KAAa,QACvC,QAAQ,MAAM,MAAM,QAAQ,MAAM,MAAM,MACzC;AAED,MAAa,OAkCT,KAAK,IAAI,OAAe,KAAa,KAAa,WACpD,QAAQ,MAAM,SAAS,QAAQ,MAAM,SAAS,MAC/C;;;;;;;;;;;;;;;;AAiBD,SAAgB,OAAO,GAAW,GAA6B;CAC7D,OAAO,IAAI,IAAI,CAAC,GAAG,EAAE,GAAG,CAAC,GAAG,EAAE;;;;;;;;;;;;;;;;;AAkBhC,SAAgB,IAAI,GAAW,GAAmB;CAChD,QAAS,IAAI,IAAK,KAAK"}
@@ -0,0 +1,241 @@
1
+ import { t as Vector2 } from "../shared/vector2-TV0UnlxY.mjs";
2
+ import { t as Pipeable } from "../shared/utils-DqTGyXrP.mjs";
3
+ import { a as QuadraticCurve2d, s as LinearCurve2d } from "../shared/rationalCubic2d-BPLohNuI.mjs";
4
+ import { a as Continuous, i as cubic2d_d_exports, n as rationalCubic2d_d_exports, o as PathTraits } from "../shared/rationalCubic2d-D_-XWxcm.mjs";
5
+
6
+ //#region src/path/linear2d.internal.d.ts
7
+ declare const LinearPath2dTypeId: unique symbol;
8
+ type LinearPath2dTypeId = typeof LinearPath2dTypeId;
9
+ declare namespace linear2d_d_exports {
10
+ export { Continuous, LinearPath2d, append$1 as append, asContinuous$1 as asContinuous, fromArray$1 as fromArray, isContinuous$1 as isContinuous, isLinearPath2d, length$1 as length, make$1 as make, solve$1 as solve, toPathData$1 as toPathData };
11
+ }
12
+ /**
13
+ * A linear path in 2D space.
14
+ *
15
+ * All fields are readonly and immutable, and all operations create new instances.
16
+ *
17
+ * The `Trait` type parameter accumulates trait brands as the path is refined
18
+ * via `isContinuous` / `asContinuous`. A `Continuous` path's `toPathData`
19
+ * skips the per-segment discontinuity check.
20
+ *
21
+ * @since 1.0.0
22
+ */
23
+ interface LinearPath2d<out Trait = unknown> extends Pipeable, Iterable<LinearCurve2d> {
24
+ readonly [LinearPath2dTypeId]: LinearPath2dTypeId;
25
+ readonly [PathTraits]: Trait;
26
+ }
27
+ /**
28
+ * Creates a new `LinearPath2d` instance from a sequence of curves.
29
+ *
30
+ * @param curves - The curves to create the path from.
31
+ * @returns A new `LinearPath2d` instance.
32
+ * @since 2.0.0
33
+ */
34
+ declare const make$1: (...curves: ReadonlyArray<LinearCurve2d>) => LinearPath2d;
35
+ /**
36
+ * Creates a new `LinearPath2d` instance from an array of curves.
37
+ *
38
+ * @param curves - The curves to create the path from.
39
+ * @returns A new `LinearPath2d` instance.
40
+ * @since 2.0.0
41
+ */
42
+ declare const fromArray$1: (curves: ReadonlyArray<LinearCurve2d>) => LinearPath2d;
43
+ /**
44
+ * Checks if a value is a `LinearPath2d`.
45
+ *
46
+ * @param p - The value to check.
47
+ * @returns `true` if the value is a `LinearPath2d`, `false` otherwise.
48
+ * @since 1.0.0
49
+ */
50
+ declare const isLinearPath2d: (p: unknown) => p is LinearPath2d;
51
+ declare const append$1: {
52
+ /**
53
+ * Appends a linear curve to a linear path.
54
+ *
55
+ * @param c - The linear curve to append.
56
+ * @returns A function that takes a linear path and returns a new linear path.
57
+ * @since 1.0.0
58
+ */
59
+ (c: LinearCurve2d): (p: LinearPath2d) => LinearPath2d;
60
+ /**
61
+ * Appends a linear curve to a linear path.
62
+ *
63
+ * @param p - The linear path to append to.
64
+ * @param c - The linear curve to append.
65
+ * @returns A new `LinearPath2d` instance with the appended curve.
66
+ * @since 1.0.0
67
+ */
68
+ (p: LinearPath2d, c: LinearCurve2d): LinearPath2d;
69
+ };
70
+ /**
71
+ * Calculates the length of a linear path.
72
+ *
73
+ * @param p - The linear path to calculate the length of.
74
+ * @returns The length of the linear path.
75
+ * @since 1.0.0
76
+ */
77
+ declare const length$1: (p: LinearPath2d) => number;
78
+ declare const solve$1: {
79
+ /**
80
+ * Solves a linear path for a given parameter.
81
+ *
82
+ * @param u - The parameter to solve for.
83
+ * @returns A function that takes a linear path and returns the solved point.
84
+ * @since 1.0.0
85
+ */
86
+ (u: number): (p: LinearPath2d) => Vector2;
87
+ /**
88
+ * Solves a linear path for a given parameter.
89
+ *
90
+ * @param p - The linear path to solve.
91
+ * @param u - The parameter to solve for.
92
+ * @returns The solved point on the linear path.
93
+ * @since 1.0.0
94
+ */
95
+ (p: LinearPath2d, u: number): Vector2;
96
+ };
97
+ /**
98
+ * Serializes a linear path as an SVG path data string (the value of a `<path>`
99
+ * element's `d` attribute), using `M` and `L` commands. Discontinuities between
100
+ * curves emit a fresh `M` command.
101
+ *
102
+ * @param p - The linear path to serialize.
103
+ * @returns The SVG path data string.
104
+ * @since 2.0.0
105
+ */
106
+ declare const toPathData$1: (p: LinearPath2d) => string;
107
+ /**
108
+ * Type-narrowing predicate: refines `LinearPath2d<T>` to
109
+ * `LinearPath2d<T & Continuous>` when adjacent curves connect at their join
110
+ * points.
111
+ *
112
+ * @param p - The linear path to check.
113
+ * @returns `true` when the path is continuous (G⁰).
114
+ * @since 2.0.0
115
+ */
116
+ declare const isContinuous$1: <T>(p: LinearPath2d<T>) => p is LinearPath2d<T & Continuous>;
117
+ /**
118
+ * Asserts that the linear path is continuous, throwing on failure.
119
+ *
120
+ * @param p - The linear path to assert against.
121
+ * @returns The same path, typed with the `Continuous` brand.
122
+ * @throws When the path has a discontinuity between adjacent curves.
123
+ * @since 2.0.0
124
+ */
125
+ declare const asContinuous$1: <T>(p: LinearPath2d<T>) => LinearPath2d<T & Continuous>;
126
+ //#endregion
127
+ //#region src/path/quadratic2d.internal.d.ts
128
+ declare const QuadraticPath2dTypeId: unique symbol;
129
+ type QuadraticPath2dTypeId = typeof QuadraticPath2dTypeId;
130
+ declare namespace quadratic2d_d_exports {
131
+ export { Continuous, QuadraticPath2d, append, asContinuous, fromArray, isContinuous, isQuadraticPath2d, length, make, solve, toPathData };
132
+ }
133
+ /**
134
+ * A quadratic path in 2D space.
135
+ *
136
+ * All fields are readonly and immutable, and all operations create new instances.
137
+ *
138
+ * The `Trait` type parameter accumulates trait brands as the path is refined
139
+ * via `isContinuous` / `asContinuous`.
140
+ *
141
+ * @since 1.0.0
142
+ */
143
+ interface QuadraticPath2d<out Trait = unknown> extends Pipeable, Iterable<QuadraticCurve2d> {
144
+ readonly [QuadraticPath2dTypeId]: QuadraticPath2dTypeId;
145
+ readonly [PathTraits]: Trait;
146
+ }
147
+ /**
148
+ * Creates a new `QuadraticPath2d` instance from a sequence of curves.
149
+ *
150
+ * @param curves - The curves to create the path from.
151
+ * @returns A new `QuadraticPath2d` instance.
152
+ * @since 2.0.0
153
+ */
154
+ declare const make: (...curves: ReadonlyArray<QuadraticCurve2d>) => QuadraticPath2d;
155
+ /**
156
+ * Creates a new `QuadraticPath2d` instance from an array of curves.
157
+ *
158
+ * @param curves - The curves to create the path from.
159
+ * @returns A new `QuadraticPath2d` instance.
160
+ * @since 2.0.0
161
+ */
162
+ declare const fromArray: (curves: ReadonlyArray<QuadraticCurve2d>) => QuadraticPath2d;
163
+ /**
164
+ * Checks if a value is a `QuadraticPath2d`.
165
+ *
166
+ * @param p - The value to check.
167
+ * @returns `true` if the value is a `QuadraticPath2d`, `false` otherwise.
168
+ * @since 1.0.0
169
+ */
170
+ declare const isQuadraticPath2d: (p: unknown) => p is QuadraticPath2d;
171
+ declare const append: {
172
+ /**
173
+ * Appends a quadratic curve to a quadratic path.
174
+ *
175
+ * @param c - The quadratic curve to append.
176
+ * @returns A function that takes a quadratic path and returns a new quadratic path.
177
+ * @since 1.0.0
178
+ */
179
+ (c: QuadraticCurve2d): (p: QuadraticPath2d) => QuadraticPath2d;
180
+ /**
181
+ * Appends a quadratic curve to a quadratic path.
182
+ *
183
+ * @param p - The quadratic path to append to.
184
+ * @param c - The quadratic curve to append.
185
+ * @returns A new `QuadraticPath2d` instance with the appended curve.
186
+ * @since 1.0.0
187
+ */
188
+ (p: QuadraticPath2d, c: QuadraticCurve2d): QuadraticPath2d;
189
+ };
190
+ /**
191
+ * Calculates the length of a quadratic path.
192
+ *
193
+ * @param p - The quadratic path to calculate the length of.
194
+ * @returns The length of the path.
195
+ */
196
+ declare const length: (p: QuadraticPath2d) => number;
197
+ declare const solve: {
198
+ /**
199
+ * Solves a quadratic path at a given parameter.
200
+ *
201
+ * @param u - The parameter to solve for.
202
+ * @returns A function that takes a quadratic path and returns the solved point.
203
+ * @since 1.0.0
204
+ */
205
+ (u: number): (p: QuadraticPath2d) => Vector2;
206
+ /**
207
+ * Solves a quadratic path at a given parameter.
208
+ *
209
+ * @param p - The quadratic path to solve.
210
+ * @param u - The parameter to solve for.
211
+ * @returns The solved point.
212
+ * @since 1.0.0
213
+ */
214
+ (p: QuadraticPath2d, u: number): Vector2;
215
+ };
216
+ /**
217
+ * Serializes a quadratic path as an SVG path data string (the value of a
218
+ * `<path>` element's `d` attribute), using `M` and `Q` commands. Discontinuities
219
+ * between curves emit a fresh `M` command.
220
+ *
221
+ * @param p - The quadratic path to serialize.
222
+ * @returns The SVG path data string.
223
+ * @since 2.0.0
224
+ */
225
+ declare const toPathData: (p: QuadraticPath2d) => string;
226
+ /**
227
+ * Type-narrowing predicate: refines `QuadraticPath2d<T>` to
228
+ * `QuadraticPath2d<T & Continuous>` when adjacent curves connect.
229
+ *
230
+ * @since 2.0.0
231
+ */
232
+ declare const isContinuous: <T>(p: QuadraticPath2d<T>) => p is QuadraticPath2d<T & Continuous>;
233
+ /**
234
+ * Asserts that the quadratic path is continuous, throwing on failure.
235
+ *
236
+ * @since 2.0.0
237
+ */
238
+ declare const asContinuous: <T>(p: QuadraticPath2d<T>) => QuadraticPath2d<T & Continuous>;
239
+ //#endregion
240
+ export { cubic2d_d_exports as CubicPath2d, linear2d_d_exports as LinearPath2d, quadratic2d_d_exports as QuadraticPath2d, rationalCubic2d_d_exports as RationalCubicPath2d };
241
+ //# sourceMappingURL=index.d.mts.map