@mark1russell7/vex-domains 0.13.2 → 0.13.4
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.
- package/build/index.d.ts +1 -18
- package/build/index.d.ts.map +1 -1
- package/build/index.js +9 -18
- package/build/index.js.map +1 -1
- package/package.json +2 -2
package/build/index.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { Domain, FnOp, OpTable } from "@mark1russell7/vex";
|
|
2
|
-
//#region src/vec2.d.ts
|
|
3
2
|
/**
|
|
4
3
|
* An immutable 2D vector. The methods live on the prototype, so a vector costs two numbers. Division is real
|
|
5
4
|
* division: a division by zero gives an infinite component, and the domain check turns it into `#NUM!`.
|
|
@@ -94,8 +93,6 @@ export type Vec2Ops = OpTable<Vec2, Vec2OpNames, "add" | "subtract" | "multiply"
|
|
|
94
93
|
};
|
|
95
94
|
/** The domain of 2D vectors. A number argument of a component-wise op lifts to a vector with that value twice. */
|
|
96
95
|
export declare const Vec2Domain: Domain<"Vec2", Vec2, Vec2Ops>;
|
|
97
|
-
//#endregion
|
|
98
|
-
//#region src/xy.d.ts
|
|
99
96
|
/**
|
|
100
97
|
* A 2D vector as plain data. `XYDomain` has the component-wise ops of `Vec2Domain`, but each op is a function of plain
|
|
101
98
|
* data. Thus a standalone module of `@mark1russell7/vex-compiler` can copy the domain, and a 2D program can be a module.
|
|
@@ -136,8 +133,6 @@ export type XYOps = {
|
|
|
136
133
|
* `NumRecordDomain`, because a record of numbers accepts the same objects.
|
|
137
134
|
*/
|
|
138
135
|
export declare const XYDomain: Domain<"XY", XY, XYOps>;
|
|
139
|
-
//#endregion
|
|
140
|
-
//#region src/ndvector.d.ts
|
|
141
136
|
/**
|
|
142
137
|
* An immutable vector with named components. The type parameter `K` is the set of component names. Ops that
|
|
143
138
|
* combine two vectors use the union of their names, and a missing component counts as 0. The constructor
|
|
@@ -208,8 +203,6 @@ export type NumRecordOps = {
|
|
|
208
203
|
};
|
|
209
204
|
/** The domain of plain number records. Its op `toNDVector` builds a vector from fields, for example from `rec()`. */
|
|
210
205
|
export declare const NumRecordDomain: Domain<"NumRecord", NumRecord, NumRecordOps>;
|
|
211
|
-
//#endregion
|
|
212
|
-
//#region src/date.d.ts
|
|
213
206
|
/** The largest distance from 1970-01-01 in days. The `Date` of JavaScript has the same range. */
|
|
214
207
|
export declare const MAX_DAYS = 1e8;
|
|
215
208
|
/**
|
|
@@ -263,8 +256,6 @@ export type DateOps = OpTable<LocalDate, "add" | "subtract" | "addMonths" | "end
|
|
|
263
256
|
* count of days. A valid date is a whole count of days, within `MAX_DAYS` of 1970-01-01.
|
|
264
257
|
*/
|
|
265
258
|
export declare const DateDomain: Domain<"Date", LocalDate, DateOps>;
|
|
266
|
-
//#endregion
|
|
267
|
-
//#region src/scalars.d.ts
|
|
268
259
|
type NumFn1 = (a: number) => number;
|
|
269
260
|
type NumFn2 = (a: number, b: number) => number;
|
|
270
261
|
type NumFn3 = (a: number, b: number, c: number) => number;
|
|
@@ -316,8 +307,6 @@ export type BoolOps = {
|
|
|
316
307
|
};
|
|
317
308
|
/** The domain of booleans. For lazy logic, use the special forms `and`, `or` and `if` of the IR. */
|
|
318
309
|
export declare const BoolDomain: Domain<"Bool", boolean, BoolOps>;
|
|
319
|
-
//#endregion
|
|
320
|
-
//#region src/text.d.ts
|
|
321
310
|
type TextFn1 = (a: string) => string;
|
|
322
311
|
/** The ops of `TextDomain`. */
|
|
323
312
|
export type TextOps = {
|
|
@@ -331,8 +320,6 @@ export type TextOps = {
|
|
|
331
320
|
};
|
|
332
321
|
/** The domain of texts. */
|
|
333
322
|
export declare const TextDomain: Domain<"Text", string, TextOps>;
|
|
334
|
-
//#endregion
|
|
335
|
-
//#region src/color.d.ts
|
|
336
323
|
/**
|
|
337
324
|
* An immutable RGBA color. The channels have no fixed range: use `clamp` to limit them. `add` adds the color
|
|
338
325
|
* channels and keeps the larger alpha, so `add` is commutative and associative.
|
|
@@ -372,8 +359,6 @@ export declare class Color {
|
|
|
372
359
|
export type ColorOps = OpTable<Color, "add" | "multiply" | "clamp" | "mix" | "luminance" | "relativeLuminance" | "contrast" | "equals">;
|
|
373
360
|
/** The domain of colors. */
|
|
374
361
|
export declare const ColorDomain: Domain<"Color", Color, ColorOps>;
|
|
375
|
-
//#endregion
|
|
376
|
-
//#region src/angle.d.ts
|
|
377
362
|
/** An immutable angle in radians. */
|
|
378
363
|
export declare class Angle {
|
|
379
364
|
readonly radians: number;
|
|
@@ -398,8 +383,6 @@ export declare class Angle {
|
|
|
398
383
|
export type AngleOps = OpTable<Angle, "add" | "subtract" | "scale" | "normalize" | "toVec2" | "sin" | "cos" | "degrees", "add" | "subtract">;
|
|
399
384
|
/** The domain of angles. A number argument of `add` or `subtract` lifts to an angle in radians. */
|
|
400
385
|
export declare const AngleDomain: Domain<"Angle", Angle, AngleOps>;
|
|
401
|
-
//#endregion
|
|
402
|
-
//#region src/wrappers.d.ts
|
|
403
386
|
/** A wrapper around a function. Its op `invoke` calls the function. It shows how a domain can hold behavior. */
|
|
404
387
|
export declare class Fn {
|
|
405
388
|
readonly fn: (...args: never[]) => unknown;
|
|
@@ -429,5 +412,5 @@ export declare class Maybe<T> {
|
|
|
429
412
|
export type MaybeOps = OpTable<Maybe<unknown>, "isTop" | "isBottom" | "map" | "chain" | "valueOr">;
|
|
430
413
|
/** The domain of `Maybe` values. */
|
|
431
414
|
export declare const MaybeDomain: Domain<"Maybe", Maybe<unknown>, MaybeOps>;
|
|
432
|
-
|
|
415
|
+
export {};
|
|
433
416
|
//# sourceMappingURL=index.d.ts.map
|
package/build/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","names":[],"sources":["../src/vec2.ts","../src/xy.ts","../src/ndvector.ts","../src/date.ts","../src/scalars.ts","../src/text.ts","../src/color.ts","../src/angle.ts","../src/wrappers.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../src/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;qBAU3B,MAAM;;UAIT;SAID,IAAI,GAAG,OAAO,IAAI,MAAM;SAGxB,OAAO,cAAc,MAAM;EAGlC;EAGA;EAGA,IAAI,GAAG,IAAI,OAAO,MAAM,IAAI,MAAM;EAGlC,MAAM,GAAG,IAAI,OAAO,MAAM,MAAM,KAAK,MAAM;EAG3C,QAAQ,GAAG,UAAU,IAAI,IAAI;;;YAMnB,WAAW,QAAQ;;qBAGlB,aAAa,gBAAgB,gBAAgB"}
|
package/build/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineDomain } from "@mark1russell7/vex";
|
|
2
|
-
|
|
2
|
+
// src/vec2.ts
|
|
3
3
|
/**
|
|
4
4
|
* An immutable 2D vector. The methods live on the prototype, so a vector costs two numbers. Division is real
|
|
5
5
|
* division: a division by zero gives an infinite component, and the domain check turns it into `#NUM!`.
|
|
@@ -406,8 +406,7 @@ const Vec2Domain = defineDomain({
|
|
|
406
406
|
}
|
|
407
407
|
}
|
|
408
408
|
});
|
|
409
|
-
|
|
410
|
-
//#region src/xy.ts
|
|
409
|
+
// src/xy.ts
|
|
411
410
|
/**
|
|
412
411
|
* The domain of 2D vectors as plain data: an object with the two number fields `x` and `y` and no other field. The op
|
|
413
412
|
* `xy` of `NumDomain` makes one. No op lifts a number, so each op has a static site in a module. Put `XYDomain` before
|
|
@@ -594,8 +593,7 @@ const XYDomain = defineDomain({
|
|
|
594
593
|
}
|
|
595
594
|
}
|
|
596
595
|
});
|
|
597
|
-
|
|
598
|
-
//#region src/ndvector.ts
|
|
596
|
+
// src/ndvector.ts
|
|
599
597
|
/**
|
|
600
598
|
* An immutable vector with named components. The type parameter `K` is the set of component names. Ops that
|
|
601
599
|
* combine two vectors use the union of their names, and a missing component counts as 0. The constructor
|
|
@@ -819,8 +817,7 @@ const NumRecordDomain = defineDomain({
|
|
|
819
817
|
is: isNumRecord,
|
|
820
818
|
ops: { toNDVector: { fn: (r) => new NDVector(r) } }
|
|
821
819
|
});
|
|
822
|
-
|
|
823
|
-
//#region src/date.ts
|
|
820
|
+
// src/date.ts
|
|
824
821
|
const MS_PER_DAY = 864e5;
|
|
825
822
|
/** The largest distance from 1970-01-01 in days. The `Date` of JavaScript has the same range. */
|
|
826
823
|
const MAX_DAYS = 1e8;
|
|
@@ -953,8 +950,7 @@ const DateDomain = defineDomain({
|
|
|
953
950
|
}
|
|
954
951
|
}
|
|
955
952
|
});
|
|
956
|
-
|
|
957
|
-
//#region src/scalars.ts
|
|
953
|
+
// src/scalars.ts
|
|
958
954
|
/** The domain of numbers. A result that is not a finite number is the error `#NUM!`. */
|
|
959
955
|
const NumDomain = defineDomain({
|
|
960
956
|
name: "Num",
|
|
@@ -1168,8 +1164,7 @@ const BoolDomain = defineDomain({
|
|
|
1168
1164
|
}
|
|
1169
1165
|
}
|
|
1170
1166
|
});
|
|
1171
|
-
|
|
1172
|
-
//#region src/text.ts
|
|
1167
|
+
// src/text.ts
|
|
1173
1168
|
/**
|
|
1174
1169
|
* The domain of texts. The op `concat` joins a text and a value of any kind. It is the operator `&` of a
|
|
1175
1170
|
* spreadsheet, and of the formula language of the sheet app.
|
|
@@ -1220,8 +1215,7 @@ const TextDomain = defineDomain({
|
|
|
1220
1215
|
}
|
|
1221
1216
|
}
|
|
1222
1217
|
});
|
|
1223
|
-
|
|
1224
|
-
//#region src/color.ts
|
|
1218
|
+
// src/color.ts
|
|
1225
1219
|
/** The linear value of an sRGB channel from 0 to 255, with the sRGB transfer function of WCAG 2.1. */
|
|
1226
1220
|
function linear(channel) {
|
|
1227
1221
|
const s = Math.min(1, Math.max(0, channel / 255));
|
|
@@ -1331,8 +1325,7 @@ const ColorDomain = defineDomain({
|
|
|
1331
1325
|
}
|
|
1332
1326
|
}
|
|
1333
1327
|
});
|
|
1334
|
-
|
|
1335
|
-
//#region src/angle.ts
|
|
1328
|
+
// src/angle.ts
|
|
1336
1329
|
/** An immutable angle in radians. */
|
|
1337
1330
|
var Angle = class Angle {
|
|
1338
1331
|
radians;
|
|
@@ -1404,8 +1397,7 @@ const AngleDomain = defineDomain({
|
|
|
1404
1397
|
degrees: {}
|
|
1405
1398
|
}
|
|
1406
1399
|
});
|
|
1407
|
-
|
|
1408
|
-
//#region src/wrappers.ts
|
|
1400
|
+
// src/wrappers.ts
|
|
1409
1401
|
/** A wrapper around a function. Its op `invoke` calls the function. It shows how a domain can hold behavior. */
|
|
1410
1402
|
var Fn = class {
|
|
1411
1403
|
fn;
|
|
@@ -1467,7 +1459,6 @@ const MaybeDomain = defineDomain({
|
|
|
1467
1459
|
valueOr: {}
|
|
1468
1460
|
}
|
|
1469
1461
|
});
|
|
1470
|
-
//#endregion
|
|
1471
1462
|
export { Angle, AngleDomain, BoolDomain, Color, ColorDomain, DateDomain, Fn, FnDomain, LiftedNDVectorDomain, LocalDate, MAX_DAYS, Maybe, MaybeDomain, NDVector, NDVectorDomain, NumDomain, NumRecordDomain, TextDomain, Vec2, Vec2Domain, XYDomain };
|
|
1472
1463
|
|
|
1473
1464
|
//# sourceMappingURL=index.js.map
|
package/build/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../src/vec2.ts","../src/xy.ts","../src/ndvector.ts","../src/date.ts","../src/scalars.ts","../src/text.ts","../src/color.ts","../src/angle.ts","../src/wrappers.ts"],"sourcesContent":["import { defineDomain, type Domain, type FnOp, type OpTable } from \"@mark1russell7/vex\";\n\n/**\n * An immutable 2D vector. The methods live on the prototype, so a vector costs two numbers. Division is real\n * division: a division by zero gives an infinite component, and the domain check turns it into `#NUM!`.\n */\nexport class Vec2 {\n readonly x: number;\n readonly y: number;\n\n constructor(x: number, y: number) {\n this.x = x;\n this.y = y;\n }\n\n /** This function makes a vector. */\n static of(x: number, y: number): Vec2 {\n return new Vec2(x, y);\n }\n /** This function makes a vector with the same value in both components. */\n static scalar(n: number): Vec2 {\n return new Vec2(n, n);\n }\n /** The zero vector. */\n static readonly zero: Vec2 = new Vec2(0, 0);\n /** The vector of ones. */\n static readonly one: Vec2 = new Vec2(1, 1);\n\n add(o: Vec2): Vec2 {\n return new Vec2(this.x + o.x, this.y + o.y);\n }\n subtract(o: Vec2): Vec2 {\n return new Vec2(this.x - o.x, this.y - o.y);\n }\n /** The component-wise product. */\n multiply(o: Vec2): Vec2 {\n return new Vec2(this.x * o.x, this.y * o.y);\n }\n /** The component-wise quotient. A zero component of `o` gives an infinite component. */\n divide(o: Vec2): Vec2 {\n return new Vec2(this.x / o.x, this.y / o.y);\n }\n /** The component-wise minimum. */\n min(o: Vec2): Vec2 {\n return new Vec2(Math.min(this.x, o.x), Math.min(this.y, o.y));\n }\n /** The component-wise maximum. */\n max(o: Vec2): Vec2 {\n return new Vec2(Math.max(this.x, o.x), Math.max(this.y, o.y));\n }\n scale(k: number): Vec2 {\n return new Vec2(this.x * k, this.y * k);\n }\n negate(): Vec2 {\n return new Vec2(-this.x, -this.y);\n }\n halve(): Vec2 {\n return this.scale(0.5);\n }\n abs(): Vec2 {\n return new Vec2(Math.abs(this.x), Math.abs(this.y));\n }\n round(): Vec2 {\n return new Vec2(Math.round(this.x), Math.round(this.y));\n }\n floor(): Vec2 {\n return new Vec2(Math.floor(this.x), Math.floor(this.y));\n }\n ceil(): Vec2 {\n return new Vec2(Math.ceil(this.x), Math.ceil(this.y));\n }\n clamp(lo: number, hi: number): Vec2 {\n return new Vec2(Math.min(hi, Math.max(lo, this.x)), Math.min(hi, Math.max(lo, this.y)));\n }\n swap(): Vec2 {\n return new Vec2(this.y, this.x);\n }\n /**\n * The vector with `main` along the unit axis of this vector and `cross` on the other axis: `this * main + swap(this) *\n * cross`. For the axis (1, 0) it is (main, cross), and for the axis (0, 1) it is (cross, main).\n */\n compose(main: number, cross: number): Vec2 {\n return new Vec2(this.x * main + this.y * cross, this.y * main + this.x * cross);\n }\n /**\n * The component-wise choice: a component of `a` where this mask has a component that is not 0, else the component\n * of `b`. Thus `hi.select(v.min(hi), v)` bounds each component of `v` by `hi`, and a 0 in `hi` sets no bound.\n */\n select(a: Vec2, b: Vec2): Vec2 {\n return new Vec2(this.x !== 0 ? a.x : b.x, this.y !== 0 ? a.y : b.y);\n }\n /** The vector turned by `radians`, counterclockwise. */\n rotate(radians: number): Vec2 {\n const c = Math.cos(radians);\n const s = Math.sin(radians);\n return new Vec2(c * this.x - s * this.y, s * this.x + c * this.y);\n }\n /** The vector with length 1. The zero vector stays zero. */\n normalize(): Vec2 {\n const len = this.length();\n return len === 0 ? this : this.scale(1 / len);\n }\n /** The linear interpolation from this vector to `o`. */\n lerp(o: Vec2, t: number): Vec2 {\n return new Vec2(this.x + (o.x - this.x) * t, this.y + (o.y - this.y) * t);\n }\n length(): number {\n return Math.hypot(this.x, this.y);\n }\n lengthSq(): number {\n return this.x * this.x + this.y * this.y;\n }\n distance(o: Vec2): number {\n return Math.hypot(this.x - o.x, this.y - o.y);\n }\n dot(o: Vec2): number {\n return this.x * o.x + this.y * o.y;\n }\n /** The component along the unit axis `dir`: `dot(this, dir)`. For the axis (1, 0) it is x, and for (0, 1) it is y. */\n along(dir: Vec2): number {\n return this.x * dir.x + this.y * dir.y;\n }\n /** The component on the other axis of the unit axis `dir`: `dot(this, swap(dir))`. For the axis (1, 0) it is y. */\n across(dir: Vec2): number {\n return this.x * dir.y + this.y * dir.x;\n }\n /** The z component of the 3D cross product. */\n cross(o: Vec2): number {\n return this.x * o.y - this.y * o.x;\n }\n /** The angle of the vector, in radians, from the x axis. */\n angle(): number {\n return Math.atan2(this.y, this.x);\n }\n /** The product of the components: the area of a size vector. */\n area(): number {\n return this.x * this.y;\n }\n /** The sum of the components. */\n sum(): number {\n return this.x + this.y;\n }\n minComponent(): number {\n return Math.min(this.x, this.y);\n }\n maxComponent(): number {\n return Math.max(this.x, this.y);\n }\n equals(o: Vec2): boolean {\n return this.x === o.x && this.y === o.y;\n }\n anyNonPositive(): boolean {\n return this.x <= 0 || this.y <= 0;\n }\n allPositive(): boolean {\n return this.x > 0 && this.y > 0;\n }\n anyNegative(): boolean {\n return this.x < 0 || this.y < 0;\n }\n allNonNegative(): boolean {\n return this.x >= 0 && this.y >= 0;\n }\n anyZero(): boolean {\n return this.x === 0 || this.y === 0;\n }\n allZero(): boolean {\n return this.x === 0 && this.y === 0;\n }\n anyLessThan(n: number): boolean {\n return this.x < n || this.y < n;\n }\n allLessThan(n: number): boolean {\n return this.x < n && this.y < n;\n }\n anyGreaterThan(n: number): boolean {\n return this.x > n || this.y > n;\n }\n allGreaterThan(n: number): boolean {\n return this.x > n && this.y > n;\n }\n toJSON(): { readonly x: number; readonly y: number } {\n return { x: this.x, y: this.y };\n }\n toString(): string {\n return `(${this.x}, ${this.y})`;\n }\n}\n\ntype Vec2OpNames =\n | \"add\" | \"subtract\" | \"multiply\" | \"divide\" | \"min\" | \"max\" | \"scale\" | \"negate\" | \"halve\" | \"abs\" | \"round\"\n | \"floor\" | \"ceil\" | \"clamp\" | \"swap\" | \"compose\" | \"select\" | \"rotate\" | \"normalize\" | \"lerp\" | \"length\"\n | \"lengthSq\" | \"distance\" | \"dot\" | \"along\" | \"across\" | \"cross\" | \"angle\" | \"area\" | \"sum\" | \"minComponent\"\n | \"maxComponent\" | \"equals\" | \"anyNonPositive\" | \"allPositive\" | \"anyNegative\" | \"allNonNegative\" | \"anyZero\"\n | \"allZero\" | \"anyLessThan\" | \"allLessThan\" | \"anyGreaterThan\" | \"allGreaterThan\";\n\n/** The ops of `Vec2Domain`. The ops `x` and `y` give a component. */\nexport type Vec2Ops = OpTable<Vec2, Vec2OpNames, \"add\" | \"subtract\" | \"multiply\" | \"divide\" | \"min\" | \"max\" | \"select\"> & {\n readonly x: FnOp<Vec2, (v: Vec2) => number>;\n readonly y: FnOp<Vec2, (v: Vec2) => number>;\n};\n\n/** The domain of 2D vectors. A number argument of a component-wise op lifts to a vector with that value twice. */\nexport const Vec2Domain: Domain<\"Vec2\", Vec2, Vec2Ops> = defineDomain<\"Vec2\", Vec2, Vec2Ops>({\n name: \"Vec2\",\n is: (u: unknown): u is Vec2 => u instanceof Vec2,\n fromScalar: (n: number): Vec2 => Vec2.scalar(n),\n valid: (v: Vec2): boolean => Number.isFinite(v.x) && Number.isFinite(v.y),\n show: (v: Vec2): string => v.toString(),\n encode: (v: Vec2): readonly [number, number] => [v.x, v.y],\n decode: (u: unknown): Vec2 => {\n // Stryker disable next-line ArrayDeclaration: a list with a text gives NaN components, like the empty list\n const [x, y] = Array.isArray(u) ? (u as readonly unknown[]) : [];\n return new Vec2(typeof x === \"number\" ? x : Number.NaN, typeof y === \"number\" ? y : Number.NaN);\n },\n ops: {\n // The components are fields of a vector, not methods, so these two ops are functions.\n x: { fn: (v: Vec2): number => v.x, params: [], returns: \"number\" },\n y: { fn: (v: Vec2): number => v.y, params: [], returns: \"number\" },\n add: { laws: [\"commutative\", \"associative\"], identity: () => Vec2.zero, liftScalar: true, params: [\"domain\"], returns: \"domain\" },\n subtract: { liftScalar: true, params: [\"domain\"], returns: \"domain\" },\n multiply: { laws: [\"commutative\", \"associative\"], identity: () => Vec2.one, liftScalar: true, params: [\"domain\"], returns: \"domain\" },\n divide: { liftScalar: true, params: [\"domain\"], returns: \"domain\" },\n min: { laws: [\"commutative\", \"associative\", \"idempotent\"], liftScalar: true, params: [\"domain\"], returns: \"domain\" },\n max: { laws: [\"commutative\", \"associative\", \"idempotent\"], liftScalar: true, params: [\"domain\"], returns: \"domain\" },\n scale: { params: [\"number\"], returns: \"domain\" },\n negate: { params: [], returns: \"domain\" },\n halve: { params: [], returns: \"domain\" },\n abs: { params: [], returns: \"domain\" },\n round: { params: [], returns: \"domain\" },\n floor: { params: [], returns: \"domain\" },\n ceil: { params: [], returns: \"domain\" },\n clamp: { params: [\"number\", \"number\"], returns: \"domain\" },\n swap: { params: [], returns: \"domain\" },\n compose: { params: [\"number\", \"number\"], returns: \"domain\" },\n select: { liftScalar: true, params: [\"domain\", \"domain\"], returns: \"domain\" },\n rotate: { params: [\"number\"], returns: \"domain\" },\n normalize: { params: [], returns: \"domain\" },\n lerp: { params: [\"domain\", \"number\"], returns: \"domain\" },\n length: { params: [], returns: \"number\" },\n lengthSq: { params: [], returns: \"number\" },\n distance: { params: [\"domain\"], returns: \"number\" },\n dot: { laws: [\"commutative\"], params: [\"domain\"], returns: \"number\" },\n along: { params: [\"domain\"], returns: \"number\" },\n across: { params: [\"domain\"], returns: \"number\" },\n cross: { params: [\"domain\"], returns: \"number\" },\n angle: { params: [], returns: \"number\" },\n area: { params: [], returns: \"number\" },\n sum: { params: [], returns: \"number\" },\n minComponent: { params: [], returns: \"number\" },\n maxComponent: { params: [], returns: \"number\" },\n equals: { laws: [\"commutative\"], params: [\"domain\"], returns: \"boolean\" },\n anyNonPositive: { params: [], returns: \"boolean\" },\n allPositive: { params: [], returns: \"boolean\" },\n anyNegative: { params: [], returns: \"boolean\" },\n allNonNegative: { params: [], returns: \"boolean\" },\n anyZero: { params: [], returns: \"boolean\" },\n allZero: { params: [], returns: \"boolean\" },\n anyLessThan: { params: [\"number\"], returns: \"boolean\" },\n allLessThan: { params: [\"number\"], returns: \"boolean\" },\n anyGreaterThan: { params: [\"number\"], returns: \"boolean\" },\n allGreaterThan: { params: [\"number\"], returns: \"boolean\" },\n },\n});\n","import { defineDomain, type Domain, type FnOp } from \"@mark1russell7/vex\";\n\n/**\n * A 2D vector as plain data. `XYDomain` has the component-wise ops of `Vec2Domain`, but each op is a function of plain\n * data. Thus a standalone module of `@mark1russell7/vex-compiler` can copy the domain, and a 2D program can be a module.\n */\nexport interface XY {\n readonly x: number;\n readonly y: number;\n}\n\ntype XYFn2 = (a: XY, b: XY) => XY;\ntype XYFn1 = (a: XY) => XY;\ntype XYNum1 = (a: XY) => number;\n\n/** The ops of `XYDomain`. */\nexport type XYOps = {\n readonly x: FnOp<XY, XYNum1>;\n readonly y: FnOp<XY, XYNum1>;\n readonly add: FnOp<XY, XYFn2>;\n readonly subtract: FnOp<XY, XYFn2>;\n readonly multiply: FnOp<XY, XYFn2>;\n readonly divide: FnOp<XY, XYFn2>;\n readonly min: FnOp<XY, XYFn2>;\n readonly max: FnOp<XY, XYFn2>;\n readonly scale: FnOp<XY, (a: XY, k: number) => XY>;\n readonly negate: FnOp<XY, XYFn1>;\n readonly abs: FnOp<XY, XYFn1>;\n readonly floor: FnOp<XY, XYFn1>;\n readonly ceil: FnOp<XY, XYFn1>;\n readonly round: FnOp<XY, XYFn1>;\n readonly dot: FnOp<XY, (a: XY, b: XY) => number>;\n readonly length: FnOp<XY, XYNum1>;\n readonly distance: FnOp<XY, (a: XY, b: XY) => number>;\n readonly area: FnOp<XY, XYNum1>;\n readonly sum: FnOp<XY, XYNum1>;\n readonly equals: FnOp<XY, (a: XY, b: XY) => boolean>;\n};\n\n/**\n * The domain of 2D vectors as plain data: an object with the two number fields `x` and `y` and no other field. The op\n * `xy` of `NumDomain` makes one. No op lifts a number, so each op has a static site in a module. Put `XYDomain` before\n * `NumRecordDomain`, because a record of numbers accepts the same objects.\n */\nexport const XYDomain: Domain<\"XY\", XY, XYOps> = defineDomain<\"XY\", XY, XYOps>({\n name: \"XY\",\n // A plain object: its prototype is Object.prototype or null, so an instance of a class such as Vec2 is not an XY.\n is: (u: unknown): u is XY => typeof u === \"object\" && u !== null && [Object.prototype, null].includes(Object.getPrototypeOf(u) as object | null) && Object.keys(u).length === 2 && typeof (u as XY).x === \"number\" && typeof (u as XY).y === \"number\",\n valid: (v: XY): boolean => Number.isFinite(v.x) && Number.isFinite(v.y),\n show: (v: XY): string => `(${v.x}, ${v.y})`,\n samples: (): readonly XY[] => [{ x: 0, y: 0 }, { x: 1.5, y: -2 }, { x: 3, y: 4 }],\n ops: {\n x: { fn: (a: XY): number => a.x, params: [], returns: \"number\" },\n y: { fn: (a: XY): number => a.y, params: [], returns: \"number\" },\n add: { fn: (a: XY, b: XY): XY => ({ x: a.x + b.x, y: a.y + b.y }), laws: [\"commutative\", \"associative\"], identity: (): XY => ({ x: 0, y: 0 }), params: [\"domain\"], returns: \"domain\" },\n subtract: { fn: (a: XY, b: XY): XY => ({ x: a.x - b.x, y: a.y - b.y }), params: [\"domain\"], returns: \"domain\" },\n multiply: { fn: (a: XY, b: XY): XY => ({ x: a.x * b.x, y: a.y * b.y }), laws: [\"commutative\", \"associative\"], identity: (): XY => ({ x: 1, y: 1 }), params: [\"domain\"], returns: \"domain\" },\n divide: { fn: (a: XY, b: XY): XY => ({ x: a.x / b.x, y: a.y / b.y }), params: [\"domain\"], returns: \"domain\" },\n min: { fn: (a: XY, b: XY): XY => ({ x: Math.min(a.x, b.x), y: Math.min(a.y, b.y) }), laws: [\"commutative\", \"associative\", \"idempotent\"], params: [\"domain\"], returns: \"domain\" },\n max: { fn: (a: XY, b: XY): XY => ({ x: Math.max(a.x, b.x), y: Math.max(a.y, b.y) }), laws: [\"commutative\", \"associative\", \"idempotent\"], params: [\"domain\"], returns: \"domain\" },\n scale: { fn: (a: XY, k: number): XY => ({ x: a.x * k, y: a.y * k }), params: [\"number\"], returns: \"domain\" },\n negate: { fn: (a: XY): XY => ({ x: -a.x, y: -a.y }), params: [], returns: \"domain\" },\n abs: { fn: (a: XY): XY => ({ x: Math.abs(a.x), y: Math.abs(a.y) }), params: [], returns: \"domain\" },\n floor: { fn: (a: XY): XY => ({ x: Math.floor(a.x), y: Math.floor(a.y) }), params: [], returns: \"domain\" },\n ceil: { fn: (a: XY): XY => ({ x: Math.ceil(a.x), y: Math.ceil(a.y) }), params: [], returns: \"domain\" },\n round: { fn: (a: XY): XY => ({ x: Math.round(a.x), y: Math.round(a.y) }), params: [], returns: \"domain\" },\n dot: { fn: (a: XY, b: XY): number => a.x * b.x + a.y * b.y, laws: [\"commutative\"], params: [\"domain\"], returns: \"number\" },\n length: { fn: (a: XY): number => Math.hypot(a.x, a.y), params: [], returns: \"number\" },\n distance: { fn: (a: XY, b: XY): number => Math.hypot(a.x - b.x, a.y - b.y), laws: [\"commutative\"], params: [\"domain\"], returns: \"number\" },\n area: { fn: (a: XY): number => a.x * a.y, params: [], returns: \"number\" },\n sum: { fn: (a: XY): number => a.x + a.y, params: [], returns: \"number\" },\n equals: { fn: (a: XY, b: XY): boolean => a.x === b.x && a.y === b.y, laws: [\"commutative\"], params: [\"domain\"], returns: \"boolean\" },\n },\n});\n","import { defineDomain, type Domain, type FnOp, type OpTable } from \"@mark1russell7/vex\";\n\n/**\n * An immutable vector with named components. The type parameter `K` is the set of component names. Ops that\n * combine two vectors use the union of their names, and a missing component counts as 0. The constructor\n * keeps each number, also a number that is not finite: the domain check reports such a value as `#NUM!`.\n */\nexport class NDVector<K extends string = string> {\n /** The components: name to number. */\n readonly c: Readonly<Record<K, number>>;\n\n constructor(c: Readonly<Record<K, number>>) {\n this.c = Object.freeze({ ...c });\n }\n\n /** This function makes a vector from name and value pairs. */\n static of<K extends string>(entries: readonly (readonly [K, number])[]): NDVector<K> {\n const c = {} as Record<K, number>;\n for (const [k, v] of entries) c[k] = v;\n return new NDVector(c);\n }\n /** This function makes the zero vector over the names `keys`. */\n static zero<K extends string>(keys: readonly K[] = []): NDVector<K> {\n return NDVector.of(keys.map((k) => [k, 0] as const));\n }\n\n /** The names of the components. */\n keys(): readonly K[] {\n return Object.keys(this.c) as K[];\n }\n /** The value of a component, or 0 if the vector does not have it. */\n get(k: string): number {\n return Object.hasOwn(this.c, k) ? Number((this.c as Readonly<Record<string, number>>)[k]) : 0;\n }\n set<K2 extends string>(k: K2, v: number): NDVector<K | K2> {\n return new NDVector({ ...this.c, [k]: v } as Record<K | K2, number>);\n }\n map(f: (name: K, v: number) => number): NDVector<K> {\n const c = {} as Record<K, number>;\n for (const k of this.keys()) c[k] = f(k, this.get(k));\n return new NDVector(c);\n }\n /** The vector with only the names in `keys`. A zero component is dropped, unless `keepZeros` is true. */\n pick<K2 extends K>(keys: readonly K2[], keepZeros = false): NDVector<K2> {\n const c = {} as Record<K2, number>;\n for (const k of keys) {\n const v = this.get(k);\n if (keepZeros || v !== 0) c[k] = v;\n }\n return new NDVector(c);\n }\n /** The vector with the names in `keys` added. A new component is 0. */\n withKeys<K2 extends string>(keys: readonly K2[]): NDVector<K | K2> {\n const c = { ...this.c } as Record<K | K2, number>;\n for (const k of keys) if (!Object.hasOwn(c, k)) c[k] = 0;\n return new NDVector(c);\n }\n #combine<K2 extends string>(o: NDVector<K2>, f: (a: number, b: number) => number): NDVector<K | K2> {\n const c = {} as Record<K | K2, number>;\n for (const k of new Set<K | K2>([...this.keys(), ...o.keys()])) c[k] = f(this.get(k), o.get(k));\n return new NDVector(c);\n }\n add<K2 extends string>(o: NDVector<K2>): NDVector<K | K2> {\n return this.#combine(o, (a, b) => a + b);\n }\n subtract<K2 extends string>(o: NDVector<K2>): NDVector<K | K2> {\n return this.#combine(o, (a, b) => a - b);\n }\n /** The component-wise product. */\n multiply<K2 extends string>(o: NDVector<K2>): NDVector<K | K2> {\n return this.#combine(o, (a, b) => a * b);\n }\n /** The component-wise minimum. A component that one vector does not have counts as 0. */\n min<K2 extends string>(o: NDVector<K2>): NDVector<K | K2> {\n return this.#combine(o, (a, b) => Math.min(a, b));\n }\n /** The component-wise maximum. A component that one vector does not have counts as 0. */\n max<K2 extends string>(o: NDVector<K2>): NDVector<K | K2> {\n return this.#combine(o, (a, b) => Math.max(a, b));\n }\n /** Of each component, the value of this vector if it is not 0, else the value of `o`. */\n mergePreferNonZero<K2 extends string>(o: NDVector<K2>): NDVector<K | K2> {\n return this.#combine(o, (a, b) => (a !== 0 ? a : b));\n }\n scale(k: number): NDVector<K> {\n return this.map((_n, v) => v * k);\n }\n clamp(lo: number, hi: number): NDVector<K> {\n return this.map((_n, v) => Math.min(hi, Math.max(lo, v)));\n }\n dot(o: NDVector): number {\n let s = 0;\n for (const k of new Set<string>([...this.keys(), ...o.keys()])) s += this.get(k) * o.get(k);\n return s;\n }\n /** The L2 length. */\n length(): number {\n return Math.sqrt(this.keys().reduce((s, k) => s + this.get(k) ** 2, 0));\n }\n /** The L1 norm. */\n norm1(): number {\n return this.keys().reduce((s, k) => s + Math.abs(this.get(k)), 0);\n }\n /** The largest absolute component. */\n normInf(): number {\n return this.keys().reduce((m, k) => Math.max(m, Math.abs(this.get(k))), 0);\n }\n equals(o: NDVector): boolean {\n const keys = new Set<string>([...this.keys(), ...o.keys()]);\n for (const k of keys) if (this.get(k) !== o.get(k)) return false;\n return true;\n }\n /** True if each component is a finite number. */\n isFinite(): boolean {\n return this.keys().every((k) => Number.isFinite(this.get(k)));\n }\n toJSON(): Readonly<Record<K, number>> {\n return { ...this.c };\n }\n toString(): string {\n return `NDVector(${JSON.stringify(this.c)})`;\n }\n}\n\ntype NDOpNames =\n | \"add\" | \"subtract\" | \"multiply\" | \"min\" | \"max\" | \"mergePreferNonZero\" | \"scale\" | \"clamp\" | \"dot\" | \"length\" | \"norm1\" | \"normInf\"\n | \"equals\" | \"pick\" | \"withKeys\" | \"get\" | \"set\";\n\n/** The ops of `NDVectorDomain`. No op lifts numbers. */\nexport type NDVectorOps = OpTable<NDVector, NDOpNames>;\n\n/** The ops of `LiftedNDVectorDomain`. */\nexport type LiftedNDVectorOps = OpTable<NDVector, NDOpNames, \"add\" | \"subtract\" | \"multiply\" | \"dot\">;\n\nconst ndOps = {\n add: { laws: [\"commutative\", \"associative\"], identity: (): NDVector => NDVector.zero(), params: [\"domain\"] },\n subtract: { params: [\"domain\"] },\n multiply: { laws: [\"commutative\", \"associative\"], params: [\"domain\"] },\n min: { laws: [\"commutative\", \"associative\", \"idempotent\"], params: [\"domain\"] },\n max: { laws: [\"commutative\", \"associative\", \"idempotent\"], params: [\"domain\"] },\n mergePreferNonZero: { laws: [\"associative\", \"idempotent\"], params: [\"domain\"] },\n scale: { params: [\"number\"] },\n clamp: { params: [\"number\", \"number\"] },\n dot: { laws: [\"commutative\"], params: [\"domain\"] },\n length: {},\n norm1: {},\n normInf: {},\n equals: { laws: [\"commutative\"], params: [\"domain\"] },\n pick: {},\n withKeys: {},\n get: { params: [\"string\"] },\n set: { params: [\"string\", \"number\"] },\n} as const satisfies NDVectorOps;\n\nconst isNDVector = (u: unknown): u is NDVector => u instanceof NDVector;\n\n/** The domain of named-component vectors. A number argument is an error here: use `LiftedNDVectorDomain` to lift. */\nexport const NDVectorDomain: Domain<\"NDVector\", NDVector, NDVectorOps> = defineDomain<\"NDVector\", NDVector, NDVectorOps>({\n name: \"NDVector\",\n is: isNDVector,\n valid: (v: NDVector): boolean => v.isFinite(),\n show: (v: NDVector): string => v.toString(),\n encode: (v: NDVector): unknown => v.toJSON(),\n decode: (u: unknown): NDVector => new NDVector(u as Readonly<Record<string, number>>),\n ops: ndOps,\n});\n\n/**\n * The domain of named-component vectors with scalar lifting. A number argument of `add`, `subtract`,\n * `multiply` or `dot` becomes the vector `{ scalar: n }`. This domain is independent of `NDVectorDomain`:\n * the two can be in one program, and neither changes the other.\n */\nexport const LiftedNDVectorDomain: Domain<\"NDVector(lifted)\", NDVector, LiftedNDVectorOps> = defineDomain<\"NDVector(lifted)\", NDVector, LiftedNDVectorOps>({\n name: \"NDVector(lifted)\",\n is: isNDVector,\n fromScalar: (n: number): NDVector => new NDVector({ scalar: n }),\n valid: (v: NDVector): boolean => v.isFinite(),\n show: (v: NDVector): string => v.toString(),\n ops: {\n ...ndOps,\n add: { ...ndOps.add, liftScalar: true },\n subtract: { ...ndOps.subtract, liftScalar: true },\n multiply: { ...ndOps.multiply, liftScalar: true },\n dot: { ...ndOps.dot, liftScalar: true },\n },\n});\n\n/** A plain record whose values are finite numbers. */\nexport type NumRecord = Readonly<Record<string, number>>;\n\n/** The ops of `NumRecordDomain`. */\nexport type NumRecordOps = {\n readonly toNDVector: FnOp<NumRecord, (r: NumRecord) => NDVector>;\n};\n\nconst isNumRecord = (u: unknown): u is NumRecord => {\n if (typeof u !== \"object\" || u === null || Array.isArray(u)) return false;\n const proto: unknown = Object.getPrototypeOf(u);\n // Number.isFinite gives false for each value that is not a number.\n return (proto === Object.prototype || proto === null) && Object.values(u).every((v) => Number.isFinite(v));\n};\n\n/** The domain of plain number records. Its op `toNDVector` builds a vector from fields, for example from `rec()`. */\nexport const NumRecordDomain: Domain<\"NumRecord\", NumRecord, NumRecordOps> = defineDomain<\"NumRecord\", NumRecord, NumRecordOps>({\n name: \"NumRecord\",\n is: isNumRecord,\n ops: {\n toNDVector: { fn: (r: NumRecord): NDVector => new NDVector(r) },\n },\n});\n","import { defineDomain, type Domain, type OpTable } from \"@mark1russell7/vex\";\n\nconst MS_PER_DAY = 86_400_000;\n\n/** The largest distance from 1970-01-01 in days. The `Date` of JavaScript has the same range. */\nexport const MAX_DAYS = 100_000_000;\n\nconst ISO = /^([+-]?\\d{4,6})-(\\d{2})-(\\d{2})$/;\n\n/** This function gives the `Date` of JavaScript at 00:00 UTC of a day. */\nconst utc = (days: number): Date => new Date(days * MS_PER_DAY);\n\n/**\n * An immutable day of the calendar, without a time and without a time zone. It keeps the number of days since\n * 1970-01-01, so the arithmetic of days is the arithmetic of numbers. The calendar is the Gregorian calendar, also\n * before 1582.\n */\nexport class LocalDate {\n /** The number of days since 1970-01-01. */\n readonly days: number;\n\n constructor(days: number) {\n this.days = days;\n }\n\n /**\n * This function makes a date from a year, a month from 1 to 12, and a day. A month or a day outside its range rolls\n * over, like the function `DATE` of a spreadsheet. Thus month 13 is January of the next year, and day 0 is the last\n * day of the month before. A number that is not whole gives a date that is not valid.\n */\n static of(year: number, month: number, day: number): LocalDate {\n if (![year, month, day].every(Number.isSafeInteger)) return new LocalDate(Number.NaN);\n // setUTCFullYear does not change the years 0 to 99 into 1900 to 1999, but Date.UTC does.\n const d = new Date(0);\n d.setUTCFullYear(year, month - 1, day);\n return new LocalDate(Math.round(d.getTime() / MS_PER_DAY));\n }\n\n /** This function reads a date in the form `YYYY-MM-DD`. A day that does not exist, for example `2026-02-30`, gives `undefined`. */\n static parse(text: string): LocalDate | undefined {\n const m = ISO.exec(text.trim());\n if (m === null) return undefined;\n const [y, mo, d] = [Number(m[1]), Number(m[2]), Number(m[3])];\n const date = LocalDate.of(y, mo, d);\n // A month or a day outside its range rolls over into another month, so the month tells if the day exists.\n return date.month() === mo ? date : undefined;\n }\n\n /** The year. */\n year(): number {\n return utc(this.days).getUTCFullYear();\n }\n /** The month, from 1 to 12. */\n month(): number {\n return utc(this.days).getUTCMonth() + 1;\n }\n /** The day of the month, from 1 to 31. */\n day(): number {\n return utc(this.days).getUTCDate();\n }\n /** The day of the week, from 1 (Sunday) to 7 (Saturday), like `WEEKDAY` of a spreadsheet. */\n weekday(): number {\n return utc(this.days).getUTCDay() + 1;\n }\n /** The date `n` days later. A negative `n` goes back. */\n add(n: number): LocalDate {\n return new LocalDate(this.days + n);\n }\n /** The number of days from the date `x` to this date, or the date `x` days before this date. */\n subtract(x: LocalDate | number): LocalDate | number {\n return x instanceof LocalDate ? this.days - x.days : new LocalDate(this.days - x);\n }\n /**\n * The same day `n` months later, like `EDATE` of a spreadsheet. When that month is shorter, the result is its last\n * day: one month after 31 January is the last day of February.\n */\n addMonths(n: number): LocalDate {\n // LocalDate.of gives a date that is not valid for a number of months that is not whole.\n const first = LocalDate.of(this.year(), this.month() + n, 1);\n const last = LocalDate.of(first.year(), first.month() + 1, 0);\n return new LocalDate(Math.min(first.days + this.day() - 1, last.days));\n }\n /** The last day of the month `n` months later, like `EOMONTH` of a spreadsheet. */\n endOfMonth(n: number): LocalDate {\n return LocalDate.of(this.year(), this.month() + n + 1, 0);\n }\n gt(o: LocalDate): boolean {\n return this.days > o.days;\n }\n gte(o: LocalDate): boolean {\n return this.days >= o.days;\n }\n lt(o: LocalDate): boolean {\n return this.days < o.days;\n }\n lte(o: LocalDate): boolean {\n return this.days <= o.days;\n }\n eq(o: LocalDate): boolean {\n return this.days === o.days;\n }\n /** The form `YYYY-MM-DD`. A year before 0 or after 9999 has a sign and six digits, as in ISO 8601. */\n toString(): string {\n const y = this.year();\n // Stryker disable next-line EqualityOperator: the year 0 takes the first branch, so y < 0 and y <= 0 are the same in the second\n const year = y >= 0 && y <= 9999 ? String(y).padStart(4, \"0\") : `${y < 0 ? \"-\" : \"+\"}${String(Math.abs(y)).padStart(6, \"0\")}`;\n return `${year}-${String(this.month()).padStart(2, \"0\")}-${String(this.day()).padStart(2, \"0\")}`;\n }\n}\n\n/** The ops of `DateDomain`. */\nexport type DateOps = OpTable<LocalDate, \"add\" | \"subtract\" | \"addMonths\" | \"endOfMonth\" | \"year\" | \"month\" | \"day\" | \"weekday\" | \"gt\" | \"gte\" | \"lt\" | \"lte\" | \"eq\">;\n\n/**\n * The domain of dates. `add` takes a count of days. `subtract` takes a date, for the days between the two dates, or a\n * count of days. A valid date is a whole count of days, within `MAX_DAYS` of 1970-01-01.\n */\nexport const DateDomain: Domain<\"Date\", LocalDate, DateOps> = defineDomain<\"Date\", LocalDate, DateOps>({\n name: \"Date\",\n is: (u: unknown): u is LocalDate => u instanceof LocalDate,\n valid: (d: LocalDate): boolean => Number.isSafeInteger(d.days) && Math.abs(d.days) <= MAX_DAYS,\n show: (d: LocalDate): string => d.toString(),\n encode: (d: LocalDate): string => d.toString(),\n decode: (u: unknown): LocalDate => (typeof u === \"string\" ? LocalDate.parse(u) : undefined) ?? new LocalDate(Number.NaN),\n ops: {\n add: { params: [\"number\"] },\n subtract: { params: [\"any\"] },\n addMonths: { params: [\"number\"] },\n endOfMonth: { params: [\"number\"] },\n year: {},\n month: {},\n day: {},\n weekday: {},\n gt: { params: [\"domain\"] },\n gte: { params: [\"domain\"] },\n lt: { params: [\"domain\"] },\n lte: { params: [\"domain\"] },\n eq: { laws: [\"commutative\"], params: [\"domain\"] },\n },\n});\n","import { defineDomain, type Domain, type FnOp } from \"@mark1russell7/vex\";\nimport { LocalDate } from \"./date.ts\";\nimport { Vec2 } from \"./vec2.ts\";\nimport type { XY } from \"./xy.ts\";\n\ntype NumFn1 = (a: number) => number;\ntype NumFn2 = (a: number, b: number) => number;\ntype NumFn3 = (a: number, b: number, c: number) => number;\ntype NumTest = (a: number, b: number) => boolean;\n\n/** The ops of `NumDomain`. */\nexport type NumOps = {\n readonly add: FnOp<number, NumFn2>;\n readonly subtract: FnOp<number, NumFn2>;\n readonly multiply: FnOp<number, NumFn2>;\n readonly divide: FnOp<number, NumFn2>;\n readonly mod: FnOp<number, NumFn2>;\n readonly pow: FnOp<number, NumFn2>;\n readonly min: FnOp<number, NumFn2>;\n readonly max: FnOp<number, NumFn2>;\n readonly clamp: FnOp<number, NumFn3>;\n readonly abs: FnOp<number, NumFn1>;\n readonly negate: FnOp<number, NumFn1>;\n readonly sqrt: FnOp<number, NumFn1>;\n readonly ln: FnOp<number, NumFn1>;\n readonly exp: FnOp<number, NumFn1>;\n readonly log10: FnOp<number, NumFn1>;\n readonly sin: FnOp<number, NumFn1>;\n readonly cos: FnOp<number, NumFn1>;\n readonly asin: FnOp<number, NumFn1>;\n readonly hypot: FnOp<number, NumFn2>;\n readonly date: FnOp<number, (year: number, month: number, day: number) => LocalDate>;\n readonly vec2: FnOp<number, (x: number, y: number) => Vec2>;\n readonly xy: FnOp<number, (x: number, y: number) => XY>;\n readonly floor: FnOp<number, NumFn1>;\n readonly ceil: FnOp<number, NumFn1>;\n readonly round: FnOp<number, NumFn1>;\n readonly gt: FnOp<number, NumTest>;\n readonly gte: FnOp<number, NumTest>;\n readonly lt: FnOp<number, NumTest>;\n readonly lte: FnOp<number, NumTest>;\n readonly eq: FnOp<number, NumTest>;\n};\n\n/** The domain of numbers. A result that is not a finite number is the error `#NUM!`. */\nexport const NumDomain: Domain<\"Num\", number, NumOps> = defineDomain<\"Num\", number, NumOps>({\n name: \"Num\",\n is: (u: unknown): u is number => typeof u === \"number\",\n primitive: \"number\",\n valid: (n: number): boolean => Number.isFinite(n),\n show: (n: number): string => String(n),\n ops: {\n add: { fn: (a: number, b: number): number => a + b, laws: [\"commutative\", \"associative\"], identity: (): number => 0, params: [\"number\"], returns: \"number\" },\n subtract: { fn: (a: number, b: number): number => a - b, params: [\"number\"], returns: \"number\" },\n multiply: { fn: (a: number, b: number): number => a * b, laws: [\"commutative\", \"associative\"], identity: (): number => 1, params: [\"number\"], returns: \"number\" },\n divide: { fn: (a: number, b: number): number => a / b, params: [\"number\"], returns: \"number\" },\n mod: { fn: (a: number, b: number): number => a % b, params: [\"number\"], returns: \"number\" },\n pow: { fn: (a: number, b: number): number => a ** b, params: [\"number\"], returns: \"number\" },\n min: { fn: (a: number, b: number): number => Math.min(a, b), laws: [\"commutative\", \"associative\", \"idempotent\"], params: [\"number\"], returns: \"number\" },\n max: { fn: (a: number, b: number): number => Math.max(a, b), laws: [\"commutative\", \"associative\", \"idempotent\"], params: [\"number\"], returns: \"number\" },\n clamp: { fn: (a: number, lo: number, hi: number): number => Math.min(hi, Math.max(lo, a)), params: [\"number\", \"number\"], returns: \"number\" },\n abs: { fn: (a: number): number => Math.abs(a), returns: \"number\" },\n negate: { fn: (a: number): number => -a, returns: \"number\" },\n sqrt: { fn: (a: number): number => Math.sqrt(a), returns: \"number\" },\n ln: { fn: (a: number): number => Math.log(a), returns: \"number\" },\n exp: { fn: (a: number): number => Math.exp(a), returns: \"number\" },\n log10: { fn: (a: number): number => Math.log10(a), returns: \"number\" },\n // The angles of sin, cos and asin are in radians.\n sin: { fn: (a: number): number => Math.sin(a), returns: \"number\" },\n cos: { fn: (a: number): number => Math.cos(a), returns: \"number\" },\n asin: { fn: (a: number): number => Math.asin(a), returns: \"number\" },\n hypot: { fn: (a: number, b: number): number => Math.hypot(a, b), laws: [\"commutative\"], params: [\"number\"], returns: \"number\" },\n // The year is the receiver: date(year, month, day). The result is a LocalDate, so a chain continues in DateDomain.\n date: { fn: (year: number, month: number, day: number): LocalDate => LocalDate.of(year, month, day), params: [\"number\", \"number\"] },\n // The x component is the receiver: vec2(x, y). The result is a Vec2, so a chain continues in Vec2Domain.\n vec2: { fn: (x: number, y: number): Vec2 => new Vec2(x, y), params: [\"number\"] },\n // The same as plain data, for a standalone module: xy(x, y). The result is a value of XYDomain.\n xy: { fn: (x: number, y: number): XY => ({ x, y }), params: [\"number\"], returns: \"domain:XY\" },\n floor: { fn: (a: number): number => Math.floor(a), returns: \"number\" },\n ceil: { fn: (a: number): number => Math.ceil(a), returns: \"number\" },\n round: { fn: (a: number): number => Math.round(a), returns: \"number\" },\n gt: { fn: (a: number, b: number): boolean => a > b, params: [\"number\"], returns: \"boolean\" },\n gte: { fn: (a: number, b: number): boolean => a >= b, params: [\"number\"], returns: \"boolean\" },\n lt: { fn: (a: number, b: number): boolean => a < b, params: [\"number\"], returns: \"boolean\" },\n lte: { fn: (a: number, b: number): boolean => a <= b, params: [\"number\"], returns: \"boolean\" },\n eq: { fn: (a: number, b: number): boolean => a === b, laws: [\"commutative\"], params: [\"number\"], returns: \"boolean\" },\n },\n});\n\ntype BoolFn1 = (a: boolean) => boolean;\ntype BoolFn2 = (a: boolean, b: boolean) => boolean;\n\n/** The ops of `BoolDomain`. */\nexport type BoolOps = {\n readonly and: FnOp<boolean, BoolFn2>;\n readonly or: FnOp<boolean, BoolFn2>;\n readonly xor: FnOp<boolean, BoolFn2>;\n readonly not: FnOp<boolean, BoolFn1>;\n readonly eq: FnOp<boolean, BoolFn2>;\n};\n\n/** The domain of booleans. For lazy logic, use the special forms `and`, `or` and `if` of the IR. */\nexport const BoolDomain: Domain<\"Bool\", boolean, BoolOps> = defineDomain<\"Bool\", boolean, BoolOps>({\n name: \"Bool\",\n is: (u: unknown): u is boolean => typeof u === \"boolean\",\n primitive: \"boolean\",\n show: (b: boolean): string => String(b),\n ops: {\n and: { fn: (a: boolean, b: boolean): boolean => a && b, laws: [\"commutative\", \"associative\", \"idempotent\"], identity: (): boolean => true, params: [\"boolean\"], returns: \"boolean\" },\n or: { fn: (a: boolean, b: boolean): boolean => a || b, laws: [\"commutative\", \"associative\", \"idempotent\"], identity: (): boolean => false, params: [\"boolean\"], returns: \"boolean\" },\n xor: { fn: (a: boolean, b: boolean): boolean => a !== b, laws: [\"commutative\", \"associative\"], identity: (): boolean => false, params: [\"boolean\"], returns: \"boolean\" },\n not: { fn: (a: boolean): boolean => !a, returns: \"boolean\" },\n eq: { fn: (a: boolean, b: boolean): boolean => a === b, laws: [\"commutative\"], params: [\"boolean\"], returns: \"boolean\" },\n },\n});\n","/**\n * The domain of texts. The op `concat` joins a text and a value of any kind. It is the operator `&` of a\n * spreadsheet, and of the formula language of the sheet app.\n */\nimport { defineDomain, type Domain, type FnOp } from \"@mark1russell7/vex\";\n\ntype TextFn1 = (a: string) => string;\n\n/** The ops of `TextDomain`. */\nexport type TextOps = {\n readonly concat: FnOp<string, (a: string, b: unknown) => string>;\n readonly length: FnOp<string, (a: string) => number>;\n readonly upper: FnOp<string, TextFn1>;\n readonly lower: FnOp<string, TextFn1>;\n readonly trim: FnOp<string, TextFn1>;\n readonly contains: FnOp<string, (a: string, b: string) => boolean>;\n readonly eq: FnOp<string, (a: string, b: string) => boolean>;\n};\n\n/**\n * This function gives the text of a value for `concat`. A text stays. A plain record gives its JSON text. Another\n * value, for example a number or a `Vec2`, gives its own text.\n */\nconst textOf = (u: unknown): string => (typeof u === \"object\" && u !== null && Object.getPrototypeOf(u) === Object.prototype ? JSON.stringify(u) : String(u));\n\n/** The domain of texts. */\nexport const TextDomain: Domain<\"Text\", string, TextOps> = defineDomain<\"Text\", string, TextOps>({\n name: \"Text\",\n is: (u: unknown): u is string => typeof u === \"string\",\n primitive: \"string\",\n show: (s: string): string => JSON.stringify(s),\n ops: {\n concat: { fn: (a: string, b: unknown): string => a + textOf(b), params: [\"any\"], returns: \"string\" },\n // The length counts UTF-16 code units, like the function LEN of a spreadsheet.\n length: { fn: (a: string): number => a.length, returns: \"number\" },\n upper: { fn: (a: string): string => a.toUpperCase(), returns: \"string\" },\n lower: { fn: (a: string): string => a.toLowerCase(), returns: \"string\" },\n trim: { fn: (a: string): string => a.trim(), returns: \"string\" },\n contains: { fn: (a: string, b: string): boolean => a.includes(b), params: [\"string\"], returns: \"boolean\" },\n eq: { fn: (a: string, b: string): boolean => a === b, laws: [\"commutative\"], params: [\"string\"], returns: \"boolean\" },\n },\n});\n","import { defineDomain, type Domain, type OpTable } from \"@mark1russell7/vex\";\n\n/** The linear value of an sRGB channel from 0 to 255, with the sRGB transfer function of WCAG 2.1. */\nfunction linear(channel: number): number {\n const s = Math.min(1, Math.max(0, channel / 255));\n // For integer channels, the sRGB threshold 0.04045 and the WCAG threshold 0.03928 give the same result.\n return s <= 0.04045 ? s / 12.92 : ((s + 0.055) / 1.055) ** 2.4;\n}\n\n/**\n * An immutable RGBA color. The channels have no fixed range: use `clamp` to limit them. `add` adds the color\n * channels and keeps the larger alpha, so `add` is commutative and associative.\n */\nexport class Color {\n readonly r: number;\n readonly g: number;\n readonly b: number;\n readonly a: number;\n\n constructor(r: number, g: number, b: number, a = 1) {\n this.r = r;\n this.g = g;\n this.b = b;\n this.a = a;\n }\n\n /** This function makes a gray color with the value `n` in each channel. */\n static gray(n: number): Color {\n return new Color(n, n, n, 1);\n }\n /** The black color with alpha 0: the identity of `add`. */\n static readonly none: Color = new Color(0, 0, 0, 0);\n\n /** The channel sum. The alpha is the larger alpha. */\n add(o: Color): Color {\n return new Color(this.r + o.r, this.g + o.g, this.b + o.b, Math.max(this.a, o.a));\n }\n /** Each color channel times `factor`. The alpha does not change. */\n multiply(factor: number): Color {\n return new Color(this.r * factor, this.g * factor, this.b * factor, this.a);\n }\n /** Each color channel in the range from `lo` to `hi`. */\n clamp(lo = 0, hi = 255): Color {\n const c = (x: number): number => Math.min(hi, Math.max(lo, x));\n return new Color(c(this.r), c(this.g), c(this.b), this.a);\n }\n /** The linear mix from this color to `o`. */\n mix(o: Color, t: number): Color {\n const m = (x: number, y: number): number => x + (y - x) * t;\n return new Color(m(this.r, o.r), m(this.g, o.g), m(this.b, o.b), m(this.a, o.a));\n }\n /** The relative luminance (Rec. 709 weights) of the color channels. */\n luminance(): number {\n return 0.2126 * this.r + 0.7152 * this.g + 0.0722 * this.b;\n }\n /**\n * The relative luminance of WCAG 2.1, from 0 (black) to 1 (white). Each channel from 0 to 255 becomes a linear\n * value with the sRGB transfer function. A channel outside the range counts as the nearest end of the range.\n */\n relativeLuminance(): number {\n return 0.2126 * linear(this.r) + 0.7152 * linear(this.g) + 0.0722 * linear(this.b);\n }\n /** The contrast ratio of WCAG 2.1 between this color and `o`: 1 for equal luminance, 21 for black and white. */\n contrast(o: Color): number {\n const a = this.relativeLuminance();\n const b = o.relativeLuminance();\n return (Math.max(a, b) + 0.05) / (Math.min(a, b) + 0.05);\n }\n equals(o: Color): boolean {\n return this.r === o.r && this.g === o.g && this.b === o.b && this.a === o.a;\n }\n toArray(): readonly [number, number, number, number] {\n return [this.r, this.g, this.b, this.a];\n }\n toString(): string {\n return `rgba(${this.r}, ${this.g}, ${this.b}, ${this.a})`;\n }\n}\n\n/** The ops of `ColorDomain`. */\nexport type ColorOps = OpTable<Color, \"add\" | \"multiply\" | \"clamp\" | \"mix\" | \"luminance\" | \"relativeLuminance\" | \"contrast\" | \"equals\">;\n\n/** The domain of colors. */\nexport const ColorDomain: Domain<\"Color\", Color, ColorOps> = defineDomain<\"Color\", Color, ColorOps>({\n name: \"Color\",\n is: (u: unknown): u is Color => u instanceof Color,\n fromScalar: (n: number): Color => Color.gray(n),\n valid: (c: Color): boolean => c.toArray().every((x) => Number.isFinite(x)),\n show: (c: Color): string => c.toString(),\n encode: (c: Color): readonly number[] => c.toArray(),\n decode: (u: unknown): Color => {\n const [r, g, b, a] = (Array.isArray(u) ? u : []) as readonly number[];\n return new Color(r ?? Number.NaN, g ?? Number.NaN, b ?? Number.NaN, a ?? 1);\n },\n ops: {\n add: { laws: [\"commutative\", \"associative\"], identity: (): Color => Color.none, params: [\"domain\"] },\n multiply: { params: [\"number\"] },\n clamp: { params: [\"number\", \"number\"] },\n mix: { params: [\"domain\", \"number\"] },\n luminance: {},\n relativeLuminance: {},\n contrast: { laws: [\"commutative\"], params: [\"domain\"] },\n equals: { laws: [\"commutative\"], params: [\"domain\"] },\n },\n});\n","import { defineDomain, type Domain, type OpTable } from \"@mark1russell7/vex\";\nimport { Vec2 } from \"./vec2.ts\";\n\n/** An immutable angle in radians. */\nexport class Angle {\n readonly radians: number;\n\n constructor(radians: number) {\n this.radians = radians;\n }\n\n /** This function makes an angle from degrees. */\n static fromDegrees(deg: number): Angle {\n return new Angle((deg * Math.PI) / 180);\n }\n /** The zero angle: the identity of `add`. */\n static readonly zero: Angle = new Angle(0);\n\n add(o: Angle): Angle {\n return new Angle(this.radians + o.radians);\n }\n subtract(o: Angle): Angle {\n return new Angle(this.radians - o.radians);\n }\n scale(k: number): Angle {\n return new Angle(this.radians * k);\n }\n /** The same angle in the range from -π (included) to π (not included). */\n normalize(): Angle {\n const twoPi = Math.PI * 2;\n // Stryker disable next-line ArithmeticOperator: x + π and x - π differ by 2π, so the result after mod 2π is the same\n return new Angle((((this.radians + Math.PI) % twoPi) + twoPi) % twoPi - Math.PI);\n }\n /** The vector with this angle and the length `length`. The result is a `Vec2`, so a chain continues in that domain. */\n toVec2(length = 1): Vec2 {\n return new Vec2(Math.cos(this.radians) * length, Math.sin(this.radians) * length);\n }\n sin(): number {\n return Math.sin(this.radians);\n }\n cos(): number {\n return Math.cos(this.radians);\n }\n degrees(): number {\n return (this.radians * 180) / Math.PI;\n }\n toString(): string {\n return `${this.radians} rad`;\n }\n}\n\n/** The ops of `AngleDomain`. */\nexport type AngleOps = OpTable<Angle, \"add\" | \"subtract\" | \"scale\" | \"normalize\" | \"toVec2\" | \"sin\" | \"cos\" | \"degrees\", \"add\" | \"subtract\">;\n\n/** The domain of angles. A number argument of `add` or `subtract` lifts to an angle in radians. */\nexport const AngleDomain: Domain<\"Angle\", Angle, AngleOps> = defineDomain<\"Angle\", Angle, AngleOps>({\n name: \"Angle\",\n is: (u: unknown): u is Angle => u instanceof Angle,\n fromScalar: (n: number): Angle => new Angle(n),\n valid: (a: Angle): boolean => Number.isFinite(a.radians),\n show: (a: Angle): string => a.toString(),\n encode: (a: Angle): number => a.radians,\n decode: (u: unknown): Angle => new Angle(typeof u === \"number\" ? u : Number.NaN),\n ops: {\n add: { laws: [\"commutative\", \"associative\"], identity: (): Angle => Angle.zero, liftScalar: true, params: [\"domain\"] },\n subtract: { liftScalar: true, params: [\"domain\"] },\n scale: { params: [\"number\"] },\n normalize: {},\n toVec2: { params: [\"number\"] },\n sin: {},\n cos: {},\n degrees: {},\n },\n});\n","import { defineDomain, type Domain, type OpTable } from \"@mark1russell7/vex\";\n\n/** A wrapper around a function. Its op `invoke` calls the function. It shows how a domain can hold behavior. */\nexport class Fn {\n readonly fn: (...args: never[]) => unknown;\n\n constructor(fn: (...args: never[]) => unknown) {\n this.fn = fn;\n }\n invoke(...args: readonly unknown[]): unknown {\n return (this.fn as (...a: readonly unknown[]) => unknown)(...args);\n }\n}\n\n/** The ops of `FnDomain`. */\nexport type FnOps = OpTable<Fn, \"invoke\">;\n\n/** The domain of function wrappers. */\nexport const FnDomain: Domain<\"Fn\", Fn, FnOps> = defineDomain<\"Fn\", Fn, FnOps>({\n name: \"Fn\",\n is: (u: unknown): u is Fn => u instanceof Fn,\n ops: { invoke: {} },\n});\n\n/**\n * A value that is there (`top`) or not there (`bottom`). It shows a domain whose ops take functions. A Vex\n * program can also hold this state in its own errors, so most programs do not need this domain.\n */\nexport class Maybe<T> {\n readonly #has: boolean;\n readonly #value: T | undefined;\n\n private constructor(has: boolean, value: T | undefined) {\n this.#has = has;\n this.#value = value;\n }\n static top<T>(value: T): Maybe<T> {\n return new Maybe<T>(true, value);\n }\n static bottom<T = never>(): Maybe<T> {\n return new Maybe<T>(false, undefined);\n }\n isTop(): boolean {\n return this.#has;\n }\n isBottom(): boolean {\n return !this.#has;\n }\n map<U>(f: (value: T) => U): Maybe<U> {\n return this.#has ? Maybe.top(f(this.#value as T)) : Maybe.bottom<U>();\n }\n chain<U>(f: (value: T) => Maybe<U>): Maybe<U> {\n return this.#has ? f(this.#value as T) : Maybe.bottom<U>();\n }\n valueOr<U>(fallback: U): T | U {\n return this.#has ? (this.#value as T) : fallback;\n }\n}\n\n/** The ops of `MaybeDomain`. */\nexport type MaybeOps = OpTable<Maybe<unknown>, \"isTop\" | \"isBottom\" | \"map\" | \"chain\" | \"valueOr\">;\n\n/** The domain of `Maybe` values. */\nexport const MaybeDomain: Domain<\"Maybe\", Maybe<unknown>, MaybeOps> = defineDomain<\"Maybe\", Maybe<unknown>, MaybeOps>({\n name: \"Maybe\",\n is: (u: unknown): u is Maybe<unknown> => u instanceof Maybe,\n ops: { isTop: {}, isBottom: {}, map: {}, chain: {}, valueOr: {} },\n});\n"],"mappings":";;;;;;AAMA,IAAa,OAAb,MAAa,KAAK;CAChB;CACA;CAEA,YAAY,GAAW,GAAW;EAChC,KAAK,IAAI;EACT,KAAK,IAAI;CACX;;CAGA,OAAO,GAAG,GAAW,GAAiB;EACpC,OAAO,IAAI,KAAK,GAAG,CAAC;CACtB;;CAEA,OAAO,OAAO,GAAiB;EAC7B,OAAO,IAAI,KAAK,GAAG,CAAC;CACtB;;CAEA,OAAgB,OAAa,IAAI,KAAK,GAAG,CAAC;;CAE1C,OAAgB,MAAY,IAAI,KAAK,GAAG,CAAC;CAEzC,IAAI,GAAe;EACjB,OAAO,IAAI,KAAK,KAAK,IAAI,EAAE,GAAG,KAAK,IAAI,EAAE,CAAC;CAC5C;CACA,SAAS,GAAe;EACtB,OAAO,IAAI,KAAK,KAAK,IAAI,EAAE,GAAG,KAAK,IAAI,EAAE,CAAC;CAC5C;;CAEA,SAAS,GAAe;EACtB,OAAO,IAAI,KAAK,KAAK,IAAI,EAAE,GAAG,KAAK,IAAI,EAAE,CAAC;CAC5C;;CAEA,OAAO,GAAe;EACpB,OAAO,IAAI,KAAK,KAAK,IAAI,EAAE,GAAG,KAAK,IAAI,EAAE,CAAC;CAC5C;;CAEA,IAAI,GAAe;EACjB,OAAO,IAAI,KAAK,KAAK,IAAI,KAAK,GAAG,EAAE,CAAC,GAAG,KAAK,IAAI,KAAK,GAAG,EAAE,CAAC,CAAC;CAC9D;;CAEA,IAAI,GAAe;EACjB,OAAO,IAAI,KAAK,KAAK,IAAI,KAAK,GAAG,EAAE,CAAC,GAAG,KAAK,IAAI,KAAK,GAAG,EAAE,CAAC,CAAC;CAC9D;CACA,MAAM,GAAiB;EACrB,OAAO,IAAI,KAAK,K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;EAC7B,KAAK,CAAC;EACN,KAAK,CAAC;EACN,SAAS,CAAC;CACZ;AACF,CAAC;;;;ACtED,IAAa,KAAb,MAAgB;CACd;CAEA,YAAY,IAAmC;EAC7C,KAAK,KAAK;CACZ;CACA,OAAO,GAAG,MAAmC;EAC3C,OAAQ,KAAK,GAA6C,GAAG,IAAI;CACnE;AACF;;AAMA,MAAa,WAAoC,aAA8B;CAC7E,MAAM;CACN,KAAK,MAAwB,aAAa;CAC1C,KAAK,EAAE,QAAQ,CAAC,EAAE;AACpB,CAAC;;;;;AAMD,IAAa,QAAb,MAAa,MAAS;CACpB;CACA;CAEA,YAAoB,KAAc,OAAsB;EACtD,KAAK,OAAO;EACZ,KAAK,SAAS;CAChB;CACA,OAAO,IAAO,OAAoB;EAChC,OAAO,IAAI,MAAS,MAAM,KAAK;CACjC;CACA,OAAO,SAA8B;EACnC,OAAO,IAAI,MAAS,OAAO,KAAA,CAAS;CACtC;CACA,QAAiB;EACf,OAAO,KAAK;CACd;CACA,WAAoB;EAClB,OAAO,CAAC,KAAK;CACf;CACA,IAAO,GAA8B;EACnC,OAAO,KAAK,OAAO,MAAM,IAAI,EAAE,KAAK,MAAW,CAAC,IAAI,MAAM,OAAU;CACtE;CACA,MAAS,GAAqC;EAC5C,OAAO,KAAK,OAAO,EAAE,KAAK,MAAW,IAAI,MAAM,OAAU;CAC3D;CACA,QAAW,UAAoB;EAC7B,OAAO,KAAK,OAAQ,KAAK,SAAe;CAC1C;AACF;;AAMA,MAAa,cAAyD,aAAgD;CACpH,MAAM;CACN,KAAK,MAAoC,aAAa;CACtD,KAAK;EAAE,OAAO,CAAC;EAAG,UAAU,CAAC;EAAG,KAAK,CAAC;EAAG,OAAO,CAAC;EAAG,SAAS,CAAC;CAAE;AAClE,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../src/vec2.ts","../src/xy.ts","../src/ndvector.ts","../src/date.ts","../src/scalars.ts","../src/text.ts","../src/color.ts","../src/angle.ts","../src/wrappers.ts"],"sourcesContent":["import { defineDomain, type Domain, type FnOp, type OpTable } from \"@mark1russell7/vex\";\n\n/**\n * An immutable 2D vector. The methods live on the prototype, so a vector costs two numbers. Division is real\n * division: a division by zero gives an infinite component, and the domain check turns it into `#NUM!`.\n */\nexport class Vec2 {\n readonly x: number;\n readonly y: number;\n\n constructor(x: number, y: number) {\n this.x = x;\n this.y = y;\n }\n\n /** This function makes a vector. */\n static of(x: number, y: number): Vec2 {\n return new Vec2(x, y);\n }\n /** This function makes a vector with the same value in both components. */\n static scalar(n: number): Vec2 {\n return new Vec2(n, n);\n }\n /** The zero vector. */\n static readonly zero: Vec2 = new Vec2(0, 0);\n /** The vector of ones. */\n static readonly one: Vec2 = new Vec2(1, 1);\n\n add(o: Vec2): Vec2 {\n return new Vec2(this.x + o.x, this.y + o.y);\n }\n subtract(o: Vec2): Vec2 {\n return new Vec2(this.x - o.x, this.y - o.y);\n }\n /** The component-wise product. */\n multiply(o: Vec2): Vec2 {\n return new Vec2(this.x * o.x, this.y * o.y);\n }\n /** The component-wise quotient. A zero component of `o` gives an infinite component. */\n divide(o: Vec2): Vec2 {\n return new Vec2(this.x / o.x, this.y / o.y);\n }\n /** The component-wise minimum. */\n min(o: Vec2): Vec2 {\n return new Vec2(Math.min(this.x, o.x), Math.min(this.y, o.y));\n }\n /** The component-wise maximum. */\n max(o: Vec2): Vec2 {\n return new Vec2(Math.max(this.x, o.x), Math.max(this.y, o.y));\n }\n scale(k: number): Vec2 {\n return new Vec2(this.x * k, this.y * k);\n }\n negate(): Vec2 {\n return new Vec2(-this.x, -this.y);\n }\n halve(): Vec2 {\n return this.scale(0.5);\n }\n abs(): Vec2 {\n return new Vec2(Math.abs(this.x), Math.abs(this.y));\n }\n round(): Vec2 {\n return new Vec2(Math.round(this.x), Math.round(this.y));\n }\n floor(): Vec2 {\n return new Vec2(Math.floor(this.x), Math.floor(this.y));\n }\n ceil(): Vec2 {\n return new Vec2(Math.ceil(this.x), Math.ceil(this.y));\n }\n clamp(lo: number, hi: number): Vec2 {\n return new Vec2(Math.min(hi, Math.max(lo, this.x)), Math.min(hi, Math.max(lo, this.y)));\n }\n swap(): Vec2 {\n return new Vec2(this.y, this.x);\n }\n /**\n * The vector with `main` along the unit axis of this vector and `cross` on the other axis: `this * main + swap(this) *\n * cross`. For the axis (1, 0) it is (main, cross), and for the axis (0, 1) it is (cross, main).\n */\n compose(main: number, cross: number): Vec2 {\n return new Vec2(this.x * main + this.y * cross, this.y * main + this.x * cross);\n }\n /**\n * The component-wise choice: a component of `a` where this mask has a component that is not 0, else the component\n * of `b`. Thus `hi.select(v.min(hi), v)` bounds each component of `v` by `hi`, and a 0 in `hi` sets no bound.\n */\n select(a: Vec2, b: Vec2): Vec2 {\n return new Vec2(this.x !== 0 ? a.x : b.x, this.y !== 0 ? a.y : b.y);\n }\n /** The vector turned by `radians`, counterclockwise. */\n rotate(radians: number): Vec2 {\n const c = Math.cos(radians);\n const s = Math.sin(radians);\n return new Vec2(c * this.x - s * this.y, s * this.x + c * this.y);\n }\n /** The vector with length 1. The zero vector stays zero. */\n normalize(): Vec2 {\n const len = this.length();\n return len === 0 ? this : this.scale(1 / len);\n }\n /** The linear interpolation from this vector to `o`. */\n lerp(o: Vec2, t: number): Vec2 {\n return new Vec2(this.x + (o.x - this.x) * t, this.y + (o.y - this.y) * t);\n }\n length(): number {\n return Math.hypot(this.x, this.y);\n }\n lengthSq(): number {\n return this.x * this.x + this.y * this.y;\n }\n distance(o: Vec2): number {\n return Math.hypot(this.x - o.x, this.y - o.y);\n }\n dot(o: Vec2): number {\n return this.x * o.x + this.y * o.y;\n }\n /** The component along the unit axis `dir`: `dot(this, dir)`. For the axis (1, 0) it is x, and for (0, 1) it is y. */\n along(dir: Vec2): number {\n return this.x * dir.x + this.y * dir.y;\n }\n /** The component on the other axis of the unit axis `dir`: `dot(this, swap(dir))`. For the axis (1, 0) it is y. */\n across(dir: Vec2): number {\n return this.x * dir.y + this.y * dir.x;\n }\n /** The z component of the 3D cross product. */\n cross(o: Vec2): number {\n return this.x * o.y - this.y * o.x;\n }\n /** The angle of the vector, in radians, from the x axis. */\n angle(): number {\n return Math.atan2(this.y, this.x);\n }\n /** The product of the components: the area of a size vector. */\n area(): number {\n return this.x * this.y;\n }\n /** The sum of the components. */\n sum(): number {\n return this.x + this.y;\n }\n minComponent(): number {\n return Math.min(this.x, this.y);\n }\n maxComponent(): number {\n return Math.max(this.x, this.y);\n }\n equals(o: Vec2): boolean {\n return this.x === o.x && this.y === o.y;\n }\n anyNonPositive(): boolean {\n return this.x <= 0 || this.y <= 0;\n }\n allPositive(): boolean {\n return this.x > 0 && this.y > 0;\n }\n anyNegative(): boolean {\n return this.x < 0 || this.y < 0;\n }\n allNonNegative(): boolean {\n return this.x >= 0 && this.y >= 0;\n }\n anyZero(): boolean {\n return this.x === 0 || this.y === 0;\n }\n allZero(): boolean {\n return this.x === 0 && this.y === 0;\n }\n anyLessThan(n: number): boolean {\n return this.x < n || this.y < n;\n }\n allLessThan(n: number): boolean {\n return this.x < n && this.y < n;\n }\n anyGreaterThan(n: number): boolean {\n return this.x > n || this.y > n;\n }\n allGreaterThan(n: number): boolean {\n return this.x > n && this.y > n;\n }\n toJSON(): { readonly x: number; readonly y: number } {\n return { x: this.x, y: this.y };\n }\n toString(): string {\n return `(${this.x}, ${this.y})`;\n }\n}\n\ntype Vec2OpNames =\n | \"add\" | \"subtract\" | \"multiply\" | \"divide\" | \"min\" | \"max\" | \"scale\" | \"negate\" | \"halve\" | \"abs\" | \"round\"\n | \"floor\" | \"ceil\" | \"clamp\" | \"swap\" | \"compose\" | \"select\" | \"rotate\" | \"normalize\" | \"lerp\" | \"length\"\n | \"lengthSq\" | \"distance\" | \"dot\" | \"along\" | \"across\" | \"cross\" | \"angle\" | \"area\" | \"sum\" | \"minComponent\"\n | \"maxComponent\" | \"equals\" | \"anyNonPositive\" | \"allPositive\" | \"anyNegative\" | \"allNonNegative\" | \"anyZero\"\n | \"allZero\" | \"anyLessThan\" | \"allLessThan\" | \"anyGreaterThan\" | \"allGreaterThan\";\n\n/** The ops of `Vec2Domain`. The ops `x` and `y` give a component. */\nexport type Vec2Ops = OpTable<Vec2, Vec2OpNames, \"add\" | \"subtract\" | \"multiply\" | \"divide\" | \"min\" | \"max\" | \"select\"> & {\n readonly x: FnOp<Vec2, (v: Vec2) => number>;\n readonly y: FnOp<Vec2, (v: Vec2) => number>;\n};\n\n/** The domain of 2D vectors. A number argument of a component-wise op lifts to a vector with that value twice. */\nexport const Vec2Domain: Domain<\"Vec2\", Vec2, Vec2Ops> = defineDomain<\"Vec2\", Vec2, Vec2Ops>({\n name: \"Vec2\",\n is: (u: unknown): u is Vec2 => u instanceof Vec2,\n fromScalar: (n: number): Vec2 => Vec2.scalar(n),\n valid: (v: Vec2): boolean => Number.isFinite(v.x) && Number.isFinite(v.y),\n show: (v: Vec2): string => v.toString(),\n encode: (v: Vec2): readonly [number, number] => [v.x, v.y],\n decode: (u: unknown): Vec2 => {\n // Stryker disable next-line ArrayDeclaration: a list with a text gives NaN components, like the empty list\n const [x, y] = Array.isArray(u) ? (u as readonly unknown[]) : [];\n return new Vec2(typeof x === \"number\" ? x : Number.NaN, typeof y === \"number\" ? y : Number.NaN);\n },\n ops: {\n // The components are fields of a vector, not methods, so these two ops are functions.\n x: { fn: (v: Vec2): number => v.x, params: [], returns: \"number\" },\n y: { fn: (v: Vec2): number => v.y, params: [], returns: \"number\" },\n add: { laws: [\"commutative\", \"associative\"], identity: () => Vec2.zero, liftScalar: true, params: [\"domain\"], returns: \"domain\" },\n subtract: { liftScalar: true, params: [\"domain\"], returns: \"domain\" },\n multiply: { laws: [\"commutative\", \"associative\"], identity: () => Vec2.one, liftScalar: true, params: [\"domain\"], returns: \"domain\" },\n divide: { liftScalar: true, params: [\"domain\"], returns: \"domain\" },\n min: { laws: [\"commutative\", \"associative\", \"idempotent\"], liftScalar: true, params: [\"domain\"], returns: \"domain\" },\n max: { laws: [\"commutative\", \"associative\", \"idempotent\"], liftScalar: true, params: [\"domain\"], returns: \"domain\" },\n scale: { params: [\"number\"], returns: \"domain\" },\n negate: { params: [], returns: \"domain\" },\n halve: { params: [], returns: \"domain\" },\n abs: { params: [], returns: \"domain\" },\n round: { params: [], returns: \"domain\" },\n floor: { params: [], returns: \"domain\" },\n ceil: { params: [], returns: \"domain\" },\n clamp: { params: [\"number\", \"number\"], returns: \"domain\" },\n swap: { params: [], returns: \"domain\" },\n compose: { params: [\"number\", \"number\"], returns: \"domain\" },\n select: { liftScalar: true, params: [\"domain\", \"domain\"], returns: \"domain\" },\n rotate: { params: [\"number\"], returns: \"domain\" },\n normalize: { params: [], returns: \"domain\" },\n lerp: { params: [\"domain\", \"number\"], returns: \"domain\" },\n length: { params: [], returns: \"number\" },\n lengthSq: { params: [], returns: \"number\" },\n distance: { params: [\"domain\"], returns: \"number\" },\n dot: { laws: [\"commutative\"], params: [\"domain\"], returns: \"number\" },\n along: { params: [\"domain\"], returns: \"number\" },\n across: { params: [\"domain\"], returns: \"number\" },\n cross: { params: [\"domain\"], returns: \"number\" },\n angle: { params: [], returns: \"number\" },\n area: { params: [], returns: \"number\" },\n sum: { params: [], returns: \"number\" },\n minComponent: { params: [], returns: \"number\" },\n maxComponent: { params: [], returns: \"number\" },\n equals: { laws: [\"commutative\"], params: [\"domain\"], returns: \"boolean\" },\n anyNonPositive: { params: [], returns: \"boolean\" },\n allPositive: { params: [], returns: \"boolean\" },\n anyNegative: { params: [], returns: \"boolean\" },\n allNonNegative: { params: [], returns: \"boolean\" },\n anyZero: { params: [], returns: \"boolean\" },\n allZero: { params: [], returns: \"boolean\" },\n anyLessThan: { params: [\"number\"], returns: \"boolean\" },\n allLessThan: { params: [\"number\"], returns: \"boolean\" },\n anyGreaterThan: { params: [\"number\"], returns: \"boolean\" },\n allGreaterThan: { params: [\"number\"], returns: \"boolean\" },\n },\n});\n","import { defineDomain, type Domain, type FnOp } from \"@mark1russell7/vex\";\n\n/**\n * A 2D vector as plain data. `XYDomain` has the component-wise ops of `Vec2Domain`, but each op is a function of plain\n * data. Thus a standalone module of `@mark1russell7/vex-compiler` can copy the domain, and a 2D program can be a module.\n */\nexport interface XY {\n readonly x: number;\n readonly y: number;\n}\n\ntype XYFn2 = (a: XY, b: XY) => XY;\ntype XYFn1 = (a: XY) => XY;\ntype XYNum1 = (a: XY) => number;\n\n/** The ops of `XYDomain`. */\nexport type XYOps = {\n readonly x: FnOp<XY, XYNum1>;\n readonly y: FnOp<XY, XYNum1>;\n readonly add: FnOp<XY, XYFn2>;\n readonly subtract: FnOp<XY, XYFn2>;\n readonly multiply: FnOp<XY, XYFn2>;\n readonly divide: FnOp<XY, XYFn2>;\n readonly min: FnOp<XY, XYFn2>;\n readonly max: FnOp<XY, XYFn2>;\n readonly scale: FnOp<XY, (a: XY, k: number) => XY>;\n readonly negate: FnOp<XY, XYFn1>;\n readonly abs: FnOp<XY, XYFn1>;\n readonly floor: FnOp<XY, XYFn1>;\n readonly ceil: FnOp<XY, XYFn1>;\n readonly round: FnOp<XY, XYFn1>;\n readonly dot: FnOp<XY, (a: XY, b: XY) => number>;\n readonly length: FnOp<XY, XYNum1>;\n readonly distance: FnOp<XY, (a: XY, b: XY) => number>;\n readonly area: FnOp<XY, XYNum1>;\n readonly sum: FnOp<XY, XYNum1>;\n readonly equals: FnOp<XY, (a: XY, b: XY) => boolean>;\n};\n\n/**\n * The domain of 2D vectors as plain data: an object with the two number fields `x` and `y` and no other field. The op\n * `xy` of `NumDomain` makes one. No op lifts a number, so each op has a static site in a module. Put `XYDomain` before\n * `NumRecordDomain`, because a record of numbers accepts the same objects.\n */\nexport const XYDomain: Domain<\"XY\", XY, XYOps> = defineDomain<\"XY\", XY, XYOps>({\n name: \"XY\",\n // A plain object: its prototype is Object.prototype or null, so an instance of a class such as Vec2 is not an XY.\n is: (u: unknown): u is XY => typeof u === \"object\" && u !== null && [Object.prototype, null].includes(Object.getPrototypeOf(u) as object | null) && Object.keys(u).length === 2 && typeof (u as XY).x === \"number\" && typeof (u as XY).y === \"number\",\n valid: (v: XY): boolean => Number.isFinite(v.x) && Number.isFinite(v.y),\n show: (v: XY): string => `(${v.x}, ${v.y})`,\n samples: (): readonly XY[] => [{ x: 0, y: 0 }, { x: 1.5, y: -2 }, { x: 3, y: 4 }],\n ops: {\n x: { fn: (a: XY): number => a.x, params: [], returns: \"number\" },\n y: { fn: (a: XY): number => a.y, params: [], returns: \"number\" },\n add: { fn: (a: XY, b: XY): XY => ({ x: a.x + b.x, y: a.y + b.y }), laws: [\"commutative\", \"associative\"], identity: (): XY => ({ x: 0, y: 0 }), params: [\"domain\"], returns: \"domain\" },\n subtract: { fn: (a: XY, b: XY): XY => ({ x: a.x - b.x, y: a.y - b.y }), params: [\"domain\"], returns: \"domain\" },\n multiply: { fn: (a: XY, b: XY): XY => ({ x: a.x * b.x, y: a.y * b.y }), laws: [\"commutative\", \"associative\"], identity: (): XY => ({ x: 1, y: 1 }), params: [\"domain\"], returns: \"domain\" },\n divide: { fn: (a: XY, b: XY): XY => ({ x: a.x / b.x, y: a.y / b.y }), params: [\"domain\"], returns: \"domain\" },\n min: { fn: (a: XY, b: XY): XY => ({ x: Math.min(a.x, b.x), y: Math.min(a.y, b.y) }), laws: [\"commutative\", \"associative\", \"idempotent\"], params: [\"domain\"], returns: \"domain\" },\n max: { fn: (a: XY, b: XY): XY => ({ x: Math.max(a.x, b.x), y: Math.max(a.y, b.y) }), laws: [\"commutative\", \"associative\", \"idempotent\"], params: [\"domain\"], returns: \"domain\" },\n scale: { fn: (a: XY, k: number): XY => ({ x: a.x * k, y: a.y * k }), params: [\"number\"], returns: \"domain\" },\n negate: { fn: (a: XY): XY => ({ x: -a.x, y: -a.y }), params: [], returns: \"domain\" },\n abs: { fn: (a: XY): XY => ({ x: Math.abs(a.x), y: Math.abs(a.y) }), params: [], returns: \"domain\" },\n floor: { fn: (a: XY): XY => ({ x: Math.floor(a.x), y: Math.floor(a.y) }), params: [], returns: \"domain\" },\n ceil: { fn: (a: XY): XY => ({ x: Math.ceil(a.x), y: Math.ceil(a.y) }), params: [], returns: \"domain\" },\n round: { fn: (a: XY): XY => ({ x: Math.round(a.x), y: Math.round(a.y) }), params: [], returns: \"domain\" },\n dot: { fn: (a: XY, b: XY): number => a.x * b.x + a.y * b.y, laws: [\"commutative\"], params: [\"domain\"], returns: \"number\" },\n length: { fn: (a: XY): number => Math.hypot(a.x, a.y), params: [], returns: \"number\" },\n distance: { fn: (a: XY, b: XY): number => Math.hypot(a.x - b.x, a.y - b.y), laws: [\"commutative\"], params: [\"domain\"], returns: \"number\" },\n area: { fn: (a: XY): number => a.x * a.y, params: [], returns: \"number\" },\n sum: { fn: (a: XY): number => a.x + a.y, params: [], returns: \"number\" },\n equals: { fn: (a: XY, b: XY): boolean => a.x === b.x && a.y === b.y, laws: [\"commutative\"], params: [\"domain\"], returns: \"boolean\" },\n },\n});\n","import { defineDomain, type Domain, type FnOp, type OpTable } from \"@mark1russell7/vex\";\n\n/**\n * An immutable vector with named components. The type parameter `K` is the set of component names. Ops that\n * combine two vectors use the union of their names, and a missing component counts as 0. The constructor\n * keeps each number, also a number that is not finite: the domain check reports such a value as `#NUM!`.\n */\nexport class NDVector<K extends string = string> {\n /** The components: name to number. */\n readonly c: Readonly<Record<K, number>>;\n\n constructor(c: Readonly<Record<K, number>>) {\n this.c = Object.freeze({ ...c });\n }\n\n /** This function makes a vector from name and value pairs. */\n static of<K extends string>(entries: readonly (readonly [K, number])[]): NDVector<K> {\n const c = {} as Record<K, number>;\n for (const [k, v] of entries) c[k] = v;\n return new NDVector(c);\n }\n /** This function makes the zero vector over the names `keys`. */\n static zero<K extends string>(keys: readonly K[] = []): NDVector<K> {\n return NDVector.of(keys.map((k) => [k, 0] as const));\n }\n\n /** The names of the components. */\n keys(): readonly K[] {\n return Object.keys(this.c) as K[];\n }\n /** The value of a component, or 0 if the vector does not have it. */\n get(k: string): number {\n return Object.hasOwn(this.c, k) ? Number((this.c as Readonly<Record<string, number>>)[k]) : 0;\n }\n set<K2 extends string>(k: K2, v: number): NDVector<K | K2> {\n return new NDVector({ ...this.c, [k]: v } as Record<K | K2, number>);\n }\n map(f: (name: K, v: number) => number): NDVector<K> {\n const c = {} as Record<K, number>;\n for (const k of this.keys()) c[k] = f(k, this.get(k));\n return new NDVector(c);\n }\n /** The vector with only the names in `keys`. A zero component is dropped, unless `keepZeros` is true. */\n pick<K2 extends K>(keys: readonly K2[], keepZeros = false): NDVector<K2> {\n const c = {} as Record<K2, number>;\n for (const k of keys) {\n const v = this.get(k);\n if (keepZeros || v !== 0) c[k] = v;\n }\n return new NDVector(c);\n }\n /** The vector with the names in `keys` added. A new component is 0. */\n withKeys<K2 extends string>(keys: readonly K2[]): NDVector<K | K2> {\n const c = { ...this.c } as Record<K | K2, number>;\n for (const k of keys) if (!Object.hasOwn(c, k)) c[k] = 0;\n return new NDVector(c);\n }\n #combine<K2 extends string>(o: NDVector<K2>, f: (a: number, b: number) => number): NDVector<K | K2> {\n const c = {} as Record<K | K2, number>;\n for (const k of new Set<K | K2>([...this.keys(), ...o.keys()])) c[k] = f(this.get(k), o.get(k));\n return new NDVector(c);\n }\n add<K2 extends string>(o: NDVector<K2>): NDVector<K | K2> {\n return this.#combine(o, (a, b) => a + b);\n }\n subtract<K2 extends string>(o: NDVector<K2>): NDVector<K | K2> {\n return this.#combine(o, (a, b) => a - b);\n }\n /** The component-wise product. */\n multiply<K2 extends string>(o: NDVector<K2>): NDVector<K | K2> {\n return this.#combine(o, (a, b) => a * b);\n }\n /** The component-wise minimum. A component that one vector does not have counts as 0. */\n min<K2 extends string>(o: NDVector<K2>): NDVector<K | K2> {\n return this.#combine(o, (a, b) => Math.min(a, b));\n }\n /** The component-wise maximum. A component that one vector does not have counts as 0. */\n max<K2 extends string>(o: NDVector<K2>): NDVector<K | K2> {\n return this.#combine(o, (a, b) => Math.max(a, b));\n }\n /** Of each component, the value of this vector if it is not 0, else the value of `o`. */\n mergePreferNonZero<K2 extends string>(o: NDVector<K2>): NDVector<K | K2> {\n return this.#combine(o, (a, b) => (a !== 0 ? a : b));\n }\n scale(k: number): NDVector<K> {\n return this.map((_n, v) => v * k);\n }\n clamp(lo: number, hi: number): NDVector<K> {\n return this.map((_n, v) => Math.min(hi, Math.max(lo, v)));\n }\n dot(o: NDVector): number {\n let s = 0;\n for (const k of new Set<string>([...this.keys(), ...o.keys()])) s += this.get(k) * o.get(k);\n return s;\n }\n /** The L2 length. */\n length(): number {\n return Math.sqrt(this.keys().reduce((s, k) => s + this.get(k) ** 2, 0));\n }\n /** The L1 norm. */\n norm1(): number {\n return this.keys().reduce((s, k) => s + Math.abs(this.get(k)), 0);\n }\n /** The largest absolute component. */\n normInf(): number {\n return this.keys().reduce((m, k) => Math.max(m, Math.abs(this.get(k))), 0);\n }\n equals(o: NDVector): boolean {\n const keys = new Set<string>([...this.keys(), ...o.keys()]);\n for (const k of keys) if (this.get(k) !== o.get(k)) return false;\n return true;\n }\n /** True if each component is a finite number. */\n isFinite(): boolean {\n return this.keys().every((k) => Number.isFinite(this.get(k)));\n }\n toJSON(): Readonly<Record<K, number>> {\n return { ...this.c };\n }\n toString(): string {\n return `NDVector(${JSON.stringify(this.c)})`;\n }\n}\n\ntype NDOpNames =\n | \"add\" | \"subtract\" | \"multiply\" | \"min\" | \"max\" | \"mergePreferNonZero\" | \"scale\" | \"clamp\" | \"dot\" | \"length\" | \"norm1\" | \"normInf\"\n | \"equals\" | \"pick\" | \"withKeys\" | \"get\" | \"set\";\n\n/** The ops of `NDVectorDomain`. No op lifts numbers. */\nexport type NDVectorOps = OpTable<NDVector, NDOpNames>;\n\n/** The ops of `LiftedNDVectorDomain`. */\nexport type LiftedNDVectorOps = OpTable<NDVector, NDOpNames, \"add\" | \"subtract\" | \"multiply\" | \"dot\">;\n\nconst ndOps = {\n add: { laws: [\"commutative\", \"associative\"], identity: (): NDVector => NDVector.zero(), params: [\"domain\"] },\n subtract: { params: [\"domain\"] },\n multiply: { laws: [\"commutative\", \"associative\"], params: [\"domain\"] },\n min: { laws: [\"commutative\", \"associative\", \"idempotent\"], params: [\"domain\"] },\n max: { laws: [\"commutative\", \"associative\", \"idempotent\"], params: [\"domain\"] },\n mergePreferNonZero: { laws: [\"associative\", \"idempotent\"], params: [\"domain\"] },\n scale: { params: [\"number\"] },\n clamp: { params: [\"number\", \"number\"] },\n dot: { laws: [\"commutative\"], params: [\"domain\"] },\n length: {},\n norm1: {},\n normInf: {},\n equals: { laws: [\"commutative\"], params: [\"domain\"] },\n pick: {},\n withKeys: {},\n get: { params: [\"string\"] },\n set: { params: [\"string\", \"number\"] },\n} as const satisfies NDVectorOps;\n\nconst isNDVector = (u: unknown): u is NDVector => u instanceof NDVector;\n\n/** The domain of named-component vectors. A number argument is an error here: use `LiftedNDVectorDomain` to lift. */\nexport const NDVectorDomain: Domain<\"NDVector\", NDVector, NDVectorOps> = defineDomain<\"NDVector\", NDVector, NDVectorOps>({\n name: \"NDVector\",\n is: isNDVector,\n valid: (v: NDVector): boolean => v.isFinite(),\n show: (v: NDVector): string => v.toString(),\n encode: (v: NDVector): unknown => v.toJSON(),\n decode: (u: unknown): NDVector => new NDVector(u as Readonly<Record<string, number>>),\n ops: ndOps,\n});\n\n/**\n * The domain of named-component vectors with scalar lifting. A number argument of `add`, `subtract`,\n * `multiply` or `dot` becomes the vector `{ scalar: n }`. This domain is independent of `NDVectorDomain`:\n * the two can be in one program, and neither changes the other.\n */\nexport const LiftedNDVectorDomain: Domain<\"NDVector(lifted)\", NDVector, LiftedNDVectorOps> = defineDomain<\"NDVector(lifted)\", NDVector, LiftedNDVectorOps>({\n name: \"NDVector(lifted)\",\n is: isNDVector,\n fromScalar: (n: number): NDVector => new NDVector({ scalar: n }),\n valid: (v: NDVector): boolean => v.isFinite(),\n show: (v: NDVector): string => v.toString(),\n ops: {\n ...ndOps,\n add: { ...ndOps.add, liftScalar: true },\n subtract: { ...ndOps.subtract, liftScalar: true },\n multiply: { ...ndOps.multiply, liftScalar: true },\n dot: { ...ndOps.dot, liftScalar: true },\n },\n});\n\n/** A plain record whose values are finite numbers. */\nexport type NumRecord = Readonly<Record<string, number>>;\n\n/** The ops of `NumRecordDomain`. */\nexport type NumRecordOps = {\n readonly toNDVector: FnOp<NumRecord, (r: NumRecord) => NDVector>;\n};\n\nconst isNumRecord = (u: unknown): u is NumRecord => {\n if (typeof u !== \"object\" || u === null || Array.isArray(u)) return false;\n const proto: unknown = Object.getPrototypeOf(u);\n // Number.isFinite gives false for each value that is not a number.\n return (proto === Object.prototype || proto === null) && Object.values(u).every((v) => Number.isFinite(v));\n};\n\n/** The domain of plain number records. Its op `toNDVector` builds a vector from fields, for example from `rec()`. */\nexport const NumRecordDomain: Domain<\"NumRecord\", NumRecord, NumRecordOps> = defineDomain<\"NumRecord\", NumRecord, NumRecordOps>({\n name: \"NumRecord\",\n is: isNumRecord,\n ops: {\n toNDVector: { fn: (r: NumRecord): NDVector => new NDVector(r) },\n },\n});\n","import { defineDomain, type Domain, type OpTable } from \"@mark1russell7/vex\";\n\nconst MS_PER_DAY = 86_400_000;\n\n/** The largest distance from 1970-01-01 in days. The `Date` of JavaScript has the same range. */\nexport const MAX_DAYS = 100_000_000;\n\nconst ISO = /^([+-]?\\d{4,6})-(\\d{2})-(\\d{2})$/;\n\n/** This function gives the `Date` of JavaScript at 00:00 UTC of a day. */\nconst utc = (days: number): Date => new Date(days * MS_PER_DAY);\n\n/**\n * An immutable day of the calendar, without a time and without a time zone. It keeps the number of days since\n * 1970-01-01, so the arithmetic of days is the arithmetic of numbers. The calendar is the Gregorian calendar, also\n * before 1582.\n */\nexport class LocalDate {\n /** The number of days since 1970-01-01. */\n readonly days: number;\n\n constructor(days: number) {\n this.days = days;\n }\n\n /**\n * This function makes a date from a year, a month from 1 to 12, and a day. A month or a day outside its range rolls\n * over, like the function `DATE` of a spreadsheet. Thus month 13 is January of the next year, and day 0 is the last\n * day of the month before. A number that is not whole gives a date that is not valid.\n */\n static of(year: number, month: number, day: number): LocalDate {\n if (![year, month, day].every(Number.isSafeInteger)) return new LocalDate(Number.NaN);\n // setUTCFullYear does not change the years 0 to 99 into 1900 to 1999, but Date.UTC does.\n const d = new Date(0);\n d.setUTCFullYear(year, month - 1, day);\n return new LocalDate(Math.round(d.getTime() / MS_PER_DAY));\n }\n\n /** This function reads a date in the form `YYYY-MM-DD`. A day that does not exist, for example `2026-02-30`, gives `undefined`. */\n static parse(text: string): LocalDate | undefined {\n const m = ISO.exec(text.trim());\n if (m === null) return undefined;\n const [y, mo, d] = [Number(m[1]), Number(m[2]), Number(m[3])];\n const date = LocalDate.of(y, mo, d);\n // A month or a day outside its range rolls over into another month, so the month tells if the day exists.\n return date.month() === mo ? date : undefined;\n }\n\n /** The year. */\n year(): number {\n return utc(this.days).getUTCFullYear();\n }\n /** The month, from 1 to 12. */\n month(): number {\n return utc(this.days).getUTCMonth() + 1;\n }\n /** The day of the month, from 1 to 31. */\n day(): number {\n return utc(this.days).getUTCDate();\n }\n /** The day of the week, from 1 (Sunday) to 7 (Saturday), like `WEEKDAY` of a spreadsheet. */\n weekday(): number {\n return utc(this.days).getUTCDay() + 1;\n }\n /** The date `n` days later. A negative `n` goes back. */\n add(n: number): LocalDate {\n return new LocalDate(this.days + n);\n }\n /** The number of days from the date `x` to this date, or the date `x` days before this date. */\n subtract(x: LocalDate | number): LocalDate | number {\n return x instanceof LocalDate ? this.days - x.days : new LocalDate(this.days - x);\n }\n /**\n * The same day `n` months later, like `EDATE` of a spreadsheet. When that month is shorter, the result is its last\n * day: one month after 31 January is the last day of February.\n */\n addMonths(n: number): LocalDate {\n // LocalDate.of gives a date that is not valid for a number of months that is not whole.\n const first = LocalDate.of(this.year(), this.month() + n, 1);\n const last = LocalDate.of(first.year(), first.month() + 1, 0);\n return new LocalDate(Math.min(first.days + this.day() - 1, last.days));\n }\n /** The last day of the month `n` months later, like `EOMONTH` of a spreadsheet. */\n endOfMonth(n: number): LocalDate {\n return LocalDate.of(this.year(), this.month() + n + 1, 0);\n }\n gt(o: LocalDate): boolean {\n return this.days > o.days;\n }\n gte(o: LocalDate): boolean {\n return this.days >= o.days;\n }\n lt(o: LocalDate): boolean {\n return this.days < o.days;\n }\n lte(o: LocalDate): boolean {\n return this.days <= o.days;\n }\n eq(o: LocalDate): boolean {\n return this.days === o.days;\n }\n /** The form `YYYY-MM-DD`. A year before 0 or after 9999 has a sign and six digits, as in ISO 8601. */\n toString(): string {\n const y = this.year();\n // Stryker disable next-line EqualityOperator: the year 0 takes the first branch, so y < 0 and y <= 0 are the same in the second\n const year = y >= 0 && y <= 9999 ? String(y).padStart(4, \"0\") : `${y < 0 ? \"-\" : \"+\"}${String(Math.abs(y)).padStart(6, \"0\")}`;\n return `${year}-${String(this.month()).padStart(2, \"0\")}-${String(this.day()).padStart(2, \"0\")}`;\n }\n}\n\n/** The ops of `DateDomain`. */\nexport type DateOps = OpTable<LocalDate, \"add\" | \"subtract\" | \"addMonths\" | \"endOfMonth\" | \"year\" | \"month\" | \"day\" | \"weekday\" | \"gt\" | \"gte\" | \"lt\" | \"lte\" | \"eq\">;\n\n/**\n * The domain of dates. `add` takes a count of days. `subtract` takes a date, for the days between the two dates, or a\n * count of days. A valid date is a whole count of days, within `MAX_DAYS` of 1970-01-01.\n */\nexport const DateDomain: Domain<\"Date\", LocalDate, DateOps> = defineDomain<\"Date\", LocalDate, DateOps>({\n name: \"Date\",\n is: (u: unknown): u is LocalDate => u instanceof LocalDate,\n valid: (d: LocalDate): boolean => Number.isSafeInteger(d.days) && Math.abs(d.days) <= MAX_DAYS,\n show: (d: LocalDate): string => d.toString(),\n encode: (d: LocalDate): string => d.toString(),\n decode: (u: unknown): LocalDate => (typeof u === \"string\" ? LocalDate.parse(u) : undefined) ?? new LocalDate(Number.NaN),\n ops: {\n add: { params: [\"number\"] },\n subtract: { params: [\"any\"] },\n addMonths: { params: [\"number\"] },\n endOfMonth: { params: [\"number\"] },\n year: {},\n month: {},\n day: {},\n weekday: {},\n gt: { params: [\"domain\"] },\n gte: { params: [\"domain\"] },\n lt: { params: [\"domain\"] },\n lte: { params: [\"domain\"] },\n eq: { laws: [\"commutative\"], params: [\"domain\"] },\n },\n});\n","import { defineDomain, type Domain, type FnOp } from \"@mark1russell7/vex\";\nimport { LocalDate } from \"./date.ts\";\nimport { Vec2 } from \"./vec2.ts\";\nimport type { XY } from \"./xy.ts\";\n\ntype NumFn1 = (a: number) => number;\ntype NumFn2 = (a: number, b: number) => number;\ntype NumFn3 = (a: number, b: number, c: number) => number;\ntype NumTest = (a: number, b: number) => boolean;\n\n/** The ops of `NumDomain`. */\nexport type NumOps = {\n readonly add: FnOp<number, NumFn2>;\n readonly subtract: FnOp<number, NumFn2>;\n readonly multiply: FnOp<number, NumFn2>;\n readonly divide: FnOp<number, NumFn2>;\n readonly mod: FnOp<number, NumFn2>;\n readonly pow: FnOp<number, NumFn2>;\n readonly min: FnOp<number, NumFn2>;\n readonly max: FnOp<number, NumFn2>;\n readonly clamp: FnOp<number, NumFn3>;\n readonly abs: FnOp<number, NumFn1>;\n readonly negate: FnOp<number, NumFn1>;\n readonly sqrt: FnOp<number, NumFn1>;\n readonly ln: FnOp<number, NumFn1>;\n readonly exp: FnOp<number, NumFn1>;\n readonly log10: FnOp<number, NumFn1>;\n readonly sin: FnOp<number, NumFn1>;\n readonly cos: FnOp<number, NumFn1>;\n readonly asin: FnOp<number, NumFn1>;\n readonly hypot: FnOp<number, NumFn2>;\n readonly date: FnOp<number, (year: number, month: number, day: number) => LocalDate>;\n readonly vec2: FnOp<number, (x: number, y: number) => Vec2>;\n readonly xy: FnOp<number, (x: number, y: number) => XY>;\n readonly floor: FnOp<number, NumFn1>;\n readonly ceil: FnOp<number, NumFn1>;\n readonly round: FnOp<number, NumFn1>;\n readonly gt: FnOp<number, NumTest>;\n readonly gte: FnOp<number, NumTest>;\n readonly lt: FnOp<number, NumTest>;\n readonly lte: FnOp<number, NumTest>;\n readonly eq: FnOp<number, NumTest>;\n};\n\n/** The domain of numbers. A result that is not a finite number is the error `#NUM!`. */\nexport const NumDomain: Domain<\"Num\", number, NumOps> = defineDomain<\"Num\", number, NumOps>({\n name: \"Num\",\n is: (u: unknown): u is number => typeof u === \"number\",\n primitive: \"number\",\n valid: (n: number): boolean => Number.isFinite(n),\n show: (n: number): string => String(n),\n ops: {\n add: { fn: (a: number, b: number): number => a + b, laws: [\"commutative\", \"associative\"], identity: (): number => 0, params: [\"number\"], returns: \"number\" },\n subtract: { fn: (a: number, b: number): number => a - b, params: [\"number\"], returns: \"number\" },\n multiply: { fn: (a: number, b: number): number => a * b, laws: [\"commutative\", \"associative\"], identity: (): number => 1, params: [\"number\"], returns: \"number\" },\n divide: { fn: (a: number, b: number): number => a / b, params: [\"number\"], returns: \"number\" },\n mod: { fn: (a: number, b: number): number => a % b, params: [\"number\"], returns: \"number\" },\n pow: { fn: (a: number, b: number): number => a ** b, params: [\"number\"], returns: \"number\" },\n min: { fn: (a: number, b: number): number => Math.min(a, b), laws: [\"commutative\", \"associative\", \"idempotent\"], params: [\"number\"], returns: \"number\" },\n max: { fn: (a: number, b: number): number => Math.max(a, b), laws: [\"commutative\", \"associative\", \"idempotent\"], params: [\"number\"], returns: \"number\" },\n clamp: { fn: (a: number, lo: number, hi: number): number => Math.min(hi, Math.max(lo, a)), params: [\"number\", \"number\"], returns: \"number\" },\n abs: { fn: (a: number): number => Math.abs(a), returns: \"number\" },\n negate: { fn: (a: number): number => -a, returns: \"number\" },\n sqrt: { fn: (a: number): number => Math.sqrt(a), returns: \"number\" },\n ln: { fn: (a: number): number => Math.log(a), returns: \"number\" },\n exp: { fn: (a: number): number => Math.exp(a), returns: \"number\" },\n log10: { fn: (a: number): number => Math.log10(a), returns: \"number\" },\n // The angles of sin, cos and asin are in radians.\n sin: { fn: (a: number): number => Math.sin(a), returns: \"number\" },\n cos: { fn: (a: number): number => Math.cos(a), returns: \"number\" },\n asin: { fn: (a: number): number => Math.asin(a), returns: \"number\" },\n hypot: { fn: (a: number, b: number): number => Math.hypot(a, b), laws: [\"commutative\"], params: [\"number\"], returns: \"number\" },\n // The year is the receiver: date(year, month, day). The result is a LocalDate, so a chain continues in DateDomain.\n date: { fn: (year: number, month: number, day: number): LocalDate => LocalDate.of(year, month, day), params: [\"number\", \"number\"] },\n // The x component is the receiver: vec2(x, y). The result is a Vec2, so a chain continues in Vec2Domain.\n vec2: { fn: (x: number, y: number): Vec2 => new Vec2(x, y), params: [\"number\"] },\n // The same as plain data, for a standalone module: xy(x, y). The result is a value of XYDomain.\n xy: { fn: (x: number, y: number): XY => ({ x, y }), params: [\"number\"], returns: \"domain:XY\" },\n floor: { fn: (a: number): number => Math.floor(a), returns: \"number\" },\n ceil: { fn: (a: number): number => Math.ceil(a), returns: \"number\" },\n round: { fn: (a: number): number => Math.round(a), returns: \"number\" },\n gt: { fn: (a: number, b: number): boolean => a > b, params: [\"number\"], returns: \"boolean\" },\n gte: { fn: (a: number, b: number): boolean => a >= b, params: [\"number\"], returns: \"boolean\" },\n lt: { fn: (a: number, b: number): boolean => a < b, params: [\"number\"], returns: \"boolean\" },\n lte: { fn: (a: number, b: number): boolean => a <= b, params: [\"number\"], returns: \"boolean\" },\n eq: { fn: (a: number, b: number): boolean => a === b, laws: [\"commutative\"], params: [\"number\"], returns: \"boolean\" },\n },\n});\n\ntype BoolFn1 = (a: boolean) => boolean;\ntype BoolFn2 = (a: boolean, b: boolean) => boolean;\n\n/** The ops of `BoolDomain`. */\nexport type BoolOps = {\n readonly and: FnOp<boolean, BoolFn2>;\n readonly or: FnOp<boolean, BoolFn2>;\n readonly xor: FnOp<boolean, BoolFn2>;\n readonly not: FnOp<boolean, BoolFn1>;\n readonly eq: FnOp<boolean, BoolFn2>;\n};\n\n/** The domain of booleans. For lazy logic, use the special forms `and`, `or` and `if` of the IR. */\nexport const BoolDomain: Domain<\"Bool\", boolean, BoolOps> = defineDomain<\"Bool\", boolean, BoolOps>({\n name: \"Bool\",\n is: (u: unknown): u is boolean => typeof u === \"boolean\",\n primitive: \"boolean\",\n show: (b: boolean): string => String(b),\n ops: {\n and: { fn: (a: boolean, b: boolean): boolean => a && b, laws: [\"commutative\", \"associative\", \"idempotent\"], identity: (): boolean => true, params: [\"boolean\"], returns: \"boolean\" },\n or: { fn: (a: boolean, b: boolean): boolean => a || b, laws: [\"commutative\", \"associative\", \"idempotent\"], identity: (): boolean => false, params: [\"boolean\"], returns: \"boolean\" },\n xor: { fn: (a: boolean, b: boolean): boolean => a !== b, laws: [\"commutative\", \"associative\"], identity: (): boolean => false, params: [\"boolean\"], returns: \"boolean\" },\n not: { fn: (a: boolean): boolean => !a, returns: \"boolean\" },\n eq: { fn: (a: boolean, b: boolean): boolean => a === b, laws: [\"commutative\"], params: [\"boolean\"], returns: \"boolean\" },\n },\n});\n","/**\n * The domain of texts. The op `concat` joins a text and a value of any kind. It is the operator `&` of a\n * spreadsheet, and of the formula language of the sheet app.\n */\nimport { defineDomain, type Domain, type FnOp } from \"@mark1russell7/vex\";\n\ntype TextFn1 = (a: string) => string;\n\n/** The ops of `TextDomain`. */\nexport type TextOps = {\n readonly concat: FnOp<string, (a: string, b: unknown) => string>;\n readonly length: FnOp<string, (a: string) => number>;\n readonly upper: FnOp<string, TextFn1>;\n readonly lower: FnOp<string, TextFn1>;\n readonly trim: FnOp<string, TextFn1>;\n readonly contains: FnOp<string, (a: string, b: string) => boolean>;\n readonly eq: FnOp<string, (a: string, b: string) => boolean>;\n};\n\n/**\n * This function gives the text of a value for `concat`. A text stays. A plain record gives its JSON text. Another\n * value, for example a number or a `Vec2`, gives its own text.\n */\nconst textOf = (u: unknown): string => (typeof u === \"object\" && u !== null && Object.getPrototypeOf(u) === Object.prototype ? JSON.stringify(u) : String(u));\n\n/** The domain of texts. */\nexport const TextDomain: Domain<\"Text\", string, TextOps> = defineDomain<\"Text\", string, TextOps>({\n name: \"Text\",\n is: (u: unknown): u is string => typeof u === \"string\",\n primitive: \"string\",\n show: (s: string): string => JSON.stringify(s),\n ops: {\n concat: { fn: (a: string, b: unknown): string => a + textOf(b), params: [\"any\"], returns: \"string\" },\n // The length counts UTF-16 code units, like the function LEN of a spreadsheet.\n length: { fn: (a: string): number => a.length, returns: \"number\" },\n upper: { fn: (a: string): string => a.toUpperCase(), returns: \"string\" },\n lower: { fn: (a: string): string => a.toLowerCase(), returns: \"string\" },\n trim: { fn: (a: string): string => a.trim(), returns: \"string\" },\n contains: { fn: (a: string, b: string): boolean => a.includes(b), params: [\"string\"], returns: \"boolean\" },\n eq: { fn: (a: string, b: string): boolean => a === b, laws: [\"commutative\"], params: [\"string\"], returns: \"boolean\" },\n },\n});\n","import { defineDomain, type Domain, type OpTable } from \"@mark1russell7/vex\";\n\n/** The linear value of an sRGB channel from 0 to 255, with the sRGB transfer function of WCAG 2.1. */\nfunction linear(channel: number): number {\n const s = Math.min(1, Math.max(0, channel / 255));\n // For integer channels, the sRGB threshold 0.04045 and the WCAG threshold 0.03928 give the same result.\n return s <= 0.04045 ? s / 12.92 : ((s + 0.055) / 1.055) ** 2.4;\n}\n\n/**\n * An immutable RGBA color. The channels have no fixed range: use `clamp` to limit them. `add` adds the color\n * channels and keeps the larger alpha, so `add` is commutative and associative.\n */\nexport class Color {\n readonly r: number;\n readonly g: number;\n readonly b: number;\n readonly a: number;\n\n constructor(r: number, g: number, b: number, a = 1) {\n this.r = r;\n this.g = g;\n this.b = b;\n this.a = a;\n }\n\n /** This function makes a gray color with the value `n` in each channel. */\n static gray(n: number): Color {\n return new Color(n, n, n, 1);\n }\n /** The black color with alpha 0: the identity of `add`. */\n static readonly none: Color = new Color(0, 0, 0, 0);\n\n /** The channel sum. The alpha is the larger alpha. */\n add(o: Color): Color {\n return new Color(this.r + o.r, this.g + o.g, this.b + o.b, Math.max(this.a, o.a));\n }\n /** Each color channel times `factor`. The alpha does not change. */\n multiply(factor: number): Color {\n return new Color(this.r * factor, this.g * factor, this.b * factor, this.a);\n }\n /** Each color channel in the range from `lo` to `hi`. */\n clamp(lo = 0, hi = 255): Color {\n const c = (x: number): number => Math.min(hi, Math.max(lo, x));\n return new Color(c(this.r), c(this.g), c(this.b), this.a);\n }\n /** The linear mix from this color to `o`. */\n mix(o: Color, t: number): Color {\n const m = (x: number, y: number): number => x + (y - x) * t;\n return new Color(m(this.r, o.r), m(this.g, o.g), m(this.b, o.b), m(this.a, o.a));\n }\n /** The relative luminance (Rec. 709 weights) of the color channels. */\n luminance(): number {\n return 0.2126 * this.r + 0.7152 * this.g + 0.0722 * this.b;\n }\n /**\n * The relative luminance of WCAG 2.1, from 0 (black) to 1 (white). Each channel from 0 to 255 becomes a linear\n * value with the sRGB transfer function. A channel outside the range counts as the nearest end of the range.\n */\n relativeLuminance(): number {\n return 0.2126 * linear(this.r) + 0.7152 * linear(this.g) + 0.0722 * linear(this.b);\n }\n /** The contrast ratio of WCAG 2.1 between this color and `o`: 1 for equal luminance, 21 for black and white. */\n contrast(o: Color): number {\n const a = this.relativeLuminance();\n const b = o.relativeLuminance();\n return (Math.max(a, b) + 0.05) / (Math.min(a, b) + 0.05);\n }\n equals(o: Color): boolean {\n return this.r === o.r && this.g === o.g && this.b === o.b && this.a === o.a;\n }\n toArray(): readonly [number, number, number, number] {\n return [this.r, this.g, this.b, this.a];\n }\n toString(): string {\n return `rgba(${this.r}, ${this.g}, ${this.b}, ${this.a})`;\n }\n}\n\n/** The ops of `ColorDomain`. */\nexport type ColorOps = OpTable<Color, \"add\" | \"multiply\" | \"clamp\" | \"mix\" | \"luminance\" | \"relativeLuminance\" | \"contrast\" | \"equals\">;\n\n/** The domain of colors. */\nexport const ColorDomain: Domain<\"Color\", Color, ColorOps> = defineDomain<\"Color\", Color, ColorOps>({\n name: \"Color\",\n is: (u: unknown): u is Color => u instanceof Color,\n fromScalar: (n: number): Color => Color.gray(n),\n valid: (c: Color): boolean => c.toArray().every((x) => Number.isFinite(x)),\n show: (c: Color): string => c.toString(),\n encode: (c: Color): readonly number[] => c.toArray(),\n decode: (u: unknown): Color => {\n const [r, g, b, a] = (Array.isArray(u) ? u : []) as readonly number[];\n return new Color(r ?? Number.NaN, g ?? Number.NaN, b ?? Number.NaN, a ?? 1);\n },\n ops: {\n add: { laws: [\"commutative\", \"associative\"], identity: (): Color => Color.none, params: [\"domain\"] },\n multiply: { params: [\"number\"] },\n clamp: { params: [\"number\", \"number\"] },\n mix: { params: [\"domain\", \"number\"] },\n luminance: {},\n relativeLuminance: {},\n contrast: { laws: [\"commutative\"], params: [\"domain\"] },\n equals: { laws: [\"commutative\"], params: [\"domain\"] },\n },\n});\n","import { defineDomain, type Domain, type OpTable } from \"@mark1russell7/vex\";\nimport { Vec2 } from \"./vec2.ts\";\n\n/** An immutable angle in radians. */\nexport class Angle {\n readonly radians: number;\n\n constructor(radians: number) {\n this.radians = radians;\n }\n\n /** This function makes an angle from degrees. */\n static fromDegrees(deg: number): Angle {\n return new Angle((deg * Math.PI) / 180);\n }\n /** The zero angle: the identity of `add`. */\n static readonly zero: Angle = new Angle(0);\n\n add(o: Angle): Angle {\n return new Angle(this.radians + o.radians);\n }\n subtract(o: Angle): Angle {\n return new Angle(this.radians - o.radians);\n }\n scale(k: number): Angle {\n return new Angle(this.radians * k);\n }\n /** The same angle in the range from -π (included) to π (not included). */\n normalize(): Angle {\n const twoPi = Math.PI * 2;\n // Stryker disable next-line ArithmeticOperator: x + π and x - π differ by 2π, so the result after mod 2π is the same\n return new Angle((((this.radians + Math.PI) % twoPi) + twoPi) % twoPi - Math.PI);\n }\n /** The vector with this angle and the length `length`. The result is a `Vec2`, so a chain continues in that domain. */\n toVec2(length = 1): Vec2 {\n return new Vec2(Math.cos(this.radians) * length, Math.sin(this.radians) * length);\n }\n sin(): number {\n return Math.sin(this.radians);\n }\n cos(): number {\n return Math.cos(this.radians);\n }\n degrees(): number {\n return (this.radians * 180) / Math.PI;\n }\n toString(): string {\n return `${this.radians} rad`;\n }\n}\n\n/** The ops of `AngleDomain`. */\nexport type AngleOps = OpTable<Angle, \"add\" | \"subtract\" | \"scale\" | \"normalize\" | \"toVec2\" | \"sin\" | \"cos\" | \"degrees\", \"add\" | \"subtract\">;\n\n/** The domain of angles. A number argument of `add` or `subtract` lifts to an angle in radians. */\nexport const AngleDomain: Domain<\"Angle\", Angle, AngleOps> = defineDomain<\"Angle\", Angle, AngleOps>({\n name: \"Angle\",\n is: (u: unknown): u is Angle => u instanceof Angle,\n fromScalar: (n: number): Angle => new Angle(n),\n valid: (a: Angle): boolean => Number.isFinite(a.radians),\n show: (a: Angle): string => a.toString(),\n encode: (a: Angle): number => a.radians,\n decode: (u: unknown): Angle => new Angle(typeof u === \"number\" ? u : Number.NaN),\n ops: {\n add: { laws: [\"commutative\", \"associative\"], identity: (): Angle => Angle.zero, liftScalar: true, params: [\"domain\"] },\n subtract: { liftScalar: true, params: [\"domain\"] },\n scale: { params: [\"number\"] },\n normalize: {},\n toVec2: { params: [\"number\"] },\n sin: {},\n cos: {},\n degrees: {},\n },\n});\n","import { defineDomain, type Domain, type OpTable } from \"@mark1russell7/vex\";\n\n/** A wrapper around a function. Its op `invoke` calls the function. It shows how a domain can hold behavior. */\nexport class Fn {\n readonly fn: (...args: never[]) => unknown;\n\n constructor(fn: (...args: never[]) => unknown) {\n this.fn = fn;\n }\n invoke(...args: readonly unknown[]): unknown {\n return (this.fn as (...a: readonly unknown[]) => unknown)(...args);\n }\n}\n\n/** The ops of `FnDomain`. */\nexport type FnOps = OpTable<Fn, \"invoke\">;\n\n/** The domain of function wrappers. */\nexport const FnDomain: Domain<\"Fn\", Fn, FnOps> = defineDomain<\"Fn\", Fn, FnOps>({\n name: \"Fn\",\n is: (u: unknown): u is Fn => u instanceof Fn,\n ops: { invoke: {} },\n});\n\n/**\n * A value that is there (`top`) or not there (`bottom`). It shows a domain whose ops take functions. A Vex\n * program can also hold this state in its own errors, so most programs do not need this domain.\n */\nexport class Maybe<T> {\n readonly #has: boolean;\n readonly #value: T | undefined;\n\n private constructor(has: boolean, value: T | undefined) {\n this.#has = has;\n this.#value = value;\n }\n static top<T>(value: T): Maybe<T> {\n return new Maybe<T>(true, value);\n }\n static bottom<T = never>(): Maybe<T> {\n return new Maybe<T>(false, undefined);\n }\n isTop(): boolean {\n return this.#has;\n }\n isBottom(): boolean {\n return !this.#has;\n }\n map<U>(f: (value: T) => U): Maybe<U> {\n return this.#has ? Maybe.top(f(this.#value as T)) : Maybe.bottom<U>();\n }\n chain<U>(f: (value: T) => Maybe<U>): Maybe<U> {\n return this.#has ? f(this.#value as T) : Maybe.bottom<U>();\n }\n valueOr<U>(fallback: U): T | U {\n return this.#has ? (this.#value as T) : fallback;\n }\n}\n\n/** The ops of `MaybeDomain`. */\nexport type MaybeOps = OpTable<Maybe<unknown>, \"isTop\" | \"isBottom\" | \"map\" | \"chain\" | \"valueOr\">;\n\n/** The domain of `Maybe` values. */\nexport const MaybeDomain: Domain<\"Maybe\", Maybe<unknown>, MaybeOps> = defineDomain<\"Maybe\", Maybe<unknown>, MaybeOps>({\n name: \"Maybe\",\n is: (u: unknown): u is Maybe<unknown> => u instanceof Maybe,\n ops: { isTop: {}, isBottom: {}, map: {}, chain: {}, valueOr: {} },\n});\n"],"mappings":";;;;;;AAMA,IAAa,OAAb,MAAa,KAAK;CAChB;CACA;CAEA,YAAY,GAAW,GAAW;EAChC,KAAK,IAAI;EACT,KAAK,IAAI;CACX;;CAGA,OAAO,GAAG,GAAW,GAAiB;EACpC,OAAO,IAAI,KAAK,GAAG,CAAC;CACtB;;CAEA,OAAO,OAAO,GAAiB;EAC7B,OAAO,IAAI,KAAK,GAAG,CAAC;CACtB;;CAEA,OAAgB,OAAa,IAAI,KAAK,GAAG,CAAC;;CAE1C,OAAgB,MAAY,IAAI,KAAK,GAAG,CAAC;CAEzC,IAAI,GAAe;EACjB,OAAO,IAAI,KAAK,KAAK,IAAI,EAAE,GAAG,KAAK,IAAI,EAAE,CAAC;CAC5C;CACA,SAAS,GAAe;EACtB,OAAO,IAAI,KAAK,KAAK,IAAI,EAAE,GAAG,KAAK,IAAI,EAAE,CAAC;CAC5C;;CAEA,SAAS,GAAe;EACtB,OAAO,IAAI,KAAK,KAAK,IAAI,EAAE,GAAG,KAAK,IAAI,EAAE,C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MAAW,IAAI,MAAM,OAAU;CAC3D;CACA,QAAW,UAAoB;EAC7B,OAAO,KAAK,OAAQ,KAAK,SAAe;CAC1C;AACF;;AAMA,MAAa,cAAyD,aAAgD;CACpH,MAAM;CACN,KAAK,MAAoC,aAAa;CACtD,KAAK;EAAE,OAAO,CAAC;EAAG,UAAU,CAAC;EAAG,KAAK,CAAC;EAAG,OAAO,CAAC;EAAG,SAAS,CAAC;CAAE;AAClE,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json.schemastore.org/package",
|
|
3
3
|
"name": "@mark1russell7/vex-domains",
|
|
4
|
-
"version": "0.13.
|
|
4
|
+
"version": "0.13.4",
|
|
5
5
|
"description": "Vex domains: 2D vectors, named-component vectors, colors, angles, numbers and booleans.",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"vex",
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
"vitest": "^5.0.3"
|
|
53
53
|
},
|
|
54
54
|
"dependencies": {
|
|
55
|
-
"@mark1russell7/vex": "0.13.
|
|
55
|
+
"@mark1russell7/vex": "0.13.4"
|
|
56
56
|
},
|
|
57
57
|
"scripts": {
|
|
58
58
|
"build": "tsdown",
|