curvy 1.0.9 → 2.0.0-alpha.2

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 (173) 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 +3 -0
  6. package/dist/interval/index.mjs +3 -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 +261 -0
  14. package/dist/path/index.mjs +325 -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-B9nCh_cx.mjs +104 -0
  19. package/dist/shared/characteristic-B9nCh_cx.mjs.map +1 -0
  20. package/dist/shared/chunk-25Hzd3z8.mjs +13 -0
  21. package/dist/shared/cubic-BajUY0JT.d.mts +1100 -0
  22. package/dist/shared/cubic-CpHAx8cC.mjs +479 -0
  23. package/dist/shared/cubic-CpHAx8cC.mjs.map +1 -0
  24. package/dist/shared/interval-05CR6eBf.mjs +421 -0
  25. package/dist/shared/interval-05CR6eBf.mjs.map +1 -0
  26. package/dist/shared/interval-Dy-RMEE3.d.mts +533 -0
  27. package/dist/shared/interval2d-8IBZnUOq.mjs +108 -0
  28. package/dist/shared/interval2d-8IBZnUOq.mjs.map +1 -0
  29. package/dist/shared/interval2d-C2id9u31.d.mts +172 -0
  30. package/dist/shared/matrix4x4-Ck2WROK-.mjs +440 -0
  31. package/dist/shared/matrix4x4-Ck2WROK-.mjs.map +1 -0
  32. package/dist/shared/matrix4x4-Dm_tSiH1.d.mts +1183 -0
  33. package/dist/shared/quadratic-CamozcFc.mjs +330 -0
  34. package/dist/shared/quadratic-CamozcFc.mjs.map +1 -0
  35. package/dist/shared/rationalCubic2d-B6g97ryJ.d.mts +308 -0
  36. package/dist/shared/rationalCubic2d-BEgUGSFf.mjs +295 -0
  37. package/dist/shared/rationalCubic2d-BEgUGSFf.mjs.map +1 -0
  38. package/dist/shared/rationalCubic2d-Bys2Uory.mjs +695 -0
  39. package/dist/shared/rationalCubic2d-Bys2Uory.mjs.map +1 -0
  40. package/dist/shared/rationalCubic2d-DlQfBURs.d.mts +818 -0
  41. package/dist/shared/solution-CrtLfqEq.mjs +306 -0
  42. package/dist/shared/solution-CrtLfqEq.mjs.map +1 -0
  43. package/dist/shared/solution-sNQ-ZVhN.d.mts +251 -0
  44. package/dist/{pipe.d.mts → shared/utils-MCckigYk.d.mts} +44 -26
  45. package/dist/shared/vector2-CL1HDdPr.mjs +187 -0
  46. package/dist/shared/vector2-CL1HDdPr.mjs.map +1 -0
  47. package/dist/shared/vector2-DPUY3_eA.d.mts +470 -0
  48. package/dist/shared/vector2.internal-DU_E808S.mjs +97 -0
  49. package/dist/shared/vector2.internal-DU_E808S.mjs.map +1 -0
  50. package/dist/shared/vector3-D-tv_aKL.mjs +204 -0
  51. package/dist/shared/vector3-D-tv_aKL.mjs.map +1 -0
  52. package/dist/shared/vector3-DqeOZtOB.d.mts +703 -0
  53. package/dist/shared/vector4-5KbjoHVj.mjs +109 -0
  54. package/dist/shared/vector4-5KbjoHVj.mjs.map +1 -0
  55. package/dist/shared/vector4.internal-5XcaX12X.mjs +163 -0
  56. package/dist/shared/vector4.internal-5XcaX12X.mjs.map +1 -0
  57. package/dist/solution/index.d.mts +2 -0
  58. package/dist/solution/index.mjs +2 -0
  59. package/dist/splines/index.d.mts +701 -0
  60. package/dist/splines/index.mjs +734 -0
  61. package/dist/splines/index.mjs.map +1 -0
  62. package/dist/utils.d.mts +2 -205
  63. package/dist/utils.mjs +88 -52
  64. package/dist/utils.mjs.map +1 -1
  65. package/dist/vector/index.d.mts +3 -0
  66. package/dist/vector/index.mjs +4 -0
  67. package/package.json +49 -92
  68. package/dist/curve/cubic2d.d.mts +0 -109
  69. package/dist/curve/cubic2d.d.ts +0 -109
  70. package/dist/curve/cubic2d.mjs +0 -80
  71. package/dist/curve/cubic2d.mjs.map +0 -1
  72. package/dist/curve/linear2d.d.mts +0 -94
  73. package/dist/curve/linear2d.d.ts +0 -94
  74. package/dist/curve/linear2d.mjs +0 -46
  75. package/dist/curve/linear2d.mjs.map +0 -1
  76. package/dist/curve/quadratic2d.d.mts +0 -117
  77. package/dist/curve/quadratic2d.d.ts +0 -117
  78. package/dist/curve/quadratic2d.mjs +0 -82
  79. package/dist/curve/quadratic2d.mjs.map +0 -1
  80. package/dist/interval.d.mts +0 -251
  81. package/dist/interval.d.ts +0 -251
  82. package/dist/interval.mjs +0 -86
  83. package/dist/interval.mjs.map +0 -1
  84. package/dist/matrix/matrix2x2.d.mts +0 -320
  85. package/dist/matrix/matrix2x2.d.ts +0 -320
  86. package/dist/matrix/matrix2x2.mjs +0 -25
  87. package/dist/matrix/matrix2x2.mjs.map +0 -1
  88. package/dist/matrix/matrix3x3.d.mts +0 -370
  89. package/dist/matrix/matrix3x3.d.ts +0 -370
  90. package/dist/matrix/matrix3x3.mjs +0 -28
  91. package/dist/matrix/matrix3x3.mjs.map +0 -1
  92. package/dist/matrix/matrix4x4.d.mts +0 -381
  93. package/dist/matrix/matrix4x4.d.ts +0 -381
  94. package/dist/matrix/matrix4x4.mjs +0 -178
  95. package/dist/matrix/matrix4x4.mjs.map +0 -1
  96. package/dist/path/cubic2d.d.mts +0 -95
  97. package/dist/path/cubic2d.d.ts +0 -95
  98. package/dist/path/cubic2d.mjs +0 -60
  99. package/dist/path/cubic2d.mjs.map +0 -1
  100. package/dist/path/linear2d.d.mts +0 -95
  101. package/dist/path/linear2d.d.ts +0 -95
  102. package/dist/path/linear2d.mjs +0 -53
  103. package/dist/path/linear2d.mjs.map +0 -1
  104. package/dist/path/quadratic2d.d.mts +0 -95
  105. package/dist/path/quadratic2d.d.ts +0 -95
  106. package/dist/path/quadratic2d.mjs +0 -57
  107. package/dist/path/quadratic2d.mjs.map +0 -1
  108. package/dist/pipe.d.ts +0 -58
  109. package/dist/pipe.mjs +0 -92
  110. package/dist/pipe.mjs.map +0 -1
  111. package/dist/polynomial/cubic.d.mts +0 -7
  112. package/dist/polynomial/cubic.d.ts +0 -7
  113. package/dist/polynomial/cubic.mjs +0 -133
  114. package/dist/polynomial/cubic.mjs.map +0 -1
  115. package/dist/polynomial/linear.d.mts +0 -7
  116. package/dist/polynomial/linear.d.ts +0 -7
  117. package/dist/polynomial/linear.mjs +0 -24
  118. package/dist/polynomial/linear.mjs.map +0 -1
  119. package/dist/polynomial/quadratic.d.mts +0 -7
  120. package/dist/polynomial/quadratic.d.ts +0 -7
  121. package/dist/polynomial/quadratic.mjs +0 -27
  122. package/dist/polynomial/quadratic.mjs.map +0 -1
  123. package/dist/shared/curvy.Bf5TIk31.d.mts +0 -22
  124. package/dist/shared/curvy.Bf5TIk31.d.ts +0 -22
  125. package/dist/shared/curvy.BkkW8Tx9.mjs +0 -102
  126. package/dist/shared/curvy.BkkW8Tx9.mjs.map +0 -1
  127. package/dist/shared/curvy.BxdGW9he.mjs +0 -116
  128. package/dist/shared/curvy.BxdGW9he.mjs.map +0 -1
  129. package/dist/shared/curvy.C_sCeg9J.mjs +0 -66
  130. package/dist/shared/curvy.C_sCeg9J.mjs.map +0 -1
  131. package/dist/shared/curvy.Cg8lZVUz.d.ts +0 -688
  132. package/dist/shared/curvy.DCt1gGII.mjs +0 -147
  133. package/dist/shared/curvy.DCt1gGII.mjs.map +0 -1
  134. package/dist/shared/curvy.DJ4xO0al.mjs +0 -63
  135. package/dist/shared/curvy.DJ4xO0al.mjs.map +0 -1
  136. package/dist/shared/curvy.DmVFTi0N.mjs +0 -35
  137. package/dist/shared/curvy.DmVFTi0N.mjs.map +0 -1
  138. package/dist/shared/curvy.FDaj5rlj.d.mts +0 -688
  139. package/dist/shared/curvy.lktriTpx.mjs +0 -101
  140. package/dist/shared/curvy.lktriTpx.mjs.map +0 -1
  141. package/dist/shared/curvy.mLFprrGm.mjs +0 -85
  142. package/dist/shared/curvy.mLFprrGm.mjs.map +0 -1
  143. package/dist/shared/curvy.r6f1j287.mjs +0 -76
  144. package/dist/shared/curvy.r6f1j287.mjs.map +0 -1
  145. package/dist/splines/basis2d.d.mts +0 -130
  146. package/dist/splines/basis2d.d.ts +0 -130
  147. package/dist/splines/basis2d.mjs +0 -90
  148. package/dist/splines/basis2d.mjs.map +0 -1
  149. package/dist/splines/bezier2d.d.mts +0 -182
  150. package/dist/splines/bezier2d.d.ts +0 -182
  151. package/dist/splines/bezier2d.mjs +0 -23
  152. package/dist/splines/bezier2d.mjs.map +0 -1
  153. package/dist/splines/cardinal2d.d.mts +0 -178
  154. package/dist/splines/cardinal2d.d.ts +0 -178
  155. package/dist/splines/cardinal2d.mjs +0 -114
  156. package/dist/splines/cardinal2d.mjs.map +0 -1
  157. package/dist/splines/hermite2d.d.mts +0 -124
  158. package/dist/splines/hermite2d.d.ts +0 -124
  159. package/dist/splines/hermite2d.mjs +0 -63
  160. package/dist/splines/hermite2d.mjs.map +0 -1
  161. package/dist/utils.d.ts +0 -205
  162. package/dist/vector/vector2.d.mts +0 -324
  163. package/dist/vector/vector2.d.ts +0 -324
  164. package/dist/vector/vector2.mjs +0 -30
  165. package/dist/vector/vector2.mjs.map +0 -1
  166. package/dist/vector/vector3.d.mts +0 -417
  167. package/dist/vector/vector3.d.ts +0 -417
  168. package/dist/vector/vector3.mjs +0 -38
  169. package/dist/vector/vector3.mjs.map +0 -1
  170. package/dist/vector/vector4.d.mts +0 -205
  171. package/dist/vector/vector4.d.ts +0 -205
  172. package/dist/vector/vector4.mjs +0 -20
  173. package/dist/vector/vector4.mjs.map +0 -1
