@tscircuit/props 0.0.597 → 0.0.599
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 +25 -0
- package/dist/index.d.ts +158 -1
- package/dist/index.js +903 -880
- package/dist/index.js.map +1 -1
- package/lib/components/autoroutingphase.ts +23 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -16606,57 +16606,75 @@ import "zod";
|
|
|
16606
16606
|
var subpanelProps = panelProps;
|
|
16607
16607
|
expectTypesMatch(true);
|
|
16608
16608
|
|
|
16609
|
+
// lib/common/fanoutBoundaryPadding.ts
|
|
16610
|
+
import { z as z45 } from "zod";
|
|
16611
|
+
var nonnegativeDistance = distance.refine((value) => value >= 0, {
|
|
16612
|
+
message: "Fanout boundary padding cannot be negative"
|
|
16613
|
+
});
|
|
16614
|
+
var fanoutBoundaryPadding = z45.union([
|
|
16615
|
+
nonnegativeDistance,
|
|
16616
|
+
z45.object({
|
|
16617
|
+
top: nonnegativeDistance.optional(),
|
|
16618
|
+
right: nonnegativeDistance.optional(),
|
|
16619
|
+
bottom: nonnegativeDistance.optional(),
|
|
16620
|
+
left: nonnegativeDistance.optional()
|
|
16621
|
+
})
|
|
16622
|
+
]);
|
|
16623
|
+
expectTypesMatch(
|
|
16624
|
+
true
|
|
16625
|
+
);
|
|
16626
|
+
|
|
16609
16627
|
// lib/components/breakout.ts
|
|
16610
|
-
import { distance as distance12 } from "circuit-json";
|
|
16611
16628
|
import "zod";
|
|
16612
16629
|
var breakoutProps = subcircuitGroupProps.extend({
|
|
16613
16630
|
autorouter: autorouterProp.default("fanout"),
|
|
16614
|
-
padding:
|
|
16615
|
-
paddingLeft:
|
|
16616
|
-
paddingRight:
|
|
16617
|
-
paddingTop:
|
|
16618
|
-
paddingBottom:
|
|
16631
|
+
padding: distance.optional(),
|
|
16632
|
+
paddingLeft: distance.optional(),
|
|
16633
|
+
paddingRight: distance.optional(),
|
|
16634
|
+
paddingTop: distance.optional(),
|
|
16635
|
+
paddingBottom: distance.optional(),
|
|
16636
|
+
fanoutBoundaryPadding: fanoutBoundaryPadding.optional()
|
|
16619
16637
|
});
|
|
16620
16638
|
expectTypesMatch(true);
|
|
16621
16639
|
|
|
16622
16640
|
// lib/components/chip.ts
|
|
16623
|
-
import { distance as
|
|
16641
|
+
import { distance as distance12, supplier_name as supplier_name2 } from "circuit-json";
|
|
16624
16642
|
import { isValidElement } from "react";
|
|
16625
|
-
import { z as
|
|
16626
|
-
var connectionTarget2 =
|
|
16627
|
-
var noConnectProp =
|
|
16628
|
-
var connectionsProp =
|
|
16629
|
-
var spicemodelElement =
|
|
16643
|
+
import { z as z47 } from "zod";
|
|
16644
|
+
var connectionTarget2 = z47.string().or(z47.array(z47.string()).readonly()).or(z47.array(z47.string()));
|
|
16645
|
+
var noConnectProp = z47.array(schematicPinLabel).readonly().or(z47.array(schematicPinLabel));
|
|
16646
|
+
var connectionsProp = z47.custom().pipe(z47.record(z47.string(), connectionTarget2));
|
|
16647
|
+
var spicemodelElement = z47.custom(
|
|
16630
16648
|
(v) => !!v && typeof v === "object" && "type" in v && "props" in v
|
|
16631
16649
|
);
|
|
16632
|
-
var internalCircuitElement =
|
|
16650
|
+
var internalCircuitElement = z47.custom(
|
|
16633
16651
|
(value) => isValidElement(value) && value.type === "internalcircuit"
|
|
16634
16652
|
);
|
|
16635
|
-
var pinLabelsProp =
|
|
16653
|
+
var pinLabelsProp = z47.record(
|
|
16636
16654
|
schematicPinLabel,
|
|
16637
|
-
schematicPinLabel.or(
|
|
16655
|
+
schematicPinLabel.or(z47.array(schematicPinLabel).readonly()).or(z47.array(schematicPinLabel))
|
|
16638
16656
|
);
|
|
16639
16657
|
expectTypesMatch(true);
|
|
16640
|
-
var pinCompatibleVariant =
|
|
16641
|
-
manufacturerPartNumber:
|
|
16642
|
-
supplierPartNumber:
|
|
16658
|
+
var pinCompatibleVariant = z47.object({
|
|
16659
|
+
manufacturerPartNumber: z47.string().optional(),
|
|
16660
|
+
supplierPartNumber: z47.record(supplier_name2, z47.array(z47.string())).optional()
|
|
16643
16661
|
});
|
|
16644
16662
|
var chipProps = commonComponentProps.extend({
|
|
16645
|
-
manufacturerPartNumber:
|
|
16663
|
+
manufacturerPartNumber: z47.string().optional(),
|
|
16646
16664
|
pinLabels: pinLabelsProp.optional(),
|
|
16647
|
-
showPinAliases:
|
|
16648
|
-
pcbPinLabels:
|
|
16649
|
-
internallyConnectedPins:
|
|
16650
|
-
externallyConnectedPins:
|
|
16665
|
+
showPinAliases: z47.boolean().optional(),
|
|
16666
|
+
pcbPinLabels: z47.record(z47.string(), z47.string()).optional(),
|
|
16667
|
+
internallyConnectedPins: z47.array(z47.array(z47.union([z47.string(), z47.number()]))).optional(),
|
|
16668
|
+
externallyConnectedPins: z47.array(z47.array(z47.string())).optional(),
|
|
16651
16669
|
schPinArrangement: schematicPortArrangement.optional(),
|
|
16652
16670
|
schPortArrangement: schematicPortArrangement.optional(),
|
|
16653
|
-
pinCompatibleVariants:
|
|
16671
|
+
pinCompatibleVariants: z47.array(pinCompatibleVariant).optional(),
|
|
16654
16672
|
schPinStyle: schematicPinStyle.optional(),
|
|
16655
|
-
schPinSpacing:
|
|
16656
|
-
schWidth:
|
|
16657
|
-
schHeight:
|
|
16658
|
-
noSchematicRepresentation:
|
|
16659
|
-
schShowInternalCircuit:
|
|
16673
|
+
schPinSpacing: distance12.optional(),
|
|
16674
|
+
schWidth: distance12.optional(),
|
|
16675
|
+
schHeight: distance12.optional(),
|
|
16676
|
+
noSchematicRepresentation: z47.boolean().optional(),
|
|
16677
|
+
schShowInternalCircuit: z47.boolean().optional().default(false),
|
|
16660
16678
|
noConnect: noConnectProp.optional(),
|
|
16661
16679
|
connections: connectionsProp.optional(),
|
|
16662
16680
|
spiceModel: spicemodelElement.optional(),
|
|
@@ -16670,76 +16688,76 @@ var pinoutProps = chipProps;
|
|
|
16670
16688
|
expectTypesMatch(true);
|
|
16671
16689
|
|
|
16672
16690
|
// lib/components/jumper.ts
|
|
16673
|
-
import { distance as
|
|
16674
|
-
import { z as
|
|
16691
|
+
import { distance as distance13 } from "circuit-json";
|
|
16692
|
+
import { z as z48 } from "zod";
|
|
16675
16693
|
var jumperProps = commonComponentProps.extend({
|
|
16676
|
-
manufacturerPartNumber:
|
|
16677
|
-
pinLabels:
|
|
16678
|
-
|
|
16679
|
-
schematicPinLabel.or(
|
|
16694
|
+
manufacturerPartNumber: z48.string().optional(),
|
|
16695
|
+
pinLabels: z48.record(
|
|
16696
|
+
z48.number().or(schematicPinLabel),
|
|
16697
|
+
schematicPinLabel.or(z48.array(schematicPinLabel))
|
|
16680
16698
|
).optional(),
|
|
16681
16699
|
schPinStyle: schematicPinStyle.optional(),
|
|
16682
|
-
schPinSpacing:
|
|
16683
|
-
schWidth:
|
|
16684
|
-
schHeight:
|
|
16685
|
-
schDirection:
|
|
16700
|
+
schPinSpacing: distance13.optional(),
|
|
16701
|
+
schWidth: distance13.optional(),
|
|
16702
|
+
schHeight: distance13.optional(),
|
|
16703
|
+
schDirection: z48.enum(["left", "right"]).optional(),
|
|
16686
16704
|
schPinArrangement: schematicPinArrangement.optional(),
|
|
16687
16705
|
schPortArrangement: schematicPortArrangement.optional(),
|
|
16688
|
-
pcbPinLabels:
|
|
16689
|
-
pinCount:
|
|
16690
|
-
internallyConnectedPins:
|
|
16691
|
-
connections:
|
|
16706
|
+
pcbPinLabels: z48.record(z48.string(), z48.string()).optional(),
|
|
16707
|
+
pinCount: z48.union([z48.literal(2), z48.literal(3)]).optional(),
|
|
16708
|
+
internallyConnectedPins: z48.array(z48.array(z48.union([z48.string(), z48.number()]))).optional(),
|
|
16709
|
+
connections: z48.custom().pipe(z48.record(z48.string(), connectionTarget)).optional()
|
|
16692
16710
|
});
|
|
16693
16711
|
expectTypesMatch(true);
|
|
16694
16712
|
|
|
16695
16713
|
// lib/components/solderjumper.ts
|
|
16696
|
-
import { z as
|
|
16714
|
+
import { z as z49 } from "zod";
|
|
16697
16715
|
var solderjumperProps = jumperProps.extend({
|
|
16698
|
-
bridgedPins:
|
|
16699
|
-
bridged:
|
|
16716
|
+
bridgedPins: z49.array(z49.array(z49.string())).optional(),
|
|
16717
|
+
bridged: z49.boolean().optional()
|
|
16700
16718
|
});
|
|
16701
16719
|
expectTypesMatch(true);
|
|
16702
16720
|
|
|
16703
16721
|
// lib/components/connector.ts
|
|
16704
|
-
import { z as
|
|
16722
|
+
import { z as z50 } from "zod";
|
|
16705
16723
|
var connectorProps = chipProps.extend({
|
|
16706
|
-
standard:
|
|
16724
|
+
standard: z50.enum(["usb_c", "m2"]).optional()
|
|
16707
16725
|
});
|
|
16708
16726
|
expectTypesMatch(true);
|
|
16709
16727
|
|
|
16710
16728
|
// lib/components/interconnect.ts
|
|
16711
|
-
import { z as
|
|
16729
|
+
import { z as z51 } from "zod";
|
|
16712
16730
|
var interconnectProps = commonComponentProps.extend({
|
|
16713
|
-
standard:
|
|
16714
|
-
pinLabels:
|
|
16715
|
-
|
|
16716
|
-
schematicPinLabel.or(
|
|
16731
|
+
standard: z51.enum(["TSC0001_36P_XALT_2025_11", "0805", "0603", "1206"]).optional(),
|
|
16732
|
+
pinLabels: z51.record(
|
|
16733
|
+
z51.number().or(schematicPinLabel),
|
|
16734
|
+
schematicPinLabel.or(z51.array(schematicPinLabel))
|
|
16717
16735
|
).optional(),
|
|
16718
|
-
internallyConnectedPins:
|
|
16736
|
+
internallyConnectedPins: z51.array(z51.array(z51.union([z51.string(), z51.number()]))).optional()
|
|
16719
16737
|
});
|
|
16720
16738
|
expectTypesMatch(true);
|
|
16721
16739
|
|
|
16722
16740
|
// lib/components/fuse.ts
|
|
16723
|
-
import { z as
|
|
16741
|
+
import { z as z52 } from "zod";
|
|
16724
16742
|
var fusePinLabels = ["pin1", "pin2"];
|
|
16725
16743
|
var fuseProps = commonComponentProps.extend({
|
|
16726
|
-
currentRating:
|
|
16727
|
-
voltageRating:
|
|
16728
|
-
schShowRatings:
|
|
16744
|
+
currentRating: z52.union([z52.number(), z52.string()]),
|
|
16745
|
+
voltageRating: z52.union([z52.number(), z52.string()]).optional(),
|
|
16746
|
+
schShowRatings: z52.boolean().optional(),
|
|
16729
16747
|
schOrientation: schematicOrientation.optional(),
|
|
16730
|
-
connections:
|
|
16731
|
-
|
|
16732
|
-
|
|
16733
|
-
|
|
16734
|
-
|
|
16735
|
-
|
|
16748
|
+
connections: z52.record(
|
|
16749
|
+
z52.string(),
|
|
16750
|
+
z52.union([
|
|
16751
|
+
z52.string(),
|
|
16752
|
+
z52.array(z52.string()).readonly(),
|
|
16753
|
+
z52.array(z52.string())
|
|
16736
16754
|
])
|
|
16737
16755
|
).optional()
|
|
16738
16756
|
});
|
|
16739
16757
|
|
|
16740
16758
|
// lib/components/platedhole.ts
|
|
16741
|
-
import { distance as
|
|
16742
|
-
import { z as
|
|
16759
|
+
import { distance as distance14 } from "circuit-json";
|
|
16760
|
+
import { z as z53 } from "zod";
|
|
16743
16761
|
var DEFAULT_PIN_HEADER_HOLE_DIAMETER = "0.04in";
|
|
16744
16762
|
var DEFAULT_PIN_HEADER_OUTER_DIAMETER = "0.1in";
|
|
16745
16763
|
var inferPlatedHoleShapeAndDefaults = (rawProps) => {
|
|
@@ -16771,100 +16789,100 @@ var inferPlatedHoleShapeAndDefaults = (rawProps) => {
|
|
|
16771
16789
|
props.outerDiameter = DEFAULT_PIN_HEADER_OUTER_DIAMETER;
|
|
16772
16790
|
return props;
|
|
16773
16791
|
};
|
|
16774
|
-
var distanceHiddenUndefined =
|
|
16792
|
+
var distanceHiddenUndefined = z53.custom().transform((a) => {
|
|
16775
16793
|
if (a === void 0) return void 0;
|
|
16776
|
-
return
|
|
16794
|
+
return distance14.parse(a);
|
|
16777
16795
|
});
|
|
16778
|
-
var platedHolePropsByShape =
|
|
16796
|
+
var platedHolePropsByShape = z53.discriminatedUnion("shape", [
|
|
16779
16797
|
pcbLayoutProps.omit({ pcbRotation: true, layer: true }).extend({
|
|
16780
|
-
name:
|
|
16781
|
-
connectsTo:
|
|
16782
|
-
shape:
|
|
16783
|
-
holeDiameter:
|
|
16784
|
-
outerDiameter:
|
|
16785
|
-
padDiameter:
|
|
16798
|
+
name: z53.string().optional(),
|
|
16799
|
+
connectsTo: z53.string().or(z53.array(z53.string())).optional(),
|
|
16800
|
+
shape: z53.literal("circle"),
|
|
16801
|
+
holeDiameter: distance14,
|
|
16802
|
+
outerDiameter: distance14,
|
|
16803
|
+
padDiameter: distance14.optional().describe("Diameter of the copper pad"),
|
|
16786
16804
|
portHints: portHints.optional(),
|
|
16787
|
-
solderMaskMargin:
|
|
16788
|
-
coveredWithSolderMask:
|
|
16805
|
+
solderMaskMargin: distance14.optional(),
|
|
16806
|
+
coveredWithSolderMask: z53.boolean().optional()
|
|
16789
16807
|
}),
|
|
16790
16808
|
pcbLayoutProps.omit({ layer: true }).extend({
|
|
16791
|
-
name:
|
|
16792
|
-
connectsTo:
|
|
16793
|
-
shape:
|
|
16794
|
-
outerWidth:
|
|
16795
|
-
outerHeight:
|
|
16809
|
+
name: z53.string().optional(),
|
|
16810
|
+
connectsTo: z53.string().or(z53.array(z53.string())).optional(),
|
|
16811
|
+
shape: z53.literal("oval"),
|
|
16812
|
+
outerWidth: distance14,
|
|
16813
|
+
outerHeight: distance14,
|
|
16796
16814
|
holeWidth: distanceHiddenUndefined,
|
|
16797
16815
|
holeHeight: distanceHiddenUndefined,
|
|
16798
|
-
innerWidth:
|
|
16799
|
-
innerHeight:
|
|
16816
|
+
innerWidth: distance14.optional().describe("DEPRECATED use holeWidth"),
|
|
16817
|
+
innerHeight: distance14.optional().describe("DEPRECATED use holeHeight"),
|
|
16800
16818
|
portHints: portHints.optional(),
|
|
16801
|
-
solderMaskMargin:
|
|
16802
|
-
coveredWithSolderMask:
|
|
16819
|
+
solderMaskMargin: distance14.optional(),
|
|
16820
|
+
coveredWithSolderMask: z53.boolean().optional()
|
|
16803
16821
|
}),
|
|
16804
16822
|
pcbLayoutProps.omit({ layer: true }).extend({
|
|
16805
|
-
name:
|
|
16806
|
-
connectsTo:
|
|
16807
|
-
shape:
|
|
16808
|
-
rectPad:
|
|
16809
|
-
outerWidth:
|
|
16810
|
-
outerHeight:
|
|
16823
|
+
name: z53.string().optional(),
|
|
16824
|
+
connectsTo: z53.string().or(z53.array(z53.string())).optional(),
|
|
16825
|
+
shape: z53.literal("pill"),
|
|
16826
|
+
rectPad: z53.boolean().optional(),
|
|
16827
|
+
outerWidth: distance14,
|
|
16828
|
+
outerHeight: distance14,
|
|
16811
16829
|
holeWidth: distanceHiddenUndefined,
|
|
16812
16830
|
holeHeight: distanceHiddenUndefined,
|
|
16813
|
-
innerWidth:
|
|
16814
|
-
innerHeight:
|
|
16831
|
+
innerWidth: distance14.optional().describe("DEPRECATED use holeWidth"),
|
|
16832
|
+
innerHeight: distance14.optional().describe("DEPRECATED use holeHeight"),
|
|
16815
16833
|
portHints: portHints.optional(),
|
|
16816
|
-
holeOffsetX:
|
|
16817
|
-
holeOffsetY:
|
|
16818
|
-
solderMaskMargin:
|
|
16819
|
-
coveredWithSolderMask:
|
|
16834
|
+
holeOffsetX: distance14.optional(),
|
|
16835
|
+
holeOffsetY: distance14.optional(),
|
|
16836
|
+
solderMaskMargin: distance14.optional(),
|
|
16837
|
+
coveredWithSolderMask: z53.boolean().optional()
|
|
16820
16838
|
}),
|
|
16821
16839
|
pcbLayoutProps.omit({ layer: true }).extend({
|
|
16822
|
-
name:
|
|
16823
|
-
connectsTo:
|
|
16824
|
-
shape:
|
|
16825
|
-
holeDiameter:
|
|
16826
|
-
rectPadWidth:
|
|
16827
|
-
rectPadHeight:
|
|
16828
|
-
rectBorderRadius:
|
|
16829
|
-
holeShape:
|
|
16830
|
-
padShape:
|
|
16840
|
+
name: z53.string().optional(),
|
|
16841
|
+
connectsTo: z53.string().or(z53.array(z53.string())).optional(),
|
|
16842
|
+
shape: z53.literal("circular_hole_with_rect_pad"),
|
|
16843
|
+
holeDiameter: distance14,
|
|
16844
|
+
rectPadWidth: distance14,
|
|
16845
|
+
rectPadHeight: distance14,
|
|
16846
|
+
rectBorderRadius: distance14.optional(),
|
|
16847
|
+
holeShape: z53.literal("circle").optional(),
|
|
16848
|
+
padShape: z53.literal("rect").optional(),
|
|
16831
16849
|
portHints: portHints.optional(),
|
|
16832
|
-
holeOffsetX:
|
|
16833
|
-
holeOffsetY:
|
|
16834
|
-
solderMaskMargin:
|
|
16835
|
-
coveredWithSolderMask:
|
|
16850
|
+
holeOffsetX: distance14.optional(),
|
|
16851
|
+
holeOffsetY: distance14.optional(),
|
|
16852
|
+
solderMaskMargin: distance14.optional(),
|
|
16853
|
+
coveredWithSolderMask: z53.boolean().optional()
|
|
16836
16854
|
}),
|
|
16837
16855
|
pcbLayoutProps.omit({ layer: true }).extend({
|
|
16838
|
-
name:
|
|
16839
|
-
connectsTo:
|
|
16840
|
-
shape:
|
|
16841
|
-
holeShape:
|
|
16842
|
-
padShape:
|
|
16843
|
-
holeWidth:
|
|
16844
|
-
holeHeight:
|
|
16845
|
-
rectPadWidth:
|
|
16846
|
-
rectPadHeight:
|
|
16847
|
-
rectBorderRadius:
|
|
16856
|
+
name: z53.string().optional(),
|
|
16857
|
+
connectsTo: z53.string().or(z53.array(z53.string())).optional(),
|
|
16858
|
+
shape: z53.literal("pill_hole_with_rect_pad"),
|
|
16859
|
+
holeShape: z53.literal("pill").optional(),
|
|
16860
|
+
padShape: z53.literal("rect").optional(),
|
|
16861
|
+
holeWidth: distance14,
|
|
16862
|
+
holeHeight: distance14,
|
|
16863
|
+
rectPadWidth: distance14,
|
|
16864
|
+
rectPadHeight: distance14,
|
|
16865
|
+
rectBorderRadius: distance14.optional(),
|
|
16848
16866
|
portHints: portHints.optional(),
|
|
16849
|
-
holeOffsetX:
|
|
16850
|
-
holeOffsetY:
|
|
16851
|
-
solderMaskMargin:
|
|
16852
|
-
coveredWithSolderMask:
|
|
16867
|
+
holeOffsetX: distance14.optional(),
|
|
16868
|
+
holeOffsetY: distance14.optional(),
|
|
16869
|
+
solderMaskMargin: distance14.optional(),
|
|
16870
|
+
coveredWithSolderMask: z53.boolean().optional()
|
|
16853
16871
|
}),
|
|
16854
16872
|
pcbLayoutProps.omit({ pcbRotation: true, layer: true }).extend({
|
|
16855
|
-
name:
|
|
16856
|
-
connectsTo:
|
|
16857
|
-
shape:
|
|
16858
|
-
holeShape:
|
|
16859
|
-
holeDiameter:
|
|
16860
|
-
holeWidth:
|
|
16861
|
-
holeHeight:
|
|
16862
|
-
padOutline:
|
|
16863
|
-
holeOffsetX:
|
|
16864
|
-
holeOffsetY:
|
|
16873
|
+
name: z53.string().optional(),
|
|
16874
|
+
connectsTo: z53.string().or(z53.array(z53.string())).optional(),
|
|
16875
|
+
shape: z53.literal("hole_with_polygon_pad"),
|
|
16876
|
+
holeShape: z53.enum(["circle", "oval", "pill", "rotated_pill"]),
|
|
16877
|
+
holeDiameter: distance14.optional(),
|
|
16878
|
+
holeWidth: distance14.optional(),
|
|
16879
|
+
holeHeight: distance14.optional(),
|
|
16880
|
+
padOutline: z53.array(point),
|
|
16881
|
+
holeOffsetX: distance14,
|
|
16882
|
+
holeOffsetY: distance14,
|
|
16865
16883
|
portHints: portHints.optional(),
|
|
16866
|
-
solderMaskMargin:
|
|
16867
|
-
coveredWithSolderMask:
|
|
16884
|
+
solderMaskMargin: distance14.optional(),
|
|
16885
|
+
coveredWithSolderMask: z53.boolean().optional()
|
|
16868
16886
|
})
|
|
16869
16887
|
]).transform((a) => {
|
|
16870
16888
|
if ("innerWidth" in a && a.innerWidth !== void 0) {
|
|
@@ -16875,7 +16893,7 @@ var platedHolePropsByShape = z52.discriminatedUnion("shape", [
|
|
|
16875
16893
|
}
|
|
16876
16894
|
return a;
|
|
16877
16895
|
});
|
|
16878
|
-
var platedHoleProps =
|
|
16896
|
+
var platedHoleProps = z53.preprocess(
|
|
16879
16897
|
inferPlatedHoleShapeAndDefaults,
|
|
16880
16898
|
platedHolePropsByShape
|
|
16881
16899
|
);
|
|
@@ -16883,7 +16901,7 @@ expectTypesMatch(true);
|
|
|
16883
16901
|
|
|
16884
16902
|
// lib/components/resistor.ts
|
|
16885
16903
|
import { resistance } from "circuit-json";
|
|
16886
|
-
import { z as
|
|
16904
|
+
import { z as z54 } from "zod";
|
|
16887
16905
|
var resistorPinLabels = ["pin1", "pin2", "pos", "neg"];
|
|
16888
16906
|
var resistorImperialFootprintNames = /* @__PURE__ */ new Set([
|
|
16889
16907
|
"01005",
|
|
@@ -16907,7 +16925,7 @@ var resistorFootprintProp = footprintProp.optional().transform(mapResistorFootpr
|
|
|
16907
16925
|
var resistorProps = commonComponentProps.extend({
|
|
16908
16926
|
footprint: resistorFootprintProp,
|
|
16909
16927
|
resistance,
|
|
16910
|
-
tolerance:
|
|
16928
|
+
tolerance: z54.union([z54.string(), z54.number()]).transform((val) => {
|
|
16911
16929
|
if (typeof val === "string") {
|
|
16912
16930
|
if (val.endsWith("%")) {
|
|
16913
16931
|
return parseFloat(val.slice(0, -1)) / 100;
|
|
@@ -16916,12 +16934,12 @@ var resistorProps = commonComponentProps.extend({
|
|
|
16916
16934
|
}
|
|
16917
16935
|
return val;
|
|
16918
16936
|
}).pipe(
|
|
16919
|
-
|
|
16937
|
+
z54.number().min(0, "Tolerance must be non-negative").max(1, "Tolerance cannot be greater than 100%")
|
|
16920
16938
|
).optional(),
|
|
16921
|
-
pullupFor:
|
|
16922
|
-
pullupTo:
|
|
16923
|
-
pulldownFor:
|
|
16924
|
-
pulldownTo:
|
|
16939
|
+
pullupFor: z54.string().optional(),
|
|
16940
|
+
pullupTo: z54.string().optional(),
|
|
16941
|
+
pulldownFor: z54.string().optional(),
|
|
16942
|
+
pulldownTo: z54.string().optional(),
|
|
16925
16943
|
schOrientation: schematicOrientation.optional(),
|
|
16926
16944
|
schSize: schematicSymbolSize.optional(),
|
|
16927
16945
|
connections: createConnectionsProp(resistorPinLabels).optional()
|
|
@@ -16931,18 +16949,18 @@ expectTypesMatch(true);
|
|
|
16931
16949
|
|
|
16932
16950
|
// lib/components/potentiometer.ts
|
|
16933
16951
|
import { resistance as resistance2 } from "circuit-json";
|
|
16934
|
-
import { z as
|
|
16952
|
+
import { z as z55 } from "zod";
|
|
16935
16953
|
var potentiometerPinLabels = ["pin1", "pin2", "pin3"];
|
|
16936
16954
|
var potentiometerProps = commonComponentProps.extend({
|
|
16937
16955
|
maxResistance: resistance2,
|
|
16938
|
-
pinVariant:
|
|
16956
|
+
pinVariant: z55.enum(["two_pin", "three_pin"]).optional(),
|
|
16939
16957
|
connections: createConnectionsProp(potentiometerPinLabels).optional()
|
|
16940
16958
|
});
|
|
16941
16959
|
expectTypesMatch(true);
|
|
16942
16960
|
|
|
16943
16961
|
// lib/components/crystal.ts
|
|
16944
|
-
import { capacitance, distance as
|
|
16945
|
-
import { z as
|
|
16962
|
+
import { capacitance, distance as distance15, frequency } from "circuit-json";
|
|
16963
|
+
import { z as z56 } from "zod";
|
|
16946
16964
|
var crystalPins = [
|
|
16947
16965
|
"pin1",
|
|
16948
16966
|
"left",
|
|
@@ -16954,10 +16972,10 @@ var crystalPins = [
|
|
|
16954
16972
|
var crystalProps = commonComponentProps.extend({
|
|
16955
16973
|
frequency,
|
|
16956
16974
|
loadCapacitance: capacitance,
|
|
16957
|
-
maxTraceLength:
|
|
16958
|
-
manufacturerPartNumber:
|
|
16959
|
-
mpn:
|
|
16960
|
-
pinVariant:
|
|
16975
|
+
maxTraceLength: distance15.optional(),
|
|
16976
|
+
manufacturerPartNumber: z56.string().optional(),
|
|
16977
|
+
mpn: z56.string().optional(),
|
|
16978
|
+
pinVariant: z56.enum(["two_pin", "four_pin"]).optional(),
|
|
16961
16979
|
schOrientation: schematicOrientation.optional(),
|
|
16962
16980
|
connections: createConnectionsProp(crystalPins).optional()
|
|
16963
16981
|
});
|
|
@@ -16965,34 +16983,34 @@ expectTypesMatch(true);
|
|
|
16965
16983
|
|
|
16966
16984
|
// lib/components/resonator.ts
|
|
16967
16985
|
import { frequency as frequency2, capacitance as capacitance2 } from "circuit-json";
|
|
16968
|
-
import { z as
|
|
16986
|
+
import { z as z57 } from "zod";
|
|
16969
16987
|
var resonatorProps = commonComponentProps.extend({
|
|
16970
16988
|
frequency: frequency2,
|
|
16971
16989
|
loadCapacitance: capacitance2,
|
|
16972
|
-
pinVariant:
|
|
16990
|
+
pinVariant: z57.enum(["no_ground", "ground_pin", "two_ground_pins"]).optional()
|
|
16973
16991
|
});
|
|
16974
16992
|
expectTypesMatch(true);
|
|
16975
16993
|
|
|
16976
16994
|
// lib/components/stampboard.ts
|
|
16977
|
-
import { distance as
|
|
16978
|
-
import { z as
|
|
16995
|
+
import { distance as distance16 } from "circuit-json";
|
|
16996
|
+
import { z as z58 } from "zod";
|
|
16979
16997
|
var stampboardProps = boardProps.extend({
|
|
16980
|
-
leftPinCount:
|
|
16981
|
-
rightPinCount:
|
|
16982
|
-
topPinCount:
|
|
16983
|
-
bottomPinCount:
|
|
16984
|
-
leftPins:
|
|
16985
|
-
rightPins:
|
|
16986
|
-
topPins:
|
|
16987
|
-
bottomPins:
|
|
16988
|
-
pinPitch:
|
|
16989
|
-
innerHoles:
|
|
16998
|
+
leftPinCount: z58.number().optional(),
|
|
16999
|
+
rightPinCount: z58.number().optional(),
|
|
17000
|
+
topPinCount: z58.number().optional(),
|
|
17001
|
+
bottomPinCount: z58.number().optional(),
|
|
17002
|
+
leftPins: z58.array(z58.string()).optional(),
|
|
17003
|
+
rightPins: z58.array(z58.string()).optional(),
|
|
17004
|
+
topPins: z58.array(z58.string()).optional(),
|
|
17005
|
+
bottomPins: z58.array(z58.string()).optional(),
|
|
17006
|
+
pinPitch: distance16.optional(),
|
|
17007
|
+
innerHoles: z58.boolean().optional()
|
|
16990
17008
|
});
|
|
16991
17009
|
expectTypesMatch(true);
|
|
16992
17010
|
|
|
16993
17011
|
// lib/components/capacitor.ts
|
|
16994
17012
|
import { capacitance as capacitance3, voltage } from "circuit-json";
|
|
16995
|
-
import { z as
|
|
17013
|
+
import { z as z59 } from "zod";
|
|
16996
17014
|
var capacitorPinLabels = [
|
|
16997
17015
|
"pin1",
|
|
16998
17016
|
"pin2",
|
|
@@ -17004,13 +17022,13 @@ var capacitorPinLabels = [
|
|
|
17004
17022
|
var capacitorProps = commonComponentProps.extend({
|
|
17005
17023
|
capacitance: capacitance3,
|
|
17006
17024
|
maxVoltageRating: voltage.optional(),
|
|
17007
|
-
schShowRatings:
|
|
17008
|
-
polarized:
|
|
17009
|
-
decouplingFor:
|
|
17010
|
-
decouplingTo:
|
|
17011
|
-
bypassFor:
|
|
17012
|
-
bypassTo:
|
|
17013
|
-
maxDecouplingTraceLength:
|
|
17025
|
+
schShowRatings: z59.boolean().optional().default(false),
|
|
17026
|
+
polarized: z59.boolean().optional().default(false),
|
|
17027
|
+
decouplingFor: z59.string().optional(),
|
|
17028
|
+
decouplingTo: z59.string().optional(),
|
|
17029
|
+
bypassFor: z59.string().optional(),
|
|
17030
|
+
bypassTo: z59.string().optional(),
|
|
17031
|
+
maxDecouplingTraceLength: z59.number().optional(),
|
|
17014
17032
|
schOrientation: schematicOrientation.optional(),
|
|
17015
17033
|
schSize: schematicSymbolSize.optional(),
|
|
17016
17034
|
connections: createConnectionsProp(capacitorPinLabels).optional()
|
|
@@ -17019,16 +17037,16 @@ var capacitorPins = lrPolarPins;
|
|
|
17019
17037
|
expectTypesMatch(true);
|
|
17020
17038
|
|
|
17021
17039
|
// lib/components/net.ts
|
|
17022
|
-
import { distance as
|
|
17023
|
-
import { z as
|
|
17024
|
-
var netProps =
|
|
17025
|
-
name:
|
|
17026
|
-
connectsTo:
|
|
17027
|
-
routingPhaseIndex:
|
|
17028
|
-
highlightColor:
|
|
17029
|
-
isPowerNet:
|
|
17030
|
-
isGroundNet:
|
|
17031
|
-
nominalTraceWidth:
|
|
17040
|
+
import { distance as distance17 } from "circuit-json";
|
|
17041
|
+
import { z as z60 } from "zod";
|
|
17042
|
+
var netProps = z60.object({
|
|
17043
|
+
name: z60.string(),
|
|
17044
|
+
connectsTo: z60.string().or(z60.array(z60.string())).optional(),
|
|
17045
|
+
routingPhaseIndex: z60.number().nullable().optional(),
|
|
17046
|
+
highlightColor: z60.string().optional(),
|
|
17047
|
+
isPowerNet: z60.boolean().optional(),
|
|
17048
|
+
isGroundNet: z60.boolean().optional(),
|
|
17049
|
+
nominalTraceWidth: distance17.optional()
|
|
17032
17050
|
});
|
|
17033
17051
|
expectTypesMatch(true);
|
|
17034
17052
|
|
|
@@ -17041,55 +17059,55 @@ var fiducialProps = commonComponentProps.extend({
|
|
|
17041
17059
|
expectTypesMatch(true);
|
|
17042
17060
|
|
|
17043
17061
|
// lib/components/constrainedlayout.ts
|
|
17044
|
-
import { z as
|
|
17045
|
-
var constrainedLayoutProps =
|
|
17046
|
-
name:
|
|
17047
|
-
pcbOnly:
|
|
17048
|
-
schOnly:
|
|
17062
|
+
import { z as z62 } from "zod";
|
|
17063
|
+
var constrainedLayoutProps = z62.object({
|
|
17064
|
+
name: z62.string().optional(),
|
|
17065
|
+
pcbOnly: z62.boolean().optional(),
|
|
17066
|
+
schOnly: z62.boolean().optional()
|
|
17049
17067
|
});
|
|
17050
17068
|
expectTypesMatch(true);
|
|
17051
17069
|
|
|
17052
17070
|
// lib/components/constraint.ts
|
|
17053
|
-
import { z as
|
|
17054
|
-
var pcbXDistConstraintProps =
|
|
17055
|
-
pcb:
|
|
17071
|
+
import { z as z63 } from "zod";
|
|
17072
|
+
var pcbXDistConstraintProps = z63.object({
|
|
17073
|
+
pcb: z63.literal(true).optional(),
|
|
17056
17074
|
xDist: distance,
|
|
17057
|
-
left:
|
|
17058
|
-
right:
|
|
17059
|
-
edgeToEdge:
|
|
17060
|
-
centerToCenter:
|
|
17075
|
+
left: z63.string(),
|
|
17076
|
+
right: z63.string(),
|
|
17077
|
+
edgeToEdge: z63.literal(true).optional(),
|
|
17078
|
+
centerToCenter: z63.literal(true).optional()
|
|
17061
17079
|
});
|
|
17062
17080
|
expectTypesMatch(
|
|
17063
17081
|
true
|
|
17064
17082
|
);
|
|
17065
|
-
var pcbYDistConstraintProps =
|
|
17066
|
-
pcb:
|
|
17083
|
+
var pcbYDistConstraintProps = z63.object({
|
|
17084
|
+
pcb: z63.literal(true).optional(),
|
|
17067
17085
|
yDist: distance,
|
|
17068
|
-
top:
|
|
17069
|
-
bottom:
|
|
17070
|
-
edgeToEdge:
|
|
17071
|
-
centerToCenter:
|
|
17086
|
+
top: z63.string(),
|
|
17087
|
+
bottom: z63.string(),
|
|
17088
|
+
edgeToEdge: z63.literal(true).optional(),
|
|
17089
|
+
centerToCenter: z63.literal(true).optional()
|
|
17072
17090
|
});
|
|
17073
17091
|
expectTypesMatch(
|
|
17074
17092
|
true
|
|
17075
17093
|
);
|
|
17076
|
-
var pcbSameYConstraintProps =
|
|
17077
|
-
pcb:
|
|
17078
|
-
sameY:
|
|
17079
|
-
for:
|
|
17094
|
+
var pcbSameYConstraintProps = z63.object({
|
|
17095
|
+
pcb: z63.literal(true).optional(),
|
|
17096
|
+
sameY: z63.literal(true).optional(),
|
|
17097
|
+
for: z63.array(z63.string())
|
|
17080
17098
|
});
|
|
17081
17099
|
expectTypesMatch(
|
|
17082
17100
|
true
|
|
17083
17101
|
);
|
|
17084
|
-
var pcbSameXConstraintProps =
|
|
17085
|
-
pcb:
|
|
17086
|
-
sameX:
|
|
17087
|
-
for:
|
|
17102
|
+
var pcbSameXConstraintProps = z63.object({
|
|
17103
|
+
pcb: z63.literal(true).optional(),
|
|
17104
|
+
sameX: z63.literal(true).optional(),
|
|
17105
|
+
for: z63.array(z63.string())
|
|
17088
17106
|
});
|
|
17089
17107
|
expectTypesMatch(
|
|
17090
17108
|
true
|
|
17091
17109
|
);
|
|
17092
|
-
var constraintProps =
|
|
17110
|
+
var constraintProps = z63.union([
|
|
17093
17111
|
pcbXDistConstraintProps,
|
|
17094
17112
|
pcbYDistConstraintProps,
|
|
17095
17113
|
pcbSameYConstraintProps,
|
|
@@ -17098,13 +17116,13 @@ var constraintProps = z62.union([
|
|
|
17098
17116
|
expectTypesMatch(true);
|
|
17099
17117
|
|
|
17100
17118
|
// lib/components/cutout.ts
|
|
17101
|
-
import { z as
|
|
17119
|
+
import { z as z64 } from "zod";
|
|
17102
17120
|
var rectCutoutProps = pcbLayoutProps.omit({
|
|
17103
17121
|
layer: true,
|
|
17104
17122
|
pcbRotation: true
|
|
17105
17123
|
}).extend({
|
|
17106
|
-
name:
|
|
17107
|
-
shape:
|
|
17124
|
+
name: z64.string().optional(),
|
|
17125
|
+
shape: z64.literal("rect"),
|
|
17108
17126
|
width: distance,
|
|
17109
17127
|
height: distance
|
|
17110
17128
|
});
|
|
@@ -17113,8 +17131,8 @@ var circleCutoutProps = pcbLayoutProps.omit({
|
|
|
17113
17131
|
layer: true,
|
|
17114
17132
|
pcbRotation: true
|
|
17115
17133
|
}).extend({
|
|
17116
|
-
name:
|
|
17117
|
-
shape:
|
|
17134
|
+
name: z64.string().optional(),
|
|
17135
|
+
shape: z64.literal("circle"),
|
|
17118
17136
|
radius: distance
|
|
17119
17137
|
});
|
|
17120
17138
|
expectTypesMatch(true);
|
|
@@ -17122,36 +17140,36 @@ var polygonCutoutProps = pcbLayoutProps.omit({
|
|
|
17122
17140
|
layer: true,
|
|
17123
17141
|
pcbRotation: true
|
|
17124
17142
|
}).extend({
|
|
17125
|
-
name:
|
|
17126
|
-
shape:
|
|
17127
|
-
points:
|
|
17143
|
+
name: z64.string().optional(),
|
|
17144
|
+
shape: z64.literal("polygon"),
|
|
17145
|
+
points: z64.array(point)
|
|
17128
17146
|
});
|
|
17129
17147
|
expectTypesMatch(true);
|
|
17130
|
-
var cutoutProps =
|
|
17148
|
+
var cutoutProps = z64.discriminatedUnion("shape", [
|
|
17131
17149
|
rectCutoutProps,
|
|
17132
17150
|
circleCutoutProps,
|
|
17133
17151
|
polygonCutoutProps
|
|
17134
17152
|
]);
|
|
17135
17153
|
|
|
17136
17154
|
// lib/components/drc-check.ts
|
|
17137
|
-
import { z as
|
|
17138
|
-
var drcCheckProps =
|
|
17139
|
-
name:
|
|
17155
|
+
import { z as z65 } from "zod";
|
|
17156
|
+
var drcCheckProps = z65.object({
|
|
17157
|
+
name: z65.string().optional(),
|
|
17140
17158
|
checkFn: customDrcCheckFn
|
|
17141
17159
|
});
|
|
17142
17160
|
expectTypesMatch(true);
|
|
17143
17161
|
|
|
17144
17162
|
// lib/components/smtpad.ts
|
|
17145
|
-
import { z as
|
|
17163
|
+
import { z as z66 } from "zod";
|
|
17146
17164
|
var rectSmtPadProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
17147
|
-
name:
|
|
17148
|
-
shape:
|
|
17165
|
+
name: z66.string().optional(),
|
|
17166
|
+
shape: z66.literal("rect"),
|
|
17149
17167
|
width: distance,
|
|
17150
17168
|
height: distance,
|
|
17151
17169
|
rectBorderRadius: distance.optional(),
|
|
17152
17170
|
cornerRadius: distance.optional(),
|
|
17153
17171
|
portHints: portHints.optional(),
|
|
17154
|
-
coveredWithSolderMask:
|
|
17172
|
+
coveredWithSolderMask: z66.boolean().optional(),
|
|
17155
17173
|
solderMaskMargin: distance.optional(),
|
|
17156
17174
|
solderMaskMarginLeft: distance.optional(),
|
|
17157
17175
|
solderMaskMarginRight: distance.optional(),
|
|
@@ -17160,14 +17178,14 @@ var rectSmtPadProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
|
17160
17178
|
});
|
|
17161
17179
|
expectTypesMatch(true);
|
|
17162
17180
|
var rotatedRectSmtPadProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
17163
|
-
name:
|
|
17164
|
-
shape:
|
|
17181
|
+
name: z66.string().optional(),
|
|
17182
|
+
shape: z66.literal("rotated_rect"),
|
|
17165
17183
|
width: distance,
|
|
17166
17184
|
height: distance,
|
|
17167
|
-
ccwRotation:
|
|
17185
|
+
ccwRotation: z66.number(),
|
|
17168
17186
|
cornerRadius: distance.optional(),
|
|
17169
17187
|
portHints: portHints.optional(),
|
|
17170
|
-
coveredWithSolderMask:
|
|
17188
|
+
coveredWithSolderMask: z66.boolean().optional(),
|
|
17171
17189
|
solderMaskMargin: distance.optional(),
|
|
17172
17190
|
solderMaskMarginLeft: distance.optional(),
|
|
17173
17191
|
solderMaskMarginRight: distance.optional(),
|
|
@@ -17176,35 +17194,35 @@ var rotatedRectSmtPadProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
|
17176
17194
|
});
|
|
17177
17195
|
expectTypesMatch(true);
|
|
17178
17196
|
var circleSmtPadProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
17179
|
-
name:
|
|
17180
|
-
shape:
|
|
17197
|
+
name: z66.string().optional(),
|
|
17198
|
+
shape: z66.literal("circle"),
|
|
17181
17199
|
radius: distance,
|
|
17182
17200
|
portHints: portHints.optional(),
|
|
17183
|
-
coveredWithSolderMask:
|
|
17201
|
+
coveredWithSolderMask: z66.boolean().optional(),
|
|
17184
17202
|
solderMaskMargin: distance.optional()
|
|
17185
17203
|
});
|
|
17186
17204
|
expectTypesMatch(true);
|
|
17187
17205
|
var pillSmtPadProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
17188
|
-
name:
|
|
17189
|
-
shape:
|
|
17206
|
+
name: z66.string().optional(),
|
|
17207
|
+
shape: z66.literal("pill"),
|
|
17190
17208
|
width: distance,
|
|
17191
17209
|
height: distance,
|
|
17192
17210
|
radius: distance,
|
|
17193
17211
|
portHints: portHints.optional(),
|
|
17194
|
-
coveredWithSolderMask:
|
|
17212
|
+
coveredWithSolderMask: z66.boolean().optional(),
|
|
17195
17213
|
solderMaskMargin: distance.optional()
|
|
17196
17214
|
});
|
|
17197
17215
|
expectTypesMatch(true);
|
|
17198
17216
|
var polygonSmtPadProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
17199
|
-
name:
|
|
17200
|
-
shape:
|
|
17201
|
-
points:
|
|
17217
|
+
name: z66.string().optional(),
|
|
17218
|
+
shape: z66.literal("polygon"),
|
|
17219
|
+
points: z66.array(point),
|
|
17202
17220
|
portHints: portHints.optional(),
|
|
17203
|
-
coveredWithSolderMask:
|
|
17221
|
+
coveredWithSolderMask: z66.boolean().optional(),
|
|
17204
17222
|
solderMaskMargin: distance.optional()
|
|
17205
17223
|
});
|
|
17206
17224
|
expectTypesMatch(true);
|
|
17207
|
-
var smtPadProps =
|
|
17225
|
+
var smtPadProps = z66.discriminatedUnion("shape", [
|
|
17208
17226
|
circleSmtPadProps,
|
|
17209
17227
|
rectSmtPadProps,
|
|
17210
17228
|
rotatedRectSmtPadProps,
|
|
@@ -17214,63 +17232,63 @@ var smtPadProps = z65.discriminatedUnion("shape", [
|
|
|
17214
17232
|
expectTypesMatch(true);
|
|
17215
17233
|
|
|
17216
17234
|
// lib/components/solderpaste.ts
|
|
17217
|
-
import { z as
|
|
17235
|
+
import { z as z67 } from "zod";
|
|
17218
17236
|
var rectSolderPasteProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
17219
|
-
shape:
|
|
17237
|
+
shape: z67.literal("rect"),
|
|
17220
17238
|
width: distance,
|
|
17221
17239
|
height: distance
|
|
17222
17240
|
});
|
|
17223
17241
|
expectTypesMatch(true);
|
|
17224
17242
|
var circleSolderPasteProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
17225
|
-
shape:
|
|
17243
|
+
shape: z67.literal("circle"),
|
|
17226
17244
|
radius: distance
|
|
17227
17245
|
});
|
|
17228
17246
|
expectTypesMatch(true);
|
|
17229
|
-
var solderPasteProps =
|
|
17247
|
+
var solderPasteProps = z67.union([
|
|
17230
17248
|
circleSolderPasteProps,
|
|
17231
17249
|
rectSolderPasteProps
|
|
17232
17250
|
]);
|
|
17233
17251
|
expectTypesMatch(true);
|
|
17234
17252
|
|
|
17235
17253
|
// lib/components/hole.ts
|
|
17236
|
-
import { z as
|
|
17254
|
+
import { z as z68 } from "zod";
|
|
17237
17255
|
var circleHoleProps = pcbLayoutProps.extend({
|
|
17238
|
-
name:
|
|
17239
|
-
shape:
|
|
17256
|
+
name: z68.string().optional(),
|
|
17257
|
+
shape: z68.literal("circle").optional(),
|
|
17240
17258
|
diameter: distance.optional(),
|
|
17241
17259
|
radius: distance.optional(),
|
|
17242
17260
|
solderMaskMargin: distance.optional(),
|
|
17243
|
-
coveredWithSolderMask:
|
|
17261
|
+
coveredWithSolderMask: z68.boolean().optional()
|
|
17244
17262
|
}).transform((d) => ({
|
|
17245
17263
|
...d,
|
|
17246
17264
|
diameter: d.diameter ?? 2 * d.radius,
|
|
17247
17265
|
radius: d.radius ?? d.diameter / 2
|
|
17248
17266
|
}));
|
|
17249
17267
|
var pillHoleProps = pcbLayoutProps.extend({
|
|
17250
|
-
name:
|
|
17251
|
-
shape:
|
|
17268
|
+
name: z68.string().optional(),
|
|
17269
|
+
shape: z68.literal("pill"),
|
|
17252
17270
|
width: distance,
|
|
17253
17271
|
height: distance,
|
|
17254
17272
|
solderMaskMargin: distance.optional(),
|
|
17255
|
-
coveredWithSolderMask:
|
|
17273
|
+
coveredWithSolderMask: z68.boolean().optional()
|
|
17256
17274
|
});
|
|
17257
17275
|
var ovalHoleProps = pcbLayoutProps.extend({
|
|
17258
|
-
name:
|
|
17259
|
-
shape:
|
|
17276
|
+
name: z68.string().optional(),
|
|
17277
|
+
shape: z68.literal("oval"),
|
|
17260
17278
|
width: distance,
|
|
17261
17279
|
height: distance,
|
|
17262
17280
|
solderMaskMargin: distance.optional(),
|
|
17263
|
-
coveredWithSolderMask:
|
|
17281
|
+
coveredWithSolderMask: z68.boolean().optional()
|
|
17264
17282
|
});
|
|
17265
17283
|
var rectHoleProps = pcbLayoutProps.extend({
|
|
17266
|
-
name:
|
|
17267
|
-
shape:
|
|
17284
|
+
name: z68.string().optional(),
|
|
17285
|
+
shape: z68.literal("rect"),
|
|
17268
17286
|
width: distance,
|
|
17269
17287
|
height: distance,
|
|
17270
17288
|
solderMaskMargin: distance.optional(),
|
|
17271
|
-
coveredWithSolderMask:
|
|
17289
|
+
coveredWithSolderMask: z68.boolean().optional()
|
|
17272
17290
|
});
|
|
17273
|
-
var holeProps =
|
|
17291
|
+
var holeProps = z68.union([
|
|
17274
17292
|
circleHoleProps,
|
|
17275
17293
|
pillHoleProps,
|
|
17276
17294
|
ovalHoleProps,
|
|
@@ -17279,58 +17297,58 @@ var holeProps = z67.union([
|
|
|
17279
17297
|
expectTypesMatch(true);
|
|
17280
17298
|
|
|
17281
17299
|
// lib/components/trace.ts
|
|
17282
|
-
import { distance as
|
|
17283
|
-
import { z as
|
|
17284
|
-
var portRef =
|
|
17285
|
-
|
|
17286
|
-
|
|
17300
|
+
import { distance as distance18, layer_ref as layer_ref4, route_hint_point as route_hint_point2 } from "circuit-json";
|
|
17301
|
+
import { z as z69 } from "zod";
|
|
17302
|
+
var portRef = z69.union([
|
|
17303
|
+
z69.string(),
|
|
17304
|
+
z69.custom(
|
|
17287
17305
|
(v) => typeof v === "object" && v !== null && "getPortSelector" in v && typeof v.getPortSelector === "function"
|
|
17288
17306
|
)
|
|
17289
17307
|
]);
|
|
17290
17308
|
var pcbPathPoint = point.extend({
|
|
17291
|
-
via:
|
|
17309
|
+
via: z69.boolean().optional(),
|
|
17292
17310
|
fromLayer: layer_ref4.optional(),
|
|
17293
17311
|
toLayer: layer_ref4.optional()
|
|
17294
17312
|
}).superRefine((value, ctx) => {
|
|
17295
17313
|
if (value.via) {
|
|
17296
17314
|
if (!value.toLayer) {
|
|
17297
17315
|
ctx.addIssue({
|
|
17298
|
-
code:
|
|
17316
|
+
code: z69.ZodIssueCode.custom,
|
|
17299
17317
|
message: "toLayer is required when via is true",
|
|
17300
17318
|
path: ["toLayer"]
|
|
17301
17319
|
});
|
|
17302
17320
|
}
|
|
17303
17321
|
} else if (value.fromLayer || value.toLayer) {
|
|
17304
17322
|
ctx.addIssue({
|
|
17305
|
-
code:
|
|
17323
|
+
code: z69.ZodIssueCode.custom,
|
|
17306
17324
|
message: "fromLayer/toLayer are only allowed when via is true",
|
|
17307
17325
|
path: ["via"]
|
|
17308
17326
|
});
|
|
17309
17327
|
}
|
|
17310
17328
|
});
|
|
17311
|
-
var pcbPath =
|
|
17312
|
-
var baseTraceProps =
|
|
17313
|
-
key:
|
|
17314
|
-
name:
|
|
17315
|
-
displayName:
|
|
17316
|
-
thickness:
|
|
17317
|
-
width:
|
|
17318
|
-
schematicRouteHints:
|
|
17319
|
-
pcbRouteHints:
|
|
17320
|
-
pcbPathRelativeTo:
|
|
17329
|
+
var pcbPath = z69.array(z69.union([pcbPathPoint, z69.string()]));
|
|
17330
|
+
var baseTraceProps = z69.object({
|
|
17331
|
+
key: z69.string().optional(),
|
|
17332
|
+
name: z69.string().optional(),
|
|
17333
|
+
displayName: z69.string().optional(),
|
|
17334
|
+
thickness: distance18.optional(),
|
|
17335
|
+
width: distance18.optional().describe("Alias for trace thickness"),
|
|
17336
|
+
schematicRouteHints: z69.array(point).optional(),
|
|
17337
|
+
pcbRouteHints: z69.array(route_hint_point2).optional(),
|
|
17338
|
+
pcbPathRelativeTo: z69.string().optional(),
|
|
17321
17339
|
pcbPath: pcbPath.optional(),
|
|
17322
|
-
pcbPaths:
|
|
17323
|
-
routingPhaseIndex:
|
|
17324
|
-
pcbStraightLine:
|
|
17325
|
-
schDisplayLabel:
|
|
17326
|
-
schStroke:
|
|
17327
|
-
highlightColor:
|
|
17328
|
-
maxLength:
|
|
17329
|
-
connectsTo:
|
|
17340
|
+
pcbPaths: z69.array(pcbPath).optional(),
|
|
17341
|
+
routingPhaseIndex: z69.number().nullable().optional(),
|
|
17342
|
+
pcbStraightLine: z69.boolean().optional().describe("Draw a straight pcb trace between the connected points"),
|
|
17343
|
+
schDisplayLabel: z69.string().optional(),
|
|
17344
|
+
schStroke: z69.string().optional(),
|
|
17345
|
+
highlightColor: z69.string().optional(),
|
|
17346
|
+
maxLength: distance18.optional(),
|
|
17347
|
+
connectsTo: z69.string().or(z69.array(z69.string())).optional()
|
|
17330
17348
|
});
|
|
17331
|
-
var traceProps =
|
|
17349
|
+
var traceProps = z69.union([
|
|
17332
17350
|
baseTraceProps.extend({
|
|
17333
|
-
path:
|
|
17351
|
+
path: z69.array(portRef)
|
|
17334
17352
|
}),
|
|
17335
17353
|
baseTraceProps.extend({
|
|
17336
17354
|
from: portRef,
|
|
@@ -17343,27 +17361,27 @@ var traceProps = z68.union([
|
|
|
17343
17361
|
]);
|
|
17344
17362
|
|
|
17345
17363
|
// lib/components/bus.ts
|
|
17346
|
-
import { z as
|
|
17347
|
-
var busProps =
|
|
17348
|
-
name:
|
|
17349
|
-
connections:
|
|
17364
|
+
import { z as z70 } from "zod";
|
|
17365
|
+
var busProps = z70.object({
|
|
17366
|
+
name: z70.string().optional(),
|
|
17367
|
+
connections: z70.array(z70.string()).min(2)
|
|
17350
17368
|
});
|
|
17351
17369
|
expectTypesMatch(true);
|
|
17352
17370
|
|
|
17353
17371
|
// lib/components/differentialpair.ts
|
|
17354
|
-
import { z as
|
|
17355
|
-
var differentialPairProps =
|
|
17356
|
-
name:
|
|
17357
|
-
positiveConnection:
|
|
17358
|
-
negativeConnection:
|
|
17359
|
-
maxLengthSkew:
|
|
17372
|
+
import { z as z71 } from "zod";
|
|
17373
|
+
var differentialPairProps = z71.object({
|
|
17374
|
+
name: z71.string().optional(),
|
|
17375
|
+
positiveConnection: z71.string(),
|
|
17376
|
+
negativeConnection: z71.string(),
|
|
17377
|
+
maxLengthSkew: z71.number().min(0).finite().optional()
|
|
17360
17378
|
});
|
|
17361
17379
|
expectTypesMatch(true);
|
|
17362
17380
|
|
|
17363
17381
|
// lib/components/footprint.ts
|
|
17364
17382
|
import { layer_ref as layer_ref5 } from "circuit-json";
|
|
17365
|
-
import { z as
|
|
17366
|
-
var footprintInsertionDirection =
|
|
17383
|
+
import { z as z72 } from "zod";
|
|
17384
|
+
var footprintInsertionDirection = z72.enum([
|
|
17367
17385
|
"from_above",
|
|
17368
17386
|
"from_left",
|
|
17369
17387
|
"from_right",
|
|
@@ -17371,11 +17389,11 @@ var footprintInsertionDirection = z71.enum([
|
|
|
17371
17389
|
"from_back"
|
|
17372
17390
|
]);
|
|
17373
17391
|
expectTypesMatch(true);
|
|
17374
|
-
var footprintProps =
|
|
17375
|
-
children:
|
|
17376
|
-
name:
|
|
17392
|
+
var footprintProps = z72.object({
|
|
17393
|
+
children: z72.any().optional(),
|
|
17394
|
+
name: z72.string().optional(),
|
|
17377
17395
|
originalLayer: layer_ref5.default("top").optional(),
|
|
17378
|
-
circuitJson:
|
|
17396
|
+
circuitJson: z72.array(z72.any()).optional(),
|
|
17379
17397
|
src: footprintProp.describe("Can be a footprint or kicad string").optional(),
|
|
17380
17398
|
insertionDirection: footprintInsertionDirection.optional().describe(
|
|
17381
17399
|
"Direction a cable or mating part is inserted into this footprint in its unrotated orientation."
|
|
@@ -17384,19 +17402,19 @@ var footprintProps = z71.object({
|
|
|
17384
17402
|
expectTypesMatch(true);
|
|
17385
17403
|
|
|
17386
17404
|
// lib/components/symbol.ts
|
|
17387
|
-
import { z as
|
|
17388
|
-
var symbolProps =
|
|
17389
|
-
originalFacingDirection:
|
|
17405
|
+
import { z as z73 } from "zod";
|
|
17406
|
+
var symbolProps = z73.object({
|
|
17407
|
+
originalFacingDirection: z73.enum(["up", "down", "left", "right"]).default("right").optional(),
|
|
17390
17408
|
width: distance.optional(),
|
|
17391
17409
|
height: distance.optional(),
|
|
17392
|
-
name:
|
|
17410
|
+
name: z73.string().optional()
|
|
17393
17411
|
});
|
|
17394
17412
|
expectTypesMatch(true);
|
|
17395
17413
|
|
|
17396
17414
|
// lib/components/battery.ts
|
|
17397
17415
|
import { voltage as voltage2 } from "circuit-json";
|
|
17398
|
-
import { z as
|
|
17399
|
-
var capacity =
|
|
17416
|
+
import { z as z74 } from "zod";
|
|
17417
|
+
var capacity = z74.number().or(z74.string().endsWith("mAh")).transform((v) => {
|
|
17400
17418
|
if (typeof v === "string") {
|
|
17401
17419
|
const valString = v.replace("mAh", "");
|
|
17402
17420
|
const num = Number.parseFloat(valString);
|
|
@@ -17411,14 +17429,14 @@ var batteryPins = lrPolarPins;
|
|
|
17411
17429
|
var batteryProps = commonComponentProps.extend({
|
|
17412
17430
|
capacity: capacity.optional(),
|
|
17413
17431
|
voltage: voltage2.optional(),
|
|
17414
|
-
standard:
|
|
17432
|
+
standard: z74.enum(["AA", "AAA", "9V", "CR2032", "18650", "C"]).optional(),
|
|
17415
17433
|
schOrientation: schematicOrientation.optional(),
|
|
17416
17434
|
connections: createConnectionsProp(batteryPins).optional()
|
|
17417
17435
|
});
|
|
17418
17436
|
expectTypesMatch(true);
|
|
17419
17437
|
|
|
17420
17438
|
// lib/components/mountedboard.ts
|
|
17421
|
-
import { z as
|
|
17439
|
+
import { z as z75 } from "zod";
|
|
17422
17440
|
var mountedboardProps = subcircuitGroupProps.extend({
|
|
17423
17441
|
manufacturerPartNumber: chipProps.shape.manufacturerPartNumber,
|
|
17424
17442
|
pinLabels: chipProps.shape.pinLabels,
|
|
@@ -17430,69 +17448,69 @@ var mountedboardProps = subcircuitGroupProps.extend({
|
|
|
17430
17448
|
internallyConnectedPins: chipProps.shape.internallyConnectedPins,
|
|
17431
17449
|
externallyConnectedPins: chipProps.shape.externallyConnectedPins,
|
|
17432
17450
|
boardToBoardDistance: distance.optional(),
|
|
17433
|
-
mountOrientation:
|
|
17451
|
+
mountOrientation: z75.enum(["faceDown", "faceUp"]).optional()
|
|
17434
17452
|
});
|
|
17435
17453
|
expectTypesMatch(true);
|
|
17436
17454
|
|
|
17437
17455
|
// lib/components/pin-header.ts
|
|
17438
|
-
import { distance as
|
|
17456
|
+
import { distance as distance19 } from "circuit-json";
|
|
17439
17457
|
|
|
17440
17458
|
// lib/common/pcbOrientation.ts
|
|
17441
|
-
import { z as
|
|
17442
|
-
var pcbOrientation =
|
|
17459
|
+
import { z as z76 } from "zod";
|
|
17460
|
+
var pcbOrientation = z76.enum(["vertical", "horizontal"]).describe(
|
|
17443
17461
|
"vertical means pins go 1->2 downward and horizontal means pins go 1->2 rightward"
|
|
17444
17462
|
);
|
|
17445
17463
|
expectTypesMatch(true);
|
|
17446
17464
|
|
|
17447
17465
|
// lib/components/pin-header.ts
|
|
17448
|
-
import { z as
|
|
17466
|
+
import { z as z77 } from "zod";
|
|
17449
17467
|
var pinHeaderProps = commonComponentProps.extend({
|
|
17450
|
-
pinCount:
|
|
17451
|
-
pitch:
|
|
17452
|
-
schFacingDirection:
|
|
17453
|
-
gender:
|
|
17454
|
-
showSilkscreenPinLabels:
|
|
17455
|
-
pcbPinLabels:
|
|
17456
|
-
doubleRow:
|
|
17457
|
-
rightAngle:
|
|
17468
|
+
pinCount: z77.number(),
|
|
17469
|
+
pitch: distance19.optional(),
|
|
17470
|
+
schFacingDirection: z77.enum(["up", "down", "left", "right"]).optional(),
|
|
17471
|
+
gender: z77.enum(["male", "female", "unpopulated"]).optional().default("male"),
|
|
17472
|
+
showSilkscreenPinLabels: z77.boolean().optional(),
|
|
17473
|
+
pcbPinLabels: z77.record(z77.string(), z77.string()).optional(),
|
|
17474
|
+
doubleRow: z77.boolean().optional(),
|
|
17475
|
+
rightAngle: z77.boolean().optional(),
|
|
17458
17476
|
pcbOrientation: pcbOrientation.optional(),
|
|
17459
|
-
holeDiameter:
|
|
17460
|
-
platedDiameter:
|
|
17461
|
-
pinLabels:
|
|
17462
|
-
connections:
|
|
17463
|
-
facingDirection:
|
|
17477
|
+
holeDiameter: distance19.optional(),
|
|
17478
|
+
platedDiameter: distance19.optional(),
|
|
17479
|
+
pinLabels: z77.record(z77.string(), schematicPinLabel).or(z77.array(schematicPinLabel)).optional(),
|
|
17480
|
+
connections: z77.custom().pipe(z77.record(z77.string(), connectionTarget)).optional(),
|
|
17481
|
+
facingDirection: z77.enum(["left", "right"]).optional(),
|
|
17464
17482
|
schPinArrangement: schematicPinArrangement.optional(),
|
|
17465
17483
|
schPinStyle: schematicPinStyle.optional(),
|
|
17466
|
-
schPinSpacing:
|
|
17467
|
-
schWidth:
|
|
17468
|
-
schHeight:
|
|
17484
|
+
schPinSpacing: distance19.optional(),
|
|
17485
|
+
schWidth: distance19.optional(),
|
|
17486
|
+
schHeight: distance19.optional()
|
|
17469
17487
|
});
|
|
17470
17488
|
expectTypesMatch(true);
|
|
17471
17489
|
|
|
17472
17490
|
// lib/components/netalias.ts
|
|
17473
|
-
import { z as
|
|
17491
|
+
import { z as z78 } from "zod";
|
|
17474
17492
|
import { rotation as rotation3 } from "circuit-json";
|
|
17475
|
-
var netAliasProps =
|
|
17476
|
-
net:
|
|
17477
|
-
connection:
|
|
17493
|
+
var netAliasProps = z78.object({
|
|
17494
|
+
net: z78.string().optional(),
|
|
17495
|
+
connection: z78.string().optional(),
|
|
17478
17496
|
schX: distance.optional(),
|
|
17479
17497
|
schY: distance.optional(),
|
|
17480
17498
|
schRotation: rotation3.optional(),
|
|
17481
|
-
anchorSide:
|
|
17499
|
+
anchorSide: z78.enum(["left", "top", "right", "bottom"]).optional()
|
|
17482
17500
|
});
|
|
17483
17501
|
expectTypesMatch(true);
|
|
17484
17502
|
|
|
17485
17503
|
// lib/components/netlabel.ts
|
|
17486
|
-
import { z as
|
|
17504
|
+
import { z as z79 } from "zod";
|
|
17487
17505
|
import { rotation as rotation4 } from "circuit-json";
|
|
17488
|
-
var netLabelProps =
|
|
17489
|
-
net:
|
|
17490
|
-
connection:
|
|
17491
|
-
connectsTo:
|
|
17506
|
+
var netLabelProps = z79.object({
|
|
17507
|
+
net: z79.string().optional(),
|
|
17508
|
+
connection: z79.string().optional(),
|
|
17509
|
+
connectsTo: z79.string().or(z79.array(z79.string())).optional(),
|
|
17492
17510
|
schX: distance.optional(),
|
|
17493
17511
|
schY: distance.optional(),
|
|
17494
17512
|
schRotation: rotation4.optional(),
|
|
17495
|
-
anchorSide:
|
|
17513
|
+
anchorSide: z79.enum(["left", "top", "right", "bottom"]).optional()
|
|
17496
17514
|
});
|
|
17497
17515
|
expectTypesMatch(true);
|
|
17498
17516
|
|
|
@@ -17507,32 +17525,32 @@ expectTypesMatch(true);
|
|
|
17507
17525
|
|
|
17508
17526
|
// lib/components/analogsimulation.ts
|
|
17509
17527
|
import { ms } from "circuit-json";
|
|
17510
|
-
import { z as
|
|
17511
|
-
var spiceEngine =
|
|
17528
|
+
import { z as z81 } from "zod";
|
|
17529
|
+
var spiceEngine = z81.custom(
|
|
17512
17530
|
(value) => typeof value === "string"
|
|
17513
17531
|
);
|
|
17514
|
-
var spiceOptions =
|
|
17515
|
-
method:
|
|
17516
|
-
reltol:
|
|
17517
|
-
abstol:
|
|
17518
|
-
vntol:
|
|
17532
|
+
var spiceOptions = z81.object({
|
|
17533
|
+
method: z81.enum(["trap", "gear"]).optional(),
|
|
17534
|
+
reltol: z81.union([z81.number(), z81.string()]).optional(),
|
|
17535
|
+
abstol: z81.union([z81.number(), z81.string()]).optional(),
|
|
17536
|
+
vntol: z81.union([z81.number(), z81.string()]).optional()
|
|
17519
17537
|
});
|
|
17520
17538
|
var analogAnalysisSimulationBaseProps = {
|
|
17521
|
-
name:
|
|
17539
|
+
name: z81.string().optional(),
|
|
17522
17540
|
spiceEngine: spiceEngine.optional(),
|
|
17523
17541
|
spiceOptions: spiceOptions.optional(),
|
|
17524
|
-
graphIndependentAxes:
|
|
17525
|
-
children:
|
|
17542
|
+
graphIndependentAxes: z81.boolean().optional(),
|
|
17543
|
+
children: z81.custom().optional()
|
|
17526
17544
|
};
|
|
17527
|
-
var analogSimulationProps =
|
|
17528
|
-
name:
|
|
17529
|
-
simulationType:
|
|
17545
|
+
var analogSimulationProps = z81.object({
|
|
17546
|
+
name: z81.string().optional(),
|
|
17547
|
+
simulationType: z81.literal("spice_transient_analysis").default("spice_transient_analysis"),
|
|
17530
17548
|
duration: ms.optional(),
|
|
17531
17549
|
startTime: ms.optional(),
|
|
17532
17550
|
timePerStep: ms.optional(),
|
|
17533
17551
|
spiceEngine: spiceEngine.optional(),
|
|
17534
17552
|
spiceOptions: spiceOptions.optional(),
|
|
17535
|
-
graphIndependentAxes:
|
|
17553
|
+
graphIndependentAxes: z81.boolean().optional()
|
|
17536
17554
|
});
|
|
17537
17555
|
expectTypesMatch(
|
|
17538
17556
|
true
|
|
@@ -17540,12 +17558,12 @@ expectTypesMatch(
|
|
|
17540
17558
|
|
|
17541
17559
|
// lib/components/analogtransientsimulation.ts
|
|
17542
17560
|
import { ms as ms2 } from "circuit-json";
|
|
17543
|
-
import { z as
|
|
17561
|
+
import { z as z82 } from "zod";
|
|
17544
17562
|
var positiveMilliseconds = ms2.refine(
|
|
17545
17563
|
(milliseconds) => milliseconds > 0,
|
|
17546
17564
|
"Time must be positive"
|
|
17547
17565
|
);
|
|
17548
|
-
var analogTransientSimulationProps =
|
|
17566
|
+
var analogTransientSimulationProps = z82.object({
|
|
17549
17567
|
...analogAnalysisSimulationBaseProps,
|
|
17550
17568
|
duration: positiveMilliseconds.default("10ms"),
|
|
17551
17569
|
startTime: ms2.default("0ms"),
|
|
@@ -17553,7 +17571,7 @@ var analogTransientSimulationProps = z81.object({
|
|
|
17553
17571
|
}).superRefine((simulation, context) => {
|
|
17554
17572
|
if (simulation.startTime < 0 || simulation.startTime > simulation.duration) {
|
|
17555
17573
|
context.addIssue({
|
|
17556
|
-
code:
|
|
17574
|
+
code: z82.ZodIssueCode.custom,
|
|
17557
17575
|
path: ["startTime"],
|
|
17558
17576
|
message: "startTime must be between zero and duration"
|
|
17559
17577
|
});
|
|
@@ -17562,19 +17580,19 @@ var analogTransientSimulationProps = z81.object({
|
|
|
17562
17580
|
expectTypesMatch(true);
|
|
17563
17581
|
|
|
17564
17582
|
// lib/components/analogdcoperatingpointsimulation.ts
|
|
17565
|
-
import { z as
|
|
17566
|
-
var analogDcOperatingPointSimulationProps =
|
|
17583
|
+
import { z as z83 } from "zod";
|
|
17584
|
+
var analogDcOperatingPointSimulationProps = z83.object({
|
|
17567
17585
|
...analogAnalysisSimulationBaseProps
|
|
17568
17586
|
});
|
|
17569
17587
|
expectTypesMatch(true);
|
|
17570
17588
|
|
|
17571
17589
|
// lib/components/analogdcsweepsimulation.ts
|
|
17572
17590
|
import { current, voltage as voltage3 } from "circuit-json";
|
|
17573
|
-
import { z as
|
|
17574
|
-
var dcSweepQuantity =
|
|
17575
|
-
var analogDcSweepSimulationProps =
|
|
17591
|
+
import { z as z84 } from "zod";
|
|
17592
|
+
var dcSweepQuantity = z84.union([voltage3, current]);
|
|
17593
|
+
var analogDcSweepSimulationProps = z84.object({
|
|
17576
17594
|
...analogAnalysisSimulationBaseProps,
|
|
17577
|
-
sweepSource:
|
|
17595
|
+
sweepSource: z84.string().min(1),
|
|
17578
17596
|
sweepStart: dcSweepQuantity,
|
|
17579
17597
|
sweepStop: dcSweepQuantity,
|
|
17580
17598
|
sweepStep: dcSweepQuantity.refine(
|
|
@@ -17584,7 +17602,7 @@ var analogDcSweepSimulationProps = z83.object({
|
|
|
17584
17602
|
}).superRefine((simulation, context) => {
|
|
17585
17603
|
if (Math.sign(simulation.sweepStop - simulation.sweepStart) !== Math.sign(simulation.sweepStep)) {
|
|
17586
17604
|
context.addIssue({
|
|
17587
|
-
code:
|
|
17605
|
+
code: z84.ZodIssueCode.custom,
|
|
17588
17606
|
path: ["sweepStep"],
|
|
17589
17607
|
message: "sweepStep must move from sweepStart toward sweepStop"
|
|
17590
17608
|
});
|
|
@@ -17594,10 +17612,10 @@ expectTypesMatch(true);
|
|
|
17594
17612
|
|
|
17595
17613
|
// lib/components/analogacsweepsimulation.ts
|
|
17596
17614
|
import { frequency as frequency3 } from "circuit-json";
|
|
17597
|
-
import { z as
|
|
17598
|
-
var analogAcSweepSimulationProps =
|
|
17615
|
+
import { z as z85 } from "zod";
|
|
17616
|
+
var analogAcSweepSimulationProps = z85.object({
|
|
17599
17617
|
...analogAnalysisSimulationBaseProps,
|
|
17600
|
-
sweepType:
|
|
17618
|
+
sweepType: z85.enum(["linear", "decade", "octave"]),
|
|
17601
17619
|
startFrequency: frequency3.refine(
|
|
17602
17620
|
(startFrequencyHz) => startFrequencyHz > 0,
|
|
17603
17621
|
"startFrequency must be positive"
|
|
@@ -17606,12 +17624,12 @@ var analogAcSweepSimulationProps = z84.object({
|
|
|
17606
17624
|
(stopFrequencyHz) => stopFrequencyHz > 0,
|
|
17607
17625
|
"stopFrequency must be positive"
|
|
17608
17626
|
),
|
|
17609
|
-
samplesPerInterval:
|
|
17610
|
-
sampleCount:
|
|
17627
|
+
samplesPerInterval: z85.number().int().positive().optional(),
|
|
17628
|
+
sampleCount: z85.number().int().positive().optional()
|
|
17611
17629
|
}).superRefine((simulation, context) => {
|
|
17612
17630
|
if (simulation.stopFrequency <= simulation.startFrequency) {
|
|
17613
17631
|
context.addIssue({
|
|
17614
|
-
code:
|
|
17632
|
+
code: z85.ZodIssueCode.custom,
|
|
17615
17633
|
path: ["stopFrequency"],
|
|
17616
17634
|
message: "stopFrequency must be greater than startFrequency"
|
|
17617
17635
|
});
|
|
@@ -17619,14 +17637,14 @@ var analogAcSweepSimulationProps = z84.object({
|
|
|
17619
17637
|
if (simulation.sweepType === "linear") {
|
|
17620
17638
|
if (simulation.sampleCount === void 0) {
|
|
17621
17639
|
context.addIssue({
|
|
17622
|
-
code:
|
|
17640
|
+
code: z85.ZodIssueCode.custom,
|
|
17623
17641
|
path: ["sampleCount"],
|
|
17624
17642
|
message: "sampleCount is required for a linear AC sweep"
|
|
17625
17643
|
});
|
|
17626
17644
|
}
|
|
17627
17645
|
if (simulation.samplesPerInterval !== void 0) {
|
|
17628
17646
|
context.addIssue({
|
|
17629
|
-
code:
|
|
17647
|
+
code: z85.ZodIssueCode.custom,
|
|
17630
17648
|
path: ["samplesPerInterval"],
|
|
17631
17649
|
message: "samplesPerInterval is only valid for decade or octave sweeps"
|
|
17632
17650
|
});
|
|
@@ -17635,14 +17653,14 @@ var analogAcSweepSimulationProps = z84.object({
|
|
|
17635
17653
|
}
|
|
17636
17654
|
if (simulation.samplesPerInterval === void 0) {
|
|
17637
17655
|
context.addIssue({
|
|
17638
|
-
code:
|
|
17656
|
+
code: z85.ZodIssueCode.custom,
|
|
17639
17657
|
path: ["samplesPerInterval"],
|
|
17640
17658
|
message: "samplesPerInterval is required for decade or octave sweeps"
|
|
17641
17659
|
});
|
|
17642
17660
|
}
|
|
17643
17661
|
if (simulation.sampleCount !== void 0) {
|
|
17644
17662
|
context.addIssue({
|
|
17645
|
-
code:
|
|
17663
|
+
code: z85.ZodIssueCode.custom,
|
|
17646
17664
|
path: ["sampleCount"],
|
|
17647
17665
|
message: "sampleCount is only valid for a linear sweep"
|
|
17648
17666
|
});
|
|
@@ -17658,43 +17676,43 @@ import {
|
|
|
17658
17676
|
resistance as resistance3,
|
|
17659
17677
|
voltage as voltage4
|
|
17660
17678
|
} from "circuit-json";
|
|
17661
|
-
import { z as
|
|
17662
|
-
var resistanceSweepQuantity = resistance3.pipe(
|
|
17663
|
-
var capacitanceSweepQuantity = capacitance4.pipe(
|
|
17664
|
-
var inductanceSweepQuantity = inductance.pipe(
|
|
17665
|
-
var voltageSweepQuantity = voltage4.pipe(
|
|
17666
|
-
var currentSweepQuantity = current2.pipe(
|
|
17679
|
+
import { z as z86 } from "zod";
|
|
17680
|
+
var resistanceSweepQuantity = resistance3.pipe(z86.number());
|
|
17681
|
+
var capacitanceSweepQuantity = capacitance4.pipe(z86.number());
|
|
17682
|
+
var inductanceSweepQuantity = inductance.pipe(z86.number());
|
|
17683
|
+
var voltageSweepQuantity = voltage4.pipe(z86.number());
|
|
17684
|
+
var currentSweepQuantity = current2.pipe(z86.number());
|
|
17667
17685
|
var createAnalogSweepCoordinateProps = (sweepQuantity) => ({
|
|
17668
|
-
name:
|
|
17669
|
-
values:
|
|
17686
|
+
name: z86.string().optional(),
|
|
17687
|
+
values: z86.array(sweepQuantity).min(1).optional(),
|
|
17670
17688
|
start: sweepQuantity.optional(),
|
|
17671
17689
|
stop: sweepQuantity.optional(),
|
|
17672
17690
|
step: sweepQuantity.optional()
|
|
17673
17691
|
});
|
|
17674
|
-
var analogResistanceSweepParameterProps =
|
|
17692
|
+
var analogResistanceSweepParameterProps = z86.object({
|
|
17675
17693
|
...createAnalogSweepCoordinateProps(resistanceSweepQuantity),
|
|
17676
|
-
parameterType:
|
|
17677
|
-
resistorRef:
|
|
17694
|
+
parameterType: z86.literal("resistance"),
|
|
17695
|
+
resistorRef: z86.string().min(1)
|
|
17678
17696
|
}).strict();
|
|
17679
|
-
var analogCapacitanceSweepParameterProps =
|
|
17697
|
+
var analogCapacitanceSweepParameterProps = z86.object({
|
|
17680
17698
|
...createAnalogSweepCoordinateProps(capacitanceSweepQuantity),
|
|
17681
|
-
parameterType:
|
|
17682
|
-
capacitorRef:
|
|
17699
|
+
parameterType: z86.literal("capacitance"),
|
|
17700
|
+
capacitorRef: z86.string().min(1)
|
|
17683
17701
|
}).strict();
|
|
17684
|
-
var analogInductanceSweepParameterProps =
|
|
17702
|
+
var analogInductanceSweepParameterProps = z86.object({
|
|
17685
17703
|
...createAnalogSweepCoordinateProps(inductanceSweepQuantity),
|
|
17686
|
-
parameterType:
|
|
17687
|
-
inductorRef:
|
|
17704
|
+
parameterType: z86.literal("inductance"),
|
|
17705
|
+
inductorRef: z86.string().min(1)
|
|
17688
17706
|
}).strict();
|
|
17689
|
-
var analogVoltageSweepParameterProps =
|
|
17707
|
+
var analogVoltageSweepParameterProps = z86.object({
|
|
17690
17708
|
...createAnalogSweepCoordinateProps(voltageSweepQuantity),
|
|
17691
|
-
parameterType:
|
|
17692
|
-
net:
|
|
17709
|
+
parameterType: z86.literal("voltage"),
|
|
17710
|
+
net: z86.string().min(1)
|
|
17693
17711
|
}).strict();
|
|
17694
|
-
var analogCurrentSweepParameterProps =
|
|
17712
|
+
var analogCurrentSweepParameterProps = z86.object({
|
|
17695
17713
|
...createAnalogSweepCoordinateProps(currentSweepQuantity),
|
|
17696
|
-
parameterType:
|
|
17697
|
-
currentSourceRef:
|
|
17714
|
+
parameterType: z86.literal("current"),
|
|
17715
|
+
currentSourceRef: z86.string().min(1)
|
|
17698
17716
|
}).strict();
|
|
17699
17717
|
var validateAnalogSweepCoordinates = (sweepCoordinates, context) => {
|
|
17700
17718
|
const hasExplicitSweepCoordinates = sweepCoordinates.values !== void 0;
|
|
@@ -17706,34 +17724,34 @@ var validateAnalogSweepCoordinates = (sweepCoordinates, context) => {
|
|
|
17706
17724
|
const hasRangeCoordinates = rangeCoordinateCount > 0;
|
|
17707
17725
|
if (hasExplicitSweepCoordinates === hasRangeCoordinates) {
|
|
17708
17726
|
context.addIssue({
|
|
17709
|
-
code:
|
|
17727
|
+
code: z86.ZodIssueCode.custom,
|
|
17710
17728
|
message: "Provide either values or start/stop/step"
|
|
17711
17729
|
});
|
|
17712
17730
|
return;
|
|
17713
17731
|
}
|
|
17714
17732
|
if (rangeCoordinateCount !== 0 && rangeCoordinateCount !== 3) {
|
|
17715
17733
|
context.addIssue({
|
|
17716
|
-
code:
|
|
17734
|
+
code: z86.ZodIssueCode.custom,
|
|
17717
17735
|
message: "start, stop, and step must be provided together"
|
|
17718
17736
|
});
|
|
17719
17737
|
return;
|
|
17720
17738
|
}
|
|
17721
17739
|
if (sweepCoordinates.step === 0) {
|
|
17722
17740
|
context.addIssue({
|
|
17723
|
-
code:
|
|
17741
|
+
code: z86.ZodIssueCode.custom,
|
|
17724
17742
|
path: ["step"],
|
|
17725
17743
|
message: "step must be nonzero"
|
|
17726
17744
|
});
|
|
17727
17745
|
}
|
|
17728
17746
|
if (sweepCoordinates.start !== void 0 && sweepCoordinates.stop !== void 0 && sweepCoordinates.step !== void 0 && Math.sign(sweepCoordinates.stop - sweepCoordinates.start) !== Math.sign(sweepCoordinates.step)) {
|
|
17729
17747
|
context.addIssue({
|
|
17730
|
-
code:
|
|
17748
|
+
code: z86.ZodIssueCode.custom,
|
|
17731
17749
|
path: ["step"],
|
|
17732
17750
|
message: "step must move from start toward stop"
|
|
17733
17751
|
});
|
|
17734
17752
|
}
|
|
17735
17753
|
};
|
|
17736
|
-
var analogSweepParameterProps =
|
|
17754
|
+
var analogSweepParameterProps = z86.discriminatedUnion("parameterType", [
|
|
17737
17755
|
analogResistanceSweepParameterProps,
|
|
17738
17756
|
analogCapacitanceSweepParameterProps,
|
|
17739
17757
|
analogInductanceSweepParameterProps,
|
|
@@ -17748,32 +17766,36 @@ expectTypesMatch(true);
|
|
|
17748
17766
|
expectTypesMatch(true);
|
|
17749
17767
|
|
|
17750
17768
|
// lib/components/autoroutingphase.ts
|
|
17751
|
-
import { z as
|
|
17752
|
-
|
|
17769
|
+
import { z as z87 } from "zod";
|
|
17770
|
+
import { layer_ref as layer_ref6 } from "circuit-json";
|
|
17771
|
+
var busFanoutDirection = z87.union([
|
|
17753
17772
|
ninePointAnchor,
|
|
17754
|
-
|
|
17773
|
+
z87.object({ direction: ninePointAnchor })
|
|
17755
17774
|
]);
|
|
17756
|
-
var autoroutingPhaseProps =
|
|
17757
|
-
key:
|
|
17758
|
-
name:
|
|
17775
|
+
var autoroutingPhaseProps = z87.object({
|
|
17776
|
+
key: z87.any().optional(),
|
|
17777
|
+
name: z87.string().optional(),
|
|
17759
17778
|
autorouter: autorouterProp.optional(),
|
|
17760
|
-
phaseIndex:
|
|
17779
|
+
phaseIndex: z87.number().optional(),
|
|
17761
17780
|
...routingTolerances.shape,
|
|
17762
|
-
region:
|
|
17763
|
-
shape:
|
|
17764
|
-
minX:
|
|
17765
|
-
maxX:
|
|
17766
|
-
minY:
|
|
17767
|
-
maxY:
|
|
17781
|
+
region: z87.object({
|
|
17782
|
+
shape: z87.literal("rect").optional(),
|
|
17783
|
+
minX: z87.number(),
|
|
17784
|
+
maxX: z87.number(),
|
|
17785
|
+
minY: z87.number(),
|
|
17786
|
+
maxY: z87.number()
|
|
17768
17787
|
}).optional(),
|
|
17769
|
-
connection:
|
|
17770
|
-
connections:
|
|
17771
|
-
reroute:
|
|
17772
|
-
busFanoutDirections:
|
|
17788
|
+
connection: z87.string().optional(),
|
|
17789
|
+
connections: z87.array(z87.string()).optional(),
|
|
17790
|
+
reroute: z87.boolean().optional(),
|
|
17791
|
+
busFanoutDirections: z87.record(busFanoutDirection).optional(),
|
|
17792
|
+
fanoutBoundaryPadding: fanoutBoundaryPadding.optional(),
|
|
17793
|
+
fanoutRoutingLayers: z87.array(layer_ref6).min(1).optional(),
|
|
17794
|
+
fanoutPourNetMap: z87.record(layer_ref6, z87.union([z87.string(), z87.array(z87.string()).min(1)])).optional()
|
|
17773
17795
|
}).superRefine((value, ctx) => {
|
|
17774
17796
|
if (value.reroute !== void 0 && value.region === void 0 && value.connection === void 0 && value.connections === void 0) {
|
|
17775
17797
|
ctx.addIssue({
|
|
17776
|
-
code:
|
|
17798
|
+
code: z87.ZodIssueCode.custom,
|
|
17777
17799
|
message: "region, connection, or connections is required when reroute is provided",
|
|
17778
17800
|
path: ["region"]
|
|
17779
17801
|
});
|
|
@@ -17782,15 +17804,15 @@ var autoroutingPhaseProps = z86.object({
|
|
|
17782
17804
|
expectTypesMatch(true);
|
|
17783
17805
|
|
|
17784
17806
|
// lib/components/spicemodel.ts
|
|
17785
|
-
import { z as
|
|
17786
|
-
var spicemodelProps =
|
|
17787
|
-
source:
|
|
17788
|
-
spicePinMapping:
|
|
17807
|
+
import { z as z88 } from "zod";
|
|
17808
|
+
var spicemodelProps = z88.object({
|
|
17809
|
+
source: z88.string(),
|
|
17810
|
+
spicePinMapping: z88.record(z88.string(), z88.string()).optional()
|
|
17789
17811
|
});
|
|
17790
17812
|
expectTypesMatch(true);
|
|
17791
17813
|
|
|
17792
17814
|
// lib/components/transistor.ts
|
|
17793
|
-
import { z as
|
|
17815
|
+
import { z as z89 } from "zod";
|
|
17794
17816
|
var transistorPinsLabels = [
|
|
17795
17817
|
"pin1",
|
|
17796
17818
|
"pin2",
|
|
@@ -17803,7 +17825,7 @@ var transistorPinsLabels = [
|
|
|
17803
17825
|
"drain"
|
|
17804
17826
|
];
|
|
17805
17827
|
var transistorProps = commonComponentProps.extend({
|
|
17806
|
-
type:
|
|
17828
|
+
type: z89.enum(["npn", "pnp", "bjt", "jfet", "mosfet", "igbt"]),
|
|
17807
17829
|
connections: createConnectionsProp(transistorPinsLabels).optional()
|
|
17808
17830
|
});
|
|
17809
17831
|
var transistorPins = [
|
|
@@ -17817,7 +17839,7 @@ var transistorPins = [
|
|
|
17817
17839
|
expectTypesMatch(true);
|
|
17818
17840
|
|
|
17819
17841
|
// lib/components/mosfet.ts
|
|
17820
|
-
import { z as
|
|
17842
|
+
import { z as z90 } from "zod";
|
|
17821
17843
|
var mosfetPins = [
|
|
17822
17844
|
"pin1",
|
|
17823
17845
|
"drain",
|
|
@@ -17827,11 +17849,11 @@ var mosfetPins = [
|
|
|
17827
17849
|
"gate"
|
|
17828
17850
|
];
|
|
17829
17851
|
var mosfetProps = commonComponentProps.extend({
|
|
17830
|
-
channelType:
|
|
17831
|
-
mosfetMode:
|
|
17832
|
-
symbolDrainSide:
|
|
17833
|
-
symbolSourceSide:
|
|
17834
|
-
symbolGateSide:
|
|
17852
|
+
channelType: z90.enum(["n", "p"]),
|
|
17853
|
+
mosfetMode: z90.enum(["enhancement", "depletion"]),
|
|
17854
|
+
symbolDrainSide: z90.enum(["left", "right", "top", "bottom"]).optional(),
|
|
17855
|
+
symbolSourceSide: z90.enum(["left", "right", "top", "bottom"]).optional(),
|
|
17856
|
+
symbolGateSide: z90.enum(["left", "right", "top", "bottom"]).optional(),
|
|
17835
17857
|
connections: createConnectionsProp(mosfetPins).optional()
|
|
17836
17858
|
});
|
|
17837
17859
|
expectTypesMatch(true);
|
|
@@ -17853,29 +17875,29 @@ expectTypesMatch(true);
|
|
|
17853
17875
|
|
|
17854
17876
|
// lib/components/inductor.ts
|
|
17855
17877
|
import { inductance as inductance2 } from "circuit-json";
|
|
17856
|
-
import { z as
|
|
17878
|
+
import { z as z92 } from "zod";
|
|
17857
17879
|
var inductorPins = lrPins;
|
|
17858
17880
|
var inductorProps = commonComponentProps.extend({
|
|
17859
17881
|
inductance: inductance2,
|
|
17860
|
-
maxCurrentRating:
|
|
17882
|
+
maxCurrentRating: z92.union([z92.string(), z92.number()]).optional(),
|
|
17861
17883
|
schOrientation: schematicOrientation.optional(),
|
|
17862
17884
|
connections: createConnectionsProp(inductorPins).optional()
|
|
17863
17885
|
});
|
|
17864
17886
|
expectTypesMatch(true);
|
|
17865
17887
|
|
|
17866
17888
|
// lib/components/internal-circuit.ts
|
|
17867
|
-
import { z as
|
|
17868
|
-
var internalCircuitProps =
|
|
17869
|
-
children:
|
|
17889
|
+
import { z as z93 } from "zod";
|
|
17890
|
+
var internalCircuitProps = z93.object({
|
|
17891
|
+
children: z93.custom().optional()
|
|
17870
17892
|
});
|
|
17871
17893
|
expectTypesMatch(
|
|
17872
17894
|
true
|
|
17873
17895
|
);
|
|
17874
17896
|
|
|
17875
17897
|
// lib/components/diode.ts
|
|
17876
|
-
import { z as
|
|
17898
|
+
import { z as z94 } from "zod";
|
|
17877
17899
|
var diodePins = lrPolarPins;
|
|
17878
|
-
var diodeConnectionKeys =
|
|
17900
|
+
var diodeConnectionKeys = z94.enum([
|
|
17879
17901
|
"anode",
|
|
17880
17902
|
"cathode",
|
|
17881
17903
|
"pin1",
|
|
@@ -17883,13 +17905,13 @@ var diodeConnectionKeys = z93.enum([
|
|
|
17883
17905
|
"pos",
|
|
17884
17906
|
"neg"
|
|
17885
17907
|
]);
|
|
17886
|
-
var connectionTarget3 =
|
|
17887
|
-
var connectionsProp2 =
|
|
17888
|
-
var diodePinLabelsProp =
|
|
17889
|
-
|
|
17890
|
-
schematicPinLabel.or(
|
|
17908
|
+
var connectionTarget3 = z94.string().or(z94.array(z94.string()).readonly()).or(z94.array(z94.string()));
|
|
17909
|
+
var connectionsProp2 = z94.record(diodeConnectionKeys, connectionTarget3);
|
|
17910
|
+
var diodePinLabelsProp = z94.record(
|
|
17911
|
+
z94.enum(diodePins),
|
|
17912
|
+
schematicPinLabel.or(z94.array(schematicPinLabel).readonly()).or(z94.array(schematicPinLabel))
|
|
17891
17913
|
);
|
|
17892
|
-
var diodeVariant =
|
|
17914
|
+
var diodeVariant = z94.enum([
|
|
17893
17915
|
"standard",
|
|
17894
17916
|
"schottky",
|
|
17895
17917
|
"zener",
|
|
@@ -17900,12 +17922,12 @@ var diodeVariant = z93.enum([
|
|
|
17900
17922
|
var diodeProps = commonComponentProps.extend({
|
|
17901
17923
|
connections: connectionsProp2.optional(),
|
|
17902
17924
|
variant: diodeVariant.optional().default("standard"),
|
|
17903
|
-
standard:
|
|
17904
|
-
schottky:
|
|
17905
|
-
zener:
|
|
17906
|
-
avalanche:
|
|
17907
|
-
photo:
|
|
17908
|
-
tvs:
|
|
17925
|
+
standard: z94.boolean().optional(),
|
|
17926
|
+
schottky: z94.boolean().optional(),
|
|
17927
|
+
zener: z94.boolean().optional(),
|
|
17928
|
+
avalanche: z94.boolean().optional(),
|
|
17929
|
+
photo: z94.boolean().optional(),
|
|
17930
|
+
tvs: z94.boolean().optional(),
|
|
17909
17931
|
schOrientation: schematicOrientation.optional(),
|
|
17910
17932
|
pinLabels: diodePinLabelsProp.optional()
|
|
17911
17933
|
}).superRefine((data, ctx) => {
|
|
@@ -17919,11 +17941,11 @@ var diodeProps = commonComponentProps.extend({
|
|
|
17919
17941
|
].filter(Boolean).length;
|
|
17920
17942
|
if (enabledFlags > 1) {
|
|
17921
17943
|
ctx.addIssue({
|
|
17922
|
-
code:
|
|
17944
|
+
code: z94.ZodIssueCode.custom,
|
|
17923
17945
|
message: "Exactly one diode variant must be enabled",
|
|
17924
17946
|
path: []
|
|
17925
17947
|
});
|
|
17926
|
-
return
|
|
17948
|
+
return z94.INVALID;
|
|
17927
17949
|
}
|
|
17928
17950
|
}).transform((data) => {
|
|
17929
17951
|
const result = {
|
|
@@ -17969,34 +17991,34 @@ var diodeProps = commonComponentProps.extend({
|
|
|
17969
17991
|
expectTypesMatch(true);
|
|
17970
17992
|
|
|
17971
17993
|
// lib/components/led.ts
|
|
17972
|
-
import { z as
|
|
17994
|
+
import { z as z95 } from "zod";
|
|
17973
17995
|
var ledProps = commonComponentProps.extend({
|
|
17974
|
-
color:
|
|
17975
|
-
wavelength:
|
|
17976
|
-
schDisplayValue:
|
|
17996
|
+
color: z95.string().optional(),
|
|
17997
|
+
wavelength: z95.string().optional(),
|
|
17998
|
+
schDisplayValue: z95.string().optional(),
|
|
17977
17999
|
schOrientation: schematicOrientation.optional(),
|
|
17978
18000
|
connections: createConnectionsProp(lrPolarPins).optional(),
|
|
17979
|
-
laser:
|
|
18001
|
+
laser: z95.boolean().optional()
|
|
17980
18002
|
});
|
|
17981
18003
|
var ledPins = lrPolarPins;
|
|
17982
18004
|
|
|
17983
18005
|
// lib/components/switch.ts
|
|
17984
18006
|
import { ms as ms3, frequency as frequency4 } from "circuit-json";
|
|
17985
|
-
import { z as
|
|
18007
|
+
import { z as z96 } from "zod";
|
|
17986
18008
|
var switchProps = commonComponentProps.extend({
|
|
17987
|
-
type:
|
|
17988
|
-
isNormallyClosed:
|
|
17989
|
-
spst:
|
|
17990
|
-
spdt:
|
|
17991
|
-
dpst:
|
|
17992
|
-
dpdt:
|
|
18009
|
+
type: z96.enum(["spst", "spdt", "dpst", "dpdt"]).optional(),
|
|
18010
|
+
isNormallyClosed: z96.boolean().optional().default(false),
|
|
18011
|
+
spst: z96.boolean().optional(),
|
|
18012
|
+
spdt: z96.boolean().optional(),
|
|
18013
|
+
dpst: z96.boolean().optional(),
|
|
18014
|
+
dpdt: z96.boolean().optional(),
|
|
17993
18015
|
pinLabels: pinLabelsProp.optional(),
|
|
17994
18016
|
simSwitchFrequency: frequency4.optional(),
|
|
17995
18017
|
simCloseAt: ms3.optional(),
|
|
17996
18018
|
simOpenAt: ms3.optional(),
|
|
17997
|
-
simStartClosed:
|
|
17998
|
-
simStartOpen:
|
|
17999
|
-
connections:
|
|
18019
|
+
simStartClosed: z96.boolean().optional(),
|
|
18020
|
+
simStartOpen: z96.boolean().optional(),
|
|
18021
|
+
connections: z96.custom().pipe(z96.record(z96.string(), connectionTarget)).optional()
|
|
18000
18022
|
}).transform((props) => {
|
|
18001
18023
|
const updatedProps = { ...props };
|
|
18002
18024
|
if (updatedProps.dpdt) {
|
|
@@ -18028,33 +18050,33 @@ expectTypesMatch(true);
|
|
|
18028
18050
|
|
|
18029
18051
|
// lib/components/fabrication-note-text.ts
|
|
18030
18052
|
import { length as length4 } from "circuit-json";
|
|
18031
|
-
import { z as
|
|
18053
|
+
import { z as z97 } from "zod";
|
|
18032
18054
|
var fabricationNoteTextProps = pcbLayoutProps.extend({
|
|
18033
|
-
text:
|
|
18034
|
-
anchorAlignment:
|
|
18035
|
-
font:
|
|
18055
|
+
text: z97.string(),
|
|
18056
|
+
anchorAlignment: z97.enum(["center", "top_left", "top_right", "bottom_left", "bottom_right"]).default("center"),
|
|
18057
|
+
font: z97.enum(["tscircuit2024"]).optional(),
|
|
18036
18058
|
fontSize: length4.optional(),
|
|
18037
|
-
color:
|
|
18059
|
+
color: z97.string().optional()
|
|
18038
18060
|
});
|
|
18039
18061
|
expectTypesMatch(true);
|
|
18040
18062
|
|
|
18041
18063
|
// lib/components/fabrication-note-rect.ts
|
|
18042
|
-
import { distance as
|
|
18043
|
-
import { z as
|
|
18064
|
+
import { distance as distance20 } from "circuit-json";
|
|
18065
|
+
import { z as z98 } from "zod";
|
|
18044
18066
|
var fabricationNoteRectProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
18045
|
-
width:
|
|
18046
|
-
height:
|
|
18047
|
-
strokeWidth:
|
|
18048
|
-
isFilled:
|
|
18049
|
-
hasStroke:
|
|
18050
|
-
isStrokeDashed:
|
|
18051
|
-
color:
|
|
18052
|
-
cornerRadius:
|
|
18067
|
+
width: distance20,
|
|
18068
|
+
height: distance20,
|
|
18069
|
+
strokeWidth: distance20.optional(),
|
|
18070
|
+
isFilled: z98.boolean().optional(),
|
|
18071
|
+
hasStroke: z98.boolean().optional(),
|
|
18072
|
+
isStrokeDashed: z98.boolean().optional(),
|
|
18073
|
+
color: z98.string().optional(),
|
|
18074
|
+
cornerRadius: distance20.optional()
|
|
18053
18075
|
});
|
|
18054
18076
|
|
|
18055
18077
|
// lib/components/fabrication-note-path.ts
|
|
18056
18078
|
import { length as length5, route_hint_point as route_hint_point3 } from "circuit-json";
|
|
18057
|
-
import { z as
|
|
18079
|
+
import { z as z99 } from "zod";
|
|
18058
18080
|
var fabricationNotePathProps = pcbLayoutProps.omit({
|
|
18059
18081
|
pcbLeftEdgeX: true,
|
|
18060
18082
|
pcbRightEdgeX: true,
|
|
@@ -18066,15 +18088,15 @@ var fabricationNotePathProps = pcbLayoutProps.omit({
|
|
|
18066
18088
|
pcbOffsetY: true,
|
|
18067
18089
|
pcbRotation: true
|
|
18068
18090
|
}).extend({
|
|
18069
|
-
route:
|
|
18091
|
+
route: z99.array(route_hint_point3),
|
|
18070
18092
|
strokeWidth: length5.optional(),
|
|
18071
|
-
color:
|
|
18093
|
+
color: z99.string().optional()
|
|
18072
18094
|
});
|
|
18073
18095
|
|
|
18074
18096
|
// lib/components/fabrication-note-dimension.ts
|
|
18075
|
-
import { distance as
|
|
18076
|
-
import { z as
|
|
18077
|
-
var dimensionTarget =
|
|
18097
|
+
import { distance as distance21, length as length6 } from "circuit-json";
|
|
18098
|
+
import { z as z100 } from "zod";
|
|
18099
|
+
var dimensionTarget = z100.union([z100.string(), point]);
|
|
18078
18100
|
var fabricationNoteDimensionProps = pcbLayoutProps.omit({
|
|
18079
18101
|
pcbLeftEdgeX: true,
|
|
18080
18102
|
pcbRightEdgeX: true,
|
|
@@ -18088,58 +18110,58 @@ var fabricationNoteDimensionProps = pcbLayoutProps.omit({
|
|
|
18088
18110
|
}).extend({
|
|
18089
18111
|
from: dimensionTarget,
|
|
18090
18112
|
to: dimensionTarget,
|
|
18091
|
-
text:
|
|
18092
|
-
offset:
|
|
18093
|
-
font:
|
|
18113
|
+
text: z100.string().optional(),
|
|
18114
|
+
offset: distance21.optional(),
|
|
18115
|
+
font: z100.enum(["tscircuit2024"]).optional(),
|
|
18094
18116
|
fontSize: length6.optional(),
|
|
18095
|
-
color:
|
|
18096
|
-
arrowSize:
|
|
18097
|
-
units:
|
|
18098
|
-
outerEdgeToEdge:
|
|
18099
|
-
centerToCenter:
|
|
18100
|
-
innerEdgeToEdge:
|
|
18117
|
+
color: z100.string().optional(),
|
|
18118
|
+
arrowSize: distance21.optional(),
|
|
18119
|
+
units: z100.enum(["in", "mm"]).optional(),
|
|
18120
|
+
outerEdgeToEdge: z100.literal(true).optional(),
|
|
18121
|
+
centerToCenter: z100.literal(true).optional(),
|
|
18122
|
+
innerEdgeToEdge: z100.literal(true).optional()
|
|
18101
18123
|
});
|
|
18102
18124
|
expectTypesMatch(true);
|
|
18103
18125
|
|
|
18104
18126
|
// lib/components/pcb-trace.ts
|
|
18105
|
-
import { distance as
|
|
18106
|
-
import { z as
|
|
18107
|
-
var pcbTraceProps =
|
|
18108
|
-
layer:
|
|
18109
|
-
thickness:
|
|
18110
|
-
route:
|
|
18127
|
+
import { distance as distance22, route_hint_point as route_hint_point4 } from "circuit-json";
|
|
18128
|
+
import { z as z101 } from "zod";
|
|
18129
|
+
var pcbTraceProps = z101.object({
|
|
18130
|
+
layer: z101.string().optional(),
|
|
18131
|
+
thickness: distance22.optional(),
|
|
18132
|
+
route: z101.array(route_hint_point4)
|
|
18111
18133
|
});
|
|
18112
18134
|
|
|
18113
18135
|
// lib/components/via.ts
|
|
18114
|
-
import { distance as
|
|
18115
|
-
import { z as
|
|
18136
|
+
import { distance as distance23, layer_ref as layer_ref7 } from "circuit-json";
|
|
18137
|
+
import { z as z102 } from "zod";
|
|
18116
18138
|
var viaProps = commonLayoutProps.extend({
|
|
18117
|
-
name:
|
|
18118
|
-
fromLayer:
|
|
18119
|
-
toLayer:
|
|
18120
|
-
holeDiameter:
|
|
18121
|
-
outerDiameter:
|
|
18122
|
-
layers:
|
|
18123
|
-
connectsTo:
|
|
18124
|
-
netIsAssignable:
|
|
18139
|
+
name: z102.string().optional(),
|
|
18140
|
+
fromLayer: layer_ref7.optional(),
|
|
18141
|
+
toLayer: layer_ref7.optional(),
|
|
18142
|
+
holeDiameter: distance23.optional(),
|
|
18143
|
+
outerDiameter: distance23.optional(),
|
|
18144
|
+
layers: z102.array(layer_ref7).optional(),
|
|
18145
|
+
connectsTo: z102.string().or(z102.array(z102.string())).optional(),
|
|
18146
|
+
netIsAssignable: z102.boolean().optional()
|
|
18125
18147
|
});
|
|
18126
18148
|
expectTypesMatch(true);
|
|
18127
18149
|
|
|
18128
18150
|
// lib/components/testpoint.ts
|
|
18129
|
-
import { distance as
|
|
18130
|
-
import { z as
|
|
18151
|
+
import { distance as distance24 } from "circuit-json";
|
|
18152
|
+
import { z as z103 } from "zod";
|
|
18131
18153
|
var testpointPins = ["pin1"];
|
|
18132
|
-
var testpointConnectionsProp =
|
|
18154
|
+
var testpointConnectionsProp = z103.object({
|
|
18133
18155
|
pin1: connectionTarget
|
|
18134
18156
|
}).strict();
|
|
18135
18157
|
var testpointProps = commonComponentProps.extend({
|
|
18136
18158
|
connections: testpointConnectionsProp.optional(),
|
|
18137
|
-
footprintVariant:
|
|
18138
|
-
padShape:
|
|
18139
|
-
padDiameter:
|
|
18140
|
-
holeDiameter:
|
|
18141
|
-
width:
|
|
18142
|
-
height:
|
|
18159
|
+
footprintVariant: z103.enum(["pad", "through_hole"]).optional(),
|
|
18160
|
+
padShape: z103.enum(["rect", "circle"]).optional().default("circle"),
|
|
18161
|
+
padDiameter: distance24.optional(),
|
|
18162
|
+
holeDiameter: distance24.optional(),
|
|
18163
|
+
width: distance24.optional(),
|
|
18164
|
+
height: distance24.optional()
|
|
18143
18165
|
}).refine(
|
|
18144
18166
|
(props) => props.footprintVariant !== "through_hole" || props.holeDiameter !== void 0,
|
|
18145
18167
|
{ message: "holeDiameter is required for through_hole testpoints" }
|
|
@@ -18147,45 +18169,45 @@ var testpointProps = commonComponentProps.extend({
|
|
|
18147
18169
|
expectTypesMatch(true);
|
|
18148
18170
|
|
|
18149
18171
|
// lib/components/breakoutpoint.ts
|
|
18150
|
-
import { z as
|
|
18172
|
+
import { z as z104 } from "zod";
|
|
18151
18173
|
var breakoutPointProps = pcbLayoutProps.omit({ pcbRotation: true, layer: true }).extend({
|
|
18152
|
-
connection:
|
|
18174
|
+
connection: z104.string()
|
|
18153
18175
|
});
|
|
18154
18176
|
expectTypesMatch(true);
|
|
18155
18177
|
|
|
18156
18178
|
// lib/components/pcb-keepout.ts
|
|
18157
|
-
import { distance as
|
|
18158
|
-
import { z as
|
|
18159
|
-
var pcbKeepoutProps =
|
|
18179
|
+
import { distance as distance25, layer_ref as layer_ref8 } from "circuit-json";
|
|
18180
|
+
import { z as z105 } from "zod";
|
|
18181
|
+
var pcbKeepoutProps = z105.union([
|
|
18160
18182
|
pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
18161
|
-
shape:
|
|
18162
|
-
radius:
|
|
18163
|
-
layers:
|
|
18183
|
+
shape: z105.literal("circle"),
|
|
18184
|
+
radius: distance25,
|
|
18185
|
+
layers: z105.array(layer_ref8).optional()
|
|
18164
18186
|
}),
|
|
18165
18187
|
pcbLayoutProps.extend({
|
|
18166
|
-
shape:
|
|
18167
|
-
width:
|
|
18168
|
-
height:
|
|
18169
|
-
layers:
|
|
18188
|
+
shape: z105.literal("rect"),
|
|
18189
|
+
width: distance25,
|
|
18190
|
+
height: distance25,
|
|
18191
|
+
layers: z105.array(layer_ref8).optional()
|
|
18170
18192
|
})
|
|
18171
18193
|
]);
|
|
18172
18194
|
|
|
18173
18195
|
// lib/components/courtyard-rect.ts
|
|
18174
|
-
import { distance as
|
|
18175
|
-
import { z as
|
|
18196
|
+
import { distance as distance26 } from "circuit-json";
|
|
18197
|
+
import { z as z106 } from "zod";
|
|
18176
18198
|
var courtyardRectProps = pcbLayoutProps.extend({
|
|
18177
|
-
width:
|
|
18178
|
-
height:
|
|
18179
|
-
strokeWidth:
|
|
18180
|
-
isFilled:
|
|
18181
|
-
hasStroke:
|
|
18182
|
-
isStrokeDashed:
|
|
18183
|
-
color:
|
|
18199
|
+
width: distance26,
|
|
18200
|
+
height: distance26,
|
|
18201
|
+
strokeWidth: distance26.optional(),
|
|
18202
|
+
isFilled: z106.boolean().optional(),
|
|
18203
|
+
hasStroke: z106.boolean().optional(),
|
|
18204
|
+
isStrokeDashed: z106.boolean().optional(),
|
|
18205
|
+
color: z106.string().optional()
|
|
18184
18206
|
});
|
|
18185
18207
|
|
|
18186
18208
|
// lib/components/courtyard-outline.ts
|
|
18187
18209
|
import { length as length7 } from "circuit-json";
|
|
18188
|
-
import { z as
|
|
18210
|
+
import { z as z107 } from "zod";
|
|
18189
18211
|
var courtyardOutlineProps = pcbLayoutProps.omit({
|
|
18190
18212
|
pcbLeftEdgeX: true,
|
|
18191
18213
|
pcbRightEdgeX: true,
|
|
@@ -18197,59 +18219,59 @@ var courtyardOutlineProps = pcbLayoutProps.omit({
|
|
|
18197
18219
|
pcbOffsetY: true,
|
|
18198
18220
|
pcbRotation: true
|
|
18199
18221
|
}).extend({
|
|
18200
|
-
outline:
|
|
18222
|
+
outline: z107.array(point),
|
|
18201
18223
|
strokeWidth: length7.optional(),
|
|
18202
|
-
isClosed:
|
|
18203
|
-
isStrokeDashed:
|
|
18204
|
-
color:
|
|
18224
|
+
isClosed: z107.boolean().optional(),
|
|
18225
|
+
isStrokeDashed: z107.boolean().optional(),
|
|
18226
|
+
color: z107.string().optional()
|
|
18205
18227
|
});
|
|
18206
18228
|
|
|
18207
18229
|
// lib/components/courtyard-circle.ts
|
|
18208
|
-
import { distance as
|
|
18230
|
+
import { distance as distance27 } from "circuit-json";
|
|
18209
18231
|
import "zod";
|
|
18210
18232
|
var courtyardCircleProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
18211
|
-
radius:
|
|
18233
|
+
radius: distance27
|
|
18212
18234
|
});
|
|
18213
18235
|
|
|
18214
18236
|
// lib/components/courtyard-pill.ts
|
|
18215
|
-
import { distance as
|
|
18237
|
+
import { distance as distance28 } from "circuit-json";
|
|
18216
18238
|
import "zod";
|
|
18217
18239
|
var courtyardPillProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
18218
|
-
width:
|
|
18219
|
-
height:
|
|
18220
|
-
radius:
|
|
18240
|
+
width: distance28,
|
|
18241
|
+
height: distance28,
|
|
18242
|
+
radius: distance28
|
|
18221
18243
|
});
|
|
18222
18244
|
|
|
18223
18245
|
// lib/components/copper-pour.ts
|
|
18224
|
-
import { z as
|
|
18225
|
-
import { layer_ref as
|
|
18226
|
-
var copperPourProps =
|
|
18227
|
-
name:
|
|
18228
|
-
layer:
|
|
18229
|
-
connectsTo:
|
|
18230
|
-
unbroken:
|
|
18246
|
+
import { z as z110 } from "zod";
|
|
18247
|
+
import { layer_ref as layer_ref9 } from "circuit-json";
|
|
18248
|
+
var copperPourProps = z110.object({
|
|
18249
|
+
name: z110.string().optional(),
|
|
18250
|
+
layer: layer_ref9,
|
|
18251
|
+
connectsTo: z110.string(),
|
|
18252
|
+
unbroken: z110.boolean().optional(),
|
|
18231
18253
|
padMargin: distance.optional(),
|
|
18232
18254
|
traceMargin: distance.optional(),
|
|
18233
18255
|
clearance: distance.optional(),
|
|
18234
18256
|
boardEdgeMargin: distance.optional(),
|
|
18235
18257
|
cutoutMargin: distance.optional(),
|
|
18236
|
-
outline:
|
|
18237
|
-
coveredWithSolderMask:
|
|
18258
|
+
outline: z110.array(point).optional(),
|
|
18259
|
+
coveredWithSolderMask: z110.boolean().optional().default(true)
|
|
18238
18260
|
});
|
|
18239
18261
|
expectTypesMatch(true);
|
|
18240
18262
|
|
|
18241
18263
|
// lib/components/cadassembly.ts
|
|
18242
|
-
import { layer_ref as
|
|
18243
|
-
import { z as
|
|
18244
|
-
var cadassemblyProps =
|
|
18245
|
-
originalLayer:
|
|
18246
|
-
children:
|
|
18264
|
+
import { layer_ref as layer_ref10 } from "circuit-json";
|
|
18265
|
+
import { z as z111 } from "zod";
|
|
18266
|
+
var cadassemblyProps = z111.object({
|
|
18267
|
+
originalLayer: layer_ref10.default("top").optional(),
|
|
18268
|
+
children: z111.any().optional()
|
|
18247
18269
|
});
|
|
18248
18270
|
expectTypesMatch(true);
|
|
18249
18271
|
|
|
18250
18272
|
// lib/components/cadmodel.ts
|
|
18251
|
-
import { z as
|
|
18252
|
-
var pcbPosition =
|
|
18273
|
+
import { z as z112 } from "zod";
|
|
18274
|
+
var pcbPosition = z112.object({
|
|
18253
18275
|
pcbX: pcbCoordinate.optional(),
|
|
18254
18276
|
pcbY: pcbCoordinate.optional(),
|
|
18255
18277
|
pcbLeftEdgeX: pcbCoordinate.optional(),
|
|
@@ -18266,7 +18288,7 @@ var cadModelBaseWithUrl = cadModelBase.extend({
|
|
|
18266
18288
|
});
|
|
18267
18289
|
var cadModelObject = cadModelBaseWithUrl.merge(pcbPosition);
|
|
18268
18290
|
expectTypesMatch(true);
|
|
18269
|
-
var cadmodelProps =
|
|
18291
|
+
var cadmodelProps = z112.union([z112.null(), url, cadModelObject]);
|
|
18270
18292
|
|
|
18271
18293
|
// lib/components/power-source.ts
|
|
18272
18294
|
import { voltage as voltage5 } from "circuit-json";
|
|
@@ -18276,9 +18298,9 @@ var powerSourceProps = commonComponentProps.extend({
|
|
|
18276
18298
|
|
|
18277
18299
|
// lib/components/voltagesource.ts
|
|
18278
18300
|
import { frequency as frequency5, ms as ms4, rotation as rotation5, voltage as voltage6 } from "circuit-json";
|
|
18279
|
-
import { z as
|
|
18301
|
+
import { z as z113 } from "zod";
|
|
18280
18302
|
var voltageSourcePinLabels = ["pin1", "pin2", "pos", "neg"];
|
|
18281
|
-
var percentage =
|
|
18303
|
+
var percentage = z113.union([z113.string(), z113.number()]).transform((val) => {
|
|
18282
18304
|
if (typeof val === "string") {
|
|
18283
18305
|
if (val.endsWith("%")) {
|
|
18284
18306
|
return parseFloat(val.slice(0, -1)) / 100;
|
|
@@ -18287,13 +18309,13 @@ var percentage = z112.union([z112.string(), z112.number()]).transform((val) => {
|
|
|
18287
18309
|
}
|
|
18288
18310
|
return val;
|
|
18289
18311
|
}).pipe(
|
|
18290
|
-
|
|
18312
|
+
z113.number().min(0, "Duty cycle must be non-negative").max(1, "Duty cycle cannot be greater than 100%")
|
|
18291
18313
|
);
|
|
18292
18314
|
var voltageSourceProps = commonComponentProps.extend({
|
|
18293
18315
|
voltage: voltage6.optional(),
|
|
18294
18316
|
frequency: frequency5.optional(),
|
|
18295
18317
|
peakToPeakVoltage: voltage6.optional(),
|
|
18296
|
-
waveShape:
|
|
18318
|
+
waveShape: z113.enum(["sinewave", "square", "triangle", "sawtooth"]).optional(),
|
|
18297
18319
|
phase: rotation5.optional(),
|
|
18298
18320
|
dutyCycle: percentage.optional(),
|
|
18299
18321
|
pulseDelay: ms4.optional(),
|
|
@@ -18310,9 +18332,9 @@ expectTypesMatch(true);
|
|
|
18310
18332
|
|
|
18311
18333
|
// lib/components/currentsource.ts
|
|
18312
18334
|
import { frequency as frequency6, rotation as rotation6, current as current3 } from "circuit-json";
|
|
18313
|
-
import { z as
|
|
18335
|
+
import { z as z114 } from "zod";
|
|
18314
18336
|
var currentSourcePinLabels = ["pin1", "pin2", "pos", "neg"];
|
|
18315
|
-
var percentage2 =
|
|
18337
|
+
var percentage2 = z114.union([z114.string(), z114.number()]).transform((val) => {
|
|
18316
18338
|
if (typeof val === "string") {
|
|
18317
18339
|
if (val.endsWith("%")) {
|
|
18318
18340
|
return parseFloat(val.slice(0, -1)) / 100;
|
|
@@ -18321,13 +18343,13 @@ var percentage2 = z113.union([z113.string(), z113.number()]).transform((val) =>
|
|
|
18321
18343
|
}
|
|
18322
18344
|
return val;
|
|
18323
18345
|
}).pipe(
|
|
18324
|
-
|
|
18346
|
+
z114.number().min(0, "Duty cycle must be non-negative").max(1, "Duty cycle cannot be greater than 100%")
|
|
18325
18347
|
);
|
|
18326
18348
|
var currentSourceProps = commonComponentProps.extend({
|
|
18327
18349
|
current: current3.optional(),
|
|
18328
18350
|
frequency: frequency6.optional(),
|
|
18329
18351
|
peakToPeakCurrent: current3.optional(),
|
|
18330
|
-
waveShape:
|
|
18352
|
+
waveShape: z114.enum(["sinewave", "square", "triangle", "sawtooth"]).optional(),
|
|
18331
18353
|
phase: rotation6.optional(),
|
|
18332
18354
|
dutyCycle: percentage2.optional(),
|
|
18333
18355
|
acMagnitude: current3.optional(),
|
|
@@ -18338,21 +18360,21 @@ var currentSourcePins = lrPolarPins;
|
|
|
18338
18360
|
expectTypesMatch(true);
|
|
18339
18361
|
|
|
18340
18362
|
// lib/components/voltageprobe.ts
|
|
18341
|
-
import { z as
|
|
18363
|
+
import { z as z115 } from "zod";
|
|
18342
18364
|
var voltageProbeProps = commonComponentProps.omit({ name: true }).extend({
|
|
18343
|
-
name:
|
|
18344
|
-
connectsTo:
|
|
18345
|
-
referenceTo:
|
|
18346
|
-
color:
|
|
18347
|
-
graphDisplayName:
|
|
18348
|
-
graphCenter:
|
|
18349
|
-
graphVerticalOffset:
|
|
18350
|
-
graphVoltagePerDiv:
|
|
18365
|
+
name: z115.string().optional(),
|
|
18366
|
+
connectsTo: z115.string(),
|
|
18367
|
+
referenceTo: z115.string().optional(),
|
|
18368
|
+
color: z115.string().optional(),
|
|
18369
|
+
graphDisplayName: z115.string().optional(),
|
|
18370
|
+
graphCenter: z115.number().optional(),
|
|
18371
|
+
graphVerticalOffset: z115.number().or(z115.string()).optional(),
|
|
18372
|
+
graphVoltagePerDiv: z115.number().or(z115.string()).optional()
|
|
18351
18373
|
});
|
|
18352
18374
|
expectTypesMatch(true);
|
|
18353
18375
|
|
|
18354
18376
|
// lib/components/ammeter.ts
|
|
18355
|
-
import { z as
|
|
18377
|
+
import { z as z116 } from "zod";
|
|
18356
18378
|
var ammeterPinLabels = ["pin1", "pin2", "pos", "neg"];
|
|
18357
18379
|
var hasAmmeterConnectionPair = (connections) => {
|
|
18358
18380
|
return connections.pos !== void 0 && connections.neg !== void 0 || connections.pin1 !== void 0 && connections.pin2 !== void 0;
|
|
@@ -18362,63 +18384,63 @@ var ammeterProps = commonComponentProps.extend({
|
|
|
18362
18384
|
hasAmmeterConnectionPair,
|
|
18363
18385
|
"Ammeter connections must include either pos/neg or pin1/pin2"
|
|
18364
18386
|
),
|
|
18365
|
-
color:
|
|
18366
|
-
graphDisplayName:
|
|
18367
|
-
graphCenter:
|
|
18368
|
-
graphVerticalOffset:
|
|
18369
|
-
graphCurrentPerDiv:
|
|
18387
|
+
color: z116.string().optional(),
|
|
18388
|
+
graphDisplayName: z116.string().optional(),
|
|
18389
|
+
graphCenter: z116.number().optional(),
|
|
18390
|
+
graphVerticalOffset: z116.number().or(z116.string()).optional(),
|
|
18391
|
+
graphCurrentPerDiv: z116.number().or(z116.string()).optional()
|
|
18370
18392
|
});
|
|
18371
18393
|
var ammeterPins = ammeterPinLabels;
|
|
18372
18394
|
expectTypesMatch(true);
|
|
18373
18395
|
|
|
18374
18396
|
// lib/components/schematic-arc.ts
|
|
18375
|
-
import { distance as
|
|
18376
|
-
import { z as
|
|
18377
|
-
var schematicArcProps =
|
|
18397
|
+
import { distance as distance29, point as point5, rotation as rotation7 } from "circuit-json";
|
|
18398
|
+
import { z as z117 } from "zod";
|
|
18399
|
+
var schematicArcProps = z117.object({
|
|
18378
18400
|
center: point5,
|
|
18379
|
-
radius:
|
|
18401
|
+
radius: distance29,
|
|
18380
18402
|
startAngleDegrees: rotation7,
|
|
18381
18403
|
endAngleDegrees: rotation7,
|
|
18382
|
-
direction:
|
|
18383
|
-
strokeWidth:
|
|
18384
|
-
color:
|
|
18385
|
-
isDashed:
|
|
18404
|
+
direction: z117.enum(["clockwise", "counterclockwise"]).default("counterclockwise"),
|
|
18405
|
+
strokeWidth: distance29.optional(),
|
|
18406
|
+
color: z117.string().optional(),
|
|
18407
|
+
isDashed: z117.boolean().optional().default(false)
|
|
18386
18408
|
});
|
|
18387
18409
|
expectTypesMatch(true);
|
|
18388
18410
|
|
|
18389
18411
|
// lib/components/toolingrail.ts
|
|
18390
|
-
import { z as
|
|
18391
|
-
var toolingrailProps =
|
|
18392
|
-
children:
|
|
18412
|
+
import { z as z118 } from "zod";
|
|
18413
|
+
var toolingrailProps = z118.object({
|
|
18414
|
+
children: z118.any().optional()
|
|
18393
18415
|
});
|
|
18394
18416
|
expectTypesMatch(true);
|
|
18395
18417
|
|
|
18396
18418
|
// lib/components/schematic-box.ts
|
|
18397
|
-
import { distance as
|
|
18398
|
-
import { z as
|
|
18399
|
-
var schematicBoxProps =
|
|
18400
|
-
name:
|
|
18401
|
-
chipRef:
|
|
18419
|
+
import { distance as distance30 } from "circuit-json";
|
|
18420
|
+
import { z as z119 } from "zod";
|
|
18421
|
+
var schematicBoxProps = z119.object({
|
|
18422
|
+
name: z119.string().optional(),
|
|
18423
|
+
chipRef: z119.string().optional(),
|
|
18402
18424
|
pinLabels: pinLabelsProp.optional(),
|
|
18403
18425
|
schPinArrangement: schematicPinArrangement.optional(),
|
|
18404
|
-
schX:
|
|
18405
|
-
schY:
|
|
18406
|
-
schSectionName:
|
|
18407
|
-
schSheetName:
|
|
18408
|
-
width:
|
|
18409
|
-
height:
|
|
18410
|
-
overlay:
|
|
18411
|
-
padding:
|
|
18412
|
-
paddingLeft:
|
|
18413
|
-
paddingRight:
|
|
18414
|
-
paddingTop:
|
|
18415
|
-
paddingBottom:
|
|
18416
|
-
title:
|
|
18426
|
+
schX: distance30.optional(),
|
|
18427
|
+
schY: distance30.optional(),
|
|
18428
|
+
schSectionName: z119.string().optional(),
|
|
18429
|
+
schSheetName: z119.string().optional(),
|
|
18430
|
+
width: distance30.optional(),
|
|
18431
|
+
height: distance30.optional(),
|
|
18432
|
+
overlay: z119.array(z119.string()).optional(),
|
|
18433
|
+
padding: distance30.optional(),
|
|
18434
|
+
paddingLeft: distance30.optional(),
|
|
18435
|
+
paddingRight: distance30.optional(),
|
|
18436
|
+
paddingTop: distance30.optional(),
|
|
18437
|
+
paddingBottom: distance30.optional(),
|
|
18438
|
+
title: z119.string().optional(),
|
|
18417
18439
|
titleAlignment: ninePointAnchor.default("top_left"),
|
|
18418
|
-
titleColor:
|
|
18419
|
-
titleFontSize:
|
|
18420
|
-
titleInside:
|
|
18421
|
-
strokeStyle:
|
|
18440
|
+
titleColor: z119.string().optional(),
|
|
18441
|
+
titleFontSize: distance30.optional(),
|
|
18442
|
+
titleInside: z119.boolean().default(false),
|
|
18443
|
+
strokeStyle: z119.enum(["solid", "dashed"]).default("solid")
|
|
18422
18444
|
}).refine(
|
|
18423
18445
|
(elm) => elm.width !== void 0 && elm.height !== void 0 || Array.isArray(elm.overlay) && elm.overlay.length > 0,
|
|
18424
18446
|
{
|
|
@@ -18434,82 +18456,82 @@ expectTypesMatch(true);
|
|
|
18434
18456
|
|
|
18435
18457
|
// lib/components/schematic-symbol.ts
|
|
18436
18458
|
import { rotation as rotation8 } from "circuit-json";
|
|
18437
|
-
import { z as
|
|
18438
|
-
var schematicSymbolConnections =
|
|
18459
|
+
import { z as z120 } from "zod";
|
|
18460
|
+
var schematicSymbolConnections = z120.custom().pipe(z120.record(z120.string(), connectionTarget)).refine((value) => Object.keys(value).length > 0, {
|
|
18439
18461
|
message: "connections must map at least one schematic symbol port"
|
|
18440
18462
|
});
|
|
18441
|
-
var schematicSymbolProps =
|
|
18442
|
-
name:
|
|
18443
|
-
displayName:
|
|
18444
|
-
chipRef:
|
|
18445
|
-
symbolName:
|
|
18463
|
+
var schematicSymbolProps = z120.object({
|
|
18464
|
+
name: z120.string().min(1),
|
|
18465
|
+
displayName: z120.string().optional(),
|
|
18466
|
+
chipRef: z120.string().min(1).optional(),
|
|
18467
|
+
symbolName: z120.string().min(1),
|
|
18446
18468
|
connections: schematicSymbolConnections.optional(),
|
|
18447
18469
|
schX: distance.optional(),
|
|
18448
18470
|
schY: distance.optional(),
|
|
18449
18471
|
schRotation: rotation8.optional(),
|
|
18450
|
-
schSectionName:
|
|
18451
|
-
schSheetName:
|
|
18472
|
+
schSectionName: z120.string().optional(),
|
|
18473
|
+
schSheetName: z120.string().optional()
|
|
18452
18474
|
});
|
|
18453
18475
|
expectTypesMatch(
|
|
18454
18476
|
true
|
|
18455
18477
|
);
|
|
18456
18478
|
|
|
18457
18479
|
// lib/components/schematic-circle.ts
|
|
18458
|
-
import { distance as
|
|
18459
|
-
import { z as
|
|
18460
|
-
var schematicCircleProps =
|
|
18480
|
+
import { distance as distance31, point as point6 } from "circuit-json";
|
|
18481
|
+
import { z as z121 } from "zod";
|
|
18482
|
+
var schematicCircleProps = z121.object({
|
|
18461
18483
|
center: point6,
|
|
18462
|
-
radius:
|
|
18463
|
-
strokeWidth:
|
|
18464
|
-
color:
|
|
18465
|
-
isFilled:
|
|
18466
|
-
fillColor:
|
|
18467
|
-
isDashed:
|
|
18484
|
+
radius: distance31,
|
|
18485
|
+
strokeWidth: distance31.optional(),
|
|
18486
|
+
color: z121.string().optional(),
|
|
18487
|
+
isFilled: z121.boolean().optional().default(false),
|
|
18488
|
+
fillColor: z121.string().optional(),
|
|
18489
|
+
isDashed: z121.boolean().optional().default(false)
|
|
18468
18490
|
});
|
|
18469
18491
|
expectTypesMatch(
|
|
18470
18492
|
true
|
|
18471
18493
|
);
|
|
18472
18494
|
|
|
18473
18495
|
// lib/components/schematic-rect.ts
|
|
18474
|
-
import { distance as
|
|
18475
|
-
import { z as
|
|
18476
|
-
var schematicRectProps =
|
|
18477
|
-
schX:
|
|
18478
|
-
schY:
|
|
18479
|
-
width:
|
|
18480
|
-
height:
|
|
18496
|
+
import { distance as distance32, rotation as rotation9 } from "circuit-json";
|
|
18497
|
+
import { z as z122 } from "zod";
|
|
18498
|
+
var schematicRectProps = z122.object({
|
|
18499
|
+
schX: distance32.optional(),
|
|
18500
|
+
schY: distance32.optional(),
|
|
18501
|
+
width: distance32,
|
|
18502
|
+
height: distance32,
|
|
18481
18503
|
rotation: rotation9.default(0),
|
|
18482
|
-
strokeWidth:
|
|
18483
|
-
color:
|
|
18484
|
-
isFilled:
|
|
18485
|
-
fillColor:
|
|
18486
|
-
isDashed:
|
|
18504
|
+
strokeWidth: distance32.optional(),
|
|
18505
|
+
color: z122.string().optional(),
|
|
18506
|
+
isFilled: z122.boolean().optional().default(false),
|
|
18507
|
+
fillColor: z122.string().optional(),
|
|
18508
|
+
isDashed: z122.boolean().optional().default(false)
|
|
18487
18509
|
});
|
|
18488
18510
|
expectTypesMatch(true);
|
|
18489
18511
|
|
|
18490
18512
|
// lib/components/schematic-line.ts
|
|
18491
|
-
import { distance as
|
|
18492
|
-
import { z as
|
|
18493
|
-
var schematicLineProps =
|
|
18494
|
-
x1:
|
|
18495
|
-
y1:
|
|
18496
|
-
x2:
|
|
18497
|
-
y2:
|
|
18498
|
-
strokeWidth:
|
|
18499
|
-
color:
|
|
18500
|
-
isDashed:
|
|
18501
|
-
dashLength:
|
|
18502
|
-
dashGap:
|
|
18513
|
+
import { distance as distance33 } from "circuit-json";
|
|
18514
|
+
import { z as z123 } from "zod";
|
|
18515
|
+
var schematicLineProps = z123.object({
|
|
18516
|
+
x1: distance33,
|
|
18517
|
+
y1: distance33,
|
|
18518
|
+
x2: distance33,
|
|
18519
|
+
y2: distance33,
|
|
18520
|
+
strokeWidth: distance33.optional(),
|
|
18521
|
+
color: z123.string().optional(),
|
|
18522
|
+
isDashed: z123.boolean().optional().default(false),
|
|
18523
|
+
dashLength: distance33.optional(),
|
|
18524
|
+
dashGap: distance33.optional()
|
|
18503
18525
|
});
|
|
18504
18526
|
expectTypesMatch(true);
|
|
18505
18527
|
|
|
18506
18528
|
// lib/components/schematic-text.ts
|
|
18507
|
-
import { distance as
|
|
18508
|
-
import { z as
|
|
18529
|
+
import { distance as distance34, rotation as rotation10 } from "circuit-json";
|
|
18530
|
+
import { z as z125 } from "zod";
|
|
18509
18531
|
|
|
18510
18532
|
// lib/common/fivePointAnchor.ts
|
|
18511
|
-
import { z as
|
|
18512
|
-
var fivePointAnchor =
|
|
18533
|
+
import { z as z124 } from "zod";
|
|
18534
|
+
var fivePointAnchor = z124.enum([
|
|
18513
18535
|
"center",
|
|
18514
18536
|
"left",
|
|
18515
18537
|
"right",
|
|
@@ -18518,128 +18540,128 @@ var fivePointAnchor = z123.enum([
|
|
|
18518
18540
|
]);
|
|
18519
18541
|
|
|
18520
18542
|
// lib/components/schematic-text.ts
|
|
18521
|
-
var schematicTextProps =
|
|
18522
|
-
schX:
|
|
18523
|
-
schY:
|
|
18524
|
-
text:
|
|
18525
|
-
fontSize:
|
|
18526
|
-
anchor:
|
|
18527
|
-
color:
|
|
18543
|
+
var schematicTextProps = z125.object({
|
|
18544
|
+
schX: distance34.optional(),
|
|
18545
|
+
schY: distance34.optional(),
|
|
18546
|
+
text: z125.string(),
|
|
18547
|
+
fontSize: z125.number().default(1),
|
|
18548
|
+
anchor: z125.union([fivePointAnchor.describe("legacy"), ninePointAnchor]).default("center"),
|
|
18549
|
+
color: z125.string().default("#000000"),
|
|
18528
18550
|
schRotation: rotation10.default(0)
|
|
18529
18551
|
});
|
|
18530
18552
|
expectTypesMatch(true);
|
|
18531
18553
|
|
|
18532
18554
|
// lib/components/schematic-path.ts
|
|
18533
|
-
import { distance as
|
|
18534
|
-
import { z as
|
|
18535
|
-
var schematicPathProps =
|
|
18536
|
-
points:
|
|
18537
|
-
svgPath:
|
|
18538
|
-
strokeWidth:
|
|
18539
|
-
strokeColor:
|
|
18540
|
-
dashLength:
|
|
18541
|
-
dashGap:
|
|
18542
|
-
isFilled:
|
|
18543
|
-
fillColor:
|
|
18555
|
+
import { distance as distance35, point as point7 } from "circuit-json";
|
|
18556
|
+
import { z as z126 } from "zod";
|
|
18557
|
+
var schematicPathProps = z126.object({
|
|
18558
|
+
points: z126.array(point7).optional(),
|
|
18559
|
+
svgPath: z126.string().optional(),
|
|
18560
|
+
strokeWidth: distance35.optional(),
|
|
18561
|
+
strokeColor: z126.string().optional(),
|
|
18562
|
+
dashLength: distance35.optional(),
|
|
18563
|
+
dashGap: distance35.optional(),
|
|
18564
|
+
isFilled: z126.boolean().optional().default(false),
|
|
18565
|
+
fillColor: z126.string().optional()
|
|
18544
18566
|
});
|
|
18545
18567
|
expectTypesMatch(true);
|
|
18546
18568
|
|
|
18547
18569
|
// lib/components/schematic-table.ts
|
|
18548
|
-
import { distance as
|
|
18549
|
-
import { z as
|
|
18550
|
-
var schematicTableProps =
|
|
18551
|
-
schX:
|
|
18552
|
-
schY:
|
|
18553
|
-
children:
|
|
18554
|
-
cellPadding:
|
|
18555
|
-
borderWidth:
|
|
18570
|
+
import { distance as distance36 } from "circuit-json";
|
|
18571
|
+
import { z as z127 } from "zod";
|
|
18572
|
+
var schematicTableProps = z127.object({
|
|
18573
|
+
schX: distance36.optional(),
|
|
18574
|
+
schY: distance36.optional(),
|
|
18575
|
+
children: z127.any().optional(),
|
|
18576
|
+
cellPadding: distance36.optional(),
|
|
18577
|
+
borderWidth: distance36.optional(),
|
|
18556
18578
|
anchor: ninePointAnchor.optional(),
|
|
18557
|
-
fontSize:
|
|
18579
|
+
fontSize: distance36.optional()
|
|
18558
18580
|
});
|
|
18559
18581
|
expectTypesMatch(true);
|
|
18560
18582
|
|
|
18561
18583
|
// lib/components/schematic-row.ts
|
|
18562
|
-
import { distance as
|
|
18563
|
-
import { z as
|
|
18564
|
-
var schematicRowProps =
|
|
18565
|
-
children:
|
|
18566
|
-
height:
|
|
18584
|
+
import { distance as distance37 } from "circuit-json";
|
|
18585
|
+
import { z as z128 } from "zod";
|
|
18586
|
+
var schematicRowProps = z128.object({
|
|
18587
|
+
children: z128.any().optional(),
|
|
18588
|
+
height: distance37.optional()
|
|
18567
18589
|
});
|
|
18568
18590
|
expectTypesMatch(true);
|
|
18569
18591
|
|
|
18570
18592
|
// lib/components/schematic-cell.ts
|
|
18571
|
-
import { distance as
|
|
18572
|
-
import { z as
|
|
18573
|
-
var schematicCellProps =
|
|
18574
|
-
children:
|
|
18575
|
-
horizontalAlign:
|
|
18576
|
-
verticalAlign:
|
|
18577
|
-
fontSize:
|
|
18578
|
-
rowSpan:
|
|
18579
|
-
colSpan:
|
|
18580
|
-
width:
|
|
18581
|
-
text:
|
|
18593
|
+
import { distance as distance38 } from "circuit-json";
|
|
18594
|
+
import { z as z129 } from "zod";
|
|
18595
|
+
var schematicCellProps = z129.object({
|
|
18596
|
+
children: z129.string().optional(),
|
|
18597
|
+
horizontalAlign: z129.enum(["left", "center", "right"]).optional(),
|
|
18598
|
+
verticalAlign: z129.enum(["top", "middle", "bottom"]).optional(),
|
|
18599
|
+
fontSize: distance38.optional(),
|
|
18600
|
+
rowSpan: z129.number().optional(),
|
|
18601
|
+
colSpan: z129.number().optional(),
|
|
18602
|
+
width: distance38.optional(),
|
|
18603
|
+
text: z129.string().optional()
|
|
18582
18604
|
});
|
|
18583
18605
|
expectTypesMatch(true);
|
|
18584
18606
|
|
|
18585
18607
|
// lib/components/schematic-section.ts
|
|
18586
|
-
import { distance as
|
|
18587
|
-
import { z as
|
|
18588
|
-
var schematicSectionProps =
|
|
18589
|
-
displayName:
|
|
18590
|
-
name:
|
|
18591
|
-
sectionTitleFontSize:
|
|
18608
|
+
import { distance as distance39 } from "circuit-json";
|
|
18609
|
+
import { z as z130 } from "zod";
|
|
18610
|
+
var schematicSectionProps = z130.object({
|
|
18611
|
+
displayName: z130.string().optional(),
|
|
18612
|
+
name: z130.string(),
|
|
18613
|
+
sectionTitleFontSize: distance39.optional()
|
|
18592
18614
|
});
|
|
18593
18615
|
expectTypesMatch(
|
|
18594
18616
|
true
|
|
18595
18617
|
);
|
|
18596
18618
|
|
|
18597
18619
|
// lib/components/schematic-sheet.ts
|
|
18598
|
-
import { z as
|
|
18599
|
-
var schematicSheetProps =
|
|
18600
|
-
name:
|
|
18601
|
-
displayName:
|
|
18602
|
-
sheetIndex:
|
|
18603
|
-
children:
|
|
18620
|
+
import { z as z131 } from "zod";
|
|
18621
|
+
var schematicSheetProps = z131.object({
|
|
18622
|
+
name: z131.string(),
|
|
18623
|
+
displayName: z131.string(),
|
|
18624
|
+
sheetIndex: z131.number().optional(),
|
|
18625
|
+
children: z131.any().optional()
|
|
18604
18626
|
});
|
|
18605
18627
|
expectTypesMatch(true);
|
|
18606
18628
|
|
|
18607
18629
|
// lib/components/copper-text.ts
|
|
18608
|
-
import { layer_ref as
|
|
18609
|
-
import { z as
|
|
18630
|
+
import { layer_ref as layer_ref11, length as length8 } from "circuit-json";
|
|
18631
|
+
import { z as z132 } from "zod";
|
|
18610
18632
|
var copperTextProps = pcbLayoutProps.extend({
|
|
18611
|
-
text:
|
|
18633
|
+
text: z132.string(),
|
|
18612
18634
|
anchorAlignment: ninePointAnchor.default("center"),
|
|
18613
|
-
font:
|
|
18635
|
+
font: z132.enum(["tscircuit2024"]).optional(),
|
|
18614
18636
|
fontSize: length8.optional(),
|
|
18615
|
-
layers:
|
|
18616
|
-
knockout:
|
|
18617
|
-
mirrored:
|
|
18637
|
+
layers: z132.array(layer_ref11).optional(),
|
|
18638
|
+
knockout: z132.boolean().optional(),
|
|
18639
|
+
mirrored: z132.boolean().optional()
|
|
18618
18640
|
});
|
|
18619
18641
|
|
|
18620
18642
|
// lib/components/silkscreen-text.ts
|
|
18621
|
-
import { layer_ref as
|
|
18622
|
-
import { z as
|
|
18643
|
+
import { layer_ref as layer_ref12, length as length9 } from "circuit-json";
|
|
18644
|
+
import { z as z133 } from "zod";
|
|
18623
18645
|
var silkscreenTextProps = pcbLayoutProps.extend({
|
|
18624
|
-
text:
|
|
18646
|
+
text: z133.string(),
|
|
18625
18647
|
anchorAlignment: ninePointAnchor.default("center"),
|
|
18626
|
-
font:
|
|
18648
|
+
font: z133.enum(["tscircuit2024"]).optional(),
|
|
18627
18649
|
fontSize: length9.optional(),
|
|
18628
18650
|
/**
|
|
18629
18651
|
* If true, text will knock out underlying silkscreen
|
|
18630
18652
|
*/
|
|
18631
|
-
isKnockout:
|
|
18653
|
+
isKnockout: z133.boolean().optional(),
|
|
18632
18654
|
knockoutPadding: length9.optional(),
|
|
18633
18655
|
knockoutPaddingLeft: length9.optional(),
|
|
18634
18656
|
knockoutPaddingRight: length9.optional(),
|
|
18635
18657
|
knockoutPaddingTop: length9.optional(),
|
|
18636
18658
|
knockoutPaddingBottom: length9.optional(),
|
|
18637
|
-
layers:
|
|
18659
|
+
layers: z133.array(layer_ref12).optional()
|
|
18638
18660
|
});
|
|
18639
18661
|
|
|
18640
18662
|
// lib/components/silkscreen-path.ts
|
|
18641
18663
|
import { length as length10, route_hint_point as route_hint_point5 } from "circuit-json";
|
|
18642
|
-
import { z as
|
|
18664
|
+
import { z as z134 } from "zod";
|
|
18643
18665
|
var silkscreenPathProps = pcbLayoutProps.omit({
|
|
18644
18666
|
pcbLeftEdgeX: true,
|
|
18645
18667
|
pcbRightEdgeX: true,
|
|
@@ -18651,12 +18673,12 @@ var silkscreenPathProps = pcbLayoutProps.omit({
|
|
|
18651
18673
|
pcbOffsetY: true,
|
|
18652
18674
|
pcbRotation: true
|
|
18653
18675
|
}).extend({
|
|
18654
|
-
route:
|
|
18676
|
+
route: z134.array(route_hint_point5),
|
|
18655
18677
|
strokeWidth: length10.optional()
|
|
18656
18678
|
});
|
|
18657
18679
|
|
|
18658
18680
|
// lib/components/silkscreen-line.ts
|
|
18659
|
-
import { distance as
|
|
18681
|
+
import { distance as distance40 } from "circuit-json";
|
|
18660
18682
|
var silkscreenLineProps = pcbLayoutProps.omit({
|
|
18661
18683
|
pcbX: true,
|
|
18662
18684
|
pcbY: true,
|
|
@@ -18664,33 +18686,33 @@ var silkscreenLineProps = pcbLayoutProps.omit({
|
|
|
18664
18686
|
pcbOffsetY: true,
|
|
18665
18687
|
pcbRotation: true
|
|
18666
18688
|
}).extend({
|
|
18667
|
-
strokeWidth:
|
|
18668
|
-
x1:
|
|
18669
|
-
y1:
|
|
18670
|
-
x2:
|
|
18671
|
-
y2:
|
|
18689
|
+
strokeWidth: distance40,
|
|
18690
|
+
x1: distance40,
|
|
18691
|
+
y1: distance40,
|
|
18692
|
+
x2: distance40,
|
|
18693
|
+
y2: distance40
|
|
18672
18694
|
});
|
|
18673
18695
|
|
|
18674
18696
|
// lib/components/silkscreen-rect.ts
|
|
18675
|
-
import { distance as
|
|
18676
|
-
import { z as
|
|
18697
|
+
import { distance as distance41 } from "circuit-json";
|
|
18698
|
+
import { z as z135 } from "zod";
|
|
18677
18699
|
var silkscreenRectProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
18678
|
-
filled:
|
|
18679
|
-
stroke:
|
|
18680
|
-
strokeWidth:
|
|
18681
|
-
width:
|
|
18682
|
-
height:
|
|
18683
|
-
cornerRadius:
|
|
18700
|
+
filled: z135.boolean().default(true).optional(),
|
|
18701
|
+
stroke: z135.enum(["dashed", "solid", "none"]).optional(),
|
|
18702
|
+
strokeWidth: distance41.optional(),
|
|
18703
|
+
width: distance41,
|
|
18704
|
+
height: distance41,
|
|
18705
|
+
cornerRadius: distance41.optional()
|
|
18684
18706
|
});
|
|
18685
18707
|
|
|
18686
18708
|
// lib/components/silkscreen-circle.ts
|
|
18687
|
-
import { distance as
|
|
18688
|
-
import { z as
|
|
18709
|
+
import { distance as distance42 } from "circuit-json";
|
|
18710
|
+
import { z as z136 } from "zod";
|
|
18689
18711
|
var silkscreenCircleProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
18690
|
-
isFilled:
|
|
18691
|
-
isOutline:
|
|
18692
|
-
strokeWidth:
|
|
18693
|
-
radius:
|
|
18712
|
+
isFilled: z136.boolean().optional(),
|
|
18713
|
+
isOutline: z136.boolean().optional(),
|
|
18714
|
+
strokeWidth: distance42.optional(),
|
|
18715
|
+
radius: distance42
|
|
18694
18716
|
});
|
|
18695
18717
|
|
|
18696
18718
|
// lib/components/silkscreen-graphic.ts
|
|
@@ -18705,65 +18727,65 @@ var silkscreenGraphicProps = pcbLayoutProps.omit({ layer: true, pcbStyle: true,
|
|
|
18705
18727
|
expectTypesMatch(true);
|
|
18706
18728
|
|
|
18707
18729
|
// lib/components/trace-hint.ts
|
|
18708
|
-
import { distance as
|
|
18709
|
-
import { z as
|
|
18710
|
-
var routeHintPointProps =
|
|
18711
|
-
x:
|
|
18712
|
-
y:
|
|
18713
|
-
via:
|
|
18714
|
-
toLayer:
|
|
18730
|
+
import { distance as distance43, layer_ref as layer_ref13, route_hint_point as route_hint_point6 } from "circuit-json";
|
|
18731
|
+
import { z as z138 } from "zod";
|
|
18732
|
+
var routeHintPointProps = z138.object({
|
|
18733
|
+
x: distance43,
|
|
18734
|
+
y: distance43,
|
|
18735
|
+
via: z138.boolean().optional(),
|
|
18736
|
+
toLayer: layer_ref13.optional()
|
|
18715
18737
|
});
|
|
18716
|
-
var traceHintProps =
|
|
18717
|
-
for:
|
|
18738
|
+
var traceHintProps = z138.object({
|
|
18739
|
+
for: z138.string().optional().describe(
|
|
18718
18740
|
"Selector for the port you're targeting, not required if you're inside a trace"
|
|
18719
18741
|
),
|
|
18720
|
-
order:
|
|
18742
|
+
order: z138.number().optional(),
|
|
18721
18743
|
offset: route_hint_point6.or(routeHintPointProps).optional(),
|
|
18722
|
-
offsets:
|
|
18723
|
-
traceWidth:
|
|
18744
|
+
offsets: z138.array(route_hint_point6).or(z138.array(routeHintPointProps)).optional(),
|
|
18745
|
+
traceWidth: z138.number().optional()
|
|
18724
18746
|
});
|
|
18725
18747
|
|
|
18726
18748
|
// lib/components/port.ts
|
|
18727
|
-
import { z as
|
|
18749
|
+
import { z as z139 } from "zod";
|
|
18728
18750
|
var portProps = commonLayoutProps.extend({
|
|
18729
|
-
name:
|
|
18730
|
-
pinNumber:
|
|
18731
|
-
schStemLength:
|
|
18732
|
-
aliases:
|
|
18733
|
-
layer:
|
|
18734
|
-
layers:
|
|
18735
|
-
schX:
|
|
18736
|
-
schY:
|
|
18751
|
+
name: z139.string().optional(),
|
|
18752
|
+
pinNumber: z139.number().optional(),
|
|
18753
|
+
schStemLength: z139.number().optional(),
|
|
18754
|
+
aliases: z139.array(z139.string()).optional(),
|
|
18755
|
+
layer: z139.string().optional(),
|
|
18756
|
+
layers: z139.array(z139.string()).optional(),
|
|
18757
|
+
schX: z139.number().optional(),
|
|
18758
|
+
schY: z139.number().optional(),
|
|
18737
18759
|
direction: direction.optional(),
|
|
18738
|
-
connectsTo:
|
|
18760
|
+
connectsTo: z139.string().or(z139.array(z139.string())).optional(),
|
|
18739
18761
|
kicadPinMetadata: kicadPinMetadata.optional(),
|
|
18740
|
-
hasInversionCircle:
|
|
18762
|
+
hasInversionCircle: z139.boolean().optional()
|
|
18741
18763
|
});
|
|
18742
18764
|
|
|
18743
18765
|
// lib/components/pcb-note-text.ts
|
|
18744
18766
|
import { length as length11 } from "circuit-json";
|
|
18745
|
-
import { z as
|
|
18767
|
+
import { z as z140 } from "zod";
|
|
18746
18768
|
var pcbNoteTextProps = pcbLayoutProps.extend({
|
|
18747
|
-
text:
|
|
18748
|
-
anchorAlignment:
|
|
18749
|
-
font:
|
|
18769
|
+
text: z140.string(),
|
|
18770
|
+
anchorAlignment: z140.enum(["center", "top_left", "top_right", "bottom_left", "bottom_right"]).default("center"),
|
|
18771
|
+
font: z140.enum(["tscircuit2024"]).optional(),
|
|
18750
18772
|
fontSize: length11.optional(),
|
|
18751
|
-
color:
|
|
18773
|
+
color: z140.string().optional()
|
|
18752
18774
|
});
|
|
18753
18775
|
expectTypesMatch(true);
|
|
18754
18776
|
|
|
18755
18777
|
// lib/components/pcb-note-rect.ts
|
|
18756
|
-
import { distance as
|
|
18757
|
-
import { z as
|
|
18778
|
+
import { distance as distance44 } from "circuit-json";
|
|
18779
|
+
import { z as z141 } from "zod";
|
|
18758
18780
|
var pcbNoteRectProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
18759
|
-
width:
|
|
18760
|
-
height:
|
|
18761
|
-
strokeWidth:
|
|
18762
|
-
isFilled:
|
|
18763
|
-
hasStroke:
|
|
18764
|
-
isStrokeDashed:
|
|
18765
|
-
color:
|
|
18766
|
-
cornerRadius:
|
|
18781
|
+
width: distance44,
|
|
18782
|
+
height: distance44,
|
|
18783
|
+
strokeWidth: distance44.optional(),
|
|
18784
|
+
isFilled: z141.boolean().optional(),
|
|
18785
|
+
hasStroke: z141.boolean().optional(),
|
|
18786
|
+
isStrokeDashed: z141.boolean().optional(),
|
|
18787
|
+
color: z141.string().optional(),
|
|
18788
|
+
cornerRadius: distance44.optional()
|
|
18767
18789
|
});
|
|
18768
18790
|
expectTypesMatch(true);
|
|
18769
18791
|
|
|
@@ -18772,7 +18794,7 @@ import {
|
|
|
18772
18794
|
length as length12,
|
|
18773
18795
|
route_hint_point as route_hint_point7
|
|
18774
18796
|
} from "circuit-json";
|
|
18775
|
-
import { z as
|
|
18797
|
+
import { z as z142 } from "zod";
|
|
18776
18798
|
var pcbNotePathProps = pcbLayoutProps.omit({
|
|
18777
18799
|
pcbLeftEdgeX: true,
|
|
18778
18800
|
pcbRightEdgeX: true,
|
|
@@ -18784,15 +18806,15 @@ var pcbNotePathProps = pcbLayoutProps.omit({
|
|
|
18784
18806
|
pcbOffsetY: true,
|
|
18785
18807
|
pcbRotation: true
|
|
18786
18808
|
}).extend({
|
|
18787
|
-
route:
|
|
18809
|
+
route: z142.array(route_hint_point7),
|
|
18788
18810
|
strokeWidth: length12.optional(),
|
|
18789
|
-
color:
|
|
18811
|
+
color: z142.string().optional()
|
|
18790
18812
|
});
|
|
18791
18813
|
expectTypesMatch(true);
|
|
18792
18814
|
|
|
18793
18815
|
// lib/components/pcb-note-line.ts
|
|
18794
|
-
import { distance as
|
|
18795
|
-
import { z as
|
|
18816
|
+
import { distance as distance45 } from "circuit-json";
|
|
18817
|
+
import { z as z143 } from "zod";
|
|
18796
18818
|
var pcbNoteLineProps = pcbLayoutProps.omit({
|
|
18797
18819
|
pcbLeftEdgeX: true,
|
|
18798
18820
|
pcbRightEdgeX: true,
|
|
@@ -18804,20 +18826,20 @@ var pcbNoteLineProps = pcbLayoutProps.omit({
|
|
|
18804
18826
|
pcbOffsetY: true,
|
|
18805
18827
|
pcbRotation: true
|
|
18806
18828
|
}).extend({
|
|
18807
|
-
x1:
|
|
18808
|
-
y1:
|
|
18809
|
-
x2:
|
|
18810
|
-
y2:
|
|
18811
|
-
strokeWidth:
|
|
18812
|
-
color:
|
|
18813
|
-
isDashed:
|
|
18829
|
+
x1: distance45,
|
|
18830
|
+
y1: distance45,
|
|
18831
|
+
x2: distance45,
|
|
18832
|
+
y2: distance45,
|
|
18833
|
+
strokeWidth: distance45.optional(),
|
|
18834
|
+
color: z143.string().optional(),
|
|
18835
|
+
isDashed: z143.boolean().optional()
|
|
18814
18836
|
});
|
|
18815
18837
|
expectTypesMatch(true);
|
|
18816
18838
|
|
|
18817
18839
|
// lib/components/pcb-note-dimension.ts
|
|
18818
|
-
import { distance as
|
|
18819
|
-
import { z as
|
|
18820
|
-
var dimensionTarget2 =
|
|
18840
|
+
import { distance as distance46, length as length13 } from "circuit-json";
|
|
18841
|
+
import { z as z144 } from "zod";
|
|
18842
|
+
var dimensionTarget2 = z144.union([z144.string(), point]);
|
|
18821
18843
|
var pcbNoteDimensionProps = pcbLayoutProps.omit({
|
|
18822
18844
|
pcbLeftEdgeX: true,
|
|
18823
18845
|
pcbRightEdgeX: true,
|
|
@@ -18831,101 +18853,101 @@ var pcbNoteDimensionProps = pcbLayoutProps.omit({
|
|
|
18831
18853
|
}).extend({
|
|
18832
18854
|
from: dimensionTarget2,
|
|
18833
18855
|
to: dimensionTarget2,
|
|
18834
|
-
text:
|
|
18835
|
-
offset:
|
|
18836
|
-
font:
|
|
18856
|
+
text: z144.string().optional(),
|
|
18857
|
+
offset: distance46.optional(),
|
|
18858
|
+
font: z144.enum(["tscircuit2024"]).optional(),
|
|
18837
18859
|
fontSize: length13.optional(),
|
|
18838
|
-
color:
|
|
18839
|
-
arrowSize:
|
|
18840
|
-
units:
|
|
18841
|
-
outerEdgeToEdge:
|
|
18842
|
-
centerToCenter:
|
|
18843
|
-
innerEdgeToEdge:
|
|
18860
|
+
color: z144.string().optional(),
|
|
18861
|
+
arrowSize: distance46.optional(),
|
|
18862
|
+
units: z144.enum(["in", "mm"]).optional(),
|
|
18863
|
+
outerEdgeToEdge: z144.literal(true).optional(),
|
|
18864
|
+
centerToCenter: z144.literal(true).optional(),
|
|
18865
|
+
innerEdgeToEdge: z144.literal(true).optional()
|
|
18844
18866
|
});
|
|
18845
18867
|
expectTypesMatch(
|
|
18846
18868
|
true
|
|
18847
18869
|
);
|
|
18848
18870
|
|
|
18849
18871
|
// lib/platformConfig.ts
|
|
18850
|
-
import { z as
|
|
18851
|
-
var unvalidatedCircuitJson =
|
|
18852
|
-
var footprintLibraryResult =
|
|
18853
|
-
footprintCircuitJson:
|
|
18872
|
+
import { z as z145 } from "zod";
|
|
18873
|
+
var unvalidatedCircuitJson = z145.array(z145.any()).describe("Circuit JSON");
|
|
18874
|
+
var footprintLibraryResult = z145.object({
|
|
18875
|
+
footprintCircuitJson: z145.array(z145.any()),
|
|
18854
18876
|
cadModel: cadModelProp.optional()
|
|
18855
18877
|
});
|
|
18856
|
-
var pathToCircuitJsonFn =
|
|
18857
|
-
|
|
18858
|
-
|
|
18859
|
-
|
|
18860
|
-
).returns(
|
|
18878
|
+
var pathToCircuitJsonFn = z145.function().args(z145.string()).returns(z145.promise(footprintLibraryResult)).or(
|
|
18879
|
+
z145.function().args(
|
|
18880
|
+
z145.string(),
|
|
18881
|
+
z145.object({ resolvedPcbStyle: pcbStyle.optional() }).optional()
|
|
18882
|
+
).returns(z145.promise(footprintLibraryResult))
|
|
18861
18883
|
).describe("A function that takes a path and returns Circuit JSON");
|
|
18862
|
-
var footprintFileParserEntry =
|
|
18863
|
-
loadFromUrl:
|
|
18884
|
+
var footprintFileParserEntry = z145.object({
|
|
18885
|
+
loadFromUrl: z145.function().args(z145.string()).returns(z145.promise(footprintLibraryResult)).describe(
|
|
18864
18886
|
"A function that takes a footprint file URL and returns Circuit JSON"
|
|
18865
18887
|
)
|
|
18866
18888
|
});
|
|
18867
|
-
var spiceEngineSimulationResult =
|
|
18868
|
-
engineVersionString:
|
|
18889
|
+
var spiceEngineSimulationResult = z145.object({
|
|
18890
|
+
engineVersionString: z145.string().optional(),
|
|
18869
18891
|
simulationResultCircuitJson: unvalidatedCircuitJson
|
|
18870
18892
|
});
|
|
18871
|
-
var spiceEngineZod =
|
|
18872
|
-
simulate:
|
|
18893
|
+
var spiceEngineZod = z145.object({
|
|
18894
|
+
simulate: z145.function().args(z145.string()).returns(z145.promise(spiceEngineSimulationResult)).describe(
|
|
18873
18895
|
"A function that takes a SPICE string and returns a simulation result"
|
|
18874
18896
|
)
|
|
18875
18897
|
});
|
|
18876
|
-
var defaultSpiceEngine =
|
|
18898
|
+
var defaultSpiceEngine = z145.custom(
|
|
18877
18899
|
(value) => typeof value === "string"
|
|
18878
18900
|
);
|
|
18879
|
-
var autorouterInstance =
|
|
18880
|
-
run:
|
|
18881
|
-
getOutputSimpleRouteJson:
|
|
18901
|
+
var autorouterInstance = z145.object({
|
|
18902
|
+
run: z145.function().args().returns(z145.promise(z145.unknown())).describe("Run the autorouter"),
|
|
18903
|
+
getOutputSimpleRouteJson: z145.function().args().returns(z145.promise(z145.any())).describe("Get the resulting SimpleRouteJson")
|
|
18882
18904
|
});
|
|
18883
|
-
var autorouterDefinition =
|
|
18884
|
-
createAutorouter:
|
|
18905
|
+
var autorouterDefinition = z145.object({
|
|
18906
|
+
createAutorouter: z145.function().args(z145.any(), z145.any().optional()).returns(z145.union([autorouterInstance, z145.promise(autorouterInstance)])).describe("Create an autorouter instance")
|
|
18885
18907
|
});
|
|
18886
|
-
var platformFetch =
|
|
18887
|
-
var platformConfig =
|
|
18908
|
+
var platformFetch = z145.custom((value) => typeof value === "function").describe("A fetch-like function to use for platform requests");
|
|
18909
|
+
var platformConfig = z145.object({
|
|
18888
18910
|
partsEngine: partsEngine.optional(),
|
|
18889
18911
|
autorouter: autorouterProp.optional(),
|
|
18890
|
-
autorouterMap:
|
|
18912
|
+
autorouterMap: z145.record(z145.string(), autorouterDefinition).optional(),
|
|
18891
18913
|
registryApiUrl: url.optional(),
|
|
18892
18914
|
cloudAutorouterUrl: url.optional(),
|
|
18893
|
-
projectName:
|
|
18915
|
+
projectName: z145.string().optional(),
|
|
18894
18916
|
projectBaseUrl: url.optional(),
|
|
18895
|
-
version:
|
|
18917
|
+
version: z145.string().optional(),
|
|
18896
18918
|
url: url.optional(),
|
|
18897
|
-
printBoardInformationToSilkscreen:
|
|
18898
|
-
includeBoardFiles:
|
|
18919
|
+
printBoardInformationToSilkscreen: z145.boolean().optional(),
|
|
18920
|
+
includeBoardFiles: z145.array(z145.string()).describe(
|
|
18899
18921
|
'The board files to automatically build with "tsci build", defaults to ["**/*.circuit.tsx"]. Can be an array of files or globs'
|
|
18900
18922
|
).optional(),
|
|
18901
|
-
snapshotsDir:
|
|
18923
|
+
snapshotsDir: z145.string().describe(
|
|
18902
18924
|
'The directory where snapshots are stored for "tsci snapshot", defaults to "tests/__snapshots__"'
|
|
18903
18925
|
).optional(),
|
|
18904
18926
|
defaultSpiceEngine: defaultSpiceEngine.optional(),
|
|
18905
|
-
unitPreference:
|
|
18906
|
-
localCacheEngine:
|
|
18907
|
-
pcbDisabled:
|
|
18908
|
-
routingDisabled:
|
|
18909
|
-
schematicDisabled:
|
|
18910
|
-
partsEngineDisabled:
|
|
18911
|
-
drcChecksDisabled:
|
|
18912
|
-
netlistDrcChecksDisabled:
|
|
18913
|
-
routingDrcChecksDisabled:
|
|
18914
|
-
placementDrcChecksDisabled:
|
|
18915
|
-
pinSpecificationDrcChecksDisabled:
|
|
18916
|
-
spiceEngineMap:
|
|
18917
|
-
footprintLibraryMap:
|
|
18918
|
-
|
|
18919
|
-
|
|
18927
|
+
unitPreference: z145.enum(["mm", "in", "mil"]).optional(),
|
|
18928
|
+
localCacheEngine: z145.any().optional(),
|
|
18929
|
+
pcbDisabled: z145.boolean().optional(),
|
|
18930
|
+
routingDisabled: z145.boolean().optional(),
|
|
18931
|
+
schematicDisabled: z145.boolean().optional(),
|
|
18932
|
+
partsEngineDisabled: z145.boolean().optional(),
|
|
18933
|
+
drcChecksDisabled: z145.boolean().optional(),
|
|
18934
|
+
netlistDrcChecksDisabled: z145.boolean().optional(),
|
|
18935
|
+
routingDrcChecksDisabled: z145.boolean().optional(),
|
|
18936
|
+
placementDrcChecksDisabled: z145.boolean().optional(),
|
|
18937
|
+
pinSpecificationDrcChecksDisabled: z145.boolean().optional(),
|
|
18938
|
+
spiceEngineMap: z145.record(z145.string(), spiceEngineZod).optional(),
|
|
18939
|
+
footprintLibraryMap: z145.record(
|
|
18940
|
+
z145.string(),
|
|
18941
|
+
z145.union([
|
|
18920
18942
|
pathToCircuitJsonFn,
|
|
18921
|
-
|
|
18922
|
-
|
|
18923
|
-
|
|
18943
|
+
z145.record(
|
|
18944
|
+
z145.string(),
|
|
18945
|
+
z145.union([unvalidatedCircuitJson, pathToCircuitJsonFn])
|
|
18924
18946
|
)
|
|
18925
18947
|
])
|
|
18926
18948
|
).optional(),
|
|
18927
|
-
footprintFileParserMap:
|
|
18928
|
-
resolveProjectStaticFileImportUrl:
|
|
18949
|
+
footprintFileParserMap: z145.record(z145.string(), footprintFileParserEntry).optional(),
|
|
18950
|
+
resolveProjectStaticFileImportUrl: z145.function().args(z145.string()).returns(z145.promise(z145.string())).describe(
|
|
18929
18951
|
"A function that returns a string URL for static files for the project"
|
|
18930
18952
|
).optional(),
|
|
18931
18953
|
platformFetch: platformFetch.optional()
|
|
@@ -19044,6 +19066,7 @@ export {
|
|
|
19044
19066
|
fabricationNotePathProps,
|
|
19045
19067
|
fabricationNoteRectProps,
|
|
19046
19068
|
fabricationNoteTextProps,
|
|
19069
|
+
fanoutBoundaryPadding,
|
|
19047
19070
|
fiducialProps,
|
|
19048
19071
|
footprintInsertionDirection,
|
|
19049
19072
|
footprintProp,
|