@tscircuit/props 0.0.648 → 0.0.650
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 +3 -1
- package/dist/index.d.ts +1817 -2
- package/dist/index.js +12 -7
- package/dist/index.js.map +1 -1
- package/lib/common/fanoutTracePath.ts +6 -11
- package/lib/common/pinAttributeMap.ts +30 -0
- package/lib/components/breakout.ts +3 -1
- package/package.json +1 -1
|
@@ -31,7 +31,10 @@ const routePoint = z.discriminatedUnion("route_type", [
|
|
|
31
31
|
* fanout's local PCB frame, in mm: +X right, +Y up, right-handed with +Z
|
|
32
32
|
* above the board. They are points (placement adds translation), not
|
|
33
33
|
* directions. Numeric distances are mm; unit strings are parsed to mm.
|
|
34
|
-
* Layers are physical board layers, independent of placement.
|
|
34
|
+
* Layers are physical board layers, independent of placement. Either endpoint
|
|
35
|
+
* may be a via: the initial layer is its from_layer and the final layer is its
|
|
36
|
+
* to_layer. Placement legality (including allowViaInPad) is checked by core,
|
|
37
|
+
* since this schema has no pad geometry or inherited routing configuration.
|
|
35
38
|
*/
|
|
36
39
|
export const fanoutTracePath = z.object({
|
|
37
40
|
connection: z.string().min(1),
|
|
@@ -39,16 +42,8 @@ export const fanoutTracePath = z.object({
|
|
|
39
42
|
.array(routePoint)
|
|
40
43
|
.min(2)
|
|
41
44
|
.superRefine((route, ctx) => {
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
route.at(-1)?.route_type !== "wire"
|
|
45
|
-
) {
|
|
46
|
-
ctx.addIssue({
|
|
47
|
-
code: "custom",
|
|
48
|
-
message: "A fanout trace path must start and end with wire points",
|
|
49
|
-
})
|
|
50
|
-
}
|
|
51
|
-
let layer = route[0]?.route_type === "wire" ? route[0].layer : undefined
|
|
45
|
+
const first = route[0]
|
|
46
|
+
let layer = first?.route_type === "via" ? first.from_layer : first?.layer
|
|
52
47
|
for (const point of route) {
|
|
53
48
|
if (
|
|
54
49
|
(point.route_type === "wire" ? point.layer : point.from_layer) !==
|
|
@@ -15,6 +15,26 @@ export const pinCapability = z.enum([
|
|
|
15
15
|
export type PinCapability = z.input<typeof pinCapability>
|
|
16
16
|
|
|
17
17
|
export interface PinAttributeMap {
|
|
18
|
+
/** Whether the pin accepts a signal. */
|
|
19
|
+
isInput?: boolean
|
|
20
|
+
/** Whether the pin drives a signal. */
|
|
21
|
+
isOutput?: boolean
|
|
22
|
+
/** Whether the pin can both accept and drive signals. */
|
|
23
|
+
isBidirectional?: boolean
|
|
24
|
+
/** Whether the pin is a passive component terminal. */
|
|
25
|
+
isPassive?: boolean
|
|
26
|
+
/** Whether the pin supports a high-impedance output state. */
|
|
27
|
+
canUseTriState?: boolean
|
|
28
|
+
/** Whether the pin is configured for tri-state operation, not its instantaneous impedance. */
|
|
29
|
+
isUsingTriState?: boolean
|
|
30
|
+
/** Whether the pin supports an open-collector output. */
|
|
31
|
+
canUseOpenCollector?: boolean
|
|
32
|
+
/** Whether the pin is configured as an open-collector output. */
|
|
33
|
+
isUsingOpenCollector?: boolean
|
|
34
|
+
/** Whether the pin supports an open-emitter output. */
|
|
35
|
+
canUseOpenEmitter?: boolean
|
|
36
|
+
/** Whether the pin is configured as an open-emitter output. */
|
|
37
|
+
isUsingOpenEmitter?: boolean
|
|
18
38
|
capabilities?: Array<PinCapability>
|
|
19
39
|
activeCapabilities?: Array<PinCapability>
|
|
20
40
|
activeCapability?: PinCapability
|
|
@@ -44,6 +64,16 @@ export interface PinAttributeMap {
|
|
|
44
64
|
}
|
|
45
65
|
|
|
46
66
|
export const pinAttributeMap = z.object({
|
|
67
|
+
isInput: z.boolean().optional(),
|
|
68
|
+
isOutput: z.boolean().optional(),
|
|
69
|
+
isBidirectional: z.boolean().optional(),
|
|
70
|
+
isPassive: z.boolean().optional(),
|
|
71
|
+
canUseTriState: z.boolean().optional(),
|
|
72
|
+
isUsingTriState: z.boolean().optional(),
|
|
73
|
+
canUseOpenCollector: z.boolean().optional(),
|
|
74
|
+
isUsingOpenCollector: z.boolean().optional(),
|
|
75
|
+
canUseOpenEmitter: z.boolean().optional(),
|
|
76
|
+
isUsingOpenEmitter: z.boolean().optional(),
|
|
47
77
|
capabilities: z.array(pinCapability).optional(),
|
|
48
78
|
activeCapabilities: z.array(pinCapability).optional(),
|
|
49
79
|
activeCapability: pinCapability.optional(),
|
|
@@ -25,7 +25,9 @@ export interface BreakoutProps
|
|
|
25
25
|
* Saved port-to-exit wire/via routes in the fanout's local PCB frame.
|
|
26
26
|
* Numeric distances are mm; unit strings are normalized to mm. Each route
|
|
27
27
|
* must start at its selected port and end at its fanout exit. Layers name
|
|
28
|
-
* physical board layers.
|
|
28
|
+
* physical board layers. Either endpoint may be a via when permitted by
|
|
29
|
+
* the circuit's routing rules (e.g. allowViaInPad for a via at a pad).
|
|
30
|
+
* Core creates the exits and preserves saved copper.
|
|
29
31
|
* When supplied, replaces automatic routing (including `autorouter`) for
|
|
30
32
|
* this fanout and must cover all its routing connections. Do not also add
|
|
31
33
|
* a breakoutpoint/fanoutpoint for the same port. Omitted by default; existing
|