curvy 2.0.0-alpha.5 → 2.0.0-alpha.6

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 (63) hide show
  1. package/dist/characteristic/{characteristic.d.ts → index.d.mts} +17 -9
  2. package/dist/curve/index.d.mts +2 -0
  3. package/dist/interval/index.d.mts +3 -0
  4. package/dist/matrix/index.d.mts +2 -0
  5. package/dist/number.d.mts +280 -0
  6. package/dist/path/index.d.mts +261 -0
  7. package/dist/polynomial/index.d.mts +2 -0
  8. package/dist/shared/cubic-C3ZMAoGj.d.mts +1124 -0
  9. package/dist/shared/interval-CSntLeSX.d.mts +533 -0
  10. package/dist/shared/interval2d-D42_0ka1.d.mts +172 -0
  11. package/dist/shared/matrix4x4-gy9ejrX2.d.mts +1183 -0
  12. package/dist/shared/rationalCubic2d-C1RBShBF.d.mts +818 -0
  13. package/dist/shared/rationalCubic2d-DFFvp5S1.d.mts +308 -0
  14. package/dist/{solution/solution.d.ts → shared/solution-Cf_zoKFU.d.mts} +71 -64
  15. package/dist/shared/utils-MCckigYk.d.mts +76 -0
  16. package/dist/shared/vector2-5GyA0jBj.d.mts +470 -0
  17. package/dist/shared/vector3-BfOPFZEn.d.mts +703 -0
  18. package/dist/solution/index.d.mts +2 -0
  19. package/dist/splines/index.d.mts +858 -0
  20. package/dist/utils.d.mts +2 -0
  21. package/dist/vector/index.d.mts +3 -0
  22. package/package.json +13 -13
  23. package/dist/characteristic/index.d.ts +0 -1
  24. package/dist/curve/cubic2d.d.ts +0 -219
  25. package/dist/curve/index.d.ts +0 -12
  26. package/dist/curve/linear2d.d.ts +0 -199
  27. package/dist/curve/quadratic2d.d.ts +0 -227
  28. package/dist/curve/rationalCubic2d.d.ts +0 -200
  29. package/dist/dimensions.d.ts +0 -23
  30. package/dist/interval/index.d.ts +0 -6
  31. package/dist/interval/interval.d.ts +0 -525
  32. package/dist/interval/interval2d.d.ts +0 -167
  33. package/dist/length.d.ts +0 -32
  34. package/dist/matrix/index.d.ts +0 -9
  35. package/dist/matrix/matrix2x2.d.ts +0 -339
  36. package/dist/matrix/matrix3x3.d.ts +0 -400
  37. package/dist/matrix/matrix4x4.d.ts +0 -443
  38. package/dist/number.d.ts +0 -276
  39. package/dist/path/cubic2d.d.ts +0 -155
  40. package/dist/path/index.d.ts +0 -12
  41. package/dist/path/linear2d.d.ts +0 -135
  42. package/dist/path/quadratic2d.d.ts +0 -127
  43. package/dist/path/rationalCubic2d.d.ts +0 -120
  44. package/dist/path/traits.d.ts +0 -31
  45. package/dist/polynomial/cubic.d.ts +0 -381
  46. package/dist/polynomial/index.d.ts +0 -9
  47. package/dist/polynomial/linear.d.ts +0 -321
  48. package/dist/polynomial/monotonicity.d.ts +0 -3
  49. package/dist/polynomial/quadratic.d.ts +0 -375
  50. package/dist/polynomial/traits.d.ts +0 -56
  51. package/dist/solution/index.d.ts +0 -3
  52. package/dist/splines/basis2d.d.ts +0 -122
  53. package/dist/splines/bezier2d.d.ts +0 -202
  54. package/dist/splines/cardinal2d.d.ts +0 -273
  55. package/dist/splines/hermite2d.d.ts +0 -117
  56. package/dist/splines/index.d.ts +0 -15
  57. package/dist/splines/rationalBezier2d.d.ts +0 -148
  58. package/dist/splines/util.d.ts +0 -5
  59. package/dist/utils.d.ts +0 -73
  60. package/dist/vector/index.d.ts +0 -9
  61. package/dist/vector/vector2.d.ts +0 -446
  62. package/dist/vector/vector3.d.ts +0 -449
  63. package/dist/vector/vector4.d.ts +0 -253
