@mark1russell7/layout-contract 0.2.17 → 0.2.18
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/README.md +16 -2
- package/build/index.d.ts +15 -0
- package/build/index.d.ts.map +1 -1
- package/build/index.js.map +1 -1
- package/package.json +1 -1
- package/src/shapes.ts +15 -0
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json.schemastore.org/package",
|
|
3
3
|
"name": "@mark1russell7/layout-contract",
|
|
4
|
-
"version": "0.2.
|
|
4
|
+
"version": "0.2.18",
|
|
5
5
|
"description": "The shared contract of the packing and highways layout engines: the input and record formats, the turn rule, margins, tolerances and hard rules.",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"layout",
|
package/src/shapes.ts
CHANGED
|
@@ -68,6 +68,21 @@ export interface ShapeSupport<Id extends string = string> {
|
|
|
68
68
|
/**
|
|
69
69
|
* The kinds where a measure gives a bound of the true value, and the side of the bound.
|
|
70
70
|
* With `upper`, the value is the true value or more. With `lower`, the value is the true value or less.
|
|
71
|
+
*
|
|
72
|
+
* @remarks
|
|
73
|
+
* The side and the `direction` of the measure tell what a bound value `v` proves about a threshold `t`.
|
|
74
|
+
* A bound is optimistic on the better side of the true value, and pessimistic on the worse side.
|
|
75
|
+
*
|
|
76
|
+
* | `direction` | `side` | The bound | The proof | No proof |
|
|
77
|
+
* |---|---|---|---|---|
|
|
78
|
+
* | `higher` | `upper` | optimistic | `v < t`: the true value is less than `t`. | `v >= t` |
|
|
79
|
+
* | `higher` | `lower` | pessimistic | `v >= t`: the true value is `t` or more. | `v < t` |
|
|
80
|
+
* | `lower` | `upper` | pessimistic | `v <= t`: the true value is `t` or less. | `v > t` |
|
|
81
|
+
* | `lower` | `lower` | optimistic | `v > t`: the true value is more than `t`. | `v <= t` |
|
|
82
|
+
*
|
|
83
|
+
* For a floor or a guard, a pessimistic bound proves a pass, and an optimistic bound proves a fail.
|
|
84
|
+
* `compareMeasure` on two bound values proves nothing. A tie with a bound value proves nothing.
|
|
85
|
+
* Against an exact baseline, an optimistic candidate proves only `worse`, and a pessimistic candidate proves only `better`.
|
|
71
86
|
*/
|
|
72
87
|
export interface ShapeBound {
|
|
73
88
|
readonly shapes: readonly ShapeKind[];
|