@tscircuit/props 0.0.214 → 0.0.216
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 +640 -1
- package/dist/index.js +266 -257
- package/dist/index.js.map +1 -1
- package/lib/components/pin-header.ts +11 -0
- package/lib/components/solderjumper.ts +17 -0
- package/lib/index.ts +1 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -459,59 +459,66 @@ var jumperProps = commonComponentProps.extend({
|
|
|
459
459
|
});
|
|
460
460
|
expectTypesMatch(true);
|
|
461
461
|
|
|
462
|
+
// lib/components/solderjumper.ts
|
|
463
|
+
import { z as z26 } from "zod";
|
|
464
|
+
var solderjumperProps = jumperProps.extend({
|
|
465
|
+
bridgedPins: z26.array(z26.array(z26.string())).optional()
|
|
466
|
+
});
|
|
467
|
+
expectTypesMatch(true);
|
|
468
|
+
|
|
462
469
|
// lib/components/connector.ts
|
|
463
470
|
import { distance as distance9 } from "circuit-json";
|
|
464
|
-
import { z as
|
|
471
|
+
import { z as z27 } from "zod";
|
|
465
472
|
var connectorProps = commonComponentProps.extend({
|
|
466
|
-
manufacturerPartNumber:
|
|
467
|
-
pinLabels:
|
|
473
|
+
manufacturerPartNumber: z27.string().optional(),
|
|
474
|
+
pinLabels: z27.record(z27.number().or(z27.string()), z27.string().or(z27.array(z27.string()))).optional(),
|
|
468
475
|
schPinStyle: schematicPinStyle.optional(),
|
|
469
476
|
schPinSpacing: distance9.optional(),
|
|
470
477
|
schWidth: distance9.optional(),
|
|
471
478
|
schHeight: distance9.optional(),
|
|
472
|
-
schDirection:
|
|
479
|
+
schDirection: z27.enum(["left", "right"]).optional(),
|
|
473
480
|
schPortArrangement: schematicPortArrangement.optional(),
|
|
474
|
-
internallyConnectedPins:
|
|
475
|
-
standard:
|
|
481
|
+
internallyConnectedPins: z27.array(z27.array(z27.string())).optional(),
|
|
482
|
+
standard: z27.enum(["usb_c", "m2"]).optional()
|
|
476
483
|
});
|
|
477
484
|
expectTypesMatch(true);
|
|
478
485
|
|
|
479
486
|
// lib/components/fuse.ts
|
|
480
|
-
import { z as
|
|
487
|
+
import { z as z28 } from "zod";
|
|
481
488
|
var fusePinLabels = ["pin1", "pin2"];
|
|
482
489
|
var fuseProps = commonComponentProps.extend({
|
|
483
|
-
currentRating:
|
|
484
|
-
voltageRating:
|
|
485
|
-
schShowRatings:
|
|
486
|
-
connections:
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
490
|
+
currentRating: z28.union([z28.number(), z28.string()]),
|
|
491
|
+
voltageRating: z28.union([z28.number(), z28.string()]).optional(),
|
|
492
|
+
schShowRatings: z28.boolean().optional(),
|
|
493
|
+
connections: z28.record(
|
|
494
|
+
z28.string(),
|
|
495
|
+
z28.union([
|
|
496
|
+
z28.string(),
|
|
497
|
+
z28.array(z28.string()).readonly(),
|
|
498
|
+
z28.array(z28.string())
|
|
492
499
|
])
|
|
493
500
|
).optional()
|
|
494
501
|
});
|
|
495
502
|
|
|
496
503
|
// lib/components/platedhole.ts
|
|
497
504
|
import { distance as distance10 } from "circuit-json";
|
|
498
|
-
import { z as
|
|
499
|
-
var distanceHiddenUndefined =
|
|
505
|
+
import { z as z29 } from "zod";
|
|
506
|
+
var distanceHiddenUndefined = z29.custom().transform((a) => {
|
|
500
507
|
if (a === void 0)
|
|
501
508
|
return void 0;
|
|
502
509
|
return distance10.parse(a);
|
|
503
510
|
});
|
|
504
|
-
var platedHoleProps =
|
|
511
|
+
var platedHoleProps = z29.union([
|
|
505
512
|
pcbLayoutProps.omit({ pcbRotation: true, layer: true }).extend({
|
|
506
|
-
name:
|
|
507
|
-
shape:
|
|
513
|
+
name: z29.string().optional(),
|
|
514
|
+
shape: z29.literal("circle"),
|
|
508
515
|
holeDiameter: distance10,
|
|
509
516
|
outerDiameter: distance10,
|
|
510
517
|
portHints: portHints.optional()
|
|
511
518
|
}),
|
|
512
519
|
pcbLayoutProps.omit({ pcbRotation: true, layer: true }).extend({
|
|
513
|
-
name:
|
|
514
|
-
shape:
|
|
520
|
+
name: z29.string().optional(),
|
|
521
|
+
shape: z29.literal("oval"),
|
|
515
522
|
outerWidth: distance10,
|
|
516
523
|
outerHeight: distance10,
|
|
517
524
|
holeWidth: distanceHiddenUndefined,
|
|
@@ -521,8 +528,8 @@ var platedHoleProps = z28.union([
|
|
|
521
528
|
portHints: portHints.optional()
|
|
522
529
|
}),
|
|
523
530
|
pcbLayoutProps.omit({ pcbRotation: true, layer: true }).extend({
|
|
524
|
-
name:
|
|
525
|
-
shape:
|
|
531
|
+
name: z29.string().optional(),
|
|
532
|
+
shape: z29.literal("pill"),
|
|
526
533
|
outerWidth: distance10,
|
|
527
534
|
outerHeight: distance10,
|
|
528
535
|
holeWidth: distanceHiddenUndefined,
|
|
@@ -532,13 +539,13 @@ var platedHoleProps = z28.union([
|
|
|
532
539
|
portHints: portHints.optional()
|
|
533
540
|
}),
|
|
534
541
|
pcbLayoutProps.omit({ pcbRotation: true, layer: true }).extend({
|
|
535
|
-
name:
|
|
542
|
+
name: z29.string().optional(),
|
|
536
543
|
holeDiameter: distance10,
|
|
537
544
|
rectPadWidth: distance10,
|
|
538
545
|
rectPadHeight: distance10,
|
|
539
|
-
holeShape:
|
|
540
|
-
padShape:
|
|
541
|
-
shape:
|
|
546
|
+
holeShape: z29.literal("circle").optional(),
|
|
547
|
+
padShape: z29.literal("rect").optional(),
|
|
548
|
+
shape: z29.literal("circular_hole_with_rect_pad").optional(),
|
|
542
549
|
portHints: portHints.optional()
|
|
543
550
|
}).refine(
|
|
544
551
|
(prop) => {
|
|
@@ -549,10 +556,10 @@ var platedHoleProps = z28.union([
|
|
|
549
556
|
}
|
|
550
557
|
),
|
|
551
558
|
pcbLayoutProps.omit({ pcbRotation: true, layer: true }).extend({
|
|
552
|
-
name:
|
|
553
|
-
shape:
|
|
554
|
-
holeShape:
|
|
555
|
-
padShape:
|
|
559
|
+
name: z29.string().optional(),
|
|
560
|
+
shape: z29.literal("pill_hole_with_rect_pad"),
|
|
561
|
+
holeShape: z29.literal("pill"),
|
|
562
|
+
padShape: z29.literal("rect"),
|
|
556
563
|
holeWidth: distance10,
|
|
557
564
|
holeHeight: distance10,
|
|
558
565
|
rectPadWidth: distance10,
|
|
@@ -574,21 +581,21 @@ expectTypesMatch(true);
|
|
|
574
581
|
import { resistance } from "circuit-json";
|
|
575
582
|
|
|
576
583
|
// lib/common/connectionsProp.ts
|
|
577
|
-
import { z as
|
|
578
|
-
var connectionTarget2 =
|
|
584
|
+
import { z as z30 } from "zod";
|
|
585
|
+
var connectionTarget2 = z30.string().or(z30.array(z30.string()).readonly()).or(z30.array(z30.string()));
|
|
579
586
|
var createConnectionsProp = (labels) => {
|
|
580
|
-
return
|
|
587
|
+
return z30.record(z30.enum(labels), connectionTarget2);
|
|
581
588
|
};
|
|
582
589
|
|
|
583
590
|
// lib/components/resistor.ts
|
|
584
|
-
import { z as
|
|
591
|
+
import { z as z31 } from "zod";
|
|
585
592
|
var resistorPinLabels = ["pin1", "pin2", "pos", "neg"];
|
|
586
593
|
var resistorProps = commonComponentProps.extend({
|
|
587
594
|
resistance,
|
|
588
|
-
pullupFor:
|
|
589
|
-
pullupTo:
|
|
590
|
-
pulldownFor:
|
|
591
|
-
pulldownTo:
|
|
595
|
+
pullupFor: z31.string().optional(),
|
|
596
|
+
pullupTo: z31.string().optional(),
|
|
597
|
+
pulldownFor: z31.string().optional(),
|
|
598
|
+
pulldownTo: z31.string().optional(),
|
|
592
599
|
connections: createConnectionsProp(resistorPinLabels).optional()
|
|
593
600
|
});
|
|
594
601
|
var resistorPins = lrPins;
|
|
@@ -596,54 +603,54 @@ expectTypesMatch(true);
|
|
|
596
603
|
|
|
597
604
|
// lib/components/potentiometer.ts
|
|
598
605
|
import { resistance as resistance2 } from "circuit-json";
|
|
599
|
-
import { z as
|
|
606
|
+
import { z as z32 } from "zod";
|
|
600
607
|
var potentiometerProps = commonComponentProps.extend({
|
|
601
608
|
maxResistance: resistance2,
|
|
602
|
-
pinVariant:
|
|
609
|
+
pinVariant: z32.enum(["two_pin", "three_pin"]).optional()
|
|
603
610
|
});
|
|
604
611
|
expectTypesMatch(true);
|
|
605
612
|
|
|
606
613
|
// lib/components/crystal.ts
|
|
607
614
|
import { frequency, capacitance } from "circuit-json";
|
|
608
|
-
import { z as
|
|
615
|
+
import { z as z33 } from "zod";
|
|
609
616
|
var crystalProps = commonComponentProps.extend({
|
|
610
617
|
frequency,
|
|
611
618
|
loadCapacitance: capacitance,
|
|
612
|
-
pinVariant:
|
|
619
|
+
pinVariant: z33.enum(["two_pin", "four_pin"]).optional()
|
|
613
620
|
});
|
|
614
621
|
var crystalPins = lrPins;
|
|
615
622
|
expectTypesMatch(true);
|
|
616
623
|
|
|
617
624
|
// lib/components/resonator.ts
|
|
618
625
|
import { frequency as frequency2, capacitance as capacitance2 } from "circuit-json";
|
|
619
|
-
import { z as
|
|
626
|
+
import { z as z34 } from "zod";
|
|
620
627
|
var resonatorProps = commonComponentProps.extend({
|
|
621
628
|
frequency: frequency2,
|
|
622
629
|
loadCapacitance: capacitance2,
|
|
623
|
-
pinVariant:
|
|
630
|
+
pinVariant: z34.enum(["no_ground", "ground_pin", "two_ground_pins"]).optional()
|
|
624
631
|
});
|
|
625
632
|
expectTypesMatch(true);
|
|
626
633
|
|
|
627
634
|
// lib/components/stampboard.ts
|
|
628
635
|
import { distance as distance11 } from "circuit-json";
|
|
629
|
-
import { z as
|
|
636
|
+
import { z as z35 } from "zod";
|
|
630
637
|
var stampboardProps = boardProps.extend({
|
|
631
|
-
leftPinCount:
|
|
632
|
-
rightPinCount:
|
|
633
|
-
topPinCount:
|
|
634
|
-
bottomPinCount:
|
|
635
|
-
leftPins:
|
|
636
|
-
rightPins:
|
|
637
|
-
topPins:
|
|
638
|
-
bottomPins:
|
|
638
|
+
leftPinCount: z35.number().optional(),
|
|
639
|
+
rightPinCount: z35.number().optional(),
|
|
640
|
+
topPinCount: z35.number().optional(),
|
|
641
|
+
bottomPinCount: z35.number().optional(),
|
|
642
|
+
leftPins: z35.array(z35.string()).optional(),
|
|
643
|
+
rightPins: z35.array(z35.string()).optional(),
|
|
644
|
+
topPins: z35.array(z35.string()).optional(),
|
|
645
|
+
bottomPins: z35.array(z35.string()).optional(),
|
|
639
646
|
pinPitch: distance11.optional(),
|
|
640
|
-
innerHoles:
|
|
647
|
+
innerHoles: z35.boolean().optional()
|
|
641
648
|
});
|
|
642
649
|
expectTypesMatch(true);
|
|
643
650
|
|
|
644
651
|
// lib/components/capacitor.ts
|
|
645
652
|
import { capacitance as capacitance3, voltage } from "circuit-json";
|
|
646
|
-
import { z as
|
|
653
|
+
import { z as z36 } from "zod";
|
|
647
654
|
var capacitorPinLabels = [
|
|
648
655
|
"pin1",
|
|
649
656
|
"pin2",
|
|
@@ -655,31 +662,31 @@ var capacitorPinLabels = [
|
|
|
655
662
|
var capacitorProps = commonComponentProps.extend({
|
|
656
663
|
capacitance: capacitance3,
|
|
657
664
|
maxVoltageRating: voltage.optional(),
|
|
658
|
-
schShowRatings:
|
|
659
|
-
polarized:
|
|
660
|
-
decouplingFor:
|
|
661
|
-
decouplingTo:
|
|
662
|
-
bypassFor:
|
|
663
|
-
bypassTo:
|
|
664
|
-
maxDecouplingTraceLength:
|
|
665
|
+
schShowRatings: z36.boolean().optional().default(false),
|
|
666
|
+
polarized: z36.boolean().optional().default(false),
|
|
667
|
+
decouplingFor: z36.string().optional(),
|
|
668
|
+
decouplingTo: z36.string().optional(),
|
|
669
|
+
bypassFor: z36.string().optional(),
|
|
670
|
+
bypassTo: z36.string().optional(),
|
|
671
|
+
maxDecouplingTraceLength: z36.number().optional(),
|
|
665
672
|
connections: createConnectionsProp(capacitorPinLabels).optional()
|
|
666
673
|
});
|
|
667
674
|
var capacitorPins = lrPolarPins;
|
|
668
675
|
expectTypesMatch(true);
|
|
669
676
|
|
|
670
677
|
// lib/components/net.ts
|
|
671
|
-
import { z as
|
|
672
|
-
var netProps =
|
|
673
|
-
name:
|
|
678
|
+
import { z as z37 } from "zod";
|
|
679
|
+
var netProps = z37.object({
|
|
680
|
+
name: z37.string()
|
|
674
681
|
});
|
|
675
682
|
expectTypesMatch(true);
|
|
676
683
|
|
|
677
684
|
// lib/components/constrainedlayout.ts
|
|
678
|
-
import { z as
|
|
679
|
-
var constrainedLayoutProps =
|
|
680
|
-
name:
|
|
681
|
-
pcbOnly:
|
|
682
|
-
schOnly:
|
|
685
|
+
import { z as z38 } from "zod";
|
|
686
|
+
var constrainedLayoutProps = z38.object({
|
|
687
|
+
name: z38.string().optional(),
|
|
688
|
+
pcbOnly: z38.boolean().optional(),
|
|
689
|
+
schOnly: z38.boolean().optional()
|
|
683
690
|
});
|
|
684
691
|
expectTypesMatch(true);
|
|
685
692
|
|
|
@@ -688,46 +695,46 @@ import "zod";
|
|
|
688
695
|
import { distance as distance12, length as length2 } from "circuit-json";
|
|
689
696
|
|
|
690
697
|
// lib/components/constraint.ts
|
|
691
|
-
import { z as
|
|
692
|
-
var pcbXDistConstraintProps =
|
|
693
|
-
pcb:
|
|
698
|
+
import { z as z40 } from "zod";
|
|
699
|
+
var pcbXDistConstraintProps = z40.object({
|
|
700
|
+
pcb: z40.literal(true).optional(),
|
|
694
701
|
xDist: distance12,
|
|
695
|
-
left:
|
|
696
|
-
right:
|
|
697
|
-
edgeToEdge:
|
|
698
|
-
centerToCenter:
|
|
702
|
+
left: z40.string(),
|
|
703
|
+
right: z40.string(),
|
|
704
|
+
edgeToEdge: z40.literal(true).optional(),
|
|
705
|
+
centerToCenter: z40.literal(true).optional()
|
|
699
706
|
});
|
|
700
707
|
expectTypesMatch(
|
|
701
708
|
true
|
|
702
709
|
);
|
|
703
|
-
var pcbYDistConstraintProps =
|
|
704
|
-
pcb:
|
|
710
|
+
var pcbYDistConstraintProps = z40.object({
|
|
711
|
+
pcb: z40.literal(true).optional(),
|
|
705
712
|
yDist: distance12,
|
|
706
|
-
top:
|
|
707
|
-
bottom:
|
|
708
|
-
edgeToEdge:
|
|
709
|
-
centerToCenter:
|
|
713
|
+
top: z40.string(),
|
|
714
|
+
bottom: z40.string(),
|
|
715
|
+
edgeToEdge: z40.literal(true).optional(),
|
|
716
|
+
centerToCenter: z40.literal(true).optional()
|
|
710
717
|
});
|
|
711
718
|
expectTypesMatch(
|
|
712
719
|
true
|
|
713
720
|
);
|
|
714
|
-
var pcbSameYConstraintProps =
|
|
715
|
-
pcb:
|
|
716
|
-
sameY:
|
|
717
|
-
for:
|
|
721
|
+
var pcbSameYConstraintProps = z40.object({
|
|
722
|
+
pcb: z40.literal(true).optional(),
|
|
723
|
+
sameY: z40.literal(true).optional(),
|
|
724
|
+
for: z40.array(z40.string())
|
|
718
725
|
});
|
|
719
726
|
expectTypesMatch(
|
|
720
727
|
true
|
|
721
728
|
);
|
|
722
|
-
var pcbSameXConstraintProps =
|
|
723
|
-
pcb:
|
|
724
|
-
sameX:
|
|
725
|
-
for:
|
|
729
|
+
var pcbSameXConstraintProps = z40.object({
|
|
730
|
+
pcb: z40.literal(true).optional(),
|
|
731
|
+
sameX: z40.literal(true).optional(),
|
|
732
|
+
for: z40.array(z40.string())
|
|
726
733
|
});
|
|
727
734
|
expectTypesMatch(
|
|
728
735
|
true
|
|
729
736
|
);
|
|
730
|
-
var constraintProps =
|
|
737
|
+
var constraintProps = z40.union([
|
|
731
738
|
pcbXDistConstraintProps,
|
|
732
739
|
pcbYDistConstraintProps,
|
|
733
740
|
pcbSameYConstraintProps,
|
|
@@ -736,13 +743,13 @@ var constraintProps = z39.union([
|
|
|
736
743
|
expectTypesMatch(true);
|
|
737
744
|
|
|
738
745
|
// lib/components/cutout.ts
|
|
739
|
-
import { z as
|
|
746
|
+
import { z as z41 } from "zod";
|
|
740
747
|
var rectCutoutProps = pcbLayoutProps.omit({
|
|
741
748
|
layer: true,
|
|
742
749
|
pcbRotation: true
|
|
743
750
|
}).extend({
|
|
744
|
-
name:
|
|
745
|
-
shape:
|
|
751
|
+
name: z41.string().optional(),
|
|
752
|
+
shape: z41.literal("rect"),
|
|
746
753
|
width: distance12,
|
|
747
754
|
height: distance12
|
|
748
755
|
});
|
|
@@ -751,8 +758,8 @@ var circleCutoutProps = pcbLayoutProps.omit({
|
|
|
751
758
|
layer: true,
|
|
752
759
|
pcbRotation: true
|
|
753
760
|
}).extend({
|
|
754
|
-
name:
|
|
755
|
-
shape:
|
|
761
|
+
name: z41.string().optional(),
|
|
762
|
+
shape: z41.literal("circle"),
|
|
756
763
|
radius: distance12
|
|
757
764
|
});
|
|
758
765
|
expectTypesMatch(true);
|
|
@@ -760,42 +767,42 @@ var polygonCutoutProps = pcbLayoutProps.omit({
|
|
|
760
767
|
layer: true,
|
|
761
768
|
pcbRotation: true
|
|
762
769
|
}).extend({
|
|
763
|
-
name:
|
|
764
|
-
shape:
|
|
765
|
-
points:
|
|
770
|
+
name: z41.string().optional(),
|
|
771
|
+
shape: z41.literal("polygon"),
|
|
772
|
+
points: z41.array(point)
|
|
766
773
|
});
|
|
767
774
|
expectTypesMatch(true);
|
|
768
|
-
var cutoutProps =
|
|
775
|
+
var cutoutProps = z41.discriminatedUnion("shape", [
|
|
769
776
|
rectCutoutProps,
|
|
770
777
|
circleCutoutProps,
|
|
771
778
|
polygonCutoutProps
|
|
772
779
|
]);
|
|
773
780
|
|
|
774
781
|
// lib/components/smtpad.ts
|
|
775
|
-
import { z as
|
|
782
|
+
import { z as z42 } from "zod";
|
|
776
783
|
var rectSmtPadProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
777
|
-
shape:
|
|
784
|
+
shape: z42.literal("rect"),
|
|
778
785
|
width: distance12,
|
|
779
786
|
height: distance12,
|
|
780
787
|
portHints: portHints.optional()
|
|
781
788
|
});
|
|
782
789
|
expectTypesMatch(true);
|
|
783
790
|
var rotatedRectSmtPadProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
784
|
-
shape:
|
|
791
|
+
shape: z42.literal("rotated_rect"),
|
|
785
792
|
width: distance12,
|
|
786
793
|
height: distance12,
|
|
787
|
-
ccwRotation:
|
|
794
|
+
ccwRotation: z42.number(),
|
|
788
795
|
portHints: portHints.optional()
|
|
789
796
|
});
|
|
790
797
|
expectTypesMatch(true);
|
|
791
798
|
var circleSmtPadProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
792
|
-
shape:
|
|
799
|
+
shape: z42.literal("circle"),
|
|
793
800
|
radius: distance12,
|
|
794
801
|
portHints: portHints.optional()
|
|
795
802
|
});
|
|
796
803
|
expectTypesMatch(true);
|
|
797
804
|
var pillSmtPadProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
798
|
-
shape:
|
|
805
|
+
shape: z42.literal("pill"),
|
|
799
806
|
width: distance12,
|
|
800
807
|
height: distance12,
|
|
801
808
|
radius: distance12,
|
|
@@ -803,12 +810,12 @@ var pillSmtPadProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
|
803
810
|
});
|
|
804
811
|
expectTypesMatch(true);
|
|
805
812
|
var polygonSmtPadProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
806
|
-
shape:
|
|
807
|
-
points:
|
|
813
|
+
shape: z42.literal("polygon"),
|
|
814
|
+
points: z42.array(point),
|
|
808
815
|
portHints: portHints.optional()
|
|
809
816
|
});
|
|
810
817
|
expectTypesMatch(true);
|
|
811
|
-
var smtPadProps =
|
|
818
|
+
var smtPadProps = z42.union([
|
|
812
819
|
circleSmtPadProps,
|
|
813
820
|
rectSmtPadProps,
|
|
814
821
|
rotatedRectSmtPadProps,
|
|
@@ -818,28 +825,28 @@ var smtPadProps = z41.union([
|
|
|
818
825
|
expectTypesMatch(true);
|
|
819
826
|
|
|
820
827
|
// lib/components/solderpaste.ts
|
|
821
|
-
import { z as
|
|
828
|
+
import { z as z43 } from "zod";
|
|
822
829
|
var rectSolderPasteProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
823
|
-
shape:
|
|
830
|
+
shape: z43.literal("rect"),
|
|
824
831
|
width: distance12,
|
|
825
832
|
height: distance12
|
|
826
833
|
});
|
|
827
834
|
expectTypesMatch(true);
|
|
828
835
|
var circleSolderPasteProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
829
|
-
shape:
|
|
836
|
+
shape: z43.literal("circle"),
|
|
830
837
|
radius: distance12
|
|
831
838
|
});
|
|
832
839
|
expectTypesMatch(true);
|
|
833
|
-
var solderPasteProps =
|
|
840
|
+
var solderPasteProps = z43.union([
|
|
834
841
|
circleSolderPasteProps,
|
|
835
842
|
rectSolderPasteProps
|
|
836
843
|
]);
|
|
837
844
|
expectTypesMatch(true);
|
|
838
845
|
|
|
839
846
|
// lib/components/hole.ts
|
|
840
|
-
import { z as
|
|
847
|
+
import { z as z44 } from "zod";
|
|
841
848
|
var holeProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
842
|
-
name:
|
|
849
|
+
name: z44.string().optional(),
|
|
843
850
|
diameter: distance12.optional(),
|
|
844
851
|
radius: distance12.optional()
|
|
845
852
|
}).transform((d) => ({
|
|
@@ -851,24 +858,24 @@ expectTypesMatch(true);
|
|
|
851
858
|
|
|
852
859
|
// lib/components/trace.ts
|
|
853
860
|
import { distance as distance13, route_hint_point as route_hint_point2 } from "circuit-json";
|
|
854
|
-
import { z as
|
|
855
|
-
var portRef =
|
|
856
|
-
|
|
857
|
-
|
|
861
|
+
import { z as z45 } from "zod";
|
|
862
|
+
var portRef = z45.union([
|
|
863
|
+
z45.string(),
|
|
864
|
+
z45.custom(
|
|
858
865
|
(v) => Boolean(v.getPortSelector)
|
|
859
866
|
)
|
|
860
867
|
]);
|
|
861
|
-
var baseTraceProps =
|
|
862
|
-
key:
|
|
868
|
+
var baseTraceProps = z45.object({
|
|
869
|
+
key: z45.string().optional(),
|
|
863
870
|
thickness: distance13.optional(),
|
|
864
|
-
schematicRouteHints:
|
|
865
|
-
pcbRouteHints:
|
|
866
|
-
schDisplayLabel:
|
|
871
|
+
schematicRouteHints: z45.array(point).optional(),
|
|
872
|
+
pcbRouteHints: z45.array(route_hint_point2).optional(),
|
|
873
|
+
schDisplayLabel: z45.string().optional(),
|
|
867
874
|
maxLength: distance13.optional()
|
|
868
875
|
});
|
|
869
|
-
var traceProps =
|
|
876
|
+
var traceProps = z45.union([
|
|
870
877
|
baseTraceProps.extend({
|
|
871
|
-
path:
|
|
878
|
+
path: z45.array(portRef)
|
|
872
879
|
}),
|
|
873
880
|
baseTraceProps.extend({
|
|
874
881
|
from: portRef,
|
|
@@ -878,15 +885,15 @@ var traceProps = z44.union([
|
|
|
878
885
|
|
|
879
886
|
// lib/components/footprint.ts
|
|
880
887
|
import { layer_ref as layer_ref4 } from "circuit-json";
|
|
881
|
-
import { z as
|
|
882
|
-
var footprintProps =
|
|
888
|
+
import { z as z46 } from "zod";
|
|
889
|
+
var footprintProps = z46.object({
|
|
883
890
|
originalLayer: layer_ref4.default("top").optional()
|
|
884
891
|
});
|
|
885
892
|
expectTypesMatch(true);
|
|
886
893
|
|
|
887
894
|
// lib/components/battery.ts
|
|
888
|
-
import { z as
|
|
889
|
-
var capacity =
|
|
895
|
+
import { z as z47 } from "zod";
|
|
896
|
+
var capacity = z47.number().or(z47.string().endsWith("mAh")).transform((v) => {
|
|
890
897
|
if (typeof v === "string") {
|
|
891
898
|
const valString = v.replace("mAh", "");
|
|
892
899
|
const num = Number.parseFloat(valString);
|
|
@@ -905,31 +912,32 @@ expectTypesMatch(true);
|
|
|
905
912
|
|
|
906
913
|
// lib/components/pin-header.ts
|
|
907
914
|
import { distance as distance14 } from "circuit-json";
|
|
908
|
-
import { z as
|
|
915
|
+
import { z as z48 } from "zod";
|
|
909
916
|
var pinHeaderProps = commonComponentProps.extend({
|
|
910
|
-
pinCount:
|
|
917
|
+
pinCount: z48.number(),
|
|
911
918
|
pitch: distance14.optional(),
|
|
912
|
-
schFacingDirection:
|
|
913
|
-
gender:
|
|
914
|
-
showSilkscreenPinLabels:
|
|
915
|
-
doubleRow:
|
|
919
|
+
schFacingDirection: z48.enum(["up", "down", "left", "right"]).optional(),
|
|
920
|
+
gender: z48.enum(["male", "female"]).optional().default("male"),
|
|
921
|
+
showSilkscreenPinLabels: z48.boolean().optional(),
|
|
922
|
+
doubleRow: z48.boolean().optional(),
|
|
916
923
|
holeDiameter: distance14.optional(),
|
|
917
924
|
platedDiameter: distance14.optional(),
|
|
918
|
-
pinLabels:
|
|
919
|
-
|
|
925
|
+
pinLabels: z48.array(z48.string()).optional(),
|
|
926
|
+
connections: z48.custom().pipe(z48.record(z48.string(), connectionTarget2)).optional(),
|
|
927
|
+
facingDirection: z48.enum(["left", "right"]).optional(),
|
|
920
928
|
schPinArrangement: schematicPinArrangement.optional()
|
|
921
929
|
});
|
|
922
930
|
expectTypesMatch(true);
|
|
923
931
|
|
|
924
932
|
// lib/components/netalias.ts
|
|
925
|
-
import { z as
|
|
933
|
+
import { z as z49 } from "zod";
|
|
926
934
|
import { rotation as rotation2 } from "circuit-json";
|
|
927
|
-
var netAliasProps =
|
|
928
|
-
net:
|
|
935
|
+
var netAliasProps = z49.object({
|
|
936
|
+
net: z49.string().optional(),
|
|
929
937
|
schX: distance12.optional(),
|
|
930
938
|
schY: distance12.optional(),
|
|
931
939
|
schRotation: rotation2.optional(),
|
|
932
|
-
anchorSide:
|
|
940
|
+
anchorSide: z49.enum(["left", "up", "right", "down"]).optional()
|
|
933
941
|
});
|
|
934
942
|
expectTypesMatch(true);
|
|
935
943
|
|
|
@@ -943,9 +951,9 @@ var subcircuitProps = subcircuitGroupProps;
|
|
|
943
951
|
expectTypesMatch(true);
|
|
944
952
|
|
|
945
953
|
// lib/components/transistor.ts
|
|
946
|
-
import { z as
|
|
954
|
+
import { z as z51 } from "zod";
|
|
947
955
|
var transistorProps = commonComponentProps.extend({
|
|
948
|
-
type:
|
|
956
|
+
type: z51.enum(["npn", "pnp", "bjt", "jfet", "mosfet"])
|
|
949
957
|
});
|
|
950
958
|
var transistorPins = [
|
|
951
959
|
"pin1",
|
|
@@ -958,10 +966,10 @@ var transistorPins = [
|
|
|
958
966
|
expectTypesMatch(true);
|
|
959
967
|
|
|
960
968
|
// lib/components/mosfet.ts
|
|
961
|
-
import { z as
|
|
969
|
+
import { z as z52 } from "zod";
|
|
962
970
|
var mosfetProps = commonComponentProps.extend({
|
|
963
|
-
channelType:
|
|
964
|
-
mosfetMode:
|
|
971
|
+
channelType: z52.enum(["n", "p"]),
|
|
972
|
+
mosfetMode: z52.enum(["enhancement", "depletion"])
|
|
965
973
|
});
|
|
966
974
|
var mosfetPins = [
|
|
967
975
|
"pin1",
|
|
@@ -981,8 +989,8 @@ var inductorProps = commonComponentProps.extend({
|
|
|
981
989
|
var inductorPins = lrPins;
|
|
982
990
|
|
|
983
991
|
// lib/components/diode.ts
|
|
984
|
-
import { z as
|
|
985
|
-
var diodeConnectionKeys =
|
|
992
|
+
import { z as z53 } from "zod";
|
|
993
|
+
var diodeConnectionKeys = z53.enum([
|
|
986
994
|
"anode",
|
|
987
995
|
"cathode",
|
|
988
996
|
"pin1",
|
|
@@ -990,17 +998,17 @@ var diodeConnectionKeys = z52.enum([
|
|
|
990
998
|
"pos",
|
|
991
999
|
"neg"
|
|
992
1000
|
]);
|
|
993
|
-
var connectionTarget3 =
|
|
994
|
-
var connectionsProp2 =
|
|
995
|
-
var diodeVariant =
|
|
1001
|
+
var connectionTarget3 = z53.string().or(z53.array(z53.string()).readonly()).or(z53.array(z53.string()));
|
|
1002
|
+
var connectionsProp2 = z53.record(diodeConnectionKeys, connectionTarget3);
|
|
1003
|
+
var diodeVariant = z53.enum(["standard", "schottky", "zener", "photo", "tvs"]);
|
|
996
1004
|
var diodeProps = commonComponentProps.extend({
|
|
997
1005
|
connections: connectionsProp2.optional(),
|
|
998
1006
|
variant: diodeVariant.optional().default("standard"),
|
|
999
|
-
standard:
|
|
1000
|
-
schottky:
|
|
1001
|
-
zener:
|
|
1002
|
-
photo:
|
|
1003
|
-
tvs:
|
|
1007
|
+
standard: z53.boolean().optional(),
|
|
1008
|
+
schottky: z53.boolean().optional(),
|
|
1009
|
+
zener: z53.boolean().optional(),
|
|
1010
|
+
photo: z53.boolean().optional(),
|
|
1011
|
+
tvs: z53.boolean().optional()
|
|
1004
1012
|
}).superRefine((data, ctx) => {
|
|
1005
1013
|
const enabledFlags = [
|
|
1006
1014
|
data.standard,
|
|
@@ -1011,11 +1019,11 @@ var diodeProps = commonComponentProps.extend({
|
|
|
1011
1019
|
].filter(Boolean).length;
|
|
1012
1020
|
if (enabledFlags > 1) {
|
|
1013
1021
|
ctx.addIssue({
|
|
1014
|
-
code:
|
|
1022
|
+
code: z53.ZodIssueCode.custom,
|
|
1015
1023
|
message: "Exactly one diode variant must be enabled",
|
|
1016
1024
|
path: []
|
|
1017
1025
|
});
|
|
1018
|
-
return
|
|
1026
|
+
return z53.INVALID;
|
|
1019
1027
|
}
|
|
1020
1028
|
}).transform((data) => {
|
|
1021
1029
|
const result = {
|
|
@@ -1063,23 +1071,23 @@ var diodePins = lrPolarPins;
|
|
|
1063
1071
|
expectTypesMatch(true);
|
|
1064
1072
|
|
|
1065
1073
|
// lib/components/led.ts
|
|
1066
|
-
import { z as
|
|
1074
|
+
import { z as z54 } from "zod";
|
|
1067
1075
|
var ledProps = commonComponentProps.extend({
|
|
1068
|
-
color:
|
|
1069
|
-
wavelength:
|
|
1070
|
-
schDisplayValue:
|
|
1076
|
+
color: z54.string().optional(),
|
|
1077
|
+
wavelength: z54.string().optional(),
|
|
1078
|
+
schDisplayValue: z54.string().optional()
|
|
1071
1079
|
});
|
|
1072
1080
|
var ledPins = lrPolarPins;
|
|
1073
1081
|
|
|
1074
1082
|
// lib/components/switch.ts
|
|
1075
|
-
import { z as
|
|
1083
|
+
import { z as z55 } from "zod";
|
|
1076
1084
|
var switchProps = commonComponentProps.extend({
|
|
1077
|
-
type:
|
|
1078
|
-
isNormallyClosed:
|
|
1079
|
-
spst:
|
|
1080
|
-
spdt:
|
|
1081
|
-
dpst:
|
|
1082
|
-
dpdt:
|
|
1085
|
+
type: z55.enum(["spst", "spdt", "dpst", "dpdt"]).optional(),
|
|
1086
|
+
isNormallyClosed: z55.boolean().optional().default(false),
|
|
1087
|
+
spst: z55.boolean().optional(),
|
|
1088
|
+
spdt: z55.boolean().optional(),
|
|
1089
|
+
dpst: z55.boolean().optional(),
|
|
1090
|
+
dpdt: z55.boolean().optional()
|
|
1083
1091
|
}).transform((props) => {
|
|
1084
1092
|
const updatedProps = { ...props };
|
|
1085
1093
|
if (updatedProps.dpdt) {
|
|
@@ -1111,31 +1119,31 @@ expectTypesMatch(true);
|
|
|
1111
1119
|
|
|
1112
1120
|
// lib/components/fabrication-note-text.ts
|
|
1113
1121
|
import { length as length3 } from "circuit-json";
|
|
1114
|
-
import { z as
|
|
1122
|
+
import { z as z56 } from "zod";
|
|
1115
1123
|
var fabricationNoteTextProps = pcbLayoutProps.extend({
|
|
1116
|
-
text:
|
|
1117
|
-
anchorAlignment:
|
|
1118
|
-
font:
|
|
1124
|
+
text: z56.string(),
|
|
1125
|
+
anchorAlignment: z56.enum(["center", "top_left", "top_right", "bottom_left", "bottom_right"]).default("center"),
|
|
1126
|
+
font: z56.enum(["tscircuit2024"]).optional(),
|
|
1119
1127
|
fontSize: length3.optional(),
|
|
1120
|
-
color:
|
|
1128
|
+
color: z56.string().optional()
|
|
1121
1129
|
});
|
|
1122
1130
|
|
|
1123
1131
|
// lib/components/fabrication-note-path.ts
|
|
1124
1132
|
import { length as length4, route_hint_point as route_hint_point3 } from "circuit-json";
|
|
1125
|
-
import { z as
|
|
1133
|
+
import { z as z57 } from "zod";
|
|
1126
1134
|
var fabricationNotePathProps = pcbLayoutProps.omit({ pcbX: true, pcbY: true, pcbRotation: true }).extend({
|
|
1127
|
-
route:
|
|
1135
|
+
route: z57.array(route_hint_point3),
|
|
1128
1136
|
strokeWidth: length4.optional(),
|
|
1129
|
-
color:
|
|
1137
|
+
color: z57.string().optional()
|
|
1130
1138
|
});
|
|
1131
1139
|
|
|
1132
1140
|
// lib/components/pcb-trace.ts
|
|
1133
1141
|
import { distance as distance15, route_hint_point as route_hint_point4 } from "circuit-json";
|
|
1134
|
-
import { z as
|
|
1135
|
-
var pcbTraceProps =
|
|
1136
|
-
layer:
|
|
1142
|
+
import { z as z58 } from "zod";
|
|
1143
|
+
var pcbTraceProps = z58.object({
|
|
1144
|
+
layer: z58.string().optional(),
|
|
1137
1145
|
thickness: distance15.optional(),
|
|
1138
|
-
route:
|
|
1146
|
+
route: z58.array(route_hint_point4)
|
|
1139
1147
|
});
|
|
1140
1148
|
|
|
1141
1149
|
// lib/components/via.ts
|
|
@@ -1149,10 +1157,10 @@ var viaProps = commonLayoutProps.extend({
|
|
|
1149
1157
|
|
|
1150
1158
|
// lib/components/testpoint.ts
|
|
1151
1159
|
import { distance as distance17 } from "circuit-json";
|
|
1152
|
-
import { z as
|
|
1160
|
+
import { z as z59 } from "zod";
|
|
1153
1161
|
var testpointProps = commonComponentProps.extend({
|
|
1154
|
-
footprintVariant:
|
|
1155
|
-
padShape:
|
|
1162
|
+
footprintVariant: z59.enum(["pad", "through_hole"]).optional().default("pad"),
|
|
1163
|
+
padShape: z59.enum(["rect", "circle"]).optional().default("circle"),
|
|
1156
1164
|
padDiameter: distance17.optional(),
|
|
1157
1165
|
holeDiameter: distance17.optional(),
|
|
1158
1166
|
width: distance17.optional(),
|
|
@@ -1164,22 +1172,22 @@ var testpointProps = commonComponentProps.extend({
|
|
|
1164
1172
|
expectTypesMatch(true);
|
|
1165
1173
|
|
|
1166
1174
|
// lib/components/breakoutpoint.ts
|
|
1167
|
-
import { z as
|
|
1175
|
+
import { z as z60 } from "zod";
|
|
1168
1176
|
var breakoutPointProps = pcbLayoutProps.omit({ pcbRotation: true, layer: true }).extend({
|
|
1169
|
-
connection:
|
|
1177
|
+
connection: z60.string()
|
|
1170
1178
|
});
|
|
1171
1179
|
expectTypesMatch(true);
|
|
1172
1180
|
|
|
1173
1181
|
// lib/components/pcb-keepout.ts
|
|
1174
1182
|
import { distance as distance18 } from "circuit-json";
|
|
1175
|
-
import { z as
|
|
1176
|
-
var pcbKeepoutProps =
|
|
1183
|
+
import { z as z61 } from "zod";
|
|
1184
|
+
var pcbKeepoutProps = z61.union([
|
|
1177
1185
|
pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
1178
|
-
shape:
|
|
1186
|
+
shape: z61.literal("circle"),
|
|
1179
1187
|
radius: distance18
|
|
1180
1188
|
}),
|
|
1181
1189
|
pcbLayoutProps.extend({
|
|
1182
|
-
shape:
|
|
1190
|
+
shape: z61.literal("rect"),
|
|
1183
1191
|
width: distance18,
|
|
1184
1192
|
height: distance18
|
|
1185
1193
|
})
|
|
@@ -1193,11 +1201,11 @@ var powerSourceProps = commonComponentProps.extend({
|
|
|
1193
1201
|
|
|
1194
1202
|
// lib/components/schematic-box.ts
|
|
1195
1203
|
import { distance as distance19 } from "circuit-json";
|
|
1196
|
-
import { z as
|
|
1204
|
+
import { z as z63 } from "zod";
|
|
1197
1205
|
|
|
1198
1206
|
// lib/common/nine_point_anchor.ts
|
|
1199
|
-
import { z as
|
|
1200
|
-
var nine_point_anchor =
|
|
1207
|
+
import { z as z62 } from "zod";
|
|
1208
|
+
var nine_point_anchor = z62.enum([
|
|
1201
1209
|
"top_left",
|
|
1202
1210
|
"top_center",
|
|
1203
1211
|
"top_right",
|
|
@@ -1210,23 +1218,23 @@ var nine_point_anchor = z61.enum([
|
|
|
1210
1218
|
]);
|
|
1211
1219
|
|
|
1212
1220
|
// lib/components/schematic-box.ts
|
|
1213
|
-
var schematicBoxProps =
|
|
1221
|
+
var schematicBoxProps = z63.object({
|
|
1214
1222
|
schX: distance19,
|
|
1215
1223
|
schY: distance19,
|
|
1216
1224
|
width: distance19.optional(),
|
|
1217
1225
|
height: distance19.optional(),
|
|
1218
|
-
overlay:
|
|
1226
|
+
overlay: z63.array(z63.string()).optional(),
|
|
1219
1227
|
padding: distance19.optional(),
|
|
1220
1228
|
paddingLeft: distance19.optional(),
|
|
1221
1229
|
paddingRight: distance19.optional(),
|
|
1222
1230
|
paddingTop: distance19.optional(),
|
|
1223
1231
|
paddingBottom: distance19.optional(),
|
|
1224
|
-
title:
|
|
1232
|
+
title: z63.string().optional(),
|
|
1225
1233
|
titleAlignment: nine_point_anchor.default("center"),
|
|
1226
|
-
titleColor:
|
|
1234
|
+
titleColor: z63.string().optional(),
|
|
1227
1235
|
titleFontSize: distance19.optional(),
|
|
1228
|
-
titleInside:
|
|
1229
|
-
strokeStyle:
|
|
1236
|
+
titleInside: z63.boolean().default(false),
|
|
1237
|
+
strokeStyle: z63.enum(["solid", "dashed"]).default("solid")
|
|
1230
1238
|
}).refine(
|
|
1231
1239
|
(elm) => elm.width !== void 0 && elm.height !== void 0 || Array.isArray(elm.overlay) && elm.overlay.length > 0,
|
|
1232
1240
|
{
|
|
@@ -1241,8 +1249,8 @@ var schematicBoxProps = z62.object({
|
|
|
1241
1249
|
|
|
1242
1250
|
// lib/components/schematic-line.ts
|
|
1243
1251
|
import { distance as distance20 } from "circuit-json";
|
|
1244
|
-
import { z as
|
|
1245
|
-
var schematicLineProps =
|
|
1252
|
+
import { z as z64 } from "zod";
|
|
1253
|
+
var schematicLineProps = z64.object({
|
|
1246
1254
|
x1: distance20,
|
|
1247
1255
|
y1: distance20,
|
|
1248
1256
|
x2: distance20,
|
|
@@ -1251,11 +1259,11 @@ var schematicLineProps = z63.object({
|
|
|
1251
1259
|
|
|
1252
1260
|
// lib/components/schematic-text.ts
|
|
1253
1261
|
import { distance as distance21, rotation as rotation3 } from "circuit-json";
|
|
1254
|
-
import { z as
|
|
1262
|
+
import { z as z66 } from "zod";
|
|
1255
1263
|
|
|
1256
1264
|
// lib/common/five_point_anchor.ts
|
|
1257
|
-
import { z as
|
|
1258
|
-
var five_point_anchor =
|
|
1265
|
+
import { z as z65 } from "zod";
|
|
1266
|
+
var five_point_anchor = z65.enum([
|
|
1259
1267
|
"center",
|
|
1260
1268
|
"left",
|
|
1261
1269
|
"right",
|
|
@@ -1264,40 +1272,40 @@ var five_point_anchor = z64.enum([
|
|
|
1264
1272
|
]);
|
|
1265
1273
|
|
|
1266
1274
|
// lib/components/schematic-text.ts
|
|
1267
|
-
var schematicTextProps =
|
|
1275
|
+
var schematicTextProps = z66.object({
|
|
1268
1276
|
schX: distance21,
|
|
1269
1277
|
schY: distance21,
|
|
1270
|
-
text:
|
|
1271
|
-
fontSize:
|
|
1272
|
-
anchor:
|
|
1273
|
-
color:
|
|
1278
|
+
text: z66.string(),
|
|
1279
|
+
fontSize: z66.number().default(1),
|
|
1280
|
+
anchor: z66.union([five_point_anchor.describe("legacy"), nine_point_anchor]).default("center"),
|
|
1281
|
+
color: z66.string().default("#000000"),
|
|
1274
1282
|
schRotation: rotation3.default(0)
|
|
1275
1283
|
});
|
|
1276
1284
|
|
|
1277
1285
|
// lib/components/schematic-path.ts
|
|
1278
1286
|
import { point as point5 } from "circuit-json";
|
|
1279
|
-
import { z as
|
|
1280
|
-
var schematicPathProps =
|
|
1281
|
-
points:
|
|
1282
|
-
isFilled:
|
|
1283
|
-
fillColor:
|
|
1287
|
+
import { z as z67 } from "zod";
|
|
1288
|
+
var schematicPathProps = z67.object({
|
|
1289
|
+
points: z67.array(point5),
|
|
1290
|
+
isFilled: z67.boolean().optional().default(false),
|
|
1291
|
+
fillColor: z67.enum(["red", "blue"]).optional()
|
|
1284
1292
|
});
|
|
1285
1293
|
|
|
1286
1294
|
// lib/components/silkscreen-text.ts
|
|
1287
1295
|
import { length as length5 } from "circuit-json";
|
|
1288
|
-
import { z as
|
|
1296
|
+
import { z as z68 } from "zod";
|
|
1289
1297
|
var silkscreenTextProps = pcbLayoutProps.extend({
|
|
1290
|
-
text:
|
|
1298
|
+
text: z68.string(),
|
|
1291
1299
|
anchorAlignment: nine_point_anchor.default("center"),
|
|
1292
|
-
font:
|
|
1300
|
+
font: z68.enum(["tscircuit2024"]).optional(),
|
|
1293
1301
|
fontSize: length5.optional()
|
|
1294
1302
|
});
|
|
1295
1303
|
|
|
1296
1304
|
// lib/components/silkscreen-path.ts
|
|
1297
1305
|
import { length as length6, route_hint_point as route_hint_point5 } from "circuit-json";
|
|
1298
|
-
import { z as
|
|
1306
|
+
import { z as z69 } from "zod";
|
|
1299
1307
|
var silkscreenPathProps = pcbLayoutProps.omit({ pcbX: true, pcbY: true, pcbRotation: true }).extend({
|
|
1300
|
-
route:
|
|
1308
|
+
route: z69.array(route_hint_point5),
|
|
1301
1309
|
strokeWidth: length6.optional()
|
|
1302
1310
|
});
|
|
1303
1311
|
|
|
@@ -1313,10 +1321,10 @@ var silkscreenLineProps = pcbLayoutProps.omit({ pcbX: true, pcbY: true, pcbRotat
|
|
|
1313
1321
|
|
|
1314
1322
|
// lib/components/silkscreen-rect.ts
|
|
1315
1323
|
import { distance as distance23 } from "circuit-json";
|
|
1316
|
-
import { z as
|
|
1324
|
+
import { z as z70 } from "zod";
|
|
1317
1325
|
var silkscreenRectProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
1318
|
-
filled:
|
|
1319
|
-
stroke:
|
|
1326
|
+
filled: z70.boolean().default(true).optional(),
|
|
1327
|
+
stroke: z70.enum(["dashed", "solid", "none"]).optional(),
|
|
1320
1328
|
strokeWidth: distance23.optional(),
|
|
1321
1329
|
width: distance23,
|
|
1322
1330
|
height: distance23
|
|
@@ -1324,60 +1332,60 @@ var silkscreenRectProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
|
1324
1332
|
|
|
1325
1333
|
// lib/components/silkscreen-circle.ts
|
|
1326
1334
|
import { distance as distance24 } from "circuit-json";
|
|
1327
|
-
import { z as
|
|
1335
|
+
import { z as z71 } from "zod";
|
|
1328
1336
|
var silkscreenCircleProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
1329
|
-
isFilled:
|
|
1330
|
-
isOutline:
|
|
1337
|
+
isFilled: z71.boolean().optional(),
|
|
1338
|
+
isOutline: z71.boolean().optional(),
|
|
1331
1339
|
strokeWidth: distance24.optional(),
|
|
1332
1340
|
radius: distance24
|
|
1333
1341
|
});
|
|
1334
1342
|
|
|
1335
1343
|
// lib/components/trace-hint.ts
|
|
1336
1344
|
import { distance as distance25, layer_ref as layer_ref6, route_hint_point as route_hint_point6 } from "circuit-json";
|
|
1337
|
-
import { z as
|
|
1338
|
-
var routeHintPointProps =
|
|
1345
|
+
import { z as z72 } from "zod";
|
|
1346
|
+
var routeHintPointProps = z72.object({
|
|
1339
1347
|
x: distance25,
|
|
1340
1348
|
y: distance25,
|
|
1341
|
-
via:
|
|
1349
|
+
via: z72.boolean().optional(),
|
|
1342
1350
|
toLayer: layer_ref6.optional()
|
|
1343
1351
|
});
|
|
1344
|
-
var traceHintProps =
|
|
1345
|
-
for:
|
|
1352
|
+
var traceHintProps = z72.object({
|
|
1353
|
+
for: z72.string().optional().describe(
|
|
1346
1354
|
"Selector for the port you're targeting, not required if you're inside a trace"
|
|
1347
1355
|
),
|
|
1348
|
-
order:
|
|
1356
|
+
order: z72.number().optional(),
|
|
1349
1357
|
offset: route_hint_point6.or(routeHintPointProps).optional(),
|
|
1350
|
-
offsets:
|
|
1351
|
-
traceWidth:
|
|
1358
|
+
offsets: z72.array(route_hint_point6).or(z72.array(routeHintPointProps)).optional(),
|
|
1359
|
+
traceWidth: z72.number().optional()
|
|
1352
1360
|
});
|
|
1353
1361
|
|
|
1354
1362
|
// lib/components/port.ts
|
|
1355
|
-
import { z as
|
|
1363
|
+
import { z as z73 } from "zod";
|
|
1356
1364
|
var portProps = commonLayoutProps.extend({
|
|
1357
|
-
name:
|
|
1358
|
-
pinNumber:
|
|
1359
|
-
aliases:
|
|
1365
|
+
name: z73.string(),
|
|
1366
|
+
pinNumber: z73.number().optional(),
|
|
1367
|
+
aliases: z73.array(z73.string()).optional(),
|
|
1360
1368
|
direction
|
|
1361
1369
|
});
|
|
1362
1370
|
|
|
1363
1371
|
// lib/platformConfig.ts
|
|
1364
|
-
import { z as
|
|
1365
|
-
var unvalidatedCircuitJson =
|
|
1366
|
-
var pathToCircuitJsonFn =
|
|
1367
|
-
var platformConfig =
|
|
1372
|
+
import { z as z74 } from "zod";
|
|
1373
|
+
var unvalidatedCircuitJson = z74.array(z74.any()).describe("Circuit JSON");
|
|
1374
|
+
var pathToCircuitJsonFn = z74.function().args(z74.string()).returns(z74.promise(z74.object({ footprintCircuitJson: z74.array(z74.any()) }))).describe("A function that takes a path and returns Circuit JSON");
|
|
1375
|
+
var platformConfig = z74.object({
|
|
1368
1376
|
partsEngine: partsEngine.optional(),
|
|
1369
1377
|
autorouter: autorouterProp.optional(),
|
|
1370
|
-
registryApiUrl:
|
|
1371
|
-
cloudAutorouterUrl:
|
|
1372
|
-
localCacheEngine:
|
|
1373
|
-
pcbDisabled:
|
|
1374
|
-
schematicDisabled:
|
|
1375
|
-
partsEngineDisabled:
|
|
1376
|
-
footprintLibraryMap:
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1378
|
+
registryApiUrl: z74.string().optional(),
|
|
1379
|
+
cloudAutorouterUrl: z74.string().optional(),
|
|
1380
|
+
localCacheEngine: z74.any().optional(),
|
|
1381
|
+
pcbDisabled: z74.boolean().optional(),
|
|
1382
|
+
schematicDisabled: z74.boolean().optional(),
|
|
1383
|
+
partsEngineDisabled: z74.boolean().optional(),
|
|
1384
|
+
footprintLibraryMap: z74.record(
|
|
1385
|
+
z74.string(),
|
|
1386
|
+
z74.record(
|
|
1387
|
+
z74.string(),
|
|
1388
|
+
z74.union([unvalidatedCircuitJson, pathToCircuitJsonFn])
|
|
1381
1389
|
)
|
|
1382
1390
|
).optional()
|
|
1383
1391
|
});
|
|
@@ -1498,6 +1506,7 @@ export {
|
|
|
1498
1506
|
silkscreenTextProps,
|
|
1499
1507
|
smtPadProps,
|
|
1500
1508
|
solderPasteProps,
|
|
1509
|
+
solderjumperProps,
|
|
1501
1510
|
stampboardProps,
|
|
1502
1511
|
subcircuitGroupProps,
|
|
1503
1512
|
subcircuitGroupPropsWithBool,
|