@@ -1,6 +1,11 @@
1
- import * as Matrix4x4 from '../matrix/matrix4x4';
2
- import * as CubicPolynomial from '../polynomial/cubic';
3
- import type * as Vector4 from '../vector/vector4';
1
+ import { r as Vector4 } from "../shared/vector3-BfOPFZEn.mjs";
2
+ import { t as Matrix4x4 } from "../shared/matrix4x4-gy9ejrX2.mjs";
3
+ import { t as CubicPolynomial } from "../shared/cubic-C3ZMAoGj.mjs";
4
+
5
+ //#region src/characteristic/characteristic.d.ts
6
+ declare namespace characteristic_d_exports {
7
+ export { apply, cubicBasisSpline, cubicBezier, cubicCardinal, cubicCatmullRom, cubicHermite };
8
+ }
4
9
  /**
5
10
  * The cubic Bézier characteristic matrix.
6
11
  *
@@ -11,7 +16,7 @@ import type * as Vector4 from '../vector/vector4';
11
16
  *
12
17
  * @since 2.0.0
13
18
  */
14
- export declare const cubicBezier: Matrix4x4.Matrix4x4;
19
+ declare const cubicBezier: Matrix4x4;
15
20
  /**
16
21
  * The cubic Hermite characteristic matrix.
17
22
  *
@@ -20,7 +25,7 @@ export declare const cubicBezier: Matrix4x4.Matrix4x4;
20
25
  *
21
26
  * @since 2.0.0
22
27
  */
23
- export declare const cubicHermite: Matrix4x4.Matrix4x4;
28
+ declare const cubicHermite: Matrix4x4;
24
29
  /**
25
30
  * The uniform cubic B-spline (basis spline) characteristic matrix.
26
31
  *
@@ -31,7 +36,7 @@ export declare const cubicHermite: Matrix4x4.Matrix4x4;
31
36
  *
32
37
  * @since 2.0.0
33
38
  */
34
- export declare const cubicBasisSpline: Matrix4x4.Matrix4x4;
39
+ declare const cubicBasisSpline: Matrix4x4;
35
40
  /**
36
41
  * The cubic Cardinal spline characteristic matrix, parameterized by tension.
37
42
  *
@@ -49,7 +54,7 @@ export declare const cubicBasisSpline: Matrix4x4.Matrix4x4;
49
54
  * @returns The characteristic matrix for that tension.
50
55
  * @since 2.0.0
51
56
  */
52
- export declare const cubicCardinal: (tension: number) => Matrix4x4.Matrix4x4;
57
+ declare const cubicCardinal: (tension: number) => Matrix4x4;
53
58
  /**
54
59
  * The cubic Catmull-Rom characteristic matrix — Cardinal with tension `0.5`.
55
60
  * The most common Cardinal-family variant; reused widely enough to deserve
@@ -57,7 +62,7 @@ export declare const cubicCardinal: (tension: number) => Matrix4x4.Matrix4x4;
57
62
  *
58
63
  * @since 2.0.0
59
64
  */
60
- export declare const cubicCatmullRom: Matrix4x4.Matrix4x4;
65
+ declare const cubicCatmullRom: Matrix4x4;
61
66
  /**
62
67
  * Applies a characteristic matrix to N channels of control values, producing
63
68
  * N cubic polynomials in monomial form.
@@ -77,4 +82,7 @@ export declare const cubicCatmullRom: Matrix4x4.Matrix4x4;
77
82
  * @returns A tuple of cubic polynomials, one per input channel.
78
83
  * @since 2.0.0
79
84
  */
