@mark1russell7/layout-contract 0.2.13 → 0.2.15

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 CHANGED
@@ -10,7 +10,7 @@ The package has no runtime dependencies.
10
10
  |---|---|
11
11
  | Geometry | `Point`, `Rect`, `Region`, `Side`, `Sides`, `Margin`, `marginSides`, `grow`, `boundsOf`, `translate`, `overlapOf` |
12
12
  | The shape kinds | `ShapeKind`, `SHAPE_KINDS`, `SHAPE_KIND_IDS`, `ShapeKindSpec`, `ShapeGeometry`, `DEFAULT_SHAPES`, `ShapeSupport`, `isShapeKind`, `shapeKindOf`, `shapeKindsOf`, `itemShapeOf`, `shapeKindProblem`, `shapesOf`, `checkShapes` |
13
- | The input `layout-input/1` | `LayoutInput`, `LayoutBox` (`Item` for the packer), `Port`, `LayoutEdge`, `LayoutContainer`, `Obstacle`, `LayoutCell`, `LayoutGenerator` |
13
+ | The input `layout-input/1` | `LayoutInput`, `LayoutBox` (`Item` for the packer), `Port`, `portPoint`, `LayoutEdge`, `LayoutContainer`, `Obstacle`, `LayoutCell`, `LayoutGenerator`, `PairGap`, `canonicalInput` |
14
14
  | The packer | `PackInput`, `toPackInput`, `Placement`, `PackOutput`, `StageTrace`, `applyPack` |
15
15
  | The record `layout-record/1` | `LayoutRecord`, `Stage`, `Supports`, `RunFacts`, `RunEnv`, `toLayoutRecord` |
16
16
  | The strategies | `StrategyInfo` |
@@ -36,8 +36,21 @@ The package has no runtime dependencies.
36
36
  - **The turn.** A turn is 90 degrees clockwise, with the y axis down. A point (`px`, `py`) of a box of height `h` goes to (`h - py`, `px`). Each side moves one step clockwise. The router gets the turned box and ports, and does not read `turn`.
37
37
  - **The margin.** A margin is a ring around a box. No other box and no route enters it. A route from a port of the box crosses the ring at a right angle.
38
38
  - **The gap.** The gap is the free space between two boxes with their margins. Routes use it. Two boxes are `mA + gap + mB` apart.
39
+ - **The pair gaps.** `pairGaps` gives a minimum distance to some pairs of boxes: `{ a, b, gap, lanes? }`. For its pair, the `gap` of an entry replaces `mA + gap + mB`.
40
+ - The order of `a` and `b` has no meaning. A pair without an entry keeps its margins and the global `gap`.
41
+ - `lanes` is the count of the channels that the gap has space for. It is information only.
42
+ - `checkInput` refuses an unknown box, a pair of one box, a repeated pair in either order, a negative or infinite `gap` and bad `lanes`.
43
+ - `canonicalInput` puts `a` before `b` in each pair and sorts the list. `documentHash` uses this form, so an input without `pairGaps` keeps its hash.
44
+ - The hard rule `no-overlap` reads `pairGaps`. For a pair of the list, in either order, the `gap` replaces the two margins. The pair breaks the rule only when the boxes are nearer than the gap.
45
+ - The pairs that are not in the list keep their margins. Without `pairGaps`, the verdicts and the hashes of the records do not change.
39
46
  - **The ports.** A port can have a side. Without a side, the router picks the side. A fixed port has `x` and `y` on the border of the box, relative to its top-left corner.