@@ -0,0 +1,533 @@
1
+ import { t as Pipeable } from "./utils-MCckigYk.mjs";
2
+
3
+ //#region src/interval/interval.d.ts
4
+ declare namespace interval_d_exports {
5
+ export { Bounds, Closed, Interval, Open, OpenEnd, OpenStart, ScaleShift, aligned, biunit, clamp, contains, containsInterval, equals, filter, fromMinMax, fromSize, isClosed, isClosedAtEnd, isClosedAtStart, isInterval, isOpen, isOpenAtEnd, isOpenAtStart, isOpenEnd, isOpenStart, lerp, make, makeOpen, makeOpenEnd, makeOpenStart, normalize, remap, scaleShift, size, toClosed, toEndClosed, toEndOpen, toLerpFn, toNormalizeFn, toOpen, toRemapFn, toStartClosed, toStartOpen, union, unit, unitOpen };
6
+ }
7
+ /**
8
+ * The structural minimum: any value with numeric `start` and `end` fields.
9
+ *
10
+ * Operations that don't read endpoint inclusivity (e.g. `lerp`, `normalize`,
11
+ * `remap`, `size`) accept `Bounds` so the signature itself documents what
12
+ * the operation depends on.
13
+ *
14
+ * @since 2.0.0
15
+ */
16
+ interface Bounds {
17
+ readonly start: number;
18
+ readonly end: number;
19
+ }
20
+ /**
21
+ * A mathematical interval. Discriminated union of four variants by endpoint
22
+ * inclusivity: `Closed`, `OpenStart`, `OpenEnd`, `Open`. Operations that
23
+ * depend on inclusivity (e.g. `contains`, `filter`, `equals`) dispatch on
24
+ * the `kind` field; operations that don't accept the broader `Bounds` type.
25
+ *
26
+ * All fields are readonly and immutable, and all operations create new instances.
27
+ *
28
+ * @since 1.0.0
29
+ */
30
+ type Interval = Closed | OpenStart | OpenEnd | Open;
31
+ /**
32
+ * `[start, end]` — both endpoints included.
33
+ *
34
+ * @since 2.0.0
35
+ */
36
+ interface Closed extends Pipeable, Bounds {
37
+ readonly kind: 'closed';
38
+ }
39
+ /**
40
+ * `(start, end]` — start excluded, end included.
41
+ *
42
+ * @since 2.0.0
43
+ */
44
+ interface OpenStart extends Pipeable, Bounds {
45
+ readonly kind: 'open-start';
46
+ }
47
+ /**
48
+ * `[start, end)` — start included, end excluded.
49
+ *
50
+ * @since 2.0.0
51
+ */
52
+ interface OpenEnd extends Pipeable, Bounds {
53
+ readonly kind: 'open-end';
54
+ }
55
+ /**
56
+ * `(start, end)` — both endpoints excluded.
57
+ *
58
+ * @since 2.0.0
59
+ */
60
+ interface Open extends Pipeable, Bounds {
61
+ readonly kind: 'open';
62
+ }
63
+ /**
64
+ * Checks if a value is an `Interval`.
65
+ *
66
+ * @param v - The value to check.
67
+ * @returns `true` if the value is an `Interval`, `false` otherwise.
68
+ * @since 1.0.0
69
+ */
70
+ declare const isInterval: (v: unknown) => v is Interval;
71
+ declare const equals: {
72
+ /**
73
+ * Checks if two `Interval` instances are approximately equal within the
74
+ * default absolute tolerance ({@link EPSILON}).
75
+ *
76
+ * Both endpoints AND the kind must match — a `Closed` and an `OpenStart` with
77
+ * the same numeric endpoints are not equal. Use `aligned` for the looser
78
+ * "same numeric range" check.
79
+ *
80
+ * @param a - The first interval.
81
+ * @param b - The second interval.
82
+ * @returns `true` when both intervals share a kind and both endpoints are within tolerance.
83
+ * @since 1.1.0
84
+ */
85
+ (a: Interval, b: Interval): boolean;
86
+ /**
87
+ * Checks if two `Interval` instances are approximately equal within the
88
+ * default absolute tolerance ({@link EPSILON}).
89
+ *
90
+ * @param b - The second interval.
91
+ * @returns A function that takes the first interval and returns the comparison result.
92
+ * @since 1.1.0
93
+ */
94
+ (b: Interval): (a: Interval) => boolean;
95
+ };
96
+ declare const aligned: {
97
+ /**
98
+ * Checks if two values share the same numeric range, ignoring endpoint
99
+ * inclusivity. Accepts any `Bounds`-shaped value.
100
+ *
101
+ * @param a - The first bounds.
102
+ * @param b - The second bounds.
103
+ * @returns `true` when both endpoints are within the default tolerance ({@link EPSILON}).
104
+ * @since 2.0.0
105
+ */
106
+ (a: Bounds, b: Bounds): boolean;
107
+ /**
108
+ * @param b - The second bounds.
109
+ * @returns A function that takes the first bounds and returns the comparison result.
110
+ * @since 2.0.0
111
+ */
112
+ (b: Bounds): (a: Bounds) => boolean;
113
+ };
114
+ declare const make: {
115
+ /**
116
+ * Creates a new closed `Interval` instance.
117
+ *
118
+ * @param point - The point of the interval.
119
+ * @returns A new `Closed` interval `[point, point]`.
120
+ * @since 1.0.0
121
+ */
122
+ (point: number): Closed;
123
+ /**
124
+ * Creates a new closed `Interval` instance.
125
+ *
126
+ * @param start - The start of the interval.
127
+ * @param end - The end of the interval.
128
+ * @returns A new `Closed` interval `[start, end]`.
129
+ * @since 1.0.0
130
+ */
131
+ (start: number, end: number): Closed;
132
+ };
133
+ declare const makeOpenStart: {
134
+ /**
135
+ * Creates a new left-open `Interval` instance.
136
+ *
137
+ * @param point - The point of the interval.
138
+ * @returns A new `OpenStart` interval `(point, point]` (degenerate, empty).
139
+ * @since 2.0.0
140
+ */
141
+ (point: number): OpenStart;
142
+ /**
143
+ * Creates a new left-open `Interval` instance.
144
+ *
145
+ * @param start - The start of the interval (excluded).
146
+ * @param end - The end of the interval (included).
147
+ * @returns A new `OpenStart` interval `(start, end]`.
148
+ * @since 2.0.0
149
+ */
150
+ (start: number, end: number): OpenStart;
151
+ };
152
+ declare const makeOpenEnd: {
153
+ /**
154
+ * Creates a new right-open `Interval` instance.
155
+ *
156
+ * @param point - The point of the interval.
157
+ * @returns A new `OpenEnd` interval `[point, point)` (degenerate, empty).
158
+ * @since 2.0.0
159
+ */
160
+ (point: number): OpenEnd;
161
+ /**
162
+ * Creates a new right-open `Interval` instance.
163
+ *
164
+ * @param start - The start of the interval (included).
165
+ * @param end - The end of the interval (excluded).
166
+ * @returns A new `OpenEnd` interval `[start, end)`.
167
+ * @since 2.0.0
168
+ */
169
+ (start: number, end: number): OpenEnd;
170
+ };
171
+ declare const makeOpen: {
172
+ /**
173
+ * Creates a new fully open `Interval` instance.
174
+ *
175
+ * @param point - The point of the interval.
176
+ * @returns A new `Open` interval `(point, point)` (degenerate, empty).
177
+ * @since 2.0.0
178
+ */
179
+ (point: number): Open;
180
+ /**
181
+ * Creates a new fully open `Interval` instance.
182
+ *
183
+ * @param start - The start of the interval (excluded).
184
+ * @param end - The end of the interval (excluded).
185
+ * @returns A new `Open` interval `(start, end)`.
186
+ * @since 2.0.0
187
+ */
188
+ (start: number, end: number): Open;
189
+ };
190
+ declare const fromSize: {
191
+ /**
192
+ * Creates a new closed `Interval` instance from a size.
193
+ *
194
+ * @param size - The size of the interval.
195
+ * @returns A new `Closed` interval `[0, size]`.
196
+ * @since 1.0.0
197
+ */
198
+ (size: number): Closed;
199
+ /**
200
+ * Creates a new closed `Interval` instance from a size.
201
+ *
202
+ * @param start - The start of the interval.
203
+ * @param size - The size of the interval.
204
+ * @returns A new `Closed` interval `[start, start + size]`.
205
+ * @since 1.0.0
206
+ */
207
+ (start: number, size: number): Closed;
208
+ };
209
+ /**
210
+ * Creates a new closed `Interval` from a minimum and maximum value, in any order.
211
+ *
212
+ * @param values - The values to take the min and max of.
213
+ * @returns A new `Closed` interval `[min(values), max(values)]`.
214
+ * @since 1.0.0
215
+ */
216
+ declare const fromMinMax: (...values: ReadonlyArray<number>) => Closed;
217
+ /**
218
+ * Calculates the size of an interval.
219
+ *
220
+ * Kind-agnostic — `size` of `[0, 1]` and `(0, 1)` are both `1`.
221
+ *
222
+ * @param i - The bounds to calculate the size of.
223
+ * @returns The size of the bounds.
224
+ * @since 1.0.0
225
+ */
226
+ declare const size: (i: Bounds) => number;
227
+ declare const contains: {
228
+ /**
229
+ * Checks if a value is contained within an interval. Endpoint inclusivity
230
+ * follows the interval's `kind`.
231
+ *
232
+ * @param interval - The interval to check.
233
+ * @param value - The value to check.
234
+ * @returns `true` if the value is contained within the interval, `false` otherwise.
235
+ * @since 1.0.0
236
+ */
237
+ (interval: Interval, value: number): boolean;
238
+ /**
239
+ * Checks if a value is contained within an interval. Endpoint inclusivity
240
+ * follows the interval's `kind`.
241
+ *
242
+ * @param value - The value to check.
243
+ * @returns A function that takes an interval and returns `true` if the value is contained within the interval, `false` otherwise.
244
+ * @since 1.0.0
245
+ */
246
+ (value: number): (interval: Interval) => boolean;
247
+ };
248
+ declare const containsInterval: {
249
+ /**
250
+ * Checks if `inner` is a subset of `outer` — every point of `inner` is also
251
+ * in `outer`. Respects endpoint inclusivity on both sides: a closed inner
252
+ * endpoint must be inside (or on a closed boundary of) the outer, while an
253
+ * open inner endpoint can sit exactly on an open outer boundary.
254
+ *
255
+ * @param outer - The enclosing interval.
256
+ * @param inner - The candidate inner interval.
257
+ * @returns `true` when `inner` is a subset of `outer`.
258
+ * @since 2.1.0
259
+ */
260
+ (outer: Interval, inner: Interval): boolean;
261
+ /**
262
+ * @param inner - The candidate inner interval.
263
+ * @returns A function that takes the outer interval and returns the containment result.
264
+ * @since 2.1.0
265
+ */
266
+ (inner: Interval): (outer: Interval) => boolean;
267
+ };
268
+ declare const union: {
269
+ /**
270
+ * Returns the smallest interval enclosing both inputs. Each endpoint's
271
+ * inclusivity follows the input that contributed it; when both endpoints
272
+ * tie, the result is closed at that point if either input includes it.
273
+ *
274
+ * @param a - The first interval.
275
+ * @param b - The second interval.
276
+ * @returns A new interval enclosing both inputs.
277
+ * @since 2.1.0
278
+ */
279
+ (a: Interval, b: Interval): Interval;
280
+ /**
281
+ * @param b - The second interval.
282
+ * @returns A function that takes the first interval and returns the union.
283
+ * @since 2.1.0
284
+ */
285
+ (b: Interval): (a: Interval) => Interval;
286
+ };
287
+ declare const filter: {
288
+ /**
289
+ * Filters an array of values to those contained within an interval.
290
+ * Endpoint inclusivity follows the interval's `kind`.
291
+ *
292
+ * @param interval - The interval to filter the values to.
293
+ * @param value - The values to filter.
294
+ * @returns The filtered values.
295
+ * @since 1.0.0
296
+ */
297
+ <V extends ReadonlyArray<number>>(interval: Interval, value: V): V;
298
+ /**
299
+ * Filters an array of values to those contained within an interval.
300
+ *
301
+ * @param value - The values to filter.
302
+ * @returns A function that takes an interval and returns the filtered values.
303
+ * @since 1.0.0
304
+ */
305
+ <V extends ReadonlyArray<number>>(value: V): (interval: Interval) => V;
306
+ };
307
+ declare const clamp: {
308
+ /**
309
+ * Clamps a value to be within bounds. Kind-agnostic — clamps to the numeric
310
+ * range regardless of endpoint inclusivity.
311
+ *
312
+ * @param interval - The bounds to clamp the value to.
313
+ * @param value - The value to clamp.
314
+ * @returns The clamped value.
315
+ * @since 1.0.0
316
+ */
317
+ (interval: Bounds, value: number): number;
318
+ /**
319
+ * Clamps a value to be within bounds. Kind-agnostic.
320
+ *
321
+ * @param value - The value to clamp.
322
+ * @returns A function that takes bounds and returns the clamped value.
323
+ * @since 1.0.0
324
+ */
325
+ (value: number): (interval: Bounds) => number;
326
+ /**
327
+ * Clamps an array of values to be within bounds. Kind-agnostic.
328
+ *
329
+ * @param interval - The bounds to clamp the values to.
330
+ * @param value - The values to clamp.
331
+ * @returns The clamped values.
332
+ * @since 1.0.0
333
+ */
334
+ (interval: Bounds, value: ReadonlyArray<number>): ReadonlyArray<number>;
335
+ /**
336
+ * Clamps an array of values to be within bounds. Kind-agnostic.
337
+ *
338
+ * @param value - The values to clamp.
339
+ * @returns A function that takes bounds and returns the clamped values.
340
+ * @since 1.0.0
341
+ */
342
+ (value: ReadonlyArray<number>): (interval: Bounds) => ReadonlyArray<number>;
343
+ };
344
+ /**
345
+ * Returns an interval with the start endpoint open. Preserves the end endpoint's inclusivity.
346
+ *
347
+ * @since 2.0.0
348
+ */
349
+ declare const toStartOpen: {
350
+ (i: Closed | OpenStart): OpenStart;
351
+ (i: OpenEnd | Open): Open;
352
+ };
353
+ /**
354
+ * Returns an interval with the start endpoint closed. Preserves the end endpoint's inclusivity.
355
+ *
356
+ * @since 2.0.0
357
+ */
358
+ declare const toStartClosed: {
359
+ (i: Closed | OpenEnd): Closed;
360
+ (i: OpenStart | Open): OpenEnd;
361
+ };
362
+ /**
363
+ * Returns an interval with the end endpoint open. Preserves the start endpoint's inclusivity.
364
+ *
365
+ * @since 2.0.0
366
+ */
367
+ declare const toEndOpen: {
368
+ (i: Closed | OpenEnd): OpenEnd;
369
+ (i: OpenStart | Open): Open;
370
+ };
371
+ /**
372
+ * Returns an interval with the end endpoint closed. Preserves the start endpoint's inclusivity.
373
+ *
374
+ * @since 2.0.0
375
+ */
376
+ declare const toEndClosed: {
377
+ (i: Closed | OpenEnd): Closed;
378
+ (i: OpenStart | Open): OpenStart;
379
+ };
380
+ /**
381
+ * Returns a closed interval over the same numeric range.
382
+ *
383
+ * @since 2.0.0
384
+ */
385
+ declare const toClosed: (i: Interval) => Closed;
386
+ /**
387
+ * Returns a fully open interval over the same numeric range.
388
+ *
389
+ * @since 2.0.0
390
+ */
391
+ declare const toOpen: (i: Interval) => Open;
392
+ /**
393
+ * Type-narrowing predicate: refines `Interval` to `Closed`.
394
+ *
395
+ * @since 2.0.0
396
+ */
397
+ declare const isClosed: (i: Interval) => i is Closed;
398
+ /**
399
+ * Type-narrowing predicate: refines `Interval` to `Open`.
400
+ *
401
+ * @since 2.0.0
402
+ */
403
+ declare const isOpen: (i: Interval) => i is Open;
404
+ /**
405
+ * Type-narrowing predicate: refines `Interval` to `OpenStart`.
406
+ *
407
+ * @since 2.0.0
408
+ */
409
+ declare const isOpenStart: (i: Interval) => i is OpenStart;
410
+ /**
411
+ * Type-narrowing predicate: refines `Interval` to `OpenEnd`.
412
+ *
413
+ * @since 2.0.0
414
+ */
415
+ declare const isOpenEnd: (i: Interval) => i is OpenEnd;
416
+ /**
417
+ * Type-narrowing predicate: refines `Interval` to those with an open start endpoint.
418
+ *
419
+ * @since 2.0.0
420
+ */
421
+ declare const isOpenAtStart: (i: Interval) => i is OpenStart | Open;
422
+ /**
423
+ * Type-narrowing predicate: refines `Interval` to those with an open end endpoint.
424
+ *
425
+ * @since 2.0.0
426
+ */
427
+ declare const isOpenAtEnd: (i: Interval) => i is OpenEnd | Open;
428
+ /**
429
+ * Type-narrowing predicate: refines `Interval` to those with a closed start endpoint.
430
+ *
431
+ * @since 2.0.0
432
+ */
433
+ declare const isClosedAtStart: (i: Interval) => i is Closed | OpenEnd;
434
+ /**
435
+ * Type-narrowing predicate: refines `Interval` to those with a closed end endpoint.
436
+ *
437
+ * @since 2.0.0
438
+ */
439
+ declare const isClosedAtEnd: (i: Interval) => i is Closed | OpenStart;
440
+ /**
441
+ * The unit interval, `[0, 1]`.
442
+ *
443
+ * @since 1.0.0
444
+ */
445
+ declare const unit: Closed;
446
+ /**
447
+ * The open unit interval, `(0, 1)`. The symmetric open analog of {@link unit};
448
+ * convenient for "strict interior" use cases such as filtering roots that
449
+ * must lie strictly inside the unit parameter range.
450
+ *
451
+ * @since 2.1.0
452
+ */
453
+ declare const unitOpen: Open;
454
+ /**
455
+ * The biunit interval, `[-1, 1]`.
456
+ *
457
+ * @since 1.0.0
458
+ */
459
+ declare const biunit: Closed;
460
+ /**
461
+ * Linearly interpolates a value within bounds.
462
+ *
463
+ * @param interval - The bounds to interpolate within.
464
+ * @param t - The interpolation factor, typically between 0 and 1.
465
+ * @returns The interpolated value.
466
+ * @since 1.0.0
467
+ */
468
+ declare const lerp: (interval: Bounds, t: number) => number;
469
+ /**
470
+ * Creates a linear interpolation function for given bounds.
471
+ *
472
+ * @param interval - The bounds to create the interpolation function for.
473
+ * @returns A function that takes a factor `t` and returns the interpolated value.
474
+ * @since 1.0.0
475
+ */
476
+ declare const toLerpFn: (interval: Bounds) => (t: number) => number;
477
+ /**
478
+ * Normalizes a value within bounds.
479
+ *
480
+ * @param interval - The bounds to normalize within.
481
+ * @param x - The value to normalize.
482
+ * @returns The normalized value.
483
+ * @since 1.0.0
484
+ */
485
+ declare const normalize: (interval: Bounds, x: number) => number;
486
+ /**
487
+ * Creates a normalization function for given bounds.
488
+ *
489
+ * @param interval - The bounds to create the normalization function for.
490
+ * @returns A function that takes a value `x` and returns the normalized value.
491
+ * @since 1.0.0
492
+ */
493
+ declare const toNormalizeFn: (interval: Bounds) => (x: number) => number;
494
+ /**
495
+ * Remaps a value from one bounds to another.
496
+ *
497
+ * @param source - The source bounds.
498
+ * @param target - The target bounds.
499
+ * @param x - The value to remap.
500
+ * @returns The remapped value.
501
+ * @since 1.0.0
502
+ */
503
+ declare const remap: (source: Bounds, target: Bounds, x: number) => number;
504
+ /**
505
+ * Creates a remapping function for given bounds.
506
+ *
507
+ * @param source - The source bounds.
508
+ * @param target - The target bounds.
509
+ * @returns A function that takes a value `x` and returns the remapped value.
510
+ * @since 1.0.0
511
+ */
512
+ declare const toRemapFn: (source: Bounds, target: Bounds) => (x: number) => number;
513
+ /**
514
+ * Calculates the scale and shift needed to map a source bounds to a target bounds.
515
+ *
516
+ * @param source - The source bounds.
517
+ * @param target - The target bounds.
518
+ * @returns An object containing the scale and shift values.
519
+ * @since 1.0.0
520
+ */
521
+ declare const scaleShift: (source: Bounds, target: Bounds) => ScaleShift;
522
+ /**
523
+ * The scale and shift needed to map a source bounds to a target bounds.
524
+ *
525
+ * @since 1.0.0
526
+ */
527
+ interface ScaleShift {
528
+ readonly scale: number;
529
+ readonly shift: number;
530
+ }
531
+ //#endregion
532
+ export { interval_d_exports as i, Closed as n, Interval as r, Bounds as t };
533
+ //# sourceMappingURL=interval-Dy-RMEE3.d.mts.map
@@ -0,0 +1,108 @@
1
+ import { t as __exportAll } from "./chunk-25Hzd3z8.mjs";
2
+ import { Pipeable, dual, invariant } from "../utils.mjs";
3
+ import { i as make$2 } from "./vector2-CL1HDdPr.mjs";
4
+ import { f as union$2, i as equals$2, n as contains, o as fromMinMax, r as containsInterval } from "./interval-05CR6eBf.mjs";
5
+ //#region src/interval/interval2d.internal.ts
6
+ const Interval2dTypeId = Symbol("curvy/interval/interval2d");
7
+ var Interval2dImpl = class extends Pipeable {
8
+ [Interval2dTypeId] = Interval2dTypeId;
9
+ x;
10
+ y;
11
+ constructor(x, y) {
12
+ super();
13
+ this.x = x;
14
+ this.y = y;
15
+ }
16
+ get [Symbol.toStringTag]() {
17
+ return `Interval2d(${String(this.x)} × ${String(this.y)})`;
18
+ }
19
+ get [Symbol.for("nodejs.util.inspect.custom")]() {
20
+ return this[Symbol.toStringTag];
21
+ }
22
+ };
23
+ const isInterval2d$1 = (v) => typeof v === "object" && v !== null && Interval2dTypeId in v;
24
+ const make$1 = (x, y) => new Interval2dImpl(x, y);
25
+ const fromCorners$1 = (p0, p1) => new Interval2dImpl(fromMinMax(p0.x, p1.x), fromMinMax(p0.y, p1.y));
26
+ const fromVectors$1 = (...points) => {
27
+ invariant(points.length > 0, "fromVectors requires at least one point");
28
+ const xs = [];
29
+ const ys = [];
30
+ for (const p of points) {
31
+ xs.push(p.x);
32
+ ys.push(p.y);
33
+ }
34
+ return new Interval2dImpl(fromMinMax(...xs), fromMinMax(...ys));
35
+ };
36
+ const containsVector$1 = dual(2, (box, v) => contains(box.x, v.x) && contains(box.y, v.y));
37
+ const containsInterval2d$1 = dual(2, (outer, inner) => containsInterval(outer.x, inner.x) && containsInterval(outer.y, inner.y));
38
+ const size$1 = (box) => make$2(Math.abs(box.x.end - box.x.start), Math.abs(box.y.end - box.y.start));
39
+ const union$1 = dual(2, (a, b) => new Interval2dImpl(union$2(a.x, b.x), union$2(a.y, b.y)));
40
+ const equals$1 = dual(2, (a, b) => equals$2(a.x, b.x) && equals$2(a.y, b.y));
41
+ //#endregion
42
+ //#region src/interval/interval2d.ts
43
+ var interval2d_exports = /* @__PURE__ */ __exportAll({
44
+ containsInterval2d: () => containsInterval2d,
45
+ containsVector: () => containsVector,
46
+ equals: () => equals,
47
+ fromCorners: () => fromCorners,
48
+ fromVectors: () => fromVectors,
49
+ isInterval2d: () => isInterval2d,
50
+ make: () => make,
51
+ size: () => size,
52
+ union: () => union
53
+ });
54
+ /**
55
+ * Checks if a value is an `Interval2d`.
56
+ *
57
+ * @param v - The value to check.
58
+ * @returns `true` if the value is an `Interval2d`, `false` otherwise.
59
+ * @since 2.1.0
60
+ */
61
+ const isInterval2d = isInterval2d$1;
62
+ /**
63
+ * Creates a new `Interval2d` from two intervals — one for the x axis, one
64
+ * for the y axis. Preserves both interval subtypes at the type level.
65
+ *
66
+ * @param x - The x-axis interval.
67
+ * @param y - The y-axis interval.
68
+ * @returns A new `Interval2d` instance.
69
+ * @since 2.1.0
70
+ */
71
+ const make = make$1;
72
+ /**
73
+ * Creates a closed `Interval2d` from two corner points. The corners can be in
74
+ * any order — each axis is built from the min and max of the coordinate.
75
+ *
76
+ * @param p0 - The first corner.
77
+ * @param p1 - The second corner.
78
+ * @returns A new `Interval2d<Closed, Closed>` enclosing both corners.
79
+ * @since 2.1.0
80
+ */
81
+ const fromCorners = fromCorners$1;
82
+ /**
83
+ * Creates the smallest closed `Interval2d` enclosing the given points. Useful
84
+ * for computing a bounding box from sampled points.
85
+ *
86
+ * @param points - One or more points to enclose.
87
+ * @returns A new `Interval2d<Closed, Closed>` enclosing all input points.
88
+ * @throws When called with zero points.
89
+ * @since 2.1.0
90
+ */
91
+ const fromVectors = fromVectors$1;
92
+ const containsVector = containsVector$1;
93
+ const containsInterval2d = containsInterval2d$1;
94
+ /**
95
+ * Returns the size as a vector `(width, height)`. Accepts the broader
96
+ * {@link Bounds2d} type because size does not depend on endpoint inclusivity.
97
+ *
98
+ * @param box - The 2D interval (or bounds-shaped value) to measure.
99
+ * @returns The size as a `Vector2`.
100
+ * @since 2.1.0
101
+ */
102
+ const size = size$1;
103
+ const union = union$1;
104
+ const equals = equals$1;
105
+ //#endregion
106
+ export { make as n, union as r, interval2d_exports as t };
107
+
108
+ //# sourceMappingURL=interval2d-8IBZnUOq.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"interval2d-8IBZnUOq.mjs","names":["isInterval2d","make","fromCorners","Interval.fromMinMax","fromVectors","containsVector","Interval.contains","containsInterval2d","Interval.containsInterval","size","Vector2.make","union","Interval.union","equals","Interval.equals","internal.isInterval2d","internal.make","internal.fromCorners","internal.fromVectors","internal.containsVector","internal.containsInterval2d","internal.size","internal.union","internal.equals"],"sources":["../../src/interval/interval2d.internal.ts","../../src/interval/interval2d.ts"],"sourcesContent":["import { dual, invariant, Pipeable } from '../utils'\nimport * as Vector2 from '../vector/vector2'\nimport * as Interval from './interval'\nimport type { Bounds2d, Interval2d } from './interval2d'\n\nexport const Interval2dTypeId: unique symbol = Symbol('curvy/interval/interval2d')\nexport type Interval2dTypeId = typeof Interval2dTypeId\n\nclass Interval2dImpl<X extends Interval.Interval, Y extends Interval.Interval>\n extends Pipeable\n implements Interval2d<X, Y>\n{\n readonly [Interval2dTypeId]: Interval2dTypeId = Interval2dTypeId\n\n readonly x: X\n readonly y: Y\n\n constructor(x: X, y: Y) {\n super()\n this.x = x\n this.y = y\n }\n\n get [Symbol.toStringTag]() {\n return `Interval2d(${String(this.x)} × ${String(this.y)})`\n }\n\n get [Symbol.for('nodejs.util.inspect.custom')]() {\n return this[Symbol.toStringTag]\n }\n}\n\nexport const isInterval2d = (v: unknown): v is Interval2d =>\n typeof v === 'object' && v !== null && Interval2dTypeId in v\n\nexport const make = <X extends Interval.Interval, Y extends Interval.Interval>(\n x: X,\n y: Y,\n): Interval2d<X, Y> => new Interval2dImpl(x, y)\n\nexport const fromCorners = (\n p0: Vector2.Vector2,\n p1: Vector2.Vector2,\n): Interval2d<Interval.Closed, Interval.Closed> =>\n new Interval2dImpl(Interval.fromMinMax(p0.x, p1.x), Interval.fromMinMax(p0.y, p1.y))\n\nexport const fromVectors = (\n ...points: ReadonlyArray<Vector2.Vector2>\n): Interval2d<Interval.Closed, Interval.Closed> => {\n invariant(points.length > 0, 'fromVectors requires at least one point')\n const xs: Array<number> = []\n const ys: Array<number> = []\n for (const p of points) {\n xs.push(p.x)\n ys.push(p.y)\n }\n return new Interval2dImpl(Interval.fromMinMax(...xs), Interval.fromMinMax(...ys))\n}\n\nexport const containsVector = dual<\n (v: Vector2.Vector2) => (box: Interval2d) => boolean,\n (box: Interval2d, v: Vector2.Vector2) => boolean\n>(\n 2,\n (box: Interval2d, v: Vector2.Vector2): boolean =>\n Interval.contains(box.x, v.x) && Interval.contains(box.y, v.y),\n)\n\nexport const containsInterval2d = dual<\n (inner: Interval2d) => (outer: Interval2d) => boolean,\n (outer: Interval2d, inner: Interval2d) => boolean\n>(\n 2,\n (outer: Interval2d, inner: Interval2d): boolean =>\n Interval.containsInterval(outer.x, inner.x) && Interval.containsInterval(outer.y, inner.y),\n)\n\n// Accepts the structural minimum because size doesn't read kind.\nexport const size = (box: Bounds2d): Vector2.Vector2 =>\n Vector2.make(Math.abs(box.x.end - box.x.start), Math.abs(box.y.end - box.y.start))\n\n// Per-axis union — the runtime delegates to `Interval.union`, which is\n// kind-correct (the resulting endpoint openness reflects which input\n// contributed each side). The conditional return type collapses to the\n// shared kind when both inputs match on an axis and falls back to `Interval`\n// when they differ — at runtime the result genuinely could be any of the four\n// kinds depending on which endpoint wins.\nexport const union: {\n <\n AX extends Interval.Interval,\n AY extends Interval.Interval,\n BX extends Interval.Interval,\n BY extends Interval.Interval,\n >(\n a: Interval2d<AX, AY>,\n b: Interval2d<BX, BY>,\n ): Interval2d<\n AX extends BX ? (BX extends AX ? AX : Interval.Interval) : Interval.Interval,\n AY extends BY ? (BY extends AY ? AY : Interval.Interval) : Interval.Interval\n >\n <BX extends Interval.Interval, BY extends Interval.Interval>(\n b: Interval2d<BX, BY>,\n ): <AX extends Interval.Interval, AY extends Interval.Interval>(\n a: Interval2d<AX, AY>,\n ) => Interval2d<\n AX extends BX ? (BX extends AX ? AX : Interval.Interval) : Interval.Interval,\n AY extends BY ? (BY extends AY ? AY : Interval.Interval) : Interval.Interval\n >\n} = dual(\n 2,\n (a: Interval2d, b: Interval2d) =>\n new Interval2dImpl(Interval.union(a.x, b.x), Interval.union(a.y, b.y)),\n) as never\n\nexport const equals = dual<\n (b: Interval2d) => (a: Interval2d) => boolean,\n (a: Interval2d, b: Interval2d) => boolean\n>(\n 2,\n (a: Interval2d, b: Interval2d): boolean => Interval.equals(a.x, b.x) && Interval.equals(a.y, b.y),\n)\n","import type { Pipeable } from '../utils'\nimport type { Vector2 } from '../vector/vector2'\nimport type { Bounds, Closed, Interval } from './interval'\nimport type { Interval2dTypeId } from './interval2d.internal'\nimport * as internal from './interval2d.internal'\n\n/**\n * An axis-aligned 2D interval — the Cartesian product of two 1D intervals.\n * Used as a bounding box for curves and paths, and as a region for\n * containment tests.\n *\n * The two type parameters carry the per-axis interval subtype so that a value\n * built from closed intervals stays `Interval2d<Closed, Closed>` and a value\n * with mixed openness preserves that information at the type level.\n *\n * All fields are readonly and immutable, and all operations create new instances.\n *\n * @since 2.1.0\n */\nexport interface Interval2d<\n X extends Interval = Interval,\n Y extends Interval = Interval,\n> extends Pipeable {\n readonly [Interval2dTypeId]: Interval2dTypeId\n readonly x: X\n readonly y: Y\n}\n\n/**\n * The structural minimum: any value with `x` and `y` fields shaped like\n * {@link Bounds}. Operations that don't read endpoint inclusivity (e.g.\n * {@link size}) accept `Bounds2d` so the signature itself documents what the\n * operation depends on. Mirrors the {@link Bounds}/{@link Interval} split in 1D.\n *\n * @since 2.1.0\n */\nexport interface Bounds2d {\n readonly x: Bounds\n readonly y: Bounds\n}\n\n/**\n * Checks if a value is an `Interval2d`.\n *\n * @param v - The value to check.\n * @returns `true` if the value is an `Interval2d`, `false` otherwise.\n * @since 2.1.0\n */\nexport const isInterval2d: (v: unknown) => v is Interval2d = internal.isInterval2d\n\n/**\n * Creates a new `Interval2d` from two intervals — one for the x axis, one\n * for the y axis. Preserves both interval subtypes at the type level.\n *\n * @param x - The x-axis interval.\n * @param y - The y-axis interval.\n * @returns A new `Interval2d` instance.\n * @since 2.1.0\n */\nexport const make: <X extends Interval, Y extends Interval>(x: X, y: Y) => Interval2d<X, Y> =\n internal.make\n\n/**\n * Creates a closed `Interval2d` from two corner points. The corners can be in\n * any order — each axis is built from the min and max of the coordinate.\n *\n * @param p0 - The first corner.\n * @param p1 - The second corner.\n * @returns A new `Interval2d<Closed, Closed>` enclosing both corners.\n * @since 2.1.0\n */\nexport const fromCorners: (p0: Vector2, p1: Vector2) => Interval2d<Closed, Closed> =\n internal.fromCorners\n\n/**\n * Creates the smallest closed `Interval2d` enclosing the given points. Useful\n * for computing a bounding box from sampled points.\n *\n * @param points - One or more points to enclose.\n * @returns A new `Interval2d<Closed, Closed>` enclosing all input points.\n * @throws When called with zero points.\n * @since 2.1.0\n */\nexport const fromVectors: (...points: ReadonlyArray<Vector2>) => Interval2d<Closed, Closed> =\n internal.fromVectors\n\nexport const containsVector: {\n /**\n * Checks if a vector lies within the 2D interval. Per-axis endpoint\n * inclusivity follows each axis interval's `kind`.\n *\n * @param box - The 2D interval to test against.\n * @param v - The vector to test.\n * @returns `true` when the vector lies within the box on both axes.\n * @since 2.1.0\n */\n (box: Interval2d, v: Vector2): boolean\n /**\n * @param v - The vector to test.\n * @returns A function that takes a 2D interval and returns the containment result.\n * @since 2.1.0\n */\n (v: Vector2): (box: Interval2d) => boolean\n} = internal.containsVector\n\nexport const containsInterval2d: {\n /**\n * Checks if `inner` is a subset of `outer`. The check is per-axis interval\n * containment — for each axis, every point of the inner interval must also\n * be in the outer interval, respecting endpoint inclusivity on both sides.\n *\n * @param outer - The enclosing 2D interval.\n * @param inner - The candidate inner 2D interval.\n * @returns `true` when every point of `inner` is also in `outer`.\n * @since 2.1.0\n */\n (outer: Interval2d, inner: Interval2d): boolean\n /**\n * @param inner - The candidate inner 2D interval.\n * @returns A function that takes the outer 2D interval and returns the containment result.\n * @since 2.1.0\n */\n (inner: Interval2d): (outer: Interval2d) => boolean\n} = internal.containsInterval2d\n\n/**\n * Returns the size as a vector `(width, height)`. Accepts the broader\n * {@link Bounds2d} type because size does not depend on endpoint inclusivity.\n *\n * @param box - The 2D interval (or bounds-shaped value) to measure.\n * @returns The size as a `Vector2`.\n * @since 2.1.0\n */\nexport const size: (box: Bounds2d) => Vector2 = internal.size\n\nexport const union: {\n /**\n * Returns the smallest 2D interval enclosing both inputs.\n *\n * The per-axis return kind is determined by which input's endpoint wins on\n * each side, with the contributor's openness preserved (or unioned to\n * \"closed\" when endpoints are numerically equal and either is closed at\n * that point).\n *\n * When both inputs share the same kind on an axis, the result collapses\n * back to that kind. Otherwise the axis falls back to the open\n * {@link Interval} type since the runtime kind depends on the values.\n *\n * @param a - The first 2D interval.\n * @param b - The second 2D interval.\n * @returns A new `Interval2d` enclosing both inputs.\n * @since 2.1.0\n */\n <AX extends Interval, AY extends Interval, BX extends Interval, BY extends Interval>(\n a: Interval2d<AX, AY>,\n b: Interval2d<BX, BY>,\n ): Interval2d<\n AX extends BX ? (BX extends AX ? AX : Interval) : Interval,\n AY extends BY ? (BY extends AY ? AY : Interval) : Interval\n >\n /**\n * @param b - The second 2D interval.\n * @returns A function that takes the first 2D interval and returns the union.\n * @since 2.1.0\n */\n <BX extends Interval, BY extends Interval>(\n b: Interval2d<BX, BY>,\n ): <AX extends Interval, AY extends Interval>(\n a: Interval2d<AX, AY>,\n ) => Interval2d<\n AX extends BX ? (BX extends AX ? AX : Interval) : Interval,\n AY extends BY ? (BY extends AY ? AY : Interval) : Interval\n >\n} = internal.union\n\nexport const equals: {\n /**\n * Checks if two `Interval2d` values are approximately equal within the\n * default absolute tolerance ({@link EPSILON}). Both the numeric endpoints\n * AND the per-axis kinds must match.\n *\n * @param a - The first 2D interval.\n * @param b - The second 2D interval.\n * @returns `true` when both axes are equal.\n * @since 2.1.0\n */\n (a: Interval2d, b: Interval2d): boolean\n /**\n * @param b - The second 2D interval.\n * @returns A function that takes the first 2D interval and returns the comparison result.\n * @since 2.1.0\n */\n (b: Interval2d): (a: Interval2d) => boolean\n} = internal.equals\n"],"mappings":";;;;;AAKA,MAAa,mBAAkC,OAAO,4BAA4B;AAGlF,IAAM,iBAAN,cACU,SAEV;CACE,CAAU,oBAAsC;CAEhD;CACA;CAEA,YAAY,GAAM,GAAM;EACtB,OAAO;EACP,KAAK,IAAI;EACT,KAAK,IAAI;;CAGX,KAAK,OAAO,eAAe;EACzB,OAAO,cAAc,OAAO,KAAK,EAAE,CAAC,KAAK,OAAO,KAAK,EAAE,CAAC;;CAG1D,KAAK,OAAO,IAAI,6BAA6B,IAAI;EAC/C,OAAO,KAAK,OAAO;;;AAIvB,MAAaA,kBAAgB,MAC3B,OAAO,MAAM,YAAY,MAAM,QAAQ,oBAAoB;AAE7D,MAAaC,UACX,GACA,MACqB,IAAI,eAAe,GAAG,EAAE;AAE/C,MAAaC,iBACX,IACA,OAEA,IAAI,eAAeC,WAAoB,GAAG,GAAG,GAAG,EAAE,EAAEA,WAAoB,GAAG,GAAG,GAAG,EAAE,CAAC;AAEtF,MAAaC,iBACX,GAAG,WAC8C;CACjD,UAAU,OAAO,SAAS,GAAG,0CAA0C;CACvE,MAAM,KAAoB,EAAE;CAC5B,MAAM,KAAoB,EAAE;CAC5B,KAAK,MAAM,KAAK,QAAQ;EACtB,GAAG,KAAK,EAAE,EAAE;EACZ,GAAG,KAAK,EAAE,EAAE;;CAEd,OAAO,IAAI,eAAeD,WAAoB,GAAG,GAAG,EAAEA,WAAoB,GAAG,GAAG,CAAC;;AAGnF,MAAaE,mBAAiB,KAI5B,IACC,KAAiB,MAChBC,SAAkB,IAAI,GAAG,EAAE,EAAE,IAAIA,SAAkB,IAAI,GAAG,EAAE,EAAE,CACjE;AAED,MAAaC,uBAAqB,KAIhC,IACC,OAAmB,UAClBC,iBAA0B,MAAM,GAAG,MAAM,EAAE,IAAIA,iBAA0B,MAAM,GAAG,MAAM,EAAE,CAC7F;AAGD,MAAaC,UAAQ,QACnBC,OAAa,KAAK,IAAI,IAAI,EAAE,MAAM,IAAI,EAAE,MAAM,EAAE,KAAK,IAAI,IAAI,EAAE,MAAM,IAAI,EAAE,MAAM,CAAC;AAQpF,MAAaC,UAqBT,KACF,IACC,GAAe,MACd,IAAI,eAAeC,QAAe,EAAE,GAAG,EAAE,EAAE,EAAEA,QAAe,EAAE,GAAG,EAAE,EAAE,CAAC,CACzE;AAED,MAAaC,WAAS,KAIpB,IACC,GAAe,MAA2BC,SAAgB,EAAE,GAAG,EAAE,EAAE,IAAIA,SAAgB,EAAE,GAAG,EAAE,EAAE,CAClG;;;;;;;;;;;;;;;;;;;;;ACxED,MAAa,eAAgDC;;;;;;;;;;AAW7D,MAAa,OACXC;;;;;;;;;;AAWF,MAAa,cACXC;;;;;;;;;;AAWF,MAAa,cACXC;AAEF,MAAa,iBAiBTC;AAEJ,MAAa,qBAkBTC;;;;;;;;;AAUJ,MAAa,OAAmCC;AAEhD,MAAa,QAsCTC;AAEJ,MAAa,SAkBTC"}