@tscircuit/props 0.0.592 → 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.
- package/README.md +18 -0
- package/dist/index.d.ts +63 -14
- package/dist/index.js +471 -453
- package/dist/index.js.map +1 -1
- package/lib/common/ninePointAnchor.ts +2 -0
- package/lib/components/autoroutingphase.ts +22 -0
- package/lib/components/bus.ts +22 -0
- package/lib/components/group.ts +8 -0
- package/lib/index.ts +1 -0
- package/package.json +2 -2
|
@@ -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 (
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { expectTypesMatch } from "lib/typecheck"
|
|
2
|
+
import { z } from "zod"
|
|
3
|
+
|
|
4
|
+
export type BusName = string
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Declares a group of connections that an autorouter should keep together.
|
|
8
|
+
* Each connection may be a trace name or a port selector.
|
|
9
|
+
*/
|
|
10
|
+
export interface BusProps {
|
|
11
|
+
name?: string
|
|
12
|
+
/** Trace names or port selectors for the connections in the bus. */
|
|
13
|
+
connections: string[]
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export const busProps = z.object({
|
|
17
|
+
name: z.string().optional(),
|
|
18
|
+
connections: z.array(z.string()).min(2),
|
|
19
|
+
})
|
|
20
|
+
|
|
21
|
+
type InferredBusProps = z.input<typeof busProps>
|
|
22
|
+
expectTypesMatch<BusProps, InferredBusProps>(true)
|
package/lib/components/group.ts
CHANGED
|
@@ -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/lib/index.ts
CHANGED
|
@@ -58,6 +58,7 @@ export * from "./components/smtpad"
|
|
|
58
58
|
export * from "./components/solderpaste"
|
|
59
59
|
export * from "./components/hole"
|
|
60
60
|
export * from "./components/trace"
|
|
61
|
+
export * from "./components/bus"
|
|
61
62
|
export * from "./components/differentialpair"
|
|
62
63
|
export * from "./components/footprint"
|
|
63
64
|
export * from "./components/symbol"
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tscircuit/props",
|
|
3
|
-
"version": "0.0.
|
|
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.
|
|
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",
|