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.
@@ -0,0 +1,308 @@
1
+ import { t as Vector2 } from "./vector2-5GyA0jBj.mjs";
2
+ import { t as Pipeable } from "./utils-MCckigYk.mjs";
3
+ import { n as Closed } from "./interval-CSntLeSX.mjs";
4
+ import { t as Interval2d } from "./interval2d-D42_0ka1.mjs";
5
+ import { r as CubicCurve2d, t as RationalCubicCurve2d } from "./rationalCubic2d-C1RBShBF.mjs";
6
+
7
+ //#region src/path/traits.d.ts
8
+ /**
9
+ * Trait brands for paths.
10
+ *
11
+ * Brands are phantom types — they exist only at the type level and carry no
12
+ * runtime data. Refiners (`isContinuous`) and assertions (`asContinuous`) on
13
+ * each path module attach these brands to the path's `Trait` parameter at the
14
+ * type level.
15
+ *
16
+ * @since 2.0.0
17
+ */
18
+ declare const ContinuousId: unique symbol;
19
+ /**
20
+ * Brand for paths whose adjacent curves connect at their join points (G⁰
21
+ * continuity). Calling `toPathData` on a `Continuous` path skips the
22
+ * per-segment discontinuity check and emits a single `M` followed by drawing
23
+ * commands.
24
+ *
25
+ * @since 2.0.0
26
+ */
27
+ type Continuous = {
28
+ readonly [ContinuousId]: 'continuous';
29
+ };
30
+ /**
31
+ * Phantom property key used by path interfaces to hold their `Trait` type
32
+ * parameter. The runtime object never has a value at this key.
33
+ *
34
+ * @since 2.0.0
35
+ */
36
+ declare const PathTraits: unique symbol;
37
+ type PathTraits = typeof PathTraits;
38
+ //#endregion
39
+ //#region src/path/cubic2d.internal.d.ts
40
+ declare const CubicPath2dTypeId: unique symbol;
41
+ type CubicPath2dTypeId = typeof CubicPath2dTypeId;
42
+ declare namespace cubic2d_d_exports {
43
+ export { Continuous, CubicPath2d, append$1 as append, asContinuous, boundingBox, fromArray$1 as fromArray, isContinuous, isCubicPath2d, length, make$1 as make, solve$1 as solve, solveByDistance, toPathData };
44
+ }
45
+ /**
46
+ * A cubic path in 2D space.
47
+ *
48
+ * All fields are readonly and immutable, and all operations create new instances.
49
+ *
50
+ * The `Trait` type parameter accumulates trait brands as the path is refined
51
+ * via `isContinuous` / `asContinuous`.
52
+ *
53
+ * @since 1.0.0
54
+ */
55
+ interface CubicPath2d<out Trait = unknown> extends Pipeable, Iterable<CubicCurve2d> {
56
+ readonly [CubicPath2dTypeId]: CubicPath2dTypeId;
57
+ readonly [PathTraits]: Trait;
58
+ }
59
+ /**
60
+ * Creates a new `CubicPath2d` instance from a sequence of curves.
61
+ *
62
+ * @param curves - The curves to create the path from.
63
+ * @returns A new `CubicPath2d` instance.
64
+ * @since 2.0.0
65
+ */
66
+ declare const make$1: (...curves: ReadonlyArray<CubicCurve2d>) => CubicPath2d;
67
+ /**
68
+ * Creates a new `CubicPath2d` instance from an array of curves.
69
+ *
70
+ * @param curves - The curves to create the path from.
71
+ * @returns A new `CubicPath2d` instance.
72
+ * @since 2.0.0
73
+ */
74
+ declare const fromArray$1: (curves: ReadonlyArray<CubicCurve2d>) => CubicPath2d;
75
+ /**
76
+ * Checks if a value is a `CubicPath2d`.
77
+ *
78
+ * @param p - The value to check.
79
+ * @returns `true` if the value is a `CubicPath2d`, `false` otherwise.
80
+ * @since 1.0.0
81
+ */
82
+ declare const isCubicPath2d: (p: unknown) => p is CubicPath2d;
83
+ declare const append$1: {
84
+ /**
85
+ * Appends a cubic curve to a cubic path.
86
+ *
87
+ * @param c - The cubic curve to append.
88
+ * @returns A function that takes a cubic path and returns a new cubic path.
89
+ * @since 1.0.0
90
+ */
91
+ (c: CubicCurve2d): (p: CubicPath2d) => CubicPath2d;
92
+ /**
93
+ * Appends a cubic curve to a cubic path.
94
+ *
95
+ * @param p - The cubic path to append to.
96
+ * @param c - The cubic curve to append.
97
+ * @returns A new cubic path.
98
+ * @since 1.0.0
99
+ */
100
+ (p: CubicPath2d, c: CubicCurve2d): CubicPath2d;
101
+ };
102
+ /**
103
+ * Calculates the length of a cubic path.
104
+ *
105
+ * @param p - The cubic path to calculate the length of.
106
+ * @returns The length of the cubic path.
107
+ * @since 1.0.0
108
+ */
109
+ declare const length: (p: CubicPath2d) => number;
110
+ declare const solve$1: {
111
+ /**
112
+ * Solves a cubic path for a given parameter.
113
+ *
114
+ * @param u - The parameter to solve for.
115
+ * @returns A function that takes a cubic path and returns the solved vector.
116
+ * @since 1.0.0
117
+ */
118
+ (u: number): (p: CubicPath2d) => Vector2;
119
+ /**
120
+ * Solves a cubic path for a given parameter.
121
+ *
122
+ * @param p - The cubic path to solve.
123
+ * @param u - The parameter to solve for.
124
+ * @returns The solved vector.
125
+ * @since 1.0.0
126
+ */
127
+ (p: CubicPath2d, u: number): Vector2;
128
+ };
129
+ /**
130
+ * Serializes a cubic path as an SVG path data string (the value of a `<path>`
131
+ * element's `d` attribute), using `M` and `C` commands. Discontinuities between
132
+ * curves emit a fresh `M` command.
133
+ *
134
+ * @param p - The cubic path to serialize.
135
+ * @returns The SVG path data string.
136
+ * @since 2.0.0
137
+ */
138
+ declare const toPathData: (p: CubicPath2d) => string;
139
+ /**
140
+ * Type-narrowing predicate: refines `CubicPath2d<T>` to
141
+ * `CubicPath2d<T & Continuous>` when adjacent curves connect.
142
+ *
143
+ * @since 2.0.0
144
+ */
145
+ declare const isContinuous: <T>(p: CubicPath2d<T>) => p is CubicPath2d<T & Continuous>;
146
+ /**
147
+ * Asserts that the cubic path is continuous, throwing on failure.
148
+ *
149
+ * @since 2.0.0
150
+ */
151
+ declare const asContinuous: <T>(p: CubicPath2d<T>) => CubicPath2d<T & Continuous>;
152
+ declare const solveByDistance: {
153
+ /**
154
+ * Solves a cubic path by normalized arc length. Unlike {@link solve}, which
155
+ * is parameterized by curve `u`, this samples points at constant speed along
156
+ * the path — `s = 0.5` returns the point exactly halfway along the curve by
157
+ * arc length, regardless of how the underlying parameterization stretches.
158
+ *
159
+ * Cumulative segment lengths are cached by path identity so repeated calls
160
+ * with the same path are fast.
161
+ *
162
+ * @param p - The cubic path to sample.
163
+ * @param s - Normalized arc length in `[0, 1]`. Values outside the range are
164
+ * clamped to path endpoints.
165
+ * @returns The point on the path at the given normalized arc length.
166
+ * @since 1.1.0
167
+ */
168
+ (p: CubicPath2d, s: number): Vector2;
169
+ /**
170
+ * Solves a cubic path by normalized arc length.
171
+ *
172
+ * @param s - Normalized arc length in `[0, 1]`.
173
+ * @returns A function that takes a cubic path and returns the point at that
174
+ * arc length.
175
+ * @since 1.1.0
176
+ */
177
+ (s: number): (p: CubicPath2d) => Vector2;
178
+ };
179
+ /**
180
+ * Computes the axis-aligned bounding box of the path — the smallest closed
181
+ * `Box2d` enclosing every segment.
182
+ *
183
+ * @param p - The cubic path.
184
+ * @returns A closed `Box2d` enclosing the path.
185
+ * @since 2.0.0
186
+ */
187
+ declare const boundingBox: (p: CubicPath2d) => Interval2d<Closed, Closed>;
188
+ //#endregion
189
+ //#region src/path/rationalCubic2d.internal.d.ts
190
+ declare const RationalCubicPath2dTypeId: unique symbol;
191
+ type RationalCubicPath2dTypeId = typeof RationalCubicPath2dTypeId;
192
+ declare namespace rationalCubic2d_d_exports {
193
+ export { RationalCubicPath2d, append, approximateAsCubicPath, fromArray, isRationalCubicPath2d, make, solve };
194
+ }
195
+ /**
196
+ * A rational cubic path in 2D space.
197
+ *
198
+ * Holds a non-empty sequence of `RationalCubicCurve2d` segments; iteration
199
+ * yields the segments in order. The path parameter `u ∈ [0, 1]` is mapped
200
+ * uniformly across segments — `u = 0` is the start of the first segment,
201
+ * `u = 1` is the end of the last segment, and intermediate values pick a
202
+ * segment by index and a local parameter within it.
203
+ *
204
+ * Counterpart to `CubicPath2d` for curves whose evaluation includes the
205
+ * homogeneous-to-plane projection.
206
+ *
207
+ * All fields are readonly and immutable, and all operations create new instances.
208
+ *
209
+ * @since 2.0.0
210
+ */
211
+ interface RationalCubicPath2d extends Pipeable, Iterable<RationalCubicCurve2d> {
212
+ readonly [RationalCubicPath2dTypeId]: RationalCubicPath2dTypeId;
213
+ }
214
+ /**
215
+ * Checks if a value is a `RationalCubicPath2d`.
216
+ *
217
+ * @param p - The value to check.
218
+ * @returns `true` if the value is a `RationalCubicPath2d`, `false` otherwise.
219
+ * @since 2.0.0
220
+ */
221
+ declare const isRationalCubicPath2d: (p: unknown) => p is RationalCubicPath2d;
222
+ /**
223
+ * Creates a new `RationalCubicPath2d` from a sequence of curves.
224
+ *
225
+ * @param curves - The curves to create the path from.
226
+ * @returns A new `RationalCubicPath2d` instance.
227
+ * @since 2.0.0
228
+ */
229
+ declare const make: (...curves: ReadonlyArray<RationalCubicCurve2d>) => RationalCubicPath2d;
230
+ /**
231
+ * Creates a new `RationalCubicPath2d` from an array of curves.
232
+ *
233
+ * @param curves - The curves to create the path from.
234
+ * @returns A new `RationalCubicPath2d` instance.
235
+ * @since 2.0.0
236
+ */
237
+ declare const fromArray: (curves: ReadonlyArray<RationalCubicCurve2d>) => RationalCubicPath2d;
238
+ declare const append: {
239
+ /**
240
+ * Appends a curve to a `RationalCubicPath2d`.
241
+ *
242
+ * @param c - The curve to append.
243
+ * @returns A function that takes a path and returns a new path with the appended curve.
244
+ * @since 2.0.0
245
+ */
246
+ (c: RationalCubicCurve2d): (p: RationalCubicPath2d) => RationalCubicPath2d;
247
+ /**
248
+ * Appends a curve to a `RationalCubicPath2d`.
249
+ *
250
+ * @param p - The path to append to.
251
+ * @param c - The curve to append.
252
+ * @returns A new path with the appended curve.
253
+ * @since 2.0.0
254
+ */
255
+ (p: RationalCubicPath2d, c: RationalCubicCurve2d): RationalCubicPath2d;
256
+ };
257
+ declare const solve: {
258
+ /**
259
+ * Evaluates the rational cubic path at parameter `u ∈ [0, 1]`.
260
+ *
261
+ * Picks the segment containing `u` (uniform mapping across segments) and
262
+ * delegates to `RationalCubicCurve2d.solve` on that segment with the local
263
+ * parameter.
264
+ *
265
+ * @param p - The path to evaluate.
266
+ * @param u - The path parameter in `[0, 1]`.
267
+ * @returns The point on the path at parameter `u`.
268
+ * @since 2.0.0
269
+ */
270
+ (p: RationalCubicPath2d, u: number): Vector2;
271
+ /**
272
+ * Evaluates the rational cubic path at parameter `u ∈ [0, 1]`.
273
+ *
274
+ * @param u - The path parameter in `[0, 1]`.
275
+ * @returns A function that takes a path and returns the point at `u`.
276
+ * @since 2.0.0
277
+ */
278
+ (u: number): (p: RationalCubicPath2d) => Vector2;
279
+ };
280
+ declare const approximateAsCubicPath: {
281
+ /**
282
+ * Approximates the rational cubic path as a `CubicPath2d` via per-segment
283
+ * recursive subdivision. Each input segment is split until its midpoint
284
+ * deviates from a polynomial-cubic candidate by at most `tolerance`; the
285
+ * surviving candidates are concatenated into a new path.
286
+ *
287
+ * Lossy in general — only exact when every input segment has uniform
288
+ * weights, in which case segment count is preserved. Tighter tolerance
289
+ * produces more segments.
290
+ *
291
+ * @param p - The rational cubic path to approximate.
292
+ * @param tolerance - Maximum allowed midpoint deviation per segment; must be positive.
293
+ * @returns A new `CubicPath2d` approximating the input.
294
+ * @since 2.0.0
295
+ */
296
+ (p: RationalCubicPath2d, tolerance: number): CubicPath2d;
297
+ /**
298
+ * Approximates the rational cubic path as a `CubicPath2d`.
299
+ *
300
+ * @param tolerance - Maximum allowed midpoint deviation per segment; must be positive.
301
+ * @returns A function that takes a rational path and returns its approximation.
302
+ * @since 2.0.0
303
+ */
304
+ (tolerance: number): (p: RationalCubicPath2d) => CubicPath2d;
305
+ };
306
+ //#endregion
307
+ export { Continuous as a, cubic2d_d_exports as i, rationalCubic2d_d_exports as n, PathTraits as o, CubicPath2d as r, RationalCubicPath2d as t };
308
+ //# sourceMappingURL=rationalCubic2d-DFFvp5S1.d.mts.map
@@ -0,0 +1,271 @@
1
+ import { t as Pipeable } from "./utils-MCckigYk.mjs";
2
+ import { r as Interval } from "./interval-CSntLeSX.mjs";
3
+
4
+ //#region src/solution/solution.d.ts
5
+ declare namespace solution_d_exports {
6
+ export { AtMostOne, AtMostThree, AtMostTwo, None, One, Solution, Some, Three, Two, clip, filter, fromArray, isNone, isSome, last, map, match, max, min, none, one, three, two, unsafeLast, unsafeMax, unsafeMin, unsafeValue, valueOrUndefined };
7
+ }
8
+ /**
9
+ * A `Solution<T>` represents the result of an operation that may produce
10
+ * between zero and three values of `T`. It generalizes the zoo of "0 or 1",
11
+ * "0 to 2", "0 to 3" return shapes used throughout curvy under one type, and
12
+ * provides a small namespace of operations (`value`, `last`, `min`, `max`,
13
+ * `filter`, `map`, `match`, …) for working with the result.
14
+ *
15
+ * Each variant carries a `_tag` discriminator and a `length` field, is
16
+ * iterable via `Symbol.iterator` (so existing `for..of` and spread patterns
17
+ * keep working), and is `Pipeable` (so a `Solution` value can be the head of
18
+ * a `pipe` chain).
19
+ *
20
+ * Variant-specific accessors:
21
+ * - `One<T>`, `Two<T>`, and `Three<T>` all expose `.value: T` (the first /
22
+ * primary value).
23
+ * - `Two<T>` and `Three<T>` additionally expose `.values: readonly [T, ...]`
24
+ * for explicit positional access.
25
+ *
26
+ * Operations that return narrower cardinalities (e.g. inverse-solving a
27
+ * monotonic polynomial) use the `AtMost{One,Two,Three}` aliases to express
28
+ * "this could be empty, but it'll have at most N values."
29
+ *
30
+ * @since 2.0.0
31
+ */
32
+ type Solution<T> = None | One<T> | Two<T> | Three<T>;
33
+ /**
34
+ * The empty solution.
35
+ *
36
+ * @since 2.0.0
37
+ */
38
+ interface None extends Pipeable, Iterable<never> {
39
+ readonly _tag: 'none';
40
+ readonly length: 0;
41
+ }
42
+ /** @since 2.0.0 */
43
+ interface One<T> extends Pipeable, Iterable<T> {
44
+ readonly _tag: 'one';
45
+ readonly length: 1;
46
+ readonly value: T;
47
+ }
48
+ /** @since 2.0.0 */
49
+ interface Two<T> extends Pipeable, Iterable<T> {
50
+ readonly _tag: 'two';
51
+ readonly length: 2;
52
+ readonly value: T;
53
+ readonly values: readonly [T, T];
54
+ }
55
+ /** @since 2.0.0 */
56
+ interface Three<T> extends Pipeable, Iterable<T> {
57
+ readonly _tag: 'three';
58
+ readonly length: 3;
59
+ readonly value: T;
60
+ readonly values: readonly [T, T, T];
61
+ }
62
+ /**
63
+ * Any non-empty solution. All `Some<T>` values expose `.value: T` directly —
64
+ * no narrowing required to read the primary value.
65
+ *
66
+ * @since 2.0.0
67
+ */
68
+ type Some<T> = One<T> | Two<T> | Three<T>;
69
+ /**
70
+ * `None | One<T>` — return type of operations that produce at most one value
71
+ * (e.g. inverse-solving a strictly monotonic polynomial).
72
+ *
73
+ * @since 2.0.0
74
+ */
75
+ type AtMostOne<T> = None | One<T>;
76
+ /**
77
+ * `None | One<T> | Two<T>` — return type of operations that produce at most
78
+ * two values (e.g. inverse-solving an unrestricted quadratic polynomial).
79
+ *
80
+ * @since 2.0.0
81
+ */
82
+ type AtMostTwo<T> = None | One<T> | Two<T>;
83
+ /**
84
+ * `None | One<T> | Two<T> | Three<T>` — equivalent to `Solution<T>`.
85
+ *
86
+ * @since 2.0.0
87
+ */
88
+ type AtMostThree<T> = Solution<T>;
89
+ /**
90
+ * The empty solution. Reused across calls — never reallocated.
91
+ *
92
+ * @since 2.0.0
93
+ */
94
+ declare const none: None;
95
+ /**
96
+ * Constructs a single-value solution.
97
+ *
98
+ * @since 2.0.0
99
+ */
100
+ declare const one: <T>(value: T) => One<T>;
101
+ /**
102
+ * Constructs a two-value solution.
103
+ *
104
+ * @since 2.0.0
105
+ */
106
+ declare const two: <T>(a: T, b: T) => Two<T>;
107
+ /**
108
+ * Constructs a three-value solution.
109
+ *
110
+ * @since 2.0.0
111
+ */
112
+ declare const three: <T>(a: T, b: T, c: T) => Three<T>;
113
+ /**
114
+ * Constructs a `Solution<T>` from a runtime array. Throws if the array has
115
+ * more than three elements.
116
+ *
117
+ * @since 2.0.0
118
+ */
119
+ declare const fromArray: <T>(arr: ReadonlyArray<T>) => Solution<T>;
120
+ /**
121
+ * Type-narrowing predicate: refines `Solution<T>` to `None`.
122
+ *
123
+ * @since 2.0.0
124
+ */
125
+ declare const isNone: <T>(s: Solution<T>) => s is None;
126
+ /**
127
+ * Type-narrowing predicate: refines `Solution<T>` to `Some<T>` (non-empty).
128
+ * After narrowing, `.value` is directly accessible without further checks.
129
+ *
130
+ * @since 2.0.0
131
+ */
132
+ declare const isSome: <T>(s: Solution<T>) => s is Some<T>;
133
+ /**
134
+ * Returns the primary (first) value if the solution is non-empty, or
135
+ * `undefined` if empty. Pair with `.value` access on `Some<T>`-narrowed
136
+ * inputs to avoid the `undefined` possibility.
137
+ *
138
+ * @since 2.0.0
139
+ */
140
+ declare const valueOrUndefined: <T>(s: Solution<T>) => T | undefined;
141
+ /**
142
+ * Returns the last value in the solution, or `undefined` if empty. When
143
+ * called on a `Some<T>`, the result is guaranteed to be `T`.
144
+ *
145
+ * @since 2.0.0
146
+ */
147
+ declare const last: {
148
+ <T>(s: Some<T>): T;
149
+ <T>(s: Solution<T>): T | undefined;
150
+ };
151
+ /**
152
+ * Returns the smallest numeric value in the solution, or `undefined` if empty.
153
+ * When called on a `Some<number>`, the result is guaranteed to be `number`.
154
+ *
155
+ * @since 2.0.0
156
+ */
157
+ declare const min: {
158
+ (s: Some<number>): number;
159
+ (s: Solution<number>): number | undefined;
160
+ };
161
+ /**
162
+ * Returns the largest numeric value in the solution, or `undefined` if empty.
163
+ * When called on a `Some<number>`, the result is guaranteed to be `number`.
164
+ *
165
+ * @since 2.0.0
166
+ */
167
+ declare const max: {
168
+ (s: Some<number>): number;
169
+ (s: Solution<number>): number | undefined;
170
+ };
171
+ /**
172
+ * Returns the primary value of the solution (i.e. `s.value`). Throws on
173
+ * `None`, optionally with a caller-provided message.
174
+ *
175
+ * Useful when the type system can't prove non-emptiness but you have a domain
176
+ * reason to assert it — e.g. inverting a polynomial you know to be monotonic
177
+ * without going through the trait refiner first:
178
+ *
179
+ * ```ts
180
+ * const x = CubicPolynomial.solveInverse(p, y).pipe(
181
+ * Solution.unsafeValue('expected a monotonic inverse'),
182
+ * )
183
+ * ```
184
+ *
185
+ * @since 2.0.0
186
+ */
187
+ declare const unsafeValue: {
188
+ <T>(s: Solution<T>, message?: string): T;
189
+ (message: string): <T>(s: Solution<T>) => T;
190
+ };
191
+ /**
192
+ * Returns the last value in the solution. Throws if empty.
193
+ *
194
+ * @since 2.0.0
195
+ */
196
+ declare const unsafeLast: <T>(s: Solution<T>) => T;
197
+ /**
198
+ * Returns the smallest numeric value in the solution. Throws on empty.
199
+ *
200
+ * @since 2.0.0
201
+ */
202
+ declare const unsafeMin: (s: Solution<number>) => number;
203
+ /**
204
+ * Returns the largest numeric value in the solution. Throws on empty.
205
+ *
206
+ * @since 2.0.0
207
+ */
208
+ declare const unsafeMax: (s: Solution<number>) => number;
209
+ /**
210
+ * Filters the solution by a predicate. Result cardinality is at most that of
211
+ * the input.
212
+ *
213
+ * @since 2.0.0
214
+ */
215
+ declare const filter: <T>(s: Solution<T>, predicate: (v: T) => boolean) => Solution<T>;
216
+ /**
217
+ * Restricts the solution to values contained within an interval. Endpoint
218
+ * inclusivity follows the interval's `kind` — pass an open variant (e.g.
219
+ * `Interval.makeOpen(0, 1)` or `Interval.unitOpen`) for strict containment.
220
+ *
221
+ * @param s - The solution to clip.
222
+ * @param i - The interval to retain values within.
223
+ * @since 2.0.0
224
+ */
225
+ declare const clip: {
226
+ (i: Interval): (s: Solution<number>) => Solution<number>;
227
+ (s: Solution<number>, i: Interval): Solution<number>;
228
+ };
229
+ /**
230
+ * Maps every value in the solution to a new value. Result cardinality matches
231
+ * the input.
232
+ *
233
+ * @since 2.0.0
234
+ */
235
+ declare const map: {
236
+ <A, B>(s: Solution<A>, f: (v: A) => B): Solution<B>;
237
+ <A, B>(f: (v: A) => B): (s: Solution<A>) => Solution<B>;
238
+ };
239
+ type SomeOf<S> = S extends None ? never : S;
240
+ /**
241
+ * Pattern matches on a solution, calling `onNone` for the empty case and
242
+ * `onSome` for any non-empty case. The `onSome` parameter is typed against
243
+ * the input's narrowed shape — for an `AtMostOne<T>` input, `onSome` receives
244
+ * `One<T>` and can read `.value` directly.
245
+ *
246
+ * @example
247
+ * ```ts
248
+ * const result = polynomial.pipe(
249
+ * LinearPolynomial.solveInverse(0),
250
+ * Solution.match({
251
+ * onNone: () => null,
252
+ * onSome: ({ value }) => Math.abs(value),
253
+ * }),
254
+ * )
255
+ * ```
256
+ *
257
+ * @since 2.0.0
258
+ */
259
+ declare const match: {
260
+ <S extends Solution<unknown>, A, B>(self: S, matcher: {
261
+ readonly onNone: () => A;
262
+ readonly onSome: (s: SomeOf<S>) => B;
263
+ }): A | B;
264
+ <S extends Solution<unknown>, A, B>(matcher: {
265
+ readonly onNone: () => A;
266
+ readonly onSome: (s: SomeOf<S>) => B;
267
+ }): (self: S) => A | B;
268
+ };
269
+ //#endregion
270
+ export { solution_d_exports as a, One as i, AtMostThree as n, AtMostTwo as r, AtMostOne as t };
271
+ //# sourceMappingURL=solution-Cf_zoKFU.d.mts.map