80
- export declare const apply: <const Channels extends ReadonlyArray<Vector4.Vector4>>(matrix: Matrix4x4.Matrix4x4, ...channels: Channels) => { readonly [K in keyof Channels]: CubicPolynomial.CubicPolynomial; };
85
+ declare const apply: <const Channels extends ReadonlyArray<Vector4>>(matrix: Matrix4x4, ...channels: Channels) => { readonly [K in keyof Channels]: CubicPolynomial };
86
+ //#endregion
87
+ export { characteristic_d_exports as Characteristic };
88
+ //# sourceMappingURL=index.d.mts.map
@@ -0,0 +1,2 @@
1
+ import { c as linear2d_d_exports, i as cubic2d_d_exports, n as rationalCubic2d_d_exports, o as quadratic2d_d_exports } from "../shared/rationalCubic2d-C1RBShBF.mjs";
2
+ export { cubic2d_d_exports as CubicCurve2d, linear2d_d_exports as LinearCurve2d, quadratic2d_d_exports as QuadraticCurve2d, rationalCubic2d_d_exports as RationalCubicCurve2d };
@@ -0,0 +1,3 @@
1
+ import { i as interval_d_exports } from "../shared/interval-CSntLeSX.mjs";
2
+ import { n as interval2d_d_exports } from "../shared/interval2d-D42_0ka1.mjs";
3
+ export { interval_d_exports as Interval, interval2d_d_exports as Interval2d };
@@ -0,0 +1,2 @@
1
+ import { i as matrix2x2_d_exports, n as matrix4x4_d_exports, r as matrix3x3_d_exports } from "../shared/matrix4x4-gy9ejrX2.mjs";
2
+ export { matrix2x2_d_exports as Matrix2x2, matrix3x3_d_exports as Matrix3x3, matrix4x4_d_exports as Matrix4x4 };
@@ -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,261 @@
1
+ import { t as Vector2 } from "../shared/vector2-5GyA0jBj.mjs";
2
+ import { t as Pipeable } from "../shared/utils-MCckigYk.mjs";
3
+ import { n as Closed } from "../shared/interval-CSntLeSX.mjs";
4
+ import { t as Interval2d } from "../shared/interval2d-D42_0ka1.mjs";
5
+ import { a as QuadraticCurve2d, s as LinearCurve2d } from "../shared/rationalCubic2d-C1RBShBF.mjs";
6
+ import { a as Continuous, i as cubic2d_d_exports, n as rationalCubic2d_d_exports, o as PathTraits } from "../shared/rationalCubic2d-DFFvp5S1.mjs";
7
+
8
+ //#region src/path/linear2d.internal.d.ts
9
+ declare const LinearPath2dTypeId: unique symbol;
10
+ type LinearPath2dTypeId = typeof LinearPath2dTypeId;
11
+ declare namespace linear2d_d_exports {
12
+ export { Continuous, LinearPath2d, append$1 as append, asContinuous$1 as asContinuous, boundingBox$1 as boundingBox, 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 };
13
+ }
14
+ /**
15
+ * A linear path in 2D space.
16
+ *
17
+ * All fields are readonly and immutable, and all operations create new instances.
18
+ *
19
+ * The `Trait` type parameter accumulates trait brands as the path is refined
20
+ * via `isContinuous` / `asContinuous`. A `Continuous` path's `toPathData`
21
+ * skips the per-segment discontinuity check.
22
+ *
23
+ * @since 1.0.0
24
+ */
25
+ interface LinearPath2d<out Trait = unknown> extends Pipeable, Iterable<LinearCurve2d> {
26
+ readonly [LinearPath2dTypeId]: LinearPath2dTypeId;
27
+ readonly [PathTraits]: Trait;
28
+ }
29
+ /**
30
+ * Creates a new `LinearPath2d` instance from a sequence of curves.
31
+ *
32
+ * @param curves - The curves to create the path from.
33
+ * @returns A new `LinearPath2d` instance.
34
+ * @since 2.0.0
35
+ */
36
+ declare const make$1: (...curves: ReadonlyArray<LinearCurve2d>) => LinearPath2d;
37
+ /**
38
+ * Creates a new `LinearPath2d` instance from an array of curves.
39
+ *
40
+ * @param curves - The curves to create the path from.
41
+ * @returns A new `LinearPath2d` instance.
42
+ * @since 2.0.0
43
+ */
44
+ declare const fromArray$1: (curves: ReadonlyArray<LinearCurve2d>) => LinearPath2d;
45
+ /**
46
+ * Checks if a value is a `LinearPath2d`.
47
+ *
48
+ * @param p - The value to check.
49
+ * @returns `true` if the value is a `LinearPath2d`, `false` otherwise.
50
+ * @since 1.0.0
51
+ */
52
+ declare const isLinearPath2d: (p: unknown) => p is LinearPath2d;
53
+ declare const append$1: {
54
+ /**
55
+ * Appends a linear curve to a linear path.
56
+ *
57
+ * @param c - The linear curve to append.
58
+ * @returns A function that takes a linear path and returns a new linear path.
59
+ * @since 1.0.0
60
+ */
61
+ (c: LinearCurve2d): (p: LinearPath2d) => LinearPath2d;
62
+ /**
63
+ * Appends a linear curve to a linear path.
64
+ *
65
+ * @param p - The linear path to append to.
66
+ * @param c - The linear curve to append.
67
+ * @returns A new `LinearPath2d` instance with the appended curve.
68
+ * @since 1.0.0
69
+ */
70
+ (p: LinearPath2d, c: LinearCurve2d): LinearPath2d;
71
+ };
72
+ /**
73
+ * Calculates the length of a linear path.
74
+ *
75
+ * @param p - The linear path to calculate the length of.
76
+ * @returns The length of the linear path.
77
+ * @since 1.0.0
78
+ */
79
+ declare const length$1: (p: LinearPath2d) => number;
80
+ declare const solve$1: {
81
+ /**
82
+ * Solves a linear path for a given parameter.
83
+ *
84
+ * @param u - The parameter to solve for.
85
+ * @returns A function that takes a linear path and returns the solved point.
86
+ * @since 1.0.0
87
+ */
88
+ (u: number): (p: LinearPath2d) => Vector2;
89
+ /**
90
+ * Solves a linear path for a given parameter.
91
+ *
92
+ * @param p - The linear path to solve.
93
+ * @param u - The parameter to solve for.
94
+ * @returns The solved point on the linear path.
95
+ * @since 1.0.0
96
+ */
97
+ (p: LinearPath2d, u: number): Vector2;
98
+ };
99
+ /**
100
+ * Serializes a linear path as an SVG path data string (the value of a `<path>`
101
+ * element's `d` attribute), using `M` and `L` commands. Discontinuities between
102
+ * curves emit a fresh `M` command.
103
+ *
104
+ * @param p - The linear path to serialize.
105
+ * @returns The SVG path data string.
106
+ * @since 2.0.0
107
+ */
108
+ declare const toPathData$1: (p: LinearPath2d) => string;
109
+ /**
110
+ * Type-narrowing predicate: refines `LinearPath2d<T>` to
111
+ * `LinearPath2d<T & Continuous>` when adjacent curves connect at their join
112
+ * points.
113
+ *
114
+ * @param p - The linear path to check.
115
+ * @returns `true` when the path is continuous (G⁰).
116
+ * @since 2.0.0
117
+ */
118
+ declare const isContinuous$1: <T>(p: LinearPath2d<T>) => p is LinearPath2d<T & Continuous>;
119
+ /**
120
+ * Asserts that the linear path is continuous, throwing on failure.
121
+ *
122
+ * @param p - The linear path to assert against.
123
+ * @returns The same path, typed with the `Continuous` brand.
124
+ * @throws When the path has a discontinuity between adjacent curves.
125
+ * @since 2.0.0
126
+ */
127
+ declare const asContinuous$1: <T>(p: LinearPath2d<T>) => LinearPath2d<T & Continuous>;
128
+ /**
129
+ * Computes the axis-aligned bounding box of the path — the smallest closed
130
+ * `Box2d` enclosing every segment.
131
+ *
132
+ * @param p - The linear path.
133
+ * @returns A closed `Box2d` enclosing the path.
134
+ * @since 2.0.0
135
+ */
136
+ declare const boundingBox$1: (p: LinearPath2d) => Interval2d<Closed, Closed>;
137
+ //#endregion
138
+ //#region src/path/quadratic2d.internal.d.ts
139
+ declare const QuadraticPath2dTypeId: unique symbol;
140
+ type QuadraticPath2dTypeId = typeof QuadraticPath2dTypeId;
141
+ declare namespace quadratic2d_d_exports {
142
+ export { Continuous, QuadraticPath2d, append, asContinuous, boundingBox, fromArray, isContinuous, isQuadraticPath2d, length, make, solve, toPathData };
143
+ }
144
+ /**
145
+ * A quadratic path in 2D space.
146
+ *
147
+ * All fields are readonly and immutable, and all operations create new instances.
148
+ *
149
+ * The `Trait` type parameter accumulates trait brands as the path is refined
150
+ * via `isContinuous` / `asContinuous`.
151
+ *
152
+ * @since 1.0.0
153
+ */
154
+ interface QuadraticPath2d<out Trait = unknown> extends Pipeable, Iterable<QuadraticCurve2d> {
155
+ readonly [QuadraticPath2dTypeId]: QuadraticPath2dTypeId;
156
+ readonly [PathTraits]: Trait;
157
+ }
158
+ /**
159
+ * Creates a new `QuadraticPath2d` instance from a sequence of curves.
160
+ *
161
+ * @param curves - The curves to create the path from.
162
+ * @returns A new `QuadraticPath2d` instance.
163
+ * @since 2.0.0
164
+ */
165
+ declare const make: (...curves: ReadonlyArray<QuadraticCurve2d>) => QuadraticPath2d;
166
+ /**
167
+ * Creates a new `QuadraticPath2d` instance from an array of curves.
168
+ *
169
+ * @param curves - The curves to create the path from.
170
+ * @returns A new `QuadraticPath2d` instance.
171
+ * @since 2.0.0
172
+ */
173
+ declare const fromArray: (curves: ReadonlyArray<QuadraticCurve2d>) => QuadraticPath2d;
174
+ /**
175
+ * Checks if a value is a `QuadraticPath2d`.
176
+ *
177
+ * @param p - The value to check.
178
+ * @returns `true` if the value is a `QuadraticPath2d`, `false` otherwise.
179
+ * @since 1.0.0
180
+ */
181
+ declare const isQuadraticPath2d: (p: unknown) => p is QuadraticPath2d;
182
+ declare const append: {
183
+ /**
184
+ * Appends a quadratic curve to a quadratic path.
185
+ *
186
+ * @param c - The quadratic curve to append.
187
+ * @returns A function that takes a quadratic path and returns a new quadratic path.
188
+ * @since 1.0.0
189
+ */
190
+ (c: QuadraticCurve2d): (p: QuadraticPath2d) => QuadraticPath2d;
191
+ /**
192
+ * Appends a quadratic curve to a quadratic path.
193
+ *
194
+ * @param p - The quadratic path to append to.
195
+ * @param c - The quadratic curve to append.
196
+ * @returns A new `QuadraticPath2d` instance with the appended curve.
197
+ * @since 1.0.0
198
+ */
199
+ (p: QuadraticPath2d, c: QuadraticCurve2d): QuadraticPath2d;
200
+ };
201
+ /**
202
+ * Calculates the length of a quadratic path.
203
+ *
204
+ * @param p - The quadratic path to calculate the length of.
205
+ * @returns The length of the path.
206
+ */
207
+ declare const length: (p: QuadraticPath2d) => number;
208
+ declare const solve: {
209
+ /**
210
+ * Solves a quadratic path at a given parameter.
211
+ *
212
+ * @param u - The parameter to solve for.
213
+ * @returns A function that takes a quadratic path and returns the solved point.
214
+ * @since 1.0.0
215
+ */
216
+ (u: number): (p: QuadraticPath2d) => Vector2;
217
+ /**
218
+ * Solves a quadratic path at a given parameter.
219
+ *
220
+ * @param p - The quadratic path to solve.
221
+ * @param u - The parameter to solve for.
222
+ * @returns The solved point.
223
+ * @since 1.0.0
224
+ */
225
+ (p: QuadraticPath2d, u: number): Vector2;
226
+ };
227
+ /**
228
+ * Serializes a quadratic path as an SVG path data string (the value of a
229
+ * `<path>` element's `d` attribute), using `M` and `Q` commands. Discontinuities
230
+ * between curves emit a fresh `M` command.
231
+ *
232
+ * @param p - The quadratic path to serialize.
233
+ * @returns The SVG path data string.
234
+ * @since 2.0.0
235
+ */
236
+ declare const toPathData: (p: QuadraticPath2d) => string;
237
+ /**
238
+ * Type-narrowing predicate: refines `QuadraticPath2d<T>` to
239
+ * `QuadraticPath2d<T & Continuous>` when adjacent curves connect.
240
+ *
241
+ * @since 2.0.0
242
+ */
243
+ declare const isContinuous: <T>(p: QuadraticPath2d<T>) => p is QuadraticPath2d<T & Continuous>;
244
+ /**
245
+ * Asserts that the quadratic path is continuous, throwing on failure.
246
+ *
247
+ * @since 2.0.0
248
+ */
249
+ declare const asContinuous: <T>(p: QuadraticPath2d<T>) => QuadraticPath2d<T & Continuous>;
250
+ /**
251
+ * Computes the axis-aligned bounding box of the path — the smallest closed
252
+ * `Box2d` enclosing every segment.
253
+ *
254
+ * @param p - The quadratic path.
255
+ * @returns A closed `Box2d` enclosing the path.
256
+ * @since 2.0.0
257
+ */
258
+ declare const boundingBox: (p: QuadraticPath2d) => Interval2d<Closed, Closed>;
259
+ //#endregion
260
+ export { cubic2d_d_exports as CubicPath2d, linear2d_d_exports as LinearPath2d, quadratic2d_d_exports as QuadraticPath2d, rationalCubic2d_d_exports as RationalCubicPath2d };
261
+ //# sourceMappingURL=index.d.mts.map
@@ -0,0 +1,2 @@
1
+ import { i as quadratic_d_exports, n as cubic_d_exports, o as linear_d_exports } from "../shared/cubic-C3ZMAoGj.mjs";
2
+ export { cubic_d_exports as CubicPolynomial, linear_d_exports as LinearPolynomial, quadratic_d_exports as QuadraticPolynomial };