@tscircuit/props 0.0.654 → 0.0.656

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.
@@ -92,6 +92,13 @@ export interface BoardProps
92
92
  * false, which restricts newly generated vias to the full board stack.
93
93
  */
94
94
  allowBlindAndBuriedVias?: boolean
95
+ defaultViaTenting?:
96
+ | boolean
97
+ | "both_sides"
98
+ | "top_and_bottom_tented"
99
+ | "top_tented"
100
+ | "bottom_tented"
101
+ | "exposed"
95
102
  borderRadius?: Distance
96
103
  thickness?: Distance
97
104
  boardAnchorPosition?: Point
@@ -169,6 +176,25 @@ export const boardProps = subcircuitGroupProps
169
176
  .describe(
170
177
  "Whether the autorouter may generate blind and buried vias. Defaults to false, which restricts newly generated vias to the full board stack.",
171
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(),
172
198
  borderRadius: distance.optional(),
173
199
  thickness: distance.optional(),
174
200
  boardAnchorPosition: point.optional(),
@@ -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)
@@ -1,4 +1,6 @@
1
1
  import { z } from "zod"
2
+ import type { AnyCircuitElement, PcbBoard } from "circuit-json"
3
+ import type { BoardProps } from "./components/board"
2
4
  import type { AutocompleteString } from "./common/autocomplete"
3
5
  import { type CadModelProp, cadModelProp } from "./common/cadModel"
4
6
  import { type PcbStyle, pcbStyle } from "./common/pcbStyle"
@@ -67,6 +69,9 @@ type EsModuleImportResult = {
67
69
  export interface PlatformConfig {
68
70
  partsEngine?: PartsEngine
69
71
 
72
+ /** Optional fabricator-specific DRC provider. No checks run when omitted. */
73
+ fabricatorEngine?: FabricatorEngine
74
+
70
75
  autorouter?: AutorouterProp
71
76
 
72
77
  autorouterMap?: Record<string, AutorouterDefinition>
@@ -246,8 +251,31 @@ const localCacheEngine = z.custom<LocalCacheEngine>(
246
251
  typeof value.setItem === "function",
247
252
  )
248
253
 
254
+ export interface FabricatorDrcCheckParams {
255
+ /** Board subtree in Circuit JSON world coordinates: +X right, +Y up, +Z above; positions and distances in mm. */
256
+ circuitJson: AnyCircuitElement[]
257
+ fabricatorPreset: NonNullable<BoardProps["fabricatorPreset"]>
258
+ pcbBoardId: PcbBoard["pcb_board_id"]
259
+ }
260
+
261
+ export interface FabricatorEngine {
262
+ /** Return diagnostic records for the selected preset without modifying the input. */
263
+ runDrcChecks: (
264
+ params: FabricatorDrcCheckParams,
265
+ ) => AnyCircuitElement[] | Promise<AnyCircuitElement[]>
266
+ }
267
+
268
+ export const fabricatorEngine = z.custom<FabricatorEngine>(
269
+ (value) =>
270
+ typeof value === "object" &&
271
+ value !== null &&
272
+ "runDrcChecks" in value &&
273
+ typeof value.runDrcChecks === "function",
274
+ )
275
+
249
276
  export const platformConfig = z.object({
250
277
  partsEngine: partsEngine.optional(),
278
+ fabricatorEngine: fabricatorEngine.optional(),
251
279
  autorouter: autorouterProp.optional(),
252
280
  autorouterMap: z.record(z.string(), autorouterDefinition).optional(),
253
281
  allowLegacyAutorouters: z.boolean().optional(),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tscircuit/props",
3
- "version": "0.0.654",
3
+ "version": "0.0.656",
4
4
  "description": "Props for tscircuit builtin component types",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",