@mark1russell7/layout-contract 0.3.11 → 0.4.0
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 +5 -4
- package/build/index.d.ts +84 -9
- package/build/index.d.ts.map +1 -1
- package/build/index.js +310 -50
- package/build/index.js.map +1 -1
- package/build/{measures-C-Tuv8GU.d.ts → measures-KWg_was6.d.ts} +28 -5
- package/build/{measures-C-Tuv8GU.d.ts.map → measures-KWg_was6.d.ts.map} +1 -1
- package/build/text.d.ts +1 -1
- package/package.json +1 -1
- package/src/edges.ts +68 -8
- package/src/families.ts +28 -1
- package/src/record.ts +11 -1
- package/src/rules.ts +184 -30
- package/src/shapes.ts +47 -5
package/README.md
CHANGED
|
@@ -33,7 +33,7 @@ The package has one runtime dependency: `@mark1russell7/rigor-generators`, the h
|
|
|
33
33
|
| The strategy catalog | `StrategyCatalog`, `StrategyCatalogSource`, `CatalogEntry`, `ParamRoute`, `StrategyMember`, `CatalogLimit`, `STRATEGY_CATALOG_SCHEMA`, `NODE_POSITIONS_DIMENSION`, `parseStrategyCatalog`, `writeStrategyCatalog`, `checkCatalog`, `catalogDefaults`, `catalogOptions`, `catalogChoices`, `catalogKey`, `decodeOptionValue`, `encodeOptionValue` |
|
|
34
34
|
| The turn | `turnBox`, `turnPort`, `turnMargin`, `turnRegion`, `turnSide`, `turnPoint` |
|
|
35
35
|
| The tolerances | `EPS`, `RECORD_EPS`, `RECORD_SCALE`, `Tolerance`, `DEFAULT_TOLERANCE` |
|
|
36
|
-
| The hard rules | `countOverlaps`, `countObstacleHits`, `regionHitsRect`, `rectInRegion`, `countOutside`, `ContainerTest`, `countPortsOffBorder`, `packHard`, `PackHard`, `PACK_HARD_RULES`, `placedRect`, `checkInput` |
|
|
36
|
+
| The hard rules | `HARD_RULE_VERSION`, `shapesOverlap`, `circleOverlaps`, `circlesOutside`, `placedCircle`, `PlacedCircle`, `countOverlaps`, `countObstacleHits`, `regionHitsRect`, `rectInRegion`, `countOutside`, `ContainerTest`, `countPortsOffBorder`, `packHard`, `PackHard`, `PACK_HARD_RULES`, `placedRect`, `checkInput` |
|
|
37
37
|
|
|
38
38
|
## The rules
|
|
39
39
|
|
|
@@ -54,9 +54,10 @@ The package has one runtime dependency: `@mark1russell7/rigor-generators`, the h
|
|
|
54
54
|
- `portPoint(box, port)` gives the point of a port, relative to the top-left corner of the box. A port without a fixed point gives `undefined`, because the router picks the point.
|
|
55
55
|
- A turn changes `along` of `left` and `right` to `1 - along`, because the start of the side moves to its other end. `along` of `top` and `bottom` stays.
|
|
56
56
|
- An input without `along` keeps its hash.
|
|
57
|
-
- **The hard rules of a pack.** `no-overlap` counts the pairs of boxes and the pairs of a box and an obstacle. A pair of `pairGaps` uses its gap in place of the margins. A locked box without a placement, or with a move of more than `RECORD_EPS`, breaks `locked-kept`. `checkInput` refuses a locked box without a position. Another box without a placement and not in `overflow` breaks `complete`.
|
|
58
|
-
- **The container rule.** `in-container` counts each box that goes out of the container made smaller by `inset`. The box counts with its margin.
|
|
59
|
-
- **The exact container.**
|
|
57
|
+
- **The hard rules of a pack.** `no-overlap` counts the pairs of boxes and the pairs of a box and an obstacle. Two circles count by the distance of their centers, and each other pair counts by its bounding boxes. A pair of `pairGaps` uses its gap in place of the margins. A locked box without a placement, or with a move of more than `RECORD_EPS`, breaks `locked-kept`. `checkInput` refuses a locked box without a position. Another box without a placement and not in `overflow` breaks `complete`.
|
|
58
|
+
- **The container rule.** `in-container` counts each box that goes out of the container made smaller by `inset`. The box counts with its margin. A circle in a circle container counts by distance, also when the size is free.
|
|
59
|
+
- **The exact container.** Since 0.4.0, a box of a shaped container with the size `fixed` must stay inside the shape. A cut corner, a notch and a hole count. A container with a free side keeps the bounding test. Give `{ exactContainer: false }` to `packHard` or `countOutside` for the bounding test on each shape.
|
|
60
|
+
- **The version of the rules.** `HARD_RULE_VERSION` is 2. A record states the version in `hardRule`, and `hardRuleOf` gives 1 for a record without the field. On version 1, a count on a circle is an upper bound.
|
|
60
61
|
- **The shape kinds.** An item is a `rect`, a `polygon`, a `circle` or a `free` shape. Each measure and rule declares its kinds. `checkShapes` refuses the other kinds. `docs/SHAPES.md` tells the rules.
|
|
61
62
|
- `regionArea(region)` gives the exact area of a region. `boxArea(box)` gives the exact area of a box, or `undefined` for a `free` box. A box with an ellipse shape is `free`.
|
|
62
63
|
- `ShapeSupport.safe` lists the kinds with a safe count: an upper bound that does not miss a break. `ruleLevel(rule, kind)` gives `exact`, `safe` or `none`.
|
package/build/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $ as
|
|
1
|
+
import { $ as CorpusSplit, A as shapeKindsOf, At as regionArea, B as LayoutInput, C as checkShapes, Ct as Sides, D as ruleLevel, Dt as marginSides, E as itemShapeOf, Et as grow, F as LayoutBox, G as PairGap, H as PackInput, I as LayoutCell, J as packLinks, K as Port, L as LayoutContainer, M as shapeSupportProblems, Mt as toRect, N as shapesOf, Nt as toSizedRect, O as shapeKindOf, Ot as overlapOf, P as Item, Pt as translate, Q as CorpusEntry, R as LayoutEdge, S as boxArea, St as Side, T as isShapeKind, Tt as boundsOf, U as PackInputOptions, V as Obstacle, W as PackLink, X as toPackInput, Y as portPoint, Z as ClaimBreak, _ as ShapeKind, _t as Margin, a as MeasureSpec, at as SPLIT_SCHEMA, b as ShapeLimit, bt as Region, c as minEffectOf, ct as checkDeclared, d as SHAPE_KINDS, dt as declaredClaimOf, et as DeclaredClaim, f as SHAPE_KIND_IDS, ft as declaredCounts, g as ShapeInput, gt as splitFolds, h as ShapeGeometry, ht as splitFileName, i as JointMeasureId, it as FamilyCell, j as shapeLevel, jt as segmentsCross, k as shapeKindProblem, kt as pointSegmentDistance, l as DEFAULT_SHAPES, lt as checkSplit, m as ShapeCheck, mt as leaveOneSeedOut, n as JOINT_MEASURES, nt as FAMILY_ANY_KIND, o as Verdict, ot as SplitCorpus, p as ShapeBound, pt as familyOf, q as canonicalInput, r as JOINT_MOVED_MIN, rt as FamilyBy, s as compareMeasure, st as SplitFold, t as Direction, tt as Declares, u as RuleLevel, ut as corpusHashOf, v as ShapeKindSpec, vt as Point, w as inputShapeLevel, wt as SizedRect, x as ShapeSupport, xt as SIDES, y as ShapeLevel, yt as Rect, z as LayoutGenerator } from "./measures-KWg_was6.js";
|
|
2
2
|
/** The epsilon for the float compares in an engine. */
|
|
3
3
|
export declare const EPS = 1e-6;
|
|
4
4
|
/**
|
|
@@ -90,6 +90,8 @@ export interface LayoutRecord {
|
|
|
90
90
|
readonly hard: Readonly<Record<string, number>>;
|
|
91
91
|
/** The tolerance of each hard rule of the run. */
|
|
92
92
|
readonly tolerance?: Readonly<Partial<Tolerance>>;
|
|
93
|
+
/** The version of the rules that made the counts of `hard`: `HARD_RULE_VERSION` at the run. `hardRuleOf` reads it. */
|
|
94
|
+
readonly hardRule?: number;
|
|
93
95
|
/**
|
|
94
96
|
* The value is `true` when two runs with the same seed give the same positions.
|
|
95
97
|
* A skipped record has `null`, because no run made a claim. Each other record has a boolean.
|
|
@@ -151,6 +153,11 @@ export type RunFacts = Omit<LayoutRecord, "schema" | "input" | "inputHash" | "se
|
|
|
151
153
|
* The input also gives `shapes`. An input with only `rect` boxes gets no `shapes`, so its record does not change.
|
|
152
154
|
*/
|
|
153
155
|
export declare function toLayoutRecord(input: LayoutInput, run: RunFacts): LayoutRecord;
|
|
156
|
+
/**
|
|
157
|
+
* This function gives the version of the rules that made the counts of `hard` of a record. A record without `hardRule` has version 1.
|
|
158
|
+
* On version 1, a count on a circle is by its bounding box. So it is an upper bound, and a count over 0 proves nothing.
|
|
159
|
+
*/
|
|
160
|
+
export declare function hardRuleOf(record: Pick<LayoutRecord, "hardRule">): number;
|
|
154
161
|
/**
|
|
155
162
|
* This function gives the problems of one `layout-record/1` value. An empty list means a good record.
|
|
156
163
|
* A record that has `skipped` has `deterministic: null`. An old skipped record with a boolean is also correct.
|
|
@@ -166,27 +173,70 @@ export declare function parseLayoutRecord(value: unknown): LayoutRecord;
|
|
|
166
173
|
/** This function gives the area of a placed box: its shape or its rectangle, at its position. A box without a position gives `undefined`. */
|
|
167
174
|
export declare function placedRect(box: LayoutBox): Rect | undefined;
|
|
168
175
|
/**
|
|
169
|
-
*
|
|
170
|
-
*
|
|
176
|
+
* The version of the rules that count `no-overlap` and `in-container`. A record states it in `LayoutRecord.hardRule`.
|
|
177
|
+
*
|
|
178
|
+
* - Version 1 counts each shape by its bounding box. On a circle, that count is an upper bound. A count over 0 proves nothing.
|
|
179
|
+
* - Version 2 counts two circles, and a circle in a circle container, by the distance of the centers. The other pairs stay on the bounding box.
|
|
180
|
+
*/
|
|
181
|
+
export declare const HARD_RULE_VERSION = 2;
|
|
182
|
+
/** A circle at its place on the board: its center and its radius, without a margin. */
|
|
183
|
+
export interface PlacedCircle {
|
|
184
|
+
readonly cx: number;
|
|
185
|
+
readonly cy: number;
|
|
186
|
+
readonly r: number;
|
|
187
|
+
}
|
|
188
|
+
/** This function gives the circle of a placed box. A box without a position, or with another shape, gives `undefined`. */
|
|
189
|
+
export declare function placedCircle(box: LayoutBox): PlacedCircle | undefined;
|
|
190
|
+
/**
|
|
191
|
+
* This function tells if two placed boxes break `no-overlap`. It is the rule for one pair of `countOverlaps`.
|
|
192
|
+
*
|
|
193
|
+
* - Two circles break the rule when their centers are nearer than the two radii and the two margins, less `tolerance`. The margin of a circle is the largest side of its margin.
|
|
194
|
+
* - Another pair breaks the rule when the bounding boxes with their margins overlap by more than `tolerance` on each axis. With a shape that is not a rectangle, this test is an upper bound.
|
|
195
|
+
* - With `gap`, the gap replaces the two margins. Two circles are then apart by the two radii and the gap. For another pair, one box grows by the gap.
|
|
196
|
+
* - A box without a position does not overlap.
|
|
197
|
+
*/
|
|
198
|
+
export declare function shapesOverlap(a: LayoutBox, b: LayoutBox, tolerance?: number, gap?: number): boolean;
|
|
199
|
+
/**
|
|
200
|
+
* This function counts the pairs of placed boxes that break `no-overlap`. `shapesOverlap` is the rule for one pair.
|
|
201
|
+
* Two circles count by the distance of their centers. Each other pair counts by the bounding boxes, so a circle beside another shape is an upper bound (roadmap item L107).
|
|
171
202
|
*
|
|
172
203
|
* A pair of `pairGaps`, in either order, uses its `gap` in place of the two margins. One box grows by the gap, and the other box does not grow.
|
|
173
204
|
* Thus the pair breaks the rule only when the boxes are nearer than the gap on each axis. The other pairs do not change.
|
|
174
205
|
*/
|
|
175
206
|
export declare function countOverlaps(boxes: readonly LayoutBox[], tolerance?: number, pairGaps?: readonly PairGap[]): number;
|
|
207
|
+
/**
|
|
208
|
+
* This function counts the pairs of placed circles that break `no-overlap`, by the distance of their centers. Each other box does not count.
|
|
209
|
+
*
|
|
210
|
+
* - Two circles break the rule when their centers are nearer than the two radii, the two margins and `gap`, less `tolerance`.
|
|
211
|
+
* - The margin of a circle is the largest side of its margin.
|
|
212
|
+
* - A pair of `pairGaps` is apart by the two radii and its gap, in place of the margins and `gap`.
|
|
213
|
+
* - `gap` has the default 0. The rule `no-overlap` does not read `LayoutInput.gap`, so `countOverlaps` gives no value. An engine that keeps the gap between circles gives it here.
|
|
214
|
+
*/
|
|
215
|
+
export declare function circleOverlaps(boxes: readonly LayoutBox[], tolerance?: number, pairGaps?: readonly PairGap[], gap?: number): number;
|
|
176
216
|
/** The options of the container test of `countOutside` and `packHard`. */
|
|
177
217
|
export interface ContainerTest {
|
|
178
218
|
/**
|
|
179
219
|
* With `true`, a box of a shaped container with the size `fixed` must stay inside the shape, not only inside its bounding box.
|
|
180
|
-
*
|
|
220
|
+
* A circle in a circle container is tested by distance. The default is `true` since 0.4.0. With `false`, only the bounding box counts.
|
|
181
221
|
*/
|
|
182
222
|
readonly exactContainer?: boolean;
|
|
183
223
|
}
|
|
224
|
+
/**
|
|
225
|
+
* This function counts the placed circles that go out of a circle container, by the distance of the centers.
|
|
226
|
+
*
|
|
227
|
+
* - The reach of a circle is the sum of the center distance, the radius, the largest side of the margin and the inset.
|
|
228
|
+
* - A circle breaks the rule when its reach is more than the container radius plus `tolerance`.
|
|
229
|
+
* - A container with a free size reads its radius from `w`, and its center is the corner of the shape plus that radius. `applyPack` writes that `w`.
|
|
230
|
+
* - Each other box does not count. The function throws a `RangeError` for a container that is not a circle.
|
|
231
|
+
*/
|
|
232
|
+
export declare function circlesOutside(input: LayoutInput, tolerance?: number): number;
|
|
184
233
|
/**
|
|
185
234
|
* This function counts the placed boxes that go out of the container.
|
|
186
235
|
* Each box with its margin must stay inside the container made smaller by `inset`. Only the fixed sides of the size count. A shaped container counts as its bounding box.
|
|
187
236
|
*
|
|
188
|
-
* With `exactContainer`, a box of a shaped container with the size `fixed` also counts when
|
|
237
|
+
* With `exactContainer`, the default, a box of a shaped container with the size `fixed` also counts when it is not inside the shape, by `rectInRegion`.
|
|
189
238
|
* For that test, the box grows by `inset` and becomes smaller by `tolerance` on each side. A shaped container with a free side keeps the bounding test only.
|
|
239
|
+
* A circle in a circle container does not use `rectInRegion`. It counts by distance, as in `circlesOutside`, also when the size is free.
|
|
190
240
|
* An input without a container gives 0.
|
|
191
241
|
*/
|
|
192
242
|
export declare function countOutside(input: LayoutInput, tolerance?: number, options?: ContainerTest): number;
|
|
@@ -201,8 +251,8 @@ export interface PackHard {
|
|
|
201
251
|
}
|
|
202
252
|
/**
|
|
203
253
|
* The hard rules of a pack, with the shape kinds that each rule supports.
|
|
204
|
-
* `no-overlap` and `in-container`
|
|
205
|
-
* For the other kinds, the count is safe: a shape is inside its bounding box, so the count is an upper bound. A count of 0 tells that the rule has no break.
|
|
254
|
+
* `no-overlap` and `in-container` are exact for a `rect` and a `circle`. `limit` tells the inputs where the count of a circle is only safe (roadmap item L107).
|
|
255
|
+
* For the other kinds, these rules test the bounding box. The count is safe: a shape is inside its bounding box, so the count is an upper bound. A count of 0 tells that the rule has no break.
|
|
206
256
|
* `locked-kept` and `complete` read only the positions and the ids, so they support each kind.
|
|
207
257
|
*/
|
|
208
258
|
export declare const PACK_HARD_RULES: readonly ShapeSupport<keyof PackHard>[];
|
|
@@ -221,7 +271,7 @@ export declare function countObstacleHits(boxes: readonly LayoutBox[], obstacles
|
|
|
221
271
|
/**
|
|
222
272
|
* This function gives the count of each hard rule of the output of a packer.
|
|
223
273
|
* It applies the output with `applyPack`. Only the placed boxes and the locked boxes count for the overlaps and the container.
|
|
224
|
-
* `no-overlap` counts the pairs of boxes and the pairs of a box and an obstacle. A pair of `pairGaps` uses its gap in place of the margins.
|
|
274
|
+
* `no-overlap` counts the pairs of boxes and the pairs of a box and an obstacle. A pair of `pairGaps` uses its gap in place of the margins. `HARD_RULE_VERSION` tells the version of these counts.
|
|
225
275
|
*
|
|
226
276
|
* A locked box without a placement, or with a move of more than `RECORD_EPS`, breaks `locked-kept`.
|
|
227
277
|
* A locked box without a position in the input is a bad input, not a break. `checkInput` finds it.
|
|
@@ -359,16 +409,37 @@ export interface EdgeStepParams {
|
|
|
359
409
|
/** The order of the hubs of `hubs` and `tree`: the largest box first, or a random order. The default is `area`. */
|
|
360
410
|
readonly hubBy?: "area" | "random";
|
|
361
411
|
}
|
|
412
|
+
/**
|
|
413
|
+
* The key of the edges of an input, in `data.collection`.
|
|
414
|
+
* - `none`: the field is absent, so a router with the rule `collection` has no ways.
|
|
415
|
+
* - `random`: a random name for each target box, so the key has no meaning.
|
|
416
|
+
* - `cluster`: a name for each cluster of boxes, so the key follows the structure.
|
|
417
|
+
*/
|
|
418
|
+
export type EdgeKey = "none" | "random" | "cluster";
|
|
419
|
+
/** The parameters of `edgeKeyStep`. */
|
|
420
|
+
export interface EdgeKeyParams {
|
|
421
|
+
readonly edgeKey: EdgeKey;
|
|
422
|
+
}
|
|
362
423
|
/** The mean count of the edges of each box for each value of `edgeDensity`. */
|
|
363
424
|
export declare const EDGE_DENSITY: Readonly<Record<EdgeStepParams["edgeDensity"], number>>;
|
|
364
425
|
/** The version of `edgeStep`. A change of its output gives a new version. */
|
|
365
426
|
export declare const EDGE_STEP_VERSION = 1;
|
|
427
|
+
/** The version of `edgeKeyStep`. A change of its output gives a new version. */
|
|
428
|
+
export declare const EDGE_KEY_STEP_VERSION = 1;
|
|
366
429
|
/**
|
|
367
430
|
* This function gives the input with edges, groups and ports from its topology alone: a joint input has no positions before the pack.
|
|
368
431
|
* The random numbers come from the steps `edges` and `ports` of `seed`. The function appends its stamp to `steps`, and removes the old `hash`.
|
|
369
432
|
* The rules of each shape are in `docs/JOINT-CORPUS.md`.
|
|
370
433
|
*/
|
|
371
434
|
export declare function edgeStep(input: LayoutInput, params: EdgeStepParams, seed?: number): LayoutInput;
|
|
435
|
+
/**
|
|
436
|
+
* This function gives the input with a stated key on each edge. The edges stay the same in all but `data.collection`, so the 3 values of `edgeKey` read one factor.
|
|
437
|
+
* The key of an edge depends on its target box, as in `edgeStep`.
|
|
438
|
+
* The value `cluster` uses the clusters of `edgeStep` with the same seed and box order, so this step comes directly after `edgeStep`. On the shape `bundled` it gives the keys of `edgeStep`.
|
|
439
|
+
* The value `random` uses the stream `edge-key`, so it does not change the numbers of `edgeStep`. The function appends its stamp to `steps`, and removes the old `hash`.
|
|
440
|
+
* It throws a `RangeError` for an edge with an unknown target.
|
|
441
|
+
*/
|
|
442
|
+
export declare function edgeKeyStep(input: LayoutInput, params: EdgeKeyParams, seed?: number): LayoutInput;
|
|
372
443
|
/**
|
|
373
444
|
* This function gives the SHA-256 digest of the UTF-8 bytes of a string, as 64 lowercase hex characters.
|
|
374
445
|
* It uses no API of Node or of the browser.
|
|
@@ -1519,11 +1590,15 @@ export declare function composeFamily(base: CorpusFamily<LayoutInput>, steps: re
|
|
|
1519
1590
|
* The value `random` of `hubBy` adds the part `.hub-random`.
|
|
1520
1591
|
*/
|
|
1521
1592
|
export declare const EDGES_STEP: CorpusStep;
|
|
1593
|
+
/**
|
|
1594
|
+
* The step `edge-key` of `edgeKeyStep` (version 1), as a corpus step. It comes directly after `EDGES_STEP`. Its family part is `key-<edgeKey>`.
|
|
1595
|
+
*/
|
|
1596
|
+
export declare const EDGE_KEY_STEP: CorpusStep;
|
|
1522
1597
|
/**
|
|
1523
1598
|
* The shared family `rect-scattered`, version 1: a fixed rectangle container, rectangle obstacles at random places and boxes without positions.
|
|
1524
1599
|
* It is the one copy of the generator of `docs/FORMAT.md` of `packing`. Its input is the input of `packing`, byte for byte.
|
|
1525
1600
|
* The steps `container`, `obstacles` and `boxes` each have a stream of `stepRandom`. Each value is a whole number, so the family is `exact`.
|
|
1526
1601
|
*/
|
|
1527
1602
|
export declare const RECT_SCATTERED: CorpusFamily<LayoutInput>;
|
|
1528
|
-
export { ClaimBreak, CorpusEntry, CorpusSplit, DEFAULT_SHAPES, DeclaredClaim, Declares, Direction, FAMILY_ANY_KIND, FamilyBy, FamilyCell, Item, JOINT_MEASURES, JOINT_MOVED_MIN, JointMeasureId, LayoutBox, LayoutCell, LayoutContainer, LayoutEdge, LayoutGenerator, LayoutInput, Margin, MeasureSpec, Obstacle, PackInput, PackInputOptions, PackLink, PairGap, Point, Port, Rect, Region, RuleLevel, SHAPE_KINDS, SHAPE_KIND_IDS, SIDES, SPLIT_SCHEMA, ShapeBound, ShapeCheck, ShapeGeometry, ShapeKind, ShapeKindSpec, ShapeLevel, ShapeSupport, Side, Sides, SizedRect, SplitCorpus, SplitFold, Verdict, boundsOf, boxArea, canonicalInput, checkDeclared, checkShapes, checkSplit, compareMeasure, corpusHashOf, declaredClaimOf, declaredCounts, familyOf, grow, isShapeKind, itemShapeOf, leaveOneSeedOut, marginSides, minEffectOf, overlapOf, packLinks, pointSegmentDistance, portPoint, regionArea, ruleLevel, segmentsCross, shapeKindOf, shapeKindProblem, shapeKindsOf, shapeLevel, shapeSupportProblems, shapesOf, splitFileName, splitFolds, toPackInput, toRect, toSizedRect, translate };
|
|
1603
|
+
export { ClaimBreak, CorpusEntry, CorpusSplit, DEFAULT_SHAPES, DeclaredClaim, Declares, Direction, FAMILY_ANY_KIND, FamilyBy, FamilyCell, Item, JOINT_MEASURES, JOINT_MOVED_MIN, JointMeasureId, LayoutBox, LayoutCell, LayoutContainer, LayoutEdge, LayoutGenerator, LayoutInput, Margin, MeasureSpec, Obstacle, PackInput, PackInputOptions, PackLink, PairGap, Point, Port, Rect, Region, RuleLevel, SHAPE_KINDS, SHAPE_KIND_IDS, SIDES, SPLIT_SCHEMA, ShapeBound, ShapeCheck, ShapeGeometry, ShapeInput, ShapeKind, ShapeKindSpec, ShapeLevel, ShapeLimit, ShapeSupport, Side, Sides, SizedRect, SplitCorpus, SplitFold, Verdict, boundsOf, boxArea, canonicalInput, checkDeclared, checkShapes, checkSplit, compareMeasure, corpusHashOf, declaredClaimOf, declaredCounts, familyOf, grow, inputShapeLevel, isShapeKind, itemShapeOf, leaveOneSeedOut, marginSides, minEffectOf, overlapOf, packLinks, pointSegmentDistance, portPoint, regionArea, ruleLevel, segmentsCross, shapeKindOf, shapeKindProblem, shapeKindsOf, shapeLevel, shapeSupportProblems, shapesOf, splitFileName, splitFolds, toPackInput, toRect, toSizedRect, translate };
|
|
1529
1604
|
//# sourceMappingURL=index.d.ts.map
|
package/build/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","names":[],"sources":["../src/tolerance.ts","../src/output.ts","../src/record.ts","../src/rules.ts","../src/turn.ts","../src/balance.ts","../src/strategy.ts","../src/random.ts","../src/edges.ts","../src/hash.ts","../src/portfolio.ts","../src/strategy-space.ts","../src/strategy-options.ts","../src/strategy-catalog.ts","../src/verdict.ts","../src/families.ts"],"mappings":";;qBACa;;;;;qBAMA;;;;;qBAMA;;;;;iBAMI;;WAEN;;WAEA;;;;;;qBAOE,mBAAmB;;iBCzBf;WACN;WACA;WACA;WACA;;;iBAIM;WACN;WACA;WACA,WAAW,SAAS;;;iBAId;WACN,qBAAqB;;WAErB;;WAEA;aAAiB;aAAoB;;;WAErC;aAA2B;aAAqB;aAAoB;;WACpE,iBAAiB;;;;;;;wBAQZ,UAAU,OAAO,aAAa,QAAQ,aAAa;;YC/BvD;;iBAGK;WACN;WACA,OAAO;WACP;WACA;;WAEA,SAAS,SAAS;WAClB;;WAEA;;WAEA;WACA;WACA;WACA;WACA;;WAEA,kBAAkB;;WAElB,UAAU,SAAS;;WAEnB,MAAM,SAAS;;WAEf,YAAY,SAAS,QAAQ;;;;;
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../src/tolerance.ts","../src/output.ts","../src/record.ts","../src/rules.ts","../src/turn.ts","../src/balance.ts","../src/strategy.ts","../src/random.ts","../src/edges.ts","../src/hash.ts","../src/portfolio.ts","../src/strategy-space.ts","../src/strategy-options.ts","../src/strategy-catalog.ts","../src/verdict.ts","../src/families.ts"],"mappings":";;qBACa;;;;;qBAMA;;;;;qBAMA;;;;;iBAMI;;WAEN;;WAEA;;;;;;qBAOE,mBAAmB;;iBCzBf;WACN;WACA;WACA;WACA;;;iBAIM;WACN;WACA;WACA,WAAW,SAAS;;;iBAId;WACN,qBAAqB;;WAErB;;WAEA;aAAiB;aAAoB;;;WAErC;aAA2B;aAAqB;aAAoB;;WACpE,iBAAiB;;;;;;;wBAQZ,UAAU,OAAO,aAAa,QAAQ,aAAa;;YC/BvD;;iBAGK;WACN;WACA,OAAO;WACP;WACA;;WAEA,SAAS,SAAS;WAClB;;WAEA;;WAEA;WACA;WACA;WACA;WACA;;WAEA,kBAAkB;;WAElB,UAAU,SAAS;;WAEnB,MAAM,SAAS;;WAEf,YAAY,SAAS,QAAQ;;WAE7B;;;;;WAKA;;WAEA;;WAEA;;WAEA;;;;;WAKA;;WAEA;;WAEA;;WAEA;;;;;WAKA;;WAEA,MAAM;;WAEN;WACA;;;;;;YAOC,WAAW,SAAS;;iBAGf;WACN;WACA;WACA;;WAEA;;WAEA;;WAEA;;WAEA;;WAEA;;;YAIC,WAAW,KAAK;;;;;wBAMZ,eAAe,OAAO,aAAa,KAAK,WAAW;;;;;wBAkDnD,WAAW,QAAQ,KAAK;;;;;;wBASxB,kBAAkB;;;;;;wBAkClB,kBAAkB,iBAAiB;;wBCxLnC,WAAW,KAAK,YAAY;;;;;;;qBAa/B;;iBAGI;WACN;WACA;WACA;;;wBAI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