@tscircuit/props 0.0.653 → 0.0.655
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 +20 -0
- package/dist/index.d.ts +19 -0
- package/dist/index.js +41 -1
- package/dist/index.js.map +1 -1
- package/lib/components/board.ts +43 -0
- package/lib/components/via.ts +26 -0
- package/package.json +1 -1
package/lib/components/board.ts
CHANGED
|
@@ -78,6 +78,12 @@ export const boardOutlinePoint = z
|
|
|
78
78
|
export interface BoardProps
|
|
79
79
|
extends Omit<SubcircuitGroupProps, "subcircuit" | "connections" | "outline"> {
|
|
80
80
|
title?: string
|
|
81
|
+
/** Fabricator preset, preserved as supplied. Omitted leaves the preset unset. */
|
|
82
|
+
fabricatorPreset?:
|
|
83
|
+
| "jlcpcb_economy"
|
|
84
|
+
| "jlcpcb_standard"
|
|
85
|
+
| "jlcpcb_economy_20260912"
|
|
86
|
+
| "jlcpcb_standard_20260912"
|
|
81
87
|
material?: "fr4" | "fr1" | "flex"
|
|
82
88
|
/** Number of layers for the PCB */
|
|
83
89
|
layers?: 1 | 2 | 4 | 6 | 8 | 10
|
|
@@ -86,6 +92,13 @@ export interface BoardProps
|
|
|
86
92
|
* false, which restricts newly generated vias to the full board stack.
|
|
87
93
|
*/
|
|
88
94
|
allowBlindAndBuriedVias?: boolean
|
|
95
|
+
defaultViaTenting?:
|
|
96
|
+
| boolean
|
|
97
|
+
| "both_sides"
|
|
98
|
+
| "top_and_bottom_tented"
|
|
99
|
+
| "top_tented"
|
|
100
|
+
| "bottom_tented"
|
|
101
|
+
| "exposed"
|
|
89
102
|
borderRadius?: Distance
|
|
90
103
|
thickness?: Distance
|
|
91
104
|
boardAnchorPosition?: Point
|
|
@@ -135,6 +148,17 @@ export interface BoardProps
|
|
|
135
148
|
export const boardProps = subcircuitGroupProps
|
|
136
149
|
.omit({ connections: true })
|
|
137
150
|
.extend({
|
|
151
|
+
fabricatorPreset: z
|
|
152
|
+
.enum([
|
|
153
|
+
"jlcpcb_economy",
|
|
154
|
+
"jlcpcb_standard",
|
|
155
|
+
"jlcpcb_economy_20260912",
|
|
156
|
+
"jlcpcb_standard_20260912",
|
|
157
|
+
])
|
|
158
|
+
.optional()
|
|
159
|
+
.describe(
|
|
160
|
+
"Fabricator preset, preserved as supplied. Omitted leaves the preset unset.",
|
|
161
|
+
),
|
|
138
162
|
material: z.enum(["fr4", "fr1", "flex"]).default("fr4"),
|
|
139
163
|
layers: z
|
|
140
164
|
.union([
|
|
@@ -152,6 +176,25 @@ export const boardProps = subcircuitGroupProps
|
|
|
152
176
|
.describe(
|
|
153
177
|
"Whether the autorouter may generate blind and buried vias. Defaults to false, which restricts newly generated vias to the full board stack.",
|
|
154
178
|
),
|
|
179
|
+
defaultViaTenting: z
|
|
180
|
+
.union([
|
|
181
|
+
z.boolean(),
|
|
182
|
+
z.enum([
|
|
183
|
+
"both_sides",
|
|
184
|
+
"top_and_bottom_tented",
|
|
185
|
+
"top_tented",
|
|
186
|
+
"bottom_tented",
|
|
187
|
+
"exposed",
|
|
188
|
+
]),
|
|
189
|
+
])
|
|
190
|
+
.transform((value) => {
|
|
191
|
+
if (value === true || value === "both_sides") {
|
|
192
|
+
return "top_and_bottom_tented" as const
|
|
193
|
+
}
|
|
194
|
+
if (value === false) return "exposed" as const
|
|
195
|
+
return value
|
|
196
|
+
})
|
|
197
|
+
.optional(),
|
|
155
198
|
borderRadius: distance.optional(),
|
|
156
199
|
thickness: distance.optional(),
|
|
157
200
|
boardAnchorPosition: point.optional(),
|
package/lib/components/via.ts
CHANGED
|
@@ -12,6 +12,13 @@ export interface ViaProps extends CommonLayoutProps {
|
|
|
12
12
|
outerDiameter?: number | string
|
|
13
13
|
connectsTo?: string | string[]
|
|
14
14
|
netIsAssignable?: boolean
|
|
15
|
+
tented?:
|
|
16
|
+
| boolean
|
|
17
|
+
| "both_sides"
|
|
18
|
+
| "top_and_bottom_tented"
|
|
19
|
+
| "top_tented"
|
|
20
|
+
| "bottom_tented"
|
|
21
|
+
| "exposed"
|
|
15
22
|
}
|
|
16
23
|
|
|
17
24
|
export const viaProps = commonLayoutProps.extend({
|
|
@@ -23,6 +30,25 @@ export const viaProps = commonLayoutProps.extend({
|
|
|
23
30
|
layers: z.array(layer_ref).optional(),
|
|
24
31
|
connectsTo: z.string().or(z.array(z.string())).optional(),
|
|
25
32
|
netIsAssignable: z.boolean().optional(),
|
|
33
|
+
tented: z
|
|
34
|
+
.union([
|
|
35
|
+
z.boolean(),
|
|
36
|
+
z.enum([
|
|
37
|
+
"both_sides",
|
|
38
|
+
"top_and_bottom_tented",
|
|
39
|
+
"top_tented",
|
|
40
|
+
"bottom_tented",
|
|
41
|
+
"exposed",
|
|
42
|
+
]),
|
|
43
|
+
])
|
|
44
|
+
.transform((value) => {
|
|
45
|
+
if (value === true || value === "both_sides") {
|
|
46
|
+
return "top_and_bottom_tented" as const
|
|
47
|
+
}
|
|
48
|
+
if (value === false) return "exposed" as const
|
|
49
|
+
return value
|
|
50
|
+
})
|
|
51
|
+
.optional(),
|
|
26
52
|
})
|
|
27
53
|
export type InferredViaProps = z.input<typeof viaProps>
|
|
28
54
|
expectTypesMatch<ViaProps, InferredViaProps>(true)
|