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