@tscircuit/props 0.0.593 → 0.0.594

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.
@@ -11,3 +11,5 @@ export const ninePointAnchor = z.enum([
11
11
  "bottom_center",
12
12
  "bottom_right",
13
13
  ])
14
+
15
+ export type NinePointAnchor = z.infer<typeof ninePointAnchor>
@@ -1,5 +1,10 @@
1
1
  import { expectTypesMatch } from "lib/typecheck"
2
2
  import { z } from "zod"
3
+ import {
4
+ type NinePointAnchor,
5
+ ninePointAnchor,
6
+ } from "../common/ninePointAnchor"
7
+ import type { BusName } from "./bus"
3
8
  import {
4
9
  type AutorouterProp,
5
10
  type RoutingTolerances,
@@ -7,6 +12,12 @@ import {
7
12
  routingTolerances,
8
13
  } from "./group"
9
14
 
15
+ export type BusFanoutDirection =
16
+ | NinePointAnchor
17
+ | {
18
+ direction: NinePointAnchor
19
+ }
20
+
10
21
  export interface AutoroutingPhaseProps extends RoutingTolerances {
11
22
  key?: any
12
23
  name?: string
@@ -22,8 +33,18 @@ export interface AutoroutingPhaseProps extends RoutingTolerances {
22
33
  connection?: string
23
34
  connections?: string[]
24
35
  reroute?: boolean
36
+ /**
37
+ * Fanout direction for each named bus in this phase. `center` leaves the
38
+ * direction unconstrained.
39
+ */
40
+ busFanoutDirections?: Record<BusName, BusFanoutDirection>
25
41
  }
26
42
 
43
+ const busFanoutDirection = z.union([
44
+ ninePointAnchor,
45
+ z.object({ direction: ninePointAnchor }),
46
+ ])
47
+
27
48
  export const autoroutingPhaseProps = z
28
49
  .object({
29
50
  key: z.any().optional(),
@@ -43,6 +64,7 @@ export const autoroutingPhaseProps = z
43
64
  connection: z.string().optional(),
44
65
  connections: z.array(z.string()).optional(),
45
66
  reroute: z.boolean().optional(),
67
+ busFanoutDirections: z.record(busFanoutDirection).optional(),
46
68
  })
47
69
  .superRefine((value, ctx) => {
48
70
  if (
@@ -1,6 +1,8 @@
1
1
  import { expectTypesMatch } from "lib/typecheck"
2
2
  import { z } from "zod"
3
3
 
4
+ export type BusName = string
5
+
4
6
  /**
5
7
  * Declares a group of connections that an autorouter should keep together.
6
8
  * Each connection may be a trace name or a port selector.
@@ -353,6 +353,8 @@ export interface AutorouterConfig {
353
353
  | "krt"
354
354
  | "freerouting"
355
355
  | "laser_prefab" // Prefabricated PCB with laser copper ablation
356
+ | "single_layer_fanout"
357
+ | "fanout"
356
358
  | /** @deprecated Use "auto_jumper" */ "auto-jumper"
357
359
  | /** @deprecated Use "sequential_trace" */ "sequential-trace"
358
360
  | /** @deprecated Use "auto_local" */ "auto-local"
@@ -371,6 +373,8 @@ export type AutorouterPreset =
371
373
  | "krt"
372
374
  | "freerouting"
373
375
  | "laser_prefab"
376
+ | "single_layer_fanout"
377
+ | "fanout"
374
378
  | "auto-jumper"
375
379
  | "sequential-trace"
376
380
  | "auto-local"
@@ -425,6 +429,8 @@ export const autorouterConfig = z.object({
425
429
  "krt",
426
430
  "freerouting",
427
431
  "laser_prefab",
432
+ "single_layer_fanout",
433
+ "fanout",
428
434
  "auto-jumper",
429
435
  "sequential-trace",
430
436
  "auto-local",
@@ -446,6 +452,8 @@ export const autorouterPreset = z.union([
446
452
  z.literal("krt"),
447
453
  z.literal("freerouting"),
448
454
  z.literal("laser_prefab"), // Prefabricated PCB with laser copper ablation
455
+ z.literal("single_layer_fanout"),
456
+ z.literal("fanout"),
449
457
  z.literal("auto-jumper"),
450
458
  z.literal("sequential-trace"),
451
459
  z.literal("auto-local"),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tscircuit/props",
3
- "version": "0.0.593",
3
+ "version": "0.0.594",
4
4
  "description": "Props for tscircuit builtin component types",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",
@@ -32,7 +32,7 @@
32
32
  "@types/node": "^20.12.11",
33
33
  "@types/react": "^18.3.2",
34
34
  "ava": "^6.1.3",
35
- "circuit-json": "^0.0.450",
35
+ "circuit-json": "^0.0.455",
36
36
  "expect-type": "^1.3.0",
37
37
  "glob": "^11.0.0",
38
38
  "madge": "^8.0.0",