@tscircuit/props 0.0.169 → 0.0.171
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/dist/index.d.ts +83 -1
- package/dist/index.js +194 -172
- package/dist/index.js.map +1 -1
- package/lib/common/connectionsProp.ts +12 -0
- package/lib/components/capacitor.ts +14 -0
- package/lib/components/chip.ts +1 -8
- package/lib/components/resistor.ts +8 -0
- package/lib/index.ts +1 -0
- package/lib/utility-types/connections-and-selectors.ts +77 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -482,94 +482,114 @@ expectTypesMatch(true);
|
|
|
482
482
|
|
|
483
483
|
// lib/components/resistor.ts
|
|
484
484
|
import { resistance } from "circuit-json";
|
|
485
|
+
|
|
486
|
+
// lib/common/connectionsProp.ts
|
|
485
487
|
import { z as z24 } from "zod";
|
|
488
|
+
var connectionTarget2 = z24.string().or(z24.array(z24.string()).readonly()).or(z24.array(z24.string()));
|
|
489
|
+
var createConnectionsProp = (labels) => {
|
|
490
|
+
return z24.record(z24.enum(labels), connectionTarget2);
|
|
491
|
+
};
|
|
492
|
+
|
|
493
|
+
// lib/components/resistor.ts
|
|
494
|
+
import { z as z25 } from "zod";
|
|
495
|
+
var resistorPinLabels = ["pin1", "pin2", "pos", "neg"];
|
|
486
496
|
var resistorProps = commonComponentProps.extend({
|
|
487
497
|
resistance,
|
|
488
|
-
pullupFor:
|
|
489
|
-
pullupTo:
|
|
490
|
-
pulldownFor:
|
|
491
|
-
pulldownTo:
|
|
498
|
+
pullupFor: z25.string().optional(),
|
|
499
|
+
pullupTo: z25.string().optional(),
|
|
500
|
+
pulldownFor: z25.string().optional(),
|
|
501
|
+
pulldownTo: z25.string().optional(),
|
|
502
|
+
connections: createConnectionsProp(resistorPinLabels).optional()
|
|
492
503
|
});
|
|
493
504
|
var resistorPins = lrPins;
|
|
494
505
|
expectTypesMatch(true);
|
|
495
506
|
|
|
496
507
|
// lib/components/potentiometer.ts
|
|
497
508
|
import { resistance as resistance2 } from "circuit-json";
|
|
498
|
-
import { z as
|
|
509
|
+
import { z as z26 } from "zod";
|
|
499
510
|
var potentiometerProps = commonComponentProps.extend({
|
|
500
511
|
maxResistance: resistance2,
|
|
501
|
-
pinVariant:
|
|
512
|
+
pinVariant: z26.enum(["two_pin", "three_pin"]).optional()
|
|
502
513
|
});
|
|
503
514
|
expectTypesMatch(true);
|
|
504
515
|
|
|
505
516
|
// lib/components/crystal.ts
|
|
506
517
|
import { frequency, capacitance } from "circuit-json";
|
|
507
|
-
import { z as
|
|
518
|
+
import { z as z27 } from "zod";
|
|
508
519
|
var crystalProps = commonComponentProps.extend({
|
|
509
520
|
frequency,
|
|
510
521
|
loadCapacitance: capacitance,
|
|
511
|
-
pinVariant:
|
|
522
|
+
pinVariant: z27.enum(["two_pin", "four_pin"]).optional()
|
|
512
523
|
});
|
|
513
524
|
var crystalPins = lrPins;
|
|
514
525
|
expectTypesMatch(true);
|
|
515
526
|
|
|
516
527
|
// lib/components/resonator.ts
|
|
517
528
|
import { frequency as frequency2, capacitance as capacitance2 } from "circuit-json";
|
|
518
|
-
import { z as
|
|
529
|
+
import { z as z28 } from "zod";
|
|
519
530
|
var resonatorProps = commonComponentProps.extend({
|
|
520
531
|
frequency: frequency2,
|
|
521
532
|
loadCapacitance: capacitance2,
|
|
522
|
-
pinVariant:
|
|
533
|
+
pinVariant: z28.enum(["no_ground", "ground_pin", "two_ground_pins"]).optional()
|
|
523
534
|
});
|
|
524
535
|
expectTypesMatch(true);
|
|
525
536
|
|
|
526
537
|
// lib/components/stampboard.ts
|
|
527
538
|
import { distance as distance9 } from "circuit-json";
|
|
528
|
-
import { z as
|
|
539
|
+
import { z as z29 } from "zod";
|
|
529
540
|
var stampboardProps = boardProps.extend({
|
|
530
|
-
leftPinCount:
|
|
531
|
-
rightPinCount:
|
|
532
|
-
topPinCount:
|
|
533
|
-
bottomPinCount:
|
|
534
|
-
leftPins:
|
|
535
|
-
rightPins:
|
|
536
|
-
topPins:
|
|
537
|
-
bottomPins:
|
|
541
|
+
leftPinCount: z29.number().optional(),
|
|
542
|
+
rightPinCount: z29.number().optional(),
|
|
543
|
+
topPinCount: z29.number().optional(),
|
|
544
|
+
bottomPinCount: z29.number().optional(),
|
|
545
|
+
leftPins: z29.array(z29.string()).optional(),
|
|
546
|
+
rightPins: z29.array(z29.string()).optional(),
|
|
547
|
+
topPins: z29.array(z29.string()).optional(),
|
|
548
|
+
bottomPins: z29.array(z29.string()).optional(),
|
|
538
549
|
pinPitch: distance9.optional(),
|
|
539
|
-
innerHoles:
|
|
550
|
+
innerHoles: z29.boolean().optional()
|
|
540
551
|
});
|
|
541
552
|
expectTypesMatch(true);
|
|
542
553
|
|
|
543
554
|
// lib/components/capacitor.ts
|
|
544
555
|
import { capacitance as capacitance3, voltage } from "circuit-json";
|
|
545
|
-
import { z as
|
|
556
|
+
import { z as z30 } from "zod";
|
|
557
|
+
var capacitorPinLabels = [
|
|
558
|
+
"pin1",
|
|
559
|
+
"pin2",
|
|
560
|
+
"pos",
|
|
561
|
+
"neg",
|
|
562
|
+
"anode",
|
|
563
|
+
"cathode"
|
|
564
|
+
];
|
|
546
565
|
var capacitorProps = commonComponentProps.extend({
|
|
547
566
|
capacitance: capacitance3,
|
|
548
567
|
maxVoltageRating: voltage.optional(),
|
|
549
|
-
schShowRatings:
|
|
550
|
-
polarized:
|
|
551
|
-
decouplingFor:
|
|
552
|
-
decouplingTo:
|
|
553
|
-
bypassFor:
|
|
554
|
-
bypassTo:
|
|
555
|
-
maxDecouplingTraceLength:
|
|
568
|
+
schShowRatings: z30.boolean().optional().default(false),
|
|
569
|
+
polarized: z30.boolean().optional().default(false),
|
|
570
|
+
decouplingFor: z30.string().optional(),
|
|
571
|
+
decouplingTo: z30.string().optional(),
|
|
572
|
+
bypassFor: z30.string().optional(),
|
|
573
|
+
bypassTo: z30.string().optional(),
|
|
574
|
+
maxDecouplingTraceLength: z30.number().optional(),
|
|
575
|
+
connections: createConnectionsProp(capacitorPinLabels).optional()
|
|
556
576
|
});
|
|
557
577
|
var capacitorPins = lrPolarPins;
|
|
558
578
|
expectTypesMatch(true);
|
|
559
579
|
|
|
560
580
|
// lib/components/net.ts
|
|
561
|
-
import { z as
|
|
562
|
-
var netProps =
|
|
563
|
-
name:
|
|
581
|
+
import { z as z31 } from "zod";
|
|
582
|
+
var netProps = z31.object({
|
|
583
|
+
name: z31.string()
|
|
564
584
|
});
|
|
565
585
|
expectTypesMatch(true);
|
|
566
586
|
|
|
567
587
|
// lib/components/constrainedlayout.ts
|
|
568
|
-
import { z as
|
|
569
|
-
var constrainedLayoutProps =
|
|
570
|
-
name:
|
|
571
|
-
pcbOnly:
|
|
572
|
-
schOnly:
|
|
588
|
+
import { z as z32 } from "zod";
|
|
589
|
+
var constrainedLayoutProps = z32.object({
|
|
590
|
+
name: z32.string().optional(),
|
|
591
|
+
pcbOnly: z32.boolean().optional(),
|
|
592
|
+
schOnly: z32.boolean().optional()
|
|
573
593
|
});
|
|
574
594
|
expectTypesMatch(true);
|
|
575
595
|
|
|
@@ -578,46 +598,46 @@ import "zod";
|
|
|
578
598
|
import { distance as distance10, length as length2 } from "circuit-json";
|
|
579
599
|
|
|
580
600
|
// lib/components/constraint.ts
|
|
581
|
-
import { z as
|
|
582
|
-
var pcbXDistConstraintProps =
|
|
583
|
-
pcb:
|
|
601
|
+
import { z as z34 } from "zod";
|
|
602
|
+
var pcbXDistConstraintProps = z34.object({
|
|
603
|
+
pcb: z34.literal(true).optional(),
|
|
584
604
|
xDist: distance10,
|
|
585
|
-
left:
|
|
586
|
-
right:
|
|
587
|
-
edgeToEdge:
|
|
588
|
-
centerToCenter:
|
|
605
|
+
left: z34.string(),
|
|
606
|
+
right: z34.string(),
|
|
607
|
+
edgeToEdge: z34.literal(true).optional(),
|
|
608
|
+
centerToCenter: z34.literal(true).optional()
|
|
589
609
|
});
|
|
590
610
|
expectTypesMatch(
|
|
591
611
|
true
|
|
592
612
|
);
|
|
593
|
-
var pcbYDistConstraintProps =
|
|
594
|
-
pcb:
|
|
613
|
+
var pcbYDistConstraintProps = z34.object({
|
|
614
|
+
pcb: z34.literal(true).optional(),
|
|
595
615
|
yDist: distance10,
|
|
596
|
-
top:
|
|
597
|
-
bottom:
|
|
598
|
-
edgeToEdge:
|
|
599
|
-
centerToCenter:
|
|
616
|
+
top: z34.string(),
|
|
617
|
+
bottom: z34.string(),
|
|
618
|
+
edgeToEdge: z34.literal(true).optional(),
|
|
619
|
+
centerToCenter: z34.literal(true).optional()
|
|
600
620
|
});
|
|
601
621
|
expectTypesMatch(
|
|
602
622
|
true
|
|
603
623
|
);
|
|
604
|
-
var pcbSameYConstraintProps =
|
|
605
|
-
pcb:
|
|
606
|
-
sameY:
|
|
607
|
-
for:
|
|
624
|
+
var pcbSameYConstraintProps = z34.object({
|
|
625
|
+
pcb: z34.literal(true).optional(),
|
|
626
|
+
sameY: z34.literal(true).optional(),
|
|
627
|
+
for: z34.array(z34.string())
|
|
608
628
|
});
|
|
609
629
|
expectTypesMatch(
|
|
610
630
|
true
|
|
611
631
|
);
|
|
612
|
-
var pcbSameXConstraintProps =
|
|
613
|
-
pcb:
|
|
614
|
-
sameX:
|
|
615
|
-
for:
|
|
632
|
+
var pcbSameXConstraintProps = z34.object({
|
|
633
|
+
pcb: z34.literal(true).optional(),
|
|
634
|
+
sameX: z34.literal(true).optional(),
|
|
635
|
+
for: z34.array(z34.string())
|
|
616
636
|
});
|
|
617
637
|
expectTypesMatch(
|
|
618
638
|
true
|
|
619
639
|
);
|
|
620
|
-
var constraintProps =
|
|
640
|
+
var constraintProps = z34.union([
|
|
621
641
|
pcbXDistConstraintProps,
|
|
622
642
|
pcbYDistConstraintProps,
|
|
623
643
|
pcbSameYConstraintProps,
|
|
@@ -626,37 +646,37 @@ var constraintProps = z33.union([
|
|
|
626
646
|
expectTypesMatch(true);
|
|
627
647
|
|
|
628
648
|
// lib/components/smtpad.ts
|
|
629
|
-
import { z as
|
|
649
|
+
import { z as z35 } from "zod";
|
|
630
650
|
var rectSmtPadProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
631
|
-
shape:
|
|
651
|
+
shape: z35.literal("rect"),
|
|
632
652
|
width: distance10,
|
|
633
653
|
height: distance10,
|
|
634
654
|
portHints: portHints.optional()
|
|
635
655
|
});
|
|
636
656
|
expectTypesMatch(true);
|
|
637
657
|
var rotatedRectSmtPadProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
638
|
-
shape:
|
|
658
|
+
shape: z35.literal("rotated_rect"),
|
|
639
659
|
width: distance10,
|
|
640
660
|
height: distance10,
|
|
641
|
-
ccwRotation:
|
|
661
|
+
ccwRotation: z35.number(),
|
|
642
662
|
portHints: portHints.optional()
|
|
643
663
|
});
|
|
644
664
|
expectTypesMatch(true);
|
|
645
665
|
var circleSmtPadProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
646
|
-
shape:
|
|
666
|
+
shape: z35.literal("circle"),
|
|
647
667
|
radius: distance10,
|
|
648
668
|
portHints: portHints.optional()
|
|
649
669
|
});
|
|
650
670
|
expectTypesMatch(true);
|
|
651
671
|
var pillSmtPadProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
652
|
-
shape:
|
|
672
|
+
shape: z35.literal("pill"),
|
|
653
673
|
width: distance10,
|
|
654
674
|
height: distance10,
|
|
655
675
|
radius: distance10,
|
|
656
676
|
portHints: portHints.optional()
|
|
657
677
|
});
|
|
658
678
|
expectTypesMatch(true);
|
|
659
|
-
var smtPadProps =
|
|
679
|
+
var smtPadProps = z35.union([
|
|
660
680
|
circleSmtPadProps,
|
|
661
681
|
rectSmtPadProps,
|
|
662
682
|
rotatedRectSmtPadProps,
|
|
@@ -665,28 +685,28 @@ var smtPadProps = z34.union([
|
|
|
665
685
|
expectTypesMatch(true);
|
|
666
686
|
|
|
667
687
|
// lib/components/solderpaste.ts
|
|
668
|
-
import { z as
|
|
688
|
+
import { z as z36 } from "zod";
|
|
669
689
|
var rectSolderPasteProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
670
|
-
shape:
|
|
690
|
+
shape: z36.literal("rect"),
|
|
671
691
|
width: distance10,
|
|
672
692
|
height: distance10
|
|
673
693
|
});
|
|
674
694
|
expectTypesMatch(true);
|
|
675
695
|
var circleSolderPasteProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
676
|
-
shape:
|
|
696
|
+
shape: z36.literal("circle"),
|
|
677
697
|
radius: distance10
|
|
678
698
|
});
|
|
679
699
|
expectTypesMatch(true);
|
|
680
|
-
var solderPasteProps =
|
|
700
|
+
var solderPasteProps = z36.union([
|
|
681
701
|
circleSolderPasteProps,
|
|
682
702
|
rectSolderPasteProps
|
|
683
703
|
]);
|
|
684
704
|
expectTypesMatch(true);
|
|
685
705
|
|
|
686
706
|
// lib/components/hole.ts
|
|
687
|
-
import { z as
|
|
707
|
+
import { z as z37 } from "zod";
|
|
688
708
|
var holeProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
689
|
-
name:
|
|
709
|
+
name: z37.string().optional(),
|
|
690
710
|
diameter: distance10.optional(),
|
|
691
711
|
radius: distance10.optional()
|
|
692
712
|
}).transform((d) => ({
|
|
@@ -698,24 +718,24 @@ expectTypesMatch(true);
|
|
|
698
718
|
|
|
699
719
|
// lib/components/trace.ts
|
|
700
720
|
import { distance as distance11, route_hint_point as route_hint_point3 } from "circuit-json";
|
|
701
|
-
import { z as
|
|
702
|
-
var portRef =
|
|
703
|
-
|
|
704
|
-
|
|
721
|
+
import { z as z38 } from "zod";
|
|
722
|
+
var portRef = z38.union([
|
|
723
|
+
z38.string(),
|
|
724
|
+
z38.custom(
|
|
705
725
|
(v) => Boolean(v.getPortSelector)
|
|
706
726
|
)
|
|
707
727
|
]);
|
|
708
|
-
var baseTraceProps =
|
|
709
|
-
key:
|
|
728
|
+
var baseTraceProps = z38.object({
|
|
729
|
+
key: z38.string().optional(),
|
|
710
730
|
thickness: distance11.optional(),
|
|
711
|
-
schematicRouteHints:
|
|
712
|
-
pcbRouteHints:
|
|
713
|
-
schDisplayLabel:
|
|
731
|
+
schematicRouteHints: z38.array(point).optional(),
|
|
732
|
+
pcbRouteHints: z38.array(route_hint_point3).optional(),
|
|
733
|
+
schDisplayLabel: z38.string().optional(),
|
|
714
734
|
maxLength: distance11.optional()
|
|
715
735
|
});
|
|
716
|
-
var traceProps =
|
|
736
|
+
var traceProps = z38.union([
|
|
717
737
|
baseTraceProps.extend({
|
|
718
|
-
path:
|
|
738
|
+
path: z38.array(portRef)
|
|
719
739
|
}),
|
|
720
740
|
baseTraceProps.extend({
|
|
721
741
|
from: portRef,
|
|
@@ -725,15 +745,15 @@ var traceProps = z37.union([
|
|
|
725
745
|
|
|
726
746
|
// lib/components/footprint.ts
|
|
727
747
|
import { layer_ref as layer_ref4 } from "circuit-json";
|
|
728
|
-
import { z as
|
|
729
|
-
var footprintProps =
|
|
748
|
+
import { z as z39 } from "zod";
|
|
749
|
+
var footprintProps = z39.object({
|
|
730
750
|
originalLayer: layer_ref4.default("top").optional()
|
|
731
751
|
});
|
|
732
752
|
expectTypesMatch(true);
|
|
733
753
|
|
|
734
754
|
// lib/components/battery.ts
|
|
735
|
-
import { z as
|
|
736
|
-
var capacity =
|
|
755
|
+
import { z as z40 } from "zod";
|
|
756
|
+
var capacity = z40.number().or(z40.string().endsWith("mAh")).transform((v) => {
|
|
737
757
|
if (typeof v === "string") {
|
|
738
758
|
const valString = v.replace("mAh", "");
|
|
739
759
|
const num = Number.parseFloat(valString);
|
|
@@ -752,30 +772,30 @@ expectTypesMatch(true);
|
|
|
752
772
|
|
|
753
773
|
// lib/components/pin-header.ts
|
|
754
774
|
import { distance as distance12 } from "circuit-json";
|
|
755
|
-
import { z as
|
|
775
|
+
import { z as z41 } from "zod";
|
|
756
776
|
var pinHeaderProps = commonComponentProps.extend({
|
|
757
|
-
pinCount:
|
|
777
|
+
pinCount: z41.number(),
|
|
758
778
|
pitch: distance12.optional(),
|
|
759
|
-
schFacingDirection:
|
|
760
|
-
gender:
|
|
761
|
-
showSilkscreenPinLabels:
|
|
762
|
-
doubleRow:
|
|
779
|
+
schFacingDirection: z41.enum(["up", "down", "left", "right"]).optional(),
|
|
780
|
+
gender: z41.enum(["male", "female"]).optional().default("male"),
|
|
781
|
+
showSilkscreenPinLabels: z41.boolean().optional(),
|
|
782
|
+
doubleRow: z41.boolean().optional(),
|
|
763
783
|
holeDiameter: distance12.optional(),
|
|
764
784
|
platedDiameter: distance12.optional(),
|
|
765
|
-
pinLabels:
|
|
766
|
-
facingDirection:
|
|
785
|
+
pinLabels: z41.array(z41.string()).optional(),
|
|
786
|
+
facingDirection: z41.enum(["left", "right"]).optional()
|
|
767
787
|
});
|
|
768
788
|
expectTypesMatch(true);
|
|
769
789
|
|
|
770
790
|
// lib/components/netalias.ts
|
|
771
|
-
import { z as
|
|
791
|
+
import { z as z42 } from "zod";
|
|
772
792
|
import { rotation as rotation2 } from "circuit-json";
|
|
773
|
-
var netAliasProps =
|
|
774
|
-
net:
|
|
793
|
+
var netAliasProps = z42.object({
|
|
794
|
+
net: z42.string().optional(),
|
|
775
795
|
schX: distance10.optional(),
|
|
776
796
|
schY: distance10.optional(),
|
|
777
797
|
schRotation: rotation2.optional(),
|
|
778
|
-
anchorSide:
|
|
798
|
+
anchorSide: z42.enum(["left", "up", "right", "down"]).optional()
|
|
779
799
|
});
|
|
780
800
|
expectTypesMatch(true);
|
|
781
801
|
|
|
@@ -789,9 +809,9 @@ var subcircuitProps = subcircuitGroupProps;
|
|
|
789
809
|
expectTypesMatch(true);
|
|
790
810
|
|
|
791
811
|
// lib/components/transistor.ts
|
|
792
|
-
import { z as
|
|
812
|
+
import { z as z44 } from "zod";
|
|
793
813
|
var transistorProps = commonComponentProps.extend({
|
|
794
|
-
type:
|
|
814
|
+
type: z44.enum(["npn", "pnp", "bjt", "jfet", "mosfet"])
|
|
795
815
|
});
|
|
796
816
|
var transistorPins = [
|
|
797
817
|
"pin1",
|
|
@@ -804,10 +824,10 @@ var transistorPins = [
|
|
|
804
824
|
expectTypesMatch(true);
|
|
805
825
|
|
|
806
826
|
// lib/components/mosfet.ts
|
|
807
|
-
import { z as
|
|
827
|
+
import { z as z45 } from "zod";
|
|
808
828
|
var mosfetProps = commonComponentProps.extend({
|
|
809
|
-
channelType:
|
|
810
|
-
mosfetMode:
|
|
829
|
+
channelType: z45.enum(["n", "p"]),
|
|
830
|
+
mosfetMode: z45.enum(["enhancement", "depletion"])
|
|
811
831
|
});
|
|
812
832
|
var mosfetPins = [
|
|
813
833
|
"pin1",
|
|
@@ -827,8 +847,8 @@ var inductorProps = commonComponentProps.extend({
|
|
|
827
847
|
var inductorPins = lrPins;
|
|
828
848
|
|
|
829
849
|
// lib/components/diode.ts
|
|
830
|
-
import { z as
|
|
831
|
-
var diodeConnectionKeys =
|
|
850
|
+
import { z as z46 } from "zod";
|
|
851
|
+
var diodeConnectionKeys = z46.enum([
|
|
832
852
|
"anode",
|
|
833
853
|
"cathode",
|
|
834
854
|
"pin1",
|
|
@@ -836,8 +856,8 @@ var diodeConnectionKeys = z45.enum([
|
|
|
836
856
|
"pos",
|
|
837
857
|
"neg"
|
|
838
858
|
]);
|
|
839
|
-
var
|
|
840
|
-
var connectionsProp2 =
|
|
859
|
+
var connectionTarget3 = z46.string().or(z46.array(z46.string()).readonly()).or(z46.array(z46.string()));
|
|
860
|
+
var connectionsProp2 = z46.record(diodeConnectionKeys, connectionTarget3);
|
|
841
861
|
var diodeProps = commonComponentProps.extend({
|
|
842
862
|
connections: connectionsProp2.optional()
|
|
843
863
|
});
|
|
@@ -845,21 +865,21 @@ var diodePins = lrPolarPins;
|
|
|
845
865
|
expectTypesMatch(true);
|
|
846
866
|
|
|
847
867
|
// lib/components/led.ts
|
|
848
|
-
import { z as
|
|
868
|
+
import { z as z47 } from "zod";
|
|
849
869
|
var ledProps = commonComponentProps.extend({
|
|
850
|
-
color:
|
|
870
|
+
color: z47.string().optional()
|
|
851
871
|
});
|
|
852
872
|
var ledPins = lrPolarPins;
|
|
853
873
|
|
|
854
874
|
// lib/components/switch.ts
|
|
855
|
-
import { z as
|
|
875
|
+
import { z as z48 } from "zod";
|
|
856
876
|
var switchProps = commonComponentProps.extend({
|
|
857
|
-
type:
|
|
858
|
-
isNormallyClosed:
|
|
859
|
-
spst:
|
|
860
|
-
spdt:
|
|
861
|
-
dpst:
|
|
862
|
-
dpdt:
|
|
877
|
+
type: z48.enum(["spst", "spdt", "dpst", "dpdt"]).optional(),
|
|
878
|
+
isNormallyClosed: z48.boolean().optional().default(false),
|
|
879
|
+
spst: z48.boolean().optional(),
|
|
880
|
+
spdt: z48.boolean().optional(),
|
|
881
|
+
dpst: z48.boolean().optional(),
|
|
882
|
+
dpdt: z48.boolean().optional()
|
|
863
883
|
}).transform((props) => {
|
|
864
884
|
const updatedProps = { ...props };
|
|
865
885
|
if (updatedProps.dpdt) {
|
|
@@ -891,31 +911,31 @@ expectTypesMatch(true);
|
|
|
891
911
|
|
|
892
912
|
// lib/components/fabrication-note-text.ts
|
|
893
913
|
import { length as length3 } from "circuit-json";
|
|
894
|
-
import { z as
|
|
914
|
+
import { z as z49 } from "zod";
|
|
895
915
|
var fabricationNoteTextProps = pcbLayoutProps.extend({
|
|
896
|
-
text:
|
|
897
|
-
anchorAlignment:
|
|
898
|
-
font:
|
|
916
|
+
text: z49.string(),
|
|
917
|
+
anchorAlignment: z49.enum(["center", "top_left", "top_right", "bottom_left", "bottom_right"]).default("center"),
|
|
918
|
+
font: z49.enum(["tscircuit2024"]).optional(),
|
|
899
919
|
fontSize: length3.optional(),
|
|
900
|
-
color:
|
|
920
|
+
color: z49.string().optional()
|
|
901
921
|
});
|
|
902
922
|
|
|
903
923
|
// lib/components/fabrication-note-path.ts
|
|
904
924
|
import { length as length4, route_hint_point as route_hint_point4 } from "circuit-json";
|
|
905
|
-
import { z as
|
|
925
|
+
import { z as z50 } from "zod";
|
|
906
926
|
var fabricationNotePathProps = pcbLayoutProps.omit({ pcbX: true, pcbY: true, pcbRotation: true }).extend({
|
|
907
|
-
route:
|
|
927
|
+
route: z50.array(route_hint_point4),
|
|
908
928
|
strokeWidth: length4.optional(),
|
|
909
|
-
color:
|
|
929
|
+
color: z50.string().optional()
|
|
910
930
|
});
|
|
911
931
|
|
|
912
932
|
// lib/components/pcb-trace.ts
|
|
913
933
|
import { distance as distance13, route_hint_point as route_hint_point5 } from "circuit-json";
|
|
914
|
-
import { z as
|
|
915
|
-
var pcbTraceProps =
|
|
916
|
-
layer:
|
|
934
|
+
import { z as z51 } from "zod";
|
|
935
|
+
var pcbTraceProps = z51.object({
|
|
936
|
+
layer: z51.string().optional(),
|
|
917
937
|
thickness: distance13.optional(),
|
|
918
|
-
route:
|
|
938
|
+
route: z51.array(route_hint_point5)
|
|
919
939
|
});
|
|
920
940
|
|
|
921
941
|
// lib/components/via.ts
|
|
@@ -929,14 +949,14 @@ var viaProps = commonLayoutProps.extend({
|
|
|
929
949
|
|
|
930
950
|
// lib/components/pcb-keepout.ts
|
|
931
951
|
import { distance as distance15 } from "circuit-json";
|
|
932
|
-
import { z as
|
|
933
|
-
var pcbKeepoutProps =
|
|
952
|
+
import { z as z52 } from "zod";
|
|
953
|
+
var pcbKeepoutProps = z52.union([
|
|
934
954
|
pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
935
|
-
shape:
|
|
955
|
+
shape: z52.literal("circle"),
|
|
936
956
|
radius: distance15
|
|
937
957
|
}),
|
|
938
958
|
pcbLayoutProps.extend({
|
|
939
|
-
shape:
|
|
959
|
+
shape: z52.literal("rect"),
|
|
940
960
|
width: distance15,
|
|
941
961
|
height: distance15
|
|
942
962
|
})
|
|
@@ -950,8 +970,8 @@ var powerSourceProps = commonComponentProps.extend({
|
|
|
950
970
|
|
|
951
971
|
// lib/components/schematic-box.ts
|
|
952
972
|
import { distance as distance16 } from "circuit-json";
|
|
953
|
-
import { z as
|
|
954
|
-
var schematicBoxProps =
|
|
973
|
+
import { z as z53 } from "zod";
|
|
974
|
+
var schematicBoxProps = z53.object({
|
|
955
975
|
schX: distance16,
|
|
956
976
|
schY: distance16,
|
|
957
977
|
width: distance16,
|
|
@@ -960,8 +980,8 @@ var schematicBoxProps = z52.object({
|
|
|
960
980
|
|
|
961
981
|
// lib/components/schematic-line.ts
|
|
962
982
|
import { distance as distance17 } from "circuit-json";
|
|
963
|
-
import { z as
|
|
964
|
-
var schematicLineProps =
|
|
983
|
+
import { z as z54 } from "zod";
|
|
984
|
+
var schematicLineProps = z54.object({
|
|
965
985
|
x1: distance17,
|
|
966
986
|
y1: distance17,
|
|
967
987
|
x2: distance17,
|
|
@@ -970,37 +990,37 @@ var schematicLineProps = z53.object({
|
|
|
970
990
|
|
|
971
991
|
// lib/components/schematic-text.ts
|
|
972
992
|
import { distance as distance18 } from "circuit-json";
|
|
973
|
-
import { z as
|
|
974
|
-
var schematicTextProps =
|
|
993
|
+
import { z as z55 } from "zod";
|
|
994
|
+
var schematicTextProps = z55.object({
|
|
975
995
|
schX: distance18,
|
|
976
996
|
schY: distance18,
|
|
977
|
-
text:
|
|
997
|
+
text: z55.string()
|
|
978
998
|
});
|
|
979
999
|
|
|
980
1000
|
// lib/components/schematic-path.ts
|
|
981
1001
|
import { point as point5 } from "circuit-json";
|
|
982
|
-
import { z as
|
|
983
|
-
var schematicPathProps =
|
|
984
|
-
points:
|
|
985
|
-
isFilled:
|
|
986
|
-
fillColor:
|
|
1002
|
+
import { z as z56 } from "zod";
|
|
1003
|
+
var schematicPathProps = z56.object({
|
|
1004
|
+
points: z56.array(point5),
|
|
1005
|
+
isFilled: z56.boolean().optional().default(false),
|
|
1006
|
+
fillColor: z56.enum(["red", "blue"]).optional()
|
|
987
1007
|
});
|
|
988
1008
|
|
|
989
1009
|
// lib/components/silkscreen-text.ts
|
|
990
1010
|
import { length as length5 } from "circuit-json";
|
|
991
|
-
import { z as
|
|
1011
|
+
import { z as z57 } from "zod";
|
|
992
1012
|
var silkscreenTextProps = pcbLayoutProps.extend({
|
|
993
|
-
text:
|
|
994
|
-
anchorAlignment:
|
|
995
|
-
font:
|
|
1013
|
+
text: z57.string(),
|
|
1014
|
+
anchorAlignment: z57.enum(["center", "top_left", "top_right", "bottom_left", "bottom_right"]).default("center"),
|
|
1015
|
+
font: z57.enum(["tscircuit2024"]).optional(),
|
|
996
1016
|
fontSize: length5.optional()
|
|
997
1017
|
});
|
|
998
1018
|
|
|
999
1019
|
// lib/components/silkscreen-path.ts
|
|
1000
1020
|
import { length as length6, route_hint_point as route_hint_point6 } from "circuit-json";
|
|
1001
|
-
import { z as
|
|
1021
|
+
import { z as z58 } from "zod";
|
|
1002
1022
|
var silkscreenPathProps = pcbLayoutProps.omit({ pcbX: true, pcbY: true, pcbRotation: true }).extend({
|
|
1003
|
-
route:
|
|
1023
|
+
route: z58.array(route_hint_point6),
|
|
1004
1024
|
strokeWidth: length6.optional()
|
|
1005
1025
|
});
|
|
1006
1026
|
|
|
@@ -1016,10 +1036,10 @@ var silkscreenLineProps = pcbLayoutProps.omit({ pcbX: true, pcbY: true, pcbRotat
|
|
|
1016
1036
|
|
|
1017
1037
|
// lib/components/silkscreen-rect.ts
|
|
1018
1038
|
import { distance as distance20 } from "circuit-json";
|
|
1019
|
-
import { z as
|
|
1039
|
+
import { z as z59 } from "zod";
|
|
1020
1040
|
var silkscreenRectProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
1021
|
-
isFilled:
|
|
1022
|
-
isOutline:
|
|
1041
|
+
isFilled: z59.boolean().optional(),
|
|
1042
|
+
isOutline: z59.boolean().optional(),
|
|
1023
1043
|
strokeWidth: distance20.optional(),
|
|
1024
1044
|
width: distance20,
|
|
1025
1045
|
height: distance20
|
|
@@ -1027,49 +1047,49 @@ var silkscreenRectProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
|
1027
1047
|
|
|
1028
1048
|
// lib/components/silkscreen-circle.ts
|
|
1029
1049
|
import { distance as distance21 } from "circuit-json";
|
|
1030
|
-
import { z as
|
|
1050
|
+
import { z as z60 } from "zod";
|
|
1031
1051
|
var silkscreenCircleProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
1032
|
-
isFilled:
|
|
1033
|
-
isOutline:
|
|
1052
|
+
isFilled: z60.boolean().optional(),
|
|
1053
|
+
isOutline: z60.boolean().optional(),
|
|
1034
1054
|
strokeWidth: distance21.optional(),
|
|
1035
1055
|
radius: distance21
|
|
1036
1056
|
});
|
|
1037
1057
|
|
|
1038
1058
|
// lib/components/trace-hint.ts
|
|
1039
1059
|
import { distance as distance22, layer_ref as layer_ref6, route_hint_point as route_hint_point7 } from "circuit-json";
|
|
1040
|
-
import { z as
|
|
1041
|
-
var routeHintPointProps =
|
|
1060
|
+
import { z as z61 } from "zod";
|
|
1061
|
+
var routeHintPointProps = z61.object({
|
|
1042
1062
|
x: distance22,
|
|
1043
1063
|
y: distance22,
|
|
1044
|
-
via:
|
|
1064
|
+
via: z61.boolean().optional(),
|
|
1045
1065
|
toLayer: layer_ref6.optional()
|
|
1046
1066
|
});
|
|
1047
|
-
var traceHintProps =
|
|
1048
|
-
for:
|
|
1067
|
+
var traceHintProps = z61.object({
|
|
1068
|
+
for: z61.string().optional().describe(
|
|
1049
1069
|
"Selector for the port you're targeting, not required if you're inside a trace"
|
|
1050
1070
|
),
|
|
1051
|
-
order:
|
|
1071
|
+
order: z61.number().optional(),
|
|
1052
1072
|
offset: route_hint_point7.or(routeHintPointProps).optional(),
|
|
1053
|
-
offsets:
|
|
1054
|
-
traceWidth:
|
|
1073
|
+
offsets: z61.array(route_hint_point7).or(z61.array(routeHintPointProps)).optional(),
|
|
1074
|
+
traceWidth: z61.number().optional()
|
|
1055
1075
|
});
|
|
1056
1076
|
|
|
1057
1077
|
// lib/components/port.ts
|
|
1058
|
-
import { z as
|
|
1078
|
+
import { z as z62 } from "zod";
|
|
1059
1079
|
var portProps = commonLayoutProps.extend({
|
|
1060
|
-
name:
|
|
1061
|
-
pinNumber:
|
|
1062
|
-
aliases:
|
|
1080
|
+
name: z62.string(),
|
|
1081
|
+
pinNumber: z62.number().optional(),
|
|
1082
|
+
aliases: z62.array(z62.string()).optional(),
|
|
1063
1083
|
direction
|
|
1064
1084
|
});
|
|
1065
1085
|
|
|
1066
1086
|
// lib/platformConfig.ts
|
|
1067
|
-
import { z as
|
|
1068
|
-
var platformConfig =
|
|
1087
|
+
import { z as z63 } from "zod";
|
|
1088
|
+
var platformConfig = z63.object({
|
|
1069
1089
|
partsEngine: partsEngine.optional(),
|
|
1070
1090
|
autorouter: autorouterProp.optional(),
|
|
1071
|
-
registryApiUrl:
|
|
1072
|
-
cloudAutorouterUrl:
|
|
1091
|
+
registryApiUrl: z63.string().optional(),
|
|
1092
|
+
cloudAutorouterUrl: z63.string().optional()
|
|
1073
1093
|
});
|
|
1074
1094
|
expectTypesMatch(true);
|
|
1075
1095
|
export {
|
|
@@ -1086,6 +1106,7 @@ export {
|
|
|
1086
1106
|
cadModelObj,
|
|
1087
1107
|
cadModelProp,
|
|
1088
1108
|
cadModelStl,
|
|
1109
|
+
capacitorPinLabels,
|
|
1089
1110
|
capacitorPins,
|
|
1090
1111
|
capacitorProps,
|
|
1091
1112
|
chipProps,
|
|
@@ -1153,6 +1174,7 @@ export {
|
|
|
1153
1174
|
pushButtonProps,
|
|
1154
1175
|
rectSmtPadProps,
|
|
1155
1176
|
rectSolderPasteProps,
|
|
1177
|
+
resistorPinLabels,
|
|
1156
1178
|
resistorPins,
|
|
1157
1179
|
resistorProps,
|
|
1158
1180
|
resonatorProps,
|