@tscircuit/props 0.0.183 → 0.0.185
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 +56 -0
- package/dist/index.d.ts +237 -4
- package/dist/index.js +169 -129
- package/dist/index.js.map +1 -1
- package/lib/components/cutout.ts +77 -0
- package/lib/components/silkscreen-text.ts +2 -3
- package/lib/index.ts +1 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -673,38 +673,74 @@ var constraintProps = z36.union([
|
|
|
673
673
|
]);
|
|
674
674
|
expectTypesMatch(true);
|
|
675
675
|
|
|
676
|
-
// lib/components/
|
|
676
|
+
// lib/components/cutout.ts
|
|
677
677
|
import { z as z37 } from "zod";
|
|
678
|
-
var
|
|
678
|
+
var rectCutoutProps = pcbLayoutProps.omit({
|
|
679
|
+
layer: true,
|
|
680
|
+
pcbRotation: true
|
|
681
|
+
}).extend({
|
|
682
|
+
name: z37.string().optional(),
|
|
679
683
|
shape: z37.literal("rect"),
|
|
680
684
|
width: distance10,
|
|
685
|
+
height: distance10
|
|
686
|
+
});
|
|
687
|
+
expectTypesMatch(true);
|
|
688
|
+
var circleCutoutProps = pcbLayoutProps.omit({
|
|
689
|
+
layer: true,
|
|
690
|
+
pcbRotation: true
|
|
691
|
+
}).extend({
|
|
692
|
+
name: z37.string().optional(),
|
|
693
|
+
shape: z37.literal("circle"),
|
|
694
|
+
radius: distance10
|
|
695
|
+
});
|
|
696
|
+
expectTypesMatch(true);
|
|
697
|
+
var polygonCutoutProps = pcbLayoutProps.omit({
|
|
698
|
+
layer: true,
|
|
699
|
+
pcbRotation: true
|
|
700
|
+
}).extend({
|
|
701
|
+
name: z37.string().optional(),
|
|
702
|
+
shape: z37.literal("polygon"),
|
|
703
|
+
points: z37.array(point)
|
|
704
|
+
});
|
|
705
|
+
expectTypesMatch(true);
|
|
706
|
+
var cutoutProps = z37.discriminatedUnion("shape", [
|
|
707
|
+
rectCutoutProps,
|
|
708
|
+
circleCutoutProps,
|
|
709
|
+
polygonCutoutProps
|
|
710
|
+
]);
|
|
711
|
+
|
|
712
|
+
// lib/components/smtpad.ts
|
|
713
|
+
import { z as z38 } from "zod";
|
|
714
|
+
var rectSmtPadProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
715
|
+
shape: z38.literal("rect"),
|
|
716
|
+
width: distance10,
|
|
681
717
|
height: distance10,
|
|
682
718
|
portHints: portHints.optional()
|
|
683
719
|
});
|
|
684
720
|
expectTypesMatch(true);
|
|
685
721
|
var rotatedRectSmtPadProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
686
|
-
shape:
|
|
722
|
+
shape: z38.literal("rotated_rect"),
|
|
687
723
|
width: distance10,
|
|
688
724
|
height: distance10,
|
|
689
|
-
ccwRotation:
|
|
725
|
+
ccwRotation: z38.number(),
|
|
690
726
|
portHints: portHints.optional()
|
|
691
727
|
});
|
|
692
728
|
expectTypesMatch(true);
|
|
693
729
|
var circleSmtPadProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
694
|
-
shape:
|
|
730
|
+
shape: z38.literal("circle"),
|
|
695
731
|
radius: distance10,
|
|
696
732
|
portHints: portHints.optional()
|
|
697
733
|
});
|
|
698
734
|
expectTypesMatch(true);
|
|
699
735
|
var pillSmtPadProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
700
|
-
shape:
|
|
736
|
+
shape: z38.literal("pill"),
|
|
701
737
|
width: distance10,
|
|
702
738
|
height: distance10,
|
|
703
739
|
radius: distance10,
|
|
704
740
|
portHints: portHints.optional()
|
|
705
741
|
});
|
|
706
742
|
expectTypesMatch(true);
|
|
707
|
-
var smtPadProps =
|
|
743
|
+
var smtPadProps = z38.union([
|
|
708
744
|
circleSmtPadProps,
|
|
709
745
|
rectSmtPadProps,
|
|
710
746
|
rotatedRectSmtPadProps,
|
|
@@ -713,28 +749,28 @@ var smtPadProps = z37.union([
|
|
|
713
749
|
expectTypesMatch(true);
|
|
714
750
|
|
|
715
751
|
// lib/components/solderpaste.ts
|
|
716
|
-
import { z as
|
|
752
|
+
import { z as z39 } from "zod";
|
|
717
753
|
var rectSolderPasteProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
718
|
-
shape:
|
|
754
|
+
shape: z39.literal("rect"),
|
|
719
755
|
width: distance10,
|
|
720
756
|
height: distance10
|
|
721
757
|
});
|
|
722
758
|
expectTypesMatch(true);
|
|
723
759
|
var circleSolderPasteProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
724
|
-
shape:
|
|
760
|
+
shape: z39.literal("circle"),
|
|
725
761
|
radius: distance10
|
|
726
762
|
});
|
|
727
763
|
expectTypesMatch(true);
|
|
728
|
-
var solderPasteProps =
|
|
764
|
+
var solderPasteProps = z39.union([
|
|
729
765
|
circleSolderPasteProps,
|
|
730
766
|
rectSolderPasteProps
|
|
731
767
|
]);
|
|
732
768
|
expectTypesMatch(true);
|
|
733
769
|
|
|
734
770
|
// lib/components/hole.ts
|
|
735
|
-
import { z as
|
|
771
|
+
import { z as z40 } from "zod";
|
|
736
772
|
var holeProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
737
|
-
name:
|
|
773
|
+
name: z40.string().optional(),
|
|
738
774
|
diameter: distance10.optional(),
|
|
739
775
|
radius: distance10.optional()
|
|
740
776
|
}).transform((d) => ({
|
|
@@ -746,24 +782,24 @@ expectTypesMatch(true);
|
|
|
746
782
|
|
|
747
783
|
// lib/components/trace.ts
|
|
748
784
|
import { distance as distance11, route_hint_point as route_hint_point2 } from "circuit-json";
|
|
749
|
-
import { z as
|
|
750
|
-
var portRef =
|
|
751
|
-
|
|
752
|
-
|
|
785
|
+
import { z as z41 } from "zod";
|
|
786
|
+
var portRef = z41.union([
|
|
787
|
+
z41.string(),
|
|
788
|
+
z41.custom(
|
|
753
789
|
(v) => Boolean(v.getPortSelector)
|
|
754
790
|
)
|
|
755
791
|
]);
|
|
756
|
-
var baseTraceProps =
|
|
757
|
-
key:
|
|
792
|
+
var baseTraceProps = z41.object({
|
|
793
|
+
key: z41.string().optional(),
|
|
758
794
|
thickness: distance11.optional(),
|
|
759
|
-
schematicRouteHints:
|
|
760
|
-
pcbRouteHints:
|
|
761
|
-
schDisplayLabel:
|
|
795
|
+
schematicRouteHints: z41.array(point).optional(),
|
|
796
|
+
pcbRouteHints: z41.array(route_hint_point2).optional(),
|
|
797
|
+
schDisplayLabel: z41.string().optional(),
|
|
762
798
|
maxLength: distance11.optional()
|
|
763
799
|
});
|
|
764
|
-
var traceProps =
|
|
800
|
+
var traceProps = z41.union([
|
|
765
801
|
baseTraceProps.extend({
|
|
766
|
-
path:
|
|
802
|
+
path: z41.array(portRef)
|
|
767
803
|
}),
|
|
768
804
|
baseTraceProps.extend({
|
|
769
805
|
from: portRef,
|
|
@@ -773,15 +809,15 @@ var traceProps = z40.union([
|
|
|
773
809
|
|
|
774
810
|
// lib/components/footprint.ts
|
|
775
811
|
import { layer_ref as layer_ref4 } from "circuit-json";
|
|
776
|
-
import { z as
|
|
777
|
-
var footprintProps =
|
|
812
|
+
import { z as z42 } from "zod";
|
|
813
|
+
var footprintProps = z42.object({
|
|
778
814
|
originalLayer: layer_ref4.default("top").optional()
|
|
779
815
|
});
|
|
780
816
|
expectTypesMatch(true);
|
|
781
817
|
|
|
782
818
|
// lib/components/battery.ts
|
|
783
|
-
import { z as
|
|
784
|
-
var capacity =
|
|
819
|
+
import { z as z43 } from "zod";
|
|
820
|
+
var capacity = z43.number().or(z43.string().endsWith("mAh")).transform((v) => {
|
|
785
821
|
if (typeof v === "string") {
|
|
786
822
|
const valString = v.replace("mAh", "");
|
|
787
823
|
const num = Number.parseFloat(valString);
|
|
@@ -800,30 +836,30 @@ expectTypesMatch(true);
|
|
|
800
836
|
|
|
801
837
|
// lib/components/pin-header.ts
|
|
802
838
|
import { distance as distance12 } from "circuit-json";
|
|
803
|
-
import { z as
|
|
839
|
+
import { z as z44 } from "zod";
|
|
804
840
|
var pinHeaderProps = commonComponentProps.extend({
|
|
805
|
-
pinCount:
|
|
841
|
+
pinCount: z44.number(),
|
|
806
842
|
pitch: distance12.optional(),
|
|
807
|
-
schFacingDirection:
|
|
808
|
-
gender:
|
|
809
|
-
showSilkscreenPinLabels:
|
|
810
|
-
doubleRow:
|
|
843
|
+
schFacingDirection: z44.enum(["up", "down", "left", "right"]).optional(),
|
|
844
|
+
gender: z44.enum(["male", "female"]).optional().default("male"),
|
|
845
|
+
showSilkscreenPinLabels: z44.boolean().optional(),
|
|
846
|
+
doubleRow: z44.boolean().optional(),
|
|
811
847
|
holeDiameter: distance12.optional(),
|
|
812
848
|
platedDiameter: distance12.optional(),
|
|
813
|
-
pinLabels:
|
|
814
|
-
facingDirection:
|
|
849
|
+
pinLabels: z44.array(z44.string()).optional(),
|
|
850
|
+
facingDirection: z44.enum(["left", "right"]).optional()
|
|
815
851
|
});
|
|
816
852
|
expectTypesMatch(true);
|
|
817
853
|
|
|
818
854
|
// lib/components/netalias.ts
|
|
819
|
-
import { z as
|
|
855
|
+
import { z as z45 } from "zod";
|
|
820
856
|
import { rotation as rotation2 } from "circuit-json";
|
|
821
|
-
var netAliasProps =
|
|
822
|
-
net:
|
|
857
|
+
var netAliasProps = z45.object({
|
|
858
|
+
net: z45.string().optional(),
|
|
823
859
|
schX: distance10.optional(),
|
|
824
860
|
schY: distance10.optional(),
|
|
825
861
|
schRotation: rotation2.optional(),
|
|
826
|
-
anchorSide:
|
|
862
|
+
anchorSide: z45.enum(["left", "up", "right", "down"]).optional()
|
|
827
863
|
});
|
|
828
864
|
expectTypesMatch(true);
|
|
829
865
|
|
|
@@ -837,9 +873,9 @@ var subcircuitProps = subcircuitGroupProps;
|
|
|
837
873
|
expectTypesMatch(true);
|
|
838
874
|
|
|
839
875
|
// lib/components/transistor.ts
|
|
840
|
-
import { z as
|
|
876
|
+
import { z as z47 } from "zod";
|
|
841
877
|
var transistorProps = commonComponentProps.extend({
|
|
842
|
-
type:
|
|
878
|
+
type: z47.enum(["npn", "pnp", "bjt", "jfet", "mosfet"])
|
|
843
879
|
});
|
|
844
880
|
var transistorPins = [
|
|
845
881
|
"pin1",
|
|
@@ -852,10 +888,10 @@ var transistorPins = [
|
|
|
852
888
|
expectTypesMatch(true);
|
|
853
889
|
|
|
854
890
|
// lib/components/mosfet.ts
|
|
855
|
-
import { z as
|
|
891
|
+
import { z as z48 } from "zod";
|
|
856
892
|
var mosfetProps = commonComponentProps.extend({
|
|
857
|
-
channelType:
|
|
858
|
-
mosfetMode:
|
|
893
|
+
channelType: z48.enum(["n", "p"]),
|
|
894
|
+
mosfetMode: z48.enum(["enhancement", "depletion"])
|
|
859
895
|
});
|
|
860
896
|
var mosfetPins = [
|
|
861
897
|
"pin1",
|
|
@@ -875,8 +911,8 @@ var inductorProps = commonComponentProps.extend({
|
|
|
875
911
|
var inductorPins = lrPins;
|
|
876
912
|
|
|
877
913
|
// lib/components/diode.ts
|
|
878
|
-
import { z as
|
|
879
|
-
var diodeConnectionKeys =
|
|
914
|
+
import { z as z49 } from "zod";
|
|
915
|
+
var diodeConnectionKeys = z49.enum([
|
|
880
916
|
"anode",
|
|
881
917
|
"cathode",
|
|
882
918
|
"pin1",
|
|
@@ -884,17 +920,17 @@ var diodeConnectionKeys = z48.enum([
|
|
|
884
920
|
"pos",
|
|
885
921
|
"neg"
|
|
886
922
|
]);
|
|
887
|
-
var connectionTarget3 =
|
|
888
|
-
var connectionsProp2 =
|
|
889
|
-
var diodeVariant =
|
|
923
|
+
var connectionTarget3 = z49.string().or(z49.array(z49.string()).readonly()).or(z49.array(z49.string()));
|
|
924
|
+
var connectionsProp2 = z49.record(diodeConnectionKeys, connectionTarget3);
|
|
925
|
+
var diodeVariant = z49.enum(["standard", "schottky", "zener", "photo", "tvs"]);
|
|
890
926
|
var diodeProps = commonComponentProps.extend({
|
|
891
927
|
connections: connectionsProp2.optional(),
|
|
892
928
|
variant: diodeVariant.optional().default("standard"),
|
|
893
|
-
standard:
|
|
894
|
-
schottky:
|
|
895
|
-
zener:
|
|
896
|
-
photo:
|
|
897
|
-
tvs:
|
|
929
|
+
standard: z49.boolean().optional(),
|
|
930
|
+
schottky: z49.boolean().optional(),
|
|
931
|
+
zener: z49.boolean().optional(),
|
|
932
|
+
photo: z49.boolean().optional(),
|
|
933
|
+
tvs: z49.boolean().optional()
|
|
898
934
|
}).superRefine((data, ctx) => {
|
|
899
935
|
const enabledFlags = [
|
|
900
936
|
data.standard,
|
|
@@ -905,11 +941,11 @@ var diodeProps = commonComponentProps.extend({
|
|
|
905
941
|
].filter(Boolean).length;
|
|
906
942
|
if (enabledFlags > 1) {
|
|
907
943
|
ctx.addIssue({
|
|
908
|
-
code:
|
|
944
|
+
code: z49.ZodIssueCode.custom,
|
|
909
945
|
message: "Exactly one diode variant must be enabled",
|
|
910
946
|
path: []
|
|
911
947
|
});
|
|
912
|
-
return
|
|
948
|
+
return z49.INVALID;
|
|
913
949
|
}
|
|
914
950
|
}).transform((data) => {
|
|
915
951
|
const result = {
|
|
@@ -957,21 +993,21 @@ var diodePins = lrPolarPins;
|
|
|
957
993
|
expectTypesMatch(true);
|
|
958
994
|
|
|
959
995
|
// lib/components/led.ts
|
|
960
|
-
import { z as
|
|
996
|
+
import { z as z50 } from "zod";
|
|
961
997
|
var ledProps = commonComponentProps.extend({
|
|
962
|
-
color:
|
|
998
|
+
color: z50.string().optional()
|
|
963
999
|
});
|
|
964
1000
|
var ledPins = lrPolarPins;
|
|
965
1001
|
|
|
966
1002
|
// lib/components/switch.ts
|
|
967
|
-
import { z as
|
|
1003
|
+
import { z as z51 } from "zod";
|
|
968
1004
|
var switchProps = commonComponentProps.extend({
|
|
969
|
-
type:
|
|
970
|
-
isNormallyClosed:
|
|
971
|
-
spst:
|
|
972
|
-
spdt:
|
|
973
|
-
dpst:
|
|
974
|
-
dpdt:
|
|
1005
|
+
type: z51.enum(["spst", "spdt", "dpst", "dpdt"]).optional(),
|
|
1006
|
+
isNormallyClosed: z51.boolean().optional().default(false),
|
|
1007
|
+
spst: z51.boolean().optional(),
|
|
1008
|
+
spdt: z51.boolean().optional(),
|
|
1009
|
+
dpst: z51.boolean().optional(),
|
|
1010
|
+
dpdt: z51.boolean().optional()
|
|
975
1011
|
}).transform((props) => {
|
|
976
1012
|
const updatedProps = { ...props };
|
|
977
1013
|
if (updatedProps.dpdt) {
|
|
@@ -1003,31 +1039,31 @@ expectTypesMatch(true);
|
|
|
1003
1039
|
|
|
1004
1040
|
// lib/components/fabrication-note-text.ts
|
|
1005
1041
|
import { length as length3 } from "circuit-json";
|
|
1006
|
-
import { z as
|
|
1042
|
+
import { z as z52 } from "zod";
|
|
1007
1043
|
var fabricationNoteTextProps = pcbLayoutProps.extend({
|
|
1008
|
-
text:
|
|
1009
|
-
anchorAlignment:
|
|
1010
|
-
font:
|
|
1044
|
+
text: z52.string(),
|
|
1045
|
+
anchorAlignment: z52.enum(["center", "top_left", "top_right", "bottom_left", "bottom_right"]).default("center"),
|
|
1046
|
+
font: z52.enum(["tscircuit2024"]).optional(),
|
|
1011
1047
|
fontSize: length3.optional(),
|
|
1012
|
-
color:
|
|
1048
|
+
color: z52.string().optional()
|
|
1013
1049
|
});
|
|
1014
1050
|
|
|
1015
1051
|
// lib/components/fabrication-note-path.ts
|
|
1016
1052
|
import { length as length4, route_hint_point as route_hint_point3 } from "circuit-json";
|
|
1017
|
-
import { z as
|
|
1053
|
+
import { z as z53 } from "zod";
|
|
1018
1054
|
var fabricationNotePathProps = pcbLayoutProps.omit({ pcbX: true, pcbY: true, pcbRotation: true }).extend({
|
|
1019
|
-
route:
|
|
1055
|
+
route: z53.array(route_hint_point3),
|
|
1020
1056
|
strokeWidth: length4.optional(),
|
|
1021
|
-
color:
|
|
1057
|
+
color: z53.string().optional()
|
|
1022
1058
|
});
|
|
1023
1059
|
|
|
1024
1060
|
// lib/components/pcb-trace.ts
|
|
1025
1061
|
import { distance as distance13, route_hint_point as route_hint_point4 } from "circuit-json";
|
|
1026
|
-
import { z as
|
|
1027
|
-
var pcbTraceProps =
|
|
1028
|
-
layer:
|
|
1062
|
+
import { z as z54 } from "zod";
|
|
1063
|
+
var pcbTraceProps = z54.object({
|
|
1064
|
+
layer: z54.string().optional(),
|
|
1029
1065
|
thickness: distance13.optional(),
|
|
1030
|
-
route:
|
|
1066
|
+
route: z54.array(route_hint_point4)
|
|
1031
1067
|
});
|
|
1032
1068
|
|
|
1033
1069
|
// lib/components/via.ts
|
|
@@ -1041,14 +1077,14 @@ var viaProps = commonLayoutProps.extend({
|
|
|
1041
1077
|
|
|
1042
1078
|
// lib/components/pcb-keepout.ts
|
|
1043
1079
|
import { distance as distance15 } from "circuit-json";
|
|
1044
|
-
import { z as
|
|
1045
|
-
var pcbKeepoutProps =
|
|
1080
|
+
import { z as z55 } from "zod";
|
|
1081
|
+
var pcbKeepoutProps = z55.union([
|
|
1046
1082
|
pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
1047
|
-
shape:
|
|
1083
|
+
shape: z55.literal("circle"),
|
|
1048
1084
|
radius: distance15
|
|
1049
1085
|
}),
|
|
1050
1086
|
pcbLayoutProps.extend({
|
|
1051
|
-
shape:
|
|
1087
|
+
shape: z55.literal("rect"),
|
|
1052
1088
|
width: distance15,
|
|
1053
1089
|
height: distance15
|
|
1054
1090
|
})
|
|
@@ -1062,8 +1098,8 @@ var powerSourceProps = commonComponentProps.extend({
|
|
|
1062
1098
|
|
|
1063
1099
|
// lib/components/schematic-box.ts
|
|
1064
1100
|
import { distance as distance16 } from "circuit-json";
|
|
1065
|
-
import { z as
|
|
1066
|
-
var schematicBoxProps =
|
|
1101
|
+
import { z as z56 } from "zod";
|
|
1102
|
+
var schematicBoxProps = z56.object({
|
|
1067
1103
|
schX: distance16,
|
|
1068
1104
|
schY: distance16,
|
|
1069
1105
|
width: distance16,
|
|
@@ -1072,8 +1108,8 @@ var schematicBoxProps = z55.object({
|
|
|
1072
1108
|
|
|
1073
1109
|
// lib/components/schematic-line.ts
|
|
1074
1110
|
import { distance as distance17 } from "circuit-json";
|
|
1075
|
-
import { z as
|
|
1076
|
-
var schematicLineProps =
|
|
1111
|
+
import { z as z57 } from "zod";
|
|
1112
|
+
var schematicLineProps = z57.object({
|
|
1077
1113
|
x1: distance17,
|
|
1078
1114
|
y1: distance17,
|
|
1079
1115
|
x2: distance17,
|
|
@@ -1082,11 +1118,11 @@ var schematicLineProps = z56.object({
|
|
|
1082
1118
|
|
|
1083
1119
|
// lib/components/schematic-text.ts
|
|
1084
1120
|
import { distance as distance18, rotation as rotation3 } from "circuit-json";
|
|
1085
|
-
import { z as
|
|
1121
|
+
import { z as z60 } from "zod";
|
|
1086
1122
|
|
|
1087
1123
|
// lib/common/nine_point_anchor.ts
|
|
1088
|
-
import { z as
|
|
1089
|
-
var nine_point_anchor =
|
|
1124
|
+
import { z as z58 } from "zod";
|
|
1125
|
+
var nine_point_anchor = z58.enum([
|
|
1090
1126
|
"top_left",
|
|
1091
1127
|
"top_center",
|
|
1092
1128
|
"top_right",
|
|
@@ -1099,8 +1135,8 @@ var nine_point_anchor = z57.enum([
|
|
|
1099
1135
|
]);
|
|
1100
1136
|
|
|
1101
1137
|
// lib/common/five_point_anchor.ts
|
|
1102
|
-
import { z as
|
|
1103
|
-
var five_point_anchor =
|
|
1138
|
+
import { z as z59 } from "zod";
|
|
1139
|
+
var five_point_anchor = z59.enum([
|
|
1104
1140
|
"center",
|
|
1105
1141
|
"left",
|
|
1106
1142
|
"right",
|
|
@@ -1109,40 +1145,40 @@ var five_point_anchor = z58.enum([
|
|
|
1109
1145
|
]);
|
|
1110
1146
|
|
|
1111
1147
|
// lib/components/schematic-text.ts
|
|
1112
|
-
var schematicTextProps =
|
|
1148
|
+
var schematicTextProps = z60.object({
|
|
1113
1149
|
schX: distance18,
|
|
1114
1150
|
schY: distance18,
|
|
1115
|
-
text:
|
|
1116
|
-
fontSize:
|
|
1117
|
-
anchor:
|
|
1118
|
-
color:
|
|
1151
|
+
text: z60.string(),
|
|
1152
|
+
fontSize: z60.number().default(1),
|
|
1153
|
+
anchor: z60.union([five_point_anchor.describe("legacy"), nine_point_anchor]).default("center"),
|
|
1154
|
+
color: z60.string().default("#000000"),
|
|
1119
1155
|
schRotation: rotation3.default(0)
|
|
1120
1156
|
});
|
|
1121
1157
|
|
|
1122
1158
|
// lib/components/schematic-path.ts
|
|
1123
1159
|
import { point as point5 } from "circuit-json";
|
|
1124
|
-
import { z as
|
|
1125
|
-
var schematicPathProps =
|
|
1126
|
-
points:
|
|
1127
|
-
isFilled:
|
|
1128
|
-
fillColor:
|
|
1160
|
+
import { z as z61 } from "zod";
|
|
1161
|
+
var schematicPathProps = z61.object({
|
|
1162
|
+
points: z61.array(point5),
|
|
1163
|
+
isFilled: z61.boolean().optional().default(false),
|
|
1164
|
+
fillColor: z61.enum(["red", "blue"]).optional()
|
|
1129
1165
|
});
|
|
1130
1166
|
|
|
1131
1167
|
// lib/components/silkscreen-text.ts
|
|
1132
1168
|
import { length as length5 } from "circuit-json";
|
|
1133
|
-
import { z as
|
|
1169
|
+
import { z as z62 } from "zod";
|
|
1134
1170
|
var silkscreenTextProps = pcbLayoutProps.extend({
|
|
1135
|
-
text:
|
|
1136
|
-
anchorAlignment:
|
|
1137
|
-
font:
|
|
1171
|
+
text: z62.string(),
|
|
1172
|
+
anchorAlignment: nine_point_anchor.default("center"),
|
|
1173
|
+
font: z62.enum(["tscircuit2024"]).optional(),
|
|
1138
1174
|
fontSize: length5.optional()
|
|
1139
1175
|
});
|
|
1140
1176
|
|
|
1141
1177
|
// lib/components/silkscreen-path.ts
|
|
1142
1178
|
import { length as length6, route_hint_point as route_hint_point5 } from "circuit-json";
|
|
1143
|
-
import { z as
|
|
1179
|
+
import { z as z63 } from "zod";
|
|
1144
1180
|
var silkscreenPathProps = pcbLayoutProps.omit({ pcbX: true, pcbY: true, pcbRotation: true }).extend({
|
|
1145
|
-
route:
|
|
1181
|
+
route: z63.array(route_hint_point5),
|
|
1146
1182
|
strokeWidth: length6.optional()
|
|
1147
1183
|
});
|
|
1148
1184
|
|
|
@@ -1158,10 +1194,10 @@ var silkscreenLineProps = pcbLayoutProps.omit({ pcbX: true, pcbY: true, pcbRotat
|
|
|
1158
1194
|
|
|
1159
1195
|
// lib/components/silkscreen-rect.ts
|
|
1160
1196
|
import { distance as distance20 } from "circuit-json";
|
|
1161
|
-
import { z as
|
|
1197
|
+
import { z as z64 } from "zod";
|
|
1162
1198
|
var silkscreenRectProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
1163
|
-
isFilled:
|
|
1164
|
-
isOutline:
|
|
1199
|
+
isFilled: z64.boolean().optional(),
|
|
1200
|
+
isOutline: z64.boolean().optional(),
|
|
1165
1201
|
strokeWidth: distance20.optional(),
|
|
1166
1202
|
width: distance20,
|
|
1167
1203
|
height: distance20
|
|
@@ -1169,49 +1205,49 @@ var silkscreenRectProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
|
1169
1205
|
|
|
1170
1206
|
// lib/components/silkscreen-circle.ts
|
|
1171
1207
|
import { distance as distance21 } from "circuit-json";
|
|
1172
|
-
import { z as
|
|
1208
|
+
import { z as z65 } from "zod";
|
|
1173
1209
|
var silkscreenCircleProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
1174
|
-
isFilled:
|
|
1175
|
-
isOutline:
|
|
1210
|
+
isFilled: z65.boolean().optional(),
|
|
1211
|
+
isOutline: z65.boolean().optional(),
|
|
1176
1212
|
strokeWidth: distance21.optional(),
|
|
1177
1213
|
radius: distance21
|
|
1178
1214
|
});
|
|
1179
1215
|
|
|
1180
1216
|
// lib/components/trace-hint.ts
|
|
1181
1217
|
import { distance as distance22, layer_ref as layer_ref6, route_hint_point as route_hint_point6 } from "circuit-json";
|
|
1182
|
-
import { z as
|
|
1183
|
-
var routeHintPointProps =
|
|
1218
|
+
import { z as z66 } from "zod";
|
|
1219
|
+
var routeHintPointProps = z66.object({
|
|
1184
1220
|
x: distance22,
|
|
1185
1221
|
y: distance22,
|
|
1186
|
-
via:
|
|
1222
|
+
via: z66.boolean().optional(),
|
|
1187
1223
|
toLayer: layer_ref6.optional()
|
|
1188
1224
|
});
|
|
1189
|
-
var traceHintProps =
|
|
1190
|
-
for:
|
|
1225
|
+
var traceHintProps = z66.object({
|
|
1226
|
+
for: z66.string().optional().describe(
|
|
1191
1227
|
"Selector for the port you're targeting, not required if you're inside a trace"
|
|
1192
1228
|
),
|
|
1193
|
-
order:
|
|
1229
|
+
order: z66.number().optional(),
|
|
1194
1230
|
offset: route_hint_point6.or(routeHintPointProps).optional(),
|
|
1195
|
-
offsets:
|
|
1196
|
-
traceWidth:
|
|
1231
|
+
offsets: z66.array(route_hint_point6).or(z66.array(routeHintPointProps)).optional(),
|
|
1232
|
+
traceWidth: z66.number().optional()
|
|
1197
1233
|
});
|
|
1198
1234
|
|
|
1199
1235
|
// lib/components/port.ts
|
|
1200
|
-
import { z as
|
|
1236
|
+
import { z as z67 } from "zod";
|
|
1201
1237
|
var portProps = commonLayoutProps.extend({
|
|
1202
|
-
name:
|
|
1203
|
-
pinNumber:
|
|
1204
|
-
aliases:
|
|
1238
|
+
name: z67.string(),
|
|
1239
|
+
pinNumber: z67.number().optional(),
|
|
1240
|
+
aliases: z67.array(z67.string()).optional(),
|
|
1205
1241
|
direction
|
|
1206
1242
|
});
|
|
1207
1243
|
|
|
1208
1244
|
// lib/platformConfig.ts
|
|
1209
|
-
import { z as
|
|
1210
|
-
var platformConfig =
|
|
1245
|
+
import { z as z68 } from "zod";
|
|
1246
|
+
var platformConfig = z68.object({
|
|
1211
1247
|
partsEngine: partsEngine.optional(),
|
|
1212
1248
|
autorouter: autorouterProp.optional(),
|
|
1213
|
-
registryApiUrl:
|
|
1214
|
-
cloudAutorouterUrl:
|
|
1249
|
+
registryApiUrl: z68.string().optional(),
|
|
1250
|
+
cloudAutorouterUrl: z68.string().optional()
|
|
1215
1251
|
});
|
|
1216
1252
|
expectTypesMatch(true);
|
|
1217
1253
|
export {
|
|
@@ -1232,6 +1268,7 @@ export {
|
|
|
1232
1268
|
capacitorPins,
|
|
1233
1269
|
capacitorProps,
|
|
1234
1270
|
chipProps,
|
|
1271
|
+
circleCutoutProps,
|
|
1235
1272
|
circleSmtPadProps,
|
|
1236
1273
|
circleSolderPasteProps,
|
|
1237
1274
|
commonComponentProps,
|
|
@@ -1241,6 +1278,7 @@ export {
|
|
|
1241
1278
|
constraintProps,
|
|
1242
1279
|
crystalPins,
|
|
1243
1280
|
crystalProps,
|
|
1281
|
+
cutoutProps,
|
|
1244
1282
|
diodePins,
|
|
1245
1283
|
diodeProps,
|
|
1246
1284
|
direction,
|
|
@@ -1291,12 +1329,14 @@ export {
|
|
|
1291
1329
|
platedHoleProps,
|
|
1292
1330
|
platformConfig,
|
|
1293
1331
|
point3,
|
|
1332
|
+
polygonCutoutProps,
|
|
1294
1333
|
portHints,
|
|
1295
1334
|
portProps,
|
|
1296
1335
|
portRef,
|
|
1297
1336
|
potentiometerProps,
|
|
1298
1337
|
powerSourceProps,
|
|
1299
1338
|
pushButtonProps,
|
|
1339
|
+
rectCutoutProps,
|
|
1300
1340
|
rectSmtPadProps,
|
|
1301
1341
|
rectSolderPasteProps,
|
|
1302
1342
|
resistorPinLabels,
|