@tscircuit/props 0.0.665 → 0.0.667
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 +31 -0
- package/dist/index.d.ts +452 -2
- package/dist/index.js +849 -789
- package/dist/index.js.map +1 -1
- package/lib/components/group.ts +11 -0
- package/lib/components/pcb-bend.ts +42 -0
- package/lib/components/pcb-stiffener.ts +48 -0
- package/lib/index.ts +2 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -16446,6 +16446,9 @@ var routingTolerances = z44.object({
|
|
|
16446
16446
|
minViaEdgeToPadEdgeClearance: length3.optional(),
|
|
16447
16447
|
minPlatedHoleDrillEdgeToDrillEdgeClearance: length3.optional(),
|
|
16448
16448
|
minTraceToPadEdgeClearance: length3.optional(),
|
|
16449
|
+
minTraceToHoleEdgeClearance: length3.refine((value) => Number.isFinite(value) && value >= 0, {
|
|
16450
|
+
message: "minTraceToHoleEdgeClearance must be finite and non-negative"
|
|
16451
|
+
}).optional(),
|
|
16449
16452
|
minPadEdgeToPadEdgeClearance: length3.optional(),
|
|
16450
16453
|
minBoardEdgeClearance: length3.optional(),
|
|
16451
16454
|
minViaHoleDiameter: length3.optional(),
|
|
@@ -16784,8 +16787,63 @@ var boardProps = subcircuitGroupProps.omit({ connections: true }).extend({
|
|
|
16784
16787
|
expectTypesMatch(true);
|
|
16785
16788
|
expectTypesMatch(true);
|
|
16786
16789
|
|
|
16787
|
-
// lib/components/
|
|
16790
|
+
// lib/components/pcb-bend.ts
|
|
16791
|
+
import { rotation as rotation3 } from "circuit-json";
|
|
16788
16792
|
import { z as z46 } from "zod";
|
|
16793
|
+
var finiteDistance = distance.pipe(z46.number().finite());
|
|
16794
|
+
var pcbBendProps = z46.object({
|
|
16795
|
+
name: z46.string().optional(),
|
|
16796
|
+
x1: finiteDistance,
|
|
16797
|
+
y1: finiteDistance,
|
|
16798
|
+
x2: finiteDistance,
|
|
16799
|
+
y2: finiteDistance,
|
|
16800
|
+
bendAngle: rotation3.pipe(z46.number().finite()),
|
|
16801
|
+
bendRadius: distance.pipe(z46.number().finite().positive()),
|
|
16802
|
+
bendSide: z46.enum(["left", "right"])
|
|
16803
|
+
}).refine(({ x1, y1, x2, y2 }) => x1 !== x2 || y1 !== y2, {
|
|
16804
|
+
message: "Bend centerline endpoints must be distinct",
|
|
16805
|
+
path: ["x2"]
|
|
16806
|
+
});
|
|
16807
|
+
expectTypesMatch(true);
|
|
16808
|
+
|
|
16809
|
+
// lib/components/pcb-stiffener.ts
|
|
16810
|
+
import { z as z47 } from "zod";
|
|
16811
|
+
var positiveDistance2 = distance.pipe(z47.number().finite().positive());
|
|
16812
|
+
var finiteDistance2 = distance.pipe(z47.number().finite());
|
|
16813
|
+
var stiffenerBaseProps = pcbLayoutProps.omit({ layer: true }).extend({
|
|
16814
|
+
name: z47.string().optional(),
|
|
16815
|
+
/** Board attachment face, not a copper-layer assignment. Required. */
|
|
16816
|
+
layer: z47.enum(["top", "bottom"]),
|
|
16817
|
+
material: z47.enum(["fr4", "polyimide", "stainless_steel", "aluminum"]),
|
|
16818
|
+
/** Stiffener material thickness only, excluding PCB and adhesive. */
|
|
16819
|
+
thickness: positiveDistance2,
|
|
16820
|
+
/** Nonnegative adhesive thickness; omission means unspecified, not zero. */
|
|
16821
|
+
adhesiveThickness: distance.pipe(z47.number().finite().nonnegative()).optional()
|
|
16822
|
+
});
|
|
16823
|
+
var pcbStiffenerProps = z47.discriminatedUnion("shape", [
|
|
16824
|
+
stiffenerBaseProps.extend({
|
|
16825
|
+
shape: z47.literal("rect"),
|
|
16826
|
+
width: positiveDistance2,
|
|
16827
|
+
height: positiveDistance2,
|
|
16828
|
+
outline: z47.never().optional()
|
|
16829
|
+
}),
|
|
16830
|
+
stiffenerBaseProps.extend({
|
|
16831
|
+
shape: z47.literal("polygon"),
|
|
16832
|
+
/** Local vertices transformed by pcbX/pcbY/pcbRotation; implicitly closed. */
|
|
16833
|
+
outline: z47.array(z47.object({ x: finiteDistance2, y: finiteDistance2 })).min(3).refine((points) => {
|
|
16834
|
+
const twiceArea = points.reduce((sum, p, i) => {
|
|
16835
|
+
const next = points[(i + 1) % points.length];
|
|
16836
|
+
return sum + p.x * next.y - next.x * p.y;
|
|
16837
|
+
}, 0);
|
|
16838
|
+
return Number.isFinite(twiceArea) && twiceArea !== 0;
|
|
16839
|
+
}, "Stiffener outline must enclose a nonzero area"),
|
|
16840
|
+
width: z47.never().optional(),
|
|
16841
|
+
height: z47.never().optional()
|
|
16842
|
+
})
|
|
16843
|
+
]);
|
|
16844
|
+
|
|
16845
|
+
// lib/components/panel.ts
|
|
16846
|
+
import { z as z48 } from "zod";
|
|
16789
16847
|
var panelProps = baseGroupProps.omit({
|
|
16790
16848
|
width: true,
|
|
16791
16849
|
height: true,
|
|
@@ -16794,25 +16852,25 @@ var panelProps = baseGroupProps.omit({
|
|
|
16794
16852
|
}).extend({
|
|
16795
16853
|
width: distance.optional(),
|
|
16796
16854
|
height: distance.optional(),
|
|
16797
|
-
children:
|
|
16855
|
+
children: z48.any().optional(),
|
|
16798
16856
|
anchorAlignment: ninePointAnchor.optional(),
|
|
16799
|
-
noSolderMask:
|
|
16800
|
-
panelizationMethod:
|
|
16857
|
+
noSolderMask: z48.boolean().optional(),
|
|
16858
|
+
panelizationMethod: z48.enum(["tab-routing", "outline_routing", "none"]).optional(),
|
|
16801
16859
|
boardGap: distance.optional(),
|
|
16802
|
-
layoutMode:
|
|
16803
|
-
row:
|
|
16804
|
-
col:
|
|
16860
|
+
layoutMode: z48.enum(["grid", "pack", "none"]).optional(),
|
|
16861
|
+
row: z48.number().optional(),
|
|
16862
|
+
col: z48.number().optional(),
|
|
16805
16863
|
cellWidth: distance.optional(),
|
|
16806
16864
|
cellHeight: distance.optional(),
|
|
16807
16865
|
tabWidth: distance.optional(),
|
|
16808
16866
|
tabLength: distance.optional(),
|
|
16809
|
-
mouseBites:
|
|
16867
|
+
mouseBites: z48.boolean().optional(),
|
|
16810
16868
|
edgePadding: distance.optional(),
|
|
16811
16869
|
edgePaddingLeft: distance.optional(),
|
|
16812
16870
|
edgePaddingRight: distance.optional(),
|
|
16813
16871
|
edgePaddingTop: distance.optional(),
|
|
16814
16872
|
edgePaddingBottom: distance.optional(),
|
|
16815
|
-
_subcircuitCachingEnabled:
|
|
16873
|
+
_subcircuitCachingEnabled: z48.boolean().optional()
|
|
16816
16874
|
});
|
|
16817
16875
|
expectTypesMatch(true);
|
|
16818
16876
|
|
|
@@ -16823,33 +16881,33 @@ expectTypesMatch(true);
|
|
|
16823
16881
|
|
|
16824
16882
|
// lib/common/fanoutTracePath.ts
|
|
16825
16883
|
import { layer_ref as layer_ref5 } from "circuit-json";
|
|
16826
|
-
import { z as
|
|
16884
|
+
import { z as z50 } from "zod";
|
|
16827
16885
|
var coordinate = distance.refine(Number.isFinite, "Coordinate must be finite");
|
|
16828
|
-
var
|
|
16886
|
+
var positiveDistance3 = distance.refine(
|
|
16829
16887
|
(value) => Number.isFinite(value) && value > 0,
|
|
16830
16888
|
"Distance must be positive and finite"
|
|
16831
16889
|
);
|
|
16832
|
-
var routePoint =
|
|
16833
|
-
|
|
16834
|
-
route_type:
|
|
16890
|
+
var routePoint = z50.discriminatedUnion("route_type", [
|
|
16891
|
+
z50.object({
|
|
16892
|
+
route_type: z50.literal("wire"),
|
|
16835
16893
|
x: coordinate,
|
|
16836
16894
|
y: coordinate,
|
|
16837
|
-
width:
|
|
16895
|
+
width: positiveDistance3,
|
|
16838
16896
|
layer: layer_ref5
|
|
16839
16897
|
}),
|
|
16840
|
-
|
|
16841
|
-
route_type:
|
|
16898
|
+
z50.object({
|
|
16899
|
+
route_type: z50.literal("via"),
|
|
16842
16900
|
x: coordinate,
|
|
16843
16901
|
y: coordinate,
|
|
16844
16902
|
from_layer: layer_ref5,
|
|
16845
16903
|
to_layer: layer_ref5,
|
|
16846
|
-
via_diameter:
|
|
16847
|
-
via_hole_diameter:
|
|
16904
|
+
via_diameter: positiveDistance3.optional(),
|
|
16905
|
+
via_hole_diameter: positiveDistance3.optional()
|
|
16848
16906
|
})
|
|
16849
16907
|
]);
|
|
16850
|
-
var fanoutTracePath =
|
|
16851
|
-
connection:
|
|
16852
|
-
route:
|
|
16908
|
+
var fanoutTracePath = z50.object({
|
|
16909
|
+
connection: z50.string().min(1),
|
|
16910
|
+
route: z50.array(routePoint).min(2).superRefine((route, ctx) => {
|
|
16853
16911
|
const first = route[0];
|
|
16854
16912
|
let layer = first?.route_type === "via" ? first.from_layer : first?.layer;
|
|
16855
16913
|
for (const point8 of route) {
|
|
@@ -16866,16 +16924,16 @@ var fanoutTracePath = z48.object({
|
|
|
16866
16924
|
|
|
16867
16925
|
// lib/common/fanoutProps.ts
|
|
16868
16926
|
import { layer_ref as layer_ref6 } from "circuit-json";
|
|
16869
|
-
import { z as
|
|
16927
|
+
import { z as z52 } from "zod";
|
|
16870
16928
|
|
|
16871
16929
|
// lib/common/fanoutBoundaryPadding.ts
|
|
16872
|
-
import { z as
|
|
16930
|
+
import { z as z51 } from "zod";
|
|
16873
16931
|
var nonnegativeDistance = distance.refine((value) => value >= 0, {
|
|
16874
16932
|
message: "Fanout boundary padding cannot be negative"
|
|
16875
16933
|
});
|
|
16876
|
-
var fanoutBoundaryPadding =
|
|
16934
|
+
var fanoutBoundaryPadding = z51.union([
|
|
16877
16935
|
nonnegativeDistance,
|
|
16878
|
-
|
|
16936
|
+
z51.object({
|
|
16879
16937
|
top: nonnegativeDistance.optional(),
|
|
16880
16938
|
right: nonnegativeDistance.optional(),
|
|
16881
16939
|
bottom: nonnegativeDistance.optional(),
|
|
@@ -16902,32 +16960,32 @@ var canonicalBusFanoutDirectionValues = [
|
|
|
16902
16960
|
"leftside_top",
|
|
16903
16961
|
"center"
|
|
16904
16962
|
];
|
|
16905
|
-
var canonicalBusFanoutDirection =
|
|
16963
|
+
var canonicalBusFanoutDirection = z52.enum(
|
|
16906
16964
|
canonicalBusFanoutDirectionValues
|
|
16907
16965
|
);
|
|
16908
|
-
var busFanoutDirection =
|
|
16966
|
+
var busFanoutDirection = z52.union([
|
|
16909
16967
|
ninePointAnchor,
|
|
16910
16968
|
canonicalBusFanoutDirection,
|
|
16911
|
-
|
|
16912
|
-
direction:
|
|
16969
|
+
z52.object({
|
|
16970
|
+
direction: z52.union([ninePointAnchor, canonicalBusFanoutDirection])
|
|
16913
16971
|
})
|
|
16914
16972
|
]);
|
|
16915
|
-
var fanoutProps =
|
|
16916
|
-
busFanoutDirections:
|
|
16973
|
+
var fanoutProps = z52.object({
|
|
16974
|
+
busFanoutDirections: z52.record(busFanoutDirection).optional(),
|
|
16917
16975
|
fanoutBoundaryPadding: fanoutBoundaryPadding.optional(),
|
|
16918
|
-
fanoutRoutingLayers:
|
|
16919
|
-
fanoutPourNetMap:
|
|
16976
|
+
fanoutRoutingLayers: z52.array(layer_ref6).min(1).optional(),
|
|
16977
|
+
fanoutPourNetMap: z52.record(layer_ref6, z52.union([z52.string(), z52.array(z52.string()).min(1)])).optional()
|
|
16920
16978
|
});
|
|
16921
16979
|
expectTypesMatch(true);
|
|
16922
16980
|
|
|
16923
16981
|
// lib/components/breakout.ts
|
|
16924
|
-
import { z as
|
|
16982
|
+
import { z as z53 } from "zod";
|
|
16925
16983
|
var nonnegativeFanoutMargin = distance.refine((value) => value >= 0, {
|
|
16926
16984
|
message: "Fanout margin cannot be negative"
|
|
16927
16985
|
});
|
|
16928
16986
|
var breakoutProps = subcircuitGroupProps.extend({
|
|
16929
16987
|
autorouter: autorouterProp.default("fanout"),
|
|
16930
|
-
pcbTracePaths:
|
|
16988
|
+
pcbTracePaths: z53.array(fanoutTracePath).optional(),
|
|
16931
16989
|
padding: distance.optional(),
|
|
16932
16990
|
paddingLeft: distance.optional(),
|
|
16933
16991
|
paddingRight: distance.optional(),
|
|
@@ -16941,41 +16999,41 @@ expectTypesMatch(true);
|
|
|
16941
16999
|
// lib/components/chip.ts
|
|
16942
17000
|
import { distance as distance12, supplier_name as supplier_name2 } from "circuit-json";
|
|
16943
17001
|
import { isValidElement } from "react";
|
|
16944
|
-
import { z as
|
|
16945
|
-
var connectionTarget2 =
|
|
16946
|
-
var noConnectProp =
|
|
16947
|
-
var connectionsProp =
|
|
16948
|
-
var spicemodelElement =
|
|
17002
|
+
import { z as z54 } from "zod";
|
|
17003
|
+
var connectionTarget2 = z54.string().or(z54.array(z54.string()).readonly()).or(z54.array(z54.string()));
|
|
17004
|
+
var noConnectProp = z54.array(schematicPinLabel).readonly().or(z54.array(schematicPinLabel));
|
|
17005
|
+
var connectionsProp = z54.custom().pipe(z54.record(z54.string(), connectionTarget2));
|
|
17006
|
+
var spicemodelElement = z54.custom(
|
|
16949
17007
|
(v) => !!v && typeof v === "object" && "type" in v && "props" in v
|
|
16950
17008
|
);
|
|
16951
|
-
var internalCircuitElement =
|
|
17009
|
+
var internalCircuitElement = z54.custom(
|
|
16952
17010
|
(value) => isValidElement(value) && value.type === "internalcircuit"
|
|
16953
17011
|
);
|
|
16954
|
-
var pinLabelsProp =
|
|
17012
|
+
var pinLabelsProp = z54.record(
|
|
16955
17013
|
schematicPinLabel,
|
|
16956
|
-
schematicPinLabel.or(
|
|
17014
|
+
schematicPinLabel.or(z54.array(schematicPinLabel).readonly()).or(z54.array(schematicPinLabel))
|
|
16957
17015
|
);
|
|
16958
17016
|
expectTypesMatch(true);
|
|
16959
|
-
var pinCompatibleVariant =
|
|
16960
|
-
manufacturerPartNumber:
|
|
16961
|
-
supplierPartNumber:
|
|
17017
|
+
var pinCompatibleVariant = z54.object({
|
|
17018
|
+
manufacturerPartNumber: z54.string().optional(),
|
|
17019
|
+
supplierPartNumber: z54.record(supplier_name2, z54.array(z54.string())).optional()
|
|
16962
17020
|
});
|
|
16963
17021
|
var chipProps = commonComponentProps.extend({
|
|
16964
|
-
manufacturerPartNumber:
|
|
17022
|
+
manufacturerPartNumber: z54.string().optional(),
|
|
16965
17023
|
pinLabels: pinLabelsProp.optional(),
|
|
16966
|
-
showPinAliases:
|
|
16967
|
-
pcbPinLabels:
|
|
16968
|
-
internallyConnectedPins:
|
|
16969
|
-
externallyConnectedPins:
|
|
17024
|
+
showPinAliases: z54.boolean().optional(),
|
|
17025
|
+
pcbPinLabels: z54.record(z54.string(), z54.string()).optional(),
|
|
17026
|
+
internallyConnectedPins: z54.array(z54.array(z54.union([z54.string(), z54.number()]))).optional(),
|
|
17027
|
+
externallyConnectedPins: z54.array(z54.array(z54.string())).optional(),
|
|
16970
17028
|
schPinArrangement: schematicPortArrangement.optional(),
|
|
16971
17029
|
schPortArrangement: schematicPortArrangement.optional(),
|
|
16972
|
-
pinCompatibleVariants:
|
|
17030
|
+
pinCompatibleVariants: z54.array(pinCompatibleVariant).optional(),
|
|
16973
17031
|
schPinStyle: schematicPinStyle.optional(),
|
|
16974
17032
|
schPinSpacing: distance12.optional(),
|
|
16975
17033
|
schWidth: distance12.optional(),
|
|
16976
17034
|
schHeight: distance12.optional(),
|
|
16977
|
-
noSchematicRepresentation:
|
|
16978
|
-
schShowInternalCircuit:
|
|
17035
|
+
noSchematicRepresentation: z54.boolean().optional(),
|
|
17036
|
+
schShowInternalCircuit: z54.boolean().optional().default(false),
|
|
16979
17037
|
noConnect: noConnectProp.optional(),
|
|
16980
17038
|
connections: connectionsProp.optional(),
|
|
16981
17039
|
spiceModel: spicemodelElement.optional(),
|
|
@@ -16990,38 +17048,38 @@ expectTypesMatch(true);
|
|
|
16990
17048
|
|
|
16991
17049
|
// lib/components/jumper.ts
|
|
16992
17050
|
import { distance as distance13 } from "circuit-json";
|
|
16993
|
-
import { z as
|
|
17051
|
+
import { z as z55 } from "zod";
|
|
16994
17052
|
var jumperProps = commonComponentProps.extend({
|
|
16995
|
-
manufacturerPartNumber:
|
|
16996
|
-
pinLabels:
|
|
16997
|
-
|
|
16998
|
-
schematicPinLabel.or(
|
|
17053
|
+
manufacturerPartNumber: z55.string().optional(),
|
|
17054
|
+
pinLabels: z55.record(
|
|
17055
|
+
z55.number().or(schematicPinLabel),
|
|
17056
|
+
schematicPinLabel.or(z55.array(schematicPinLabel))
|
|
16999
17057
|
).optional(),
|
|
17000
17058
|
schPinStyle: schematicPinStyle.optional(),
|
|
17001
17059
|
schPinSpacing: distance13.optional(),
|
|
17002
17060
|
schWidth: distance13.optional(),
|
|
17003
17061
|
schHeight: distance13.optional(),
|
|
17004
|
-
schDirection:
|
|
17062
|
+
schDirection: z55.enum(["left", "right"]).optional(),
|
|
17005
17063
|
schPinArrangement: schematicPinArrangement.optional(),
|
|
17006
17064
|
schPortArrangement: schematicPortArrangement.optional(),
|
|
17007
|
-
pcbPinLabels:
|
|
17008
|
-
pinCount:
|
|
17009
|
-
internallyConnectedPins:
|
|
17010
|
-
connections:
|
|
17065
|
+
pcbPinLabels: z55.record(z55.string(), z55.string()).optional(),
|
|
17066
|
+
pinCount: z55.union([z55.literal(2), z55.literal(3)]).optional(),
|
|
17067
|
+
internallyConnectedPins: z55.array(z55.array(z55.union([z55.string(), z55.number()]))).optional(),
|
|
17068
|
+
connections: z55.custom().pipe(z55.record(z55.string(), connectionTarget)).optional()
|
|
17011
17069
|
});
|
|
17012
17070
|
expectTypesMatch(true);
|
|
17013
17071
|
|
|
17014
17072
|
// lib/components/solderjumper.ts
|
|
17015
|
-
import { z as
|
|
17073
|
+
import { z as z56 } from "zod";
|
|
17016
17074
|
var solderjumperProps = jumperProps.extend({
|
|
17017
|
-
bridgedPins:
|
|
17018
|
-
bridged:
|
|
17075
|
+
bridgedPins: z56.array(z56.array(z56.string())).optional(),
|
|
17076
|
+
bridged: z56.boolean().optional()
|
|
17019
17077
|
});
|
|
17020
17078
|
expectTypesMatch(true);
|
|
17021
17079
|
|
|
17022
17080
|
// lib/components/connector.ts
|
|
17023
|
-
import { z as
|
|
17024
|
-
var connectorStandard =
|
|
17081
|
+
import { z as z57 } from "zod";
|
|
17082
|
+
var connectorStandard = z57.enum([
|
|
17025
17083
|
"usb_c",
|
|
17026
17084
|
"m2",
|
|
17027
17085
|
"jst_sh",
|
|
@@ -17033,43 +17091,43 @@ var connectorStandard = z55.enum([
|
|
|
17033
17091
|
]);
|
|
17034
17092
|
var connectorProps = chipProps.extend({
|
|
17035
17093
|
standard: connectorStandard.optional(),
|
|
17036
|
-
pinCount:
|
|
17094
|
+
pinCount: z57.number().int().positive().optional()
|
|
17037
17095
|
});
|
|
17038
17096
|
expectTypesMatch(true);
|
|
17039
17097
|
|
|
17040
17098
|
// lib/components/interconnect.ts
|
|
17041
|
-
import { z as
|
|
17099
|
+
import { z as z58 } from "zod";
|
|
17042
17100
|
var interconnectProps = commonComponentProps.extend({
|
|
17043
|
-
standard:
|
|
17044
|
-
pinLabels:
|
|
17045
|
-
|
|
17046
|
-
schematicPinLabel.or(
|
|
17101
|
+
standard: z58.enum(["TSC0001_36P_XALT_2025_11", "0805", "0603", "1206"]).optional(),
|
|
17102
|
+
pinLabels: z58.record(
|
|
17103
|
+
z58.number().or(schematicPinLabel),
|
|
17104
|
+
schematicPinLabel.or(z58.array(schematicPinLabel))
|
|
17047
17105
|
).optional(),
|
|
17048
|
-
internallyConnectedPins:
|
|
17106
|
+
internallyConnectedPins: z58.array(z58.array(z58.union([z58.string(), z58.number()]))).optional()
|
|
17049
17107
|
});
|
|
17050
17108
|
expectTypesMatch(true);
|
|
17051
17109
|
|
|
17052
17110
|
// lib/components/fuse.ts
|
|
17053
|
-
import { z as
|
|
17111
|
+
import { z as z59 } from "zod";
|
|
17054
17112
|
var fusePinLabels = ["pin1", "pin2"];
|
|
17055
17113
|
var fuseProps = commonComponentProps.extend({
|
|
17056
|
-
currentRating:
|
|
17057
|
-
voltageRating:
|
|
17058
|
-
schShowRatings:
|
|
17114
|
+
currentRating: z59.union([z59.number(), z59.string()]),
|
|
17115
|
+
voltageRating: z59.union([z59.number(), z59.string()]).optional(),
|
|
17116
|
+
schShowRatings: z59.boolean().optional(),
|
|
17059
17117
|
schOrientation: schematicOrientation.optional(),
|
|
17060
|
-
connections:
|
|
17061
|
-
|
|
17062
|
-
|
|
17063
|
-
|
|
17064
|
-
|
|
17065
|
-
|
|
17118
|
+
connections: z59.record(
|
|
17119
|
+
z59.string(),
|
|
17120
|
+
z59.union([
|
|
17121
|
+
z59.string(),
|
|
17122
|
+
z59.array(z59.string()).readonly(),
|
|
17123
|
+
z59.array(z59.string())
|
|
17066
17124
|
])
|
|
17067
17125
|
).optional()
|
|
17068
17126
|
});
|
|
17069
17127
|
|
|
17070
17128
|
// lib/components/platedhole.ts
|
|
17071
17129
|
import { distance as distance14 } from "circuit-json";
|
|
17072
|
-
import { z as
|
|
17130
|
+
import { z as z60 } from "zod";
|
|
17073
17131
|
var DEFAULT_PIN_HEADER_HOLE_DIAMETER = "0.04in";
|
|
17074
17132
|
var DEFAULT_PIN_HEADER_OUTER_DIAMETER = "0.1in";
|
|
17075
17133
|
var inferPlatedHoleShapeAndDefaults = (rawProps) => {
|
|
@@ -17101,26 +17159,26 @@ var inferPlatedHoleShapeAndDefaults = (rawProps) => {
|
|
|
17101
17159
|
props.outerDiameter = DEFAULT_PIN_HEADER_OUTER_DIAMETER;
|
|
17102
17160
|
return props;
|
|
17103
17161
|
};
|
|
17104
|
-
var distanceHiddenUndefined =
|
|
17162
|
+
var distanceHiddenUndefined = z60.custom().transform((a) => {
|
|
17105
17163
|
if (a === void 0) return void 0;
|
|
17106
17164
|
return distance14.parse(a);
|
|
17107
17165
|
});
|
|
17108
|
-
var platedHolePropsByShape =
|
|
17166
|
+
var platedHolePropsByShape = z60.discriminatedUnion("shape", [
|
|
17109
17167
|
pcbLayoutProps.omit({ pcbRotation: true, layer: true }).extend({
|
|
17110
|
-
name:
|
|
17111
|
-
connectsTo:
|
|
17112
|
-
shape:
|
|
17168
|
+
name: z60.string().optional(),
|
|
17169
|
+
connectsTo: z60.string().or(z60.array(z60.string())).optional(),
|
|
17170
|
+
shape: z60.literal("circle"),
|
|
17113
17171
|
holeDiameter: distance14,
|
|
17114
17172
|
outerDiameter: distance14,
|
|
17115
17173
|
padDiameter: distance14.optional().describe("Diameter of the copper pad"),
|
|
17116
17174
|
portHints: portHints.optional(),
|
|
17117
17175
|
solderMaskMargin: distance14.optional(),
|
|
17118
|
-
coveredWithSolderMask:
|
|
17176
|
+
coveredWithSolderMask: z60.boolean().optional()
|
|
17119
17177
|
}),
|
|
17120
17178
|
pcbLayoutProps.omit({ layer: true }).extend({
|
|
17121
|
-
name:
|
|
17122
|
-
connectsTo:
|
|
17123
|
-
shape:
|
|
17179
|
+
name: z60.string().optional(),
|
|
17180
|
+
connectsTo: z60.string().or(z60.array(z60.string())).optional(),
|
|
17181
|
+
shape: z60.literal("oval"),
|
|
17124
17182
|
outerWidth: distance14,
|
|
17125
17183
|
outerHeight: distance14,
|
|
17126
17184
|
holeWidth: distanceHiddenUndefined,
|
|
@@ -17129,13 +17187,13 @@ var platedHolePropsByShape = z58.discriminatedUnion("shape", [
|
|
|
17129
17187
|
innerHeight: distance14.optional().describe("DEPRECATED use holeHeight"),
|
|
17130
17188
|
portHints: portHints.optional(),
|
|
17131
17189
|
solderMaskMargin: distance14.optional(),
|
|
17132
|
-
coveredWithSolderMask:
|
|
17190
|
+
coveredWithSolderMask: z60.boolean().optional()
|
|
17133
17191
|
}),
|
|
17134
17192
|
pcbLayoutProps.omit({ layer: true }).extend({
|
|
17135
|
-
name:
|
|
17136
|
-
connectsTo:
|
|
17137
|
-
shape:
|
|
17138
|
-
rectPad:
|
|
17193
|
+
name: z60.string().optional(),
|
|
17194
|
+
connectsTo: z60.string().or(z60.array(z60.string())).optional(),
|
|
17195
|
+
shape: z60.literal("pill"),
|
|
17196
|
+
rectPad: z60.boolean().optional(),
|
|
17139
17197
|
outerWidth: distance14,
|
|
17140
17198
|
outerHeight: distance14,
|
|
17141
17199
|
holeWidth: distanceHiddenUndefined,
|
|
@@ -17146,30 +17204,30 @@ var platedHolePropsByShape = z58.discriminatedUnion("shape", [
|
|
|
17146
17204
|
holeOffsetX: distance14.optional(),
|
|
17147
17205
|
holeOffsetY: distance14.optional(),
|
|
17148
17206
|
solderMaskMargin: distance14.optional(),
|
|
17149
|
-
coveredWithSolderMask:
|
|
17207
|
+
coveredWithSolderMask: z60.boolean().optional()
|
|
17150
17208
|
}),
|
|
17151
17209
|
pcbLayoutProps.omit({ layer: true }).extend({
|
|
17152
|
-
name:
|
|
17153
|
-
connectsTo:
|
|
17154
|
-
shape:
|
|
17210
|
+
name: z60.string().optional(),
|
|
17211
|
+
connectsTo: z60.string().or(z60.array(z60.string())).optional(),
|
|
17212
|
+
shape: z60.literal("circular_hole_with_rect_pad"),
|
|
17155
17213
|
holeDiameter: distance14,
|
|
17156
17214
|
rectPadWidth: distance14,
|
|
17157
17215
|
rectPadHeight: distance14,
|
|
17158
17216
|
rectBorderRadius: distance14.optional(),
|
|
17159
|
-
holeShape:
|
|
17160
|
-
padShape:
|
|
17217
|
+
holeShape: z60.literal("circle").optional(),
|
|
17218
|
+
padShape: z60.literal("rect").optional(),
|
|
17161
17219
|
portHints: portHints.optional(),
|
|
17162
17220
|
holeOffsetX: distance14.optional(),
|
|
17163
17221
|
holeOffsetY: distance14.optional(),
|
|
17164
17222
|
solderMaskMargin: distance14.optional(),
|
|
17165
|
-
coveredWithSolderMask:
|
|
17223
|
+
coveredWithSolderMask: z60.boolean().optional()
|
|
17166
17224
|
}),
|
|
17167
17225
|
pcbLayoutProps.omit({ layer: true }).extend({
|
|
17168
|
-
name:
|
|
17169
|
-
connectsTo:
|
|
17170
|
-
shape:
|
|
17171
|
-
holeShape:
|
|
17172
|
-
padShape:
|
|
17226
|
+
name: z60.string().optional(),
|
|
17227
|
+
connectsTo: z60.string().or(z60.array(z60.string())).optional(),
|
|
17228
|
+
shape: z60.literal("pill_hole_with_rect_pad"),
|
|
17229
|
+
holeShape: z60.literal("pill").optional(),
|
|
17230
|
+
padShape: z60.literal("rect").optional(),
|
|
17173
17231
|
holeWidth: distance14,
|
|
17174
17232
|
holeHeight: distance14,
|
|
17175
17233
|
rectPadWidth: distance14,
|
|
@@ -17179,22 +17237,22 @@ var platedHolePropsByShape = z58.discriminatedUnion("shape", [
|
|
|
17179
17237
|
holeOffsetX: distance14.optional(),
|
|
17180
17238
|
holeOffsetY: distance14.optional(),
|
|
17181
17239
|
solderMaskMargin: distance14.optional(),
|
|
17182
|
-
coveredWithSolderMask:
|
|
17240
|
+
coveredWithSolderMask: z60.boolean().optional()
|
|
17183
17241
|
}),
|
|
17184
17242
|
pcbLayoutProps.omit({ pcbRotation: true, layer: true }).extend({
|
|
17185
|
-
name:
|
|
17186
|
-
connectsTo:
|
|
17187
|
-
shape:
|
|
17188
|
-
holeShape:
|
|
17243
|
+
name: z60.string().optional(),
|
|
17244
|
+
connectsTo: z60.string().or(z60.array(z60.string())).optional(),
|
|
17245
|
+
shape: z60.literal("hole_with_polygon_pad"),
|
|
17246
|
+
holeShape: z60.enum(["circle", "oval", "pill", "rotated_pill"]),
|
|
17189
17247
|
holeDiameter: distance14.optional(),
|
|
17190
17248
|
holeWidth: distance14.optional(),
|
|
17191
17249
|
holeHeight: distance14.optional(),
|
|
17192
|
-
padOutline:
|
|
17250
|
+
padOutline: z60.array(point),
|
|
17193
17251
|
holeOffsetX: distance14,
|
|
17194
17252
|
holeOffsetY: distance14,
|
|
17195
17253
|
portHints: portHints.optional(),
|
|
17196
17254
|
solderMaskMargin: distance14.optional(),
|
|
17197
|
-
coveredWithSolderMask:
|
|
17255
|
+
coveredWithSolderMask: z60.boolean().optional()
|
|
17198
17256
|
})
|
|
17199
17257
|
]).transform((a) => {
|
|
17200
17258
|
if ("innerWidth" in a && a.innerWidth !== void 0) {
|
|
@@ -17205,7 +17263,7 @@ var platedHolePropsByShape = z58.discriminatedUnion("shape", [
|
|
|
17205
17263
|
}
|
|
17206
17264
|
return a;
|
|
17207
17265
|
});
|
|
17208
|
-
var platedHoleProps =
|
|
17266
|
+
var platedHoleProps = z60.preprocess(
|
|
17209
17267
|
inferPlatedHoleShapeAndDefaults,
|
|
17210
17268
|
platedHolePropsByShape
|
|
17211
17269
|
);
|
|
@@ -17213,7 +17271,7 @@ expectTypesMatch(true);
|
|
|
17213
17271
|
|
|
17214
17272
|
// lib/components/resistor.ts
|
|
17215
17273
|
import { resistance } from "circuit-json";
|
|
17216
|
-
import { z as
|
|
17274
|
+
import { z as z61 } from "zod";
|
|
17217
17275
|
var resistorPinLabels = ["pin1", "pin2", "pos", "neg"];
|
|
17218
17276
|
var resistorImperialFootprintNames = /* @__PURE__ */ new Set([
|
|
17219
17277
|
"01005",
|
|
@@ -17237,7 +17295,7 @@ var resistorFootprintProp = footprintProp.optional().transform(mapResistorFootpr
|
|
|
17237
17295
|
var resistorProps = commonComponentProps.extend({
|
|
17238
17296
|
footprint: resistorFootprintProp,
|
|
17239
17297
|
resistance,
|
|
17240
|
-
tolerance:
|
|
17298
|
+
tolerance: z61.union([z61.string(), z61.number()]).transform((val) => {
|
|
17241
17299
|
if (typeof val === "string") {
|
|
17242
17300
|
if (val.endsWith("%")) {
|
|
17243
17301
|
return parseFloat(val.slice(0, -1)) / 100;
|
|
@@ -17246,12 +17304,12 @@ var resistorProps = commonComponentProps.extend({
|
|
|
17246
17304
|
}
|
|
17247
17305
|
return val;
|
|
17248
17306
|
}).pipe(
|
|
17249
|
-
|
|
17307
|
+
z61.number().min(0, "Tolerance must be non-negative").max(1, "Tolerance cannot be greater than 100%")
|
|
17250
17308
|
).optional(),
|
|
17251
|
-
pullupFor:
|
|
17252
|
-
pullupTo:
|
|
17253
|
-
pulldownFor:
|
|
17254
|
-
pulldownTo:
|
|
17309
|
+
pullupFor: z61.string().optional(),
|
|
17310
|
+
pullupTo: z61.string().optional(),
|
|
17311
|
+
pulldownFor: z61.string().optional(),
|
|
17312
|
+
pulldownTo: z61.string().optional(),
|
|
17255
17313
|
schOrientation: schematicOrientation.optional(),
|
|
17256
17314
|
schSize: schematicSymbolSize.optional(),
|
|
17257
17315
|
connections: createConnectionsProp(resistorPinLabels).optional()
|
|
@@ -17261,18 +17319,18 @@ expectTypesMatch(true);
|
|
|
17261
17319
|
|
|
17262
17320
|
// lib/components/potentiometer.ts
|
|
17263
17321
|
import { resistance as resistance2 } from "circuit-json";
|
|
17264
|
-
import { z as
|
|
17322
|
+
import { z as z62 } from "zod";
|
|
17265
17323
|
var potentiometerPinLabels = ["pin1", "pin2", "pin3"];
|
|
17266
17324
|
var potentiometerProps = commonComponentProps.extend({
|
|
17267
17325
|
maxResistance: resistance2,
|
|
17268
|
-
pinVariant:
|
|
17326
|
+
pinVariant: z62.enum(["two_pin", "three_pin"]).optional(),
|
|
17269
17327
|
connections: createConnectionsProp(potentiometerPinLabels).optional()
|
|
17270
17328
|
});
|
|
17271
17329
|
expectTypesMatch(true);
|
|
17272
17330
|
|
|
17273
17331
|
// lib/components/crystal.ts
|
|
17274
17332
|
import { capacitance, distance as distance15, frequency } from "circuit-json";
|
|
17275
|
-
import { z as
|
|
17333
|
+
import { z as z63 } from "zod";
|
|
17276
17334
|
var crystalPins = [
|
|
17277
17335
|
"pin1",
|
|
17278
17336
|
"left",
|
|
@@ -17285,9 +17343,9 @@ var crystalProps = commonComponentProps.extend({
|
|
|
17285
17343
|
frequency,
|
|
17286
17344
|
loadCapacitance: capacitance,
|
|
17287
17345
|
maxTraceLength: distance15.optional(),
|
|
17288
|
-
manufacturerPartNumber:
|
|
17289
|
-
mpn:
|
|
17290
|
-
pinVariant:
|
|
17346
|
+
manufacturerPartNumber: z63.string().optional(),
|
|
17347
|
+
mpn: z63.string().optional(),
|
|
17348
|
+
pinVariant: z63.enum(["two_pin", "four_pin"]).optional(),
|
|
17291
17349
|
schOrientation: schematicOrientation.optional(),
|
|
17292
17350
|
connections: createConnectionsProp(crystalPins).optional()
|
|
17293
17351
|
});
|
|
@@ -17295,34 +17353,34 @@ expectTypesMatch(true);
|
|
|
17295
17353
|
|
|
17296
17354
|
// lib/components/resonator.ts
|
|
17297
17355
|
import { frequency as frequency2, capacitance as capacitance2 } from "circuit-json";
|
|
17298
|
-
import { z as
|
|
17356
|
+
import { z as z64 } from "zod";
|
|
17299
17357
|
var resonatorProps = commonComponentProps.extend({
|
|
17300
17358
|
frequency: frequency2,
|
|
17301
17359
|
loadCapacitance: capacitance2,
|
|
17302
|
-
pinVariant:
|
|
17360
|
+
pinVariant: z64.enum(["no_ground", "ground_pin", "two_ground_pins"]).optional()
|
|
17303
17361
|
});
|
|
17304
17362
|
expectTypesMatch(true);
|
|
17305
17363
|
|
|
17306
17364
|
// lib/components/stampboard.ts
|
|
17307
17365
|
import { distance as distance16 } from "circuit-json";
|
|
17308
|
-
import { z as
|
|
17366
|
+
import { z as z65 } from "zod";
|
|
17309
17367
|
var stampboardProps = boardProps.extend({
|
|
17310
|
-
leftPinCount:
|
|
17311
|
-
rightPinCount:
|
|
17312
|
-
topPinCount:
|
|
17313
|
-
bottomPinCount:
|
|
17314
|
-
leftPins:
|
|
17315
|
-
rightPins:
|
|
17316
|
-
topPins:
|
|
17317
|
-
bottomPins:
|
|
17368
|
+
leftPinCount: z65.number().optional(),
|
|
17369
|
+
rightPinCount: z65.number().optional(),
|
|
17370
|
+
topPinCount: z65.number().optional(),
|
|
17371
|
+
bottomPinCount: z65.number().optional(),
|
|
17372
|
+
leftPins: z65.array(z65.string()).optional(),
|
|
17373
|
+
rightPins: z65.array(z65.string()).optional(),
|
|
17374
|
+
topPins: z65.array(z65.string()).optional(),
|
|
17375
|
+
bottomPins: z65.array(z65.string()).optional(),
|
|
17318
17376
|
pinPitch: distance16.optional(),
|
|
17319
|
-
innerHoles:
|
|
17377
|
+
innerHoles: z65.boolean().optional()
|
|
17320
17378
|
});
|
|
17321
17379
|
expectTypesMatch(true);
|
|
17322
17380
|
|
|
17323
17381
|
// lib/components/capacitor.ts
|
|
17324
17382
|
import { capacitance as capacitance3, distance as distance17, voltage } from "circuit-json";
|
|
17325
|
-
import { z as
|
|
17383
|
+
import { z as z66 } from "zod";
|
|
17326
17384
|
var capacitorPinLabels = [
|
|
17327
17385
|
"pin1",
|
|
17328
17386
|
"pin2",
|
|
@@ -17334,12 +17392,12 @@ var capacitorPinLabels = [
|
|
|
17334
17392
|
var capacitorProps = commonComponentProps.extend({
|
|
17335
17393
|
capacitance: capacitance3,
|
|
17336
17394
|
maxVoltageRating: voltage.optional(),
|
|
17337
|
-
schShowRatings:
|
|
17338
|
-
polarized:
|
|
17339
|
-
decouplingFor:
|
|
17340
|
-
decouplingTo:
|
|
17341
|
-
bypassFor:
|
|
17342
|
-
bypassTo:
|
|
17395
|
+
schShowRatings: z66.boolean().optional().default(false),
|
|
17396
|
+
polarized: z66.boolean().optional().default(false),
|
|
17397
|
+
decouplingFor: z66.string().optional(),
|
|
17398
|
+
decouplingTo: z66.string().optional(),
|
|
17399
|
+
bypassFor: z66.string().optional(),
|
|
17400
|
+
bypassTo: z66.string().optional(),
|
|
17343
17401
|
maxDecouplingTraceLength: distance17.optional(),
|
|
17344
17402
|
schOrientation: schematicOrientation.optional(),
|
|
17345
17403
|
schSize: schematicSymbolSize.optional(),
|
|
@@ -17350,14 +17408,14 @@ expectTypesMatch(true);
|
|
|
17350
17408
|
|
|
17351
17409
|
// lib/components/net.ts
|
|
17352
17410
|
import { distance as distance18 } from "circuit-json";
|
|
17353
|
-
import { z as
|
|
17354
|
-
var netProps =
|
|
17355
|
-
name:
|
|
17356
|
-
connectsTo:
|
|
17357
|
-
routingPhaseIndex:
|
|
17358
|
-
highlightColor:
|
|
17359
|
-
isPowerNet:
|
|
17360
|
-
isGroundNet:
|
|
17411
|
+
import { z as z67 } from "zod";
|
|
17412
|
+
var netProps = z67.object({
|
|
17413
|
+
name: z67.string(),
|
|
17414
|
+
connectsTo: z67.string().or(z67.array(z67.string())).optional(),
|
|
17415
|
+
routingPhaseIndex: z67.number().nullable().optional(),
|
|
17416
|
+
highlightColor: z67.string().optional(),
|
|
17417
|
+
isPowerNet: z67.boolean().optional(),
|
|
17418
|
+
isGroundNet: z67.boolean().optional(),
|
|
17361
17419
|
nominalTraceWidth: distance18.optional()
|
|
17362
17420
|
});
|
|
17363
17421
|
expectTypesMatch(true);
|
|
@@ -17371,55 +17429,55 @@ var fiducialProps = commonComponentProps.extend({
|
|
|
17371
17429
|
expectTypesMatch(true);
|
|
17372
17430
|
|
|
17373
17431
|
// lib/components/constrainedlayout.ts
|
|
17374
|
-
import { z as
|
|
17375
|
-
var constrainedLayoutProps =
|
|
17376
|
-
name:
|
|
17377
|
-
pcbOnly:
|
|
17378
|
-
schOnly:
|
|
17432
|
+
import { z as z69 } from "zod";
|
|
17433
|
+
var constrainedLayoutProps = z69.object({
|
|
17434
|
+
name: z69.string().optional(),
|
|
17435
|
+
pcbOnly: z69.boolean().optional(),
|
|
17436
|
+
schOnly: z69.boolean().optional()
|
|
17379
17437
|
});
|
|
17380
17438
|
expectTypesMatch(true);
|
|
17381
17439
|
|
|
17382
17440
|
// lib/components/constraint.ts
|
|
17383
|
-
import { z as
|
|
17384
|
-
var pcbXDistConstraintProps =
|
|
17385
|
-
pcb:
|
|
17441
|
+
import { z as z70 } from "zod";
|
|
17442
|
+
var pcbXDistConstraintProps = z70.object({
|
|
17443
|
+
pcb: z70.literal(true).optional(),
|
|
17386
17444
|
xDist: distance,
|
|
17387
|
-
left:
|
|
17388
|
-
right:
|
|
17389
|
-
edgeToEdge:
|
|
17390
|
-
centerToCenter:
|
|
17445
|
+
left: z70.string(),
|
|
17446
|
+
right: z70.string(),
|
|
17447
|
+
edgeToEdge: z70.literal(true).optional(),
|
|
17448
|
+
centerToCenter: z70.literal(true).optional()
|
|
17391
17449
|
});
|
|
17392
17450
|
expectTypesMatch(
|
|
17393
17451
|
true
|
|
17394
17452
|
);
|
|
17395
|
-
var pcbYDistConstraintProps =
|
|
17396
|
-
pcb:
|
|
17453
|
+
var pcbYDistConstraintProps = z70.object({
|
|
17454
|
+
pcb: z70.literal(true).optional(),
|
|
17397
17455
|
yDist: distance,
|
|
17398
|
-
top:
|
|
17399
|
-
bottom:
|
|
17400
|
-
edgeToEdge:
|
|
17401
|
-
centerToCenter:
|
|
17456
|
+
top: z70.string(),
|
|
17457
|
+
bottom: z70.string(),
|
|
17458
|
+
edgeToEdge: z70.literal(true).optional(),
|
|
17459
|
+
centerToCenter: z70.literal(true).optional()
|
|
17402
17460
|
});
|
|
17403
17461
|
expectTypesMatch(
|
|
17404
17462
|
true
|
|
17405
17463
|
);
|
|
17406
|
-
var pcbSameYConstraintProps =
|
|
17407
|
-
pcb:
|
|
17408
|
-
sameY:
|
|
17409
|
-
for:
|
|
17464
|
+
var pcbSameYConstraintProps = z70.object({
|
|
17465
|
+
pcb: z70.literal(true).optional(),
|
|
17466
|
+
sameY: z70.literal(true).optional(),
|
|
17467
|
+
for: z70.array(z70.string())
|
|
17410
17468
|
});
|
|
17411
17469
|
expectTypesMatch(
|
|
17412
17470
|
true
|
|
17413
17471
|
);
|
|
17414
|
-
var pcbSameXConstraintProps =
|
|
17415
|
-
pcb:
|
|
17416
|
-
sameX:
|
|
17417
|
-
for:
|
|
17472
|
+
var pcbSameXConstraintProps = z70.object({
|
|
17473
|
+
pcb: z70.literal(true).optional(),
|
|
17474
|
+
sameX: z70.literal(true).optional(),
|
|
17475
|
+
for: z70.array(z70.string())
|
|
17418
17476
|
});
|
|
17419
17477
|
expectTypesMatch(
|
|
17420
17478
|
true
|
|
17421
17479
|
);
|
|
17422
|
-
var constraintProps =
|
|
17480
|
+
var constraintProps = z70.union([
|
|
17423
17481
|
pcbXDistConstraintProps,
|
|
17424
17482
|
pcbYDistConstraintProps,
|
|
17425
17483
|
pcbSameYConstraintProps,
|
|
@@ -17428,13 +17486,13 @@ var constraintProps = z68.union([
|
|
|
17428
17486
|
expectTypesMatch(true);
|
|
17429
17487
|
|
|
17430
17488
|
// lib/components/cutout.ts
|
|
17431
|
-
import { z as
|
|
17489
|
+
import { z as z71 } from "zod";
|
|
17432
17490
|
var rectCutoutProps = pcbLayoutProps.omit({
|
|
17433
17491
|
layer: true,
|
|
17434
17492
|
pcbRotation: true
|
|
17435
17493
|
}).extend({
|
|
17436
|
-
name:
|
|
17437
|
-
shape:
|
|
17494
|
+
name: z71.string().optional(),
|
|
17495
|
+
shape: z71.literal("rect"),
|
|
17438
17496
|
width: distance,
|
|
17439
17497
|
height: distance
|
|
17440
17498
|
});
|
|
@@ -17443,8 +17501,8 @@ var circleCutoutProps = pcbLayoutProps.omit({
|
|
|
17443
17501
|
layer: true,
|
|
17444
17502
|
pcbRotation: true
|
|
17445
17503
|
}).extend({
|
|
17446
|
-
name:
|
|
17447
|
-
shape:
|
|
17504
|
+
name: z71.string().optional(),
|
|
17505
|
+
shape: z71.literal("circle"),
|
|
17448
17506
|
radius: distance
|
|
17449
17507
|
});
|
|
17450
17508
|
expectTypesMatch(true);
|
|
@@ -17452,36 +17510,36 @@ var polygonCutoutProps = pcbLayoutProps.omit({
|
|
|
17452
17510
|
layer: true,
|
|
17453
17511
|
pcbRotation: true
|
|
17454
17512
|
}).extend({
|
|
17455
|
-
name:
|
|
17456
|
-
shape:
|
|
17457
|
-
points:
|
|
17513
|
+
name: z71.string().optional(),
|
|
17514
|
+
shape: z71.literal("polygon"),
|
|
17515
|
+
points: z71.array(point)
|
|
17458
17516
|
});
|
|
17459
17517
|
expectTypesMatch(true);
|
|
17460
|
-
var cutoutProps =
|
|
17518
|
+
var cutoutProps = z71.discriminatedUnion("shape", [
|
|
17461
17519
|
rectCutoutProps,
|
|
17462
17520
|
circleCutoutProps,
|
|
17463
17521
|
polygonCutoutProps
|
|
17464
17522
|
]);
|
|
17465
17523
|
|
|
17466
17524
|
// lib/components/drc-check.ts
|
|
17467
|
-
import { z as
|
|
17468
|
-
var drcCheckProps =
|
|
17469
|
-
name:
|
|
17525
|
+
import { z as z72 } from "zod";
|
|
17526
|
+
var drcCheckProps = z72.object({
|
|
17527
|
+
name: z72.string().optional(),
|
|
17470
17528
|
checkFn: customDrcCheckFn
|
|
17471
17529
|
});
|
|
17472
17530
|
expectTypesMatch(true);
|
|
17473
17531
|
|
|
17474
17532
|
// lib/components/smtpad.ts
|
|
17475
|
-
import { z as
|
|
17533
|
+
import { z as z73 } from "zod";
|
|
17476
17534
|
var rectSmtPadProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
17477
|
-
name:
|
|
17478
|
-
shape:
|
|
17535
|
+
name: z73.string().optional(),
|
|
17536
|
+
shape: z73.literal("rect"),
|
|
17479
17537
|
width: distance,
|
|
17480
17538
|
height: distance,
|
|
17481
17539
|
rectBorderRadius: distance.optional(),
|
|
17482
17540
|
cornerRadius: distance.optional(),
|
|
17483
17541
|
portHints: portHints.optional(),
|
|
17484
|
-
coveredWithSolderMask:
|
|
17542
|
+
coveredWithSolderMask: z73.boolean().optional(),
|
|
17485
17543
|
solderMaskMargin: distance.optional(),
|
|
17486
17544
|
solderMaskMarginLeft: distance.optional(),
|
|
17487
17545
|
solderMaskMarginRight: distance.optional(),
|
|
@@ -17491,14 +17549,14 @@ var rectSmtPadProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
|
17491
17549
|
});
|
|
17492
17550
|
expectTypesMatch(true);
|
|
17493
17551
|
var rotatedRectSmtPadProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
17494
|
-
name:
|
|
17495
|
-
shape:
|
|
17552
|
+
name: z73.string().optional(),
|
|
17553
|
+
shape: z73.literal("rotated_rect"),
|
|
17496
17554
|
width: distance,
|
|
17497
17555
|
height: distance,
|
|
17498
|
-
ccwRotation:
|
|
17556
|
+
ccwRotation: z73.number(),
|
|
17499
17557
|
cornerRadius: distance.optional(),
|
|
17500
17558
|
portHints: portHints.optional(),
|
|
17501
|
-
coveredWithSolderMask:
|
|
17559
|
+
coveredWithSolderMask: z73.boolean().optional(),
|
|
17502
17560
|
solderMaskMargin: distance.optional(),
|
|
17503
17561
|
solderMaskMarginLeft: distance.optional(),
|
|
17504
17562
|
solderMaskMarginRight: distance.optional(),
|
|
@@ -17508,51 +17566,51 @@ var rotatedRectSmtPadProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
|
17508
17566
|
});
|
|
17509
17567
|
expectTypesMatch(true);
|
|
17510
17568
|
var circleSmtPadProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
17511
|
-
name:
|
|
17512
|
-
shape:
|
|
17569
|
+
name: z73.string().optional(),
|
|
17570
|
+
shape: z73.literal("circle"),
|
|
17513
17571
|
radius: distance,
|
|
17514
17572
|
portHints: portHints.optional(),
|
|
17515
|
-
coveredWithSolderMask:
|
|
17573
|
+
coveredWithSolderMask: z73.boolean().optional(),
|
|
17516
17574
|
solderMaskMargin: distance.optional(),
|
|
17517
17575
|
solderPasteMargin: distance.optional()
|
|
17518
17576
|
});
|
|
17519
17577
|
expectTypesMatch(true);
|
|
17520
17578
|
var pillSmtPadProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
17521
|
-
name:
|
|
17522
|
-
shape:
|
|
17579
|
+
name: z73.string().optional(),
|
|
17580
|
+
shape: z73.literal("pill"),
|
|
17523
17581
|
width: distance,
|
|
17524
17582
|
height: distance,
|
|
17525
17583
|
radius: distance,
|
|
17526
17584
|
portHints: portHints.optional(),
|
|
17527
|
-
coveredWithSolderMask:
|
|
17585
|
+
coveredWithSolderMask: z73.boolean().optional(),
|
|
17528
17586
|
solderMaskMargin: distance.optional(),
|
|
17529
17587
|
solderPasteMargin: distance.optional()
|
|
17530
17588
|
});
|
|
17531
17589
|
expectTypesMatch(true);
|
|
17532
17590
|
var rotatedPillSmtPadProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
17533
|
-
name:
|
|
17534
|
-
shape:
|
|
17591
|
+
name: z73.string().optional(),
|
|
17592
|
+
shape: z73.literal("rotated_pill"),
|
|
17535
17593
|
width: distance,
|
|
17536
17594
|
height: distance,
|
|
17537
17595
|
radius: distance,
|
|
17538
|
-
ccwRotation:
|
|
17596
|
+
ccwRotation: z73.number(),
|
|
17539
17597
|
portHints: portHints.optional(),
|
|
17540
|
-
coveredWithSolderMask:
|
|
17598
|
+
coveredWithSolderMask: z73.boolean().optional(),
|
|
17541
17599
|
solderMaskMargin: distance.optional(),
|
|
17542
17600
|
solderPasteMargin: distance.optional()
|
|
17543
17601
|
});
|
|
17544
17602
|
expectTypesMatch(true);
|
|
17545
17603
|
var polygonSmtPadProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
17546
|
-
name:
|
|
17547
|
-
shape:
|
|
17548
|
-
points:
|
|
17604
|
+
name: z73.string().optional(),
|
|
17605
|
+
shape: z73.literal("polygon"),
|
|
17606
|
+
points: z73.array(point),
|
|
17549
17607
|
portHints: portHints.optional(),
|
|
17550
|
-
coveredWithSolderMask:
|
|
17608
|
+
coveredWithSolderMask: z73.boolean().optional(),
|
|
17551
17609
|
solderMaskMargin: distance.optional(),
|
|
17552
17610
|
solderPasteMargin: distance.optional()
|
|
17553
17611
|
});
|
|
17554
17612
|
expectTypesMatch(true);
|
|
17555
|
-
var smtPadProps =
|
|
17613
|
+
var smtPadProps = z73.discriminatedUnion("shape", [
|
|
17556
17614
|
circleSmtPadProps,
|
|
17557
17615
|
rectSmtPadProps,
|
|
17558
17616
|
rotatedRectSmtPadProps,
|
|
@@ -17563,63 +17621,63 @@ var smtPadProps = z71.discriminatedUnion("shape", [
|
|
|
17563
17621
|
expectTypesMatch(true);
|
|
17564
17622
|
|
|
17565
17623
|
// lib/components/solderpaste.ts
|
|
17566
|
-
import { z as
|
|
17624
|
+
import { z as z74 } from "zod";
|
|
17567
17625
|
var rectSolderPasteProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
17568
|
-
shape:
|
|
17626
|
+
shape: z74.literal("rect"),
|
|
17569
17627
|
width: distance,
|
|
17570
17628
|
height: distance
|
|
17571
17629
|
});
|
|
17572
17630
|
expectTypesMatch(true);
|
|
17573
17631
|
var circleSolderPasteProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
17574
|
-
shape:
|
|
17632
|
+
shape: z74.literal("circle"),
|
|
17575
17633
|
radius: distance
|
|
17576
17634
|
});
|
|
17577
17635
|
expectTypesMatch(true);
|
|
17578
|
-
var solderPasteProps =
|
|
17636
|
+
var solderPasteProps = z74.union([
|
|
17579
17637
|
circleSolderPasteProps,
|
|
17580
17638
|
rectSolderPasteProps
|
|
17581
17639
|
]);
|
|
17582
17640
|
expectTypesMatch(true);
|
|
17583
17641
|
|
|
17584
17642
|
// lib/components/hole.ts
|
|
17585
|
-
import { z as
|
|
17643
|
+
import { z as z75 } from "zod";
|
|
17586
17644
|
var circleHoleProps = pcbLayoutProps.extend({
|
|
17587
|
-
name:
|
|
17588
|
-
shape:
|
|
17645
|
+
name: z75.string().optional(),
|
|
17646
|
+
shape: z75.literal("circle").optional(),
|
|
17589
17647
|
diameter: distance.optional(),
|
|
17590
17648
|
radius: distance.optional(),
|
|
17591
17649
|
solderMaskMargin: distance.optional(),
|
|
17592
|
-
coveredWithSolderMask:
|
|
17650
|
+
coveredWithSolderMask: z75.boolean().optional()
|
|
17593
17651
|
}).transform((d) => ({
|
|
17594
17652
|
...d,
|
|
17595
17653
|
diameter: d.diameter ?? 2 * d.radius,
|
|
17596
17654
|
radius: d.radius ?? d.diameter / 2
|
|
17597
17655
|
}));
|
|
17598
17656
|
var pillHoleProps = pcbLayoutProps.extend({
|
|
17599
|
-
name:
|
|
17600
|
-
shape:
|
|
17657
|
+
name: z75.string().optional(),
|
|
17658
|
+
shape: z75.literal("pill"),
|
|
17601
17659
|
width: distance,
|
|
17602
17660
|
height: distance,
|
|
17603
17661
|
solderMaskMargin: distance.optional(),
|
|
17604
|
-
coveredWithSolderMask:
|
|
17662
|
+
coveredWithSolderMask: z75.boolean().optional()
|
|
17605
17663
|
});
|
|
17606
17664
|
var ovalHoleProps = pcbLayoutProps.extend({
|
|
17607
|
-
name:
|
|
17608
|
-
shape:
|
|
17665
|
+
name: z75.string().optional(),
|
|
17666
|
+
shape: z75.literal("oval"),
|
|
17609
17667
|
width: distance,
|
|
17610
17668
|
height: distance,
|
|
17611
17669
|
solderMaskMargin: distance.optional(),
|
|
17612
|
-
coveredWithSolderMask:
|
|
17670
|
+
coveredWithSolderMask: z75.boolean().optional()
|
|
17613
17671
|
});
|
|
17614
17672
|
var rectHoleProps = pcbLayoutProps.extend({
|
|
17615
|
-
name:
|
|
17616
|
-
shape:
|
|
17673
|
+
name: z75.string().optional(),
|
|
17674
|
+
shape: z75.literal("rect"),
|
|
17617
17675
|
width: distance,
|
|
17618
17676
|
height: distance,
|
|
17619
17677
|
solderMaskMargin: distance.optional(),
|
|
17620
|
-
coveredWithSolderMask:
|
|
17678
|
+
coveredWithSolderMask: z75.boolean().optional()
|
|
17621
17679
|
});
|
|
17622
|
-
var holeProps =
|
|
17680
|
+
var holeProps = z75.union([
|
|
17623
17681
|
circleHoleProps,
|
|
17624
17682
|
pillHoleProps,
|
|
17625
17683
|
ovalHoleProps,
|
|
@@ -17628,7 +17686,7 @@ var holeProps = z73.union([
|
|
|
17628
17686
|
expectTypesMatch(true);
|
|
17629
17687
|
|
|
17630
17688
|
// lib/components/antenna.ts
|
|
17631
|
-
import { z as
|
|
17689
|
+
import { z as z76 } from "zod";
|
|
17632
17690
|
var antennaShapes = [
|
|
17633
17691
|
"2.4ghz_quarter_wave_monopole",
|
|
17634
17692
|
"2.4ghz_meandered_monopole",
|
|
@@ -17636,7 +17694,7 @@ var antennaShapes = [
|
|
|
17636
17694
|
"2.4ghz_meandered_inverted_f",
|
|
17637
17695
|
"2.4ghz_folded_dipole"
|
|
17638
17696
|
];
|
|
17639
|
-
var antennaShape =
|
|
17697
|
+
var antennaShape = z76.enum(antennaShapes);
|
|
17640
17698
|
var antennaFrequencyBands = [
|
|
17641
17699
|
"2.4ghz",
|
|
17642
17700
|
"5ghz",
|
|
@@ -17644,7 +17702,7 @@ var antennaFrequencyBands = [
|
|
|
17644
17702
|
"dual_band_2.4ghz_5ghz",
|
|
17645
17703
|
"tri_band_2.4ghz_5ghz_6ghz"
|
|
17646
17704
|
];
|
|
17647
|
-
var antennaFrequencyBand =
|
|
17705
|
+
var antennaFrequencyBand = z76.enum(antennaFrequencyBands);
|
|
17648
17706
|
var antennaProps = commonComponentProps.extend({
|
|
17649
17707
|
antennaShape: antennaShape.optional(),
|
|
17650
17708
|
frequencyBand: antennaFrequencyBand.optional(),
|
|
@@ -17654,36 +17712,36 @@ expectTypesMatch(true);
|
|
|
17654
17712
|
|
|
17655
17713
|
// lib/components/trace.ts
|
|
17656
17714
|
import { distance as distance19, route_hint_point as route_hint_point2 } from "circuit-json";
|
|
17657
|
-
import { z as
|
|
17658
|
-
var portRef =
|
|
17659
|
-
|
|
17660
|
-
|
|
17715
|
+
import { z as z77 } from "zod";
|
|
17716
|
+
var portRef = z77.union([
|
|
17717
|
+
z77.string(),
|
|
17718
|
+
z77.custom(
|
|
17661
17719
|
(v) => typeof v === "object" && v !== null && "getPortSelector" in v && typeof v.getPortSelector === "function"
|
|
17662
17720
|
)
|
|
17663
17721
|
]);
|
|
17664
|
-
var baseTraceProps =
|
|
17665
|
-
key:
|
|
17666
|
-
name:
|
|
17667
|
-
displayName:
|
|
17722
|
+
var baseTraceProps = z77.object({
|
|
17723
|
+
key: z77.string().optional(),
|
|
17724
|
+
name: z77.string().optional(),
|
|
17725
|
+
displayName: z77.string().optional(),
|
|
17668
17726
|
thickness: distance19.optional(),
|
|
17669
17727
|
width: distance19.optional().describe("Alias for trace thickness"),
|
|
17670
|
-
schematicRouteHints:
|
|
17671
|
-
pcbRouteHints:
|
|
17672
|
-
pcbPathRelativeTo:
|
|
17728
|
+
schematicRouteHints: z77.array(point).optional(),
|
|
17729
|
+
pcbRouteHints: z77.array(route_hint_point2).optional(),
|
|
17730
|
+
pcbPathRelativeTo: z77.string().optional(),
|
|
17673
17731
|
pcbPath: pcbPath.optional(),
|
|
17674
|
-
pcbPaths:
|
|
17675
|
-
routingPhaseIndex:
|
|
17676
|
-
pcbStraightLine:
|
|
17677
|
-
schDisplayLabel:
|
|
17678
|
-
schStroke:
|
|
17679
|
-
highlightColor:
|
|
17732
|
+
pcbPaths: z77.array(pcbPath).optional(),
|
|
17733
|
+
routingPhaseIndex: z77.number().nullable().optional(),
|
|
17734
|
+
pcbStraightLine: z77.boolean().optional().describe("Draw a straight pcb trace between the connected points"),
|
|
17735
|
+
schDisplayLabel: z77.string().optional(),
|
|
17736
|
+
schStroke: z77.string().optional(),
|
|
17737
|
+
highlightColor: z77.string().optional(),
|
|
17680
17738
|
maxLength: distance19.optional(),
|
|
17681
|
-
maxViaCount:
|
|
17682
|
-
connectsTo:
|
|
17739
|
+
maxViaCount: z77.number().int().nonnegative().optional().describe("Maximum number of vias allowed in the PCB trace route"),
|
|
17740
|
+
connectsTo: z77.string().or(z77.array(z77.string())).optional()
|
|
17683
17741
|
});
|
|
17684
|
-
var traceProps =
|
|
17742
|
+
var traceProps = z77.union([
|
|
17685
17743
|
baseTraceProps.extend({
|
|
17686
|
-
path:
|
|
17744
|
+
path: z77.array(portRef)
|
|
17687
17745
|
}),
|
|
17688
17746
|
baseTraceProps.extend({
|
|
17689
17747
|
from: portRef,
|
|
@@ -17701,31 +17759,31 @@ import {
|
|
|
17701
17759
|
layer_ref as layer_ref7,
|
|
17702
17760
|
resistance as resistance3
|
|
17703
17761
|
} from "circuit-json";
|
|
17704
|
-
import { z as
|
|
17705
|
-
var busProps =
|
|
17706
|
-
name:
|
|
17707
|
-
connections:
|
|
17708
|
-
routingPhaseIndex:
|
|
17709
|
-
maxLengthSkew: distance20.pipe(
|
|
17710
|
-
targetImpedance: resistance3.pipe(
|
|
17711
|
-
pcbTraceWidth: distance20.pipe(
|
|
17712
|
-
pcbAllowedLayers:
|
|
17762
|
+
import { z as z78 } from "zod";
|
|
17763
|
+
var busProps = z78.object({
|
|
17764
|
+
name: z78.string().optional(),
|
|
17765
|
+
connections: z78.array(z78.string()).min(1),
|
|
17766
|
+
routingPhaseIndex: z78.number().nullable().optional(),
|
|
17767
|
+
maxLengthSkew: distance20.pipe(z78.number().min(0).finite()).optional(),
|
|
17768
|
+
targetImpedance: resistance3.pipe(z78.number().positive().finite()).optional(),
|
|
17769
|
+
pcbTraceWidth: distance20.pipe(z78.number().positive().finite()).optional(),
|
|
17770
|
+
pcbAllowedLayers: z78.array(layer_ref7).min(1).optional(),
|
|
17713
17771
|
preferredLayer: layer_ref7.optional(),
|
|
17714
|
-
preferredLayers:
|
|
17772
|
+
preferredLayers: z78.array(layer_ref7).min(1).optional()
|
|
17715
17773
|
});
|
|
17716
17774
|
expectTypesMatch(true);
|
|
17717
17775
|
|
|
17718
17776
|
// lib/components/differentialpair.ts
|
|
17719
17777
|
import { distance as distance21, resistance as resistance4 } from "circuit-json";
|
|
17720
|
-
import { z as
|
|
17721
|
-
var differentialPairProps =
|
|
17722
|
-
name:
|
|
17723
|
-
positiveConnection:
|
|
17724
|
-
negativeConnection:
|
|
17725
|
-
maxLengthSkew: distance21.pipe(
|
|
17726
|
-
targetDifferentialImpedance: resistance4.pipe(
|
|
17727
|
-
pcbTraceGap: distance21.pipe(
|
|
17728
|
-
maxUncoupledLength: distance21.pipe(
|
|
17778
|
+
import { z as z79 } from "zod";
|
|
17779
|
+
var differentialPairProps = z79.object({
|
|
17780
|
+
name: z79.string().optional(),
|
|
17781
|
+
positiveConnection: z79.string(),
|
|
17782
|
+
negativeConnection: z79.string(),
|
|
17783
|
+
maxLengthSkew: distance21.pipe(z79.number().min(0).finite()).optional(),
|
|
17784
|
+
targetDifferentialImpedance: resistance4.pipe(z79.number().positive().finite()).optional(),
|
|
17785
|
+
pcbTraceGap: distance21.pipe(z79.number().positive().finite()).optional(),
|
|
17786
|
+
maxUncoupledLength: distance21.pipe(z79.number().min(0).finite()).optional()
|
|
17729
17787
|
});
|
|
17730
17788
|
expectTypesMatch(true);
|
|
17731
17789
|
|
|
@@ -17733,8 +17791,8 @@ expectTypesMatch(true);
|
|
|
17733
17791
|
import {
|
|
17734
17792
|
layer_ref as layer_ref8
|
|
17735
17793
|
} from "circuit-json";
|
|
17736
|
-
import { z as
|
|
17737
|
-
var footprintInsertionDirection =
|
|
17794
|
+
import { z as z80 } from "zod";
|
|
17795
|
+
var footprintInsertionDirection = z80.enum([
|
|
17738
17796
|
"from_left",
|
|
17739
17797
|
"from_right",
|
|
17740
17798
|
"from_top",
|
|
@@ -17752,11 +17810,11 @@ var footprintInsertionDirection = z78.enum([
|
|
|
17752
17810
|
"from_back"
|
|
17753
17811
|
]);
|
|
17754
17812
|
expectTypesMatch(true);
|
|
17755
|
-
var footprintProps =
|
|
17756
|
-
children:
|
|
17757
|
-
name:
|
|
17813
|
+
var footprintProps = z80.object({
|
|
17814
|
+
children: z80.any().optional(),
|
|
17815
|
+
name: z80.string().optional(),
|
|
17758
17816
|
originalLayer: layer_ref8.default("top").optional(),
|
|
17759
|
-
circuitJson:
|
|
17817
|
+
circuitJson: z80.array(z80.any()).optional(),
|
|
17760
17818
|
src: footprintProp.describe("Can be a footprint or kicad string").optional(),
|
|
17761
17819
|
insertionDirection: footprintInsertionDirection.optional().describe(
|
|
17762
17820
|
"Direction a cable or mating part is attached from, named for the side of the footprint it approaches from, in its unrotated orientation."
|
|
@@ -17768,19 +17826,19 @@ var footprintProps = z78.object({
|
|
|
17768
17826
|
expectTypesMatch(true);
|
|
17769
17827
|
|
|
17770
17828
|
// lib/components/symbol.ts
|
|
17771
|
-
import { z as
|
|
17772
|
-
var symbolProps =
|
|
17773
|
-
originalFacingDirection:
|
|
17829
|
+
import { z as z81 } from "zod";
|
|
17830
|
+
var symbolProps = z81.object({
|
|
17831
|
+
originalFacingDirection: z81.enum(["up", "down", "left", "right"]).default("right").optional(),
|
|
17774
17832
|
width: distance.optional(),
|
|
17775
17833
|
height: distance.optional(),
|
|
17776
|
-
name:
|
|
17834
|
+
name: z81.string().optional()
|
|
17777
17835
|
});
|
|
17778
17836
|
expectTypesMatch(true);
|
|
17779
17837
|
|
|
17780
17838
|
// lib/components/battery.ts
|
|
17781
17839
|
import { voltage as voltage2 } from "circuit-json";
|
|
17782
|
-
import { z as
|
|
17783
|
-
var capacity =
|
|
17840
|
+
import { z as z82 } from "zod";
|
|
17841
|
+
var capacity = z82.number().or(z82.string().endsWith("mAh")).transform((v) => {
|
|
17784
17842
|
if (typeof v === "string") {
|
|
17785
17843
|
const valString = v.replace("mAh", "");
|
|
17786
17844
|
const num = Number.parseFloat(valString);
|
|
@@ -17795,14 +17853,14 @@ var batteryPins = lrPolarPins;
|
|
|
17795
17853
|
var batteryProps = commonComponentProps.extend({
|
|
17796
17854
|
capacity: capacity.optional(),
|
|
17797
17855
|
voltage: voltage2.optional(),
|
|
17798
|
-
standard:
|
|
17856
|
+
standard: z82.enum(["AA", "AAA", "9V", "CR2032", "18650", "C"]).optional(),
|
|
17799
17857
|
schOrientation: schematicOrientation.optional(),
|
|
17800
17858
|
connections: createConnectionsProp(batteryPins).optional()
|
|
17801
17859
|
});
|
|
17802
17860
|
expectTypesMatch(true);
|
|
17803
17861
|
|
|
17804
17862
|
// lib/components/mountedboard.ts
|
|
17805
|
-
import { z as
|
|
17863
|
+
import { z as z83 } from "zod";
|
|
17806
17864
|
var mountedboardProps = subcircuitGroupProps.extend({
|
|
17807
17865
|
manufacturerPartNumber: chipProps.shape.manufacturerPartNumber,
|
|
17808
17866
|
pinLabels: chipProps.shape.pinLabels,
|
|
@@ -17814,7 +17872,7 @@ var mountedboardProps = subcircuitGroupProps.extend({
|
|
|
17814
17872
|
internallyConnectedPins: chipProps.shape.internallyConnectedPins,
|
|
17815
17873
|
externallyConnectedPins: chipProps.shape.externallyConnectedPins,
|
|
17816
17874
|
boardToBoardDistance: distance.optional(),
|
|
17817
|
-
mountOrientation:
|
|
17875
|
+
mountOrientation: z83.enum(["faceDown", "faceUp"]).optional()
|
|
17818
17876
|
});
|
|
17819
17877
|
expectTypesMatch(true);
|
|
17820
17878
|
|
|
@@ -17822,40 +17880,40 @@ expectTypesMatch(true);
|
|
|
17822
17880
|
import { distance as distance22 } from "circuit-json";
|
|
17823
17881
|
|
|
17824
17882
|
// lib/common/pcbOrientation.ts
|
|
17825
|
-
import { z as
|
|
17826
|
-
var pcbOrientation =
|
|
17883
|
+
import { z as z84 } from "zod";
|
|
17884
|
+
var pcbOrientation = z84.enum(["vertical", "horizontal"]).describe(
|
|
17827
17885
|
"vertical means pins go 1->2 downward and horizontal means pins go 1->2 rightward"
|
|
17828
17886
|
);
|
|
17829
17887
|
expectTypesMatch(true);
|
|
17830
17888
|
|
|
17831
17889
|
// lib/components/pin-header.ts
|
|
17832
|
-
import { z as
|
|
17890
|
+
import { z as z85 } from "zod";
|
|
17833
17891
|
var pinHeaderProps = commonComponentProps.extend({
|
|
17834
|
-
pinCount:
|
|
17892
|
+
pinCount: z85.number(),
|
|
17835
17893
|
pitch: distance22.optional(),
|
|
17836
|
-
schFacingDirection:
|
|
17837
|
-
gender:
|
|
17838
|
-
showSilkscreenPinLabels:
|
|
17839
|
-
pcbPinLabels:
|
|
17840
|
-
doubleRow:
|
|
17841
|
-
rightAngle:
|
|
17894
|
+
schFacingDirection: z85.enum(["up", "down", "left", "right"]).optional(),
|
|
17895
|
+
gender: z85.enum(["male", "female", "unpopulated"]).optional().default("male"),
|
|
17896
|
+
showSilkscreenPinLabels: z85.boolean().optional(),
|
|
17897
|
+
pcbPinLabels: z85.record(z85.string(), z85.string()).optional(),
|
|
17898
|
+
doubleRow: z85.boolean().optional(),
|
|
17899
|
+
rightAngle: z85.boolean().optional(),
|
|
17842
17900
|
pcbOrientation: pcbOrientation.optional(),
|
|
17843
17901
|
holeDiameter: distance22.optional(),
|
|
17844
17902
|
platedDiameter: distance22.optional(),
|
|
17845
|
-
pinLabels:
|
|
17846
|
-
connections:
|
|
17847
|
-
facingDirection:
|
|
17903
|
+
pinLabels: z85.record(z85.string(), schematicPinLabel).or(z85.array(schematicPinLabel)).optional(),
|
|
17904
|
+
connections: z85.custom().pipe(z85.record(z85.string(), connectionTarget)).optional(),
|
|
17905
|
+
facingDirection: z85.enum(["left", "right"]).optional(),
|
|
17848
17906
|
schPinArrangement: schematicPinArrangement.optional(),
|
|
17849
17907
|
schPinStyle: schematicPinStyle.optional(),
|
|
17850
17908
|
schPinSpacing: distance22.optional(),
|
|
17851
17909
|
schWidth: distance22.optional(),
|
|
17852
17910
|
schHeight: distance22.optional(),
|
|
17853
|
-
connectsFromAbove:
|
|
17854
|
-
connectsFromBelow:
|
|
17911
|
+
connectsFromAbove: z85.boolean().optional(),
|
|
17912
|
+
connectsFromBelow: z85.boolean().optional()
|
|
17855
17913
|
}).superRefine((props, ctx) => {
|
|
17856
17914
|
if (props.connectsFromAbove && props.connectsFromBelow) {
|
|
17857
17915
|
ctx.addIssue({
|
|
17858
|
-
code:
|
|
17916
|
+
code: z85.ZodIssueCode.custom,
|
|
17859
17917
|
message: "connectsFromAbove and connectsFromBelow are opposites; set at most one"
|
|
17860
17918
|
});
|
|
17861
17919
|
}
|
|
@@ -17866,30 +17924,30 @@ var pinHeaderProps = commonComponentProps.extend({
|
|
|
17866
17924
|
expectTypesMatch(true);
|
|
17867
17925
|
|
|
17868
17926
|
// lib/components/netalias.ts
|
|
17869
|
-
import { z as
|
|
17870
|
-
import { rotation as
|
|
17871
|
-
var netAliasProps =
|
|
17872
|
-
net:
|
|
17873
|
-
connection:
|
|
17927
|
+
import { z as z86 } from "zod";
|
|
17928
|
+
import { rotation as rotation4 } from "circuit-json";
|
|
17929
|
+
var netAliasProps = z86.object({
|
|
17930
|
+
net: z86.string().optional(),
|
|
17931
|
+
connection: z86.string().optional(),
|
|
17874
17932
|
schX: distance.optional(),
|
|
17875
17933
|
schY: distance.optional(),
|
|
17876
|
-
schRotation:
|
|
17877
|
-
anchorSide:
|
|
17934
|
+
schRotation: rotation4.optional(),
|
|
17935
|
+
anchorSide: z86.enum(["left", "top", "right", "bottom"]).optional()
|
|
17878
17936
|
});
|
|
17879
17937
|
expectTypesMatch(true);
|
|
17880
17938
|
|
|
17881
17939
|
// lib/components/netlabel.ts
|
|
17882
|
-
import { z as
|
|
17883
|
-
import { rotation as
|
|
17884
|
-
var netLabelProps =
|
|
17885
|
-
net:
|
|
17886
|
-
connection:
|
|
17887
|
-
connectsTo:
|
|
17888
|
-
inline:
|
|
17940
|
+
import { z as z87 } from "zod";
|
|
17941
|
+
import { rotation as rotation5 } from "circuit-json";
|
|
17942
|
+
var netLabelProps = z87.object({
|
|
17943
|
+
net: z87.string().optional(),
|
|
17944
|
+
connection: z87.string().optional(),
|
|
17945
|
+
connectsTo: z87.string().or(z87.array(z87.string())).optional(),
|
|
17946
|
+
inline: z87.boolean().optional(),
|
|
17889
17947
|
schX: distance.optional(),
|
|
17890
17948
|
schY: distance.optional(),
|
|
17891
|
-
schRotation:
|
|
17892
|
-
anchorSide:
|
|
17949
|
+
schRotation: rotation5.optional(),
|
|
17950
|
+
anchorSide: z87.enum(["left", "top", "right", "bottom"]).optional()
|
|
17893
17951
|
});
|
|
17894
17952
|
expectTypesMatch(true);
|
|
17895
17953
|
|
|
@@ -17904,32 +17962,32 @@ expectTypesMatch(true);
|
|
|
17904
17962
|
|
|
17905
17963
|
// lib/components/analogsimulation.ts
|
|
17906
17964
|
import { ms } from "circuit-json";
|
|
17907
|
-
import { z as
|
|
17908
|
-
var spiceEngine =
|
|
17965
|
+
import { z as z89 } from "zod";
|
|
17966
|
+
var spiceEngine = z89.custom(
|
|
17909
17967
|
(value) => typeof value === "string"
|
|
17910
17968
|
);
|
|
17911
|
-
var spiceOptions =
|
|
17912
|
-
method:
|
|
17913
|
-
reltol:
|
|
17914
|
-
abstol:
|
|
17915
|
-
vntol:
|
|
17969
|
+
var spiceOptions = z89.object({
|
|
17970
|
+
method: z89.enum(["trap", "gear"]).optional(),
|
|
17971
|
+
reltol: z89.union([z89.number(), z89.string()]).optional(),
|
|
17972
|
+
abstol: z89.union([z89.number(), z89.string()]).optional(),
|
|
17973
|
+
vntol: z89.union([z89.number(), z89.string()]).optional()
|
|
17916
17974
|
});
|
|
17917
17975
|
var analogAnalysisSimulationBaseProps = {
|
|
17918
|
-
name:
|
|
17976
|
+
name: z89.string().optional(),
|
|
17919
17977
|
spiceEngine: spiceEngine.optional(),
|
|
17920
17978
|
spiceOptions: spiceOptions.optional(),
|
|
17921
|
-
graphIndependentAxes:
|
|
17922
|
-
children:
|
|
17979
|
+
graphIndependentAxes: z89.boolean().optional(),
|
|
17980
|
+
children: z89.custom().optional()
|
|
17923
17981
|
};
|
|
17924
|
-
var analogSimulationProps =
|
|
17925
|
-
name:
|
|
17926
|
-
simulationType:
|
|
17982
|
+
var analogSimulationProps = z89.object({
|
|
17983
|
+
name: z89.string().optional(),
|
|
17984
|
+
simulationType: z89.literal("spice_transient_analysis").default("spice_transient_analysis"),
|
|
17927
17985
|
duration: ms.optional(),
|
|
17928
17986
|
startTime: ms.optional(),
|
|
17929
17987
|
timePerStep: ms.optional(),
|
|
17930
17988
|
spiceEngine: spiceEngine.optional(),
|
|
17931
17989
|
spiceOptions: spiceOptions.optional(),
|
|
17932
|
-
graphIndependentAxes:
|
|
17990
|
+
graphIndependentAxes: z89.boolean().optional()
|
|
17933
17991
|
});
|
|
17934
17992
|
expectTypesMatch(
|
|
17935
17993
|
true
|
|
@@ -17937,12 +17995,12 @@ expectTypesMatch(
|
|
|
17937
17995
|
|
|
17938
17996
|
// lib/components/analogtransientsimulation.ts
|
|
17939
17997
|
import { ms as ms2 } from "circuit-json";
|
|
17940
|
-
import { z as
|
|
17998
|
+
import { z as z90 } from "zod";
|
|
17941
17999
|
var positiveMilliseconds = ms2.refine(
|
|
17942
18000
|
(milliseconds) => milliseconds > 0,
|
|
17943
18001
|
"Time must be positive"
|
|
17944
18002
|
);
|
|
17945
|
-
var analogTransientSimulationProps =
|
|
18003
|
+
var analogTransientSimulationProps = z90.object({
|
|
17946
18004
|
...analogAnalysisSimulationBaseProps,
|
|
17947
18005
|
duration: positiveMilliseconds.default("10ms"),
|
|
17948
18006
|
startTime: ms2.default("0ms"),
|
|
@@ -17950,7 +18008,7 @@ var analogTransientSimulationProps = z88.object({
|
|
|
17950
18008
|
}).superRefine((simulation, context) => {
|
|
17951
18009
|
if (simulation.startTime < 0 || simulation.startTime > simulation.duration) {
|
|
17952
18010
|
context.addIssue({
|
|
17953
|
-
code:
|
|
18011
|
+
code: z90.ZodIssueCode.custom,
|
|
17954
18012
|
path: ["startTime"],
|
|
17955
18013
|
message: "startTime must be between zero and duration"
|
|
17956
18014
|
});
|
|
@@ -17959,19 +18017,19 @@ var analogTransientSimulationProps = z88.object({
|
|
|
17959
18017
|
expectTypesMatch(true);
|
|
17960
18018
|
|
|
17961
18019
|
// lib/components/analogdcoperatingpointsimulation.ts
|
|
17962
|
-
import { z as
|
|
17963
|
-
var analogDcOperatingPointSimulationProps =
|
|
18020
|
+
import { z as z91 } from "zod";
|
|
18021
|
+
var analogDcOperatingPointSimulationProps = z91.object({
|
|
17964
18022
|
...analogAnalysisSimulationBaseProps
|
|
17965
18023
|
});
|
|
17966
18024
|
expectTypesMatch(true);
|
|
17967
18025
|
|
|
17968
18026
|
// lib/components/analogdcsweepsimulation.ts
|
|
17969
18027
|
import { current, voltage as voltage3 } from "circuit-json";
|
|
17970
|
-
import { z as
|
|
17971
|
-
var dcSweepQuantity =
|
|
17972
|
-
var analogDcSweepSimulationProps =
|
|
18028
|
+
import { z as z92 } from "zod";
|
|
18029
|
+
var dcSweepQuantity = z92.union([voltage3, current]);
|
|
18030
|
+
var analogDcSweepSimulationProps = z92.object({
|
|
17973
18031
|
...analogAnalysisSimulationBaseProps,
|
|
17974
|
-
sweepSource:
|
|
18032
|
+
sweepSource: z92.string().min(1),
|
|
17975
18033
|
sweepStart: dcSweepQuantity,
|
|
17976
18034
|
sweepStop: dcSweepQuantity,
|
|
17977
18035
|
sweepStep: dcSweepQuantity.refine(
|
|
@@ -17981,7 +18039,7 @@ var analogDcSweepSimulationProps = z90.object({
|
|
|
17981
18039
|
}).superRefine((simulation, context) => {
|
|
17982
18040
|
if (Math.sign(simulation.sweepStop - simulation.sweepStart) !== Math.sign(simulation.sweepStep)) {
|
|
17983
18041
|
context.addIssue({
|
|
17984
|
-
code:
|
|
18042
|
+
code: z92.ZodIssueCode.custom,
|
|
17985
18043
|
path: ["sweepStep"],
|
|
17986
18044
|
message: "sweepStep must move from sweepStart toward sweepStop"
|
|
17987
18045
|
});
|
|
@@ -17991,10 +18049,10 @@ expectTypesMatch(true);
|
|
|
17991
18049
|
|
|
17992
18050
|
// lib/components/analogacsweepsimulation.ts
|
|
17993
18051
|
import { frequency as frequency3 } from "circuit-json";
|
|
17994
|
-
import { z as
|
|
17995
|
-
var analogAcSweepSimulationProps =
|
|
18052
|
+
import { z as z93 } from "zod";
|
|
18053
|
+
var analogAcSweepSimulationProps = z93.object({
|
|
17996
18054
|
...analogAnalysisSimulationBaseProps,
|
|
17997
|
-
sweepType:
|
|
18055
|
+
sweepType: z93.enum(["linear", "decade", "octave"]),
|
|
17998
18056
|
startFrequency: frequency3.refine(
|
|
17999
18057
|
(startFrequencyHz) => startFrequencyHz > 0,
|
|
18000
18058
|
"startFrequency must be positive"
|
|
@@ -18003,12 +18061,12 @@ var analogAcSweepSimulationProps = z91.object({
|
|
|
18003
18061
|
(stopFrequencyHz) => stopFrequencyHz > 0,
|
|
18004
18062
|
"stopFrequency must be positive"
|
|
18005
18063
|
),
|
|
18006
|
-
samplesPerInterval:
|
|
18007
|
-
sampleCount:
|
|
18064
|
+
samplesPerInterval: z93.number().int().positive().optional(),
|
|
18065
|
+
sampleCount: z93.number().int().positive().optional()
|
|
18008
18066
|
}).superRefine((simulation, context) => {
|
|
18009
18067
|
if (simulation.stopFrequency <= simulation.startFrequency) {
|
|
18010
18068
|
context.addIssue({
|
|
18011
|
-
code:
|
|
18069
|
+
code: z93.ZodIssueCode.custom,
|
|
18012
18070
|
path: ["stopFrequency"],
|
|
18013
18071
|
message: "stopFrequency must be greater than startFrequency"
|
|
18014
18072
|
});
|
|
@@ -18016,14 +18074,14 @@ var analogAcSweepSimulationProps = z91.object({
|
|
|
18016
18074
|
if (simulation.sweepType === "linear") {
|
|
18017
18075
|
if (simulation.sampleCount === void 0) {
|
|
18018
18076
|
context.addIssue({
|
|
18019
|
-
code:
|
|
18077
|
+
code: z93.ZodIssueCode.custom,
|
|
18020
18078
|
path: ["sampleCount"],
|
|
18021
18079
|
message: "sampleCount is required for a linear AC sweep"
|
|
18022
18080
|
});
|
|
18023
18081
|
}
|
|
18024
18082
|
if (simulation.samplesPerInterval !== void 0) {
|
|
18025
18083
|
context.addIssue({
|
|
18026
|
-
code:
|
|
18084
|
+
code: z93.ZodIssueCode.custom,
|
|
18027
18085
|
path: ["samplesPerInterval"],
|
|
18028
18086
|
message: "samplesPerInterval is only valid for decade or octave sweeps"
|
|
18029
18087
|
});
|
|
@@ -18032,14 +18090,14 @@ var analogAcSweepSimulationProps = z91.object({
|
|
|
18032
18090
|
}
|
|
18033
18091
|
if (simulation.samplesPerInterval === void 0) {
|
|
18034
18092
|
context.addIssue({
|
|
18035
|
-
code:
|
|
18093
|
+
code: z93.ZodIssueCode.custom,
|
|
18036
18094
|
path: ["samplesPerInterval"],
|
|
18037
18095
|
message: "samplesPerInterval is required for decade or octave sweeps"
|
|
18038
18096
|
});
|
|
18039
18097
|
}
|
|
18040
18098
|
if (simulation.sampleCount !== void 0) {
|
|
18041
18099
|
context.addIssue({
|
|
18042
|
-
code:
|
|
18100
|
+
code: z93.ZodIssueCode.custom,
|
|
18043
18101
|
path: ["sampleCount"],
|
|
18044
18102
|
message: "sampleCount is only valid for a linear sweep"
|
|
18045
18103
|
});
|
|
@@ -18055,43 +18113,43 @@ import {
|
|
|
18055
18113
|
resistance as resistance5,
|
|
18056
18114
|
voltage as voltage4
|
|
18057
18115
|
} from "circuit-json";
|
|
18058
|
-
import { z as
|
|
18059
|
-
var resistanceSweepQuantity = resistance5.pipe(
|
|
18060
|
-
var capacitanceSweepQuantity = capacitance4.pipe(
|
|
18061
|
-
var inductanceSweepQuantity = inductance.pipe(
|
|
18062
|
-
var voltageSweepQuantity = voltage4.pipe(
|
|
18063
|
-
var currentSweepQuantity = current2.pipe(
|
|
18116
|
+
import { z as z94 } from "zod";
|
|
18117
|
+
var resistanceSweepQuantity = resistance5.pipe(z94.number());
|
|
18118
|
+
var capacitanceSweepQuantity = capacitance4.pipe(z94.number());
|
|
18119
|
+
var inductanceSweepQuantity = inductance.pipe(z94.number());
|
|
18120
|
+
var voltageSweepQuantity = voltage4.pipe(z94.number());
|
|
18121
|
+
var currentSweepQuantity = current2.pipe(z94.number());
|
|
18064
18122
|
var createAnalogSweepCoordinateProps = (sweepQuantity) => ({
|
|
18065
|
-
name:
|
|
18066
|
-
values:
|
|
18123
|
+
name: z94.string().optional(),
|
|
18124
|
+
values: z94.array(sweepQuantity).min(1).optional(),
|
|
18067
18125
|
start: sweepQuantity.optional(),
|
|
18068
18126
|
stop: sweepQuantity.optional(),
|
|
18069
18127
|
step: sweepQuantity.optional()
|
|
18070
18128
|
});
|
|
18071
|
-
var analogResistanceSweepParameterProps =
|
|
18129
|
+
var analogResistanceSweepParameterProps = z94.object({
|
|
18072
18130
|
...createAnalogSweepCoordinateProps(resistanceSweepQuantity),
|
|
18073
|
-
parameterType:
|
|
18074
|
-
resistorRef:
|
|
18131
|
+
parameterType: z94.literal("resistance"),
|
|
18132
|
+
resistorRef: z94.string().min(1)
|
|
18075
18133
|
}).strict();
|
|
18076
|
-
var analogCapacitanceSweepParameterProps =
|
|
18134
|
+
var analogCapacitanceSweepParameterProps = z94.object({
|
|
18077
18135
|
...createAnalogSweepCoordinateProps(capacitanceSweepQuantity),
|
|
18078
|
-
parameterType:
|
|
18079
|
-
capacitorRef:
|
|
18136
|
+
parameterType: z94.literal("capacitance"),
|
|
18137
|
+
capacitorRef: z94.string().min(1)
|
|
18080
18138
|
}).strict();
|
|
18081
|
-
var analogInductanceSweepParameterProps =
|
|
18139
|
+
var analogInductanceSweepParameterProps = z94.object({
|
|
18082
18140
|
...createAnalogSweepCoordinateProps(inductanceSweepQuantity),
|
|
18083
|
-
parameterType:
|
|
18084
|
-
inductorRef:
|
|
18141
|
+
parameterType: z94.literal("inductance"),
|
|
18142
|
+
inductorRef: z94.string().min(1)
|
|
18085
18143
|
}).strict();
|
|
18086
|
-
var analogVoltageSweepParameterProps =
|
|
18144
|
+
var analogVoltageSweepParameterProps = z94.object({
|
|
18087
18145
|
...createAnalogSweepCoordinateProps(voltageSweepQuantity),
|
|
18088
|
-
parameterType:
|
|
18089
|
-
net:
|
|
18146
|
+
parameterType: z94.literal("voltage"),
|
|
18147
|
+
net: z94.string().min(1)
|
|
18090
18148
|
}).strict();
|
|
18091
|
-
var analogCurrentSweepParameterProps =
|
|
18149
|
+
var analogCurrentSweepParameterProps = z94.object({
|
|
18092
18150
|
...createAnalogSweepCoordinateProps(currentSweepQuantity),
|
|
18093
|
-
parameterType:
|
|
18094
|
-
currentSourceRef:
|
|
18151
|
+
parameterType: z94.literal("current"),
|
|
18152
|
+
currentSourceRef: z94.string().min(1)
|
|
18095
18153
|
}).strict();
|
|
18096
18154
|
var validateAnalogSweepCoordinates = (sweepCoordinates, context) => {
|
|
18097
18155
|
const hasExplicitSweepCoordinates = sweepCoordinates.values !== void 0;
|
|
@@ -18103,34 +18161,34 @@ var validateAnalogSweepCoordinates = (sweepCoordinates, context) => {
|
|
|
18103
18161
|
const hasRangeCoordinates = rangeCoordinateCount > 0;
|
|
18104
18162
|
if (hasExplicitSweepCoordinates === hasRangeCoordinates) {
|
|
18105
18163
|
context.addIssue({
|
|
18106
|
-
code:
|
|
18164
|
+
code: z94.ZodIssueCode.custom,
|
|
18107
18165
|
message: "Provide either values or start/stop/step"
|
|
18108
18166
|
});
|
|
18109
18167
|
return;
|
|
18110
18168
|
}
|
|
18111
18169
|
if (rangeCoordinateCount !== 0 && rangeCoordinateCount !== 3) {
|
|
18112
18170
|
context.addIssue({
|
|
18113
|
-
code:
|
|
18171
|
+
code: z94.ZodIssueCode.custom,
|
|
18114
18172
|
message: "start, stop, and step must be provided together"
|
|
18115
18173
|
});
|
|
18116
18174
|
return;
|
|
18117
18175
|
}
|
|
18118
18176
|
if (sweepCoordinates.step === 0) {
|
|
18119
18177
|
context.addIssue({
|
|
18120
|
-
code:
|
|
18178
|
+
code: z94.ZodIssueCode.custom,
|
|
18121
18179
|
path: ["step"],
|
|
18122
18180
|
message: "step must be nonzero"
|
|
18123
18181
|
});
|
|
18124
18182
|
}
|
|
18125
18183
|
if (sweepCoordinates.start !== void 0 && sweepCoordinates.stop !== void 0 && sweepCoordinates.step !== void 0 && Math.sign(sweepCoordinates.stop - sweepCoordinates.start) !== Math.sign(sweepCoordinates.step)) {
|
|
18126
18184
|
context.addIssue({
|
|
18127
|
-
code:
|
|
18185
|
+
code: z94.ZodIssueCode.custom,
|
|
18128
18186
|
path: ["step"],
|
|
18129
18187
|
message: "step must move from start toward stop"
|
|
18130
18188
|
});
|
|
18131
18189
|
}
|
|
18132
18190
|
};
|
|
18133
|
-
var analogSweepParameterProps =
|
|
18191
|
+
var analogSweepParameterProps = z94.discriminatedUnion("parameterType", [
|
|
18134
18192
|
analogResistanceSweepParameterProps,
|
|
18135
18193
|
analogCapacitanceSweepParameterProps,
|
|
18136
18194
|
analogInductanceSweepParameterProps,
|
|
@@ -18145,26 +18203,26 @@ expectTypesMatch(true);
|
|
|
18145
18203
|
expectTypesMatch(true);
|
|
18146
18204
|
|
|
18147
18205
|
// lib/components/autoroutingphase.ts
|
|
18148
|
-
import { z as
|
|
18149
|
-
var autoroutingPhaseProps =
|
|
18150
|
-
key:
|
|
18151
|
-
name:
|
|
18206
|
+
import { z as z95 } from "zod";
|
|
18207
|
+
var autoroutingPhaseProps = z95.object({
|
|
18208
|
+
key: z95.any().optional(),
|
|
18209
|
+
name: z95.string().optional(),
|
|
18152
18210
|
autorouter: autorouterProp.optional(),
|
|
18153
18211
|
algorithmFn: autorouterConfig.shape.algorithmFn,
|
|
18154
18212
|
preflightRoutingCheckPolicy: preflightRoutingCheckPolicy.optional(),
|
|
18155
|
-
phaseIndex:
|
|
18156
|
-
pcbTracePaths:
|
|
18213
|
+
phaseIndex: z95.number().optional(),
|
|
18214
|
+
pcbTracePaths: z95.array(fanoutTracePath).optional(),
|
|
18157
18215
|
...routingTolerances.shape,
|
|
18158
|
-
region:
|
|
18159
|
-
shape:
|
|
18160
|
-
minX:
|
|
18161
|
-
maxX:
|
|
18162
|
-
minY:
|
|
18163
|
-
maxY:
|
|
18216
|
+
region: z95.object({
|
|
18217
|
+
shape: z95.literal("rect").optional(),
|
|
18218
|
+
minX: z95.number(),
|
|
18219
|
+
maxX: z95.number(),
|
|
18220
|
+
minY: z95.number(),
|
|
18221
|
+
maxY: z95.number()
|
|
18164
18222
|
}).optional(),
|
|
18165
|
-
connection:
|
|
18166
|
-
connections:
|
|
18167
|
-
reroute:
|
|
18223
|
+
connection: z95.string().optional(),
|
|
18224
|
+
connections: z95.array(z95.string()).optional(),
|
|
18225
|
+
reroute: z95.boolean().optional(),
|
|
18168
18226
|
...fanoutProps.shape
|
|
18169
18227
|
}).superRefine((value, ctx) => {
|
|
18170
18228
|
const isSimplifyAutorouter = value.autorouter === "simplify" || typeof value.autorouter === "object" && value.autorouter?.preset === "simplify";
|
|
@@ -18175,7 +18233,7 @@ var autoroutingPhaseProps = z93.object({
|
|
|
18175
18233
|
}
|
|
18176
18234
|
if (value.reroute !== void 0 && !(isSimplifyAutorouter && value.reroute === true) && value.region === void 0 && value.connection === void 0 && value.connections === void 0) {
|
|
18177
18235
|
ctx.addIssue({
|
|
18178
|
-
code:
|
|
18236
|
+
code: z95.ZodIssueCode.custom,
|
|
18179
18237
|
message: "region, connection, or connections is required when reroute is provided",
|
|
18180
18238
|
path: ["region"]
|
|
18181
18239
|
});
|
|
@@ -18184,15 +18242,15 @@ var autoroutingPhaseProps = z93.object({
|
|
|
18184
18242
|
expectTypesMatch(true);
|
|
18185
18243
|
|
|
18186
18244
|
// lib/components/spicemodel.ts
|
|
18187
|
-
import { z as
|
|
18188
|
-
var spicemodelProps =
|
|
18189
|
-
source:
|
|
18190
|
-
spicePinMapping:
|
|
18245
|
+
import { z as z96 } from "zod";
|
|
18246
|
+
var spicemodelProps = z96.object({
|
|
18247
|
+
source: z96.string(),
|
|
18248
|
+
spicePinMapping: z96.record(z96.string(), z96.string()).optional()
|
|
18191
18249
|
});
|
|
18192
18250
|
expectTypesMatch(true);
|
|
18193
18251
|
|
|
18194
18252
|
// lib/components/transistor.ts
|
|
18195
|
-
import { z as
|
|
18253
|
+
import { z as z97 } from "zod";
|
|
18196
18254
|
var transistorPinsLabels = [
|
|
18197
18255
|
"pin1",
|
|
18198
18256
|
"pin2",
|
|
@@ -18205,7 +18263,7 @@ var transistorPinsLabels = [
|
|
|
18205
18263
|
"drain"
|
|
18206
18264
|
];
|
|
18207
18265
|
var transistorProps = commonComponentProps.extend({
|
|
18208
|
-
type:
|
|
18266
|
+
type: z97.enum(["npn", "pnp", "bjt", "jfet", "mosfet", "igbt"]),
|
|
18209
18267
|
connections: createConnectionsProp(transistorPinsLabels).optional()
|
|
18210
18268
|
});
|
|
18211
18269
|
var transistorPins = [
|
|
@@ -18219,7 +18277,7 @@ var transistorPins = [
|
|
|
18219
18277
|
expectTypesMatch(true);
|
|
18220
18278
|
|
|
18221
18279
|
// lib/components/mosfet.ts
|
|
18222
|
-
import { z as
|
|
18280
|
+
import { z as z98 } from "zod";
|
|
18223
18281
|
var mosfetPins = [
|
|
18224
18282
|
"pin1",
|
|
18225
18283
|
"drain",
|
|
@@ -18229,11 +18287,11 @@ var mosfetPins = [
|
|
|
18229
18287
|
"gate"
|
|
18230
18288
|
];
|
|
18231
18289
|
var mosfetProps = commonComponentProps.extend({
|
|
18232
|
-
channelType:
|
|
18233
|
-
mosfetMode:
|
|
18234
|
-
symbolDrainSide:
|
|
18235
|
-
symbolSourceSide:
|
|
18236
|
-
symbolGateSide:
|
|
18290
|
+
channelType: z98.enum(["n", "p"]),
|
|
18291
|
+
mosfetMode: z98.enum(["enhancement", "depletion"]),
|
|
18292
|
+
symbolDrainSide: z98.enum(["left", "right", "top", "bottom"]).optional(),
|
|
18293
|
+
symbolSourceSide: z98.enum(["left", "right", "top", "bottom"]).optional(),
|
|
18294
|
+
symbolGateSide: z98.enum(["left", "right", "top", "bottom"]).optional(),
|
|
18237
18295
|
connections: createConnectionsProp(mosfetPins).optional()
|
|
18238
18296
|
});
|
|
18239
18297
|
expectTypesMatch(true);
|
|
@@ -18255,29 +18313,29 @@ expectTypesMatch(true);
|
|
|
18255
18313
|
|
|
18256
18314
|
// lib/components/inductor.ts
|
|
18257
18315
|
import { inductance as inductance2 } from "circuit-json";
|
|
18258
|
-
import { z as
|
|
18316
|
+
import { z as z100 } from "zod";
|
|
18259
18317
|
var inductorPins = lrPins;
|
|
18260
18318
|
var inductorProps = commonComponentProps.extend({
|
|
18261
18319
|
inductance: inductance2,
|
|
18262
|
-
maxCurrentRating:
|
|
18320
|
+
maxCurrentRating: z100.union([z100.string(), z100.number()]).optional(),
|
|
18263
18321
|
schOrientation: schematicOrientation.optional(),
|
|
18264
18322
|
connections: createConnectionsProp(inductorPins).optional()
|
|
18265
18323
|
});
|
|
18266
18324
|
expectTypesMatch(true);
|
|
18267
18325
|
|
|
18268
18326
|
// lib/components/internal-circuit.ts
|
|
18269
|
-
import { z as
|
|
18270
|
-
var internalCircuitProps =
|
|
18271
|
-
children:
|
|
18327
|
+
import { z as z101 } from "zod";
|
|
18328
|
+
var internalCircuitProps = z101.object({
|
|
18329
|
+
children: z101.custom().optional()
|
|
18272
18330
|
});
|
|
18273
18331
|
expectTypesMatch(
|
|
18274
18332
|
true
|
|
18275
18333
|
);
|
|
18276
18334
|
|
|
18277
18335
|
// lib/components/diode.ts
|
|
18278
|
-
import { z as
|
|
18336
|
+
import { z as z102 } from "zod";
|
|
18279
18337
|
var diodePins = lrPolarPins;
|
|
18280
|
-
var diodeConnectionKeys =
|
|
18338
|
+
var diodeConnectionKeys = z102.enum([
|
|
18281
18339
|
"anode",
|
|
18282
18340
|
"cathode",
|
|
18283
18341
|
"pin1",
|
|
@@ -18285,13 +18343,13 @@ var diodeConnectionKeys = z100.enum([
|
|
|
18285
18343
|
"pos",
|
|
18286
18344
|
"neg"
|
|
18287
18345
|
]);
|
|
18288
|
-
var connectionTarget3 =
|
|
18289
|
-
var connectionsProp2 =
|
|
18290
|
-
var diodePinLabelsProp =
|
|
18291
|
-
|
|
18292
|
-
schematicPinLabel.or(
|
|
18346
|
+
var connectionTarget3 = z102.string().or(z102.array(z102.string()).readonly()).or(z102.array(z102.string()));
|
|
18347
|
+
var connectionsProp2 = z102.record(diodeConnectionKeys, connectionTarget3);
|
|
18348
|
+
var diodePinLabelsProp = z102.record(
|
|
18349
|
+
z102.enum(diodePins),
|
|
18350
|
+
schematicPinLabel.or(z102.array(schematicPinLabel).readonly()).or(z102.array(schematicPinLabel))
|
|
18293
18351
|
);
|
|
18294
|
-
var diodeVariant =
|
|
18352
|
+
var diodeVariant = z102.enum([
|
|
18295
18353
|
"standard",
|
|
18296
18354
|
"schottky",
|
|
18297
18355
|
"zener",
|
|
@@ -18302,12 +18360,12 @@ var diodeVariant = z100.enum([
|
|
|
18302
18360
|
var diodeProps = commonComponentProps.extend({
|
|
18303
18361
|
connections: connectionsProp2.optional(),
|
|
18304
18362
|
variant: diodeVariant.optional().default("standard"),
|
|
18305
|
-
standard:
|
|
18306
|
-
schottky:
|
|
18307
|
-
zener:
|
|
18308
|
-
avalanche:
|
|
18309
|
-
photo:
|
|
18310
|
-
tvs:
|
|
18363
|
+
standard: z102.boolean().optional(),
|
|
18364
|
+
schottky: z102.boolean().optional(),
|
|
18365
|
+
zener: z102.boolean().optional(),
|
|
18366
|
+
avalanche: z102.boolean().optional(),
|
|
18367
|
+
photo: z102.boolean().optional(),
|
|
18368
|
+
tvs: z102.boolean().optional(),
|
|
18311
18369
|
schOrientation: schematicOrientation.optional(),
|
|
18312
18370
|
pinLabels: diodePinLabelsProp.optional()
|
|
18313
18371
|
}).superRefine((data, ctx) => {
|
|
@@ -18321,11 +18379,11 @@ var diodeProps = commonComponentProps.extend({
|
|
|
18321
18379
|
].filter(Boolean).length;
|
|
18322
18380
|
if (enabledFlags > 1) {
|
|
18323
18381
|
ctx.addIssue({
|
|
18324
|
-
code:
|
|
18382
|
+
code: z102.ZodIssueCode.custom,
|
|
18325
18383
|
message: "Exactly one diode variant must be enabled",
|
|
18326
18384
|
path: []
|
|
18327
18385
|
});
|
|
18328
|
-
return
|
|
18386
|
+
return z102.INVALID;
|
|
18329
18387
|
}
|
|
18330
18388
|
}).transform((data) => {
|
|
18331
18389
|
const result = {
|
|
@@ -18371,45 +18429,45 @@ var diodeProps = commonComponentProps.extend({
|
|
|
18371
18429
|
expectTypesMatch(true);
|
|
18372
18430
|
|
|
18373
18431
|
// lib/components/led.ts
|
|
18374
|
-
import { z as
|
|
18375
|
-
var legacyNumericLedPinLabelsProp =
|
|
18376
|
-
|
|
18377
|
-
schematicPinLabel.or(
|
|
18432
|
+
import { z as z103 } from "zod";
|
|
18433
|
+
var legacyNumericLedPinLabelsProp = z103.record(
|
|
18434
|
+
z103.enum(["1", "2"]),
|
|
18435
|
+
schematicPinLabel.or(z103.array(schematicPinLabel).readonly()).or(z103.array(schematicPinLabel))
|
|
18378
18436
|
).transform((pinLabels) => ({
|
|
18379
18437
|
...pinLabels["1"] === void 0 ? {} : { pin1: pinLabels["1"] },
|
|
18380
18438
|
...pinLabels["2"] === void 0 ? {} : { pin2: pinLabels["2"] }
|
|
18381
18439
|
}));
|
|
18382
18440
|
var ledProps = commonComponentProps.extend({
|
|
18383
|
-
color:
|
|
18384
|
-
wavelength:
|
|
18385
|
-
schDisplayValue:
|
|
18441
|
+
color: z103.string().optional(),
|
|
18442
|
+
wavelength: z103.string().optional(),
|
|
18443
|
+
schDisplayValue: z103.string().optional(),
|
|
18386
18444
|
schOrientation: schematicOrientation.optional(),
|
|
18387
18445
|
// Numeric keys are accepted for compatibility with legacy generated LED
|
|
18388
18446
|
// wrappers, then normalized to the canonical pin1/pin2 representation.
|
|
18389
18447
|
pinLabels: diodePinLabelsProp.or(legacyNumericLedPinLabelsProp).optional(),
|
|
18390
18448
|
connections: createConnectionsProp(lrPolarPins).optional(),
|
|
18391
|
-
laser:
|
|
18449
|
+
laser: z103.boolean().optional()
|
|
18392
18450
|
});
|
|
18393
18451
|
var ledPins = lrPolarPins;
|
|
18394
18452
|
|
|
18395
18453
|
// lib/components/switch.ts
|
|
18396
18454
|
import { ms as ms3, frequency as frequency4 } from "circuit-json";
|
|
18397
|
-
import { z as
|
|
18455
|
+
import { z as z104 } from "zod";
|
|
18398
18456
|
var switchProps = commonComponentProps.extend({
|
|
18399
|
-
type:
|
|
18400
|
-
isNormallyClosed:
|
|
18401
|
-
spst:
|
|
18402
|
-
spdt:
|
|
18403
|
-
dpst:
|
|
18404
|
-
dpdt:
|
|
18457
|
+
type: z104.enum(["spst", "spdt", "dpst", "dpdt"]).optional(),
|
|
18458
|
+
isNormallyClosed: z104.boolean().optional().default(false),
|
|
18459
|
+
spst: z104.boolean().optional(),
|
|
18460
|
+
spdt: z104.boolean().optional(),
|
|
18461
|
+
dpst: z104.boolean().optional(),
|
|
18462
|
+
dpdt: z104.boolean().optional(),
|
|
18405
18463
|
pinLabels: pinLabelsProp.optional(),
|
|
18406
18464
|
noConnect: noConnectProp.optional(),
|
|
18407
18465
|
simSwitchFrequency: frequency4.optional(),
|
|
18408
18466
|
simCloseAt: ms3.optional(),
|
|
18409
18467
|
simOpenAt: ms3.optional(),
|
|
18410
|
-
simStartClosed:
|
|
18411
|
-
simStartOpen:
|
|
18412
|
-
connections:
|
|
18468
|
+
simStartClosed: z104.boolean().optional(),
|
|
18469
|
+
simStartOpen: z104.boolean().optional(),
|
|
18470
|
+
connections: z104.custom().pipe(z104.record(z104.string(), connectionTarget)).optional()
|
|
18413
18471
|
}).transform((props) => {
|
|
18414
18472
|
const updatedProps = { ...props };
|
|
18415
18473
|
if (updatedProps.dpdt) {
|
|
@@ -18441,33 +18499,33 @@ expectTypesMatch(true);
|
|
|
18441
18499
|
|
|
18442
18500
|
// lib/components/fabrication-note-text.ts
|
|
18443
18501
|
import { length as length4 } from "circuit-json";
|
|
18444
|
-
import { z as
|
|
18502
|
+
import { z as z105 } from "zod";
|
|
18445
18503
|
var fabricationNoteTextProps = pcbLayoutProps.extend({
|
|
18446
|
-
text:
|
|
18447
|
-
anchorAlignment:
|
|
18448
|
-
font:
|
|
18504
|
+
text: z105.string(),
|
|
18505
|
+
anchorAlignment: z105.enum(["center", "top_left", "top_right", "bottom_left", "bottom_right"]).default("center"),
|
|
18506
|
+
font: z105.enum(["tscircuit2024"]).optional(),
|
|
18449
18507
|
fontSize: length4.optional(),
|
|
18450
|
-
color:
|
|
18508
|
+
color: z105.string().optional()
|
|
18451
18509
|
});
|
|
18452
18510
|
expectTypesMatch(true);
|
|
18453
18511
|
|
|
18454
18512
|
// lib/components/fabrication-note-rect.ts
|
|
18455
18513
|
import { distance as distance23 } from "circuit-json";
|
|
18456
|
-
import { z as
|
|
18514
|
+
import { z as z106 } from "zod";
|
|
18457
18515
|
var fabricationNoteRectProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
18458
18516
|
width: distance23,
|
|
18459
18517
|
height: distance23,
|
|
18460
18518
|
strokeWidth: distance23.optional(),
|
|
18461
|
-
isFilled:
|
|
18462
|
-
hasStroke:
|
|
18463
|
-
isStrokeDashed:
|
|
18464
|
-
color:
|
|
18519
|
+
isFilled: z106.boolean().optional(),
|
|
18520
|
+
hasStroke: z106.boolean().optional(),
|
|
18521
|
+
isStrokeDashed: z106.boolean().optional(),
|
|
18522
|
+
color: z106.string().optional(),
|
|
18465
18523
|
cornerRadius: distance23.optional()
|
|
18466
18524
|
});
|
|
18467
18525
|
|
|
18468
18526
|
// lib/components/fabrication-note-path.ts
|
|
18469
18527
|
import { length as length5, route_hint_point as route_hint_point3 } from "circuit-json";
|
|
18470
|
-
import { z as
|
|
18528
|
+
import { z as z107 } from "zod";
|
|
18471
18529
|
var fabricationNotePathProps = pcbLayoutProps.omit({
|
|
18472
18530
|
pcbLeftEdgeX: true,
|
|
18473
18531
|
pcbRightEdgeX: true,
|
|
@@ -18479,15 +18537,15 @@ var fabricationNotePathProps = pcbLayoutProps.omit({
|
|
|
18479
18537
|
pcbOffsetY: true,
|
|
18480
18538
|
pcbRotation: true
|
|
18481
18539
|
}).extend({
|
|
18482
|
-
route:
|
|
18540
|
+
route: z107.array(route_hint_point3),
|
|
18483
18541
|
strokeWidth: length5.optional(),
|
|
18484
|
-
color:
|
|
18542
|
+
color: z107.string().optional()
|
|
18485
18543
|
});
|
|
18486
18544
|
|
|
18487
18545
|
// lib/components/fabrication-note-dimension.ts
|
|
18488
18546
|
import { distance as distance24, length as length6 } from "circuit-json";
|
|
18489
|
-
import { z as
|
|
18490
|
-
var dimensionTarget =
|
|
18547
|
+
import { z as z108 } from "zod";
|
|
18548
|
+
var dimensionTarget = z108.union([z108.string(), point]);
|
|
18491
18549
|
var fabricationNoteDimensionProps = pcbLayoutProps.omit({
|
|
18492
18550
|
pcbLeftEdgeX: true,
|
|
18493
18551
|
pcbRightEdgeX: true,
|
|
@@ -18501,43 +18559,43 @@ var fabricationNoteDimensionProps = pcbLayoutProps.omit({
|
|
|
18501
18559
|
}).extend({
|
|
18502
18560
|
from: dimensionTarget,
|
|
18503
18561
|
to: dimensionTarget,
|
|
18504
|
-
text:
|
|
18562
|
+
text: z108.string().optional(),
|
|
18505
18563
|
offset: distance24.optional(),
|
|
18506
|
-
font:
|
|
18564
|
+
font: z108.enum(["tscircuit2024"]).optional(),
|
|
18507
18565
|
fontSize: length6.optional(),
|
|
18508
|
-
color:
|
|
18566
|
+
color: z108.string().optional(),
|
|
18509
18567
|
arrowSize: distance24.optional(),
|
|
18510
|
-
units:
|
|
18511
|
-
outerEdgeToEdge:
|
|
18512
|
-
centerToCenter:
|
|
18513
|
-
innerEdgeToEdge:
|
|
18568
|
+
units: z108.enum(["in", "mm"]).optional(),
|
|
18569
|
+
outerEdgeToEdge: z108.literal(true).optional(),
|
|
18570
|
+
centerToCenter: z108.literal(true).optional(),
|
|
18571
|
+
innerEdgeToEdge: z108.literal(true).optional()
|
|
18514
18572
|
});
|
|
18515
18573
|
expectTypesMatch(true);
|
|
18516
18574
|
|
|
18517
18575
|
// lib/components/pcb-trace.ts
|
|
18518
18576
|
import { distance as distance25, route_hint_point as route_hint_point4 } from "circuit-json";
|
|
18519
|
-
import { z as
|
|
18520
|
-
var pcbTraceProps =
|
|
18521
|
-
layer:
|
|
18577
|
+
import { z as z109 } from "zod";
|
|
18578
|
+
var pcbTraceProps = z109.object({
|
|
18579
|
+
layer: z109.string().optional(),
|
|
18522
18580
|
thickness: distance25.optional(),
|
|
18523
|
-
route:
|
|
18581
|
+
route: z109.array(route_hint_point4)
|
|
18524
18582
|
});
|
|
18525
18583
|
|
|
18526
18584
|
// lib/components/via.ts
|
|
18527
18585
|
import { distance as distance26, layer_ref as layer_ref9 } from "circuit-json";
|
|
18528
|
-
import { z as
|
|
18586
|
+
import { z as z110 } from "zod";
|
|
18529
18587
|
var viaProps = commonLayoutProps.extend({
|
|
18530
|
-
name:
|
|
18588
|
+
name: z110.string().optional(),
|
|
18531
18589
|
fromLayer: layer_ref9.optional(),
|
|
18532
18590
|
toLayer: layer_ref9.optional(),
|
|
18533
18591
|
holeDiameter: distance26.optional(),
|
|
18534
18592
|
outerDiameter: distance26.optional(),
|
|
18535
|
-
layers:
|
|
18536
|
-
connectsTo:
|
|
18537
|
-
netIsAssignable:
|
|
18538
|
-
tented:
|
|
18539
|
-
|
|
18540
|
-
|
|
18593
|
+
layers: z110.array(layer_ref9).optional(),
|
|
18594
|
+
connectsTo: z110.string().or(z110.array(z110.string())).optional(),
|
|
18595
|
+
netIsAssignable: z110.boolean().optional(),
|
|
18596
|
+
tented: z110.union([
|
|
18597
|
+
z110.boolean(),
|
|
18598
|
+
z110.enum([
|
|
18541
18599
|
"both_sides",
|
|
18542
18600
|
"top_and_bottom_tented",
|
|
18543
18601
|
"top_tented",
|
|
@@ -18556,15 +18614,15 @@ expectTypesMatch(true);
|
|
|
18556
18614
|
|
|
18557
18615
|
// lib/components/testpoint.ts
|
|
18558
18616
|
import { distance as distance27 } from "circuit-json";
|
|
18559
|
-
import { z as
|
|
18617
|
+
import { z as z111 } from "zod";
|
|
18560
18618
|
var testpointPins = ["pin1"];
|
|
18561
|
-
var testpointConnectionsProp =
|
|
18619
|
+
var testpointConnectionsProp = z111.object({
|
|
18562
18620
|
pin1: connectionTarget
|
|
18563
18621
|
}).strict();
|
|
18564
18622
|
var testpointProps = commonComponentProps.extend({
|
|
18565
18623
|
connections: testpointConnectionsProp.optional(),
|
|
18566
|
-
footprintVariant:
|
|
18567
|
-
padShape:
|
|
18624
|
+
footprintVariant: z111.enum(["pad", "through_hole"]).optional(),
|
|
18625
|
+
padShape: z111.enum(["rect", "circle"]).optional().default("circle"),
|
|
18568
18626
|
padDiameter: distance27.optional(),
|
|
18569
18627
|
holeDiameter: distance27.optional(),
|
|
18570
18628
|
width: distance27.optional(),
|
|
@@ -18576,42 +18634,42 @@ var testpointProps = commonComponentProps.extend({
|
|
|
18576
18634
|
expectTypesMatch(true);
|
|
18577
18635
|
|
|
18578
18636
|
// lib/components/breakoutpoint.ts
|
|
18579
|
-
import { z as
|
|
18637
|
+
import { z as z112 } from "zod";
|
|
18580
18638
|
var breakoutPointProps = pcbLayoutProps.omit({ pcbRotation: true, layer: true }).extend({
|
|
18581
|
-
connection:
|
|
18639
|
+
connection: z112.string()
|
|
18582
18640
|
});
|
|
18583
18641
|
expectTypesMatch(true);
|
|
18584
18642
|
|
|
18585
18643
|
// lib/components/pcb-keepout.ts
|
|
18586
18644
|
import { distance as distance28, layer_ref as layer_ref10 } from "circuit-json";
|
|
18587
|
-
import { z as
|
|
18588
|
-
var pcbKeepoutProps =
|
|
18645
|
+
import { z as z113 } from "zod";
|
|
18646
|
+
var pcbKeepoutProps = z113.union([
|
|
18589
18647
|
pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
18590
|
-
shape:
|
|
18648
|
+
shape: z113.literal("circle"),
|
|
18591
18649
|
radius: distance28,
|
|
18592
|
-
layers:
|
|
18650
|
+
layers: z113.array(layer_ref10).optional(),
|
|
18593
18651
|
/** Report keepout violations as warnings when true. Omit for normal enforcement. */
|
|
18594
|
-
warningOnly:
|
|
18652
|
+
warningOnly: z113.boolean().optional(),
|
|
18595
18653
|
/** Allow trace crossings without keepout diagnostics. False or omitted retains enforcement; copper pours remain excluded. */
|
|
18596
|
-
allowTraces:
|
|
18654
|
+
allowTraces: z113.boolean().optional(),
|
|
18597
18655
|
/** Allow components and their pads/plated holes without keepout diagnostics. False or omitted retains enforcement; copper pours remain excluded. */
|
|
18598
|
-
allowPlacements:
|
|
18599
|
-
excludeRefs:
|
|
18656
|
+
allowPlacements: z113.boolean().optional(),
|
|
18657
|
+
excludeRefs: z113.array(z113.string()).optional().describe(
|
|
18600
18658
|
'Component selectors excluded from the keepout, such as ".ANT1"'
|
|
18601
18659
|
)
|
|
18602
18660
|
}),
|
|
18603
18661
|
pcbLayoutProps.extend({
|
|
18604
|
-
shape:
|
|
18662
|
+
shape: z113.literal("rect"),
|
|
18605
18663
|
width: distance28,
|
|
18606
18664
|
height: distance28,
|
|
18607
|
-
layers:
|
|
18665
|
+
layers: z113.array(layer_ref10).optional(),
|
|
18608
18666
|
/** Report keepout violations as warnings when true. Omit for normal enforcement. */
|
|
18609
|
-
warningOnly:
|
|
18667
|
+
warningOnly: z113.boolean().optional(),
|
|
18610
18668
|
/** Allow trace crossings without keepout diagnostics. False or omitted retains enforcement; copper pours remain excluded. */
|
|
18611
|
-
allowTraces:
|
|
18669
|
+
allowTraces: z113.boolean().optional(),
|
|
18612
18670
|
/** Allow components and their pads/plated holes without keepout diagnostics. False or omitted retains enforcement; copper pours remain excluded. */
|
|
18613
|
-
allowPlacements:
|
|
18614
|
-
excludeRefs:
|
|
18671
|
+
allowPlacements: z113.boolean().optional(),
|
|
18672
|
+
excludeRefs: z113.array(z113.string()).optional().describe(
|
|
18615
18673
|
'Component selectors excluded from the keepout, such as ".ANT1"'
|
|
18616
18674
|
)
|
|
18617
18675
|
})
|
|
@@ -18619,20 +18677,20 @@ var pcbKeepoutProps = z111.union([
|
|
|
18619
18677
|
|
|
18620
18678
|
// lib/components/courtyard-rect.ts
|
|
18621
18679
|
import { distance as distance29 } from "circuit-json";
|
|
18622
|
-
import { z as
|
|
18680
|
+
import { z as z114 } from "zod";
|
|
18623
18681
|
var courtyardRectProps = pcbLayoutProps.extend({
|
|
18624
18682
|
width: distance29,
|
|
18625
18683
|
height: distance29,
|
|
18626
18684
|
strokeWidth: distance29.optional(),
|
|
18627
|
-
isFilled:
|
|
18628
|
-
hasStroke:
|
|
18629
|
-
isStrokeDashed:
|
|
18630
|
-
color:
|
|
18685
|
+
isFilled: z114.boolean().optional(),
|
|
18686
|
+
hasStroke: z114.boolean().optional(),
|
|
18687
|
+
isStrokeDashed: z114.boolean().optional(),
|
|
18688
|
+
color: z114.string().optional()
|
|
18631
18689
|
});
|
|
18632
18690
|
|
|
18633
18691
|
// lib/components/courtyard-outline.ts
|
|
18634
18692
|
import { length as length7 } from "circuit-json";
|
|
18635
|
-
import { z as
|
|
18693
|
+
import { z as z115 } from "zod";
|
|
18636
18694
|
var courtyardOutlineProps = pcbLayoutProps.omit({
|
|
18637
18695
|
pcbLeftEdgeX: true,
|
|
18638
18696
|
pcbRightEdgeX: true,
|
|
@@ -18644,11 +18702,11 @@ var courtyardOutlineProps = pcbLayoutProps.omit({
|
|
|
18644
18702
|
pcbOffsetY: true,
|
|
18645
18703
|
pcbRotation: true
|
|
18646
18704
|
}).extend({
|
|
18647
|
-
outline:
|
|
18705
|
+
outline: z115.array(point),
|
|
18648
18706
|
strokeWidth: length7.optional(),
|
|
18649
|
-
isClosed:
|
|
18650
|
-
isStrokeDashed:
|
|
18651
|
-
color:
|
|
18707
|
+
isClosed: z115.boolean().optional(),
|
|
18708
|
+
isStrokeDashed: z115.boolean().optional(),
|
|
18709
|
+
color: z115.string().optional()
|
|
18652
18710
|
});
|
|
18653
18711
|
|
|
18654
18712
|
// lib/components/courtyard-circle.ts
|
|
@@ -18668,13 +18726,13 @@ var courtyardPillProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
|
18668
18726
|
});
|
|
18669
18727
|
|
|
18670
18728
|
// lib/components/copper-pour.ts
|
|
18671
|
-
import { z as
|
|
18729
|
+
import { z as z118 } from "zod";
|
|
18672
18730
|
import { layer_ref as layer_ref11 } from "circuit-json";
|
|
18673
|
-
var copperPourProps =
|
|
18674
|
-
name:
|
|
18731
|
+
var copperPourProps = z118.object({
|
|
18732
|
+
name: z118.string().optional(),
|
|
18675
18733
|
layer: layer_ref11,
|
|
18676
|
-
connectsTo:
|
|
18677
|
-
unbroken:
|
|
18734
|
+
connectsTo: z118.string(),
|
|
18735
|
+
unbroken: z118.boolean().optional().describe(
|
|
18678
18736
|
"Reserves the pour region during autorouting so unrelated traces do not split it. Vias may still cross the region using antipads."
|
|
18679
18737
|
),
|
|
18680
18738
|
padMargin: distance.optional(),
|
|
@@ -18682,24 +18740,24 @@ var copperPourProps = z116.object({
|
|
|
18682
18740
|
clearance: distance.optional(),
|
|
18683
18741
|
boardEdgeMargin: distance.optional(),
|
|
18684
18742
|
cutoutMargin: distance.optional(),
|
|
18685
|
-
useThermalReliefs:
|
|
18686
|
-
outline:
|
|
18687
|
-
coveredWithSolderMask:
|
|
18743
|
+
useThermalReliefs: z118.boolean().optional(),
|
|
18744
|
+
outline: z118.array(point).optional(),
|
|
18745
|
+
coveredWithSolderMask: z118.boolean().optional().default(true)
|
|
18688
18746
|
});
|
|
18689
18747
|
expectTypesMatch(true);
|
|
18690
18748
|
|
|
18691
18749
|
// lib/components/cadassembly.ts
|
|
18692
18750
|
import { layer_ref as layer_ref12 } from "circuit-json";
|
|
18693
|
-
import { z as
|
|
18694
|
-
var cadassemblyProps =
|
|
18751
|
+
import { z as z119 } from "zod";
|
|
18752
|
+
var cadassemblyProps = z119.object({
|
|
18695
18753
|
originalLayer: layer_ref12.default("top").optional(),
|
|
18696
|
-
children:
|
|
18754
|
+
children: z119.any().optional()
|
|
18697
18755
|
});
|
|
18698
18756
|
expectTypesMatch(true);
|
|
18699
18757
|
|
|
18700
18758
|
// lib/components/cadmodel.ts
|
|
18701
|
-
import { z as
|
|
18702
|
-
var pcbPosition =
|
|
18759
|
+
import { z as z120 } from "zod";
|
|
18760
|
+
var pcbPosition = z120.object({
|
|
18703
18761
|
pcbX: pcbCoordinate.optional(),
|
|
18704
18762
|
pcbY: pcbCoordinate.optional(),
|
|
18705
18763
|
pcbLeftEdgeX: pcbCoordinate.optional(),
|
|
@@ -18716,7 +18774,7 @@ var cadModelBaseWithUrl = cadModelBase.extend({
|
|
|
18716
18774
|
});
|
|
18717
18775
|
var cadModelObject = cadModelBaseWithUrl.merge(pcbPosition);
|
|
18718
18776
|
expectTypesMatch(true);
|
|
18719
|
-
var cadmodelProps =
|
|
18777
|
+
var cadmodelProps = z120.union([z120.null(), url, cadModelObject]);
|
|
18720
18778
|
|
|
18721
18779
|
// lib/components/power-source.ts
|
|
18722
18780
|
import { voltage as voltage5 } from "circuit-json";
|
|
@@ -18725,10 +18783,10 @@ var powerSourceProps = commonComponentProps.extend({
|
|
|
18725
18783
|
});
|
|
18726
18784
|
|
|
18727
18785
|
// lib/components/voltagesource.ts
|
|
18728
|
-
import { frequency as frequency5, ms as ms4, rotation as
|
|
18729
|
-
import { z as
|
|
18786
|
+
import { frequency as frequency5, ms as ms4, rotation as rotation6, voltage as voltage6 } from "circuit-json";
|
|
18787
|
+
import { z as z121 } from "zod";
|
|
18730
18788
|
var voltageSourcePinLabels = ["pin1", "pin2", "pos", "neg"];
|
|
18731
|
-
var percentage =
|
|
18789
|
+
var percentage = z121.union([z121.string(), z121.number()]).transform((val) => {
|
|
18732
18790
|
if (typeof val === "string") {
|
|
18733
18791
|
if (val.endsWith("%")) {
|
|
18734
18792
|
return parseFloat(val.slice(0, -1)) / 100;
|
|
@@ -18737,14 +18795,14 @@ var percentage = z119.union([z119.string(), z119.number()]).transform((val) => {
|
|
|
18737
18795
|
}
|
|
18738
18796
|
return val;
|
|
18739
18797
|
}).pipe(
|
|
18740
|
-
|
|
18798
|
+
z121.number().min(0, "Duty cycle must be non-negative").max(1, "Duty cycle cannot be greater than 100%")
|
|
18741
18799
|
);
|
|
18742
18800
|
var voltageSourceProps = commonComponentProps.extend({
|
|
18743
18801
|
voltage: voltage6.optional(),
|
|
18744
18802
|
frequency: frequency5.optional(),
|
|
18745
18803
|
peakToPeakVoltage: voltage6.optional(),
|
|
18746
|
-
waveShape:
|
|
18747
|
-
phase:
|
|
18804
|
+
waveShape: z121.enum(["sinewave", "square", "triangle", "sawtooth"]).optional(),
|
|
18805
|
+
phase: rotation6.optional(),
|
|
18748
18806
|
dutyCycle: percentage.optional(),
|
|
18749
18807
|
pulseDelay: ms4.optional(),
|
|
18750
18808
|
riseTime: ms4.optional(),
|
|
@@ -18752,17 +18810,17 @@ var voltageSourceProps = commonComponentProps.extend({
|
|
|
18752
18810
|
pulseWidth: ms4.optional(),
|
|
18753
18811
|
period: ms4.optional(),
|
|
18754
18812
|
acMagnitude: voltage6.optional(),
|
|
18755
|
-
acPhase:
|
|
18813
|
+
acPhase: rotation6.optional(),
|
|
18756
18814
|
connections: createConnectionsProp(voltageSourcePinLabels).optional()
|
|
18757
18815
|
});
|
|
18758
18816
|
var voltageSourcePins = lrPolarPins;
|
|
18759
18817
|
expectTypesMatch(true);
|
|
18760
18818
|
|
|
18761
18819
|
// lib/components/currentsource.ts
|
|
18762
|
-
import { frequency as frequency6, rotation as
|
|
18763
|
-
import { z as
|
|
18820
|
+
import { frequency as frequency6, rotation as rotation7, current as current3 } from "circuit-json";
|
|
18821
|
+
import { z as z122 } from "zod";
|
|
18764
18822
|
var currentSourcePinLabels = ["pin1", "pin2", "pos", "neg"];
|
|
18765
|
-
var percentage2 =
|
|
18823
|
+
var percentage2 = z122.union([z122.string(), z122.number()]).transform((val) => {
|
|
18766
18824
|
if (typeof val === "string") {
|
|
18767
18825
|
if (val.endsWith("%")) {
|
|
18768
18826
|
return parseFloat(val.slice(0, -1)) / 100;
|
|
@@ -18771,38 +18829,38 @@ var percentage2 = z120.union([z120.string(), z120.number()]).transform((val) =>
|
|
|
18771
18829
|
}
|
|
18772
18830
|
return val;
|
|
18773
18831
|
}).pipe(
|
|
18774
|
-
|
|
18832
|
+
z122.number().min(0, "Duty cycle must be non-negative").max(1, "Duty cycle cannot be greater than 100%")
|
|
18775
18833
|
);
|
|
18776
18834
|
var currentSourceProps = commonComponentProps.extend({
|
|
18777
18835
|
current: current3.optional(),
|
|
18778
18836
|
frequency: frequency6.optional(),
|
|
18779
18837
|
peakToPeakCurrent: current3.optional(),
|
|
18780
|
-
waveShape:
|
|
18781
|
-
phase:
|
|
18838
|
+
waveShape: z122.enum(["sinewave", "square", "triangle", "sawtooth"]).optional(),
|
|
18839
|
+
phase: rotation7.optional(),
|
|
18782
18840
|
dutyCycle: percentage2.optional(),
|
|
18783
18841
|
acMagnitude: current3.optional(),
|
|
18784
|
-
acPhase:
|
|
18842
|
+
acPhase: rotation7.optional(),
|
|
18785
18843
|
connections: createConnectionsProp(currentSourcePinLabels).optional()
|
|
18786
18844
|
});
|
|
18787
18845
|
var currentSourcePins = lrPolarPins;
|
|
18788
18846
|
expectTypesMatch(true);
|
|
18789
18847
|
|
|
18790
18848
|
// lib/components/voltageprobe.ts
|
|
18791
|
-
import { z as
|
|
18849
|
+
import { z as z123 } from "zod";
|
|
18792
18850
|
var voltageProbeProps = commonComponentProps.omit({ name: true }).extend({
|
|
18793
|
-
name:
|
|
18794
|
-
connectsTo:
|
|
18795
|
-
referenceTo:
|
|
18796
|
-
color:
|
|
18797
|
-
graphDisplayName:
|
|
18798
|
-
graphCenter:
|
|
18799
|
-
graphVerticalOffset:
|
|
18800
|
-
graphVoltagePerDiv:
|
|
18851
|
+
name: z123.string().optional(),
|
|
18852
|
+
connectsTo: z123.string(),
|
|
18853
|
+
referenceTo: z123.string().optional(),
|
|
18854
|
+
color: z123.string().optional(),
|
|
18855
|
+
graphDisplayName: z123.string().optional(),
|
|
18856
|
+
graphCenter: z123.number().optional(),
|
|
18857
|
+
graphVerticalOffset: z123.number().or(z123.string()).optional(),
|
|
18858
|
+
graphVoltagePerDiv: z123.number().or(z123.string()).optional()
|
|
18801
18859
|
});
|
|
18802
18860
|
expectTypesMatch(true);
|
|
18803
18861
|
|
|
18804
18862
|
// lib/components/ammeter.ts
|
|
18805
|
-
import { z as
|
|
18863
|
+
import { z as z124 } from "zod";
|
|
18806
18864
|
var ammeterPinLabels = ["pin1", "pin2", "pos", "neg"];
|
|
18807
18865
|
var hasAmmeterConnectionPair = (connections) => {
|
|
18808
18866
|
return connections.pos !== void 0 && connections.neg !== void 0 || connections.pin1 !== void 0 && connections.pin2 !== void 0;
|
|
@@ -18812,64 +18870,64 @@ var ammeterProps = commonComponentProps.extend({
|
|
|
18812
18870
|
hasAmmeterConnectionPair,
|
|
18813
18871
|
"Ammeter connections must include either pos/neg or pin1/pin2"
|
|
18814
18872
|
),
|
|
18815
|
-
color:
|
|
18816
|
-
graphDisplayName:
|
|
18817
|
-
graphCenter:
|
|
18818
|
-
graphVerticalOffset:
|
|
18819
|
-
graphCurrentPerDiv:
|
|
18873
|
+
color: z124.string().optional(),
|
|
18874
|
+
graphDisplayName: z124.string().optional(),
|
|
18875
|
+
graphCenter: z124.number().optional(),
|
|
18876
|
+
graphVerticalOffset: z124.number().or(z124.string()).optional(),
|
|
18877
|
+
graphCurrentPerDiv: z124.number().or(z124.string()).optional()
|
|
18820
18878
|
});
|
|
18821
18879
|
var ammeterPins = ammeterPinLabels;
|
|
18822
18880
|
expectTypesMatch(true);
|
|
18823
18881
|
|
|
18824
18882
|
// lib/components/schematic-arc.ts
|
|
18825
|
-
import { distance as distance32, point as point5, rotation as
|
|
18826
|
-
import { z as
|
|
18827
|
-
var schematicArcProps =
|
|
18883
|
+
import { distance as distance32, point as point5, rotation as rotation8 } from "circuit-json";
|
|
18884
|
+
import { z as z125 } from "zod";
|
|
18885
|
+
var schematicArcProps = z125.object({
|
|
18828
18886
|
center: point5,
|
|
18829
18887
|
radius: distance32,
|
|
18830
|
-
startAngleDegrees:
|
|
18831
|
-
endAngleDegrees:
|
|
18832
|
-
direction:
|
|
18888
|
+
startAngleDegrees: rotation8,
|
|
18889
|
+
endAngleDegrees: rotation8,
|
|
18890
|
+
direction: z125.enum(["clockwise", "counterclockwise"]).default("counterclockwise"),
|
|
18833
18891
|
strokeWidth: distance32.optional(),
|
|
18834
|
-
color:
|
|
18835
|
-
isDashed:
|
|
18892
|
+
color: z125.string().optional(),
|
|
18893
|
+
isDashed: z125.boolean().optional().default(false)
|
|
18836
18894
|
});
|
|
18837
18895
|
expectTypesMatch(true);
|
|
18838
18896
|
|
|
18839
18897
|
// lib/components/toolingrail.ts
|
|
18840
|
-
import { z as
|
|
18841
|
-
var toolingrailProps =
|
|
18842
|
-
children:
|
|
18898
|
+
import { z as z126 } from "zod";
|
|
18899
|
+
var toolingrailProps = z126.object({
|
|
18900
|
+
children: z126.any().optional()
|
|
18843
18901
|
});
|
|
18844
18902
|
expectTypesMatch(true);
|
|
18845
18903
|
|
|
18846
18904
|
// lib/components/schematic-box.ts
|
|
18847
18905
|
import { distance as distance33 } from "circuit-json";
|
|
18848
|
-
import { z as
|
|
18849
|
-
var schematicBoxProps =
|
|
18850
|
-
name:
|
|
18851
|
-
chipRef:
|
|
18906
|
+
import { z as z127 } from "zod";
|
|
18907
|
+
var schematicBoxProps = z127.object({
|
|
18908
|
+
name: z127.string().optional(),
|
|
18909
|
+
chipRef: z127.string().optional(),
|
|
18852
18910
|
pinLabels: pinLabelsProp.optional(),
|
|
18853
18911
|
schPinArrangement: schematicPinArrangement.optional(),
|
|
18854
18912
|
schPinStyle: schematicPinStyle.optional(),
|
|
18855
18913
|
schX: distance33.optional(),
|
|
18856
18914
|
schY: distance33.optional(),
|
|
18857
|
-
schSectionName:
|
|
18858
|
-
schSheetName:
|
|
18915
|
+
schSectionName: z127.string().optional(),
|
|
18916
|
+
schSheetName: z127.string().optional(),
|
|
18859
18917
|
width: distance33.optional(),
|
|
18860
18918
|
height: distance33.optional(),
|
|
18861
|
-
overlay:
|
|
18919
|
+
overlay: z127.array(z127.string()).optional(),
|
|
18862
18920
|
padding: distance33.optional(),
|
|
18863
18921
|
paddingLeft: distance33.optional(),
|
|
18864
18922
|
paddingRight: distance33.optional(),
|
|
18865
18923
|
paddingTop: distance33.optional(),
|
|
18866
18924
|
paddingBottom: distance33.optional(),
|
|
18867
|
-
title:
|
|
18925
|
+
title: z127.string().optional(),
|
|
18868
18926
|
titleAlignment: ninePointAnchor.default("top_left"),
|
|
18869
|
-
titleColor:
|
|
18927
|
+
titleColor: z127.string().optional(),
|
|
18870
18928
|
titleFontSize: distance33.optional(),
|
|
18871
|
-
titleInside:
|
|
18872
|
-
strokeStyle:
|
|
18929
|
+
titleInside: z127.boolean().default(false),
|
|
18930
|
+
strokeStyle: z127.enum(["solid", "dashed"]).default("solid")
|
|
18873
18931
|
}).refine(
|
|
18874
18932
|
(elm) => elm.width !== void 0 && elm.height !== void 0 || Array.isArray(elm.overlay) && elm.overlay.length > 0,
|
|
18875
18933
|
{
|
|
@@ -18884,22 +18942,22 @@ var schematicBoxProps = z125.object({
|
|
|
18884
18942
|
expectTypesMatch(true);
|
|
18885
18943
|
|
|
18886
18944
|
// lib/components/schematic-symbol.ts
|
|
18887
|
-
import { rotation as
|
|
18888
|
-
import { z as
|
|
18889
|
-
var schematicSymbolConnections =
|
|
18945
|
+
import { rotation as rotation9 } from "circuit-json";
|
|
18946
|
+
import { z as z128 } from "zod";
|
|
18947
|
+
var schematicSymbolConnections = z128.custom().pipe(z128.record(z128.string(), connectionTarget)).refine((value) => Object.keys(value).length > 0, {
|
|
18890
18948
|
message: "connections must map at least one schematic symbol port"
|
|
18891
18949
|
});
|
|
18892
|
-
var schematicSymbolProps =
|
|
18893
|
-
name:
|
|
18894
|
-
displayName:
|
|
18895
|
-
chipRef:
|
|
18896
|
-
symbolName:
|
|
18950
|
+
var schematicSymbolProps = z128.object({
|
|
18951
|
+
name: z128.string().min(1),
|
|
18952
|
+
displayName: z128.string().optional(),
|
|
18953
|
+
chipRef: z128.string().min(1).optional(),
|
|
18954
|
+
symbolName: z128.string().min(1),
|
|
18897
18955
|
connections: schematicSymbolConnections.optional(),
|
|
18898
18956
|
schX: distance.optional(),
|
|
18899
18957
|
schY: distance.optional(),
|
|
18900
|
-
schRotation:
|
|
18901
|
-
schSectionName:
|
|
18902
|
-
schSheetName:
|
|
18958
|
+
schRotation: rotation9.optional(),
|
|
18959
|
+
schSectionName: z128.string().optional(),
|
|
18960
|
+
schSheetName: z128.string().optional()
|
|
18903
18961
|
});
|
|
18904
18962
|
expectTypesMatch(
|
|
18905
18963
|
true
|
|
@@ -18907,60 +18965,60 @@ expectTypesMatch(
|
|
|
18907
18965
|
|
|
18908
18966
|
// lib/components/schematic-circle.ts
|
|
18909
18967
|
import { distance as distance34, point as point6 } from "circuit-json";
|
|
18910
|
-
import { z as
|
|
18911
|
-
var schematicCircleProps =
|
|
18968
|
+
import { z as z129 } from "zod";
|
|
18969
|
+
var schematicCircleProps = z129.object({
|
|
18912
18970
|
center: point6,
|
|
18913
18971
|
radius: distance34,
|
|
18914
18972
|
strokeWidth: distance34.optional(),
|
|
18915
|
-
color:
|
|
18916
|
-
isFilled:
|
|
18917
|
-
fillColor:
|
|
18918
|
-
isDashed:
|
|
18973
|
+
color: z129.string().optional(),
|
|
18974
|
+
isFilled: z129.boolean().optional().default(false),
|
|
18975
|
+
fillColor: z129.string().optional(),
|
|
18976
|
+
isDashed: z129.boolean().optional().default(false)
|
|
18919
18977
|
});
|
|
18920
18978
|
expectTypesMatch(
|
|
18921
18979
|
true
|
|
18922
18980
|
);
|
|
18923
18981
|
|
|
18924
18982
|
// lib/components/schematic-rect.ts
|
|
18925
|
-
import { distance as distance35, rotation as
|
|
18926
|
-
import { z as
|
|
18927
|
-
var schematicRectProps =
|
|
18983
|
+
import { distance as distance35, rotation as rotation10 } from "circuit-json";
|
|
18984
|
+
import { z as z130 } from "zod";
|
|
18985
|
+
var schematicRectProps = z130.object({
|
|
18928
18986
|
schX: distance35.optional(),
|
|
18929
18987
|
schY: distance35.optional(),
|
|
18930
18988
|
width: distance35,
|
|
18931
18989
|
height: distance35,
|
|
18932
|
-
rotation:
|
|
18990
|
+
rotation: rotation10.default(0),
|
|
18933
18991
|
strokeWidth: distance35.optional(),
|
|
18934
|
-
color:
|
|
18935
|
-
isFilled:
|
|
18936
|
-
fillColor:
|
|
18937
|
-
isDashed:
|
|
18992
|
+
color: z130.string().optional(),
|
|
18993
|
+
isFilled: z130.boolean().optional().default(false),
|
|
18994
|
+
fillColor: z130.string().optional(),
|
|
18995
|
+
isDashed: z130.boolean().optional().default(false)
|
|
18938
18996
|
});
|
|
18939
18997
|
expectTypesMatch(true);
|
|
18940
18998
|
|
|
18941
18999
|
// lib/components/schematic-line.ts
|
|
18942
19000
|
import { distance as distance36 } from "circuit-json";
|
|
18943
|
-
import { z as
|
|
18944
|
-
var schematicLineProps =
|
|
19001
|
+
import { z as z131 } from "zod";
|
|
19002
|
+
var schematicLineProps = z131.object({
|
|
18945
19003
|
x1: distance36,
|
|
18946
19004
|
y1: distance36,
|
|
18947
19005
|
x2: distance36,
|
|
18948
19006
|
y2: distance36,
|
|
18949
19007
|
strokeWidth: distance36.optional(),
|
|
18950
|
-
color:
|
|
18951
|
-
isDashed:
|
|
19008
|
+
color: z131.string().optional(),
|
|
19009
|
+
isDashed: z131.boolean().optional().default(false),
|
|
18952
19010
|
dashLength: distance36.optional(),
|
|
18953
19011
|
dashGap: distance36.optional()
|
|
18954
19012
|
});
|
|
18955
19013
|
expectTypesMatch(true);
|
|
18956
19014
|
|
|
18957
19015
|
// lib/components/schematic-text.ts
|
|
18958
|
-
import { distance as distance37, rotation as
|
|
18959
|
-
import { z as
|
|
19016
|
+
import { distance as distance37, rotation as rotation11 } from "circuit-json";
|
|
19017
|
+
import { z as z133 } from "zod";
|
|
18960
19018
|
|
|
18961
19019
|
// lib/common/fivePointAnchor.ts
|
|
18962
|
-
import { z as
|
|
18963
|
-
var fivePointAnchor =
|
|
19020
|
+
import { z as z132 } from "zod";
|
|
19021
|
+
var fivePointAnchor = z132.enum([
|
|
18964
19022
|
"center",
|
|
18965
19023
|
"left",
|
|
18966
19024
|
"right",
|
|
@@ -18969,39 +19027,39 @@ var fivePointAnchor = z130.enum([
|
|
|
18969
19027
|
]);
|
|
18970
19028
|
|
|
18971
19029
|
// lib/components/schematic-text.ts
|
|
18972
|
-
var schematicTextProps =
|
|
19030
|
+
var schematicTextProps = z133.object({
|
|
18973
19031
|
schX: distance37.optional(),
|
|
18974
19032
|
schY: distance37.optional(),
|
|
18975
|
-
text:
|
|
18976
|
-
fontSize:
|
|
18977
|
-
anchor:
|
|
18978
|
-
color:
|
|
18979
|
-
schRotation:
|
|
19033
|
+
text: z133.string(),
|
|
19034
|
+
fontSize: z133.number().default(1),
|
|
19035
|
+
anchor: z133.union([fivePointAnchor.describe("legacy"), ninePointAnchor]).default("center"),
|
|
19036
|
+
color: z133.string().default("#000000"),
|
|
19037
|
+
schRotation: rotation11.default(0)
|
|
18980
19038
|
});
|
|
18981
19039
|
expectTypesMatch(true);
|
|
18982
19040
|
|
|
18983
19041
|
// lib/components/schematic-path.ts
|
|
18984
19042
|
import { distance as distance38, point as point7 } from "circuit-json";
|
|
18985
|
-
import { z as
|
|
18986
|
-
var schematicPathProps =
|
|
18987
|
-
points:
|
|
18988
|
-
svgPath:
|
|
19043
|
+
import { z as z134 } from "zod";
|
|
19044
|
+
var schematicPathProps = z134.object({
|
|
19045
|
+
points: z134.array(point7).optional(),
|
|
19046
|
+
svgPath: z134.string().optional(),
|
|
18989
19047
|
strokeWidth: distance38.optional(),
|
|
18990
|
-
strokeColor:
|
|
19048
|
+
strokeColor: z134.string().optional(),
|
|
18991
19049
|
dashLength: distance38.optional(),
|
|
18992
19050
|
dashGap: distance38.optional(),
|
|
18993
|
-
isFilled:
|
|
18994
|
-
fillColor:
|
|
19051
|
+
isFilled: z134.boolean().optional().default(false),
|
|
19052
|
+
fillColor: z134.string().optional()
|
|
18995
19053
|
});
|
|
18996
19054
|
expectTypesMatch(true);
|
|
18997
19055
|
|
|
18998
19056
|
// lib/components/schematic-table.ts
|
|
18999
19057
|
import { distance as distance39 } from "circuit-json";
|
|
19000
|
-
import { z as
|
|
19001
|
-
var schematicTableProps =
|
|
19058
|
+
import { z as z135 } from "zod";
|
|
19059
|
+
var schematicTableProps = z135.object({
|
|
19002
19060
|
schX: distance39.optional(),
|
|
19003
19061
|
schY: distance39.optional(),
|
|
19004
|
-
children:
|
|
19062
|
+
children: z135.any().optional(),
|
|
19005
19063
|
cellPadding: distance39.optional(),
|
|
19006
19064
|
borderWidth: distance39.optional(),
|
|
19007
19065
|
anchor: ninePointAnchor.optional(),
|
|
@@ -19011,34 +19069,34 @@ expectTypesMatch(true);
|
|
|
19011
19069
|
|
|
19012
19070
|
// lib/components/schematic-row.ts
|
|
19013
19071
|
import { distance as distance40 } from "circuit-json";
|
|
19014
|
-
import { z as
|
|
19015
|
-
var schematicRowProps =
|
|
19016
|
-
children:
|
|
19072
|
+
import { z as z136 } from "zod";
|
|
19073
|
+
var schematicRowProps = z136.object({
|
|
19074
|
+
children: z136.any().optional(),
|
|
19017
19075
|
height: distance40.optional()
|
|
19018
19076
|
});
|
|
19019
19077
|
expectTypesMatch(true);
|
|
19020
19078
|
|
|
19021
19079
|
// lib/components/schematic-cell.ts
|
|
19022
19080
|
import { distance as distance41 } from "circuit-json";
|
|
19023
|
-
import { z as
|
|
19024
|
-
var schematicCellProps =
|
|
19025
|
-
children:
|
|
19026
|
-
horizontalAlign:
|
|
19027
|
-
verticalAlign:
|
|
19081
|
+
import { z as z137 } from "zod";
|
|
19082
|
+
var schematicCellProps = z137.object({
|
|
19083
|
+
children: z137.string().optional(),
|
|
19084
|
+
horizontalAlign: z137.enum(["left", "center", "right"]).optional(),
|
|
19085
|
+
verticalAlign: z137.enum(["top", "middle", "bottom"]).optional(),
|
|
19028
19086
|
fontSize: distance41.optional(),
|
|
19029
|
-
rowSpan:
|
|
19030
|
-
colSpan:
|
|
19087
|
+
rowSpan: z137.number().optional(),
|
|
19088
|
+
colSpan: z137.number().optional(),
|
|
19031
19089
|
width: distance41.optional(),
|
|
19032
|
-
text:
|
|
19090
|
+
text: z137.string().optional()
|
|
19033
19091
|
});
|
|
19034
19092
|
expectTypesMatch(true);
|
|
19035
19093
|
|
|
19036
19094
|
// lib/components/schematic-section.ts
|
|
19037
19095
|
import { distance as distance42 } from "circuit-json";
|
|
19038
|
-
import { z as
|
|
19039
|
-
var schematicSectionProps =
|
|
19040
|
-
displayName:
|
|
19041
|
-
name:
|
|
19096
|
+
import { z as z138 } from "zod";
|
|
19097
|
+
var schematicSectionProps = z138.object({
|
|
19098
|
+
displayName: z138.string().optional(),
|
|
19099
|
+
name: z138.string(),
|
|
19042
19100
|
sectionTitleFontSize: distance42.optional()
|
|
19043
19101
|
});
|
|
19044
19102
|
expectTypesMatch(
|
|
@@ -19046,38 +19104,38 @@ expectTypesMatch(
|
|
|
19046
19104
|
);
|
|
19047
19105
|
|
|
19048
19106
|
// lib/components/schematic-sheet.ts
|
|
19049
|
-
import { z as
|
|
19107
|
+
import { z as z139 } from "zod";
|
|
19050
19108
|
import { distance as distance43 } from "circuit-json";
|
|
19051
|
-
var schematicSheetProps =
|
|
19052
|
-
name:
|
|
19053
|
-
displayName:
|
|
19054
|
-
sheetIndex:
|
|
19055
|
-
sheetSize:
|
|
19056
|
-
sheetWidth: distance43.pipe(
|
|
19057
|
-
sheetHeight: distance43.pipe(
|
|
19058
|
-
children:
|
|
19109
|
+
var schematicSheetProps = z139.object({
|
|
19110
|
+
name: z139.string().optional(),
|
|
19111
|
+
displayName: z139.string().optional(),
|
|
19112
|
+
sheetIndex: z139.number().optional(),
|
|
19113
|
+
sheetSize: z139.enum(["A4", "ANSI_B"]).default("A4"),
|
|
19114
|
+
sheetWidth: distance43.pipe(z139.number().positive()).optional(),
|
|
19115
|
+
sheetHeight: distance43.pipe(z139.number().positive()).optional(),
|
|
19116
|
+
children: z139.any().optional()
|
|
19059
19117
|
});
|
|
19060
19118
|
expectTypesMatch(true);
|
|
19061
19119
|
|
|
19062
19120
|
// lib/components/schematic-graphic.ts
|
|
19063
|
-
import { z as
|
|
19121
|
+
import { z as z140 } from "zod";
|
|
19064
19122
|
var nonemptyUrl = url.refine((value) => value.trim().length > 0, {
|
|
19065
19123
|
message: "imageUrl cannot be empty"
|
|
19066
19124
|
});
|
|
19067
|
-
var
|
|
19125
|
+
var positiveDistance4 = (fieldName) => distance.refine((value) => Number.isFinite(value) && value > 0, {
|
|
19068
19126
|
message: `${fieldName} must be a positive finite distance`
|
|
19069
19127
|
});
|
|
19070
|
-
var schematicGraphicProps =
|
|
19128
|
+
var schematicGraphicProps = z140.object({
|
|
19071
19129
|
imageUrl: nonemptyUrl.optional(),
|
|
19072
|
-
svgContent:
|
|
19130
|
+
svgContent: z140.string().refine((value) => value.trim().length > 0, {
|
|
19073
19131
|
message: "svgContent cannot be empty"
|
|
19074
19132
|
}).optional(),
|
|
19075
|
-
width:
|
|
19076
|
-
height:
|
|
19133
|
+
width: positiveDistance4("width").optional(),
|
|
19134
|
+
height: positiveDistance4("height").optional()
|
|
19077
19135
|
}).superRefine(({ imageUrl, svgContent }, ctx) => {
|
|
19078
19136
|
if (imageUrl === void 0 && svgContent === void 0) {
|
|
19079
19137
|
ctx.addIssue({
|
|
19080
|
-
code:
|
|
19138
|
+
code: z140.ZodIssueCode.custom,
|
|
19081
19139
|
message: "At least one of imageUrl or svgContent is required"
|
|
19082
19140
|
});
|
|
19083
19141
|
}
|
|
@@ -19088,40 +19146,40 @@ expectTypesMatch(
|
|
|
19088
19146
|
|
|
19089
19147
|
// lib/components/copper-text.ts
|
|
19090
19148
|
import { layer_ref as layer_ref13, length as length8 } from "circuit-json";
|
|
19091
|
-
import { z as
|
|
19149
|
+
import { z as z141 } from "zod";
|
|
19092
19150
|
var copperTextProps = pcbLayoutProps.extend({
|
|
19093
|
-
text:
|
|
19151
|
+
text: z141.string(),
|
|
19094
19152
|
anchorAlignment: ninePointAnchor.default("center"),
|
|
19095
|
-
font:
|
|
19153
|
+
font: z141.enum(["tscircuit2024"]).optional(),
|
|
19096
19154
|
fontSize: length8.optional(),
|
|
19097
|
-
layers:
|
|
19098
|
-
knockout:
|
|
19099
|
-
mirrored:
|
|
19155
|
+
layers: z141.array(layer_ref13).optional(),
|
|
19156
|
+
knockout: z141.boolean().optional(),
|
|
19157
|
+
mirrored: z141.boolean().optional()
|
|
19100
19158
|
});
|
|
19101
19159
|
|
|
19102
19160
|
// lib/components/silkscreen-text.ts
|
|
19103
19161
|
import { layer_ref as layer_ref14, length as length9 } from "circuit-json";
|
|
19104
|
-
import { z as
|
|
19162
|
+
import { z as z142 } from "zod";
|
|
19105
19163
|
var silkscreenTextProps = pcbLayoutProps.extend({
|
|
19106
|
-
text:
|
|
19164
|
+
text: z142.string(),
|
|
19107
19165
|
anchorAlignment: ninePointAnchor.default("center"),
|
|
19108
|
-
font:
|
|
19166
|
+
font: z142.enum(["tscircuit2024"]).optional(),
|
|
19109
19167
|
fontSize: length9.optional(),
|
|
19110
19168
|
/**
|
|
19111
19169
|
* If true, text will knock out underlying silkscreen
|
|
19112
19170
|
*/
|
|
19113
|
-
isKnockout:
|
|
19171
|
+
isKnockout: z142.boolean().optional(),
|
|
19114
19172
|
knockoutPadding: length9.optional(),
|
|
19115
19173
|
knockoutPaddingLeft: length9.optional(),
|
|
19116
19174
|
knockoutPaddingRight: length9.optional(),
|
|
19117
19175
|
knockoutPaddingTop: length9.optional(),
|
|
19118
19176
|
knockoutPaddingBottom: length9.optional(),
|
|
19119
|
-
layers:
|
|
19177
|
+
layers: z142.array(layer_ref14).optional()
|
|
19120
19178
|
});
|
|
19121
19179
|
|
|
19122
19180
|
// lib/components/silkscreen-path.ts
|
|
19123
19181
|
import { length as length10, route_hint_point as route_hint_point5 } from "circuit-json";
|
|
19124
|
-
import { z as
|
|
19182
|
+
import { z as z143 } from "zod";
|
|
19125
19183
|
var silkscreenPathProps = pcbLayoutProps.omit({
|
|
19126
19184
|
pcbLeftEdgeX: true,
|
|
19127
19185
|
pcbRightEdgeX: true,
|
|
@@ -19133,7 +19191,7 @@ var silkscreenPathProps = pcbLayoutProps.omit({
|
|
|
19133
19191
|
pcbOffsetY: true,
|
|
19134
19192
|
pcbRotation: true
|
|
19135
19193
|
}).extend({
|
|
19136
|
-
route:
|
|
19194
|
+
route: z143.array(route_hint_point5),
|
|
19137
19195
|
strokeWidth: length10.optional()
|
|
19138
19196
|
});
|
|
19139
19197
|
|
|
@@ -19155,10 +19213,10 @@ var silkscreenLineProps = pcbLayoutProps.omit({
|
|
|
19155
19213
|
|
|
19156
19214
|
// lib/components/silkscreen-rect.ts
|
|
19157
19215
|
import { distance as distance45 } from "circuit-json";
|
|
19158
|
-
import { z as
|
|
19216
|
+
import { z as z144 } from "zod";
|
|
19159
19217
|
var silkscreenRectProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
19160
|
-
filled:
|
|
19161
|
-
stroke:
|
|
19218
|
+
filled: z144.boolean().default(true).optional(),
|
|
19219
|
+
stroke: z144.enum(["dashed", "solid", "none"]).optional(),
|
|
19162
19220
|
strokeWidth: distance45.optional(),
|
|
19163
19221
|
width: distance45,
|
|
19164
19222
|
height: distance45,
|
|
@@ -19167,10 +19225,10 @@ var silkscreenRectProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
|
19167
19225
|
|
|
19168
19226
|
// lib/components/silkscreen-circle.ts
|
|
19169
19227
|
import { distance as distance46 } from "circuit-json";
|
|
19170
|
-
import { z as
|
|
19228
|
+
import { z as z145 } from "zod";
|
|
19171
19229
|
var silkscreenCircleProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
19172
|
-
isFilled:
|
|
19173
|
-
isOutline:
|
|
19230
|
+
isFilled: z145.boolean().optional(),
|
|
19231
|
+
isOutline: z145.boolean().optional(),
|
|
19174
19232
|
strokeWidth: distance46.optional(),
|
|
19175
19233
|
radius: distance46
|
|
19176
19234
|
});
|
|
@@ -19188,69 +19246,69 @@ expectTypesMatch(true);
|
|
|
19188
19246
|
|
|
19189
19247
|
// lib/components/trace-hint.ts
|
|
19190
19248
|
import { distance as distance47, layer_ref as layer_ref15, route_hint_point as route_hint_point6 } from "circuit-json";
|
|
19191
|
-
import { z as
|
|
19192
|
-
var routeHintPointProps =
|
|
19249
|
+
import { z as z147 } from "zod";
|
|
19250
|
+
var routeHintPointProps = z147.object({
|
|
19193
19251
|
x: distance47,
|
|
19194
19252
|
y: distance47,
|
|
19195
|
-
via:
|
|
19253
|
+
via: z147.boolean().optional(),
|
|
19196
19254
|
toLayer: layer_ref15.optional()
|
|
19197
19255
|
});
|
|
19198
|
-
var traceHintProps =
|
|
19199
|
-
for:
|
|
19256
|
+
var traceHintProps = z147.object({
|
|
19257
|
+
for: z147.string().optional().describe(
|
|
19200
19258
|
"Selector for the port you're targeting, not required if you're inside a trace"
|
|
19201
19259
|
),
|
|
19202
|
-
order:
|
|
19260
|
+
order: z147.number().optional(),
|
|
19203
19261
|
offset: route_hint_point6.or(routeHintPointProps).optional(),
|
|
19204
|
-
offsets:
|
|
19205
|
-
traceWidth:
|
|
19262
|
+
offsets: z147.array(route_hint_point6).or(z147.array(routeHintPointProps)).optional(),
|
|
19263
|
+
traceWidth: z147.number().optional()
|
|
19206
19264
|
});
|
|
19207
19265
|
|
|
19208
19266
|
// lib/components/port.ts
|
|
19209
19267
|
import { distance as distance48 } from "circuit-json";
|
|
19210
|
-
import { z as
|
|
19268
|
+
import { z as z148 } from "zod";
|
|
19211
19269
|
var portProps = commonLayoutProps.extend({
|
|
19212
|
-
name:
|
|
19213
|
-
pinNumber:
|
|
19214
|
-
schStemLength:
|
|
19215
|
-
schPinLabelFontSize:
|
|
19270
|
+
name: z148.string().optional(),
|
|
19271
|
+
pinNumber: z148.number().optional(),
|
|
19272
|
+
schStemLength: z148.number().optional(),
|
|
19273
|
+
schPinLabelFontSize: z148.enum(["default", "sm"]).or(
|
|
19216
19274
|
distance48.refine((value) => Number.isFinite(value) && value > 0, {
|
|
19217
19275
|
message: "Schematic pin-label font size must be positive and finite"
|
|
19218
19276
|
})
|
|
19219
19277
|
).optional(),
|
|
19220
|
-
aliases:
|
|
19221
|
-
layer:
|
|
19222
|
-
layers:
|
|
19223
|
-
schX:
|
|
19224
|
-
schY:
|
|
19278
|
+
aliases: z148.array(z148.string()).optional(),
|
|
19279
|
+
layer: z148.string().optional(),
|
|
19280
|
+
layers: z148.array(z148.string()).optional(),
|
|
19281
|
+
schX: z148.number().optional(),
|
|
19282
|
+
schY: z148.number().optional(),
|
|
19225
19283
|
direction: direction.optional(),
|
|
19226
|
-
connectsTo:
|
|
19284
|
+
connectsTo: z148.string().or(z148.array(z148.string())).optional(),
|
|
19227
19285
|
kicadPinMetadata: kicadPinMetadata.optional(),
|
|
19228
|
-
hasInversionCircle:
|
|
19286
|
+
hasInversionCircle: z148.boolean().optional()
|
|
19229
19287
|
});
|
|
19230
19288
|
|
|
19231
19289
|
// lib/components/pcb-note-text.ts
|
|
19232
19290
|
import { length as length11 } from "circuit-json";
|
|
19233
|
-
import { z as
|
|
19291
|
+
import { z as z149 } from "zod";
|
|
19234
19292
|
var pcbNoteTextProps = pcbLayoutProps.extend({
|
|
19235
|
-
text:
|
|
19236
|
-
anchorAlignment:
|
|
19237
|
-
font:
|
|
19293
|
+
text: z149.string(),
|
|
19294
|
+
anchorAlignment: z149.enum(["center", "top_left", "top_right", "bottom_left", "bottom_right"]).default("center"),
|
|
19295
|
+
font: z149.enum(["tscircuit2024"]).optional(),
|
|
19238
19296
|
fontSize: length11.optional(),
|
|
19239
|
-
color:
|
|
19297
|
+
color: z149.string().optional()
|
|
19240
19298
|
});
|
|
19241
19299
|
expectTypesMatch(true);
|
|
19242
19300
|
|
|
19243
19301
|
// lib/components/pcb-note-rect.ts
|
|
19244
19302
|
import { distance as distance49 } from "circuit-json";
|
|
19245
|
-
import { z as
|
|
19303
|
+
import { z as z150 } from "zod";
|
|
19246
19304
|
var pcbNoteRectProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
19247
19305
|
width: distance49,
|
|
19248
19306
|
height: distance49,
|
|
19249
19307
|
strokeWidth: distance49.optional(),
|
|
19250
|
-
isFilled:
|
|
19251
|
-
hasStroke:
|
|
19252
|
-
isStrokeDashed:
|
|
19253
|
-
color:
|
|
19308
|
+
isFilled: z150.boolean().optional(),
|
|
19309
|
+
hasStroke: z150.boolean().optional(),
|
|
19310
|
+
isStrokeDashed: z150.boolean().optional(),
|
|
19311
|
+
color: z150.string().optional(),
|
|
19254
19312
|
cornerRadius: distance49.optional()
|
|
19255
19313
|
});
|
|
19256
19314
|
expectTypesMatch(true);
|
|
@@ -19260,7 +19318,7 @@ import {
|
|
|
19260
19318
|
length as length12,
|
|
19261
19319
|
route_hint_point as route_hint_point7
|
|
19262
19320
|
} from "circuit-json";
|
|
19263
|
-
import { z as
|
|
19321
|
+
import { z as z151 } from "zod";
|
|
19264
19322
|
var pcbNotePathProps = pcbLayoutProps.omit({
|
|
19265
19323
|
pcbLeftEdgeX: true,
|
|
19266
19324
|
pcbRightEdgeX: true,
|
|
@@ -19272,15 +19330,15 @@ var pcbNotePathProps = pcbLayoutProps.omit({
|
|
|
19272
19330
|
pcbOffsetY: true,
|
|
19273
19331
|
pcbRotation: true
|
|
19274
19332
|
}).extend({
|
|
19275
|
-
route:
|
|
19333
|
+
route: z151.array(route_hint_point7),
|
|
19276
19334
|
strokeWidth: length12.optional(),
|
|
19277
|
-
color:
|
|
19335
|
+
color: z151.string().optional()
|
|
19278
19336
|
});
|
|
19279
19337
|
expectTypesMatch(true);
|
|
19280
19338
|
|
|
19281
19339
|
// lib/components/pcb-note-line.ts
|
|
19282
19340
|
import { distance as distance50 } from "circuit-json";
|
|
19283
|
-
import { z as
|
|
19341
|
+
import { z as z152 } from "zod";
|
|
19284
19342
|
var pcbNoteLineProps = pcbLayoutProps.omit({
|
|
19285
19343
|
pcbLeftEdgeX: true,
|
|
19286
19344
|
pcbRightEdgeX: true,
|
|
@@ -19297,15 +19355,15 @@ var pcbNoteLineProps = pcbLayoutProps.omit({
|
|
|
19297
19355
|
x2: distance50,
|
|
19298
19356
|
y2: distance50,
|
|
19299
19357
|
strokeWidth: distance50.optional(),
|
|
19300
|
-
color:
|
|
19301
|
-
isDashed:
|
|
19358
|
+
color: z152.string().optional(),
|
|
19359
|
+
isDashed: z152.boolean().optional()
|
|
19302
19360
|
});
|
|
19303
19361
|
expectTypesMatch(true);
|
|
19304
19362
|
|
|
19305
19363
|
// lib/components/pcb-note-dimension.ts
|
|
19306
19364
|
import { distance as distance51, length as length13 } from "circuit-json";
|
|
19307
|
-
import { z as
|
|
19308
|
-
var dimensionTarget2 =
|
|
19365
|
+
import { z as z153 } from "zod";
|
|
19366
|
+
var dimensionTarget2 = z153.union([z153.string(), point]);
|
|
19309
19367
|
var pcbNoteDimensionProps = pcbLayoutProps.omit({
|
|
19310
19368
|
pcbLeftEdgeX: true,
|
|
19311
19369
|
pcbRightEdgeX: true,
|
|
@@ -19319,113 +19377,113 @@ var pcbNoteDimensionProps = pcbLayoutProps.omit({
|
|
|
19319
19377
|
}).extend({
|
|
19320
19378
|
from: dimensionTarget2,
|
|
19321
19379
|
to: dimensionTarget2,
|
|
19322
|
-
text:
|
|
19380
|
+
text: z153.string().optional(),
|
|
19323
19381
|
offset: distance51.optional(),
|
|
19324
|
-
font:
|
|
19382
|
+
font: z153.enum(["tscircuit2024"]).optional(),
|
|
19325
19383
|
fontSize: length13.optional(),
|
|
19326
|
-
color:
|
|
19384
|
+
color: z153.string().optional(),
|
|
19327
19385
|
arrowSize: distance51.optional(),
|
|
19328
|
-
units:
|
|
19329
|
-
outerEdgeToEdge:
|
|
19330
|
-
centerToCenter:
|
|
19331
|
-
innerEdgeToEdge:
|
|
19386
|
+
units: z153.enum(["in", "mm"]).optional(),
|
|
19387
|
+
outerEdgeToEdge: z153.literal(true).optional(),
|
|
19388
|
+
centerToCenter: z153.literal(true).optional(),
|
|
19389
|
+
innerEdgeToEdge: z153.literal(true).optional()
|
|
19332
19390
|
});
|
|
19333
19391
|
expectTypesMatch(
|
|
19334
19392
|
true
|
|
19335
19393
|
);
|
|
19336
19394
|
|
|
19337
19395
|
// lib/platformConfig.ts
|
|
19338
|
-
import { z as
|
|
19339
|
-
var unvalidatedCircuitJson =
|
|
19340
|
-
var footprintLibraryResult =
|
|
19341
|
-
footprintCircuitJson:
|
|
19396
|
+
import { z as z154 } from "zod";
|
|
19397
|
+
var unvalidatedCircuitJson = z154.array(z154.any()).describe("Circuit JSON");
|
|
19398
|
+
var footprintLibraryResult = z154.object({
|
|
19399
|
+
footprintCircuitJson: z154.array(z154.any()),
|
|
19342
19400
|
cadModel: cadModelProp.optional()
|
|
19343
19401
|
});
|
|
19344
|
-
var pathToCircuitJsonFn =
|
|
19345
|
-
|
|
19346
|
-
|
|
19347
|
-
|
|
19348
|
-
).returns(
|
|
19402
|
+
var pathToCircuitJsonFn = z154.function().args(z154.string()).returns(z154.promise(footprintLibraryResult)).or(
|
|
19403
|
+
z154.function().args(
|
|
19404
|
+
z154.string(),
|
|
19405
|
+
z154.object({ resolvedPcbStyle: pcbStyle.optional() }).optional()
|
|
19406
|
+
).returns(z154.promise(footprintLibraryResult))
|
|
19349
19407
|
).describe("A function that takes a path and returns Circuit JSON");
|
|
19350
|
-
var footprintFileParserEntry =
|
|
19351
|
-
loadFromUrl:
|
|
19408
|
+
var footprintFileParserEntry = z154.object({
|
|
19409
|
+
loadFromUrl: z154.function().args(z154.string()).returns(z154.promise(footprintLibraryResult)).describe(
|
|
19352
19410
|
"A function that takes a footprint file URL and returns Circuit JSON"
|
|
19353
19411
|
)
|
|
19354
19412
|
});
|
|
19355
|
-
var spiceEngineSimulationResult =
|
|
19356
|
-
engineVersionString:
|
|
19413
|
+
var spiceEngineSimulationResult = z154.object({
|
|
19414
|
+
engineVersionString: z154.string().optional(),
|
|
19357
19415
|
simulationResultCircuitJson: unvalidatedCircuitJson
|
|
19358
19416
|
});
|
|
19359
|
-
var spiceEngineZod =
|
|
19360
|
-
simulate:
|
|
19417
|
+
var spiceEngineZod = z154.object({
|
|
19418
|
+
simulate: z154.function().args(z154.string()).returns(z154.promise(spiceEngineSimulationResult)).describe(
|
|
19361
19419
|
"A function that takes a SPICE string and returns a simulation result"
|
|
19362
19420
|
)
|
|
19363
19421
|
});
|
|
19364
|
-
var defaultSpiceEngine =
|
|
19422
|
+
var defaultSpiceEngine = z154.custom(
|
|
19365
19423
|
(value) => typeof value === "string"
|
|
19366
19424
|
);
|
|
19367
|
-
var autorouterInstance =
|
|
19368
|
-
run:
|
|
19369
|
-
getOutputSimpleRouteJson:
|
|
19425
|
+
var autorouterInstance = z154.object({
|
|
19426
|
+
run: z154.function().args().returns(z154.promise(z154.unknown())).describe("Run the autorouter"),
|
|
19427
|
+
getOutputSimpleRouteJson: z154.function().args().returns(z154.promise(z154.any())).describe("Get the resulting SimpleRouteJson")
|
|
19370
19428
|
});
|
|
19371
|
-
var autorouterDefinition =
|
|
19372
|
-
createAutorouter:
|
|
19429
|
+
var autorouterDefinition = z154.object({
|
|
19430
|
+
createAutorouter: z154.function().args(z154.any(), z154.any().optional()).returns(z154.union([autorouterInstance, z154.promise(autorouterInstance)])).describe("Create an autorouter instance")
|
|
19373
19431
|
});
|
|
19374
|
-
var platformFetch =
|
|
19375
|
-
var localCacheEngine =
|
|
19432
|
+
var platformFetch = z154.custom((value) => typeof value === "function").describe("A fetch-like function to use for platform requests");
|
|
19433
|
+
var localCacheEngine = z154.custom(
|
|
19376
19434
|
(value) => typeof value === "object" && value !== null && "getItem" in value && typeof value.getItem === "function" && "setItem" in value && typeof value.setItem === "function"
|
|
19377
19435
|
);
|
|
19378
|
-
var fabricatorEngine =
|
|
19436
|
+
var fabricatorEngine = z154.custom(
|
|
19379
19437
|
(value) => typeof value === "object" && value !== null && "runDrcChecks" in value && typeof value.runDrcChecks === "function"
|
|
19380
19438
|
);
|
|
19381
|
-
var platformConfig =
|
|
19439
|
+
var platformConfig = z154.object({
|
|
19382
19440
|
partsEngine: partsEngine.optional(),
|
|
19383
19441
|
fabricatorEngine: fabricatorEngine.optional(),
|
|
19384
19442
|
autorouter: autorouterProp.optional(),
|
|
19385
|
-
autorouterMap:
|
|
19386
|
-
allowLegacyAutorouters:
|
|
19443
|
+
autorouterMap: z154.record(z154.string(), autorouterDefinition).optional(),
|
|
19444
|
+
allowLegacyAutorouters: z154.boolean().optional(),
|
|
19387
19445
|
registryApiUrl: url.optional(),
|
|
19388
19446
|
cloudAutorouterUrl: url.optional(),
|
|
19389
|
-
projectName:
|
|
19447
|
+
projectName: z154.string().optional(),
|
|
19390
19448
|
projectBaseUrl: url.optional(),
|
|
19391
|
-
version:
|
|
19449
|
+
version: z154.string().optional(),
|
|
19392
19450
|
url: url.optional(),
|
|
19393
|
-
printBoardInformationToSilkscreen:
|
|
19394
|
-
includeBoardFiles:
|
|
19451
|
+
printBoardInformationToSilkscreen: z154.boolean().optional(),
|
|
19452
|
+
includeBoardFiles: z154.array(z154.string()).describe(
|
|
19395
19453
|
'The board files to automatically build with "tsci build", defaults to ["**/*.circuit.tsx"]. Can be an array of files or globs'
|
|
19396
19454
|
).optional(),
|
|
19397
|
-
snapshotsDir:
|
|
19455
|
+
snapshotsDir: z154.string().describe(
|
|
19398
19456
|
'The directory where snapshots are stored for "tsci snapshot", defaults to "tests/__snapshots__"'
|
|
19399
19457
|
).optional(),
|
|
19400
19458
|
defaultSpiceEngine: defaultSpiceEngine.optional(),
|
|
19401
|
-
unitPreference:
|
|
19459
|
+
unitPreference: z154.enum(["mm", "in", "mil"]).optional(),
|
|
19402
19460
|
localCacheEngine: localCacheEngine.optional(),
|
|
19403
|
-
useCloudAutorouter:
|
|
19404
|
-
enablePartOrientationAnalysis:
|
|
19405
|
-
pcbPackSolverTimeoutMs:
|
|
19406
|
-
pcbDisabled:
|
|
19407
|
-
routingDisabled:
|
|
19408
|
-
schematicDisabled:
|
|
19409
|
-
partsEngineDisabled:
|
|
19410
|
-
analogSimulationDisabled:
|
|
19411
|
-
drcChecksDisabled:
|
|
19412
|
-
netlistDrcChecksDisabled:
|
|
19413
|
-
routingDrcChecksDisabled:
|
|
19414
|
-
placementDrcChecksDisabled:
|
|
19415
|
-
pinSpecificationDrcChecksDisabled:
|
|
19416
|
-
spiceEngineMap:
|
|
19417
|
-
footprintLibraryMap:
|
|
19418
|
-
|
|
19419
|
-
|
|
19461
|
+
useCloudAutorouter: z154.boolean().optional(),
|
|
19462
|
+
enablePartOrientationAnalysis: z154.boolean().optional(),
|
|
19463
|
+
pcbPackSolverTimeoutMs: z154.number().finite().positive().optional(),
|
|
19464
|
+
pcbDisabled: z154.boolean().optional(),
|
|
19465
|
+
routingDisabled: z154.boolean().optional(),
|
|
19466
|
+
schematicDisabled: z154.boolean().optional(),
|
|
19467
|
+
partsEngineDisabled: z154.boolean().optional(),
|
|
19468
|
+
analogSimulationDisabled: z154.boolean().optional(),
|
|
19469
|
+
drcChecksDisabled: z154.boolean().optional(),
|
|
19470
|
+
netlistDrcChecksDisabled: z154.boolean().optional(),
|
|
19471
|
+
routingDrcChecksDisabled: z154.boolean().optional(),
|
|
19472
|
+
placementDrcChecksDisabled: z154.boolean().optional(),
|
|
19473
|
+
pinSpecificationDrcChecksDisabled: z154.boolean().optional(),
|
|
19474
|
+
spiceEngineMap: z154.record(z154.string(), spiceEngineZod).optional(),
|
|
19475
|
+
footprintLibraryMap: z154.record(
|
|
19476
|
+
z154.string(),
|
|
19477
|
+
z154.union([
|
|
19420
19478
|
pathToCircuitJsonFn,
|
|
19421
|
-
|
|
19422
|
-
|
|
19423
|
-
|
|
19479
|
+
z154.record(
|
|
19480
|
+
z154.string(),
|
|
19481
|
+
z154.union([unvalidatedCircuitJson, pathToCircuitJsonFn])
|
|
19424
19482
|
)
|
|
19425
19483
|
])
|
|
19426
19484
|
).optional(),
|
|
19427
|
-
footprintFileParserMap:
|
|
19428
|
-
resolveProjectStaticFileImportUrl:
|
|
19485
|
+
footprintFileParserMap: z154.record(z154.string(), footprintFileParserEntry).optional(),
|
|
19486
|
+
resolveProjectStaticFileImportUrl: z154.function().args(z154.string()).returns(z154.promise(z154.string())).describe(
|
|
19429
19487
|
"A function that returns a string URL for static files for the project"
|
|
19430
19488
|
).optional(),
|
|
19431
19489
|
platformFetch: platformFetch.optional()
|
|
@@ -19621,6 +19679,7 @@ export {
|
|
|
19621
19679
|
opampProps,
|
|
19622
19680
|
panelProps,
|
|
19623
19681
|
partsEngine,
|
|
19682
|
+
pcbBendProps,
|
|
19624
19683
|
pcbKeepoutProps,
|
|
19625
19684
|
pcbLayoutProps,
|
|
19626
19685
|
pcbNoteDimensionProps,
|
|
@@ -19632,6 +19691,7 @@ export {
|
|
|
19632
19691
|
pcbPathPoint,
|
|
19633
19692
|
pcbSameXConstraintProps,
|
|
19634
19693
|
pcbSameYConstraintProps,
|
|
19694
|
+
pcbStiffenerProps,
|
|
19635
19695
|
pcbStyle,
|
|
19636
19696
|
pcbSx,
|
|
19637
19697
|
pcbSxValue,
|