40
- - **The hard rules of a pack.** `no-overlap` counts the pairs of boxes and the pairs of a box and an obstacle. 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`.
47
+ - A port with `side` and `along` is fixed at a fraction of its side. `along` is a number from 0 to 1, from the start of the side.
48
+ - The start of `left` and `right` is the top end. The start of `top` and `bottom` is the left end. `countPortsOffBorder` uses the same start for `x` and `y`.
49
+ - `checkInput` refuses `along` without a side, a value that is not a finite number from 0 to 1, and `along` with `x` or `y`.
50
+ - `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.
51
+ - 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.
52
+ - An input without `along` keeps its hash.
53
+ - **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`.
41
54
  - **The container rule.** `in-container` counts each box that goes out of the container made smaller by `inset`. The box counts with its margin. By default, a shaped container counts as its bounding box.
42
55
  - **The exact container.** Give `{ exactContainer: true }` to `packHard` or `countOutside`. Then 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. The default changes to the exact test at the next breaking version.
43
56
  - **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.
package/build/index.d.ts CHANGED
@@ -189,14 +189,27 @@ export declare function leaveOneSeedOut(seeds: readonly number[]): SplitFold[];
189
189
  /**
190
190
  * A port of a box: a place where edges go into the box.
191
191
  * With `x` and `y`, the port is fixed on the border of the box, relative to its top-left corner.
192
- * Without them, the router places the port on its `side`. Without a side, the router picks the side.
192
+ * With `side` and `along`, the port is fixed at a fraction of its side.
193
+ * With only a side, the router places the port on that side. Without a side, the router picks the side.
193
194
  */
194
195
  export interface Port {
195
196
  readonly id: string;
196
197
  readonly side?: Side;
197
198
  readonly x?: number;
198
199
  readonly y?: number;
200
+ /**
201
+ * The place of the port on its `side`: a fraction from 0 to 1, from the start of the side.
202
+ * The start of `left` and `right` is the top end. The start of `top` and `bottom` is the left end.
203
+ * It needs a `side`. A port with `along` has no `x` and no `y`.
204
+ */
205
+ readonly along?: number;
199
206
  }
207
+ /**
208
+ * This function gives the point of a port on the border of its box, relative to the top-left corner of the box.
209
+ * A port with `x` and `y` gives that point. A port with `side` and `along` gives the point at that fraction of the side.
210
+ * Another port gives `undefined`, because the router picks its point.
211
+ */
212
+ export declare function portPoint(box: Pick<LayoutBox, "w" | "h">, port: Port): Point | undefined;
200
213
  /** A box of an input. In the packer, its name is item. */
201
214
  export interface LayoutBox {
202
215
  readonly id: string;
@@ -266,6 +279,18 @@ export interface LayoutGenerator {
266
279
  readonly params: Readonly<Record<string, unknown>>;
267
280
  readonly seed: number;
268
281
  }
282
+ /**
283
+ * One minimum distance between two boxes (`a` and `b`). It replaces the two margins of the boxes for this pair, and the global `gap`.
284
+ * The order of `a` and `b` has no meaning. A pair without an entry keeps the margins and the `gap`.
285
+ */
286
+ export interface PairGap {
287
+ readonly a: string;
288
+ readonly b: string;
289
+ /** The minimum distance between the two boxes, in units: a finite number of 0 or more. */
290
+ readonly gap: number;
291
+ /** The count of the channels that the gap has space for. It is information only: a whole number of 0 or more. */
292
+ readonly lanes?: number;
293
+ }
269
294
  /** The cell of an input in the taxonomy: one value for each dimension. The dimensions are in `docs/FORMAT.md` of `packing`. */
270
295
  export interface LayoutCell {
271
296
  readonly containerSize?: "fixed" | "freeHeight" | "freeWidth" | "freeAspect" | "freeArea";
@@ -303,6 +328,8 @@ export interface LayoutInput {
303
328
  readonly container?: LayoutContainer;
304
329
  /** The free space between two boxes with their margins. Routes use it. */
305
330
  readonly gap?: number;
331
+ /** The distances of some pairs of boxes. An entry replaces the margins and the `gap` for its pair. `canonicalInput` sorts the list. */
332
+ readonly pairGaps?: readonly PairGap[];
306
333
  readonly boxes: readonly LayoutBox[];
307
334
  readonly edges?: readonly LayoutEdge[];
308
335
  readonly obstacles?: readonly Obstacle[];
@@ -312,6 +339,11 @@ export interface LayoutInput {
312
339
  */
313
340
  readonly base?: string;
314
341
  readonly change?: "add" | "remove" | "resize" | "reorder" | "packed";
342
+ /**
343
+ * The fields that a corpus registry removed, because a dimension value made them wrong (`CorpusDimension.invalidates`).
344
+ * The names are sorted. An input with no removed field has no `invalidated`.
345
+ */
346
+ readonly invalidated?: readonly string[];
315
347
  }
316
348
  /** The input of a packer: a `layout-input/1` file without the edges. */
317
349
  export interface PackInput {
@@ -319,9 +351,16 @@ export interface PackInput {
319
351
  readonly items: readonly Item[];
320
352
  readonly obstacles?: readonly Obstacle[];
321
353
  readonly gap?: number;
354
+ readonly pairGaps?: readonly PairGap[];
322
355
  }
323
356
  /** This function gives the packer input of a file. An input without a container gets `{ fixed: "none" }`, so the packer picks the size. */
324
357
  export declare function toPackInput(input: LayoutInput): PackInput;
358
+ /**
359
+ * This function gives the canonical form of an input. `documentHash` uses it for each `layout-input/1` document.
360
+ * Each pair of `pairGaps` gets `a` before `b`, and the list is sorted by `a` and then by `b`.
361
+ * An input without `pairGaps` is the same object, so its hash does not change.
362
+ */
363
+ export declare function canonicalInput<T extends LayoutInput>(input: T): T;
325
364
  /**
326
365
  * The kind of the shape of an item. A box without `shape` and without `shapeKind` is a `rect`.
327
366
  * The set is open: a later version can add a kind. A reader treats an unknown kind as a kind that it does not support.
@@ -517,8 +556,11 @@ export declare function placedRect(box: LayoutBox): Rect | undefined;
517
556
  /**
518
557
  * This function counts the pairs of placed boxes whose insides, with their margins, overlap by more than `tolerance` on each axis.
519
558
  * A box with a shape counts as its bounding box. That area is larger, thus the count is safe.
559
+ *
560
+ * 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.
561
+ * Thus the pair breaks the rule only when the boxes are nearer than the gap on each axis. The other pairs do not change.
520
562
  */
521
- export declare function countOverlaps(boxes: readonly LayoutBox[], tolerance?: number): number;
563
+ export declare function countOverlaps(boxes: readonly LayoutBox[], tolerance?: number, pairGaps?: readonly PairGap[]): number;
522
564
  /** The options of the container test of `countOutside` and `packHard`. */
523
565
  export interface ContainerTest {
524
566
  /**
@@ -566,7 +608,8 @@ export declare function countObstacleHits(boxes: readonly LayoutBox[], obstacles
566
608
  /**
567
609
  * This function gives the count of each hard rule of the output of a packer.
568
610
  * It applies the output with `applyPack`. Only the placed boxes and the locked boxes count for the overlaps and the container.
569
- * `no-overlap` counts the pairs of boxes and the pairs of a box and an obstacle.
611
+ * `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.
612
+ *
570
613
  * A locked box without a placement, or with a move of more than `RECORD_EPS`, breaks `locked-kept`.
