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