@tscircuit/props 0.0.413 → 0.0.415
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 +13 -2
- package/dist/index.d.ts +1088 -9
- package/dist/index.js +478 -470
- package/dist/index.js.map +1 -1
- package/lib/components/interconnect.ts +17 -0
- package/lib/components/via.ts +4 -4
- package/lib/index.ts +1 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -842,47 +842,54 @@ var connectorProps = commonComponentProps.extend({
|
|
|
842
842
|
});
|
|
843
843
|
expectTypesMatch(true);
|
|
844
844
|
|
|
845
|
-
// lib/components/
|
|
845
|
+
// lib/components/interconnect.ts
|
|
846
846
|
import { z as z36 } from "zod";
|
|
847
|
+
var interconnectProps = commonComponentProps.extend({
|
|
848
|
+
standard: z36.enum(["TSC0001_36P_XALT_2025_11"]).optional()
|
|
849
|
+
});
|
|
850
|
+
expectTypesMatch(true);
|
|
851
|
+
|
|
852
|
+
// lib/components/fuse.ts
|
|
853
|
+
import { z as z37 } from "zod";
|
|
847
854
|
var fusePinLabels = ["pin1", "pin2"];
|
|
848
855
|
var fuseProps = commonComponentProps.extend({
|
|
849
|
-
currentRating:
|
|
850
|
-
voltageRating:
|
|
851
|
-
schShowRatings:
|
|
856
|
+
currentRating: z37.union([z37.number(), z37.string()]),
|
|
857
|
+
voltageRating: z37.union([z37.number(), z37.string()]).optional(),
|
|
858
|
+
schShowRatings: z37.boolean().optional(),
|
|
852
859
|
schOrientation: schematicOrientation.optional(),
|
|
853
|
-
connections:
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
860
|
+
connections: z37.record(
|
|
861
|
+
z37.string(),
|
|
862
|
+
z37.union([
|
|
863
|
+
z37.string(),
|
|
864
|
+
z37.array(z37.string()).readonly(),
|
|
865
|
+
z37.array(z37.string())
|
|
859
866
|
])
|
|
860
867
|
).optional()
|
|
861
868
|
});
|
|
862
869
|
|
|
863
870
|
// lib/components/platedhole.ts
|
|
864
871
|
import { distance as distance12 } from "circuit-json";
|
|
865
|
-
import { z as
|
|
866
|
-
var distanceHiddenUndefined =
|
|
872
|
+
import { z as z38 } from "zod";
|
|
873
|
+
var distanceHiddenUndefined = z38.custom().transform((a) => {
|
|
867
874
|
if (a === void 0) return void 0;
|
|
868
875
|
return distance12.parse(a);
|
|
869
876
|
});
|
|
870
|
-
var platedHoleProps =
|
|
877
|
+
var platedHoleProps = z38.discriminatedUnion("shape", [
|
|
871
878
|
pcbLayoutProps.omit({ pcbRotation: true, layer: true }).extend({
|
|
872
|
-
name:
|
|
873
|
-
connectsTo:
|
|
874
|
-
shape:
|
|
879
|
+
name: z38.string().optional(),
|
|
880
|
+
connectsTo: z38.string().or(z38.array(z38.string())).optional(),
|
|
881
|
+
shape: z38.literal("circle"),
|
|
875
882
|
holeDiameter: distance12,
|
|
876
883
|
outerDiameter: distance12,
|
|
877
884
|
padDiameter: distance12.optional().describe("Diameter of the copper pad"),
|
|
878
885
|
portHints: portHints.optional(),
|
|
879
886
|
solderMaskMargin: distance12.optional(),
|
|
880
|
-
coveredWithSolderMask:
|
|
887
|
+
coveredWithSolderMask: z38.boolean().optional()
|
|
881
888
|
}),
|
|
882
889
|
pcbLayoutProps.omit({ layer: true }).extend({
|
|
883
|
-
name:
|
|
884
|
-
connectsTo:
|
|
885
|
-
shape:
|
|
890
|
+
name: z38.string().optional(),
|
|
891
|
+
connectsTo: z38.string().or(z38.array(z38.string())).optional(),
|
|
892
|
+
shape: z38.literal("oval"),
|
|
886
893
|
outerWidth: distance12,
|
|
887
894
|
outerHeight: distance12,
|
|
888
895
|
holeWidth: distanceHiddenUndefined,
|
|
@@ -891,13 +898,13 @@ var platedHoleProps = z37.discriminatedUnion("shape", [
|
|
|
891
898
|
innerHeight: distance12.optional().describe("DEPRECATED use holeHeight"),
|
|
892
899
|
portHints: portHints.optional(),
|
|
893
900
|
solderMaskMargin: distance12.optional(),
|
|
894
|
-
coveredWithSolderMask:
|
|
901
|
+
coveredWithSolderMask: z38.boolean().optional()
|
|
895
902
|
}),
|
|
896
903
|
pcbLayoutProps.omit({ layer: true }).extend({
|
|
897
|
-
name:
|
|
898
|
-
connectsTo:
|
|
899
|
-
shape:
|
|
900
|
-
rectPad:
|
|
904
|
+
name: z38.string().optional(),
|
|
905
|
+
connectsTo: z38.string().or(z38.array(z38.string())).optional(),
|
|
906
|
+
shape: z38.literal("pill"),
|
|
907
|
+
rectPad: z38.boolean().optional(),
|
|
901
908
|
outerWidth: distance12,
|
|
902
909
|
outerHeight: distance12,
|
|
903
910
|
holeWidth: distanceHiddenUndefined,
|
|
@@ -908,30 +915,30 @@ var platedHoleProps = z37.discriminatedUnion("shape", [
|
|
|
908
915
|
holeOffsetX: distance12.optional(),
|
|
909
916
|
holeOffsetY: distance12.optional(),
|
|
910
917
|
solderMaskMargin: distance12.optional(),
|
|
911
|
-
coveredWithSolderMask:
|
|
918
|
+
coveredWithSolderMask: z38.boolean().optional()
|
|
912
919
|
}),
|
|
913
920
|
pcbLayoutProps.omit({ pcbRotation: true, layer: true }).extend({
|
|
914
|
-
name:
|
|
915
|
-
connectsTo:
|
|
916
|
-
shape:
|
|
921
|
+
name: z38.string().optional(),
|
|
922
|
+
connectsTo: z38.string().or(z38.array(z38.string())).optional(),
|
|
923
|
+
shape: z38.literal("circular_hole_with_rect_pad"),
|
|
917
924
|
holeDiameter: distance12,
|
|
918
925
|
rectPadWidth: distance12,
|
|
919
926
|
rectPadHeight: distance12,
|
|
920
927
|
rectBorderRadius: distance12.optional(),
|
|
921
|
-
holeShape:
|
|
922
|
-
padShape:
|
|
928
|
+
holeShape: z38.literal("circle").optional(),
|
|
929
|
+
padShape: z38.literal("rect").optional(),
|
|
923
930
|
portHints: portHints.optional(),
|
|
924
931
|
holeOffsetX: distance12.optional(),
|
|
925
932
|
holeOffsetY: distance12.optional(),
|
|
926
933
|
solderMaskMargin: distance12.optional(),
|
|
927
|
-
coveredWithSolderMask:
|
|
934
|
+
coveredWithSolderMask: z38.boolean().optional()
|
|
928
935
|
}),
|
|
929
936
|
pcbLayoutProps.omit({ pcbRotation: true, layer: true }).extend({
|
|
930
|
-
name:
|
|
931
|
-
connectsTo:
|
|
932
|
-
shape:
|
|
933
|
-
holeShape:
|
|
934
|
-
padShape:
|
|
937
|
+
name: z38.string().optional(),
|
|
938
|
+
connectsTo: z38.string().or(z38.array(z38.string())).optional(),
|
|
939
|
+
shape: z38.literal("pill_hole_with_rect_pad"),
|
|
940
|
+
holeShape: z38.literal("pill"),
|
|
941
|
+
padShape: z38.literal("rect"),
|
|
935
942
|
holeWidth: distance12,
|
|
936
943
|
holeHeight: distance12,
|
|
937
944
|
rectPadWidth: distance12,
|
|
@@ -940,22 +947,22 @@ var platedHoleProps = z37.discriminatedUnion("shape", [
|
|
|
940
947
|
holeOffsetX: distance12.optional(),
|
|
941
948
|
holeOffsetY: distance12.optional(),
|
|
942
949
|
solderMaskMargin: distance12.optional(),
|
|
943
|
-
coveredWithSolderMask:
|
|
950
|
+
coveredWithSolderMask: z38.boolean().optional()
|
|
944
951
|
}),
|
|
945
952
|
pcbLayoutProps.omit({ pcbRotation: true, layer: true }).extend({
|
|
946
|
-
name:
|
|
947
|
-
connectsTo:
|
|
948
|
-
shape:
|
|
949
|
-
holeShape:
|
|
953
|
+
name: z38.string().optional(),
|
|
954
|
+
connectsTo: z38.string().or(z38.array(z38.string())).optional(),
|
|
955
|
+
shape: z38.literal("hole_with_polygon_pad"),
|
|
956
|
+
holeShape: z38.enum(["circle", "oval", "pill", "rotated_pill"]),
|
|
950
957
|
holeDiameter: distance12.optional(),
|
|
951
958
|
holeWidth: distance12.optional(),
|
|
952
959
|
holeHeight: distance12.optional(),
|
|
953
|
-
padOutline:
|
|
960
|
+
padOutline: z38.array(point),
|
|
954
961
|
holeOffsetX: distance12,
|
|
955
962
|
holeOffsetY: distance12,
|
|
956
963
|
portHints: portHints.optional(),
|
|
957
964
|
solderMaskMargin: distance12.optional(),
|
|
958
|
-
coveredWithSolderMask:
|
|
965
|
+
coveredWithSolderMask: z38.boolean().optional()
|
|
959
966
|
})
|
|
960
967
|
]).refine((a) => {
|
|
961
968
|
if ("innerWidth" in a && a.innerWidth !== void 0) {
|
|
@@ -970,14 +977,14 @@ expectTypesMatch(true);
|
|
|
970
977
|
|
|
971
978
|
// lib/components/resistor.ts
|
|
972
979
|
import { resistance } from "circuit-json";
|
|
973
|
-
import { z as
|
|
980
|
+
import { z as z39 } from "zod";
|
|
974
981
|
var resistorPinLabels = ["pin1", "pin2", "pos", "neg"];
|
|
975
982
|
var resistorProps = commonComponentProps.extend({
|
|
976
983
|
resistance,
|
|
977
|
-
pullupFor:
|
|
978
|
-
pullupTo:
|
|
979
|
-
pulldownFor:
|
|
980
|
-
pulldownTo:
|
|
984
|
+
pullupFor: z39.string().optional(),
|
|
985
|
+
pullupTo: z39.string().optional(),
|
|
986
|
+
pulldownFor: z39.string().optional(),
|
|
987
|
+
pulldownTo: z39.string().optional(),
|
|
981
988
|
schOrientation: schematicOrientation.optional(),
|
|
982
989
|
connections: createConnectionsProp(resistorPinLabels).optional()
|
|
983
990
|
});
|
|
@@ -986,23 +993,23 @@ expectTypesMatch(true);
|
|
|
986
993
|
|
|
987
994
|
// lib/components/potentiometer.ts
|
|
988
995
|
import { resistance as resistance2 } from "circuit-json";
|
|
989
|
-
import { z as
|
|
996
|
+
import { z as z40 } from "zod";
|
|
990
997
|
var potentiometerProps = commonComponentProps.extend({
|
|
991
998
|
maxResistance: resistance2,
|
|
992
|
-
pinVariant:
|
|
999
|
+
pinVariant: z40.enum(["two_pin", "three_pin"]).optional()
|
|
993
1000
|
});
|
|
994
1001
|
expectTypesMatch(true);
|
|
995
1002
|
|
|
996
1003
|
// lib/components/crystal.ts
|
|
997
1004
|
import { frequency, capacitance } from "circuit-json";
|
|
998
|
-
import { z as
|
|
1005
|
+
import { z as z41 } from "zod";
|
|
999
1006
|
var crystalPins = lrPins;
|
|
1000
1007
|
var crystalProps = commonComponentProps.extend({
|
|
1001
1008
|
frequency,
|
|
1002
1009
|
loadCapacitance: capacitance,
|
|
1003
|
-
manufacturerPartNumber:
|
|
1004
|
-
mpn:
|
|
1005
|
-
pinVariant:
|
|
1010
|
+
manufacturerPartNumber: z41.string().optional(),
|
|
1011
|
+
mpn: z41.string().optional(),
|
|
1012
|
+
pinVariant: z41.enum(["two_pin", "four_pin"]).optional(),
|
|
1006
1013
|
schOrientation: schematicOrientation.optional(),
|
|
1007
1014
|
connections: createConnectionsProp(crystalPins).optional()
|
|
1008
1015
|
});
|
|
@@ -1010,34 +1017,34 @@ expectTypesMatch(true);
|
|
|
1010
1017
|
|
|
1011
1018
|
// lib/components/resonator.ts
|
|
1012
1019
|
import { frequency as frequency2, capacitance as capacitance2 } from "circuit-json";
|
|
1013
|
-
import { z as
|
|
1020
|
+
import { z as z42 } from "zod";
|
|
1014
1021
|
var resonatorProps = commonComponentProps.extend({
|
|
1015
1022
|
frequency: frequency2,
|
|
1016
1023
|
loadCapacitance: capacitance2,
|
|
1017
|
-
pinVariant:
|
|
1024
|
+
pinVariant: z42.enum(["no_ground", "ground_pin", "two_ground_pins"]).optional()
|
|
1018
1025
|
});
|
|
1019
1026
|
expectTypesMatch(true);
|
|
1020
1027
|
|
|
1021
1028
|
// lib/components/stampboard.ts
|
|
1022
1029
|
import { distance as distance13 } from "circuit-json";
|
|
1023
|
-
import { z as
|
|
1030
|
+
import { z as z43 } from "zod";
|
|
1024
1031
|
var stampboardProps = boardProps.extend({
|
|
1025
|
-
leftPinCount:
|
|
1026
|
-
rightPinCount:
|
|
1027
|
-
topPinCount:
|
|
1028
|
-
bottomPinCount:
|
|
1029
|
-
leftPins:
|
|
1030
|
-
rightPins:
|
|
1031
|
-
topPins:
|
|
1032
|
-
bottomPins:
|
|
1032
|
+
leftPinCount: z43.number().optional(),
|
|
1033
|
+
rightPinCount: z43.number().optional(),
|
|
1034
|
+
topPinCount: z43.number().optional(),
|
|
1035
|
+
bottomPinCount: z43.number().optional(),
|
|
1036
|
+
leftPins: z43.array(z43.string()).optional(),
|
|
1037
|
+
rightPins: z43.array(z43.string()).optional(),
|
|
1038
|
+
topPins: z43.array(z43.string()).optional(),
|
|
1039
|
+
bottomPins: z43.array(z43.string()).optional(),
|
|
1033
1040
|
pinPitch: distance13.optional(),
|
|
1034
|
-
innerHoles:
|
|
1041
|
+
innerHoles: z43.boolean().optional()
|
|
1035
1042
|
});
|
|
1036
1043
|
expectTypesMatch(true);
|
|
1037
1044
|
|
|
1038
1045
|
// lib/components/capacitor.ts
|
|
1039
1046
|
import { capacitance as capacitance3, voltage } from "circuit-json";
|
|
1040
|
-
import { z as
|
|
1047
|
+
import { z as z44 } from "zod";
|
|
1041
1048
|
var capacitorPinLabels = [
|
|
1042
1049
|
"pin1",
|
|
1043
1050
|
"pin2",
|
|
@@ -1049,13 +1056,13 @@ var capacitorPinLabels = [
|
|
|
1049
1056
|
var capacitorProps = commonComponentProps.extend({
|
|
1050
1057
|
capacitance: capacitance3,
|
|
1051
1058
|
maxVoltageRating: voltage.optional(),
|
|
1052
|
-
schShowRatings:
|
|
1053
|
-
polarized:
|
|
1054
|
-
decouplingFor:
|
|
1055
|
-
decouplingTo:
|
|
1056
|
-
bypassFor:
|
|
1057
|
-
bypassTo:
|
|
1058
|
-
maxDecouplingTraceLength:
|
|
1059
|
+
schShowRatings: z44.boolean().optional().default(false),
|
|
1060
|
+
polarized: z44.boolean().optional().default(false),
|
|
1061
|
+
decouplingFor: z44.string().optional(),
|
|
1062
|
+
decouplingTo: z44.string().optional(),
|
|
1063
|
+
bypassFor: z44.string().optional(),
|
|
1064
|
+
bypassTo: z44.string().optional(),
|
|
1065
|
+
maxDecouplingTraceLength: z44.number().optional(),
|
|
1059
1066
|
schOrientation: schematicOrientation.optional(),
|
|
1060
1067
|
connections: createConnectionsProp(capacitorPinLabels).optional()
|
|
1061
1068
|
});
|
|
@@ -1063,66 +1070,66 @@ var capacitorPins = lrPolarPins;
|
|
|
1063
1070
|
expectTypesMatch(true);
|
|
1064
1071
|
|
|
1065
1072
|
// lib/components/net.ts
|
|
1066
|
-
import { z as
|
|
1067
|
-
var netProps =
|
|
1068
|
-
name:
|
|
1069
|
-
connectsTo:
|
|
1070
|
-
highlightColor:
|
|
1071
|
-
isPowerNet:
|
|
1072
|
-
isGroundNet:
|
|
1073
|
+
import { z as z45 } from "zod";
|
|
1074
|
+
var netProps = z45.object({
|
|
1075
|
+
name: z45.string(),
|
|
1076
|
+
connectsTo: z45.string().or(z45.array(z45.string())).optional(),
|
|
1077
|
+
highlightColor: z45.string().optional(),
|
|
1078
|
+
isPowerNet: z45.boolean().optional(),
|
|
1079
|
+
isGroundNet: z45.boolean().optional()
|
|
1073
1080
|
});
|
|
1074
1081
|
expectTypesMatch(true);
|
|
1075
1082
|
|
|
1076
1083
|
// lib/components/constrainedlayout.ts
|
|
1077
|
-
import { z as
|
|
1078
|
-
var constrainedLayoutProps =
|
|
1079
|
-
name:
|
|
1080
|
-
pcbOnly:
|
|
1081
|
-
schOnly:
|
|
1084
|
+
import { z as z46 } from "zod";
|
|
1085
|
+
var constrainedLayoutProps = z46.object({
|
|
1086
|
+
name: z46.string().optional(),
|
|
1087
|
+
pcbOnly: z46.boolean().optional(),
|
|
1088
|
+
schOnly: z46.boolean().optional()
|
|
1082
1089
|
});
|
|
1083
1090
|
expectTypesMatch(true);
|
|
1084
1091
|
|
|
1085
1092
|
// lib/components/constraint.ts
|
|
1086
|
-
import { z as
|
|
1087
|
-
var pcbXDistConstraintProps =
|
|
1088
|
-
pcb:
|
|
1093
|
+
import { z as z47 } from "zod";
|
|
1094
|
+
var pcbXDistConstraintProps = z47.object({
|
|
1095
|
+
pcb: z47.literal(true).optional(),
|
|
1089
1096
|
xDist: distance,
|
|
1090
|
-
left:
|
|
1091
|
-
right:
|
|
1092
|
-
edgeToEdge:
|
|
1093
|
-
centerToCenter:
|
|
1097
|
+
left: z47.string(),
|
|
1098
|
+
right: z47.string(),
|
|
1099
|
+
edgeToEdge: z47.literal(true).optional(),
|
|
1100
|
+
centerToCenter: z47.literal(true).optional()
|
|
1094
1101
|
});
|
|
1095
1102
|
expectTypesMatch(
|
|
1096
1103
|
true
|
|
1097
1104
|
);
|
|
1098
|
-
var pcbYDistConstraintProps =
|
|
1099
|
-
pcb:
|
|
1105
|
+
var pcbYDistConstraintProps = z47.object({
|
|
1106
|
+
pcb: z47.literal(true).optional(),
|
|
1100
1107
|
yDist: distance,
|
|
1101
|
-
top:
|
|
1102
|
-
bottom:
|
|
1103
|
-
edgeToEdge:
|
|
1104
|
-
centerToCenter:
|
|
1108
|
+
top: z47.string(),
|
|
1109
|
+
bottom: z47.string(),
|
|
1110
|
+
edgeToEdge: z47.literal(true).optional(),
|
|
1111
|
+
centerToCenter: z47.literal(true).optional()
|
|
1105
1112
|
});
|
|
1106
1113
|
expectTypesMatch(
|
|
1107
1114
|
true
|
|
1108
1115
|
);
|
|
1109
|
-
var pcbSameYConstraintProps =
|
|
1110
|
-
pcb:
|
|
1111
|
-
sameY:
|
|
1112
|
-
for:
|
|
1116
|
+
var pcbSameYConstraintProps = z47.object({
|
|
1117
|
+
pcb: z47.literal(true).optional(),
|
|
1118
|
+
sameY: z47.literal(true).optional(),
|
|
1119
|
+
for: z47.array(z47.string())
|
|
1113
1120
|
});
|
|
1114
1121
|
expectTypesMatch(
|
|
1115
1122
|
true
|
|
1116
1123
|
);
|
|
1117
|
-
var pcbSameXConstraintProps =
|
|
1118
|
-
pcb:
|
|
1119
|
-
sameX:
|
|
1120
|
-
for:
|
|
1124
|
+
var pcbSameXConstraintProps = z47.object({
|
|
1125
|
+
pcb: z47.literal(true).optional(),
|
|
1126
|
+
sameX: z47.literal(true).optional(),
|
|
1127
|
+
for: z47.array(z47.string())
|
|
1121
1128
|
});
|
|
1122
1129
|
expectTypesMatch(
|
|
1123
1130
|
true
|
|
1124
1131
|
);
|
|
1125
|
-
var constraintProps =
|
|
1132
|
+
var constraintProps = z47.union([
|
|
1126
1133
|
pcbXDistConstraintProps,
|
|
1127
1134
|
pcbYDistConstraintProps,
|
|
1128
1135
|
pcbSameYConstraintProps,
|
|
@@ -1131,13 +1138,13 @@ var constraintProps = z46.union([
|
|
|
1131
1138
|
expectTypesMatch(true);
|
|
1132
1139
|
|
|
1133
1140
|
// lib/components/cutout.ts
|
|
1134
|
-
import { z as
|
|
1141
|
+
import { z as z48 } from "zod";
|
|
1135
1142
|
var rectCutoutProps = pcbLayoutProps.omit({
|
|
1136
1143
|
layer: true,
|
|
1137
1144
|
pcbRotation: true
|
|
1138
1145
|
}).extend({
|
|
1139
|
-
name:
|
|
1140
|
-
shape:
|
|
1146
|
+
name: z48.string().optional(),
|
|
1147
|
+
shape: z48.literal("rect"),
|
|
1141
1148
|
width: distance,
|
|
1142
1149
|
height: distance
|
|
1143
1150
|
});
|
|
@@ -1146,8 +1153,8 @@ var circleCutoutProps = pcbLayoutProps.omit({
|
|
|
1146
1153
|
layer: true,
|
|
1147
1154
|
pcbRotation: true
|
|
1148
1155
|
}).extend({
|
|
1149
|
-
name:
|
|
1150
|
-
shape:
|
|
1156
|
+
name: z48.string().optional(),
|
|
1157
|
+
shape: z48.literal("circle"),
|
|
1151
1158
|
radius: distance
|
|
1152
1159
|
});
|
|
1153
1160
|
expectTypesMatch(true);
|
|
@@ -1155,73 +1162,73 @@ var polygonCutoutProps = pcbLayoutProps.omit({
|
|
|
1155
1162
|
layer: true,
|
|
1156
1163
|
pcbRotation: true
|
|
1157
1164
|
}).extend({
|
|
1158
|
-
name:
|
|
1159
|
-
shape:
|
|
1160
|
-
points:
|
|
1165
|
+
name: z48.string().optional(),
|
|
1166
|
+
shape: z48.literal("polygon"),
|
|
1167
|
+
points: z48.array(point)
|
|
1161
1168
|
});
|
|
1162
1169
|
expectTypesMatch(true);
|
|
1163
|
-
var cutoutProps =
|
|
1170
|
+
var cutoutProps = z48.discriminatedUnion("shape", [
|
|
1164
1171
|
rectCutoutProps,
|
|
1165
1172
|
circleCutoutProps,
|
|
1166
1173
|
polygonCutoutProps
|
|
1167
1174
|
]);
|
|
1168
1175
|
|
|
1169
1176
|
// lib/components/smtpad.ts
|
|
1170
|
-
import { z as
|
|
1177
|
+
import { z as z49 } from "zod";
|
|
1171
1178
|
var rectSmtPadProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
1172
|
-
name:
|
|
1173
|
-
shape:
|
|
1179
|
+
name: z49.string().optional(),
|
|
1180
|
+
shape: z49.literal("rect"),
|
|
1174
1181
|
width: distance,
|
|
1175
1182
|
height: distance,
|
|
1176
1183
|
rectBorderRadius: distance.optional(),
|
|
1177
1184
|
cornerRadius: distance.optional(),
|
|
1178
1185
|
portHints: portHints.optional(),
|
|
1179
|
-
coveredWithSolderMask:
|
|
1186
|
+
coveredWithSolderMask: z49.boolean().optional(),
|
|
1180
1187
|
solderMaskMargin: distance.optional()
|
|
1181
1188
|
});
|
|
1182
1189
|
expectTypesMatch(true);
|
|
1183
1190
|
var rotatedRectSmtPadProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
1184
|
-
name:
|
|
1185
|
-
shape:
|
|
1191
|
+
name: z49.string().optional(),
|
|
1192
|
+
shape: z49.literal("rotated_rect"),
|
|
1186
1193
|
width: distance,
|
|
1187
1194
|
height: distance,
|
|
1188
|
-
ccwRotation:
|
|
1195
|
+
ccwRotation: z49.number(),
|
|
1189
1196
|
cornerRadius: distance.optional(),
|
|
1190
1197
|
portHints: portHints.optional(),
|
|
1191
|
-
coveredWithSolderMask:
|
|
1198
|
+
coveredWithSolderMask: z49.boolean().optional(),
|
|
1192
1199
|
solderMaskMargin: distance.optional()
|
|
1193
1200
|
});
|
|
1194
1201
|
expectTypesMatch(true);
|
|
1195
1202
|
var circleSmtPadProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
1196
|
-
name:
|
|
1197
|
-
shape:
|
|
1203
|
+
name: z49.string().optional(),
|
|
1204
|
+
shape: z49.literal("circle"),
|
|
1198
1205
|
radius: distance,
|
|
1199
1206
|
portHints: portHints.optional(),
|
|
1200
|
-
coveredWithSolderMask:
|
|
1207
|
+
coveredWithSolderMask: z49.boolean().optional(),
|
|
1201
1208
|
solderMaskMargin: distance.optional()
|
|
1202
1209
|
});
|
|
1203
1210
|
expectTypesMatch(true);
|
|
1204
1211
|
var pillSmtPadProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
1205
|
-
name:
|
|
1206
|
-
shape:
|
|
1212
|
+
name: z49.string().optional(),
|
|
1213
|
+
shape: z49.literal("pill"),
|
|
1207
1214
|
width: distance,
|
|
1208
1215
|
height: distance,
|
|
1209
1216
|
radius: distance,
|
|
1210
1217
|
portHints: portHints.optional(),
|
|
1211
|
-
coveredWithSolderMask:
|
|
1218
|
+
coveredWithSolderMask: z49.boolean().optional(),
|
|
1212
1219
|
solderMaskMargin: distance.optional()
|
|
1213
1220
|
});
|
|
1214
1221
|
expectTypesMatch(true);
|
|
1215
1222
|
var polygonSmtPadProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
1216
|
-
name:
|
|
1217
|
-
shape:
|
|
1218
|
-
points:
|
|
1223
|
+
name: z49.string().optional(),
|
|
1224
|
+
shape: z49.literal("polygon"),
|
|
1225
|
+
points: z49.array(point),
|
|
1219
1226
|
portHints: portHints.optional(),
|
|
1220
|
-
coveredWithSolderMask:
|
|
1227
|
+
coveredWithSolderMask: z49.boolean().optional(),
|
|
1221
1228
|
solderMaskMargin: distance.optional()
|
|
1222
1229
|
});
|
|
1223
1230
|
expectTypesMatch(true);
|
|
1224
|
-
var smtPadProps =
|
|
1231
|
+
var smtPadProps = z49.discriminatedUnion("shape", [
|
|
1225
1232
|
circleSmtPadProps,
|
|
1226
1233
|
rectSmtPadProps,
|
|
1227
1234
|
rotatedRectSmtPadProps,
|
|
@@ -1231,55 +1238,55 @@ var smtPadProps = z48.discriminatedUnion("shape", [
|
|
|
1231
1238
|
expectTypesMatch(true);
|
|
1232
1239
|
|
|
1233
1240
|
// lib/components/solderpaste.ts
|
|
1234
|
-
import { z as
|
|
1241
|
+
import { z as z50 } from "zod";
|
|
1235
1242
|
var rectSolderPasteProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
1236
|
-
shape:
|
|
1243
|
+
shape: z50.literal("rect"),
|
|
1237
1244
|
width: distance,
|
|
1238
1245
|
height: distance
|
|
1239
1246
|
});
|
|
1240
1247
|
expectTypesMatch(true);
|
|
1241
1248
|
var circleSolderPasteProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
1242
|
-
shape:
|
|
1249
|
+
shape: z50.literal("circle"),
|
|
1243
1250
|
radius: distance
|
|
1244
1251
|
});
|
|
1245
1252
|
expectTypesMatch(true);
|
|
1246
|
-
var solderPasteProps =
|
|
1253
|
+
var solderPasteProps = z50.union([
|
|
1247
1254
|
circleSolderPasteProps,
|
|
1248
1255
|
rectSolderPasteProps
|
|
1249
1256
|
]);
|
|
1250
1257
|
expectTypesMatch(true);
|
|
1251
1258
|
|
|
1252
1259
|
// lib/components/hole.ts
|
|
1253
|
-
import { z as
|
|
1260
|
+
import { z as z51 } from "zod";
|
|
1254
1261
|
var circleHoleProps = pcbLayoutProps.extend({
|
|
1255
|
-
name:
|
|
1256
|
-
shape:
|
|
1262
|
+
name: z51.string().optional(),
|
|
1263
|
+
shape: z51.literal("circle").optional(),
|
|
1257
1264
|
diameter: distance.optional(),
|
|
1258
1265
|
radius: distance.optional(),
|
|
1259
1266
|
solderMaskMargin: distance.optional(),
|
|
1260
|
-
coveredWithSolderMask:
|
|
1267
|
+
coveredWithSolderMask: z51.boolean().optional()
|
|
1261
1268
|
}).transform((d) => ({
|
|
1262
1269
|
...d,
|
|
1263
1270
|
diameter: d.diameter ?? 2 * d.radius,
|
|
1264
1271
|
radius: d.radius ?? d.diameter / 2
|
|
1265
1272
|
}));
|
|
1266
1273
|
var pillHoleProps = pcbLayoutProps.extend({
|
|
1267
|
-
name:
|
|
1268
|
-
shape:
|
|
1274
|
+
name: z51.string().optional(),
|
|
1275
|
+
shape: z51.literal("pill"),
|
|
1269
1276
|
width: distance,
|
|
1270
1277
|
height: distance,
|
|
1271
1278
|
solderMaskMargin: distance.optional(),
|
|
1272
|
-
coveredWithSolderMask:
|
|
1279
|
+
coveredWithSolderMask: z51.boolean().optional()
|
|
1273
1280
|
});
|
|
1274
1281
|
var rectHoleProps = pcbLayoutProps.extend({
|
|
1275
|
-
name:
|
|
1276
|
-
shape:
|
|
1282
|
+
name: z51.string().optional(),
|
|
1283
|
+
shape: z51.literal("rect"),
|
|
1277
1284
|
width: distance,
|
|
1278
1285
|
height: distance,
|
|
1279
1286
|
solderMaskMargin: distance.optional(),
|
|
1280
|
-
coveredWithSolderMask:
|
|
1287
|
+
coveredWithSolderMask: z51.boolean().optional()
|
|
1281
1288
|
});
|
|
1282
|
-
var holeProps =
|
|
1289
|
+
var holeProps = z51.union([
|
|
1283
1290
|
circleHoleProps,
|
|
1284
1291
|
pillHoleProps,
|
|
1285
1292
|
rectHoleProps
|
|
@@ -1288,30 +1295,30 @@ expectTypesMatch(true);
|
|
|
1288
1295
|
|
|
1289
1296
|
// lib/components/trace.ts
|
|
1290
1297
|
import { distance as distance14, route_hint_point as route_hint_point2 } from "circuit-json";
|
|
1291
|
-
import { z as
|
|
1292
|
-
var portRef =
|
|
1293
|
-
|
|
1294
|
-
|
|
1298
|
+
import { z as z52 } from "zod";
|
|
1299
|
+
var portRef = z52.union([
|
|
1300
|
+
z52.string(),
|
|
1301
|
+
z52.custom(
|
|
1295
1302
|
(v) => Boolean(v.getPortSelector)
|
|
1296
1303
|
)
|
|
1297
1304
|
]);
|
|
1298
|
-
var baseTraceProps =
|
|
1299
|
-
key:
|
|
1305
|
+
var baseTraceProps = z52.object({
|
|
1306
|
+
key: z52.string().optional(),
|
|
1300
1307
|
thickness: distance14.optional(),
|
|
1301
1308
|
width: distance14.optional().describe("Alias for trace thickness"),
|
|
1302
|
-
schematicRouteHints:
|
|
1303
|
-
pcbRouteHints:
|
|
1304
|
-
pcbPathRelativeTo:
|
|
1305
|
-
pcbPath:
|
|
1306
|
-
pcbStraightLine:
|
|
1307
|
-
schDisplayLabel:
|
|
1308
|
-
schStroke:
|
|
1309
|
-
highlightColor:
|
|
1309
|
+
schematicRouteHints: z52.array(point).optional(),
|
|
1310
|
+
pcbRouteHints: z52.array(route_hint_point2).optional(),
|
|
1311
|
+
pcbPathRelativeTo: z52.string().optional(),
|
|
1312
|
+
pcbPath: z52.array(z52.union([point, z52.string()])).optional(),
|
|
1313
|
+
pcbStraightLine: z52.boolean().optional().describe("Draw a straight pcb trace between the connected points"),
|
|
1314
|
+
schDisplayLabel: z52.string().optional(),
|
|
1315
|
+
schStroke: z52.string().optional(),
|
|
1316
|
+
highlightColor: z52.string().optional(),
|
|
1310
1317
|
maxLength: distance14.optional()
|
|
1311
1318
|
});
|
|
1312
|
-
var traceProps =
|
|
1319
|
+
var traceProps = z52.union([
|
|
1313
1320
|
baseTraceProps.extend({
|
|
1314
|
-
path:
|
|
1321
|
+
path: z52.array(portRef)
|
|
1315
1322
|
}),
|
|
1316
1323
|
baseTraceProps.extend({
|
|
1317
1324
|
from: portRef,
|
|
@@ -1321,25 +1328,25 @@ var traceProps = z51.union([
|
|
|
1321
1328
|
|
|
1322
1329
|
// lib/components/footprint.ts
|
|
1323
1330
|
import { layer_ref as layer_ref4 } from "circuit-json";
|
|
1324
|
-
import { z as
|
|
1325
|
-
var footprintProps =
|
|
1326
|
-
children:
|
|
1331
|
+
import { z as z53 } from "zod";
|
|
1332
|
+
var footprintProps = z53.object({
|
|
1333
|
+
children: z53.any().optional(),
|
|
1327
1334
|
originalLayer: layer_ref4.default("top").optional(),
|
|
1328
|
-
circuitJson:
|
|
1335
|
+
circuitJson: z53.array(z53.any()).optional()
|
|
1329
1336
|
});
|
|
1330
1337
|
expectTypesMatch(true);
|
|
1331
1338
|
|
|
1332
1339
|
// lib/components/symbol.ts
|
|
1333
|
-
import { z as
|
|
1334
|
-
var symbolProps =
|
|
1335
|
-
originalFacingDirection:
|
|
1340
|
+
import { z as z54 } from "zod";
|
|
1341
|
+
var symbolProps = z54.object({
|
|
1342
|
+
originalFacingDirection: z54.enum(["up", "down", "left", "right"]).default("right").optional()
|
|
1336
1343
|
});
|
|
1337
1344
|
expectTypesMatch(true);
|
|
1338
1345
|
|
|
1339
1346
|
// lib/components/battery.ts
|
|
1340
1347
|
import { voltage as voltage2 } from "circuit-json";
|
|
1341
|
-
import { z as
|
|
1342
|
-
var capacity =
|
|
1348
|
+
import { z as z55 } from "zod";
|
|
1349
|
+
var capacity = z55.number().or(z55.string().endsWith("mAh")).transform((v) => {
|
|
1343
1350
|
if (typeof v === "string") {
|
|
1344
1351
|
const valString = v.replace("mAh", "");
|
|
1345
1352
|
const num = Number.parseFloat(valString);
|
|
@@ -1353,7 +1360,7 @@ var capacity = z54.number().or(z54.string().endsWith("mAh")).transform((v) => {
|
|
|
1353
1360
|
var batteryProps = commonComponentProps.extend({
|
|
1354
1361
|
capacity: capacity.optional(),
|
|
1355
1362
|
voltage: voltage2.optional(),
|
|
1356
|
-
standard:
|
|
1363
|
+
standard: z55.enum(["AA", "AAA", "9V", "CR2032", "18650", "C"]).optional(),
|
|
1357
1364
|
schOrientation: schematicOrientation.optional()
|
|
1358
1365
|
});
|
|
1359
1366
|
var batteryPins = lrPolarPins;
|
|
@@ -1363,29 +1370,29 @@ expectTypesMatch(true);
|
|
|
1363
1370
|
import { distance as distance15 } from "circuit-json";
|
|
1364
1371
|
|
|
1365
1372
|
// lib/common/pcbOrientation.ts
|
|
1366
|
-
import { z as
|
|
1367
|
-
var pcbOrientation =
|
|
1373
|
+
import { z as z56 } from "zod";
|
|
1374
|
+
var pcbOrientation = z56.enum(["vertical", "horizontal"]).describe(
|
|
1368
1375
|
"vertical means pins go 1->2 downward and horizontal means pins go 1->2 rightward"
|
|
1369
1376
|
);
|
|
1370
1377
|
expectTypesMatch(true);
|
|
1371
1378
|
|
|
1372
1379
|
// lib/components/pin-header.ts
|
|
1373
|
-
import { z as
|
|
1380
|
+
import { z as z57 } from "zod";
|
|
1374
1381
|
var pinHeaderProps = commonComponentProps.extend({
|
|
1375
|
-
pinCount:
|
|
1382
|
+
pinCount: z57.number(),
|
|
1376
1383
|
pitch: distance15.optional(),
|
|
1377
|
-
schFacingDirection:
|
|
1378
|
-
gender:
|
|
1379
|
-
showSilkscreenPinLabels:
|
|
1380
|
-
pcbPinLabels:
|
|
1381
|
-
doubleRow:
|
|
1382
|
-
rightAngle:
|
|
1384
|
+
schFacingDirection: z57.enum(["up", "down", "left", "right"]).optional(),
|
|
1385
|
+
gender: z57.enum(["male", "female", "unpopulated"]).optional().default("male"),
|
|
1386
|
+
showSilkscreenPinLabels: z57.boolean().optional(),
|
|
1387
|
+
pcbPinLabels: z57.record(z57.string(), z57.string()).optional(),
|
|
1388
|
+
doubleRow: z57.boolean().optional(),
|
|
1389
|
+
rightAngle: z57.boolean().optional(),
|
|
1383
1390
|
pcbOrientation: pcbOrientation.optional(),
|
|
1384
1391
|
holeDiameter: distance15.optional(),
|
|
1385
1392
|
platedDiameter: distance15.optional(),
|
|
1386
|
-
pinLabels:
|
|
1387
|
-
connections:
|
|
1388
|
-
facingDirection:
|
|
1393
|
+
pinLabels: z57.record(z57.string(), schematicPinLabel).or(z57.array(schematicPinLabel)).optional(),
|
|
1394
|
+
connections: z57.custom().pipe(z57.record(z57.string(), connectionTarget)).optional(),
|
|
1395
|
+
facingDirection: z57.enum(["left", "right"]).optional(),
|
|
1389
1396
|
schPinArrangement: schematicPinArrangement.optional(),
|
|
1390
1397
|
schPinStyle: schematicPinStyle.optional(),
|
|
1391
1398
|
schPinSpacing: distance15.optional(),
|
|
@@ -1395,29 +1402,29 @@ var pinHeaderProps = commonComponentProps.extend({
|
|
|
1395
1402
|
expectTypesMatch(true);
|
|
1396
1403
|
|
|
1397
1404
|
// lib/components/netalias.ts
|
|
1398
|
-
import { z as
|
|
1405
|
+
import { z as z58 } from "zod";
|
|
1399
1406
|
import { rotation as rotation2 } from "circuit-json";
|
|
1400
|
-
var netAliasProps =
|
|
1401
|
-
net:
|
|
1402
|
-
connection:
|
|
1407
|
+
var netAliasProps = z58.object({
|
|
1408
|
+
net: z58.string().optional(),
|
|
1409
|
+
connection: z58.string().optional(),
|
|
1403
1410
|
schX: distance.optional(),
|
|
1404
1411
|
schY: distance.optional(),
|
|
1405
1412
|
schRotation: rotation2.optional(),
|
|
1406
|
-
anchorSide:
|
|
1413
|
+
anchorSide: z58.enum(["left", "top", "right", "bottom"]).optional()
|
|
1407
1414
|
});
|
|
1408
1415
|
expectTypesMatch(true);
|
|
1409
1416
|
|
|
1410
1417
|
// lib/components/netlabel.ts
|
|
1411
|
-
import { z as
|
|
1418
|
+
import { z as z59 } from "zod";
|
|
1412
1419
|
import { rotation as rotation3 } from "circuit-json";
|
|
1413
|
-
var netLabelProps =
|
|
1414
|
-
net:
|
|
1415
|
-
connection:
|
|
1416
|
-
connectsTo:
|
|
1420
|
+
var netLabelProps = z59.object({
|
|
1421
|
+
net: z59.string().optional(),
|
|
1422
|
+
connection: z59.string().optional(),
|
|
1423
|
+
connectsTo: z59.string().or(z59.array(z59.string())).optional(),
|
|
1417
1424
|
schX: distance.optional(),
|
|
1418
1425
|
schY: distance.optional(),
|
|
1419
1426
|
schRotation: rotation3.optional(),
|
|
1420
|
-
anchorSide:
|
|
1427
|
+
anchorSide: z59.enum(["left", "top", "right", "bottom"]).optional()
|
|
1421
1428
|
});
|
|
1422
1429
|
expectTypesMatch(true);
|
|
1423
1430
|
|
|
@@ -1432,12 +1439,12 @@ expectTypesMatch(true);
|
|
|
1432
1439
|
|
|
1433
1440
|
// lib/components/analogsimulation.ts
|
|
1434
1441
|
import { ms } from "circuit-json";
|
|
1435
|
-
import { z as
|
|
1436
|
-
var spiceEngine =
|
|
1442
|
+
import { z as z61 } from "zod";
|
|
1443
|
+
var spiceEngine = z61.custom(
|
|
1437
1444
|
(value) => typeof value === "string"
|
|
1438
1445
|
);
|
|
1439
|
-
var analogSimulationProps =
|
|
1440
|
-
simulationType:
|
|
1446
|
+
var analogSimulationProps = z61.object({
|
|
1447
|
+
simulationType: z61.literal("spice_transient_analysis").default("spice_transient_analysis"),
|
|
1441
1448
|
duration: ms.optional(),
|
|
1442
1449
|
timePerStep: ms.optional(),
|
|
1443
1450
|
spiceEngine: spiceEngine.optional()
|
|
@@ -1447,7 +1454,7 @@ expectTypesMatch(
|
|
|
1447
1454
|
);
|
|
1448
1455
|
|
|
1449
1456
|
// lib/components/transistor.ts
|
|
1450
|
-
import { z as
|
|
1457
|
+
import { z as z62 } from "zod";
|
|
1451
1458
|
var transistorPinsLabels = [
|
|
1452
1459
|
"pin1",
|
|
1453
1460
|
"pin2",
|
|
@@ -1460,7 +1467,7 @@ var transistorPinsLabels = [
|
|
|
1460
1467
|
"drain"
|
|
1461
1468
|
];
|
|
1462
1469
|
var transistorProps = commonComponentProps.extend({
|
|
1463
|
-
type:
|
|
1470
|
+
type: z62.enum(["npn", "pnp", "bjt", "jfet", "mosfet", "igbt"]),
|
|
1464
1471
|
connections: createConnectionsProp(transistorPinsLabels).optional()
|
|
1465
1472
|
});
|
|
1466
1473
|
var transistorPins = [
|
|
@@ -1474,10 +1481,10 @@ var transistorPins = [
|
|
|
1474
1481
|
expectTypesMatch(true);
|
|
1475
1482
|
|
|
1476
1483
|
// lib/components/mosfet.ts
|
|
1477
|
-
import { z as
|
|
1484
|
+
import { z as z63 } from "zod";
|
|
1478
1485
|
var mosfetProps = commonComponentProps.extend({
|
|
1479
|
-
channelType:
|
|
1480
|
-
mosfetMode:
|
|
1486
|
+
channelType: z63.enum(["n", "p"]),
|
|
1487
|
+
mosfetMode: z63.enum(["enhancement", "depletion"])
|
|
1481
1488
|
});
|
|
1482
1489
|
var mosfetPins = [
|
|
1483
1490
|
"pin1",
|
|
@@ -1491,19 +1498,19 @@ expectTypesMatch(true);
|
|
|
1491
1498
|
|
|
1492
1499
|
// lib/components/inductor.ts
|
|
1493
1500
|
import { inductance } from "circuit-json";
|
|
1494
|
-
import { z as
|
|
1501
|
+
import { z as z64 } from "zod";
|
|
1495
1502
|
var inductorPins = lrPins;
|
|
1496
1503
|
var inductorProps = commonComponentProps.extend({
|
|
1497
1504
|
inductance,
|
|
1498
|
-
maxCurrentRating:
|
|
1505
|
+
maxCurrentRating: z64.union([z64.string(), z64.number()]).optional(),
|
|
1499
1506
|
schOrientation: schematicOrientation.optional(),
|
|
1500
1507
|
connections: createConnectionsProp(inductorPins).optional()
|
|
1501
1508
|
});
|
|
1502
1509
|
expectTypesMatch(true);
|
|
1503
1510
|
|
|
1504
1511
|
// lib/components/diode.ts
|
|
1505
|
-
import { z as
|
|
1506
|
-
var diodeConnectionKeys =
|
|
1512
|
+
import { z as z65 } from "zod";
|
|
1513
|
+
var diodeConnectionKeys = z65.enum([
|
|
1507
1514
|
"anode",
|
|
1508
1515
|
"cathode",
|
|
1509
1516
|
"pin1",
|
|
@@ -1511,9 +1518,9 @@ var diodeConnectionKeys = z64.enum([
|
|
|
1511
1518
|
"pos",
|
|
1512
1519
|
"neg"
|
|
1513
1520
|
]);
|
|
1514
|
-
var connectionTarget3 =
|
|
1515
|
-
var connectionsProp2 =
|
|
1516
|
-
var diodeVariant =
|
|
1521
|
+
var connectionTarget3 = z65.string().or(z65.array(z65.string()).readonly()).or(z65.array(z65.string()));
|
|
1522
|
+
var connectionsProp2 = z65.record(diodeConnectionKeys, connectionTarget3);
|
|
1523
|
+
var diodeVariant = z65.enum([
|
|
1517
1524
|
"standard",
|
|
1518
1525
|
"schottky",
|
|
1519
1526
|
"zener",
|
|
@@ -1524,12 +1531,12 @@ var diodeVariant = z64.enum([
|
|
|
1524
1531
|
var diodeProps = commonComponentProps.extend({
|
|
1525
1532
|
connections: connectionsProp2.optional(),
|
|
1526
1533
|
variant: diodeVariant.optional().default("standard"),
|
|
1527
|
-
standard:
|
|
1528
|
-
schottky:
|
|
1529
|
-
zener:
|
|
1530
|
-
avalanche:
|
|
1531
|
-
photo:
|
|
1532
|
-
tvs:
|
|
1534
|
+
standard: z65.boolean().optional(),
|
|
1535
|
+
schottky: z65.boolean().optional(),
|
|
1536
|
+
zener: z65.boolean().optional(),
|
|
1537
|
+
avalanche: z65.boolean().optional(),
|
|
1538
|
+
photo: z65.boolean().optional(),
|
|
1539
|
+
tvs: z65.boolean().optional(),
|
|
1533
1540
|
schOrientation: schematicOrientation.optional()
|
|
1534
1541
|
}).superRefine((data, ctx) => {
|
|
1535
1542
|
const enabledFlags = [
|
|
@@ -1542,11 +1549,11 @@ var diodeProps = commonComponentProps.extend({
|
|
|
1542
1549
|
].filter(Boolean).length;
|
|
1543
1550
|
if (enabledFlags > 1) {
|
|
1544
1551
|
ctx.addIssue({
|
|
1545
|
-
code:
|
|
1552
|
+
code: z65.ZodIssueCode.custom,
|
|
1546
1553
|
message: "Exactly one diode variant must be enabled",
|
|
1547
1554
|
path: []
|
|
1548
1555
|
});
|
|
1549
|
-
return
|
|
1556
|
+
return z65.INVALID;
|
|
1550
1557
|
}
|
|
1551
1558
|
}).transform((data) => {
|
|
1552
1559
|
const result = {
|
|
@@ -1593,33 +1600,33 @@ var diodePins = lrPolarPins;
|
|
|
1593
1600
|
expectTypesMatch(true);
|
|
1594
1601
|
|
|
1595
1602
|
// lib/components/led.ts
|
|
1596
|
-
import { z as
|
|
1603
|
+
import { z as z66 } from "zod";
|
|
1597
1604
|
var ledProps = commonComponentProps.extend({
|
|
1598
|
-
color:
|
|
1599
|
-
wavelength:
|
|
1600
|
-
schDisplayValue:
|
|
1605
|
+
color: z66.string().optional(),
|
|
1606
|
+
wavelength: z66.string().optional(),
|
|
1607
|
+
schDisplayValue: z66.string().optional(),
|
|
1601
1608
|
schOrientation: schematicOrientation.optional(),
|
|
1602
1609
|
connections: createConnectionsProp(lrPolarPins).optional(),
|
|
1603
|
-
laser:
|
|
1610
|
+
laser: z66.boolean().optional()
|
|
1604
1611
|
});
|
|
1605
1612
|
var ledPins = lrPolarPins;
|
|
1606
1613
|
|
|
1607
1614
|
// lib/components/switch.ts
|
|
1608
1615
|
import { ms as ms2, frequency as frequency3 } from "circuit-json";
|
|
1609
|
-
import { z as
|
|
1616
|
+
import { z as z67 } from "zod";
|
|
1610
1617
|
var switchProps = commonComponentProps.extend({
|
|
1611
|
-
type:
|
|
1612
|
-
isNormallyClosed:
|
|
1613
|
-
spst:
|
|
1614
|
-
spdt:
|
|
1615
|
-
dpst:
|
|
1616
|
-
dpdt:
|
|
1618
|
+
type: z67.enum(["spst", "spdt", "dpst", "dpdt"]).optional(),
|
|
1619
|
+
isNormallyClosed: z67.boolean().optional().default(false),
|
|
1620
|
+
spst: z67.boolean().optional(),
|
|
1621
|
+
spdt: z67.boolean().optional(),
|
|
1622
|
+
dpst: z67.boolean().optional(),
|
|
1623
|
+
dpdt: z67.boolean().optional(),
|
|
1617
1624
|
simSwitchFrequency: frequency3.optional(),
|
|
1618
1625
|
simCloseAt: ms2.optional(),
|
|
1619
1626
|
simOpenAt: ms2.optional(),
|
|
1620
|
-
simStartClosed:
|
|
1621
|
-
simStartOpen:
|
|
1622
|
-
connections:
|
|
1627
|
+
simStartClosed: z67.boolean().optional(),
|
|
1628
|
+
simStartOpen: z67.boolean().optional(),
|
|
1629
|
+
connections: z67.custom().pipe(z67.record(z67.string(), connectionTarget)).optional()
|
|
1623
1630
|
}).transform((props) => {
|
|
1624
1631
|
const updatedProps = { ...props };
|
|
1625
1632
|
if (updatedProps.dpdt) {
|
|
@@ -1651,33 +1658,33 @@ expectTypesMatch(true);
|
|
|
1651
1658
|
|
|
1652
1659
|
// lib/components/fabrication-note-text.ts
|
|
1653
1660
|
import { length as length3 } from "circuit-json";
|
|
1654
|
-
import { z as
|
|
1661
|
+
import { z as z68 } from "zod";
|
|
1655
1662
|
var fabricationNoteTextProps = pcbLayoutProps.extend({
|
|
1656
|
-
text:
|
|
1657
|
-
anchorAlignment:
|
|
1658
|
-
font:
|
|
1663
|
+
text: z68.string(),
|
|
1664
|
+
anchorAlignment: z68.enum(["center", "top_left", "top_right", "bottom_left", "bottom_right"]).default("center"),
|
|
1665
|
+
font: z68.enum(["tscircuit2024"]).optional(),
|
|
1659
1666
|
fontSize: length3.optional(),
|
|
1660
|
-
color:
|
|
1667
|
+
color: z68.string().optional()
|
|
1661
1668
|
});
|
|
1662
1669
|
expectTypesMatch(true);
|
|
1663
1670
|
|
|
1664
1671
|
// lib/components/fabrication-note-rect.ts
|
|
1665
1672
|
import { distance as distance16 } from "circuit-json";
|
|
1666
|
-
import { z as
|
|
1673
|
+
import { z as z69 } from "zod";
|
|
1667
1674
|
var fabricationNoteRectProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
1668
1675
|
width: distance16,
|
|
1669
1676
|
height: distance16,
|
|
1670
1677
|
strokeWidth: distance16.optional(),
|
|
1671
|
-
isFilled:
|
|
1672
|
-
hasStroke:
|
|
1673
|
-
isStrokeDashed:
|
|
1674
|
-
color:
|
|
1678
|
+
isFilled: z69.boolean().optional(),
|
|
1679
|
+
hasStroke: z69.boolean().optional(),
|
|
1680
|
+
isStrokeDashed: z69.boolean().optional(),
|
|
1681
|
+
color: z69.string().optional(),
|
|
1675
1682
|
cornerRadius: distance16.optional()
|
|
1676
1683
|
});
|
|
1677
1684
|
|
|
1678
1685
|
// lib/components/fabrication-note-path.ts
|
|
1679
1686
|
import { length as length4, route_hint_point as route_hint_point3 } from "circuit-json";
|
|
1680
|
-
import { z as
|
|
1687
|
+
import { z as z70 } from "zod";
|
|
1681
1688
|
var fabricationNotePathProps = pcbLayoutProps.omit({
|
|
1682
1689
|
pcbX: true,
|
|
1683
1690
|
pcbY: true,
|
|
@@ -1685,15 +1692,15 @@ var fabricationNotePathProps = pcbLayoutProps.omit({
|
|
|
1685
1692
|
pcbOffsetY: true,
|
|
1686
1693
|
pcbRotation: true
|
|
1687
1694
|
}).extend({
|
|
1688
|
-
route:
|
|
1695
|
+
route: z70.array(route_hint_point3),
|
|
1689
1696
|
strokeWidth: length4.optional(),
|
|
1690
|
-
color:
|
|
1697
|
+
color: z70.string().optional()
|
|
1691
1698
|
});
|
|
1692
1699
|
|
|
1693
1700
|
// lib/components/fabrication-note-dimension.ts
|
|
1694
1701
|
import { distance as distance17, length as length5 } from "circuit-json";
|
|
1695
|
-
import { z as
|
|
1696
|
-
var dimensionTarget =
|
|
1702
|
+
import { z as z71 } from "zod";
|
|
1703
|
+
var dimensionTarget = z71.union([z71.string(), point]);
|
|
1697
1704
|
var fabricationNoteDimensionProps = pcbLayoutProps.omit({
|
|
1698
1705
|
pcbX: true,
|
|
1699
1706
|
pcbY: true,
|
|
@@ -1703,53 +1710,53 @@ var fabricationNoteDimensionProps = pcbLayoutProps.omit({
|
|
|
1703
1710
|
}).extend({
|
|
1704
1711
|
from: dimensionTarget,
|
|
1705
1712
|
to: dimensionTarget,
|
|
1706
|
-
text:
|
|
1713
|
+
text: z71.string().optional(),
|
|
1707
1714
|
offset: distance17.optional(),
|
|
1708
|
-
font:
|
|
1715
|
+
font: z71.enum(["tscircuit2024"]).optional(),
|
|
1709
1716
|
fontSize: length5.optional(),
|
|
1710
|
-
color:
|
|
1717
|
+
color: z71.string().optional(),
|
|
1711
1718
|
arrowSize: distance17.optional(),
|
|
1712
|
-
units:
|
|
1713
|
-
outerEdgeToEdge:
|
|
1714
|
-
centerToCenter:
|
|
1715
|
-
innerEdgeToEdge:
|
|
1719
|
+
units: z71.enum(["in", "mm"]).optional(),
|
|
1720
|
+
outerEdgeToEdge: z71.literal(true).optional(),
|
|
1721
|
+
centerToCenter: z71.literal(true).optional(),
|
|
1722
|
+
innerEdgeToEdge: z71.literal(true).optional()
|
|
1716
1723
|
});
|
|
1717
1724
|
expectTypesMatch(true);
|
|
1718
1725
|
|
|
1719
1726
|
// lib/components/pcb-trace.ts
|
|
1720
1727
|
import { distance as distance18, route_hint_point as route_hint_point4 } from "circuit-json";
|
|
1721
|
-
import { z as
|
|
1722
|
-
var pcbTraceProps =
|
|
1723
|
-
layer:
|
|
1728
|
+
import { z as z72 } from "zod";
|
|
1729
|
+
var pcbTraceProps = z72.object({
|
|
1730
|
+
layer: z72.string().optional(),
|
|
1724
1731
|
thickness: distance18.optional(),
|
|
1725
|
-
route:
|
|
1732
|
+
route: z72.array(route_hint_point4)
|
|
1726
1733
|
});
|
|
1727
1734
|
|
|
1728
1735
|
// lib/components/via.ts
|
|
1729
1736
|
import { distance as distance19, layer_ref as layer_ref5 } from "circuit-json";
|
|
1730
|
-
import { z as
|
|
1737
|
+
import { z as z73 } from "zod";
|
|
1731
1738
|
var viaProps = commonLayoutProps.extend({
|
|
1732
|
-
name:
|
|
1739
|
+
name: z73.string().optional(),
|
|
1733
1740
|
fromLayer: layer_ref5,
|
|
1734
1741
|
toLayer: layer_ref5,
|
|
1735
|
-
holeDiameter: distance19,
|
|
1736
|
-
outerDiameter: distance19,
|
|
1737
|
-
connectsTo:
|
|
1738
|
-
netIsAssignable:
|
|
1742
|
+
holeDiameter: distance19.optional(),
|
|
1743
|
+
outerDiameter: distance19.optional(),
|
|
1744
|
+
connectsTo: z73.string().or(z73.array(z73.string())).optional(),
|
|
1745
|
+
netIsAssignable: z73.boolean().optional()
|
|
1739
1746
|
});
|
|
1740
1747
|
expectTypesMatch(true);
|
|
1741
1748
|
|
|
1742
1749
|
// lib/components/testpoint.ts
|
|
1743
1750
|
import { distance as distance20 } from "circuit-json";
|
|
1744
|
-
import { z as
|
|
1751
|
+
import { z as z74 } from "zod";
|
|
1745
1752
|
var testpointPins = ["pin1"];
|
|
1746
|
-
var testpointConnectionsProp =
|
|
1753
|
+
var testpointConnectionsProp = z74.object({
|
|
1747
1754
|
pin1: connectionTarget
|
|
1748
1755
|
}).strict();
|
|
1749
1756
|
var testpointProps = commonComponentProps.extend({
|
|
1750
1757
|
connections: testpointConnectionsProp.optional(),
|
|
1751
|
-
footprintVariant:
|
|
1752
|
-
padShape:
|
|
1758
|
+
footprintVariant: z74.enum(["pad", "through_hole"]).optional(),
|
|
1759
|
+
padShape: z74.enum(["rect", "circle"]).optional().default("circle"),
|
|
1753
1760
|
padDiameter: distance20.optional(),
|
|
1754
1761
|
holeDiameter: distance20.optional(),
|
|
1755
1762
|
width: distance20.optional(),
|
|
@@ -1761,22 +1768,22 @@ var testpointProps = commonComponentProps.extend({
|
|
|
1761
1768
|
expectTypesMatch(true);
|
|
1762
1769
|
|
|
1763
1770
|
// lib/components/breakoutpoint.ts
|
|
1764
|
-
import { z as
|
|
1771
|
+
import { z as z75 } from "zod";
|
|
1765
1772
|
var breakoutPointProps = pcbLayoutProps.omit({ pcbRotation: true, layer: true }).extend({
|
|
1766
|
-
connection:
|
|
1773
|
+
connection: z75.string()
|
|
1767
1774
|
});
|
|
1768
1775
|
expectTypesMatch(true);
|
|
1769
1776
|
|
|
1770
1777
|
// lib/components/pcb-keepout.ts
|
|
1771
1778
|
import { distance as distance21 } from "circuit-json";
|
|
1772
|
-
import { z as
|
|
1773
|
-
var pcbKeepoutProps =
|
|
1779
|
+
import { z as z76 } from "zod";
|
|
1780
|
+
var pcbKeepoutProps = z76.union([
|
|
1774
1781
|
pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
1775
|
-
shape:
|
|
1782
|
+
shape: z76.literal("circle"),
|
|
1776
1783
|
radius: distance21
|
|
1777
1784
|
}),
|
|
1778
1785
|
pcbLayoutProps.extend({
|
|
1779
|
-
shape:
|
|
1786
|
+
shape: z76.literal("rect"),
|
|
1780
1787
|
width: distance21,
|
|
1781
1788
|
height: distance21
|
|
1782
1789
|
})
|
|
@@ -1784,20 +1791,20 @@ var pcbKeepoutProps = z75.union([
|
|
|
1784
1791
|
|
|
1785
1792
|
// lib/components/courtyard-rect.ts
|
|
1786
1793
|
import { distance as distance22 } from "circuit-json";
|
|
1787
|
-
import { z as
|
|
1794
|
+
import { z as z77 } from "zod";
|
|
1788
1795
|
var courtyardRectProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
1789
1796
|
width: distance22,
|
|
1790
1797
|
height: distance22,
|
|
1791
1798
|
strokeWidth: distance22.optional(),
|
|
1792
|
-
isFilled:
|
|
1793
|
-
hasStroke:
|
|
1794
|
-
isStrokeDashed:
|
|
1795
|
-
color:
|
|
1799
|
+
isFilled: z77.boolean().optional(),
|
|
1800
|
+
hasStroke: z77.boolean().optional(),
|
|
1801
|
+
isStrokeDashed: z77.boolean().optional(),
|
|
1802
|
+
color: z77.string().optional()
|
|
1796
1803
|
});
|
|
1797
1804
|
|
|
1798
1805
|
// lib/components/courtyard-outline.ts
|
|
1799
1806
|
import { length as length6 } from "circuit-json";
|
|
1800
|
-
import { z as
|
|
1807
|
+
import { z as z78 } from "zod";
|
|
1801
1808
|
var courtyardOutlineProps = pcbLayoutProps.omit({
|
|
1802
1809
|
pcbX: true,
|
|
1803
1810
|
pcbY: true,
|
|
@@ -1805,41 +1812,41 @@ var courtyardOutlineProps = pcbLayoutProps.omit({
|
|
|
1805
1812
|
pcbOffsetY: true,
|
|
1806
1813
|
pcbRotation: true
|
|
1807
1814
|
}).extend({
|
|
1808
|
-
outline:
|
|
1815
|
+
outline: z78.array(point),
|
|
1809
1816
|
strokeWidth: length6.optional(),
|
|
1810
|
-
isClosed:
|
|
1811
|
-
isStrokeDashed:
|
|
1812
|
-
color:
|
|
1817
|
+
isClosed: z78.boolean().optional(),
|
|
1818
|
+
isStrokeDashed: z78.boolean().optional(),
|
|
1819
|
+
color: z78.string().optional()
|
|
1813
1820
|
});
|
|
1814
1821
|
|
|
1815
1822
|
// lib/components/copper-pour.ts
|
|
1816
|
-
import { z as
|
|
1823
|
+
import { z as z79 } from "zod";
|
|
1817
1824
|
import { layer_ref as layer_ref6 } from "circuit-json";
|
|
1818
|
-
var copperPourProps =
|
|
1819
|
-
name:
|
|
1825
|
+
var copperPourProps = z79.object({
|
|
1826
|
+
name: z79.string().optional(),
|
|
1820
1827
|
layer: layer_ref6,
|
|
1821
|
-
connectsTo:
|
|
1828
|
+
connectsTo: z79.string(),
|
|
1822
1829
|
padMargin: distance.optional(),
|
|
1823
1830
|
traceMargin: distance.optional(),
|
|
1824
1831
|
clearance: distance.optional(),
|
|
1825
1832
|
boardEdgeMargin: distance.optional(),
|
|
1826
1833
|
cutoutMargin: distance.optional(),
|
|
1827
|
-
coveredWithSolderMask:
|
|
1834
|
+
coveredWithSolderMask: z79.boolean().optional().default(true)
|
|
1828
1835
|
});
|
|
1829
1836
|
expectTypesMatch(true);
|
|
1830
1837
|
|
|
1831
1838
|
// lib/components/cadassembly.ts
|
|
1832
1839
|
import { layer_ref as layer_ref7 } from "circuit-json";
|
|
1833
|
-
import { z as
|
|
1834
|
-
var cadassemblyProps =
|
|
1840
|
+
import { z as z80 } from "zod";
|
|
1841
|
+
var cadassemblyProps = z80.object({
|
|
1835
1842
|
originalLayer: layer_ref7.default("top").optional(),
|
|
1836
|
-
children:
|
|
1843
|
+
children: z80.any().optional()
|
|
1837
1844
|
});
|
|
1838
1845
|
expectTypesMatch(true);
|
|
1839
1846
|
|
|
1840
1847
|
// lib/components/cadmodel.ts
|
|
1841
|
-
import { z as
|
|
1842
|
-
var pcbPosition =
|
|
1848
|
+
import { z as z81 } from "zod";
|
|
1849
|
+
var pcbPosition = z81.object({
|
|
1843
1850
|
pcbX: distance.optional(),
|
|
1844
1851
|
pcbY: distance.optional(),
|
|
1845
1852
|
pcbOffsetX: distance.optional(),
|
|
@@ -1847,12 +1854,12 @@ var pcbPosition = z80.object({
|
|
|
1847
1854
|
pcbZ: distance.optional()
|
|
1848
1855
|
});
|
|
1849
1856
|
var cadModelBaseWithUrl = cadModelBase.extend({
|
|
1850
|
-
modelUrl:
|
|
1851
|
-
stepUrl:
|
|
1857
|
+
modelUrl: z81.string(),
|
|
1858
|
+
stepUrl: z81.string().optional()
|
|
1852
1859
|
});
|
|
1853
1860
|
var cadModelObject = cadModelBaseWithUrl.merge(pcbPosition);
|
|
1854
1861
|
expectTypesMatch(true);
|
|
1855
|
-
var cadmodelProps =
|
|
1862
|
+
var cadmodelProps = z81.union([z81.null(), z81.string(), cadModelObject]);
|
|
1856
1863
|
|
|
1857
1864
|
// lib/components/power-source.ts
|
|
1858
1865
|
import { voltage as voltage3 } from "circuit-json";
|
|
@@ -1862,9 +1869,9 @@ var powerSourceProps = commonComponentProps.extend({
|
|
|
1862
1869
|
|
|
1863
1870
|
// lib/components/voltagesource.ts
|
|
1864
1871
|
import { frequency as frequency4, rotation as rotation4, voltage as voltage4 } from "circuit-json";
|
|
1865
|
-
import { z as
|
|
1872
|
+
import { z as z82 } from "zod";
|
|
1866
1873
|
var voltageSourcePinLabels = ["pin1", "pin2", "pos", "neg"];
|
|
1867
|
-
var percentage =
|
|
1874
|
+
var percentage = z82.union([z82.string(), z82.number()]).transform((val) => {
|
|
1868
1875
|
if (typeof val === "string") {
|
|
1869
1876
|
if (val.endsWith("%")) {
|
|
1870
1877
|
return parseFloat(val.slice(0, -1)) / 100;
|
|
@@ -1873,13 +1880,13 @@ var percentage = z81.union([z81.string(), z81.number()]).transform((val) => {
|
|
|
1873
1880
|
}
|
|
1874
1881
|
return val;
|
|
1875
1882
|
}).pipe(
|
|
1876
|
-
|
|
1883
|
+
z82.number().min(0, "Duty cycle must be non-negative").max(1, "Duty cycle cannot be greater than 100%")
|
|
1877
1884
|
);
|
|
1878
1885
|
var voltageSourceProps = commonComponentProps.extend({
|
|
1879
1886
|
voltage: voltage4.optional(),
|
|
1880
1887
|
frequency: frequency4.optional(),
|
|
1881
1888
|
peakToPeakVoltage: voltage4.optional(),
|
|
1882
|
-
waveShape:
|
|
1889
|
+
waveShape: z82.enum(["sinewave", "square", "triangle", "sawtooth"]).optional(),
|
|
1883
1890
|
phase: rotation4.optional(),
|
|
1884
1891
|
dutyCycle: percentage.optional(),
|
|
1885
1892
|
connections: createConnectionsProp(voltageSourcePinLabels).optional()
|
|
@@ -1888,49 +1895,49 @@ var voltageSourcePins = lrPolarPins;
|
|
|
1888
1895
|
expectTypesMatch(true);
|
|
1889
1896
|
|
|
1890
1897
|
// lib/components/voltageprobe.ts
|
|
1891
|
-
import { z as
|
|
1898
|
+
import { z as z83 } from "zod";
|
|
1892
1899
|
var voltageProbeProps = commonComponentProps.omit({ name: true }).extend({
|
|
1893
|
-
name:
|
|
1894
|
-
connectsTo:
|
|
1895
|
-
referenceTo:
|
|
1896
|
-
color:
|
|
1900
|
+
name: z83.string().optional(),
|
|
1901
|
+
connectsTo: z83.string(),
|
|
1902
|
+
referenceTo: z83.string().optional(),
|
|
1903
|
+
color: z83.string().optional()
|
|
1897
1904
|
});
|
|
1898
1905
|
expectTypesMatch(true);
|
|
1899
1906
|
|
|
1900
1907
|
// lib/components/schematic-arc.ts
|
|
1901
1908
|
import { distance as distance23, point as point5, rotation as rotation5 } from "circuit-json";
|
|
1902
|
-
import { z as
|
|
1903
|
-
var schematicArcProps =
|
|
1909
|
+
import { z as z84 } from "zod";
|
|
1910
|
+
var schematicArcProps = z84.object({
|
|
1904
1911
|
center: point5,
|
|
1905
1912
|
radius: distance23,
|
|
1906
1913
|
startAngleDegrees: rotation5,
|
|
1907
1914
|
endAngleDegrees: rotation5,
|
|
1908
|
-
direction:
|
|
1915
|
+
direction: z84.enum(["clockwise", "counterclockwise"]).default("counterclockwise"),
|
|
1909
1916
|
strokeWidth: distance23.optional(),
|
|
1910
|
-
color:
|
|
1911
|
-
isDashed:
|
|
1917
|
+
color: z84.string().optional(),
|
|
1918
|
+
isDashed: z84.boolean().optional().default(false)
|
|
1912
1919
|
});
|
|
1913
1920
|
|
|
1914
1921
|
// lib/components/schematic-box.ts
|
|
1915
1922
|
import { distance as distance24 } from "circuit-json";
|
|
1916
|
-
import { z as
|
|
1917
|
-
var schematicBoxProps =
|
|
1923
|
+
import { z as z85 } from "zod";
|
|
1924
|
+
var schematicBoxProps = z85.object({
|
|
1918
1925
|
schX: distance24.optional(),
|
|
1919
1926
|
schY: distance24.optional(),
|
|
1920
1927
|
width: distance24.optional(),
|
|
1921
1928
|
height: distance24.optional(),
|
|
1922
|
-
overlay:
|
|
1929
|
+
overlay: z85.array(z85.string()).optional(),
|
|
1923
1930
|
padding: distance24.optional(),
|
|
1924
1931
|
paddingLeft: distance24.optional(),
|
|
1925
1932
|
paddingRight: distance24.optional(),
|
|
1926
1933
|
paddingTop: distance24.optional(),
|
|
1927
1934
|
paddingBottom: distance24.optional(),
|
|
1928
|
-
title:
|
|
1935
|
+
title: z85.string().optional(),
|
|
1929
1936
|
titleAlignment: ninePointAnchor.default("top_left"),
|
|
1930
|
-
titleColor:
|
|
1937
|
+
titleColor: z85.string().optional(),
|
|
1931
1938
|
titleFontSize: distance24.optional(),
|
|
1932
|
-
titleInside:
|
|
1933
|
-
strokeStyle:
|
|
1939
|
+
titleInside: z85.boolean().default(false),
|
|
1940
|
+
strokeStyle: z85.enum(["solid", "dashed"]).default("solid")
|
|
1934
1941
|
}).refine(
|
|
1935
1942
|
(elm) => elm.width !== void 0 && elm.height !== void 0 || Array.isArray(elm.overlay) && elm.overlay.length > 0,
|
|
1936
1943
|
{
|
|
@@ -1945,54 +1952,54 @@ var schematicBoxProps = z84.object({
|
|
|
1945
1952
|
|
|
1946
1953
|
// lib/components/schematic-circle.ts
|
|
1947
1954
|
import { distance as distance25, point as point6 } from "circuit-json";
|
|
1948
|
-
import { z as
|
|
1949
|
-
var schematicCircleProps =
|
|
1955
|
+
import { z as z86 } from "zod";
|
|
1956
|
+
var schematicCircleProps = z86.object({
|
|
1950
1957
|
center: point6,
|
|
1951
1958
|
radius: distance25,
|
|
1952
1959
|
strokeWidth: distance25.optional(),
|
|
1953
|
-
color:
|
|
1954
|
-
isFilled:
|
|
1955
|
-
fillColor:
|
|
1956
|
-
isDashed:
|
|
1960
|
+
color: z86.string().optional(),
|
|
1961
|
+
isFilled: z86.boolean().optional().default(false),
|
|
1962
|
+
fillColor: z86.string().optional(),
|
|
1963
|
+
isDashed: z86.boolean().optional().default(false)
|
|
1957
1964
|
});
|
|
1958
1965
|
|
|
1959
1966
|
// lib/components/schematic-rect.ts
|
|
1960
1967
|
import { distance as distance26, rotation as rotation6 } from "circuit-json";
|
|
1961
|
-
import { z as
|
|
1962
|
-
var schematicRectProps =
|
|
1968
|
+
import { z as z87 } from "zod";
|
|
1969
|
+
var schematicRectProps = z87.object({
|
|
1963
1970
|
schX: distance26.optional(),
|
|
1964
1971
|
schY: distance26.optional(),
|
|
1965
1972
|
width: distance26,
|
|
1966
1973
|
height: distance26,
|
|
1967
1974
|
rotation: rotation6.default(0),
|
|
1968
1975
|
strokeWidth: distance26.optional(),
|
|
1969
|
-
color:
|
|
1970
|
-
isFilled:
|
|
1971
|
-
fillColor:
|
|
1972
|
-
isDashed:
|
|
1976
|
+
color: z87.string().optional(),
|
|
1977
|
+
isFilled: z87.boolean().optional().default(false),
|
|
1978
|
+
fillColor: z87.string().optional(),
|
|
1979
|
+
isDashed: z87.boolean().optional().default(false),
|
|
1973
1980
|
cornerRadius: distance26.optional()
|
|
1974
1981
|
});
|
|
1975
1982
|
|
|
1976
1983
|
// lib/components/schematic-line.ts
|
|
1977
1984
|
import { distance as distance27 } from "circuit-json";
|
|
1978
|
-
import { z as
|
|
1979
|
-
var schematicLineProps =
|
|
1985
|
+
import { z as z88 } from "zod";
|
|
1986
|
+
var schematicLineProps = z88.object({
|
|
1980
1987
|
x1: distance27,
|
|
1981
1988
|
y1: distance27,
|
|
1982
1989
|
x2: distance27,
|
|
1983
1990
|
y2: distance27,
|
|
1984
1991
|
strokeWidth: distance27.optional(),
|
|
1985
|
-
color:
|
|
1986
|
-
isDashed:
|
|
1992
|
+
color: z88.string().optional(),
|
|
1993
|
+
isDashed: z88.boolean().optional().default(false)
|
|
1987
1994
|
});
|
|
1988
1995
|
|
|
1989
1996
|
// lib/components/schematic-text.ts
|
|
1990
1997
|
import { distance as distance28, rotation as rotation7 } from "circuit-json";
|
|
1991
|
-
import { z as
|
|
1998
|
+
import { z as z90 } from "zod";
|
|
1992
1999
|
|
|
1993
2000
|
// lib/common/fivePointAnchor.ts
|
|
1994
|
-
import { z as
|
|
1995
|
-
var fivePointAnchor =
|
|
2001
|
+
import { z as z89 } from "zod";
|
|
2002
|
+
var fivePointAnchor = z89.enum([
|
|
1996
2003
|
"center",
|
|
1997
2004
|
"left",
|
|
1998
2005
|
"right",
|
|
@@ -2001,32 +2008,32 @@ var fivePointAnchor = z88.enum([
|
|
|
2001
2008
|
]);
|
|
2002
2009
|
|
|
2003
2010
|
// lib/components/schematic-text.ts
|
|
2004
|
-
var schematicTextProps =
|
|
2011
|
+
var schematicTextProps = z90.object({
|
|
2005
2012
|
schX: distance28.optional(),
|
|
2006
2013
|
schY: distance28.optional(),
|
|
2007
|
-
text:
|
|
2008
|
-
fontSize:
|
|
2009
|
-
anchor:
|
|
2010
|
-
color:
|
|
2014
|
+
text: z90.string(),
|
|
2015
|
+
fontSize: z90.number().default(1),
|
|
2016
|
+
anchor: z90.union([fivePointAnchor.describe("legacy"), ninePointAnchor]).default("center"),
|
|
2017
|
+
color: z90.string().default("#000000"),
|
|
2011
2018
|
schRotation: rotation7.default(0)
|
|
2012
2019
|
});
|
|
2013
2020
|
|
|
2014
2021
|
// lib/components/schematic-path.ts
|
|
2015
2022
|
import { point as point8 } from "circuit-json";
|
|
2016
|
-
import { z as
|
|
2017
|
-
var schematicPathProps =
|
|
2018
|
-
points:
|
|
2019
|
-
isFilled:
|
|
2020
|
-
fillColor:
|
|
2023
|
+
import { z as z91 } from "zod";
|
|
2024
|
+
var schematicPathProps = z91.object({
|
|
2025
|
+
points: z91.array(point8),
|
|
2026
|
+
isFilled: z91.boolean().optional().default(false),
|
|
2027
|
+
fillColor: z91.enum(["red", "blue"]).optional()
|
|
2021
2028
|
});
|
|
2022
2029
|
|
|
2023
2030
|
// lib/components/schematic-table.ts
|
|
2024
2031
|
import { distance as distance29 } from "circuit-json";
|
|
2025
|
-
import { z as
|
|
2026
|
-
var schematicTableProps =
|
|
2032
|
+
import { z as z92 } from "zod";
|
|
2033
|
+
var schematicTableProps = z92.object({
|
|
2027
2034
|
schX: distance29.optional(),
|
|
2028
2035
|
schY: distance29.optional(),
|
|
2029
|
-
children:
|
|
2036
|
+
children: z92.any().optional(),
|
|
2030
2037
|
cellPadding: distance29.optional(),
|
|
2031
2038
|
borderWidth: distance29.optional(),
|
|
2032
2039
|
anchor: ninePointAnchor.optional(),
|
|
@@ -2036,62 +2043,62 @@ expectTypesMatch(true);
|
|
|
2036
2043
|
|
|
2037
2044
|
// lib/components/schematic-row.ts
|
|
2038
2045
|
import { distance as distance30 } from "circuit-json";
|
|
2039
|
-
import { z as
|
|
2040
|
-
var schematicRowProps =
|
|
2041
|
-
children:
|
|
2046
|
+
import { z as z93 } from "zod";
|
|
2047
|
+
var schematicRowProps = z93.object({
|
|
2048
|
+
children: z93.any().optional(),
|
|
2042
2049
|
height: distance30.optional()
|
|
2043
2050
|
});
|
|
2044
2051
|
expectTypesMatch(true);
|
|
2045
2052
|
|
|
2046
2053
|
// lib/components/schematic-cell.ts
|
|
2047
2054
|
import { distance as distance31 } from "circuit-json";
|
|
2048
|
-
import { z as
|
|
2049
|
-
var schematicCellProps =
|
|
2050
|
-
children:
|
|
2051
|
-
horizontalAlign:
|
|
2052
|
-
verticalAlign:
|
|
2055
|
+
import { z as z94 } from "zod";
|
|
2056
|
+
var schematicCellProps = z94.object({
|
|
2057
|
+
children: z94.string().optional(),
|
|
2058
|
+
horizontalAlign: z94.enum(["left", "center", "right"]).optional(),
|
|
2059
|
+
verticalAlign: z94.enum(["top", "middle", "bottom"]).optional(),
|
|
2053
2060
|
fontSize: distance31.optional(),
|
|
2054
|
-
rowSpan:
|
|
2055
|
-
colSpan:
|
|
2061
|
+
rowSpan: z94.number().optional(),
|
|
2062
|
+
colSpan: z94.number().optional(),
|
|
2056
2063
|
width: distance31.optional(),
|
|
2057
|
-
text:
|
|
2064
|
+
text: z94.string().optional()
|
|
2058
2065
|
});
|
|
2059
2066
|
expectTypesMatch(true);
|
|
2060
2067
|
|
|
2061
2068
|
// lib/components/copper-text.ts
|
|
2062
2069
|
import { layer_ref as layer_ref8, length as length7 } from "circuit-json";
|
|
2063
|
-
import { z as
|
|
2070
|
+
import { z as z95 } from "zod";
|
|
2064
2071
|
var copperTextProps = pcbLayoutProps.extend({
|
|
2065
|
-
text:
|
|
2072
|
+
text: z95.string(),
|
|
2066
2073
|
anchorAlignment: ninePointAnchor.default("center"),
|
|
2067
|
-
font:
|
|
2074
|
+
font: z95.enum(["tscircuit2024"]).optional(),
|
|
2068
2075
|
fontSize: length7.optional(),
|
|
2069
|
-
layers:
|
|
2076
|
+
layers: z95.array(layer_ref8).optional()
|
|
2070
2077
|
});
|
|
2071
2078
|
|
|
2072
2079
|
// lib/components/silkscreen-text.ts
|
|
2073
2080
|
import { layer_ref as layer_ref9, length as length8 } from "circuit-json";
|
|
2074
|
-
import { z as
|
|
2081
|
+
import { z as z96 } from "zod";
|
|
2075
2082
|
var silkscreenTextProps = pcbLayoutProps.extend({
|
|
2076
|
-
text:
|
|
2083
|
+
text: z96.string(),
|
|
2077
2084
|
anchorAlignment: ninePointAnchor.default("center"),
|
|
2078
|
-
font:
|
|
2085
|
+
font: z96.enum(["tscircuit2024"]).optional(),
|
|
2079
2086
|
fontSize: length8.optional(),
|
|
2080
2087
|
/**
|
|
2081
2088
|
* If true, text will knock out underlying silkscreen
|
|
2082
2089
|
*/
|
|
2083
|
-
isKnockout:
|
|
2090
|
+
isKnockout: z96.boolean().optional(),
|
|
2084
2091
|
knockoutPadding: length8.optional(),
|
|
2085
2092
|
knockoutPaddingLeft: length8.optional(),
|
|
2086
2093
|
knockoutPaddingRight: length8.optional(),
|
|
2087
2094
|
knockoutPaddingTop: length8.optional(),
|
|
2088
2095
|
knockoutPaddingBottom: length8.optional(),
|
|
2089
|
-
layers:
|
|
2096
|
+
layers: z96.array(layer_ref9).optional()
|
|
2090
2097
|
});
|
|
2091
2098
|
|
|
2092
2099
|
// lib/components/silkscreen-path.ts
|
|
2093
2100
|
import { length as length9, route_hint_point as route_hint_point5 } from "circuit-json";
|
|
2094
|
-
import { z as
|
|
2101
|
+
import { z as z97 } from "zod";
|
|
2095
2102
|
var silkscreenPathProps = pcbLayoutProps.omit({
|
|
2096
2103
|
pcbX: true,
|
|
2097
2104
|
pcbY: true,
|
|
@@ -2099,7 +2106,7 @@ var silkscreenPathProps = pcbLayoutProps.omit({
|
|
|
2099
2106
|
pcbOffsetY: true,
|
|
2100
2107
|
pcbRotation: true
|
|
2101
2108
|
}).extend({
|
|
2102
|
-
route:
|
|
2109
|
+
route: z97.array(route_hint_point5),
|
|
2103
2110
|
strokeWidth: length9.optional()
|
|
2104
2111
|
});
|
|
2105
2112
|
|
|
@@ -2121,10 +2128,10 @@ var silkscreenLineProps = pcbLayoutProps.omit({
|
|
|
2121
2128
|
|
|
2122
2129
|
// lib/components/silkscreen-rect.ts
|
|
2123
2130
|
import { distance as distance33 } from "circuit-json";
|
|
2124
|
-
import { z as
|
|
2131
|
+
import { z as z98 } from "zod";
|
|
2125
2132
|
var silkscreenRectProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
2126
|
-
filled:
|
|
2127
|
-
stroke:
|
|
2133
|
+
filled: z98.boolean().default(true).optional(),
|
|
2134
|
+
stroke: z98.enum(["dashed", "solid", "none"]).optional(),
|
|
2128
2135
|
strokeWidth: distance33.optional(),
|
|
2129
2136
|
width: distance33,
|
|
2130
2137
|
height: distance33,
|
|
@@ -2133,66 +2140,66 @@ var silkscreenRectProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
|
2133
2140
|
|
|
2134
2141
|
// lib/components/silkscreen-circle.ts
|
|
2135
2142
|
import { distance as distance34 } from "circuit-json";
|
|
2136
|
-
import { z as
|
|
2143
|
+
import { z as z99 } from "zod";
|
|
2137
2144
|
var silkscreenCircleProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
2138
|
-
isFilled:
|
|
2139
|
-
isOutline:
|
|
2145
|
+
isFilled: z99.boolean().optional(),
|
|
2146
|
+
isOutline: z99.boolean().optional(),
|
|
2140
2147
|
strokeWidth: distance34.optional(),
|
|
2141
2148
|
radius: distance34
|
|
2142
2149
|
});
|
|
2143
2150
|
|
|
2144
2151
|
// lib/components/trace-hint.ts
|
|
2145
2152
|
import { distance as distance35, layer_ref as layer_ref10, route_hint_point as route_hint_point6 } from "circuit-json";
|
|
2146
|
-
import { z as
|
|
2147
|
-
var routeHintPointProps =
|
|
2153
|
+
import { z as z100 } from "zod";
|
|
2154
|
+
var routeHintPointProps = z100.object({
|
|
2148
2155
|
x: distance35,
|
|
2149
2156
|
y: distance35,
|
|
2150
|
-
via:
|
|
2157
|
+
via: z100.boolean().optional(),
|
|
2151
2158
|
toLayer: layer_ref10.optional()
|
|
2152
2159
|
});
|
|
2153
|
-
var traceHintProps =
|
|
2154
|
-
for:
|
|
2160
|
+
var traceHintProps = z100.object({
|
|
2161
|
+
for: z100.string().optional().describe(
|
|
2155
2162
|
"Selector for the port you're targeting, not required if you're inside a trace"
|
|
2156
2163
|
),
|
|
2157
|
-
order:
|
|
2164
|
+
order: z100.number().optional(),
|
|
2158
2165
|
offset: route_hint_point6.or(routeHintPointProps).optional(),
|
|
2159
|
-
offsets:
|
|
2160
|
-
traceWidth:
|
|
2166
|
+
offsets: z100.array(route_hint_point6).or(z100.array(routeHintPointProps)).optional(),
|
|
2167
|
+
traceWidth: z100.number().optional()
|
|
2161
2168
|
});
|
|
2162
2169
|
|
|
2163
2170
|
// lib/components/port.ts
|
|
2164
|
-
import { z as
|
|
2171
|
+
import { z as z101 } from "zod";
|
|
2165
2172
|
var portProps = commonLayoutProps.extend({
|
|
2166
|
-
name:
|
|
2167
|
-
pinNumber:
|
|
2168
|
-
aliases:
|
|
2173
|
+
name: z101.string(),
|
|
2174
|
+
pinNumber: z101.number().optional(),
|
|
2175
|
+
aliases: z101.array(z101.string()).optional(),
|
|
2169
2176
|
direction,
|
|
2170
|
-
connectsTo:
|
|
2177
|
+
connectsTo: z101.string().or(z101.array(z101.string())).optional()
|
|
2171
2178
|
});
|
|
2172
2179
|
|
|
2173
2180
|
// lib/components/pcb-note-text.ts
|
|
2174
2181
|
import { length as length10 } from "circuit-json";
|
|
2175
|
-
import { z as
|
|
2182
|
+
import { z as z102 } from "zod";
|
|
2176
2183
|
var pcbNoteTextProps = pcbLayoutProps.extend({
|
|
2177
|
-
text:
|
|
2178
|
-
anchorAlignment:
|
|
2179
|
-
font:
|
|
2184
|
+
text: z102.string(),
|
|
2185
|
+
anchorAlignment: z102.enum(["center", "top_left", "top_right", "bottom_left", "bottom_right"]).default("center"),
|
|
2186
|
+
font: z102.enum(["tscircuit2024"]).optional(),
|
|
2180
2187
|
fontSize: length10.optional(),
|
|
2181
|
-
color:
|
|
2188
|
+
color: z102.string().optional()
|
|
2182
2189
|
});
|
|
2183
2190
|
expectTypesMatch(true);
|
|
2184
2191
|
|
|
2185
2192
|
// lib/components/pcb-note-rect.ts
|
|
2186
2193
|
import { distance as distance36 } from "circuit-json";
|
|
2187
|
-
import { z as
|
|
2194
|
+
import { z as z103 } from "zod";
|
|
2188
2195
|
var pcbNoteRectProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
2189
2196
|
width: distance36,
|
|
2190
2197
|
height: distance36,
|
|
2191
2198
|
strokeWidth: distance36.optional(),
|
|
2192
|
-
isFilled:
|
|
2193
|
-
hasStroke:
|
|
2194
|
-
isStrokeDashed:
|
|
2195
|
-
color:
|
|
2199
|
+
isFilled: z103.boolean().optional(),
|
|
2200
|
+
hasStroke: z103.boolean().optional(),
|
|
2201
|
+
isStrokeDashed: z103.boolean().optional(),
|
|
2202
|
+
color: z103.string().optional(),
|
|
2196
2203
|
cornerRadius: distance36.optional()
|
|
2197
2204
|
});
|
|
2198
2205
|
expectTypesMatch(true);
|
|
@@ -2202,7 +2209,7 @@ import {
|
|
|
2202
2209
|
length as length11,
|
|
2203
2210
|
route_hint_point as route_hint_point7
|
|
2204
2211
|
} from "circuit-json";
|
|
2205
|
-
import { z as
|
|
2212
|
+
import { z as z104 } from "zod";
|
|
2206
2213
|
var pcbNotePathProps = pcbLayoutProps.omit({
|
|
2207
2214
|
pcbX: true,
|
|
2208
2215
|
pcbY: true,
|
|
@@ -2210,15 +2217,15 @@ var pcbNotePathProps = pcbLayoutProps.omit({
|
|
|
2210
2217
|
pcbOffsetY: true,
|
|
2211
2218
|
pcbRotation: true
|
|
2212
2219
|
}).extend({
|
|
2213
|
-
route:
|
|
2220
|
+
route: z104.array(route_hint_point7),
|
|
2214
2221
|
strokeWidth: length11.optional(),
|
|
2215
|
-
color:
|
|
2222
|
+
color: z104.string().optional()
|
|
2216
2223
|
});
|
|
2217
2224
|
expectTypesMatch(true);
|
|
2218
2225
|
|
|
2219
2226
|
// lib/components/pcb-note-line.ts
|
|
2220
2227
|
import { distance as distance37 } from "circuit-json";
|
|
2221
|
-
import { z as
|
|
2228
|
+
import { z as z105 } from "zod";
|
|
2222
2229
|
var pcbNoteLineProps = pcbLayoutProps.omit({
|
|
2223
2230
|
pcbX: true,
|
|
2224
2231
|
pcbY: true,
|
|
@@ -2231,15 +2238,15 @@ var pcbNoteLineProps = pcbLayoutProps.omit({
|
|
|
2231
2238
|
x2: distance37,
|
|
2232
2239
|
y2: distance37,
|
|
2233
2240
|
strokeWidth: distance37.optional(),
|
|
2234
|
-
color:
|
|
2235
|
-
isDashed:
|
|
2241
|
+
color: z105.string().optional(),
|
|
2242
|
+
isDashed: z105.boolean().optional()
|
|
2236
2243
|
});
|
|
2237
2244
|
expectTypesMatch(true);
|
|
2238
2245
|
|
|
2239
2246
|
// lib/components/pcb-note-dimension.ts
|
|
2240
2247
|
import { distance as distance38, length as length12 } from "circuit-json";
|
|
2241
|
-
import { z as
|
|
2242
|
-
var dimensionTarget2 =
|
|
2248
|
+
import { z as z106 } from "zod";
|
|
2249
|
+
var dimensionTarget2 = z106.union([z106.string(), point]);
|
|
2243
2250
|
var pcbNoteDimensionProps = pcbLayoutProps.omit({
|
|
2244
2251
|
pcbX: true,
|
|
2245
2252
|
pcbY: true,
|
|
@@ -2249,93 +2256,93 @@ var pcbNoteDimensionProps = pcbLayoutProps.omit({
|
|
|
2249
2256
|
}).extend({
|
|
2250
2257
|
from: dimensionTarget2,
|
|
2251
2258
|
to: dimensionTarget2,
|
|
2252
|
-
text:
|
|
2259
|
+
text: z106.string().optional(),
|
|
2253
2260
|
offset: distance38.optional(),
|
|
2254
|
-
font:
|
|
2261
|
+
font: z106.enum(["tscircuit2024"]).optional(),
|
|
2255
2262
|
fontSize: length12.optional(),
|
|
2256
|
-
color:
|
|
2263
|
+
color: z106.string().optional(),
|
|
2257
2264
|
arrowSize: distance38.optional(),
|
|
2258
|
-
units:
|
|
2259
|
-
outerEdgeToEdge:
|
|
2260
|
-
centerToCenter:
|
|
2261
|
-
innerEdgeToEdge:
|
|
2265
|
+
units: z106.enum(["in", "mm"]).optional(),
|
|
2266
|
+
outerEdgeToEdge: z106.literal(true).optional(),
|
|
2267
|
+
centerToCenter: z106.literal(true).optional(),
|
|
2268
|
+
innerEdgeToEdge: z106.literal(true).optional()
|
|
2262
2269
|
});
|
|
2263
2270
|
expectTypesMatch(
|
|
2264
2271
|
true
|
|
2265
2272
|
);
|
|
2266
2273
|
|
|
2267
2274
|
// lib/platformConfig.ts
|
|
2268
|
-
import { z as
|
|
2269
|
-
var unvalidatedCircuitJson =
|
|
2270
|
-
var footprintLibraryResult =
|
|
2271
|
-
footprintCircuitJson:
|
|
2275
|
+
import { z as z107 } from "zod";
|
|
2276
|
+
var unvalidatedCircuitJson = z107.array(z107.any()).describe("Circuit JSON");
|
|
2277
|
+
var footprintLibraryResult = z107.object({
|
|
2278
|
+
footprintCircuitJson: z107.array(z107.any()),
|
|
2272
2279
|
cadModel: cadModelProp.optional()
|
|
2273
2280
|
});
|
|
2274
|
-
var pathToCircuitJsonFn =
|
|
2275
|
-
|
|
2276
|
-
|
|
2277
|
-
|
|
2278
|
-
).returns(
|
|
2281
|
+
var pathToCircuitJsonFn = z107.function().args(z107.string()).returns(z107.promise(footprintLibraryResult)).or(
|
|
2282
|
+
z107.function().args(
|
|
2283
|
+
z107.string(),
|
|
2284
|
+
z107.object({ resolvedPcbStyle: pcbStyle.optional() }).optional()
|
|
2285
|
+
).returns(z107.promise(footprintLibraryResult))
|
|
2279
2286
|
).describe("A function that takes a path and returns Circuit JSON");
|
|
2280
|
-
var footprintFileParserEntry =
|
|
2281
|
-
loadFromUrl:
|
|
2287
|
+
var footprintFileParserEntry = z107.object({
|
|
2288
|
+
loadFromUrl: z107.function().args(z107.string()).returns(z107.promise(footprintLibraryResult)).describe(
|
|
2282
2289
|
"A function that takes a footprint file URL and returns Circuit JSON"
|
|
2283
2290
|
)
|
|
2284
2291
|
});
|
|
2285
|
-
var spiceEngineSimulationResult =
|
|
2286
|
-
engineVersionString:
|
|
2292
|
+
var spiceEngineSimulationResult = z107.object({
|
|
2293
|
+
engineVersionString: z107.string().optional(),
|
|
2287
2294
|
simulationResultCircuitJson: unvalidatedCircuitJson
|
|
2288
2295
|
});
|
|
2289
|
-
var spiceEngineZod =
|
|
2290
|
-
simulate:
|
|
2296
|
+
var spiceEngineZod = z107.object({
|
|
2297
|
+
simulate: z107.function().args(z107.string()).returns(z107.promise(spiceEngineSimulationResult)).describe(
|
|
2291
2298
|
"A function that takes a SPICE string and returns a simulation result"
|
|
2292
2299
|
)
|
|
2293
2300
|
});
|
|
2294
|
-
var defaultSpiceEngine =
|
|
2301
|
+
var defaultSpiceEngine = z107.custom(
|
|
2295
2302
|
(value) => typeof value === "string"
|
|
2296
2303
|
);
|
|
2297
|
-
var autorouterInstance =
|
|
2298
|
-
run:
|
|
2299
|
-
getOutputSimpleRouteJson:
|
|
2304
|
+
var autorouterInstance = z107.object({
|
|
2305
|
+
run: z107.function().args().returns(z107.promise(z107.unknown())).describe("Run the autorouter"),
|
|
2306
|
+
getOutputSimpleRouteJson: z107.function().args().returns(z107.promise(z107.any())).describe("Get the resulting SimpleRouteJson")
|
|
2300
2307
|
});
|
|
2301
|
-
var autorouterDefinition =
|
|
2302
|
-
createAutorouter:
|
|
2308
|
+
var autorouterDefinition = z107.object({
|
|
2309
|
+
createAutorouter: z107.function().args(z107.any(), z107.any().optional()).returns(z107.union([autorouterInstance, z107.promise(autorouterInstance)])).describe("Create an autorouter instance")
|
|
2303
2310
|
});
|
|
2304
|
-
var platformConfig =
|
|
2311
|
+
var platformConfig = z107.object({
|
|
2305
2312
|
partsEngine: partsEngine.optional(),
|
|
2306
2313
|
autorouter: autorouterProp.optional(),
|
|
2307
|
-
autorouterMap:
|
|
2308
|
-
registryApiUrl:
|
|
2309
|
-
cloudAutorouterUrl:
|
|
2310
|
-
projectName:
|
|
2311
|
-
projectBaseUrl:
|
|
2312
|
-
version:
|
|
2313
|
-
url:
|
|
2314
|
-
printBoardInformationToSilkscreen:
|
|
2315
|
-
includeBoardFiles:
|
|
2314
|
+
autorouterMap: z107.record(z107.string(), autorouterDefinition).optional(),
|
|
2315
|
+
registryApiUrl: z107.string().optional(),
|
|
2316
|
+
cloudAutorouterUrl: z107.string().optional(),
|
|
2317
|
+
projectName: z107.string().optional(),
|
|
2318
|
+
projectBaseUrl: z107.string().optional(),
|
|
2319
|
+
version: z107.string().optional(),
|
|
2320
|
+
url: z107.string().optional(),
|
|
2321
|
+
printBoardInformationToSilkscreen: z107.boolean().optional(),
|
|
2322
|
+
includeBoardFiles: z107.array(z107.string()).describe(
|
|
2316
2323
|
'The board files to automatically build with "tsci build", defaults to ["**/*.circuit.tsx"]. Can be an array of files or globs'
|
|
2317
2324
|
).optional(),
|
|
2318
|
-
snapshotsDir:
|
|
2325
|
+
snapshotsDir: z107.string().describe(
|
|
2319
2326
|
'The directory where snapshots are stored for "tsci snapshot", defaults to "tests/__snapshots__"'
|
|
2320
2327
|
).optional(),
|
|
2321
2328
|
defaultSpiceEngine: defaultSpiceEngine.optional(),
|
|
2322
|
-
localCacheEngine:
|
|
2323
|
-
pcbDisabled:
|
|
2324
|
-
schematicDisabled:
|
|
2325
|
-
partsEngineDisabled:
|
|
2326
|
-
spiceEngineMap:
|
|
2327
|
-
footprintLibraryMap:
|
|
2328
|
-
|
|
2329
|
-
|
|
2329
|
+
localCacheEngine: z107.any().optional(),
|
|
2330
|
+
pcbDisabled: z107.boolean().optional(),
|
|
2331
|
+
schematicDisabled: z107.boolean().optional(),
|
|
2332
|
+
partsEngineDisabled: z107.boolean().optional(),
|
|
2333
|
+
spiceEngineMap: z107.record(z107.string(), spiceEngineZod).optional(),
|
|
2334
|
+
footprintLibraryMap: z107.record(
|
|
2335
|
+
z107.string(),
|
|
2336
|
+
z107.union([
|
|
2330
2337
|
pathToCircuitJsonFn,
|
|
2331
|
-
|
|
2332
|
-
|
|
2333
|
-
|
|
2338
|
+
z107.record(
|
|
2339
|
+
z107.string(),
|
|
2340
|
+
z107.union([unvalidatedCircuitJson, pathToCircuitJsonFn])
|
|
2334
2341
|
)
|
|
2335
2342
|
])
|
|
2336
2343
|
).optional(),
|
|
2337
|
-
footprintFileParserMap:
|
|
2338
|
-
resolveProjectStaticFileImportUrl:
|
|
2344
|
+
footprintFileParserMap: z107.record(z107.string(), footprintFileParserEntry).optional(),
|
|
2345
|
+
resolveProjectStaticFileImportUrl: z107.function().args(z107.string()).returns(z107.promise(z107.string())).describe(
|
|
2339
2346
|
"A function that returns a string URL for static files for the project"
|
|
2340
2347
|
).optional()
|
|
2341
2348
|
});
|
|
@@ -2425,6 +2432,7 @@ export {
|
|
|
2425
2432
|
holeProps,
|
|
2426
2433
|
inductorPins,
|
|
2427
2434
|
inductorProps,
|
|
2435
|
+
interconnectProps,
|
|
2428
2436
|
jumperProps,
|
|
2429
2437
|
layoutConfig,
|
|
2430
2438
|
ledPins,
|