571
614
  * A locked box without a position in the input is a bad input, not a break. `checkInput` finds it.
572
615
  * Another box without a placement that is not in `overflow` breaks `complete`.
@@ -577,13 +620,19 @@ export declare function packHard(input: LayoutInput, output: PackOutput, toleran
577
620
  /**
578
621
  * This function gives the problems of an input file. An empty list tells that the file is good.
579
622
  * A problem is a bad input, not a break of a hard rule. Thus an engine refuses the input.
623
+ * In `pairGaps`, an unknown box, a pair of one box, a repeated pair in either order, a bad `gap` and bad `lanes` are problems.
624
+ * A port with `along` and no `side`, with `x` or `y`, or with a value outside [0, 1] is a problem.
580
625
  */
581
626
  export declare function checkInput(input: LayoutInput): readonly string[];
582
627
  /** This function gives the side after a turn of 90 degrees clockwise. */
583
628
  export declare function turnSide(side: Side): Side;
584
629
  /** This function gives a point of a box of height `h` after the turn. */
585
630
  export declare function turnPoint(x: number, y: number, h: number): [number, number];
586
- /** This function gives a port of a box of height `h` after the turn. Each value of the port turns, also a port with only `x` or only `y`. */
631
+ /**
632
+ * This function gives a port of a box of height `h` after the turn. Each value of the port turns, also a port with only `x` or only `y`.
633
+ * The start of a side is its top end or its left end. Thus `left` goes to `top` and `right` goes to `bottom` with `along` changed to `1 - along`.
634
+ * `top` goes to `right` and `bottom` goes to `left` with the same `along`.
635
+ */
587
636
  export declare function turnPort(port: Port, h: number): Port;
588
637
  /** This function gives a margin after the turn: the value of each side moves one side clockwise. */
589
638
  export declare function turnMargin(margin: Margin): Margin;
@@ -731,6 +780,7 @@ export declare function outputHash(value: unknown, options?: HashOptions): strin
731
780
  /**
732
781
  * This function gives the hash of a document. It uses the rule of `outputHash`, but the form does not include the field `hash` of the document.
733
782
  * With the default grid, it is the input hash of `docs/FORMAT.md` of `packing`.
783
+ * A document with the schema `layout-input/1` goes through `canonicalInput` first. Thus the order of its `pairGaps` does not change the hash.
734
784
  */
735
785
  export declare function documentHash(doc: object, options?: HashOptions): string;
736
786
  /** One output group: the candidates with the same output hash on each decision input. */
@@ -935,6 +985,12 @@ export interface MemberRule {
935
985
  readonly min: number;
936
986
  readonly max: number;
937
987
  readonly ordered: boolean;
988
+ /**
989
+ * The member lists that the option permits. Each entry is a list of whole configs of the space of the members.
990
+ * Without `pool`, each list of base configs with a good count is a member list.
991
+ * With `pool`, a config of the option has the members of one entry, and `spaceSize` counts each entry one time.
992
+ */
993
+ readonly pool?: readonly (readonly StrategyConfig[])[];
938
994
  }
939
995
  /** The inputs that an option supports. A missing field supports each value. */
940
996
  export interface OptionSupports {
@@ -1027,22 +1083,31 @@ export interface SampleOptions extends ShapeFilter {
1027
1083
  /** The count of the configs, a whole number of 0 or more. */
1028
1084
  readonly n: number;
1029
1085
  readonly seed: number;
1030
- /** With `skip` (the default), the sample has no meta option. With `sample`, a meta option draws its members from base samples. */
1086
+ /** With `skip` (the default), the sample has no meta option. With `sample`, a meta option draws its members from base samples, or one entry of its `pool`. */
1031
1087
  readonly meta?: "skip" | "sample";
1032
1088
  /** The largest count of option draws. The default is the larger value of 1000 and `100 * n`. */
1033
1089
  readonly maxTries?: number;
1034
1090
  }
1035
1091
  /** The options of `enumerateSpace`. */
1036
1092
  export type EnumerateOptions = GridOptions | SampleOptions;
1093
+ /** This function gives the problem of a value of a param, or `undefined` for a value in its range. The corpus dimensions of `families.ts` use it. */
1094
+ export declare function paramProblem(param: SpaceParam, value: unknown): string | undefined;
1095
+ /** This function tells if a param is active for the values of the earlier params. A param without `when` is always active. */
1096
+ export declare function paramActive(param: SpaceParam, values: Readonly<Record<string, ParamValue>>): boolean;
1097
+ /** This function gives the stable form of a value of a param: a real number gets 12 significant digits, and `-0` becomes `0`. */
1098
+ export declare function paramValue(param: SpaceParam, value: ParamValue): ParamValue;
1037
1099
  /**
1038
1100
  * This function checks one config of a space. It gives one break for each problem. An empty list tells that the config is good.
1039
1101
  * The `claim` of a break is the kind of the problem, for example `missing`, `unknown`, `inactive`, `param`, `constraint`, `members` or `depth`.
1102
+ *
1103
+ * A member list that is not an entry of the `pool` of its option gives the claim `pool`.
1040
1104
  * With `shapes`, an option that does not support a kind of the list gives the claim `shape`. A member of a meta option gets the same check.
1041
1105
  */
1042
1106
  export declare function checkConfig(space: StrategySpace, config: StrategyConfig, options?: ShapeFilter): ClaimBreak[];
1043
1107
  /**
1044
1108
  * This function checks a space. It gives one break for each problem. An empty list tells that the space is good.
1045
1109
  * It finds duplicate names, empty ranges, defaults out of range, enums without values, bad log scales, unknown names and bad named configs.
1110
+ * It also checks each entry of a `pool`: the count of its members, each member and a repeated entry.
1046
1111
  * The `inputs` of a break of a named config have the name of the config.
1047
1112
  */
1048
1113
  export declare function checkSpace(space: StrategySpace): ClaimBreak[];
@@ -1065,6 +1130,7 @@ export declare function paramLevels(param: SpaceParam, levels: number): ParamVal
1065
1130
  /**
1066
1131
  * This function gives the count of the grid points of a space, with `levels` levels for each numeric param.
1067
1132
  * It counts only the active params and the combinations that keep the constraints. It gives the meta configs apart.
1133
+ * A meta option with a `pool` counts each entry of the pool one time.
1068
1134
  * With `shapes`, it counts only the options that support each kind of the list.
1069
1135
  */
1070
1136
  export declare function spaceSize(space: StrategySpace, options: SpaceSizeOptions): SpaceSize;
@@ -1075,6 +1141,7 @@ export declare function spaceSize(space: StrategySpace, options: SpaceSizeOption
1075
1141
  * - The mode `sample` gives `n` configs of a seeded Latin hypercube. The options of a stage get equal strata, and each active param gets its own strata.
1076
1142
  * - A sample draws again when a point breaks a constraint. After `maxTries` draws, it throws an `Error`. Two sampled configs can be equal.
1077
1143
  * - With `shapes`, only the options that support each kind of the list count. Without `shapes`, the result does not change.
1144
+ * - A meta option with a `pool` gives only the entries of its pool. With `shapes`, only the entries whose members support each kind count.
1078
1145
  */
1079
1146
  export declare function enumerateSpace(space: StrategySpace, options: EnumerateOptions): StrategyConfig[];
1080
1147
  /**
@@ -1227,4 +1294,239 @@ export interface VerdictResult {
1227
1294
  * It throws a `RangeError` for a missing `tie` or `level`, and for no pair. Two records of one side and input, or a value that is not finite, also cause a `RangeError`.
1228
1295
  */
1229
1296
  export declare function verdict<R extends VerdictRecord>(records: Iterable<R>, options: VerdictOptions<R>): VerdictResult;
1297
+ /**
1298
+ * One dimension of a corpus: a param of `strategy-space.ts` with its meaning and the engines that use it.
1299
+ * The field `when` has the form of `SpaceParam.when`: the dimension is active only for some values of an earlier dimension.
1300
+ */
1301
+ export interface CorpusDimension extends SpaceParam {
1302
+ /** The meaning of the dimension, in one sentence. */
1303
+ readonly meaning: string;
1304
+ /** The engines that read the dimension, for example `packing`, `highways` and `joint`. */
1305
+ readonly engines: readonly string[];
1306
+ /** The values of a sweep. Without them, a sweep uses the values of an `enum`, `false` and `true` of a `bool`, or the default. */
1307
+ readonly levels?: readonly ParamValue[];
1308
+ /**
1309
+ * The values that the family accepts. Without it, the family accepts each value of the dimension.
1310
+ * A list is for an `enum` or a `bool`. A sub-range is for an `int` or a `real`.
1311
+ * The default and each level are supported values. `resolve` and `generate` refuse a value that is not supported.
1312
+ */
1313
+ readonly supported?: SupportedValues;
1314
+ /**
1315
+ * The output fields that a value other than the default makes wrong, for example `known`.
1316
+ * Then `generate` of a registry removes these fields from the output, and lists them in `invalidated`.
1317
+ */
1318
+ readonly invalidates?: readonly string[];
1319
+ }
1320
+ /**
1321
+ * The supported values of a dimension (`CorpusDimension.supported`).
1322
+ * The list form gives the values of an `enum` or a `bool`. The range form gives a sub-range of an `int` or a `real`.
1323
+ * A range without `min` or `max` keeps that end of the dimension.
1324
+ */
1325
+ export type SupportedValues = readonly ParamValue[] | SupportedRange;
1326
+ /** The range form of `SupportedValues`: the least and the largest supported value of a numeric dimension. */
1327
+ export interface SupportedRange {
1328
+ readonly min?: number;
1329
+ readonly max?: number;
1330
+ }
1331
+ /** The name of the output field that lists the fields that `generate` of a registry removed. */
1332
+ export declare const INVALIDATED_FIELD = "invalidated";
1333
+ /** The values of the dimensions of one input: one value for each name. */
1334
+ export type DimensionValues = Readonly<Record<string, ParamValue>>;
1335
+ /** A factory of seeded random numbers: it gives a source of numbers in [0, 1) for a seed. */
1336
+ export type RngFactory = (seed: number) => () => number;
1337
+ /**
1338
+ * The cross-engine note of a family. `exact` tells that each JavaScript engine gives the same output.
1339
+ * `libm-dependent` tells that the family uses a function that is not correctly rounded in each engine, for example `Math.log`, `Math.cos` or `**`.
1340
+ */
1341
+ export type CrossEngine = "exact" | "libm-dependent";
1342
+ /** The random numbers of the default factory: `mulberry32` of `random.ts`. Its stream is pinned in `families.test.ts`. */
1343
+ export declare const DEFAULT_RNG: RngFactory;
1344
+ /** The context that a registry gives to `generate`. */
1345
+ export interface GenerateContext {
1346
+ /** The random factory of the family: its own `rng`, or `DEFAULT_RNG`. */
1347
+ readonly rng: RngFactory;
1348
+ /** The source of random numbers of the input: `rng(rngSeed(seed, dims))`. A family that does not use it takes no numbers from it. */
1349
+ readonly random: () => number;
1350
+ /** The name of the corpus of the input, when the caller gives one. */
1351
+ readonly set?: string;
1352
+ }
1353
+ /**
1354
+ * A family of a corpus: a seeded generator with declared dimensions. The engine that owns it gives it to a registry.
1355
+ * The registry gives `generate` the raw seed and the full dimension values.
1356
+ * The registry changes the output only for a dimension with `invalidates` at a value other than its default.
1357
+ */
1358
+ export interface CorpusFamily<O = LayoutInput> {
1359
+ /** The name of the family, for example `rect-grid`. */
1360
+ readonly name: string;
1361
+ /** The version. A change of the output of the family needs a new version. A dimension of only some versions is in the list of those versions only. */
1362
+ readonly version: number;
1363
+ /** The engine that owns the definition of the family, for example `packing`. */
1364
+ readonly owner: string;
1365
+ /** The meaning of the family, in one sentence. */
1366
+ readonly meaning: string;
1367
+ /** The dimensions of the family, in their order. A dimension with `when` comes after the dimension that its `when` names. The name `kind` is reserved. */
1368
+ readonly dimensions: readonly CorpusDimension[];
1369
+ /** The text of the rule that gives the random numbers of an input from its seed and its dimensions. */
1370
+ readonly seeding: string;
1371
+ /** The cross-engine note of the family. */
1372
+ readonly crossEngine: CrossEngine;
1373
+ /** The random factory of the family. The default is `DEFAULT_RNG`. */
1374
+ readonly rng?: RngFactory;
1375
+ /** This function gives the seed of `context.random` from the input seed and the full dimension values. The default gives the input seed. */
1376
+ readonly rngSeed?: (seed: number, dims: DimensionValues) => number;
1377
+ /** The dimensions of the family key of `familyBy`, after the kind of the cell. A dimension with `when` is not permitted. The default is no dimension. */
1378
+ readonly familyBy?: readonly string[];
1379
+ /**
1380
+ * This function gives the hash of an output after the registry removes the fields of `invalidates`. The default is `documentHash` of `hash.ts`.
1381
+ * The registry uses it only for an output with a `hash` field of text. The registry gives it an output of the family.
1382
+ * Its parameter has the type `never`, so a family of each output type can be a `CorpusFamily<unknown>`.
1383
+ */
1384
+ readonly hash?: (output: never) => string;
1385
+ /** This function gives the input of a seed. `dims` has a value for each dimension, also for an inactive dimension. */
1386
+ generate(seed: number, dims: DimensionValues, context: GenerateContext): O;
1387
+ }
1388
+ /** The options of `generate` of a registry. */
1389
+ export interface GenerateOptions {
1390
+ /** The version of the family. The default is the first version that the registry got. */
1391
+ readonly version?: number;
1392
+ /** The name of the corpus. The registry gives it to the family in `context.set`. */
1393
+ readonly set?: string;
1394
+ }
1395
+ /** The options of `cells` and `cellCount` of a registry. */
1396
+ export interface CellsOptions {
1397
+ readonly version?: number;
1398
+ /** The dimensions of the sweep. The other dimensions keep their defaults. The default is each dimension of the family. */
1399
+ readonly sweep?: readonly string[];
1400
+ /** The values of a sweep for some dimensions, in place of the levels of the dimensions. */
1401
+ readonly levels?: Readonly<Record<string, readonly ParamValue[]>>;
1402
+ }
1403
+ /** The cell of an input of a registry: `<name>@<version>` of its family in `kind` (`familyKind`), and the value of each active dimension. */
1404
+ export type RegistryCell = Readonly<Record<string, ParamValue>> & {
1405
+ readonly kind: string;
1406
+ };
1407
+ /** This function gives the `kind` of the cells of a version of a family: `<name>@<version>`, for example `rect-grid@2`. Thus two versions do not share a family key. */
1408
+ export declare function familyKind(name: string, version: number): string;
1409
+ /** A registry of families. An import registers nothing: a host makes a registry from the lists of families of the engines. */
1410
+ export interface FamilyRegistry<O = LayoutInput> {
1411
+ /** This method adds a family. It throws a `RangeError` for a second family with the same name and version, or for a bad dimension. */
1412
+ register(family: CorpusFamily<O>): FamilyRegistry<O>;
1413
+ /** This method gives a family. Without a version, it gives the first version that the registry got. It throws a `RangeError` for an unknown family. */
1414
+ family(name: string, version?: number): CorpusFamily<O>;
1415
+ /** This method gives each family, in the order of registration. */
1416
+ families(): readonly CorpusFamily<O>[];
1417
+ /**
1418
+ * This method gives the full dimension values of an input. It throws a `RangeError` for an unknown dimension, a bad value or a value that is not supported.
1419
+ * The methods with `dims` accept a cell of `cellOf`: they ignore a `kind` that is the `familyKind` of the family, and refuse another `kind`.
1420
+ */
1421
+ resolve(name: string, dims?: Readonly<Record<string, ParamValue>>, version?: number): DimensionValues;
1422
+ /**
1423
+ * This method gives the input of a seed: the output of the family. A dimension with `invalidates` at a value other than its default changes it.
1424
+ * Then the method removes those fields, adds their names to `invalidated` and calculates the `hash` again. Another output has no change.
1425
+ */
1426
+ generate(name: string, seed: number, dims?: Readonly<Record<string, ParamValue>>, options?: GenerateOptions): O;
1427
+ /** This method gives the cell of an input: the `familyKind` of the family version and the value of each active dimension. */
1428
+ cellOf(name: string, dims?: Readonly<Record<string, ParamValue>>, version?: number): RegistryCell;
1429
+ /** This method gives the full dimension values of each cell of a sweep, without the dead combinations of `when`. */
1430
+ cells(name: string, options?: CellsOptions): Generator<DimensionValues>;
1431
+ /** This method gives the count of the cells of `cells`. It makes no input. */
1432
+ cellCount(name: string, options?: CellsOptions): number;
1433
+ /** This method gives the defaults, and each end of each numeric range. The dimensions that a `when` needs get its first value. The other dimensions keep their defaults. */
1434
+ boundaryCells(name: string, version?: number): DimensionValues[];
1435
+ /** This method gives the random source of an input: the stream that `generate` gets in `context.random`. */
1436
+ rngOf(name: string, version?: number): (seed: number, dims?: Readonly<Record<string, ParamValue>>) => () => number;
1437
+ /** This method gives the map form of `FamilyBy` for the cells of `cellOf`: the `familyKind` of each family version, with its own `familyBy`. */
1438
+ familyBy(): FamilyBy;
1439
+ }
1440
+ /** The default key of a family in a manifest: the kind of the cell alone. It is the map form of `FamilyBy` with the entry `"*"`. */
1441
+ export declare const DEFAULT_FAMILY_BY: FamilyBy;
1442
+ /**
1443
+ * The shared dimension table. A family takes a dimension of it with `sharedDimension`, or declares its own dimension.
1444
+ * The coverage table of each dimension and each engine is in `docs/CORPUS.md`.
1445
+ */
1446
+ export declare const CORPUS_DIMENSIONS: Readonly<Record<string, CorpusDimension>>;
1447
+ /**
1448
+ * This function gives a dimension of `CORPUS_DIMENSIONS`, with the fields of `patch` over it. It throws a `RangeError` for an unknown name.
1449
+ * With `supported` or `invalidates` in the patch, it also throws a `RangeError` for a bad dimension, as `ownerDimension` does.
1450
+ */
1451
+ export declare function sharedDimension(name: string, patch?: Partial<CorpusDimension>): CorpusDimension;
1452
+ /** The fields of a dimension that the owner declares: each field of `CorpusDimension` but the name. */
1453
+ export type OwnerDimensionSpec = Omit<CorpusDimension, "name">;
1454
+ /**
1455
+ * This function gives a dimension that only its owner declares, for example `cut` of a family of `packing`.
1456
+ * It throws a `RangeError` for a name of `CORPUS_DIMENSIONS`, the reserved name `kind`, or a bad default, level, `supported` or `invalidates`.
1457
+ * The registry examines the `when` of the dimension, because it needs the earlier dimensions.
1458
+ */
1459
+ export declare function ownerDimension(name: string, spec: OwnerDimensionSpec): CorpusDimension;
1460
+ /**
1461
+ * This function tells if a family accepts a value of a dimension. A site uses it to show the values that a family does not support.
1462
+ * It gives `false` for a bad value, and for a value outside `supported`. Without `supported`, it gives `true` for each good value.
1463
+ */
1464
+ export declare function dimensionSupports(dim: CorpusDimension, value: unknown): boolean;
1465
+ /**
1466
+ * This function gives the value at the fraction `t` of the range of a numeric dimension, on its scale. A slider of a site uses it.
1467
+ * A log scale with a `min` of 0 or less is the log of `1 + x - min`. An `int` dimension gives a whole number.
1468
+ */
1469
+ export declare function dimensionAt(dim: SpaceParam, t: number): number;
1470
+ /** This function gives the fraction of the range of a numeric dimension at a value, on its scale. It is the inverse of `dimensionAt`. */
1471
+ export declare function dimensionUnit(dim: SpaceParam, value: number): number;
1472
+ /**
1473
+ * This function gives the values of a sweep of a dimension. `levels` of the dimension come first. Then an `enum` gives its values, and a `bool` gives `false` and `true`.
1474
+ * With `steps`, a numeric dimension gives `steps` points from `min` to `max` on its scale. Else it gives its default.
1475
+ * With `supported`, an `enum` and a `bool` give only the supported values, and the points of a numeric dimension stay in the supported range.
1476
+ */
1477
+ export declare function levelsOf(dim: CorpusDimension, steps?: number): ParamValue[];
1478
+ /**
1479
+ * This function gives the full dimension values of an input. A missing dimension gets its default. An inactive dimension of `when` also gets its default.
1480
+ * Thus a default that the caller gives, a missing value and an inactive value give the same values. A real number gets its stable form.
1481
+ *
1482
+ * The function throws a `RangeError` for an unknown dimension or a bad value, also for a bad value of an inactive dimension.
1483
+ * It also throws a `RangeError` for a value outside `supported`, with the text "not supported by" and `by`.
1484
+ */
1485
+ export declare function resolveDimensions(dimensions: readonly CorpusDimension[], dims?: Readonly<Record<string, ParamValue>>, where?: string, by?: string): DimensionValues;
1486
+ /** This function gives a new registry with the families of the list. Each engine gives the list of its families. An import registers nothing. */
1487
+ export declare function createFamilyRegistry<O = LayoutInput>(families?: Iterable<CorpusFamily<O>>): FamilyRegistry<O>;
1488
+ /** A step of a composed family: a pure function that changes an input after its base family, as `edgeStep` does. */
1489
+ export interface CorpusStep {
1490
+ readonly name: string;
1491
+ readonly version: number;
1492
+ /** The engine that owns the definition of the step. */
1493
+ readonly owner: string;
1494
+ readonly meaning: string;
1495
+ /** The dimensions of the step. Their names are not names of the dimensions of the base family. */
1496
+ readonly dimensions: readonly CorpusDimension[];
1497
+ /** The text of the rule that gives the random numbers of the step from the seed. */
1498
+ readonly seeding: string;
1499
+ readonly crossEngine: CrossEngine;
1500
+ /** This function gives the part of the family of the input that tells the values of the step. Without it, the family does not change. */
1501
+ readonly familyPart?: (dims: DimensionValues) => string;
1502
+ /** This function gives the changed input. It removes the old `hash` of the input. */
1503
+ apply(input: LayoutInput, seed: number, dims: DimensionValues): LayoutInput;
1504
+ }
1505
+ /** The options of `composeFamily`. */
1506
+ export interface ComposeOptions {
1507
+ /** The default is the name of the base family and the names of the steps, with `+` between them. */
1508
+ readonly name?: string;
1509
+ /** The default is the owner of the base family. */
1510
+ readonly owner?: string;
1511
+ readonly meaning?: string;
1512
+ /** The hash of the composed input. The default is `documentHash` of `hash.ts`. The composed family also gives it to the registry in `hash`. */
1513
+ readonly hash?: (input: LayoutInput) => string;
1514
+ }
1515
+ /**
1516
+ * This function gives a family that runs the base family and then each step, with the same seed.
1517
+ * The family of the input gets the part of each step after a dot. The id becomes `<set>/<family>/s<seed>`, and the input gets the hash of `options.hash`.
1518
+ * The function throws a `RangeError` when a step has a dimension with the name of an earlier dimension.
1519
+ */
1520
+ export declare function composeFamily(base: CorpusFamily<LayoutInput>, steps: readonly CorpusStep[], options?: ComposeOptions): CorpusFamily<LayoutInput>;
1521
+ /**
1522
+ * The step `edges` of `edgeStep` (version 1), as a corpus step. Its family part is `e-<edgeDensity>.<edgeShape>.<groups>.<ports>`.
1523
+ * The value `random` of `hubBy` adds the part `.hub-random`.
1524
+ */
1525
+ export declare const EDGES_STEP: CorpusStep;
1526
+ /**
1527
+ * The shared family `rect-scattered`, version 1: a fixed rectangle container, rectangle obstacles at random places and boxes without positions.
1528
+ * It is the one copy of the generator of `docs/FORMAT.md` of `packing`. Its input is the input of `packing`, byte for byte.
1529
+ * The steps `container`, `obstacles` and `boxes` each have a stream of `stepRandom`. Each value is a whole number, so the family is `exact`.
1530
+ */
1531
+ export declare const RECT_SCATTERED: CorpusFamily<LayoutInput>;
1230
1532
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","names":[],"sources":["../src/geometry.ts","../src/corpus.ts","../src/input.ts","../src/shapes.ts","../src/tolerance.ts","../src/output.ts","../src/record.ts","../src/rules.ts","../src/turn.ts","../src/measures.ts","../src/strategy.ts","../src/random.ts","../src/edges.ts","../src/hash.ts","../src/portfolio.ts","../src/strategy-space.ts","../src/verdict.ts"],"mappings":";YACY;;qBAGC,gBAAgB;iBAEZ;WACN;WACA;;;iBAIM;WACN;WACA;WACA;WACA;;;iBAIM;WACN;WACA;WACA;WACA;;;;;;YAOC;WACG;W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src/input.ts","../src/shapes.ts","../src/tolerance.ts","../src/output.ts","../src/record.ts","../src/rules.ts","../src/turn.ts","../src/measures.ts","../src/strategy.ts","../src/random.ts","../src/edges.ts","../src/hash.ts","../src/portfolio.ts","../src/strategy-space.ts","../src/verdict.ts","../src/families.ts"],"mappings":";YACY;;qBAGC,gBAAgB;iBAEZ;WACN;WACA;;;iBAIM;WACN;WACA;WACA;WACA;;;iBAIM;WACN;WACA;WACA;WACA;;;;;;YAOC;WACG;WAAuB;WAAoB;WAAoB;WAAoB;;WAEnF;WACA;WACA;;WAEA;WAAyB;WAAqB;WAAqB;;WACnE;WAA0B;WAAqB;WAAqB;WAAqB;;;YAG5F,kBAAkB;;wBAGd,YAAY,QAAQ,qBAAqB;;wBAOzC,KAAK,MAAM,MAAM,QAAQ,qBAAqB;;wBAM9C,SAAS,QAAQ,SAAS;;wBAyB1B,UAAU,QAAQ,QAAQ,YAAY,aAAa;;;;;wBAoBnD,UAAU,GAAG,MAAM,GAAG;WAAkB;WAAoB;;;iBCnG3D;;WAEN;;WAEA;;WAEA;;;iBAIM;;WAEN;;WAEA;;WAEA,QAAQ,SAAS;;WAEjB,WAAW;;WAEX;;;;;;;;YASC;;;;YAGA,aAAa,SAAS;;qBAGrB;;;;;;wBA4CG,SAAS,MAAM,YAAY,UAAU;;YAazC,SAAS,MAAM,OAAO;;;;;wBAMlB,eAAe,GAAG,QAAQ,SAAS,IAAI,UAAU,SAAS,IAAI,0BAA8B;;;;;wBAa5F,gBAAgB,mBAAmB;;;;;;;;;;;;;;;wBAuCnC,cAAc,GAC5B,QAAQ,SAAS,IACjB,UAAU,SAAS,IACnB,OAAO,eACP,yBACA,UAAS,OAAO,MAAM,yBACrB;;iBAiEc;WACN;WACA;;;;;;wBAOK,aAAa,gBAAgB,iBAAiB;;qBAKjD;;iBAGI;WACN;WACA;;;iBAIM;WACN,eAAe;WACf;;WAEA;;WAEA,QAAQ,SAAS;aAA0B,gBAAgB;;;;iBAIrD;WACN;WACA;a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