@tscircuit/props 0.0.525 → 0.0.527
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 +807 -729
- package/dist/index.js +17 -9
- package/dist/index.js.map +1 -1
- package/lib/components/autoroutingphase.ts +8 -2
- package/lib/components/group.ts +33 -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"
|
|
@@ -332,6 +344,7 @@ export interface AutorouterConfig {
|
|
|
332
344
|
| "auto_cloud"
|
|
333
345
|
| "auto_jumper"
|
|
334
346
|
| "tscircuit_beta"
|
|
347
|
+
| "krt"
|
|
335
348
|
| "freerouting"
|
|
336
349
|
| "laser_prefab" // Prefabricated PCB with laser copper ablation
|
|
337
350
|
| /** @deprecated Use "auto_jumper" */ "auto-jumper"
|
|
@@ -348,6 +361,7 @@ export type AutorouterPreset =
|
|
|
348
361
|
| "auto_cloud"
|
|
349
362
|
| "auto_jumper"
|
|
350
363
|
| "tscircuit_beta"
|
|
364
|
+
| "krt"
|
|
351
365
|
| "freerouting"
|
|
352
366
|
| "laser_prefab"
|
|
353
367
|
| "auto-jumper"
|
|
@@ -363,6 +377,18 @@ const pcbAnchorAlignmentAutocomplete = z.custom<
|
|
|
363
377
|
AutocompleteString<z.infer<typeof ninePointAnchor>>
|
|
364
378
|
>((value) => typeof value === "string")
|
|
365
379
|
|
|
380
|
+
export const routingTolerances = z.object({
|
|
381
|
+
minTraceWidth: length.optional(),
|
|
382
|
+
minViaHoleEdgeToViaHoleEdgeClearance: length.optional(),
|
|
383
|
+
minViaEdgeToPadEdgeClearance: length.optional(),
|
|
384
|
+
minPlatedHoleDrillEdgeToDrillEdgeClearance: length.optional(),
|
|
385
|
+
minTraceToPadEdgeClearance: length.optional(),
|
|
386
|
+
minPadEdgeToPadEdgeClearance: length.optional(),
|
|
387
|
+
minBoardEdgeClearance: length.optional(),
|
|
388
|
+
minViaHoleDiameter: length.optional(),
|
|
389
|
+
minViaPadDiameter: length.optional(),
|
|
390
|
+
})
|
|
391
|
+
|
|
366
392
|
export const autorouterConfig = z.object({
|
|
367
393
|
serverUrl: url.optional(),
|
|
368
394
|
inputFormat: z.enum(["simplified", "circuit-json"]).optional(),
|
|
@@ -388,6 +414,7 @@ export const autorouterConfig = z.object({
|
|
|
388
414
|
"auto_cloud",
|
|
389
415
|
"auto_jumper",
|
|
390
416
|
"tscircuit_beta",
|
|
417
|
+
"krt",
|
|
391
418
|
"freerouting",
|
|
392
419
|
"laser_prefab",
|
|
393
420
|
"auto-jumper",
|
|
@@ -407,6 +434,7 @@ export const autorouterPreset = z.union([
|
|
|
407
434
|
z.literal("auto_cloud"),
|
|
408
435
|
z.literal("auto_jumper"),
|
|
409
436
|
z.literal("tscircuit_beta"),
|
|
437
|
+
z.literal("krt"),
|
|
410
438
|
z.literal("freerouting"),
|
|
411
439
|
z.literal("laser_prefab"), // Prefabricated PCB with laser copper ablation
|
|
412
440
|
z.literal("auto-jumper"),
|
|
@@ -427,22 +455,14 @@ export const autorouterProp: z.ZodType<AutorouterProp> = z.union([
|
|
|
427
455
|
|
|
428
456
|
export const autorouterEffortLevel = z.enum(["1x", "2x", "5x", "10x", "100x"])
|
|
429
457
|
|
|
430
|
-
export interface SubcircuitGroupProps
|
|
458
|
+
export interface SubcircuitGroupProps
|
|
459
|
+
extends BaseGroupProps,
|
|
460
|
+
RoutingTolerances {
|
|
431
461
|
manualEdits?: ManualEditsFileInput
|
|
432
462
|
routingDisabled?: boolean
|
|
433
463
|
bomDisabled?: boolean
|
|
434
464
|
defaultTraceWidth?: Distance
|
|
435
465
|
|
|
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
466
|
nominalTraceWidth?: Distance
|
|
447
467
|
pcbRouteCache?: PcbRouteCache
|
|
448
468
|
|
|
@@ -604,15 +624,7 @@ export const subcircuitGroupProps = baseGroupProps.extend({
|
|
|
604
624
|
routingDisabled: z.boolean().optional(),
|
|
605
625
|
bomDisabled: z.boolean().optional(),
|
|
606
626
|
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(),
|
|
627
|
+
...routingTolerances.shape,
|
|
616
628
|
nominalTraceWidth: length.optional(),
|
|
617
629
|
partsEngine: partsEngine.optional(),
|
|
618
630
|
_subcircuitCachingEnabled: z.boolean().optional(),
|
|
@@ -648,6 +660,7 @@ type InferredSubcircuitGroupPropsWithBool = z.input<
|
|
|
648
660
|
>
|
|
649
661
|
|
|
650
662
|
expectTypesMatch<AutorouterProp, z.input<typeof autorouterProp>>(true)
|
|
663
|
+
expectTypesMatch<RoutingTolerances, z.input<typeof routingTolerances>>(true)
|
|
651
664
|
|
|
652
665
|
expectTypesMatch<BaseGroupProps, InferredBaseGroupProps>(true)
|
|
653
666
|
expectTypesMatch<
|