curvy 2.0.0-alpha.4 → 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.
@@ -1,6 +1,6 @@
1
- import { n as Vector4 } from "../shared/vector3-3Xx7GVk7.mjs";
2
- import { t as Matrix4x4 } from "../shared/matrix4x4-CaytTaB_.mjs";
3
- import { t as CubicPolynomial } from "../shared/cubic-DkBqcZf-.mjs";
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
4
 
5
5
  //#region src/characteristic/characteristic.d.ts
6
6
  declare namespace characteristic_d_exports {
@@ -1,10 +1,2 @@
1
- import { i as LinearCurve2d$1, n as CubicCurve2d$1, r as QuadraticCurve2d$1, t as RationalCubicCurve2d$1 } from "../shared/rationalCubic2d-MgMSJaAU.mjs";
2
-
3
- //#region src/curve/index.d.ts
4
- type LinearCurve2d = LinearCurve2d$1;
5
- type QuadraticCurve2d = QuadraticCurve2d$1;
6
- type CubicCurve2d = CubicCurve2d$1;
7
- type RationalCubicCurve2d = RationalCubicCurve2d$1;
8
- //#endregion
9
- export { CubicCurve2d, LinearCurve2d, QuadraticCurve2d, RationalCubicCurve2d };
10
- //# sourceMappingURL=index.d.mts.map
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 };
@@ -1,9 +1,3 @@
1
- import { t as Interval$1 } from "../shared/interval-Bhzeqp8M.mjs";
2
- import { t as Interval2d$1 } from "../shared/interval2d-BMk5UYXD.mjs";
3
-
4
- //#region src/interval/index.d.ts
5
- type Interval = Interval$1;
6
- type Interval2d = Interval2d$1;
7
- //#endregion
8
- export { Interval, Interval2d };
9
- //# sourceMappingURL=index.d.mts.map
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 };
@@ -1,9 +1,2 @@
1
- import { n as Matrix3x3$1, r as Matrix2x2$1, t as Matrix4x4$1 } from "../shared/matrix4x4-CaytTaB_.mjs";
2
-
3
- //#region src/matrix/index.d.ts
4
- type Matrix2x2 = Matrix2x2$1;
5
- type Matrix3x3 = Matrix3x3$1;
6
- type Matrix4x4 = Matrix4x4$1;
7
- //#endregion
8
- export { Matrix2x2, Matrix3x3, Matrix4x4 };
9
- //# sourceMappingURL=index.d.mts.map
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 };
@@ -1,12 +1,16 @@
1
+ import { t as Vector2 } from "../shared/vector2-5GyA0jBj.mjs";
1
2
  import { t as Pipeable } from "../shared/utils-MCckigYk.mjs";
2
- import { i as LinearCurve2d, r as QuadraticCurve2d } from "../shared/rationalCubic2d-MgMSJaAU.mjs";
3
- import { n as CubicPath2d$1, r as PathTraits, t as RationalCubicPath2d$1 } from "../shared/rationalCubic2d-D-UevGKu.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";
4
7
 
5
8
  //#region src/path/linear2d.internal.d.ts
6
9
  declare const LinearPath2dTypeId: unique symbol;
7
10
  type LinearPath2dTypeId = typeof LinearPath2dTypeId;
8
- //#endregion
9
- //#region src/path/linear2d.d.ts
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
+ }
10
14
  /**
11
15
  * A linear path in 2D space.
12
16
  *
@@ -18,16 +22,125 @@ type LinearPath2dTypeId = typeof LinearPath2dTypeId;
18
22
  *
19
23
  * @since 1.0.0
20
24
  */
21
- interface LinearPath2d$1<out Trait = unknown> extends Pipeable, Iterable<LinearCurve2d> {
25
+ interface LinearPath2d<out Trait = unknown> extends Pipeable, Iterable<LinearCurve2d> {
22
26
  readonly [LinearPath2dTypeId]: LinearPath2dTypeId;
23
27
  readonly [PathTraits]: Trait;
24
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>;
25
137
  //#endregion
26
138
  //#region src/path/quadratic2d.internal.d.ts
27
139
  declare const QuadraticPath2dTypeId: unique symbol;
28
140
  type QuadraticPath2dTypeId = typeof QuadraticPath2dTypeId;
29
- //#endregion
30
- //#region src/path/quadratic2d.d.ts
141
+ declare namespace quadratic2d_d_exports {
142
+ export { Continuous, QuadraticPath2d, append, asContinuous, boundingBox, fromArray, isContinuous, isQuadraticPath2d, length, make, solve, toPathData };
143
+ }
31
144
  /**
32
145
  * A quadratic path in 2D space.
33
146
  *
@@ -38,16 +151,111 @@ type QuadraticPath2dTypeId = typeof QuadraticPath2dTypeId;
38
151
  *
39
152
  * @since 1.0.0
40
153
  */
41
- interface QuadraticPath2d$1<out Trait = unknown> extends Pipeable, Iterable<QuadraticCurve2d> {
154
+ interface QuadraticPath2d<out Trait = unknown> extends Pipeable, Iterable<QuadraticCurve2d> {
42
155
  readonly [QuadraticPath2dTypeId]: QuadraticPath2dTypeId;
43
156
  readonly [PathTraits]: Trait;
44
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>;
45
259
  //#endregion
46
- //#region src/path/index.d.ts
47
- type LinearPath2d = LinearPath2d$1;
48
- type QuadraticPath2d = QuadraticPath2d$1;
49
- type CubicPath2d = CubicPath2d$1;
50
- type RationalCubicPath2d = RationalCubicPath2d$1;
51
- //#endregion
52
- export { CubicPath2d, LinearPath2d, QuadraticPath2d, RationalCubicPath2d };
260
+ export { cubic2d_d_exports as CubicPath2d, linear2d_d_exports as LinearPath2d, quadratic2d_d_exports as QuadraticPath2d, rationalCubic2d_d_exports as RationalCubicPath2d };
53
261
  //# sourceMappingURL=index.d.mts.map
@@ -1,9 +1,2 @@
1
- import { n as QuadraticPolynomial$1, r as LinearPolynomial$1, t as CubicPolynomial$1 } from "../shared/cubic-DkBqcZf-.mjs";
2
-
3
- //#region src/polynomial/index.d.ts
4
- type LinearPolynomial = LinearPolynomial$1;
5
- type QuadraticPolynomial = QuadraticPolynomial$1;
6
- type CubicPolynomial = CubicPolynomial$1;
7
- //#endregion
8
- export { CubicPolynomial, LinearPolynomial, QuadraticPolynomial };
9
- //# sourceMappingURL=index.d.mts.map
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 };