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