@tscircuit/props 0.0.525 → 0.0.526
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 +1 -1
- package/dist/index.d.ts +801 -723
- package/dist/index.js +15 -9
- package/dist/index.js.map +1 -1
- package/lib/components/autoroutingphase.ts +8 -2
- package/lib/components/group.ts +29 -20
- package/package.json +1 -1
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
import { expectTypesMatch } from "lib/typecheck"
|
|
2
2
|
import { z } from "zod"
|
|
3
|
-
import {
|
|
3
|
+
import {
|
|
4
|
+
autorouterProp,
|
|
5
|
+
routingTolerances,
|
|
6
|
+
type AutorouterProp,
|
|
7
|
+
type RoutingTolerances,
|
|
8
|
+
} from "./group"
|
|
4
9
|
|
|
5
|
-
export interface AutoroutingPhaseProps {
|
|
10
|
+
export interface AutoroutingPhaseProps extends RoutingTolerances {
|
|
6
11
|
key?: any
|
|
7
12
|
autorouter?: AutorouterProp
|
|
8
13
|
phaseIndex?: number
|
|
@@ -21,6 +26,7 @@ export const autoroutingPhaseProps = z
|
|
|
21
26
|
key: z.any().optional(),
|
|
22
27
|
autorouter: autorouterProp.optional(),
|
|
23
28
|
phaseIndex: z.number().optional(),
|
|
29
|
+
...routingTolerances.shape,
|
|
24
30
|
region: z
|
|
25
31
|
.object({
|
|
26
32
|
shape: z.literal("rect").optional(),
|
package/lib/components/group.ts
CHANGED
|
@@ -310,6 +310,18 @@ export interface PcbRouteCache {
|
|
|
310
310
|
cacheKey: string
|
|
311
311
|
}
|
|
312
312
|
|
|
313
|
+
export interface RoutingTolerances {
|
|
314
|
+
minTraceWidth?: Distance
|
|
315
|
+
minViaHoleEdgeToViaHoleEdgeClearance?: Distance
|
|
316
|
+
minPlatedHoleDrillEdgeToDrillEdgeClearance?: Distance
|
|
317
|
+
minTraceToPadEdgeClearance?: Distance
|
|
318
|
+
minPadEdgeToPadEdgeClearance?: Distance
|
|
319
|
+
minBoardEdgeClearance?: Distance
|
|
320
|
+
minViaEdgeToPadEdgeClearance?: Distance
|
|
321
|
+
minViaHoleDiameter?: Distance
|
|
322
|
+
minViaPadDiameter?: Distance
|
|
323
|
+
}
|
|
324
|
+
|
|
313
325
|
export interface AutorouterConfig {
|
|
314
326
|
serverUrl?: string
|
|
315
327
|
inputFormat?: "simplified" | "circuit-json"
|
|
@@ -363,6 +375,18 @@ const pcbAnchorAlignmentAutocomplete = z.custom<
|
|
|
363
375
|
AutocompleteString<z.infer<typeof ninePointAnchor>>
|
|
364
376
|
>((value) => typeof value === "string")
|
|
365
377
|
|
|
378
|
+
export const routingTolerances = z.object({
|
|
379
|
+
minTraceWidth: length.optional(),
|
|
380
|
+
minViaHoleEdgeToViaHoleEdgeClearance: length.optional(),
|
|
381
|
+
minViaEdgeToPadEdgeClearance: length.optional(),
|
|
382
|
+
minPlatedHoleDrillEdgeToDrillEdgeClearance: length.optional(),
|
|
383
|
+
minTraceToPadEdgeClearance: length.optional(),
|
|
384
|
+
minPadEdgeToPadEdgeClearance: length.optional(),
|
|
385
|
+
minBoardEdgeClearance: length.optional(),
|
|
386
|
+
minViaHoleDiameter: length.optional(),
|
|
387
|
+
minViaPadDiameter: length.optional(),
|
|
388
|
+
})
|
|
389
|
+
|
|
366
390
|
export const autorouterConfig = z.object({
|
|
367
391
|
serverUrl: url.optional(),
|
|
368
392
|
inputFormat: z.enum(["simplified", "circuit-json"]).optional(),
|
|
@@ -427,22 +451,14 @@ export const autorouterProp: z.ZodType<AutorouterProp> = z.union([
|
|
|
427
451
|
|
|
428
452
|
export const autorouterEffortLevel = z.enum(["1x", "2x", "5x", "10x", "100x"])
|
|
429
453
|
|
|
430
|
-
export interface SubcircuitGroupProps
|
|
454
|
+
export interface SubcircuitGroupProps
|
|
455
|
+
extends BaseGroupProps,
|
|
456
|
+
RoutingTolerances {
|
|
431
457
|
manualEdits?: ManualEditsFileInput
|
|
432
458
|
routingDisabled?: boolean
|
|
433
459
|
bomDisabled?: boolean
|
|
434
460
|
defaultTraceWidth?: Distance
|
|
435
461
|
|
|
436
|
-
minTraceWidth?: Distance
|
|
437
|
-
minViaHoleEdgeToViaHoleEdgeClearance?: Distance
|
|
438
|
-
minPlatedHoleDrillEdgeToDrillEdgeClearance?: Distance
|
|
439
|
-
minTraceToPadEdgeClearance?: Distance
|
|
440
|
-
minPadEdgeToPadEdgeClearance?: Distance
|
|
441
|
-
minBoardEdgeClearance?: Distance
|
|
442
|
-
minViaEdgeToPadEdgeClearance?: Distance
|
|
443
|
-
minViaHoleDiameter?: Distance
|
|
444
|
-
minViaPadDiameter?: Distance
|
|
445
|
-
|
|
446
462
|
nominalTraceWidth?: Distance
|
|
447
463
|
pcbRouteCache?: PcbRouteCache
|
|
448
464
|
|
|
@@ -604,15 +620,7 @@ export const subcircuitGroupProps = baseGroupProps.extend({
|
|
|
604
620
|
routingDisabled: z.boolean().optional(),
|
|
605
621
|
bomDisabled: z.boolean().optional(),
|
|
606
622
|
defaultTraceWidth: length.optional(),
|
|
607
|
-
|
|
608
|
-
minViaHoleEdgeToViaHoleEdgeClearance: length.optional(),
|
|
609
|
-
minViaEdgeToPadEdgeClearance: length.optional(),
|
|
610
|
-
minPlatedHoleDrillEdgeToDrillEdgeClearance: length.optional(),
|
|
611
|
-
minTraceToPadEdgeClearance: length.optional(),
|
|
612
|
-
minPadEdgeToPadEdgeClearance: length.optional(),
|
|
613
|
-
minBoardEdgeClearance: length.optional(),
|
|
614
|
-
minViaHoleDiameter: length.optional(),
|
|
615
|
-
minViaPadDiameter: length.optional(),
|
|
623
|
+
...routingTolerances.shape,
|
|
616
624
|
nominalTraceWidth: length.optional(),
|
|
617
625
|
partsEngine: partsEngine.optional(),
|
|
618
626
|
_subcircuitCachingEnabled: z.boolean().optional(),
|
|
@@ -648,6 +656,7 @@ type InferredSubcircuitGroupPropsWithBool = z.input<
|
|
|
648
656
|
>
|
|
649
657
|
|
|
650
658
|
expectTypesMatch<AutorouterProp, z.input<typeof autorouterProp>>(true)
|
|
659
|
+
expectTypesMatch<RoutingTolerances, z.input<typeof routingTolerances>>(true)
|
|
651
660
|
|
|
652
661
|
expectTypesMatch<BaseGroupProps, InferredBaseGroupProps>(true)
|
|
653
662
|
expectTypesMatch<
|