@tscircuit/props 0.0.597 → 0.0.598
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 +11 -0
- package/dist/index.d.ts +109 -1
- package/dist/index.js +891 -871
- package/dist/index.js.map +1 -1
- 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,33 @@ expectTypesMatch(true);
|
|
|
17748
17766
|
expectTypesMatch(true);
|
|
17749
17767
|
|
|
17750
17768
|
// lib/components/autoroutingphase.ts
|
|
17751
|
-
import { z as
|
|
17752
|
-
var busFanoutDirection =
|
|
17769
|
+
import { z as z87 } from "zod";
|
|
17770
|
+
var busFanoutDirection = z87.union([
|
|
17753
17771
|
ninePointAnchor,
|
|
17754
|
-
|
|
17772
|
+
z87.object({ direction: ninePointAnchor })
|
|
17755
17773
|
]);
|
|
17756
|
-
var autoroutingPhaseProps =
|
|
17757
|
-
key:
|
|
17758
|
-
name:
|
|
17774
|
+
var autoroutingPhaseProps = z87.object({
|
|
17775
|
+
key: z87.any().optional(),
|
|
17776
|
+
name: z87.string().optional(),
|
|
17759
17777
|
autorouter: autorouterProp.optional(),
|
|
17760
|
-
phaseIndex:
|
|
17778
|
+
phaseIndex: z87.number().optional(),
|
|
17761
17779
|
...routingTolerances.shape,
|
|
17762
|
-
region:
|
|
17763
|
-
shape:
|
|
17764
|
-
minX:
|
|
17765
|
-
maxX:
|
|
17766
|
-
minY:
|
|
17767
|
-
maxY:
|
|
17780
|
+
region: z87.object({
|
|
17781
|
+
shape: z87.literal("rect").optional(),
|
|
17782
|
+
minX: z87.number(),
|
|
17783
|
+
maxX: z87.number(),
|
|
17784
|
+
minY: z87.number(),
|
|
17785
|
+
maxY: z87.number()
|
|
17768
17786
|
}).optional(),
|
|
17769
|
-
connection:
|
|
17770
|
-
connections:
|
|
17771
|
-
reroute:
|
|
17772
|
-
busFanoutDirections:
|
|
17787
|
+
connection: z87.string().optional(),
|
|
17788
|
+
connections: z87.array(z87.string()).optional(),
|
|
17789
|
+
reroute: z87.boolean().optional(),
|
|
17790
|
+
busFanoutDirections: z87.record(busFanoutDirection).optional(),
|
|
17791
|
+
fanoutBoundaryPadding: fanoutBoundaryPadding.optional()
|
|
17773
17792
|
}).superRefine((value, ctx) => {
|
|
17774
17793
|
if (value.reroute !== void 0 && value.region === void 0 && value.connection === void 0 && value.connections === void 0) {
|
|
17775
17794
|
ctx.addIssue({
|
|
17776
|
-
code:
|
|
17795
|
+
code: z87.ZodIssueCode.custom,
|
|
17777
17796
|
message: "region, connection, or connections is required when reroute is provided",
|
|
17778
17797
|
path: ["region"]
|
|
17779
17798
|
});
|
|
@@ -17782,15 +17801,15 @@ var autoroutingPhaseProps = z86.object({
|
|
|
17782
17801
|
expectTypesMatch(true);
|
|
17783
17802
|
|
|
17784
17803
|
// lib/components/spicemodel.ts
|
|
17785
|
-
import { z as
|
|
17786
|
-
var spicemodelProps =
|
|
17787
|
-
source:
|
|
17788
|
-
spicePinMapping:
|
|
17804
|
+
import { z as z88 } from "zod";
|
|
17805
|
+
var spicemodelProps = z88.object({
|
|
17806
|
+
source: z88.string(),
|
|
17807
|
+
spicePinMapping: z88.record(z88.string(), z88.string()).optional()
|
|
17789
17808
|
});
|
|
17790
17809
|
expectTypesMatch(true);
|
|
17791
17810
|
|
|
17792
17811
|
// lib/components/transistor.ts
|
|
17793
|
-
import { z as
|
|
17812
|
+
import { z as z89 } from "zod";
|
|
17794
17813
|
var transistorPinsLabels = [
|
|
17795
17814
|
"pin1",
|
|
17796
17815
|
"pin2",
|
|
@@ -17803,7 +17822,7 @@ var transistorPinsLabels = [
|
|
|
17803
17822
|
"drain"
|
|
17804
17823
|
];
|
|
17805
17824
|
var transistorProps = commonComponentProps.extend({
|
|
17806
|
-
type:
|
|
17825
|
+
type: z89.enum(["npn", "pnp", "bjt", "jfet", "mosfet", "igbt"]),
|
|
17807
17826
|
connections: createConnectionsProp(transistorPinsLabels).optional()
|
|
17808
17827
|
});
|
|
17809
17828
|
var transistorPins = [
|
|
@@ -17817,7 +17836,7 @@ var transistorPins = [
|
|
|
17817
17836
|
expectTypesMatch(true);
|
|
17818
17837
|
|
|
17819
17838
|
// lib/components/mosfet.ts
|
|
17820
|
-
import { z as
|
|
17839
|
+
import { z as z90 } from "zod";
|
|
17821
17840
|
var mosfetPins = [
|
|
17822
17841
|
"pin1",
|
|
17823
17842
|
"drain",
|
|
@@ -17827,11 +17846,11 @@ var mosfetPins = [
|
|
|
17827
17846
|
"gate"
|
|
17828
17847
|
];
|
|
17829
17848
|
var mosfetProps = commonComponentProps.extend({
|
|
17830
|
-
channelType:
|
|
17831
|
-
mosfetMode:
|
|
17832
|
-
symbolDrainSide:
|
|
17833
|
-
symbolSourceSide:
|
|
17834
|
-
symbolGateSide:
|
|
17849
|
+
channelType: z90.enum(["n", "p"]),
|
|
17850
|
+
mosfetMode: z90.enum(["enhancement", "depletion"]),
|
|
17851
|
+
symbolDrainSide: z90.enum(["left", "right", "top", "bottom"]).optional(),
|
|
17852
|
+
symbolSourceSide: z90.enum(["left", "right", "top", "bottom"]).optional(),
|
|
17853
|
+
symbolGateSide: z90.enum(["left", "right", "top", "bottom"]).optional(),
|
|
17835
17854
|
connections: createConnectionsProp(mosfetPins).optional()
|
|
17836
17855
|
});
|
|
17837
17856
|
expectTypesMatch(true);
|
|
@@ -17853,29 +17872,29 @@ expectTypesMatch(true);
|
|
|
17853
17872
|
|
|
17854
17873
|
// lib/components/inductor.ts
|
|
17855
17874
|
import { inductance as inductance2 } from "circuit-json";
|
|
17856
|
-
import { z as
|
|
17875
|
+
import { z as z92 } from "zod";
|
|
17857
17876
|
var inductorPins = lrPins;
|
|
17858
17877
|
var inductorProps = commonComponentProps.extend({
|
|
17859
17878
|
inductance: inductance2,
|
|
17860
|
-
maxCurrentRating:
|
|
17879
|
+
maxCurrentRating: z92.union([z92.string(), z92.number()]).optional(),
|
|
17861
17880
|
schOrientation: schematicOrientation.optional(),
|
|
17862
17881
|
connections: createConnectionsProp(inductorPins).optional()
|
|
17863
17882
|
});
|
|
17864
17883
|
expectTypesMatch(true);
|
|
17865
17884
|
|
|
17866
17885
|
// lib/components/internal-circuit.ts
|
|
17867
|
-
import { z as
|
|
17868
|
-
var internalCircuitProps =
|
|
17869
|
-
children:
|
|
17886
|
+
import { z as z93 } from "zod";
|
|
17887
|
+
var internalCircuitProps = z93.object({
|
|
17888
|
+
children: z93.custom().optional()
|
|
17870
17889
|
});
|
|
17871
17890
|
expectTypesMatch(
|
|
17872
17891
|
true
|
|
17873
17892
|
);
|
|
17874
17893
|
|
|
17875
17894
|
// lib/components/diode.ts
|
|
17876
|
-
import { z as
|
|
17895
|
+
import { z as z94 } from "zod";
|
|
17877
17896
|
var diodePins = lrPolarPins;
|
|
17878
|
-
var diodeConnectionKeys =
|
|
17897
|
+
var diodeConnectionKeys = z94.enum([
|
|
17879
17898
|
"anode",
|
|
17880
17899
|
"cathode",
|
|
17881
17900
|
"pin1",
|
|
@@ -17883,13 +17902,13 @@ var diodeConnectionKeys = z93.enum([
|
|
|
17883
17902
|
"pos",
|
|
17884
17903
|
"neg"
|
|
17885
17904
|
]);
|
|
17886
|
-
var connectionTarget3 =
|
|
17887
|
-
var connectionsProp2 =
|
|
17888
|
-
var diodePinLabelsProp =
|
|
17889
|
-
|
|
17890
|
-
schematicPinLabel.or(
|
|
17905
|
+
var connectionTarget3 = z94.string().or(z94.array(z94.string()).readonly()).or(z94.array(z94.string()));
|
|
17906
|
+
var connectionsProp2 = z94.record(diodeConnectionKeys, connectionTarget3);
|
|
17907
|
+
var diodePinLabelsProp = z94.record(
|
|
17908
|
+
z94.enum(diodePins),
|
|
17909
|
+
schematicPinLabel.or(z94.array(schematicPinLabel).readonly()).or(z94.array(schematicPinLabel))
|
|
17891
17910
|
);
|
|
17892
|
-
var diodeVariant =
|
|
17911
|
+
var diodeVariant = z94.enum([
|
|
17893
17912
|
"standard",
|
|
17894
17913
|
"schottky",
|
|
17895
17914
|
"zener",
|
|
@@ -17900,12 +17919,12 @@ var diodeVariant = z93.enum([
|
|
|
17900
17919
|
var diodeProps = commonComponentProps.extend({
|
|
17901
17920
|
connections: connectionsProp2.optional(),
|
|
17902
17921
|
variant: diodeVariant.optional().default("standard"),
|
|
17903
|
-
standard:
|
|
17904
|
-
schottky:
|
|
17905
|
-
zener:
|
|
17906
|
-
avalanche:
|
|
17907
|
-
photo:
|
|
17908
|
-
tvs:
|
|
17922
|
+
standard: z94.boolean().optional(),
|
|
17923
|
+
schottky: z94.boolean().optional(),
|
|
17924
|
+
zener: z94.boolean().optional(),
|
|
17925
|
+
avalanche: z94.boolean().optional(),
|
|
17926
|
+
photo: z94.boolean().optional(),
|
|
17927
|
+
tvs: z94.boolean().optional(),
|
|
17909
17928
|
schOrientation: schematicOrientation.optional(),
|
|
17910
17929
|
pinLabels: diodePinLabelsProp.optional()
|
|
17911
17930
|
}).superRefine((data, ctx) => {
|
|
@@ -17919,11 +17938,11 @@ var diodeProps = commonComponentProps.extend({
|
|
|
17919
17938
|
].filter(Boolean).length;
|
|
17920
17939
|
if (enabledFlags > 1) {
|
|
17921
17940
|
ctx.addIssue({
|
|
17922
|
-
code:
|
|
17941
|
+
code: z94.ZodIssueCode.custom,
|
|
17923
17942
|
message: "Exactly one diode variant must be enabled",
|
|
17924
17943
|
path: []
|
|
17925
17944
|
});
|
|
17926
|
-
return
|
|
17945
|
+
return z94.INVALID;
|
|
17927
17946
|
}
|
|
17928
17947
|
}).transform((data) => {
|
|
17929
17948
|
const result = {
|
|
@@ -17969,34 +17988,34 @@ var diodeProps = commonComponentProps.extend({
|
|
|
17969
17988
|
expectTypesMatch(true);
|
|
17970
17989
|
|
|
17971
17990
|
// lib/components/led.ts
|
|
17972
|
-
import { z as
|
|
17991
|
+
import { z as z95 } from "zod";
|
|
17973
17992
|
var ledProps = commonComponentProps.extend({
|
|
17974
|
-
color:
|
|
17975
|
-
wavelength:
|
|
17976
|
-
schDisplayValue:
|
|
17993
|
+
color: z95.string().optional(),
|
|
17994
|
+
wavelength: z95.string().optional(),
|
|
17995
|
+
schDisplayValue: z95.string().optional(),
|
|
17977
17996
|
schOrientation: schematicOrientation.optional(),
|
|
17978
17997
|
connections: createConnectionsProp(lrPolarPins).optional(),
|
|
17979
|
-
laser:
|
|
17998
|
+
laser: z95.boolean().optional()
|
|
17980
17999
|
});
|
|
17981
18000
|
var ledPins = lrPolarPins;
|
|
17982
18001
|
|
|
17983
18002
|
// lib/components/switch.ts
|
|
17984
18003
|
import { ms as ms3, frequency as frequency4 } from "circuit-json";
|
|
17985
|
-
import { z as
|
|
18004
|
+
import { z as z96 } from "zod";
|
|
17986
18005
|
var switchProps = commonComponentProps.extend({
|
|
17987
|
-
type:
|
|
17988
|
-
isNormallyClosed:
|
|
17989
|
-
spst:
|
|
17990
|
-
spdt:
|
|
17991
|
-
dpst:
|
|
17992
|
-
dpdt:
|
|
18006
|
+
type: z96.enum(["spst", "spdt", "dpst", "dpdt"]).optional(),
|
|
18007
|
+
isNormallyClosed: z96.boolean().optional().default(false),
|
|
18008
|
+
spst: z96.boolean().optional(),
|
|
18009
|
+
spdt: z96.boolean().optional(),
|
|
18010
|
+
dpst: z96.boolean().optional(),
|
|
18011
|
+
dpdt: z96.boolean().optional(),
|
|
17993
18012
|
pinLabels: pinLabelsProp.optional(),
|
|
17994
18013
|
simSwitchFrequency: frequency4.optional(),
|
|
17995
18014
|
simCloseAt: ms3.optional(),
|
|
17996
18015
|
simOpenAt: ms3.optional(),
|
|
17997
|
-
simStartClosed:
|
|
17998
|
-
simStartOpen:
|
|
17999
|
-
connections:
|
|
18016
|
+
simStartClosed: z96.boolean().optional(),
|
|
18017
|
+
simStartOpen: z96.boolean().optional(),
|
|
18018
|
+
connections: z96.custom().pipe(z96.record(z96.string(), connectionTarget)).optional()
|
|
18000
18019
|
}).transform((props) => {
|
|
18001
18020
|
const updatedProps = { ...props };
|
|
18002
18021
|
if (updatedProps.dpdt) {
|
|
@@ -18028,33 +18047,33 @@ expectTypesMatch(true);
|
|
|
18028
18047
|
|
|
18029
18048
|
// lib/components/fabrication-note-text.ts
|
|
18030
18049
|
import { length as length4 } from "circuit-json";
|
|
18031
|
-
import { z as
|
|
18050
|
+
import { z as z97 } from "zod";
|
|
18032
18051
|
var fabricationNoteTextProps = pcbLayoutProps.extend({
|
|
18033
|
-
text:
|
|
18034
|
-
anchorAlignment:
|
|
18035
|
-
font:
|
|
18052
|
+
text: z97.string(),
|
|
18053
|
+
anchorAlignment: z97.enum(["center", "top_left", "top_right", "bottom_left", "bottom_right"]).default("center"),
|
|
18054
|
+
font: z97.enum(["tscircuit2024"]).optional(),
|
|
18036
18055
|
fontSize: length4.optional(),
|
|
18037
|
-
color:
|
|
18056
|
+
color: z97.string().optional()
|
|
18038
18057
|
});
|
|
18039
18058
|
expectTypesMatch(true);
|
|
18040
18059
|
|
|
18041
18060
|
// lib/components/fabrication-note-rect.ts
|
|
18042
|
-
import { distance as
|
|
18043
|
-
import { z as
|
|
18061
|
+
import { distance as distance20 } from "circuit-json";
|
|
18062
|
+
import { z as z98 } from "zod";
|
|
18044
18063
|
var fabricationNoteRectProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
18045
|
-
width:
|
|
18046
|
-
height:
|
|
18047
|
-
strokeWidth:
|
|
18048
|
-
isFilled:
|
|
18049
|
-
hasStroke:
|
|
18050
|
-
isStrokeDashed:
|
|
18051
|
-
color:
|
|
18052
|
-
cornerRadius:
|
|
18064
|
+
width: distance20,
|
|
18065
|
+
height: distance20,
|
|
18066
|
+
strokeWidth: distance20.optional(),
|
|
18067
|
+
isFilled: z98.boolean().optional(),
|
|
18068
|
+
hasStroke: z98.boolean().optional(),
|
|
18069
|
+
isStrokeDashed: z98.boolean().optional(),
|
|
18070
|
+
color: z98.string().optional(),
|
|
18071
|
+
cornerRadius: distance20.optional()
|
|
18053
18072
|
});
|
|
18054
18073
|
|
|
18055
18074
|
// lib/components/fabrication-note-path.ts
|
|
18056
18075
|
import { length as length5, route_hint_point as route_hint_point3 } from "circuit-json";
|
|
18057
|
-
import { z as
|
|
18076
|
+
import { z as z99 } from "zod";
|
|
18058
18077
|
var fabricationNotePathProps = pcbLayoutProps.omit({
|
|
18059
18078
|
pcbLeftEdgeX: true,
|
|
18060
18079
|
pcbRightEdgeX: true,
|
|
@@ -18066,15 +18085,15 @@ var fabricationNotePathProps = pcbLayoutProps.omit({
|
|
|
18066
18085
|
pcbOffsetY: true,
|
|
18067
18086
|
pcbRotation: true
|
|
18068
18087
|
}).extend({
|
|
18069
|
-
route:
|
|
18088
|
+
route: z99.array(route_hint_point3),
|
|
18070
18089
|
strokeWidth: length5.optional(),
|
|
18071
|
-
color:
|
|
18090
|
+
color: z99.string().optional()
|
|
18072
18091
|
});
|
|
18073
18092
|
|
|
18074
18093
|
// lib/components/fabrication-note-dimension.ts
|
|
18075
|
-
import { distance as
|
|
18076
|
-
import { z as
|
|
18077
|
-
var dimensionTarget =
|
|
18094
|
+
import { distance as distance21, length as length6 } from "circuit-json";
|
|
18095
|
+
import { z as z100 } from "zod";
|
|
18096
|
+
var dimensionTarget = z100.union([z100.string(), point]);
|
|
18078
18097
|
var fabricationNoteDimensionProps = pcbLayoutProps.omit({
|
|
18079
18098
|
pcbLeftEdgeX: true,
|
|
18080
18099
|
pcbRightEdgeX: true,
|
|
@@ -18088,58 +18107,58 @@ var fabricationNoteDimensionProps = pcbLayoutProps.omit({
|
|
|
18088
18107
|
}).extend({
|
|
18089
18108
|
from: dimensionTarget,
|
|
18090
18109
|
to: dimensionTarget,
|
|
18091
|
-
text:
|
|
18092
|
-
offset:
|
|
18093
|
-
font:
|
|
18110
|
+
text: z100.string().optional(),
|
|
18111
|
+
offset: distance21.optional(),
|
|
18112
|
+
font: z100.enum(["tscircuit2024"]).optional(),
|
|
18094
18113
|
fontSize: length6.optional(),
|
|
18095
|
-
color:
|
|
18096
|
-
arrowSize:
|
|
18097
|
-
units:
|
|
18098
|
-
outerEdgeToEdge:
|
|
18099
|
-
centerToCenter:
|
|
18100
|
-
innerEdgeToEdge:
|
|
18114
|
+
color: z100.string().optional(),
|
|
18115
|
+
arrowSize: distance21.optional(),
|
|
18116
|
+
units: z100.enum(["in", "mm"]).optional(),
|
|
18117
|
+
outerEdgeToEdge: z100.literal(true).optional(),
|
|
18118
|
+
centerToCenter: z100.literal(true).optional(),
|
|
18119
|
+
innerEdgeToEdge: z100.literal(true).optional()
|
|
18101
18120
|
});
|
|
18102
18121
|
expectTypesMatch(true);
|
|
18103
18122
|
|
|
18104
18123
|
// lib/components/pcb-trace.ts
|
|
18105
|
-
import { distance as
|
|
18106
|
-
import { z as
|
|
18107
|
-
var pcbTraceProps =
|
|
18108
|
-
layer:
|
|
18109
|
-
thickness:
|
|
18110
|
-
route:
|
|
18124
|
+
import { distance as distance22, route_hint_point as route_hint_point4 } from "circuit-json";
|
|
18125
|
+
import { z as z101 } from "zod";
|
|
18126
|
+
var pcbTraceProps = z101.object({
|
|
18127
|
+
layer: z101.string().optional(),
|
|
18128
|
+
thickness: distance22.optional(),
|
|
18129
|
+
route: z101.array(route_hint_point4)
|
|
18111
18130
|
});
|
|
18112
18131
|
|
|
18113
18132
|
// lib/components/via.ts
|
|
18114
|
-
import { distance as
|
|
18115
|
-
import { z as
|
|
18133
|
+
import { distance as distance23, layer_ref as layer_ref6 } from "circuit-json";
|
|
18134
|
+
import { z as z102 } from "zod";
|
|
18116
18135
|
var viaProps = commonLayoutProps.extend({
|
|
18117
|
-
name:
|
|
18136
|
+
name: z102.string().optional(),
|
|
18118
18137
|
fromLayer: layer_ref6.optional(),
|
|
18119
18138
|
toLayer: layer_ref6.optional(),
|
|
18120
|
-
holeDiameter:
|
|
18121
|
-
outerDiameter:
|
|
18122
|
-
layers:
|
|
18123
|
-
connectsTo:
|
|
18124
|
-
netIsAssignable:
|
|
18139
|
+
holeDiameter: distance23.optional(),
|
|
18140
|
+
outerDiameter: distance23.optional(),
|
|
18141
|
+
layers: z102.array(layer_ref6).optional(),
|
|
18142
|
+
connectsTo: z102.string().or(z102.array(z102.string())).optional(),
|
|
18143
|
+
netIsAssignable: z102.boolean().optional()
|
|
18125
18144
|
});
|
|
18126
18145
|
expectTypesMatch(true);
|
|
18127
18146
|
|
|
18128
18147
|
// lib/components/testpoint.ts
|
|
18129
|
-
import { distance as
|
|
18130
|
-
import { z as
|
|
18148
|
+
import { distance as distance24 } from "circuit-json";
|
|
18149
|
+
import { z as z103 } from "zod";
|
|
18131
18150
|
var testpointPins = ["pin1"];
|
|
18132
|
-
var testpointConnectionsProp =
|
|
18151
|
+
var testpointConnectionsProp = z103.object({
|
|
18133
18152
|
pin1: connectionTarget
|
|
18134
18153
|
}).strict();
|
|
18135
18154
|
var testpointProps = commonComponentProps.extend({
|
|
18136
18155
|
connections: testpointConnectionsProp.optional(),
|
|
18137
|
-
footprintVariant:
|
|
18138
|
-
padShape:
|
|
18139
|
-
padDiameter:
|
|
18140
|
-
holeDiameter:
|
|
18141
|
-
width:
|
|
18142
|
-
height:
|
|
18156
|
+
footprintVariant: z103.enum(["pad", "through_hole"]).optional(),
|
|
18157
|
+
padShape: z103.enum(["rect", "circle"]).optional().default("circle"),
|
|
18158
|
+
padDiameter: distance24.optional(),
|
|
18159
|
+
holeDiameter: distance24.optional(),
|
|
18160
|
+
width: distance24.optional(),
|
|
18161
|
+
height: distance24.optional()
|
|
18143
18162
|
}).refine(
|
|
18144
18163
|
(props) => props.footprintVariant !== "through_hole" || props.holeDiameter !== void 0,
|
|
18145
18164
|
{ message: "holeDiameter is required for through_hole testpoints" }
|
|
@@ -18147,45 +18166,45 @@ var testpointProps = commonComponentProps.extend({
|
|
|
18147
18166
|
expectTypesMatch(true);
|
|
18148
18167
|
|
|
18149
18168
|
// lib/components/breakoutpoint.ts
|
|
18150
|
-
import { z as
|
|
18169
|
+
import { z as z104 } from "zod";
|
|
18151
18170
|
var breakoutPointProps = pcbLayoutProps.omit({ pcbRotation: true, layer: true }).extend({
|
|
18152
|
-
connection:
|
|
18171
|
+
connection: z104.string()
|
|
18153
18172
|
});
|
|
18154
18173
|
expectTypesMatch(true);
|
|
18155
18174
|
|
|
18156
18175
|
// lib/components/pcb-keepout.ts
|
|
18157
|
-
import { distance as
|
|
18158
|
-
import { z as
|
|
18159
|
-
var pcbKeepoutProps =
|
|
18176
|
+
import { distance as distance25, layer_ref as layer_ref7 } from "circuit-json";
|
|
18177
|
+
import { z as z105 } from "zod";
|
|
18178
|
+
var pcbKeepoutProps = z105.union([
|
|
18160
18179
|
pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
18161
|
-
shape:
|
|
18162
|
-
radius:
|
|
18163
|
-
layers:
|
|
18180
|
+
shape: z105.literal("circle"),
|
|
18181
|
+
radius: distance25,
|
|
18182
|
+
layers: z105.array(layer_ref7).optional()
|
|
18164
18183
|
}),
|
|
18165
18184
|
pcbLayoutProps.extend({
|
|
18166
|
-
shape:
|
|
18167
|
-
width:
|
|
18168
|
-
height:
|
|
18169
|
-
layers:
|
|
18185
|
+
shape: z105.literal("rect"),
|
|
18186
|
+
width: distance25,
|
|
18187
|
+
height: distance25,
|
|
18188
|
+
layers: z105.array(layer_ref7).optional()
|
|
18170
18189
|
})
|
|
18171
18190
|
]);
|
|
18172
18191
|
|
|
18173
18192
|
// lib/components/courtyard-rect.ts
|
|
18174
|
-
import { distance as
|
|
18175
|
-
import { z as
|
|
18193
|
+
import { distance as distance26 } from "circuit-json";
|
|
18194
|
+
import { z as z106 } from "zod";
|
|
18176
18195
|
var courtyardRectProps = pcbLayoutProps.extend({
|
|
18177
|
-
width:
|
|
18178
|
-
height:
|
|
18179
|
-
strokeWidth:
|
|
18180
|
-
isFilled:
|
|
18181
|
-
hasStroke:
|
|
18182
|
-
isStrokeDashed:
|
|
18183
|
-
color:
|
|
18196
|
+
width: distance26,
|
|
18197
|
+
height: distance26,
|
|
18198
|
+
strokeWidth: distance26.optional(),
|
|
18199
|
+
isFilled: z106.boolean().optional(),
|
|
18200
|
+
hasStroke: z106.boolean().optional(),
|
|
18201
|
+
isStrokeDashed: z106.boolean().optional(),
|
|
18202
|
+
color: z106.string().optional()
|
|
18184
18203
|
});
|
|
18185
18204
|
|
|
18186
18205
|
// lib/components/courtyard-outline.ts
|
|
18187
18206
|
import { length as length7 } from "circuit-json";
|
|
18188
|
-
import { z as
|
|
18207
|
+
import { z as z107 } from "zod";
|
|
18189
18208
|
var courtyardOutlineProps = pcbLayoutProps.omit({
|
|
18190
18209
|
pcbLeftEdgeX: true,
|
|
18191
18210
|
pcbRightEdgeX: true,
|
|
@@ -18197,59 +18216,59 @@ var courtyardOutlineProps = pcbLayoutProps.omit({
|
|
|
18197
18216
|
pcbOffsetY: true,
|
|
18198
18217
|
pcbRotation: true
|
|
18199
18218
|
}).extend({
|
|
18200
|
-
outline:
|
|
18219
|
+
outline: z107.array(point),
|
|
18201
18220
|
strokeWidth: length7.optional(),
|
|
18202
|
-
isClosed:
|
|
18203
|
-
isStrokeDashed:
|
|
18204
|
-
color:
|
|
18221
|
+
isClosed: z107.boolean().optional(),
|
|
18222
|
+
isStrokeDashed: z107.boolean().optional(),
|
|
18223
|
+
color: z107.string().optional()
|
|
18205
18224
|
});
|
|
18206
18225
|
|
|
18207
18226
|
// lib/components/courtyard-circle.ts
|
|
18208
|
-
import { distance as
|
|
18227
|
+
import { distance as distance27 } from "circuit-json";
|
|
18209
18228
|
import "zod";
|
|
18210
18229
|
var courtyardCircleProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
18211
|
-
radius:
|
|
18230
|
+
radius: distance27
|
|
18212
18231
|
});
|
|
18213
18232
|
|
|
18214
18233
|
// lib/components/courtyard-pill.ts
|
|
18215
|
-
import { distance as
|
|
18234
|
+
import { distance as distance28 } from "circuit-json";
|
|
18216
18235
|
import "zod";
|
|
18217
18236
|
var courtyardPillProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
18218
|
-
width:
|
|
18219
|
-
height:
|
|
18220
|
-
radius:
|
|
18237
|
+
width: distance28,
|
|
18238
|
+
height: distance28,
|
|
18239
|
+
radius: distance28
|
|
18221
18240
|
});
|
|
18222
18241
|
|
|
18223
18242
|
// lib/components/copper-pour.ts
|
|
18224
|
-
import { z as
|
|
18243
|
+
import { z as z110 } from "zod";
|
|
18225
18244
|
import { layer_ref as layer_ref8 } from "circuit-json";
|
|
18226
|
-
var copperPourProps =
|
|
18227
|
-
name:
|
|
18245
|
+
var copperPourProps = z110.object({
|
|
18246
|
+
name: z110.string().optional(),
|
|
18228
18247
|
layer: layer_ref8,
|
|
18229
|
-
connectsTo:
|
|
18230
|
-
unbroken:
|
|
18248
|
+
connectsTo: z110.string(),
|
|
18249
|
+
unbroken: z110.boolean().optional(),
|
|
18231
18250
|
padMargin: distance.optional(),
|
|
18232
18251
|
traceMargin: distance.optional(),
|
|
18233
18252
|
clearance: distance.optional(),
|
|
18234
18253
|
boardEdgeMargin: distance.optional(),
|
|
18235
18254
|
cutoutMargin: distance.optional(),
|
|
18236
|
-
outline:
|
|
18237
|
-
coveredWithSolderMask:
|
|
18255
|
+
outline: z110.array(point).optional(),
|
|
18256
|
+
coveredWithSolderMask: z110.boolean().optional().default(true)
|
|
18238
18257
|
});
|
|
18239
18258
|
expectTypesMatch(true);
|
|
18240
18259
|
|
|
18241
18260
|
// lib/components/cadassembly.ts
|
|
18242
18261
|
import { layer_ref as layer_ref9 } from "circuit-json";
|
|
18243
|
-
import { z as
|
|
18244
|
-
var cadassemblyProps =
|
|
18262
|
+
import { z as z111 } from "zod";
|
|
18263
|
+
var cadassemblyProps = z111.object({
|
|
18245
18264
|
originalLayer: layer_ref9.default("top").optional(),
|
|
18246
|
-
children:
|
|
18265
|
+
children: z111.any().optional()
|
|
18247
18266
|
});
|
|
18248
18267
|
expectTypesMatch(true);
|
|
18249
18268
|
|
|
18250
18269
|
// lib/components/cadmodel.ts
|
|
18251
|
-
import { z as
|
|
18252
|
-
var pcbPosition =
|
|
18270
|
+
import { z as z112 } from "zod";
|
|
18271
|
+
var pcbPosition = z112.object({
|
|
18253
18272
|
pcbX: pcbCoordinate.optional(),
|
|
18254
18273
|
pcbY: pcbCoordinate.optional(),
|
|
18255
18274
|
pcbLeftEdgeX: pcbCoordinate.optional(),
|
|
@@ -18266,7 +18285,7 @@ var cadModelBaseWithUrl = cadModelBase.extend({
|
|
|
18266
18285
|
});
|
|
18267
18286
|
var cadModelObject = cadModelBaseWithUrl.merge(pcbPosition);
|
|
18268
18287
|
expectTypesMatch(true);
|
|
18269
|
-
var cadmodelProps =
|
|
18288
|
+
var cadmodelProps = z112.union([z112.null(), url, cadModelObject]);
|
|
18270
18289
|
|
|
18271
18290
|
// lib/components/power-source.ts
|
|
18272
18291
|
import { voltage as voltage5 } from "circuit-json";
|
|
@@ -18276,9 +18295,9 @@ var powerSourceProps = commonComponentProps.extend({
|
|
|
18276
18295
|
|
|
18277
18296
|
// lib/components/voltagesource.ts
|
|
18278
18297
|
import { frequency as frequency5, ms as ms4, rotation as rotation5, voltage as voltage6 } from "circuit-json";
|
|
18279
|
-
import { z as
|
|
18298
|
+
import { z as z113 } from "zod";
|
|
18280
18299
|
var voltageSourcePinLabels = ["pin1", "pin2", "pos", "neg"];
|
|
18281
|
-
var percentage =
|
|
18300
|
+
var percentage = z113.union([z113.string(), z113.number()]).transform((val) => {
|
|
18282
18301
|
if (typeof val === "string") {
|
|
18283
18302
|
if (val.endsWith("%")) {
|
|
18284
18303
|
return parseFloat(val.slice(0, -1)) / 100;
|
|
@@ -18287,13 +18306,13 @@ var percentage = z112.union([z112.string(), z112.number()]).transform((val) => {
|
|
|
18287
18306
|
}
|
|
18288
18307
|
return val;
|
|
18289
18308
|
}).pipe(
|
|
18290
|
-
|
|
18309
|
+
z113.number().min(0, "Duty cycle must be non-negative").max(1, "Duty cycle cannot be greater than 100%")
|
|
18291
18310
|
);
|
|
18292
18311
|
var voltageSourceProps = commonComponentProps.extend({
|
|
18293
18312
|
voltage: voltage6.optional(),
|
|
18294
18313
|
frequency: frequency5.optional(),
|
|
18295
18314
|
peakToPeakVoltage: voltage6.optional(),
|
|
18296
|
-
waveShape:
|
|
18315
|
+
waveShape: z113.enum(["sinewave", "square", "triangle", "sawtooth"]).optional(),
|
|
18297
18316
|
phase: rotation5.optional(),
|
|
18298
18317
|
dutyCycle: percentage.optional(),
|
|
18299
18318
|
pulseDelay: ms4.optional(),
|
|
@@ -18310,9 +18329,9 @@ expectTypesMatch(true);
|
|
|
18310
18329
|
|
|
18311
18330
|
// lib/components/currentsource.ts
|
|
18312
18331
|
import { frequency as frequency6, rotation as rotation6, current as current3 } from "circuit-json";
|
|
18313
|
-
import { z as
|
|
18332
|
+
import { z as z114 } from "zod";
|
|
18314
18333
|
var currentSourcePinLabels = ["pin1", "pin2", "pos", "neg"];
|
|
18315
|
-
var percentage2 =
|
|
18334
|
+
var percentage2 = z114.union([z114.string(), z114.number()]).transform((val) => {
|
|
18316
18335
|
if (typeof val === "string") {
|
|
18317
18336
|
if (val.endsWith("%")) {
|
|
18318
18337
|
return parseFloat(val.slice(0, -1)) / 100;
|
|
@@ -18321,13 +18340,13 @@ var percentage2 = z113.union([z113.string(), z113.number()]).transform((val) =>
|
|
|
18321
18340
|
}
|
|
18322
18341
|
return val;
|
|
18323
18342
|
}).pipe(
|
|
18324
|
-
|
|
18343
|
+
z114.number().min(0, "Duty cycle must be non-negative").max(1, "Duty cycle cannot be greater than 100%")
|
|
18325
18344
|
);
|
|
18326
18345
|
var currentSourceProps = commonComponentProps.extend({
|
|
18327
18346
|
current: current3.optional(),
|
|
18328
18347
|
frequency: frequency6.optional(),
|
|
18329
18348
|
peakToPeakCurrent: current3.optional(),
|
|
18330
|
-
waveShape:
|
|
18349
|
+
waveShape: z114.enum(["sinewave", "square", "triangle", "sawtooth"]).optional(),
|
|
18331
18350
|
phase: rotation6.optional(),
|
|
18332
18351
|
dutyCycle: percentage2.optional(),
|
|
18333
18352
|
acMagnitude: current3.optional(),
|
|
@@ -18338,21 +18357,21 @@ var currentSourcePins = lrPolarPins;
|
|
|
18338
18357
|
expectTypesMatch(true);
|
|
18339
18358
|
|
|
18340
18359
|
// lib/components/voltageprobe.ts
|
|
18341
|
-
import { z as
|
|
18360
|
+
import { z as z115 } from "zod";
|
|
18342
18361
|
var voltageProbeProps = commonComponentProps.omit({ name: true }).extend({
|
|
18343
|
-
name:
|
|
18344
|
-
connectsTo:
|
|
18345
|
-
referenceTo:
|
|
18346
|
-
color:
|
|
18347
|
-
graphDisplayName:
|
|
18348
|
-
graphCenter:
|
|
18349
|
-
graphVerticalOffset:
|
|
18350
|
-
graphVoltagePerDiv:
|
|
18362
|
+
name: z115.string().optional(),
|
|
18363
|
+
connectsTo: z115.string(),
|
|
18364
|
+
referenceTo: z115.string().optional(),
|
|
18365
|
+
color: z115.string().optional(),
|
|
18366
|
+
graphDisplayName: z115.string().optional(),
|
|
18367
|
+
graphCenter: z115.number().optional(),
|
|
18368
|
+
graphVerticalOffset: z115.number().or(z115.string()).optional(),
|
|
18369
|
+
graphVoltagePerDiv: z115.number().or(z115.string()).optional()
|
|
18351
18370
|
});
|
|
18352
18371
|
expectTypesMatch(true);
|
|
18353
18372
|
|
|
18354
18373
|
// lib/components/ammeter.ts
|
|
18355
|
-
import { z as
|
|
18374
|
+
import { z as z116 } from "zod";
|
|
18356
18375
|
var ammeterPinLabels = ["pin1", "pin2", "pos", "neg"];
|
|
18357
18376
|
var hasAmmeterConnectionPair = (connections) => {
|
|
18358
18377
|
return connections.pos !== void 0 && connections.neg !== void 0 || connections.pin1 !== void 0 && connections.pin2 !== void 0;
|
|
@@ -18362,63 +18381,63 @@ var ammeterProps = commonComponentProps.extend({
|
|
|
18362
18381
|
hasAmmeterConnectionPair,
|
|
18363
18382
|
"Ammeter connections must include either pos/neg or pin1/pin2"
|
|
18364
18383
|
),
|
|
18365
|
-
color:
|
|
18366
|
-
graphDisplayName:
|
|
18367
|
-
graphCenter:
|
|
18368
|
-
graphVerticalOffset:
|
|
18369
|
-
graphCurrentPerDiv:
|
|
18384
|
+
color: z116.string().optional(),
|
|
18385
|
+
graphDisplayName: z116.string().optional(),
|
|
18386
|
+
graphCenter: z116.number().optional(),
|
|
18387
|
+
graphVerticalOffset: z116.number().or(z116.string()).optional(),
|
|
18388
|
+
graphCurrentPerDiv: z116.number().or(z116.string()).optional()
|
|
18370
18389
|
});
|
|
18371
18390
|
var ammeterPins = ammeterPinLabels;
|
|
18372
18391
|
expectTypesMatch(true);
|
|
18373
18392
|
|
|
18374
18393
|
// lib/components/schematic-arc.ts
|
|
18375
|
-
import { distance as
|
|
18376
|
-
import { z as
|
|
18377
|
-
var schematicArcProps =
|
|
18394
|
+
import { distance as distance29, point as point5, rotation as rotation7 } from "circuit-json";
|
|
18395
|
+
import { z as z117 } from "zod";
|
|
18396
|
+
var schematicArcProps = z117.object({
|
|
18378
18397
|
center: point5,
|
|
18379
|
-
radius:
|
|
18398
|
+
radius: distance29,
|
|
18380
18399
|
startAngleDegrees: rotation7,
|
|
18381
18400
|
endAngleDegrees: rotation7,
|
|
18382
|
-
direction:
|
|
18383
|
-
strokeWidth:
|
|
18384
|
-
color:
|
|
18385
|
-
isDashed:
|
|
18401
|
+
direction: z117.enum(["clockwise", "counterclockwise"]).default("counterclockwise"),
|
|
18402
|
+
strokeWidth: distance29.optional(),
|
|
18403
|
+
color: z117.string().optional(),
|
|
18404
|
+
isDashed: z117.boolean().optional().default(false)
|
|
18386
18405
|
});
|
|
18387
18406
|
expectTypesMatch(true);
|
|
18388
18407
|
|
|
18389
18408
|
// lib/components/toolingrail.ts
|
|
18390
|
-
import { z as
|
|
18391
|
-
var toolingrailProps =
|
|
18392
|
-
children:
|
|
18409
|
+
import { z as z118 } from "zod";
|
|
18410
|
+
var toolingrailProps = z118.object({
|
|
18411
|
+
children: z118.any().optional()
|
|
18393
18412
|
});
|
|
18394
18413
|
expectTypesMatch(true);
|
|
18395
18414
|
|
|
18396
18415
|
// lib/components/schematic-box.ts
|
|
18397
|
-
import { distance as
|
|
18398
|
-
import { z as
|
|
18399
|
-
var schematicBoxProps =
|
|
18400
|
-
name:
|
|
18401
|
-
chipRef:
|
|
18416
|
+
import { distance as distance30 } from "circuit-json";
|
|
18417
|
+
import { z as z119 } from "zod";
|
|
18418
|
+
var schematicBoxProps = z119.object({
|
|
18419
|
+
name: z119.string().optional(),
|
|
18420
|
+
chipRef: z119.string().optional(),
|
|
18402
18421
|
pinLabels: pinLabelsProp.optional(),
|
|
18403
18422
|
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:
|
|
18423
|
+
schX: distance30.optional(),
|
|
18424
|
+
schY: distance30.optional(),
|
|
18425
|
+
schSectionName: z119.string().optional(),
|
|
18426
|
+
schSheetName: z119.string().optional(),
|
|
18427
|
+
width: distance30.optional(),
|
|
18428
|
+
height: distance30.optional(),
|
|
18429
|
+
overlay: z119.array(z119.string()).optional(),
|
|
18430
|
+
padding: distance30.optional(),
|
|
18431
|
+
paddingLeft: distance30.optional(),
|
|
18432
|
+
paddingRight: distance30.optional(),
|
|
18433
|
+
paddingTop: distance30.optional(),
|
|
18434
|
+
paddingBottom: distance30.optional(),
|
|
18435
|
+
title: z119.string().optional(),
|
|
18417
18436
|
titleAlignment: ninePointAnchor.default("top_left"),
|
|
18418
|
-
titleColor:
|
|
18419
|
-
titleFontSize:
|
|
18420
|
-
titleInside:
|
|
18421
|
-
strokeStyle:
|
|
18437
|
+
titleColor: z119.string().optional(),
|
|
18438
|
+
titleFontSize: distance30.optional(),
|
|
18439
|
+
titleInside: z119.boolean().default(false),
|
|
18440
|
+
strokeStyle: z119.enum(["solid", "dashed"]).default("solid")
|
|
18422
18441
|
}).refine(
|
|
18423
18442
|
(elm) => elm.width !== void 0 && elm.height !== void 0 || Array.isArray(elm.overlay) && elm.overlay.length > 0,
|
|
18424
18443
|
{
|
|
@@ -18434,82 +18453,82 @@ expectTypesMatch(true);
|
|
|
18434
18453
|
|
|
18435
18454
|
// lib/components/schematic-symbol.ts
|
|
18436
18455
|
import { rotation as rotation8 } from "circuit-json";
|
|
18437
|
-
import { z as
|
|
18438
|
-
var schematicSymbolConnections =
|
|
18456
|
+
import { z as z120 } from "zod";
|
|
18457
|
+
var schematicSymbolConnections = z120.custom().pipe(z120.record(z120.string(), connectionTarget)).refine((value) => Object.keys(value).length > 0, {
|
|
18439
18458
|
message: "connections must map at least one schematic symbol port"
|
|
18440
18459
|
});
|
|
18441
|
-
var schematicSymbolProps =
|
|
18442
|
-
name:
|
|
18443
|
-
displayName:
|
|
18444
|
-
chipRef:
|
|
18445
|
-
symbolName:
|
|
18460
|
+
var schematicSymbolProps = z120.object({
|
|
18461
|
+
name: z120.string().min(1),
|
|
18462
|
+
displayName: z120.string().optional(),
|
|
18463
|
+
chipRef: z120.string().min(1).optional(),
|
|
18464
|
+
symbolName: z120.string().min(1),
|
|
18446
18465
|
connections: schematicSymbolConnections.optional(),
|
|
18447
18466
|
schX: distance.optional(),
|
|
18448
18467
|
schY: distance.optional(),
|
|
18449
18468
|
schRotation: rotation8.optional(),
|
|
18450
|
-
schSectionName:
|
|
18451
|
-
schSheetName:
|
|
18469
|
+
schSectionName: z120.string().optional(),
|
|
18470
|
+
schSheetName: z120.string().optional()
|
|
18452
18471
|
});
|
|
18453
18472
|
expectTypesMatch(
|
|
18454
18473
|
true
|
|
18455
18474
|
);
|
|
18456
18475
|
|
|
18457
18476
|
// lib/components/schematic-circle.ts
|
|
18458
|
-
import { distance as
|
|
18459
|
-
import { z as
|
|
18460
|
-
var schematicCircleProps =
|
|
18477
|
+
import { distance as distance31, point as point6 } from "circuit-json";
|
|
18478
|
+
import { z as z121 } from "zod";
|
|
18479
|
+
var schematicCircleProps = z121.object({
|
|
18461
18480
|
center: point6,
|
|
18462
|
-
radius:
|
|
18463
|
-
strokeWidth:
|
|
18464
|
-
color:
|
|
18465
|
-
isFilled:
|
|
18466
|
-
fillColor:
|
|
18467
|
-
isDashed:
|
|
18481
|
+
radius: distance31,
|
|
18482
|
+
strokeWidth: distance31.optional(),
|
|
18483
|
+
color: z121.string().optional(),
|
|
18484
|
+
isFilled: z121.boolean().optional().default(false),
|
|
18485
|
+
fillColor: z121.string().optional(),
|
|
18486
|
+
isDashed: z121.boolean().optional().default(false)
|
|
18468
18487
|
});
|
|
18469
18488
|
expectTypesMatch(
|
|
18470
18489
|
true
|
|
18471
18490
|
);
|
|
18472
18491
|
|
|
18473
18492
|
// lib/components/schematic-rect.ts
|
|
18474
|
-
import { distance as
|
|
18475
|
-
import { z as
|
|
18476
|
-
var schematicRectProps =
|
|
18477
|
-
schX:
|
|
18478
|
-
schY:
|
|
18479
|
-
width:
|
|
18480
|
-
height:
|
|
18493
|
+
import { distance as distance32, rotation as rotation9 } from "circuit-json";
|
|
18494
|
+
import { z as z122 } from "zod";
|
|
18495
|
+
var schematicRectProps = z122.object({
|
|
18496
|
+
schX: distance32.optional(),
|
|
18497
|
+
schY: distance32.optional(),
|
|
18498
|
+
width: distance32,
|
|
18499
|
+
height: distance32,
|
|
18481
18500
|
rotation: rotation9.default(0),
|
|
18482
|
-
strokeWidth:
|
|
18483
|
-
color:
|
|
18484
|
-
isFilled:
|
|
18485
|
-
fillColor:
|
|
18486
|
-
isDashed:
|
|
18501
|
+
strokeWidth: distance32.optional(),
|
|
18502
|
+
color: z122.string().optional(),
|
|
18503
|
+
isFilled: z122.boolean().optional().default(false),
|
|
18504
|
+
fillColor: z122.string().optional(),
|
|
18505
|
+
isDashed: z122.boolean().optional().default(false)
|
|
18487
18506
|
});
|
|
18488
18507
|
expectTypesMatch(true);
|
|
18489
18508
|
|
|
18490
18509
|
// 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:
|
|
18510
|
+
import { distance as distance33 } from "circuit-json";
|
|
18511
|
+
import { z as z123 } from "zod";
|
|
18512
|
+
var schematicLineProps = z123.object({
|
|
18513
|
+
x1: distance33,
|
|
18514
|
+
y1: distance33,
|
|
18515
|
+
x2: distance33,
|
|
18516
|
+
y2: distance33,
|
|
18517
|
+
strokeWidth: distance33.optional(),
|
|
18518
|
+
color: z123.string().optional(),
|
|
18519
|
+
isDashed: z123.boolean().optional().default(false),
|
|
18520
|
+
dashLength: distance33.optional(),
|
|
18521
|
+
dashGap: distance33.optional()
|
|
18503
18522
|
});
|
|
18504
18523
|
expectTypesMatch(true);
|
|
18505
18524
|
|
|
18506
18525
|
// lib/components/schematic-text.ts
|
|
18507
|
-
import { distance as
|
|
18508
|
-
import { z as
|
|
18526
|
+
import { distance as distance34, rotation as rotation10 } from "circuit-json";
|
|
18527
|
+
import { z as z125 } from "zod";
|
|
18509
18528
|
|
|
18510
18529
|
// lib/common/fivePointAnchor.ts
|
|
18511
|
-
import { z as
|
|
18512
|
-
var fivePointAnchor =
|
|
18530
|
+
import { z as z124 } from "zod";
|
|
18531
|
+
var fivePointAnchor = z124.enum([
|
|
18513
18532
|
"center",
|
|
18514
18533
|
"left",
|
|
18515
18534
|
"right",
|
|
@@ -18518,128 +18537,128 @@ var fivePointAnchor = z123.enum([
|
|
|
18518
18537
|
]);
|
|
18519
18538
|
|
|
18520
18539
|
// lib/components/schematic-text.ts
|
|
18521
|
-
var schematicTextProps =
|
|
18522
|
-
schX:
|
|
18523
|
-
schY:
|
|
18524
|
-
text:
|
|
18525
|
-
fontSize:
|
|
18526
|
-
anchor:
|
|
18527
|
-
color:
|
|
18540
|
+
var schematicTextProps = z125.object({
|
|
18541
|
+
schX: distance34.optional(),
|
|
18542
|
+
schY: distance34.optional(),
|
|
18543
|
+
text: z125.string(),
|
|
18544
|
+
fontSize: z125.number().default(1),
|
|
18545
|
+
anchor: z125.union([fivePointAnchor.describe("legacy"), ninePointAnchor]).default("center"),
|
|
18546
|
+
color: z125.string().default("#000000"),
|
|
18528
18547
|
schRotation: rotation10.default(0)
|
|
18529
18548
|
});
|
|
18530
18549
|
expectTypesMatch(true);
|
|
18531
18550
|
|
|
18532
18551
|
// 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:
|
|
18552
|
+
import { distance as distance35, point as point7 } from "circuit-json";
|
|
18553
|
+
import { z as z126 } from "zod";
|
|
18554
|
+
var schematicPathProps = z126.object({
|
|
18555
|
+
points: z126.array(point7).optional(),
|
|
18556
|
+
svgPath: z126.string().optional(),
|
|
18557
|
+
strokeWidth: distance35.optional(),
|
|
18558
|
+
strokeColor: z126.string().optional(),
|
|
18559
|
+
dashLength: distance35.optional(),
|
|
18560
|
+
dashGap: distance35.optional(),
|
|
18561
|
+
isFilled: z126.boolean().optional().default(false),
|
|
18562
|
+
fillColor: z126.string().optional()
|
|
18544
18563
|
});
|
|
18545
18564
|
expectTypesMatch(true);
|
|
18546
18565
|
|
|
18547
18566
|
// 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:
|
|
18567
|
+
import { distance as distance36 } from "circuit-json";
|
|
18568
|
+
import { z as z127 } from "zod";
|
|
18569
|
+
var schematicTableProps = z127.object({
|
|
18570
|
+
schX: distance36.optional(),
|
|
18571
|
+
schY: distance36.optional(),
|
|
18572
|
+
children: z127.any().optional(),
|
|
18573
|
+
cellPadding: distance36.optional(),
|
|
18574
|
+
borderWidth: distance36.optional(),
|
|
18556
18575
|
anchor: ninePointAnchor.optional(),
|
|
18557
|
-
fontSize:
|
|
18576
|
+
fontSize: distance36.optional()
|
|
18558
18577
|
});
|
|
18559
18578
|
expectTypesMatch(true);
|
|
18560
18579
|
|
|
18561
18580
|
// lib/components/schematic-row.ts
|
|
18562
|
-
import { distance as
|
|
18563
|
-
import { z as
|
|
18564
|
-
var schematicRowProps =
|
|
18565
|
-
children:
|
|
18566
|
-
height:
|
|
18581
|
+
import { distance as distance37 } from "circuit-json";
|
|
18582
|
+
import { z as z128 } from "zod";
|
|
18583
|
+
var schematicRowProps = z128.object({
|
|
18584
|
+
children: z128.any().optional(),
|
|
18585
|
+
height: distance37.optional()
|
|
18567
18586
|
});
|
|
18568
18587
|
expectTypesMatch(true);
|
|
18569
18588
|
|
|
18570
18589
|
// 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:
|
|
18590
|
+
import { distance as distance38 } from "circuit-json";
|
|
18591
|
+
import { z as z129 } from "zod";
|
|
18592
|
+
var schematicCellProps = z129.object({
|
|
18593
|
+
children: z129.string().optional(),
|
|
18594
|
+
horizontalAlign: z129.enum(["left", "center", "right"]).optional(),
|
|
18595
|
+
verticalAlign: z129.enum(["top", "middle", "bottom"]).optional(),
|
|
18596
|
+
fontSize: distance38.optional(),
|
|
18597
|
+
rowSpan: z129.number().optional(),
|
|
18598
|
+
colSpan: z129.number().optional(),
|
|
18599
|
+
width: distance38.optional(),
|
|
18600
|
+
text: z129.string().optional()
|
|
18582
18601
|
});
|
|
18583
18602
|
expectTypesMatch(true);
|
|
18584
18603
|
|
|
18585
18604
|
// lib/components/schematic-section.ts
|
|
18586
|
-
import { distance as
|
|
18587
|
-
import { z as
|
|
18588
|
-
var schematicSectionProps =
|
|
18589
|
-
displayName:
|
|
18590
|
-
name:
|
|
18591
|
-
sectionTitleFontSize:
|
|
18605
|
+
import { distance as distance39 } from "circuit-json";
|
|
18606
|
+
import { z as z130 } from "zod";
|
|
18607
|
+
var schematicSectionProps = z130.object({
|
|
18608
|
+
displayName: z130.string().optional(),
|
|
18609
|
+
name: z130.string(),
|
|
18610
|
+
sectionTitleFontSize: distance39.optional()
|
|
18592
18611
|
});
|
|
18593
18612
|
expectTypesMatch(
|
|
18594
18613
|
true
|
|
18595
18614
|
);
|
|
18596
18615
|
|
|
18597
18616
|
// lib/components/schematic-sheet.ts
|
|
18598
|
-
import { z as
|
|
18599
|
-
var schematicSheetProps =
|
|
18600
|
-
name:
|
|
18601
|
-
displayName:
|
|
18602
|
-
sheetIndex:
|
|
18603
|
-
children:
|
|
18617
|
+
import { z as z131 } from "zod";
|
|
18618
|
+
var schematicSheetProps = z131.object({
|
|
18619
|
+
name: z131.string(),
|
|
18620
|
+
displayName: z131.string(),
|
|
18621
|
+
sheetIndex: z131.number().optional(),
|
|
18622
|
+
children: z131.any().optional()
|
|
18604
18623
|
});
|
|
18605
18624
|
expectTypesMatch(true);
|
|
18606
18625
|
|
|
18607
18626
|
// lib/components/copper-text.ts
|
|
18608
18627
|
import { layer_ref as layer_ref10, length as length8 } from "circuit-json";
|
|
18609
|
-
import { z as
|
|
18628
|
+
import { z as z132 } from "zod";
|
|
18610
18629
|
var copperTextProps = pcbLayoutProps.extend({
|
|
18611
|
-
text:
|
|
18630
|
+
text: z132.string(),
|
|
18612
18631
|
anchorAlignment: ninePointAnchor.default("center"),
|
|
18613
|
-
font:
|
|
18632
|
+
font: z132.enum(["tscircuit2024"]).optional(),
|
|
18614
18633
|
fontSize: length8.optional(),
|
|
18615
|
-
layers:
|
|
18616
|
-
knockout:
|
|
18617
|
-
mirrored:
|
|
18634
|
+
layers: z132.array(layer_ref10).optional(),
|
|
18635
|
+
knockout: z132.boolean().optional(),
|
|
18636
|
+
mirrored: z132.boolean().optional()
|
|
18618
18637
|
});
|
|
18619
18638
|
|
|
18620
18639
|
// lib/components/silkscreen-text.ts
|
|
18621
18640
|
import { layer_ref as layer_ref11, length as length9 } from "circuit-json";
|
|
18622
|
-
import { z as
|
|
18641
|
+
import { z as z133 } from "zod";
|
|
18623
18642
|
var silkscreenTextProps = pcbLayoutProps.extend({
|
|
18624
|
-
text:
|
|
18643
|
+
text: z133.string(),
|
|
18625
18644
|
anchorAlignment: ninePointAnchor.default("center"),
|
|
18626
|
-
font:
|
|
18645
|
+
font: z133.enum(["tscircuit2024"]).optional(),
|
|
18627
18646
|
fontSize: length9.optional(),
|
|
18628
18647
|
/**
|
|
18629
18648
|
* If true, text will knock out underlying silkscreen
|
|
18630
18649
|
*/
|
|
18631
|
-
isKnockout:
|
|
18650
|
+
isKnockout: z133.boolean().optional(),
|
|
18632
18651
|
knockoutPadding: length9.optional(),
|
|
18633
18652
|
knockoutPaddingLeft: length9.optional(),
|
|
18634
18653
|
knockoutPaddingRight: length9.optional(),
|
|
18635
18654
|
knockoutPaddingTop: length9.optional(),
|
|
18636
18655
|
knockoutPaddingBottom: length9.optional(),
|
|
18637
|
-
layers:
|
|
18656
|
+
layers: z133.array(layer_ref11).optional()
|
|
18638
18657
|
});
|
|
18639
18658
|
|
|
18640
18659
|
// lib/components/silkscreen-path.ts
|
|
18641
18660
|
import { length as length10, route_hint_point as route_hint_point5 } from "circuit-json";
|
|
18642
|
-
import { z as
|
|
18661
|
+
import { z as z134 } from "zod";
|
|
18643
18662
|
var silkscreenPathProps = pcbLayoutProps.omit({
|
|
18644
18663
|
pcbLeftEdgeX: true,
|
|
18645
18664
|
pcbRightEdgeX: true,
|
|
@@ -18651,12 +18670,12 @@ var silkscreenPathProps = pcbLayoutProps.omit({
|
|
|
18651
18670
|
pcbOffsetY: true,
|
|
18652
18671
|
pcbRotation: true
|
|
18653
18672
|
}).extend({
|
|
18654
|
-
route:
|
|
18673
|
+
route: z134.array(route_hint_point5),
|
|
18655
18674
|
strokeWidth: length10.optional()
|
|
18656
18675
|
});
|
|
18657
18676
|
|
|
18658
18677
|
// lib/components/silkscreen-line.ts
|
|
18659
|
-
import { distance as
|
|
18678
|
+
import { distance as distance40 } from "circuit-json";
|
|
18660
18679
|
var silkscreenLineProps = pcbLayoutProps.omit({
|
|
18661
18680
|
pcbX: true,
|
|
18662
18681
|
pcbY: true,
|
|
@@ -18664,33 +18683,33 @@ var silkscreenLineProps = pcbLayoutProps.omit({
|
|
|
18664
18683
|
pcbOffsetY: true,
|
|
18665
18684
|
pcbRotation: true
|
|
18666
18685
|
}).extend({
|
|
18667
|
-
strokeWidth:
|
|
18668
|
-
x1:
|
|
18669
|
-
y1:
|
|
18670
|
-
x2:
|
|
18671
|
-
y2:
|
|
18686
|
+
strokeWidth: distance40,
|
|
18687
|
+
x1: distance40,
|
|
18688
|
+
y1: distance40,
|
|
18689
|
+
x2: distance40,
|
|
18690
|
+
y2: distance40
|
|
18672
18691
|
});
|
|
18673
18692
|
|
|
18674
18693
|
// lib/components/silkscreen-rect.ts
|
|
18675
|
-
import { distance as
|
|
18676
|
-
import { z as
|
|
18694
|
+
import { distance as distance41 } from "circuit-json";
|
|
18695
|
+
import { z as z135 } from "zod";
|
|
18677
18696
|
var silkscreenRectProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
18678
|
-
filled:
|
|
18679
|
-
stroke:
|
|
18680
|
-
strokeWidth:
|
|
18681
|
-
width:
|
|
18682
|
-
height:
|
|
18683
|
-
cornerRadius:
|
|
18697
|
+
filled: z135.boolean().default(true).optional(),
|
|
18698
|
+
stroke: z135.enum(["dashed", "solid", "none"]).optional(),
|
|
18699
|
+
strokeWidth: distance41.optional(),
|
|
18700
|
+
width: distance41,
|
|
18701
|
+
height: distance41,
|
|
18702
|
+
cornerRadius: distance41.optional()
|
|
18684
18703
|
});
|
|
18685
18704
|
|
|
18686
18705
|
// lib/components/silkscreen-circle.ts
|
|
18687
|
-
import { distance as
|
|
18688
|
-
import { z as
|
|
18706
|
+
import { distance as distance42 } from "circuit-json";
|
|
18707
|
+
import { z as z136 } from "zod";
|
|
18689
18708
|
var silkscreenCircleProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
18690
|
-
isFilled:
|
|
18691
|
-
isOutline:
|
|
18692
|
-
strokeWidth:
|
|
18693
|
-
radius:
|
|
18709
|
+
isFilled: z136.boolean().optional(),
|
|
18710
|
+
isOutline: z136.boolean().optional(),
|
|
18711
|
+
strokeWidth: distance42.optional(),
|
|
18712
|
+
radius: distance42
|
|
18694
18713
|
});
|
|
18695
18714
|
|
|
18696
18715
|
// lib/components/silkscreen-graphic.ts
|
|
@@ -18705,65 +18724,65 @@ var silkscreenGraphicProps = pcbLayoutProps.omit({ layer: true, pcbStyle: true,
|
|
|
18705
18724
|
expectTypesMatch(true);
|
|
18706
18725
|
|
|
18707
18726
|
// lib/components/trace-hint.ts
|
|
18708
|
-
import { distance as
|
|
18709
|
-
import { z as
|
|
18710
|
-
var routeHintPointProps =
|
|
18711
|
-
x:
|
|
18712
|
-
y:
|
|
18713
|
-
via:
|
|
18727
|
+
import { distance as distance43, layer_ref as layer_ref12, route_hint_point as route_hint_point6 } from "circuit-json";
|
|
18728
|
+
import { z as z138 } from "zod";
|
|
18729
|
+
var routeHintPointProps = z138.object({
|
|
18730
|
+
x: distance43,
|
|
18731
|
+
y: distance43,
|
|
18732
|
+
via: z138.boolean().optional(),
|
|
18714
18733
|
toLayer: layer_ref12.optional()
|
|
18715
18734
|
});
|
|
18716
|
-
var traceHintProps =
|
|
18717
|
-
for:
|
|
18735
|
+
var traceHintProps = z138.object({
|
|
18736
|
+
for: z138.string().optional().describe(
|
|
18718
18737
|
"Selector for the port you're targeting, not required if you're inside a trace"
|
|
18719
18738
|
),
|
|
18720
|
-
order:
|
|
18739
|
+
order: z138.number().optional(),
|
|
18721
18740
|
offset: route_hint_point6.or(routeHintPointProps).optional(),
|
|
18722
|
-
offsets:
|
|
18723
|
-
traceWidth:
|
|
18741
|
+
offsets: z138.array(route_hint_point6).or(z138.array(routeHintPointProps)).optional(),
|
|
18742
|
+
traceWidth: z138.number().optional()
|
|
18724
18743
|
});
|
|
18725
18744
|
|
|
18726
18745
|
// lib/components/port.ts
|
|
18727
|
-
import { z as
|
|
18746
|
+
import { z as z139 } from "zod";
|
|
18728
18747
|
var portProps = commonLayoutProps.extend({
|
|
18729
|
-
name:
|
|
18730
|
-
pinNumber:
|
|
18731
|
-
schStemLength:
|
|
18732
|
-
aliases:
|
|
18733
|
-
layer:
|
|
18734
|
-
layers:
|
|
18735
|
-
schX:
|
|
18736
|
-
schY:
|
|
18748
|
+
name: z139.string().optional(),
|
|
18749
|
+
pinNumber: z139.number().optional(),
|
|
18750
|
+
schStemLength: z139.number().optional(),
|
|
18751
|
+
aliases: z139.array(z139.string()).optional(),
|
|
18752
|
+
layer: z139.string().optional(),
|
|
18753
|
+
layers: z139.array(z139.string()).optional(),
|
|
18754
|
+
schX: z139.number().optional(),
|
|
18755
|
+
schY: z139.number().optional(),
|
|
18737
18756
|
direction: direction.optional(),
|
|
18738
|
-
connectsTo:
|
|
18757
|
+
connectsTo: z139.string().or(z139.array(z139.string())).optional(),
|
|
18739
18758
|
kicadPinMetadata: kicadPinMetadata.optional(),
|
|
18740
|
-
hasInversionCircle:
|
|
18759
|
+
hasInversionCircle: z139.boolean().optional()
|
|
18741
18760
|
});
|
|
18742
18761
|
|
|
18743
18762
|
// lib/components/pcb-note-text.ts
|
|
18744
18763
|
import { length as length11 } from "circuit-json";
|
|
18745
|
-
import { z as
|
|
18764
|
+
import { z as z140 } from "zod";
|
|
18746
18765
|
var pcbNoteTextProps = pcbLayoutProps.extend({
|
|
18747
|
-
text:
|
|
18748
|
-
anchorAlignment:
|
|
18749
|
-
font:
|
|
18766
|
+
text: z140.string(),
|
|
18767
|
+
anchorAlignment: z140.enum(["center", "top_left", "top_right", "bottom_left", "bottom_right"]).default("center"),
|
|
18768
|
+
font: z140.enum(["tscircuit2024"]).optional(),
|
|
18750
18769
|
fontSize: length11.optional(),
|
|
18751
|
-
color:
|
|
18770
|
+
color: z140.string().optional()
|
|
18752
18771
|
});
|
|
18753
18772
|
expectTypesMatch(true);
|
|
18754
18773
|
|
|
18755
18774
|
// lib/components/pcb-note-rect.ts
|
|
18756
|
-
import { distance as
|
|
18757
|
-
import { z as
|
|
18775
|
+
import { distance as distance44 } from "circuit-json";
|
|
18776
|
+
import { z as z141 } from "zod";
|
|
18758
18777
|
var pcbNoteRectProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
18759
|
-
width:
|
|
18760
|
-
height:
|
|
18761
|
-
strokeWidth:
|
|
18762
|
-
isFilled:
|
|
18763
|
-
hasStroke:
|
|
18764
|
-
isStrokeDashed:
|
|
18765
|
-
color:
|
|
18766
|
-
cornerRadius:
|
|
18778
|
+
width: distance44,
|
|
18779
|
+
height: distance44,
|
|
18780
|
+
strokeWidth: distance44.optional(),
|
|
18781
|
+
isFilled: z141.boolean().optional(),
|
|
18782
|
+
hasStroke: z141.boolean().optional(),
|
|
18783
|
+
isStrokeDashed: z141.boolean().optional(),
|
|
18784
|
+
color: z141.string().optional(),
|
|
18785
|
+
cornerRadius: distance44.optional()
|
|
18767
18786
|
});
|
|
18768
18787
|
expectTypesMatch(true);
|
|
18769
18788
|
|
|
@@ -18772,7 +18791,7 @@ import {
|
|
|
18772
18791
|
length as length12,
|
|
18773
18792
|
route_hint_point as route_hint_point7
|
|
18774
18793
|
} from "circuit-json";
|
|
18775
|
-
import { z as
|
|
18794
|
+
import { z as z142 } from "zod";
|
|
18776
18795
|
var pcbNotePathProps = pcbLayoutProps.omit({
|
|
18777
18796
|
pcbLeftEdgeX: true,
|
|
18778
18797
|
pcbRightEdgeX: true,
|
|
@@ -18784,15 +18803,15 @@ var pcbNotePathProps = pcbLayoutProps.omit({
|
|
|
18784
18803
|
pcbOffsetY: true,
|
|
18785
18804
|
pcbRotation: true
|
|
18786
18805
|
}).extend({
|
|
18787
|
-
route:
|
|
18806
|
+
route: z142.array(route_hint_point7),
|
|
18788
18807
|
strokeWidth: length12.optional(),
|
|
18789
|
-
color:
|
|
18808
|
+
color: z142.string().optional()
|
|
18790
18809
|
});
|
|
18791
18810
|
expectTypesMatch(true);
|
|
18792
18811
|
|
|
18793
18812
|
// lib/components/pcb-note-line.ts
|
|
18794
|
-
import { distance as
|
|
18795
|
-
import { z as
|
|
18813
|
+
import { distance as distance45 } from "circuit-json";
|
|
18814
|
+
import { z as z143 } from "zod";
|
|
18796
18815
|
var pcbNoteLineProps = pcbLayoutProps.omit({
|
|
18797
18816
|
pcbLeftEdgeX: true,
|
|
18798
18817
|
pcbRightEdgeX: true,
|
|
@@ -18804,20 +18823,20 @@ var pcbNoteLineProps = pcbLayoutProps.omit({
|
|
|
18804
18823
|
pcbOffsetY: true,
|
|
18805
18824
|
pcbRotation: true
|
|
18806
18825
|
}).extend({
|
|
18807
|
-
x1:
|
|
18808
|
-
y1:
|
|
18809
|
-
x2:
|
|
18810
|
-
y2:
|
|
18811
|
-
strokeWidth:
|
|
18812
|
-
color:
|
|
18813
|
-
isDashed:
|
|
18826
|
+
x1: distance45,
|
|
18827
|
+
y1: distance45,
|
|
18828
|
+
x2: distance45,
|
|
18829
|
+
y2: distance45,
|
|
18830
|
+
strokeWidth: distance45.optional(),
|
|
18831
|
+
color: z143.string().optional(),
|
|
18832
|
+
isDashed: z143.boolean().optional()
|
|
18814
18833
|
});
|
|
18815
18834
|
expectTypesMatch(true);
|
|
18816
18835
|
|
|
18817
18836
|
// lib/components/pcb-note-dimension.ts
|
|
18818
|
-
import { distance as
|
|
18819
|
-
import { z as
|
|
18820
|
-
var dimensionTarget2 =
|
|
18837
|
+
import { distance as distance46, length as length13 } from "circuit-json";
|
|
18838
|
+
import { z as z144 } from "zod";
|
|
18839
|
+
var dimensionTarget2 = z144.union([z144.string(), point]);
|
|
18821
18840
|
var pcbNoteDimensionProps = pcbLayoutProps.omit({
|
|
18822
18841
|
pcbLeftEdgeX: true,
|
|
18823
18842
|
pcbRightEdgeX: true,
|
|
@@ -18831,101 +18850,101 @@ var pcbNoteDimensionProps = pcbLayoutProps.omit({
|
|
|
18831
18850
|
}).extend({
|
|
18832
18851
|
from: dimensionTarget2,
|
|
18833
18852
|
to: dimensionTarget2,
|
|
18834
|
-
text:
|
|
18835
|
-
offset:
|
|
18836
|
-
font:
|
|
18853
|
+
text: z144.string().optional(),
|
|
18854
|
+
offset: distance46.optional(),
|
|
18855
|
+
font: z144.enum(["tscircuit2024"]).optional(),
|
|
18837
18856
|
fontSize: length13.optional(),
|
|
18838
|
-
color:
|
|
18839
|
-
arrowSize:
|
|
18840
|
-
units:
|
|
18841
|
-
outerEdgeToEdge:
|
|
18842
|
-
centerToCenter:
|
|
18843
|
-
innerEdgeToEdge:
|
|
18857
|
+
color: z144.string().optional(),
|
|
18858
|
+
arrowSize: distance46.optional(),
|
|
18859
|
+
units: z144.enum(["in", "mm"]).optional(),
|
|
18860
|
+
outerEdgeToEdge: z144.literal(true).optional(),
|
|
18861
|
+
centerToCenter: z144.literal(true).optional(),
|
|
18862
|
+
innerEdgeToEdge: z144.literal(true).optional()
|
|
18844
18863
|
});
|
|
18845
18864
|
expectTypesMatch(
|
|
18846
18865
|
true
|
|
18847
18866
|
);
|
|
18848
18867
|
|
|
18849
18868
|
// lib/platformConfig.ts
|
|
18850
|
-
import { z as
|
|
18851
|
-
var unvalidatedCircuitJson =
|
|
18852
|
-
var footprintLibraryResult =
|
|
18853
|
-
footprintCircuitJson:
|
|
18869
|
+
import { z as z145 } from "zod";
|
|
18870
|
+
var unvalidatedCircuitJson = z145.array(z145.any()).describe("Circuit JSON");
|
|
18871
|
+
var footprintLibraryResult = z145.object({
|
|
18872
|
+
footprintCircuitJson: z145.array(z145.any()),
|
|
18854
18873
|
cadModel: cadModelProp.optional()
|
|
18855
18874
|
});
|
|
18856
|
-
var pathToCircuitJsonFn =
|
|
18857
|
-
|
|
18858
|
-
|
|
18859
|
-
|
|
18860
|
-
).returns(
|
|
18875
|
+
var pathToCircuitJsonFn = z145.function().args(z145.string()).returns(z145.promise(footprintLibraryResult)).or(
|
|
18876
|
+
z145.function().args(
|
|
18877
|
+
z145.string(),
|
|
18878
|
+
z145.object({ resolvedPcbStyle: pcbStyle.optional() }).optional()
|
|
18879
|
+
).returns(z145.promise(footprintLibraryResult))
|
|
18861
18880
|
).describe("A function that takes a path and returns Circuit JSON");
|
|
18862
|
-
var footprintFileParserEntry =
|
|
18863
|
-
loadFromUrl:
|
|
18881
|
+
var footprintFileParserEntry = z145.object({
|
|
18882
|
+
loadFromUrl: z145.function().args(z145.string()).returns(z145.promise(footprintLibraryResult)).describe(
|
|
18864
18883
|
"A function that takes a footprint file URL and returns Circuit JSON"
|
|
18865
18884
|
)
|
|
18866
18885
|
});
|
|
18867
|
-
var spiceEngineSimulationResult =
|
|
18868
|
-
engineVersionString:
|
|
18886
|
+
var spiceEngineSimulationResult = z145.object({
|
|
18887
|
+
engineVersionString: z145.string().optional(),
|
|
18869
18888
|
simulationResultCircuitJson: unvalidatedCircuitJson
|
|
18870
18889
|
});
|
|
18871
|
-
var spiceEngineZod =
|
|
18872
|
-
simulate:
|
|
18890
|
+
var spiceEngineZod = z145.object({
|
|
18891
|
+
simulate: z145.function().args(z145.string()).returns(z145.promise(spiceEngineSimulationResult)).describe(
|
|
18873
18892
|
"A function that takes a SPICE string and returns a simulation result"
|
|
18874
18893
|
)
|
|
18875
18894
|
});
|
|
18876
|
-
var defaultSpiceEngine =
|
|
18895
|
+
var defaultSpiceEngine = z145.custom(
|
|
18877
18896
|
(value) => typeof value === "string"
|
|
18878
18897
|
);
|
|
18879
|
-
var autorouterInstance =
|
|
18880
|
-
run:
|
|
18881
|
-
getOutputSimpleRouteJson:
|
|
18898
|
+
var autorouterInstance = z145.object({
|
|
18899
|
+
run: z145.function().args().returns(z145.promise(z145.unknown())).describe("Run the autorouter"),
|
|
18900
|
+
getOutputSimpleRouteJson: z145.function().args().returns(z145.promise(z145.any())).describe("Get the resulting SimpleRouteJson")
|
|
18882
18901
|
});
|
|
18883
|
-
var autorouterDefinition =
|
|
18884
|
-
createAutorouter:
|
|
18902
|
+
var autorouterDefinition = z145.object({
|
|
18903
|
+
createAutorouter: z145.function().args(z145.any(), z145.any().optional()).returns(z145.union([autorouterInstance, z145.promise(autorouterInstance)])).describe("Create an autorouter instance")
|
|
18885
18904
|
});
|
|
18886
|
-
var platformFetch =
|
|
18887
|
-
var platformConfig =
|
|
18905
|
+
var platformFetch = z145.custom((value) => typeof value === "function").describe("A fetch-like function to use for platform requests");
|
|
18906
|
+
var platformConfig = z145.object({
|
|
18888
18907
|
partsEngine: partsEngine.optional(),
|
|
18889
18908
|
autorouter: autorouterProp.optional(),
|
|
18890
|
-
autorouterMap:
|
|
18909
|
+
autorouterMap: z145.record(z145.string(), autorouterDefinition).optional(),
|
|
18891
18910
|
registryApiUrl: url.optional(),
|
|
18892
18911
|
cloudAutorouterUrl: url.optional(),
|
|
18893
|
-
projectName:
|
|
18912
|
+
projectName: z145.string().optional(),
|
|
18894
18913
|
projectBaseUrl: url.optional(),
|
|
18895
|
-
version:
|
|
18914
|
+
version: z145.string().optional(),
|
|
18896
18915
|
url: url.optional(),
|
|
18897
|
-
printBoardInformationToSilkscreen:
|
|
18898
|
-
includeBoardFiles:
|
|
18916
|
+
printBoardInformationToSilkscreen: z145.boolean().optional(),
|
|
18917
|
+
includeBoardFiles: z145.array(z145.string()).describe(
|
|
18899
18918
|
'The board files to automatically build with "tsci build", defaults to ["**/*.circuit.tsx"]. Can be an array of files or globs'
|
|
18900
18919
|
).optional(),
|
|
18901
|
-
snapshotsDir:
|
|
18920
|
+
snapshotsDir: z145.string().describe(
|
|
18902
18921
|
'The directory where snapshots are stored for "tsci snapshot", defaults to "tests/__snapshots__"'
|
|
18903
18922
|
).optional(),
|
|
18904
18923
|
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
|
-
|
|
18924
|
+
unitPreference: z145.enum(["mm", "in", "mil"]).optional(),
|
|
18925
|
+
localCacheEngine: z145.any().optional(),
|
|
18926
|
+
pcbDisabled: z145.boolean().optional(),
|
|
18927
|
+
routingDisabled: z145.boolean().optional(),
|
|
18928
|
+
schematicDisabled: z145.boolean().optional(),
|
|
18929
|
+
partsEngineDisabled: z145.boolean().optional(),
|
|
18930
|
+
drcChecksDisabled: z145.boolean().optional(),
|
|
18931
|
+
netlistDrcChecksDisabled: z145.boolean().optional(),
|
|
18932
|
+
routingDrcChecksDisabled: z145.boolean().optional(),
|
|
18933
|
+
placementDrcChecksDisabled: z145.boolean().optional(),
|
|
18934
|
+
pinSpecificationDrcChecksDisabled: z145.boolean().optional(),
|
|
18935
|
+
spiceEngineMap: z145.record(z145.string(), spiceEngineZod).optional(),
|
|
18936
|
+
footprintLibraryMap: z145.record(
|
|
18937
|
+
z145.string(),
|
|
18938
|
+
z145.union([
|
|
18920
18939
|
pathToCircuitJsonFn,
|
|
18921
|
-
|
|
18922
|
-
|
|
18923
|
-
|
|
18940
|
+
z145.record(
|
|
18941
|
+
z145.string(),
|
|
18942
|
+
z145.union([unvalidatedCircuitJson, pathToCircuitJsonFn])
|
|
18924
18943
|
)
|
|
18925
18944
|
])
|
|
18926
18945
|
).optional(),
|
|
18927
|
-
footprintFileParserMap:
|
|
18928
|
-
resolveProjectStaticFileImportUrl:
|
|
18946
|
+
footprintFileParserMap: z145.record(z145.string(), footprintFileParserEntry).optional(),
|
|
18947
|
+
resolveProjectStaticFileImportUrl: z145.function().args(z145.string()).returns(z145.promise(z145.string())).describe(
|
|
18929
18948
|
"A function that returns a string URL for static files for the project"
|
|
18930
18949
|
).optional(),
|
|
18931
18950
|
platformFetch: platformFetch.optional()
|
|
@@ -19044,6 +19063,7 @@ export {
|
|
|
19044
19063
|
fabricationNotePathProps,
|
|
19045
19064
|
fabricationNoteRectProps,
|
|
19046
19065
|
fabricationNoteTextProps,
|
|
19066
|
+
fanoutBoundaryPadding,
|
|
19047
19067
|
fiducialProps,
|
|
19048
19068
|
footprintInsertionDirection,
|
|
19049
19069
|
footprintProp,
|