@mark1russell7/highways 0.9.1 → 0.9.3

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.
@@ -6,6 +6,9 @@ import type { MlsebOptions } from "../highways/mlseb/index.ts";
6
6
  import type { PowerOptions } from "../highways/power/index.ts";
7
7
  import type { SbebOptions } from "../highways/sbeb/index.ts";
8
8
  import type { CutOptions } from "../groups/cut/index.ts";
9
+ import type { JustifyOptions } from "../plugs/justify.ts";
10
+ import type { SidePlugOptions } from "../plugs/side.ts";
11
+ import type { SpreadOptions } from "../plugs/spread/index.ts";
9
12
  import type { KdOptions } from "../groups/kd/index.ts";
10
13
  import type { KeyOptions } from "../groups/keys/index.ts";
11
14
  import type { HighwayBase } from "../highways/base.ts";
@@ -125,6 +128,19 @@ export const CORNERS_SCHEMA: OptionSchema<RouterPreset<CornersOptions>> = {
125
128
  },
126
129
  plug: { type: "strategy", step: "plugs", describe: "The plug rule: a strategy of the step `plugs`. Without it, the option `plugs` places the plugs." },
127
130
  plugOptions: { type: "object", describe: "The options of the strategy `plug`." },
131
+ outside: {
132
+ type: "enum",
133
+ values: ["throw", "skip", "clamp"],
134
+ default: "throw",
135
+ describe: "The rule for a box outside the box of its frame: throw a `RangeError`, skip the box and its inner edges, or cut the box to the bounds.",
136
+ },
137
+ frameInset: {
138
+ type: "number",
139
+ min: 0,
140
+ max: 20,
141
+ step: 1,
142
+ describe: "The distance from the walls of a frame to the bounds of its inner routes. Without a value, the inset is the margin.",
143
+ },
128
144
  };
129
145
 
130
146
  /** The declarations of the options of the router `trunks`. */
@@ -915,6 +931,25 @@ export const DEPTHS_SCHEMA: OptionSchema<DepthLevelOptions> = {
915
931
  levels: SECTIONS_SCHEMA.levels,
916
932
  };
917
933
 
934
+ /** The declarations of the options of the plug strategy `side` (WILD-001). The defaults are the plugs of `corners` with `plugs: "side"`. */
935
+ export const SIDE_PLUG_SCHEMA: OptionSchema<SidePlugOptions> = {
936
+ bend: { type: "number", min: 0, max: 4, step: 0.25, default: 1, describe: "The cost of a slant first leg: its length grows by this value times its angle to the normal." },
937
+ inset: { type: "number", min: 0, max: 12, step: 1, default: 6, describe: "A plug stays this far from the corners of its side." },
938
+ most: { type: "integer", min: 1, max: 64, step: 1, default: 16, describe: "The largest number of places that the search tries on each side." },
939
+ };
940
+
941
+ /** The declarations of the options of the plug strategy `justify` (WILD-002). */
942
+ export const JUSTIFY_SCHEMA: OptionSchema<JustifyOptions> = {
943
+ plugGap: { type: "number", min: 0, max: 24, step: 1, default: 8, describe: "The free plugs of a side keep their order and at least this gap. 0 keeps each plug where it faces." },
944
+ };
945
+
946
+ /** The declarations of the options of the plug strategy `spread` (PLUG-SPREAD). */
947
+ export const SPREAD_SCHEMA: OptionSchema<SpreadOptions> = {
948
+ plugGap: { type: "number", min: 0, max: 24, step: 1, default: 8, describe: "The least gap between two plugs of one wall. On a short wall, the gap shrinks evenly." },
949
+ inset: { type: "number", min: 0, max: 12, step: 1, default: 6, describe: "A plug stays this far from the corners of its wall." },
950
+ rounds: { type: "integer", min: 0, max: 8, step: 1, default: 2, describe: "The passes that sort each wall again by the new places of the far ends." },
951
+ };
952
+
918
953
  /** The declarations of the options of the whole strategy `pipeline`. */
919
954
  export const PIPELINE_SCHEMA: OptionSchema<PipelineOptions> = {
920
955
  router: { type: "strategy", step: "router", describe: "The router. A highway plan takes its place." },