@tscircuit/props 0.0.578 → 0.0.580
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/dist/index.d.ts +761 -507
- package/dist/index.js +1068 -1005
- package/dist/index.js.map +1 -1
- package/lib/common/commonShape.ts +50 -0
- package/lib/enclosure/cutout-aperture.ts +63 -0
- package/lib/enclosure/fdm/box.ts +24 -0
- package/lib/enclosure/fdm/index.ts +1 -0
- package/lib/enclosure/index.ts +12 -0
- package/lib/index.ts +2 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -18,9 +18,71 @@ var directionAlongEdge = z.enum([
|
|
|
18
18
|
expectTypesMatch(true);
|
|
19
19
|
expectTypesMatch(true);
|
|
20
20
|
|
|
21
|
-
// lib/common/
|
|
21
|
+
// lib/common/distance.ts
|
|
22
|
+
import { distance as baseDistance, length } from "circuit-json";
|
|
22
23
|
import { z as z2 } from "zod";
|
|
23
|
-
var
|
|
24
|
+
var calcString = z2.string().regex(/^calc\(.*\)$/);
|
|
25
|
+
var distance = baseDistance;
|
|
26
|
+
var pcbCoordinate = calcString.or(baseDistance);
|
|
27
|
+
|
|
28
|
+
// lib/common/commonShape.ts
|
|
29
|
+
import { z as z3 } from "zod";
|
|
30
|
+
var pillShapeProps = z3.object({
|
|
31
|
+
shape: z3.literal("pill"),
|
|
32
|
+
width: distance,
|
|
33
|
+
height: distance
|
|
34
|
+
});
|
|
35
|
+
var rectShapeProps = z3.object({
|
|
36
|
+
shape: z3.literal("rect"),
|
|
37
|
+
width: distance,
|
|
38
|
+
height: distance
|
|
39
|
+
});
|
|
40
|
+
var circleShapeProps = z3.object({
|
|
41
|
+
shape: z3.literal("circle"),
|
|
42
|
+
radius: distance
|
|
43
|
+
});
|
|
44
|
+
var commonShapeProps = z3.discriminatedUnion("shape", [
|
|
45
|
+
pillShapeProps,
|
|
46
|
+
rectShapeProps,
|
|
47
|
+
circleShapeProps
|
|
48
|
+
]);
|
|
49
|
+
expectTypesMatch(true);
|
|
50
|
+
|
|
51
|
+
// lib/enclosure/cutout-aperture.ts
|
|
52
|
+
import { z as z4 } from "zod";
|
|
53
|
+
var enclosureCutoutApertureShapes = ["pill", "rect", "circle"];
|
|
54
|
+
var apertureOnlyProps = {
|
|
55
|
+
margin: distance.optional()
|
|
56
|
+
};
|
|
57
|
+
var enclosureCutoutApertureProps = z4.discriminatedUnion("shape", [
|
|
58
|
+
pillShapeProps.extend(apertureOnlyProps),
|
|
59
|
+
rectShapeProps.extend(apertureOnlyProps),
|
|
60
|
+
circleShapeProps.extend(apertureOnlyProps)
|
|
61
|
+
]);
|
|
62
|
+
expectTypesMatch(true);
|
|
63
|
+
|
|
64
|
+
// lib/enclosure/fdm/box.ts
|
|
65
|
+
import { z as z5 } from "zod";
|
|
66
|
+
var enclosureFdmBoxProps = z5.object({
|
|
67
|
+
boardRef: z5.string().min(1),
|
|
68
|
+
width: distance.optional(),
|
|
69
|
+
height: distance.optional(),
|
|
70
|
+
depth: distance.optional(),
|
|
71
|
+
wallThickness: distance.default("2mm")
|
|
72
|
+
});
|
|
73
|
+
expectTypesMatch(true);
|
|
74
|
+
|
|
75
|
+
// lib/enclosure/index.ts
|
|
76
|
+
var enclosureProps = {
|
|
77
|
+
cutoutaperture: enclosureCutoutApertureProps,
|
|
78
|
+
fdm: {
|
|
79
|
+
box: enclosureFdmBoxProps
|
|
80
|
+
}
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
// lib/common/portHints.ts
|
|
84
|
+
import { z as z6 } from "zod";
|
|
85
|
+
var portHints = z6.array(z6.string().or(z6.number()));
|
|
24
86
|
expectTypesMatch(true);
|
|
25
87
|
|
|
26
88
|
// lib/common/layout.ts
|
|
@@ -30,41 +92,34 @@ import {
|
|
|
30
92
|
rotation as rotation2,
|
|
31
93
|
supplier_name
|
|
32
94
|
} from "circuit-json";
|
|
33
|
-
import { z as
|
|
95
|
+
import { z as z19 } from "zod";
|
|
34
96
|
|
|
35
97
|
// lib/common/cadModel.ts
|
|
36
|
-
import { z as
|
|
37
|
-
|
|
38
|
-
// lib/common/distance.ts
|
|
39
|
-
import { distance as baseDistance, length } from "circuit-json";
|
|
40
|
-
import { z as z3 } from "zod";
|
|
41
|
-
var calcString = z3.string().regex(/^calc\(.*\)$/);
|
|
42
|
-
var distance = baseDistance;
|
|
43
|
-
var pcbCoordinate = calcString.or(baseDistance);
|
|
98
|
+
import { z as z9 } from "zod";
|
|
44
99
|
|
|
45
100
|
// lib/common/point3.ts
|
|
46
101
|
import { distance as distance2 } from "circuit-json";
|
|
47
|
-
import { z as
|
|
48
|
-
var point3 =
|
|
102
|
+
import { z as z7 } from "zod";
|
|
103
|
+
var point3 = z7.object({
|
|
49
104
|
x: distance2,
|
|
50
105
|
y: distance2,
|
|
51
106
|
z: distance2
|
|
52
107
|
});
|
|
53
108
|
|
|
54
109
|
// lib/common/url.ts
|
|
55
|
-
import { z as
|
|
56
|
-
var url =
|
|
110
|
+
import { z as z8 } from "zod";
|
|
111
|
+
var url = z8.preprocess((value) => {
|
|
57
112
|
if (value && typeof value === "object" && "default" in value) {
|
|
58
113
|
return value.default;
|
|
59
114
|
}
|
|
60
115
|
return value;
|
|
61
|
-
},
|
|
116
|
+
}, z8.string());
|
|
62
117
|
|
|
63
118
|
// lib/common/cadModel.ts
|
|
64
|
-
var rotationPoint3 =
|
|
65
|
-
x:
|
|
66
|
-
y:
|
|
67
|
-
z:
|
|
119
|
+
var rotationPoint3 = z9.object({
|
|
120
|
+
x: z9.union([z9.number(), z9.string()]),
|
|
121
|
+
y: z9.union([z9.number(), z9.string()]),
|
|
122
|
+
z: z9.union([z9.number(), z9.string()])
|
|
68
123
|
});
|
|
69
124
|
var cadModelAxisDirections = [
|
|
70
125
|
"x+",
|
|
@@ -74,17 +129,17 @@ var cadModelAxisDirections = [
|
|
|
74
129
|
"z+",
|
|
75
130
|
"z-"
|
|
76
131
|
];
|
|
77
|
-
var cadModelAxisDirection =
|
|
78
|
-
var cadModelBase =
|
|
79
|
-
rotationOffset:
|
|
132
|
+
var cadModelAxisDirection = z9.enum(cadModelAxisDirections);
|
|
133
|
+
var cadModelBase = z9.object({
|
|
134
|
+
rotationOffset: z9.number().or(rotationPoint3).optional(),
|
|
80
135
|
positionOffset: point3.optional(),
|
|
81
136
|
modelOriginPosition: point3.optional(),
|
|
82
137
|
size: point3.optional(),
|
|
83
138
|
modelUnitToMmScale: distance.optional(),
|
|
84
139
|
modelBoardNormalDirection: cadModelAxisDirection.optional(),
|
|
85
|
-
pcbRotationOffset:
|
|
140
|
+
pcbRotationOffset: z9.number().optional(),
|
|
86
141
|
zOffsetFromSurface: distance.optional(),
|
|
87
|
-
showAsTranslucentModel:
|
|
142
|
+
showAsTranslucentModel: z9.boolean().optional(),
|
|
88
143
|
stepUrl: url.optional()
|
|
89
144
|
});
|
|
90
145
|
expectTypesMatch(true);
|
|
@@ -108,12 +163,12 @@ var cadModelWrl = cadModelBase.extend({
|
|
|
108
163
|
wrlUrl: url
|
|
109
164
|
});
|
|
110
165
|
var cadModelJscad = cadModelBase.extend({
|
|
111
|
-
jscad:
|
|
166
|
+
jscad: z9.record(z9.any())
|
|
112
167
|
});
|
|
113
|
-
var cadModelProp =
|
|
114
|
-
|
|
168
|
+
var cadModelProp = z9.union([
|
|
169
|
+
z9.null(),
|
|
115
170
|
url,
|
|
116
|
-
|
|
171
|
+
z9.custom((v) => {
|
|
117
172
|
return v && typeof v === "object" && "type" in v && "props" in v;
|
|
118
173
|
}),
|
|
119
174
|
cadModelStl,
|
|
@@ -127,17 +182,17 @@ var cadModelProp = z6.union([
|
|
|
127
182
|
expectTypesMatch(true);
|
|
128
183
|
|
|
129
184
|
// lib/common/footprintProp.ts
|
|
130
|
-
import { z as
|
|
131
|
-
var footprintProp =
|
|
185
|
+
import { z as z10 } from "zod";
|
|
186
|
+
var footprintProp = z10.custom((v) => true);
|
|
132
187
|
|
|
133
188
|
// lib/common/kicadFootprintMetadata.ts
|
|
134
189
|
import { distance as distance4, rotation } from "circuit-json";
|
|
135
|
-
import { z as
|
|
190
|
+
import { z as z12 } from "zod";
|
|
136
191
|
|
|
137
192
|
// lib/common/point.ts
|
|
138
193
|
import { distance as distance3 } from "circuit-json";
|
|
139
|
-
import { z as
|
|
140
|
-
var point =
|
|
194
|
+
import { z as z11 } from "zod";
|
|
195
|
+
var point = z11.object({
|
|
141
196
|
x: distance3,
|
|
142
197
|
y: distance3
|
|
143
198
|
});
|
|
@@ -147,25 +202,25 @@ var kicadAt = point.extend({
|
|
|
147
202
|
rotation: rotation.optional()
|
|
148
203
|
});
|
|
149
204
|
expectTypesMatch(true);
|
|
150
|
-
var kicadFont =
|
|
205
|
+
var kicadFont = z12.object({
|
|
151
206
|
size: point.optional(),
|
|
152
207
|
thickness: distance4.optional()
|
|
153
208
|
});
|
|
154
209
|
expectTypesMatch(true);
|
|
155
|
-
var kicadEffects =
|
|
210
|
+
var kicadEffects = z12.object({
|
|
156
211
|
font: kicadFont.optional()
|
|
157
212
|
});
|
|
158
213
|
expectTypesMatch(true);
|
|
159
|
-
var kicadProperty =
|
|
160
|
-
value:
|
|
214
|
+
var kicadProperty = z12.object({
|
|
215
|
+
value: z12.string(),
|
|
161
216
|
at: kicadAt.optional(),
|
|
162
|
-
layer:
|
|
163
|
-
uuid:
|
|
164
|
-
hide:
|
|
217
|
+
layer: z12.string().optional(),
|
|
218
|
+
uuid: z12.string().optional(),
|
|
219
|
+
hide: z12.boolean().optional(),
|
|
165
220
|
effects: kicadEffects.optional()
|
|
166
221
|
});
|
|
167
222
|
expectTypesMatch(true);
|
|
168
|
-
var kicadFootprintProperties =
|
|
223
|
+
var kicadFootprintProperties = z12.object({
|
|
169
224
|
Reference: kicadProperty.optional(),
|
|
170
225
|
Value: kicadProperty.optional(),
|
|
171
226
|
Datasheet: kicadProperty.optional(),
|
|
@@ -174,74 +229,74 @@ var kicadFootprintProperties = z9.object({
|
|
|
174
229
|
expectTypesMatch(
|
|
175
230
|
true
|
|
176
231
|
);
|
|
177
|
-
var kicadFootprintAttributes =
|
|
178
|
-
through_hole:
|
|
179
|
-
smd:
|
|
180
|
-
exclude_from_pos_files:
|
|
181
|
-
exclude_from_bom:
|
|
232
|
+
var kicadFootprintAttributes = z12.object({
|
|
233
|
+
through_hole: z12.boolean().optional(),
|
|
234
|
+
smd: z12.boolean().optional(),
|
|
235
|
+
exclude_from_pos_files: z12.boolean().optional(),
|
|
236
|
+
exclude_from_bom: z12.boolean().optional()
|
|
182
237
|
});
|
|
183
238
|
expectTypesMatch(
|
|
184
239
|
true
|
|
185
240
|
);
|
|
186
|
-
var kicadFootprintPad =
|
|
187
|
-
name:
|
|
188
|
-
type:
|
|
189
|
-
shape:
|
|
241
|
+
var kicadFootprintPad = z12.object({
|
|
242
|
+
name: z12.string(),
|
|
243
|
+
type: z12.string(),
|
|
244
|
+
shape: z12.string().optional(),
|
|
190
245
|
at: kicadAt.optional(),
|
|
191
246
|
size: point.optional(),
|
|
192
247
|
drill: distance4.optional(),
|
|
193
|
-
layers:
|
|
194
|
-
removeUnusedLayers:
|
|
195
|
-
uuid:
|
|
248
|
+
layers: z12.array(z12.string()).optional(),
|
|
249
|
+
removeUnusedLayers: z12.boolean().optional(),
|
|
250
|
+
uuid: z12.string().optional()
|
|
196
251
|
});
|
|
197
252
|
expectTypesMatch(true);
|
|
198
|
-
var kicadFootprintModel =
|
|
199
|
-
path:
|
|
253
|
+
var kicadFootprintModel = z12.object({
|
|
254
|
+
path: z12.string(),
|
|
200
255
|
offset: point3.optional(),
|
|
201
256
|
scale: point3.optional(),
|
|
202
257
|
rotate: point3.optional()
|
|
203
258
|
});
|
|
204
259
|
expectTypesMatch(true);
|
|
205
|
-
var kicadFootprintMetadata =
|
|
206
|
-
footprintName:
|
|
207
|
-
version:
|
|
208
|
-
generator:
|
|
209
|
-
generatorVersion:
|
|
210
|
-
layer:
|
|
260
|
+
var kicadFootprintMetadata = z12.object({
|
|
261
|
+
footprintName: z12.string().optional(),
|
|
262
|
+
version: z12.union([z12.number(), z12.string()]).optional(),
|
|
263
|
+
generator: z12.string().optional(),
|
|
264
|
+
generatorVersion: z12.union([z12.number(), z12.string()]).optional(),
|
|
265
|
+
layer: z12.string().optional(),
|
|
211
266
|
properties: kicadFootprintProperties.optional(),
|
|
212
267
|
attributes: kicadFootprintAttributes.optional(),
|
|
213
|
-
pads:
|
|
214
|
-
embeddedFonts:
|
|
268
|
+
pads: z12.array(kicadFootprintPad).optional(),
|
|
269
|
+
embeddedFonts: z12.boolean().optional(),
|
|
215
270
|
model: kicadFootprintModel.optional()
|
|
216
271
|
});
|
|
217
272
|
expectTypesMatch(true);
|
|
218
273
|
|
|
219
274
|
// lib/common/kicadSymbolMetadata.ts
|
|
220
275
|
import { distance as distance5 } from "circuit-json";
|
|
221
|
-
import { z as
|
|
222
|
-
var kicadSymbolPinNumbers =
|
|
223
|
-
hide:
|
|
276
|
+
import { z as z13 } from "zod";
|
|
277
|
+
var kicadSymbolPinNumbers = z13.object({
|
|
278
|
+
hide: z13.boolean().optional()
|
|
224
279
|
});
|
|
225
280
|
expectTypesMatch(true);
|
|
226
|
-
var kicadSymbolPinNames =
|
|
281
|
+
var kicadSymbolPinNames = z13.object({
|
|
227
282
|
offset: distance5.optional(),
|
|
228
|
-
hide:
|
|
283
|
+
hide: z13.boolean().optional()
|
|
229
284
|
});
|
|
230
285
|
expectTypesMatch(true);
|
|
231
|
-
var kicadSymbolEffects =
|
|
286
|
+
var kicadSymbolEffects = z13.object({
|
|
232
287
|
font: kicadFont.optional(),
|
|
233
|
-
justify:
|
|
234
|
-
hide:
|
|
288
|
+
justify: z13.union([z13.string(), z13.array(z13.string())]).optional(),
|
|
289
|
+
hide: z13.boolean().optional()
|
|
235
290
|
});
|
|
236
291
|
expectTypesMatch(true);
|
|
237
|
-
var kicadSymbolProperty =
|
|
238
|
-
value:
|
|
239
|
-
id:
|
|
292
|
+
var kicadSymbolProperty = z13.object({
|
|
293
|
+
value: z13.string(),
|
|
294
|
+
id: z13.union([z13.number(), z13.string()]).optional(),
|
|
240
295
|
at: kicadAt.optional(),
|
|
241
296
|
effects: kicadSymbolEffects.optional()
|
|
242
297
|
});
|
|
243
298
|
expectTypesMatch(true);
|
|
244
|
-
var kicadSymbolProperties =
|
|
299
|
+
var kicadSymbolProperties = z13.object({
|
|
245
300
|
Reference: kicadSymbolProperty.optional(),
|
|
246
301
|
Value: kicadSymbolProperty.optional(),
|
|
247
302
|
Footprint: kicadSymbolProperty.optional(),
|
|
@@ -251,55 +306,55 @@ var kicadSymbolProperties = z10.object({
|
|
|
251
306
|
ki_fp_filters: kicadSymbolProperty.optional()
|
|
252
307
|
});
|
|
253
308
|
expectTypesMatch(true);
|
|
254
|
-
var kicadSymbolMetadata =
|
|
255
|
-
symbolName:
|
|
256
|
-
extends:
|
|
309
|
+
var kicadSymbolMetadata = z13.object({
|
|
310
|
+
symbolName: z13.string().optional(),
|
|
311
|
+
extends: z13.string().optional(),
|
|
257
312
|
pinNumbers: kicadSymbolPinNumbers.optional(),
|
|
258
313
|
pinNames: kicadSymbolPinNames.optional(),
|
|
259
|
-
excludeFromSim:
|
|
260
|
-
inBom:
|
|
261
|
-
onBoard:
|
|
314
|
+
excludeFromSim: z13.boolean().optional(),
|
|
315
|
+
inBom: z13.boolean().optional(),
|
|
316
|
+
onBoard: z13.boolean().optional(),
|
|
262
317
|
properties: kicadSymbolProperties.optional(),
|
|
263
|
-
embeddedFonts:
|
|
318
|
+
embeddedFonts: z13.boolean().optional()
|
|
264
319
|
});
|
|
265
320
|
expectTypesMatch(true);
|
|
266
321
|
|
|
267
322
|
// lib/common/pcbStyle.ts
|
|
268
323
|
import { distance as distance6 } from "circuit-json";
|
|
269
|
-
import { z as
|
|
270
|
-
var pcbStyle =
|
|
324
|
+
import { z as z14 } from "zod";
|
|
325
|
+
var pcbStyle = z14.object({
|
|
271
326
|
silkscreenFontSize: distance6.optional(),
|
|
272
327
|
viaPadDiameter: distance6.optional(),
|
|
273
328
|
viaHoleDiameter: distance6.optional(),
|
|
274
|
-
silkscreenTextPosition:
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
offsetX:
|
|
278
|
-
offsetY:
|
|
329
|
+
silkscreenTextPosition: z14.union([
|
|
330
|
+
z14.enum(["centered", "outside", "none"]),
|
|
331
|
+
z14.object({
|
|
332
|
+
offsetX: z14.number(),
|
|
333
|
+
offsetY: z14.number()
|
|
279
334
|
})
|
|
280
335
|
]).optional(),
|
|
281
|
-
silkscreenTextVisibility:
|
|
336
|
+
silkscreenTextVisibility: z14.enum(["hidden", "visible", "inherit"]).optional()
|
|
282
337
|
});
|
|
283
338
|
expectTypesMatch(true);
|
|
284
339
|
|
|
285
340
|
// lib/common/pcbSx.ts
|
|
286
341
|
import { length as length2 } from "circuit-json";
|
|
287
|
-
import { z as
|
|
288
|
-
var pcbSxValue =
|
|
342
|
+
import { z as z15 } from "zod";
|
|
343
|
+
var pcbSxValue = z15.object({
|
|
289
344
|
fontSize: length2.optional(),
|
|
290
345
|
pcbX: pcbCoordinate.optional(),
|
|
291
346
|
pcbY: pcbCoordinate.optional(),
|
|
292
|
-
visibility:
|
|
347
|
+
visibility: z15.enum(["hidden", "visible", "inherit"]).optional()
|
|
293
348
|
});
|
|
294
|
-
var pcbSx =
|
|
295
|
-
|
|
349
|
+
var pcbSx = z15.record(
|
|
350
|
+
z15.string(),
|
|
296
351
|
pcbSxValue
|
|
297
352
|
);
|
|
298
353
|
expectTypesMatch(true);
|
|
299
354
|
|
|
300
355
|
// lib/common/pinAttributeMap.ts
|
|
301
|
-
import { z as
|
|
302
|
-
var pinCapability =
|
|
356
|
+
import { z as z16 } from "zod";
|
|
357
|
+
var pinCapability = z16.enum([
|
|
303
358
|
"i2c_sda",
|
|
304
359
|
"i2c_scl",
|
|
305
360
|
"spi_cs",
|
|
@@ -309,51 +364,51 @@ var pinCapability = z13.enum([
|
|
|
309
364
|
"uart_tx",
|
|
310
365
|
"uart_rx"
|
|
311
366
|
]);
|
|
312
|
-
var pinAttributeMap =
|
|
313
|
-
capabilities:
|
|
314
|
-
activeCapabilities:
|
|
367
|
+
var pinAttributeMap = z16.object({
|
|
368
|
+
capabilities: z16.array(pinCapability).optional(),
|
|
369
|
+
activeCapabilities: z16.array(pinCapability).optional(),
|
|
315
370
|
activeCapability: pinCapability.optional(),
|
|
316
|
-
providesPower:
|
|
317
|
-
requiresPower:
|
|
318
|
-
providesGround:
|
|
319
|
-
requiresGround:
|
|
320
|
-
providesVoltage:
|
|
321
|
-
requiresVoltage:
|
|
322
|
-
doNotConnect:
|
|
323
|
-
includeInBoardPinout:
|
|
324
|
-
highlightColor:
|
|
325
|
-
mustBeConnected:
|
|
326
|
-
canUseInternalPullup:
|
|
327
|
-
isUsingInternalPullup:
|
|
328
|
-
needsExternalPullup:
|
|
329
|
-
canUseInternalPulldown:
|
|
330
|
-
isUsingInternalPulldown:
|
|
331
|
-
needsExternalPulldown:
|
|
332
|
-
canUseOpenDrain:
|
|
333
|
-
isUsingOpenDrain:
|
|
334
|
-
canUsePushPull:
|
|
335
|
-
isUsingPushPull:
|
|
336
|
-
shouldHaveDecouplingCapacitor:
|
|
337
|
-
recommendedDecouplingCapacitorCapacitance:
|
|
338
|
-
isGpio:
|
|
371
|
+
providesPower: z16.boolean().optional(),
|
|
372
|
+
requiresPower: z16.boolean().optional(),
|
|
373
|
+
providesGround: z16.boolean().optional(),
|
|
374
|
+
requiresGround: z16.boolean().optional(),
|
|
375
|
+
providesVoltage: z16.union([z16.string(), z16.number()]).optional(),
|
|
376
|
+
requiresVoltage: z16.union([z16.string(), z16.number()]).optional(),
|
|
377
|
+
doNotConnect: z16.boolean().optional(),
|
|
378
|
+
includeInBoardPinout: z16.boolean().optional(),
|
|
379
|
+
highlightColor: z16.string().optional(),
|
|
380
|
+
mustBeConnected: z16.boolean().optional(),
|
|
381
|
+
canUseInternalPullup: z16.boolean().optional(),
|
|
382
|
+
isUsingInternalPullup: z16.boolean().optional(),
|
|
383
|
+
needsExternalPullup: z16.boolean().optional(),
|
|
384
|
+
canUseInternalPulldown: z16.boolean().optional(),
|
|
385
|
+
isUsingInternalPulldown: z16.boolean().optional(),
|
|
386
|
+
needsExternalPulldown: z16.boolean().optional(),
|
|
387
|
+
canUseOpenDrain: z16.boolean().optional(),
|
|
388
|
+
isUsingOpenDrain: z16.boolean().optional(),
|
|
389
|
+
canUsePushPull: z16.boolean().optional(),
|
|
390
|
+
isUsingPushPull: z16.boolean().optional(),
|
|
391
|
+
shouldHaveDecouplingCapacitor: z16.boolean().optional(),
|
|
392
|
+
recommendedDecouplingCapacitorCapacitance: z16.union([z16.string(), z16.number()]).optional(),
|
|
393
|
+
isGpio: z16.boolean().optional()
|
|
339
394
|
});
|
|
340
395
|
expectTypesMatch(true);
|
|
341
396
|
|
|
342
397
|
// lib/common/schStyle.ts
|
|
343
398
|
import { distance as distance7 } from "circuit-json";
|
|
344
|
-
import { z as
|
|
345
|
-
var schStyle =
|
|
346
|
-
defaultPassiveSize:
|
|
347
|
-
defaultCapacitorOrientation:
|
|
399
|
+
import { z as z17 } from "zod";
|
|
400
|
+
var schStyle = z17.object({
|
|
401
|
+
defaultPassiveSize: z17.union([z17.enum(["xs", "sm", "md"]), distance7]).optional(),
|
|
402
|
+
defaultCapacitorOrientation: z17.enum(["vertical", "none"]).optional()
|
|
348
403
|
});
|
|
349
404
|
expectTypesMatch(true);
|
|
350
405
|
|
|
351
406
|
// lib/common/symbolProp.ts
|
|
352
|
-
import { z as
|
|
353
|
-
var symbolProp =
|
|
407
|
+
import { z as z18 } from "zod";
|
|
408
|
+
var symbolProp = z18.custom((v) => true);
|
|
354
409
|
|
|
355
410
|
// lib/common/layout.ts
|
|
356
|
-
var pcbLayoutProps =
|
|
411
|
+
var pcbLayoutProps = z19.object({
|
|
357
412
|
pcbX: pcbCoordinate.optional(),
|
|
358
413
|
pcbY: pcbCoordinate.optional(),
|
|
359
414
|
pcbLeftEdgeX: pcbCoordinate.optional(),
|
|
@@ -363,14 +418,14 @@ var pcbLayoutProps = z16.object({
|
|
|
363
418
|
pcbOffsetX: distance8.optional(),
|
|
364
419
|
pcbOffsetY: distance8.optional(),
|
|
365
420
|
pcbRotation: rotation2.optional(),
|
|
366
|
-
pcbPositionAnchor:
|
|
367
|
-
pcbPositionMode:
|
|
421
|
+
pcbPositionAnchor: z19.string().optional(),
|
|
422
|
+
pcbPositionMode: z19.enum([
|
|
368
423
|
"relative_to_group_anchor",
|
|
369
424
|
"auto",
|
|
370
425
|
"relative_to_board_anchor",
|
|
371
426
|
"relative_to_component_anchor"
|
|
372
427
|
]).optional(),
|
|
373
|
-
shouldBeOnEdgeOfBoard:
|
|
428
|
+
shouldBeOnEdgeOfBoard: z19.boolean().optional(),
|
|
374
429
|
layer: layer_ref.optional(),
|
|
375
430
|
pcbMarginTop: distance8.optional(),
|
|
376
431
|
pcbMarginRight: distance8.optional(),
|
|
@@ -380,11 +435,11 @@ var pcbLayoutProps = z16.object({
|
|
|
380
435
|
pcbMarginY: distance8.optional(),
|
|
381
436
|
pcbStyle: pcbStyle.optional(),
|
|
382
437
|
pcbSx: pcbSx.optional(),
|
|
383
|
-
pcbRelative:
|
|
384
|
-
relative:
|
|
438
|
+
pcbRelative: z19.boolean().optional(),
|
|
439
|
+
relative: z19.boolean().optional()
|
|
385
440
|
});
|
|
386
441
|
expectTypesMatch(true);
|
|
387
|
-
var commonLayoutProps =
|
|
442
|
+
var commonLayoutProps = z19.object({
|
|
388
443
|
pcbX: pcbCoordinate.optional(),
|
|
389
444
|
pcbY: pcbCoordinate.optional(),
|
|
390
445
|
pcbLeftEdgeX: pcbCoordinate.optional(),
|
|
@@ -394,14 +449,14 @@ var commonLayoutProps = z16.object({
|
|
|
394
449
|
pcbOffsetX: distance8.optional(),
|
|
395
450
|
pcbOffsetY: distance8.optional(),
|
|
396
451
|
pcbRotation: rotation2.optional(),
|
|
397
|
-
pcbPositionAnchor:
|
|
398
|
-
pcbPositionMode:
|
|
452
|
+
pcbPositionAnchor: z19.string().optional(),
|
|
453
|
+
pcbPositionMode: z19.enum([
|
|
399
454
|
"relative_to_group_anchor",
|
|
400
455
|
"auto",
|
|
401
456
|
"relative_to_board_anchor",
|
|
402
457
|
"relative_to_component_anchor"
|
|
403
458
|
]).optional(),
|
|
404
|
-
shouldBeOnEdgeOfBoard:
|
|
459
|
+
shouldBeOnEdgeOfBoard: z19.boolean().optional(),
|
|
405
460
|
pcbMarginTop: distance8.optional(),
|
|
406
461
|
pcbMarginRight: distance8.optional(),
|
|
407
462
|
pcbMarginBottom: distance8.optional(),
|
|
@@ -423,44 +478,44 @@ var commonLayoutProps = z16.object({
|
|
|
423
478
|
footprint: footprintProp.optional(),
|
|
424
479
|
symbol: symbolProp.optional(),
|
|
425
480
|
schStyle: schStyle.optional(),
|
|
426
|
-
relative:
|
|
427
|
-
schRelative:
|
|
428
|
-
pcbRelative:
|
|
481
|
+
relative: z19.boolean().optional(),
|
|
482
|
+
schRelative: z19.boolean().optional(),
|
|
483
|
+
pcbRelative: z19.boolean().optional()
|
|
429
484
|
});
|
|
430
485
|
expectTypesMatch(true);
|
|
431
|
-
var supplierProps =
|
|
432
|
-
supplierPartNumbers:
|
|
486
|
+
var supplierProps = z19.object({
|
|
487
|
+
supplierPartNumbers: z19.record(supplier_name, z19.array(z19.string())).optional()
|
|
433
488
|
});
|
|
434
489
|
expectTypesMatch(true);
|
|
435
490
|
var commonComponentProps = commonLayoutProps.merge(supplierProps).extend({
|
|
436
|
-
key:
|
|
437
|
-
name:
|
|
438
|
-
displayName:
|
|
439
|
-
schSectionName:
|
|
491
|
+
key: z19.any().optional(),
|
|
492
|
+
name: z19.string(),
|
|
493
|
+
displayName: z19.string().optional(),
|
|
494
|
+
schSectionName: z19.string().optional().describe(
|
|
440
495
|
'This component will be drawn as part of this section e.g. "Power"'
|
|
441
496
|
),
|
|
442
|
-
schSheetName:
|
|
497
|
+
schSheetName: z19.string().optional().describe(
|
|
443
498
|
'This component will be drawn as part of this sheet e.g. "Main"'
|
|
444
499
|
),
|
|
445
500
|
datasheetUrl: url.optional(),
|
|
446
501
|
cadModel: cadModelProp.optional(),
|
|
447
502
|
kicadFootprintMetadata: kicadFootprintMetadata.optional(),
|
|
448
503
|
kicadSymbolMetadata: kicadSymbolMetadata.optional(),
|
|
449
|
-
children:
|
|
450
|
-
symbolName:
|
|
451
|
-
doNotPlace:
|
|
452
|
-
allowOffBoard:
|
|
504
|
+
children: z19.any().optional(),
|
|
505
|
+
symbolName: z19.string().optional(),
|
|
506
|
+
doNotPlace: z19.boolean().optional(),
|
|
507
|
+
allowOffBoard: z19.boolean().optional().describe(
|
|
453
508
|
"Allows the PCB component to hang off the board (e.g. for USB ports or displays)"
|
|
454
509
|
),
|
|
455
|
-
obstructsWithinBounds:
|
|
510
|
+
obstructsWithinBounds: z19.boolean().optional().describe(
|
|
456
511
|
"Does this component take up all the space within its bounds on a layer. This is generally true except for when separated pin headers are being represented by a single component (in which case, chips can be placed between the pin headers) or for tall modules where chips fit underneath"
|
|
457
512
|
),
|
|
458
|
-
showAsTranslucentModel:
|
|
513
|
+
showAsTranslucentModel: z19.boolean().optional().describe(
|
|
459
514
|
"Whether to show this component's CAD model as translucent in the 3D viewer."
|
|
460
515
|
),
|
|
461
|
-
pinAttributes:
|
|
462
|
-
mfn:
|
|
463
|
-
manufacturerPartNumber:
|
|
516
|
+
pinAttributes: z19.record(z19.string(), pinAttributeMap).optional(),
|
|
517
|
+
mfn: z19.string().describe("Manufacturer Part Number").optional(),
|
|
518
|
+
manufacturerPartNumber: z19.string().optional()
|
|
464
519
|
});
|
|
465
520
|
expectTypesMatch(true);
|
|
466
521
|
var componentProps = commonComponentProps;
|
|
@@ -475,7 +530,7 @@ var lrPolarPins = [
|
|
|
475
530
|
"cathode",
|
|
476
531
|
"neg"
|
|
477
532
|
];
|
|
478
|
-
var distanceOrMultiplier = distance8.or(
|
|
533
|
+
var distanceOrMultiplier = distance8.or(z19.enum(["2x", "3x", "4x"]));
|
|
479
534
|
|
|
480
535
|
// lib/generated/kicad-autocomplete.ts
|
|
481
536
|
var kicadFootprintKeys = [
|
|
@@ -15941,8 +15996,8 @@ var footprinterStringExamples = [
|
|
|
15941
15996
|
];
|
|
15942
15997
|
|
|
15943
15998
|
// lib/common/schematicOrientation.ts
|
|
15944
|
-
import { z as
|
|
15945
|
-
var schematicOrientation =
|
|
15999
|
+
import { z as z20 } from "zod";
|
|
16000
|
+
var schematicOrientation = z20.enum([
|
|
15946
16001
|
"vertical",
|
|
15947
16002
|
"horizontal",
|
|
15948
16003
|
"pos_top",
|
|
@@ -15961,32 +16016,32 @@ expectTypesMatch(
|
|
|
15961
16016
|
);
|
|
15962
16017
|
|
|
15963
16018
|
// lib/common/schematicPinDefinitions.ts
|
|
15964
|
-
import { z as
|
|
15965
|
-
var explicitPinSideDefinition =
|
|
15966
|
-
pins:
|
|
15967
|
-
direction:
|
|
15968
|
-
|
|
15969
|
-
|
|
15970
|
-
|
|
15971
|
-
|
|
16019
|
+
import { z as z21 } from "zod";
|
|
16020
|
+
var explicitPinSideDefinition = z21.object({
|
|
16021
|
+
pins: z21.array(z21.union([z21.number(), z21.string()])),
|
|
16022
|
+
direction: z21.union([
|
|
16023
|
+
z21.literal("top-to-bottom"),
|
|
16024
|
+
z21.literal("left-to-right"),
|
|
16025
|
+
z21.literal("bottom-to-top"),
|
|
16026
|
+
z21.literal("right-to-left")
|
|
15972
16027
|
])
|
|
15973
16028
|
});
|
|
15974
|
-
var pinSideDefinitionInput =
|
|
15975
|
-
var pinSideDefinitionWithDefaultDirection = (direction2) =>
|
|
16029
|
+
var pinSideDefinitionInput = z21.array(z21.union([z21.number(), z21.string()]));
|
|
16030
|
+
var pinSideDefinitionWithDefaultDirection = (direction2) => z21.union([explicitPinSideDefinition, pinSideDefinitionInput]).transform(
|
|
15976
16031
|
(value) => Array.isArray(value) ? {
|
|
15977
16032
|
pins: value,
|
|
15978
16033
|
direction: direction2
|
|
15979
16034
|
} : value
|
|
15980
16035
|
);
|
|
15981
|
-
var schematicPortArrangement =
|
|
15982
|
-
leftSize:
|
|
15983
|
-
topSize:
|
|
15984
|
-
rightSize:
|
|
15985
|
-
bottomSize:
|
|
15986
|
-
leftPinCount:
|
|
15987
|
-
rightPinCount:
|
|
15988
|
-
topPinCount:
|
|
15989
|
-
bottomPinCount:
|
|
16036
|
+
var schematicPortArrangement = z21.object({
|
|
16037
|
+
leftSize: z21.number().optional().describe("@deprecated, use leftPinCount"),
|
|
16038
|
+
topSize: z21.number().optional().describe("@deprecated, use topPinCount"),
|
|
16039
|
+
rightSize: z21.number().optional().describe("@deprecated, use rightPinCount"),
|
|
16040
|
+
bottomSize: z21.number().optional().describe("@deprecated, use bottomPinCount"),
|
|
16041
|
+
leftPinCount: z21.number().optional(),
|
|
16042
|
+
rightPinCount: z21.number().optional(),
|
|
16043
|
+
topPinCount: z21.number().optional(),
|
|
16044
|
+
bottomPinCount: z21.number().optional(),
|
|
15990
16045
|
leftSide: pinSideDefinitionWithDefaultDirection("top-to-bottom").optional(),
|
|
15991
16046
|
rightSide: pinSideDefinitionWithDefaultDirection("top-to-bottom").optional(),
|
|
15992
16047
|
topSide: pinSideDefinitionWithDefaultDirection("left-to-right").optional(),
|
|
@@ -15997,9 +16052,9 @@ expectTypesMatch(true);
|
|
|
15997
16052
|
|
|
15998
16053
|
// lib/common/schematicPinStyle.ts
|
|
15999
16054
|
import { distance as distance9 } from "circuit-json";
|
|
16000
|
-
import { z as
|
|
16001
|
-
var schematicPinStyle =
|
|
16002
|
-
|
|
16055
|
+
import { z as z22 } from "zod";
|
|
16056
|
+
var schematicPinStyle = z22.record(
|
|
16057
|
+
z22.object({
|
|
16003
16058
|
marginLeft: distance9.optional(),
|
|
16004
16059
|
marginRight: distance9.optional(),
|
|
16005
16060
|
marginTop: distance9.optional(),
|
|
@@ -16013,17 +16068,17 @@ var schematicPinStyle = z19.record(
|
|
|
16013
16068
|
expectTypesMatch(true);
|
|
16014
16069
|
|
|
16015
16070
|
// lib/common/schematicPinLabel.ts
|
|
16016
|
-
import { z as
|
|
16017
|
-
var schematicPinLabel =
|
|
16071
|
+
import { z as z23 } from "zod";
|
|
16072
|
+
var schematicPinLabel = z23.string().regex(/^[A-Za-z0-9_]+$/);
|
|
16018
16073
|
|
|
16019
16074
|
// lib/common/schematicSize.ts
|
|
16020
16075
|
import { distance as distance10 } from "circuit-json";
|
|
16021
|
-
import { z as
|
|
16022
|
-
var schematicSymbolSize = distance10.or(
|
|
16076
|
+
import { z as z24 } from "zod";
|
|
16077
|
+
var schematicSymbolSize = distance10.or(z24.enum(["xs", "sm", "default", "md"])).describe("distance between pin1 and pin2 of the schematic symbol");
|
|
16023
16078
|
|
|
16024
16079
|
// lib/common/kicadPinMetadata.ts
|
|
16025
|
-
import { z as
|
|
16026
|
-
var kicadPinElectricalType =
|
|
16080
|
+
import { z as z25 } from "zod";
|
|
16081
|
+
var kicadPinElectricalType = z25.enum([
|
|
16027
16082
|
"input",
|
|
16028
16083
|
"output",
|
|
16029
16084
|
"bidirectional",
|
|
@@ -16037,7 +16092,7 @@ var kicadPinElectricalType = z22.enum([
|
|
|
16037
16092
|
"open_emitter",
|
|
16038
16093
|
"no_connect"
|
|
16039
16094
|
]);
|
|
16040
|
-
var kicadPinGraphicStyle =
|
|
16095
|
+
var kicadPinGraphicStyle = z25.enum([
|
|
16041
16096
|
"line",
|
|
16042
16097
|
"inverted",
|
|
16043
16098
|
"clock",
|
|
@@ -16048,7 +16103,7 @@ var kicadPinGraphicStyle = z22.enum([
|
|
|
16048
16103
|
"falling_edge_clock",
|
|
16049
16104
|
"nonlogic"
|
|
16050
16105
|
]);
|
|
16051
|
-
var kicadPinMetadata =
|
|
16106
|
+
var kicadPinMetadata = z25.object({
|
|
16052
16107
|
electricalType: kicadPinElectricalType.optional(),
|
|
16053
16108
|
graphicStyle: kicadPinGraphicStyle.optional(),
|
|
16054
16109
|
pinLength: distance.optional(),
|
|
@@ -16058,14 +16113,14 @@ var kicadPinMetadata = z22.object({
|
|
|
16058
16113
|
expectTypesMatch(true);
|
|
16059
16114
|
|
|
16060
16115
|
// lib/customDrc.ts
|
|
16061
|
-
import { z as
|
|
16062
|
-
var customDrcCheckFn =
|
|
16116
|
+
import { z as z26 } from "zod";
|
|
16117
|
+
var customDrcCheckFn = z26.custom(
|
|
16063
16118
|
(value) => typeof value === "function"
|
|
16064
16119
|
);
|
|
16065
16120
|
|
|
16066
16121
|
// lib/common/ninePointAnchor.ts
|
|
16067
|
-
import { z as
|
|
16068
|
-
var ninePointAnchor =
|
|
16122
|
+
import { z as z27 } from "zod";
|
|
16123
|
+
var ninePointAnchor = z27.enum([
|
|
16069
16124
|
"top_left",
|
|
16070
16125
|
"top_center",
|
|
16071
16126
|
"top_right",
|
|
@@ -16078,47 +16133,47 @@ var ninePointAnchor = z24.enum([
|
|
|
16078
16133
|
]);
|
|
16079
16134
|
|
|
16080
16135
|
// lib/components/board.ts
|
|
16081
|
-
import { z as
|
|
16136
|
+
import { z as z41 } from "zod";
|
|
16082
16137
|
|
|
16083
16138
|
// lib/components/group.ts
|
|
16084
16139
|
import {
|
|
16085
16140
|
length as length3,
|
|
16086
16141
|
distance as distance11
|
|
16087
16142
|
} from "circuit-json";
|
|
16088
|
-
import { z as
|
|
16143
|
+
import { z as z40 } from "zod";
|
|
16089
16144
|
|
|
16090
16145
|
// lib/manual-edits/manual-edit-events/base_manual_edit_event.ts
|
|
16091
|
-
import { z as
|
|
16092
|
-
var base_manual_edit_event =
|
|
16093
|
-
edit_event_id:
|
|
16094
|
-
in_progress:
|
|
16095
|
-
created_at:
|
|
16146
|
+
import { z as z28 } from "zod";
|
|
16147
|
+
var base_manual_edit_event = z28.object({
|
|
16148
|
+
edit_event_id: z28.string(),
|
|
16149
|
+
in_progress: z28.boolean().optional(),
|
|
16150
|
+
created_at: z28.number()
|
|
16096
16151
|
});
|
|
16097
16152
|
expectTypesMatch(
|
|
16098
16153
|
true
|
|
16099
16154
|
);
|
|
16100
16155
|
|
|
16101
16156
|
// lib/manual-edits/manual-edit-events/edit_pcb_component_location_event.ts
|
|
16102
|
-
import { z as
|
|
16157
|
+
import { z as z29 } from "zod";
|
|
16103
16158
|
var edit_pcb_component_location_event = base_manual_edit_event.extend({
|
|
16104
|
-
pcb_edit_event_type:
|
|
16105
|
-
edit_event_type:
|
|
16106
|
-
pcb_component_id:
|
|
16107
|
-
original_center:
|
|
16108
|
-
new_center:
|
|
16159
|
+
pcb_edit_event_type: z29.literal("edit_component_location").describe("deprecated"),
|
|
16160
|
+
edit_event_type: z29.literal("edit_pcb_component_location"),
|
|
16161
|
+
pcb_component_id: z29.string(),
|
|
16162
|
+
original_center: z29.object({ x: z29.number(), y: z29.number() }),
|
|
16163
|
+
new_center: z29.object({ x: z29.number(), y: z29.number() })
|
|
16109
16164
|
});
|
|
16110
16165
|
var edit_component_location_event = edit_pcb_component_location_event;
|
|
16111
16166
|
expectTypesMatch(true);
|
|
16112
16167
|
|
|
16113
16168
|
// lib/manual-edits/manual-edit-events/edit_trace_hint_event.ts
|
|
16114
|
-
import { z as
|
|
16169
|
+
import { z as z30 } from "zod";
|
|
16115
16170
|
var edit_trace_hint_event = base_manual_edit_event.extend({
|
|
16116
|
-
pcb_edit_event_type:
|
|
16117
|
-
edit_event_type:
|
|
16118
|
-
pcb_port_id:
|
|
16119
|
-
pcb_trace_hint_id:
|
|
16120
|
-
route:
|
|
16121
|
-
|
|
16171
|
+
pcb_edit_event_type: z30.literal("edit_trace_hint").describe("deprecated"),
|
|
16172
|
+
edit_event_type: z30.literal("edit_pcb_trace_hint").optional(),
|
|
16173
|
+
pcb_port_id: z30.string(),
|
|
16174
|
+
pcb_trace_hint_id: z30.string().optional(),
|
|
16175
|
+
route: z30.array(
|
|
16176
|
+
z30.object({ x: z30.number(), y: z30.number(), via: z30.boolean().optional() })
|
|
16122
16177
|
)
|
|
16123
16178
|
});
|
|
16124
16179
|
expectTypesMatch(
|
|
@@ -16126,38 +16181,38 @@ expectTypesMatch(
|
|
|
16126
16181
|
);
|
|
16127
16182
|
|
|
16128
16183
|
// lib/manual-edits/manual-edit-events/edit_schematic_component_location_event.ts
|
|
16129
|
-
import { z as
|
|
16184
|
+
import { z as z31 } from "zod";
|
|
16130
16185
|
var edit_schematic_component_location_event = base_manual_edit_event.extend({
|
|
16131
|
-
edit_event_type:
|
|
16132
|
-
schematic_component_id:
|
|
16133
|
-
original_center:
|
|
16134
|
-
new_center:
|
|
16186
|
+
edit_event_type: z31.literal("edit_schematic_component_location"),
|
|
16187
|
+
schematic_component_id: z31.string(),
|
|
16188
|
+
original_center: z31.object({ x: z31.number(), y: z31.number() }),
|
|
16189
|
+
new_center: z31.object({ x: z31.number(), y: z31.number() })
|
|
16135
16190
|
});
|
|
16136
16191
|
expectTypesMatch(true);
|
|
16137
16192
|
|
|
16138
16193
|
// lib/manual-edits/manual-edit-events/edit_pcb_group_location_event.ts
|
|
16139
|
-
import { z as
|
|
16194
|
+
import { z as z32 } from "zod";
|
|
16140
16195
|
var edit_pcb_group_location_event = base_manual_edit_event.extend({
|
|
16141
|
-
edit_event_type:
|
|
16142
|
-
pcb_group_id:
|
|
16143
|
-
original_center:
|
|
16144
|
-
new_center:
|
|
16196
|
+
edit_event_type: z32.literal("edit_pcb_group_location"),
|
|
16197
|
+
pcb_group_id: z32.string(),
|
|
16198
|
+
original_center: z32.object({ x: z32.number(), y: z32.number() }),
|
|
16199
|
+
new_center: z32.object({ x: z32.number(), y: z32.number() })
|
|
16145
16200
|
});
|
|
16146
16201
|
expectTypesMatch(true);
|
|
16147
16202
|
|
|
16148
16203
|
// lib/manual-edits/manual-edit-events/edit_schematic_group_location_event.ts
|
|
16149
|
-
import { z as
|
|
16204
|
+
import { z as z33 } from "zod";
|
|
16150
16205
|
var edit_schematic_group_location_event = base_manual_edit_event.extend({
|
|
16151
|
-
edit_event_type:
|
|
16152
|
-
schematic_group_id:
|
|
16153
|
-
original_center:
|
|
16154
|
-
new_center:
|
|
16206
|
+
edit_event_type: z33.literal("edit_schematic_group_location"),
|
|
16207
|
+
schematic_group_id: z33.string(),
|
|
16208
|
+
original_center: z33.object({ x: z33.number(), y: z33.number() }),
|
|
16209
|
+
new_center: z33.object({ x: z33.number(), y: z33.number() })
|
|
16155
16210
|
});
|
|
16156
16211
|
expectTypesMatch(true);
|
|
16157
16212
|
|
|
16158
16213
|
// lib/manual-edits/manual_edit_event.ts
|
|
16159
|
-
import { z as
|
|
16160
|
-
var manual_edit_event =
|
|
16214
|
+
import { z as z34 } from "zod";
|
|
16215
|
+
var manual_edit_event = z34.union([
|
|
16161
16216
|
edit_pcb_component_location_event,
|
|
16162
16217
|
edit_trace_hint_event,
|
|
16163
16218
|
edit_schematic_component_location_event
|
|
@@ -16165,33 +16220,33 @@ var manual_edit_event = z31.union([
|
|
|
16165
16220
|
expectTypesMatch(true);
|
|
16166
16221
|
|
|
16167
16222
|
// lib/manual-edits/manual_edits_file.ts
|
|
16168
|
-
import { z as
|
|
16223
|
+
import { z as z38 } from "zod";
|
|
16169
16224
|
|
|
16170
16225
|
// lib/manual-edits/manual_pcb_placement.ts
|
|
16171
|
-
import { z as
|
|
16226
|
+
import { z as z35 } from "zod";
|
|
16172
16227
|
import { point as point2 } from "circuit-json";
|
|
16173
|
-
var manual_pcb_placement =
|
|
16174
|
-
selector:
|
|
16175
|
-
relative_to:
|
|
16228
|
+
var manual_pcb_placement = z35.object({
|
|
16229
|
+
selector: z35.string(),
|
|
16230
|
+
relative_to: z35.string().optional().default("group_center").describe("Can be a selector or 'group_center'"),
|
|
16176
16231
|
center: point2
|
|
16177
16232
|
});
|
|
16178
16233
|
expectTypesMatch(true);
|
|
16179
16234
|
|
|
16180
16235
|
// lib/manual-edits/manual_trace_hint.ts
|
|
16181
|
-
import { z as
|
|
16236
|
+
import { z as z36 } from "zod";
|
|
16182
16237
|
import { route_hint_point } from "circuit-json";
|
|
16183
|
-
var manual_trace_hint =
|
|
16184
|
-
pcb_port_selector:
|
|
16185
|
-
offsets:
|
|
16238
|
+
var manual_trace_hint = z36.object({
|
|
16239
|
+
pcb_port_selector: z36.string(),
|
|
16240
|
+
offsets: z36.array(route_hint_point)
|
|
16186
16241
|
});
|
|
16187
16242
|
expectTypesMatch(true);
|
|
16188
16243
|
|
|
16189
16244
|
// lib/manual-edits/manual_schematic_placement.ts
|
|
16190
|
-
import { z as
|
|
16245
|
+
import { z as z37 } from "zod";
|
|
16191
16246
|
import { point as point4 } from "circuit-json";
|
|
16192
|
-
var manual_schematic_placement =
|
|
16193
|
-
selector:
|
|
16194
|
-
relative_to:
|
|
16247
|
+
var manual_schematic_placement = z37.object({
|
|
16248
|
+
selector: z37.string(),
|
|
16249
|
+
relative_to: z37.string().optional().default("group_center").describe("Can be a selector or 'group_center'"),
|
|
16195
16250
|
center: point4
|
|
16196
16251
|
});
|
|
16197
16252
|
expectTypesMatch(
|
|
@@ -16199,37 +16254,37 @@ expectTypesMatch(
|
|
|
16199
16254
|
);
|
|
16200
16255
|
|
|
16201
16256
|
// lib/manual-edits/manual_edits_file.ts
|
|
16202
|
-
var manual_edits_file =
|
|
16203
|
-
pcb_placements:
|
|
16204
|
-
manual_trace_hints:
|
|
16205
|
-
schematic_placements:
|
|
16257
|
+
var manual_edits_file = z38.object({
|
|
16258
|
+
pcb_placements: z38.array(manual_pcb_placement).optional(),
|
|
16259
|
+
manual_trace_hints: z38.array(manual_trace_hint).optional(),
|
|
16260
|
+
schematic_placements: z38.array(manual_schematic_placement).optional()
|
|
16206
16261
|
});
|
|
16207
16262
|
expectTypesMatch(true);
|
|
16208
16263
|
|
|
16209
16264
|
// lib/common/connectionsProp.ts
|
|
16210
|
-
import { z as
|
|
16211
|
-
var connectionTarget =
|
|
16265
|
+
import { z as z39 } from "zod";
|
|
16266
|
+
var connectionTarget = z39.string().or(z39.array(z39.string()).readonly()).or(z39.array(z39.string()));
|
|
16212
16267
|
var createConnectionsProp = (labels) => {
|
|
16213
|
-
return
|
|
16268
|
+
return z39.record(z39.enum(labels), connectionTarget);
|
|
16214
16269
|
};
|
|
16215
16270
|
|
|
16216
16271
|
// lib/components/group.ts
|
|
16217
|
-
var layoutConfig =
|
|
16218
|
-
layoutMode:
|
|
16219
|
-
position:
|
|
16220
|
-
grid:
|
|
16221
|
-
gridCols:
|
|
16222
|
-
gridRows:
|
|
16223
|
-
gridTemplateRows:
|
|
16224
|
-
gridTemplateColumns:
|
|
16225
|
-
gridTemplate:
|
|
16226
|
-
gridGap:
|
|
16227
|
-
gridRowGap:
|
|
16228
|
-
gridColumnGap:
|
|
16229
|
-
flex:
|
|
16230
|
-
flexDirection:
|
|
16231
|
-
alignItems:
|
|
16232
|
-
justifyContent:
|
|
16272
|
+
var layoutConfig = z40.object({
|
|
16273
|
+
layoutMode: z40.enum(["grid", "flex", "match-adapt", "relative", "none"]).optional(),
|
|
16274
|
+
position: z40.enum(["absolute", "relative"]).optional(),
|
|
16275
|
+
grid: z40.boolean().optional(),
|
|
16276
|
+
gridCols: z40.number().or(z40.string()).optional(),
|
|
16277
|
+
gridRows: z40.number().or(z40.string()).optional(),
|
|
16278
|
+
gridTemplateRows: z40.string().optional(),
|
|
16279
|
+
gridTemplateColumns: z40.string().optional(),
|
|
16280
|
+
gridTemplate: z40.string().optional(),
|
|
16281
|
+
gridGap: z40.number().or(z40.string()).optional(),
|
|
16282
|
+
gridRowGap: z40.number().or(z40.string()).optional(),
|
|
16283
|
+
gridColumnGap: z40.number().or(z40.string()).optional(),
|
|
16284
|
+
flex: z40.boolean().or(z40.string()).optional(),
|
|
16285
|
+
flexDirection: z40.enum(["row", "column"]).optional(),
|
|
16286
|
+
alignItems: z40.enum(["start", "center", "end", "stretch"]).optional(),
|
|
16287
|
+
justifyContent: z40.enum([
|
|
16233
16288
|
"start",
|
|
16234
16289
|
"center",
|
|
16235
16290
|
"end",
|
|
@@ -16238,16 +16293,16 @@ var layoutConfig = z37.object({
|
|
|
16238
16293
|
"space-around",
|
|
16239
16294
|
"space-evenly"
|
|
16240
16295
|
]).optional(),
|
|
16241
|
-
flexRow:
|
|
16242
|
-
flexColumn:
|
|
16243
|
-
gap:
|
|
16244
|
-
pack:
|
|
16245
|
-
packOrderStrategy:
|
|
16296
|
+
flexRow: z40.boolean().optional(),
|
|
16297
|
+
flexColumn: z40.boolean().optional(),
|
|
16298
|
+
gap: z40.number().or(z40.string()).optional(),
|
|
16299
|
+
pack: z40.boolean().optional().describe("Pack the contents of this group using a packing strategy"),
|
|
16300
|
+
packOrderStrategy: z40.enum([
|
|
16246
16301
|
"largest_to_smallest",
|
|
16247
16302
|
"first_to_last",
|
|
16248
16303
|
"highest_to_lowest_pin_count"
|
|
16249
16304
|
]).optional(),
|
|
16250
|
-
packPlacementStrategy:
|
|
16305
|
+
packPlacementStrategy: z40.enum(["shortest_connection_along_outline"]).optional(),
|
|
16251
16306
|
padding: length3.optional(),
|
|
16252
16307
|
paddingLeft: length3.optional(),
|
|
16253
16308
|
paddingRight: length3.optional(),
|
|
@@ -16257,17 +16312,17 @@ var layoutConfig = z37.object({
|
|
|
16257
16312
|
paddingY: length3.optional(),
|
|
16258
16313
|
width: length3.optional(),
|
|
16259
16314
|
height: length3.optional(),
|
|
16260
|
-
matchAdapt:
|
|
16261
|
-
matchAdaptTemplate:
|
|
16315
|
+
matchAdapt: z40.boolean().optional(),
|
|
16316
|
+
matchAdaptTemplate: z40.any().optional()
|
|
16262
16317
|
});
|
|
16263
16318
|
expectTypesMatch(true);
|
|
16264
|
-
var border =
|
|
16319
|
+
var border = z40.object({
|
|
16265
16320
|
strokeWidth: length3.optional(),
|
|
16266
|
-
dashed:
|
|
16267
|
-
solid:
|
|
16321
|
+
dashed: z40.boolean().optional(),
|
|
16322
|
+
solid: z40.boolean().optional()
|
|
16268
16323
|
});
|
|
16269
|
-
var pcbAnchorAlignmentAutocomplete =
|
|
16270
|
-
var routingTolerances =
|
|
16324
|
+
var pcbAnchorAlignmentAutocomplete = z40.custom((value) => typeof value === "string");
|
|
16325
|
+
var routingTolerances = z40.object({
|
|
16271
16326
|
minTraceWidth: length3.optional(),
|
|
16272
16327
|
minViaHoleEdgeToViaHoleEdgeClearance: length3.optional(),
|
|
16273
16328
|
minViaEdgeToPadEdgeClearance: length3.optional(),
|
|
@@ -16278,19 +16333,19 @@ var routingTolerances = z37.object({
|
|
|
16278
16333
|
minViaHoleDiameter: length3.optional(),
|
|
16279
16334
|
minViaPadDiameter: length3.optional()
|
|
16280
16335
|
});
|
|
16281
|
-
var autorouterConfig =
|
|
16336
|
+
var autorouterConfig = z40.object({
|
|
16282
16337
|
serverUrl: url.optional(),
|
|
16283
|
-
inputFormat:
|
|
16284
|
-
serverMode:
|
|
16285
|
-
serverCacheEnabled:
|
|
16286
|
-
cache:
|
|
16338
|
+
inputFormat: z40.enum(["simplified", "circuit-json"]).optional(),
|
|
16339
|
+
serverMode: z40.enum(["job", "solve-endpoint"]).optional(),
|
|
16340
|
+
serverCacheEnabled: z40.boolean().optional(),
|
|
16341
|
+
cache: z40.custom((v) => true).optional(),
|
|
16287
16342
|
traceClearance: length3.optional(),
|
|
16288
|
-
availableJumperTypes:
|
|
16289
|
-
groupMode:
|
|
16290
|
-
algorithmFn:
|
|
16343
|
+
availableJumperTypes: z40.array(z40.enum(["1206x4", "0603"])).optional(),
|
|
16344
|
+
groupMode: z40.enum(["sequential_trace", "subcircuit", "sequential-trace"]).optional(),
|
|
16345
|
+
algorithmFn: z40.custom(
|
|
16291
16346
|
(v) => typeof v === "function" || v === void 0
|
|
16292
16347
|
).optional(),
|
|
16293
|
-
preset:
|
|
16348
|
+
preset: z40.enum([
|
|
16294
16349
|
"sequential_trace",
|
|
16295
16350
|
"subcircuit",
|
|
16296
16351
|
"default",
|
|
@@ -16307,61 +16362,61 @@ var autorouterConfig = z37.object({
|
|
|
16307
16362
|
"auto-local",
|
|
16308
16363
|
"auto-cloud"
|
|
16309
16364
|
]).optional(),
|
|
16310
|
-
local:
|
|
16365
|
+
local: z40.boolean().optional()
|
|
16311
16366
|
});
|
|
16312
|
-
var autorouterPreset =
|
|
16313
|
-
|
|
16314
|
-
|
|
16315
|
-
|
|
16316
|
-
|
|
16317
|
-
|
|
16318
|
-
|
|
16319
|
-
|
|
16320
|
-
|
|
16321
|
-
|
|
16322
|
-
|
|
16323
|
-
|
|
16367
|
+
var autorouterPreset = z40.union([
|
|
16368
|
+
z40.literal("sequential_trace"),
|
|
16369
|
+
z40.literal("subcircuit"),
|
|
16370
|
+
z40.literal("default"),
|
|
16371
|
+
z40.literal("auto"),
|
|
16372
|
+
z40.literal("auto_local"),
|
|
16373
|
+
z40.literal("auto_cloud"),
|
|
16374
|
+
z40.literal("auto_jumper"),
|
|
16375
|
+
z40.literal("tscircuit_beta"),
|
|
16376
|
+
z40.literal("krt"),
|
|
16377
|
+
z40.literal("freerouting"),
|
|
16378
|
+
z40.literal("laser_prefab"),
|
|
16324
16379
|
// Prefabricated PCB with laser copper ablation
|
|
16325
|
-
|
|
16326
|
-
|
|
16327
|
-
|
|
16328
|
-
|
|
16380
|
+
z40.literal("auto-jumper"),
|
|
16381
|
+
z40.literal("sequential-trace"),
|
|
16382
|
+
z40.literal("auto-local"),
|
|
16383
|
+
z40.literal("auto-cloud")
|
|
16329
16384
|
]);
|
|
16330
|
-
var autorouterString =
|
|
16331
|
-
var autorouterProp =
|
|
16385
|
+
var autorouterString = z40.string();
|
|
16386
|
+
var autorouterProp = z40.union([
|
|
16332
16387
|
autorouterConfig,
|
|
16333
16388
|
autorouterPreset,
|
|
16334
16389
|
autorouterString
|
|
16335
16390
|
]);
|
|
16336
|
-
var autorouterEffortLevel =
|
|
16391
|
+
var autorouterEffortLevel = z40.enum(["1x", "2x", "5x", "10x", "100x"]);
|
|
16337
16392
|
var baseGroupProps = commonLayoutProps.extend({
|
|
16338
|
-
name:
|
|
16339
|
-
children:
|
|
16340
|
-
schTitle:
|
|
16341
|
-
schSheetName:
|
|
16342
|
-
key:
|
|
16343
|
-
showAsSchematicBox:
|
|
16344
|
-
connections:
|
|
16393
|
+
name: z40.string().optional(),
|
|
16394
|
+
children: z40.any().optional(),
|
|
16395
|
+
schTitle: z40.string().optional(),
|
|
16396
|
+
schSheetName: z40.string().optional().describe('This group will be drawn as part of this sheet e.g. "Main"'),
|
|
16397
|
+
key: z40.any().optional(),
|
|
16398
|
+
showAsSchematicBox: z40.boolean().optional(),
|
|
16399
|
+
connections: z40.record(z40.string(), connectionTarget.optional()).optional(),
|
|
16345
16400
|
schPinArrangement: schematicPinArrangement.optional(),
|
|
16346
16401
|
schPinSpacing: length3.optional(),
|
|
16347
16402
|
schPinStyle: schematicPinStyle.optional(),
|
|
16348
16403
|
...layoutConfig.shape,
|
|
16349
16404
|
grid: layoutConfig.shape.grid.describe("@deprecated use pcbGrid"),
|
|
16350
16405
|
flex: layoutConfig.shape.flex.describe("@deprecated use pcbFlex"),
|
|
16351
|
-
pcbGrid:
|
|
16352
|
-
pcbGridCols:
|
|
16353
|
-
pcbGridRows:
|
|
16354
|
-
pcbGridTemplateRows:
|
|
16355
|
-
pcbGridTemplateColumns:
|
|
16356
|
-
pcbGridTemplate:
|
|
16357
|
-
pcbGridGap:
|
|
16358
|
-
pcbGridRowGap:
|
|
16359
|
-
pcbGridColumnGap:
|
|
16360
|
-
pcbFlex:
|
|
16361
|
-
pcbFlexGap:
|
|
16362
|
-
pcbFlexDirection:
|
|
16363
|
-
pcbAlignItems:
|
|
16364
|
-
pcbJustifyContent:
|
|
16406
|
+
pcbGrid: z40.boolean().optional(),
|
|
16407
|
+
pcbGridCols: z40.number().or(z40.string()).optional(),
|
|
16408
|
+
pcbGridRows: z40.number().or(z40.string()).optional(),
|
|
16409
|
+
pcbGridTemplateRows: z40.string().optional(),
|
|
16410
|
+
pcbGridTemplateColumns: z40.string().optional(),
|
|
16411
|
+
pcbGridTemplate: z40.string().optional(),
|
|
16412
|
+
pcbGridGap: z40.number().or(z40.string()).optional(),
|
|
16413
|
+
pcbGridRowGap: z40.number().or(z40.string()).optional(),
|
|
16414
|
+
pcbGridColumnGap: z40.number().or(z40.string()).optional(),
|
|
16415
|
+
pcbFlex: z40.boolean().or(z40.string()).optional(),
|
|
16416
|
+
pcbFlexGap: z40.number().or(z40.string()).optional(),
|
|
16417
|
+
pcbFlexDirection: z40.enum(["row", "column"]).optional(),
|
|
16418
|
+
pcbAlignItems: z40.enum(["start", "center", "end", "stretch"]).optional(),
|
|
16419
|
+
pcbJustifyContent: z40.enum([
|
|
16365
16420
|
"start",
|
|
16366
16421
|
"center",
|
|
16367
16422
|
"end",
|
|
@@ -16370,25 +16425,25 @@ var baseGroupProps = commonLayoutProps.extend({
|
|
|
16370
16425
|
"space-around",
|
|
16371
16426
|
"space-evenly"
|
|
16372
16427
|
]).optional(),
|
|
16373
|
-
pcbFlexRow:
|
|
16374
|
-
pcbFlexColumn:
|
|
16375
|
-
pcbGap:
|
|
16376
|
-
pcbPack:
|
|
16377
|
-
pcbPackGap:
|
|
16378
|
-
schGrid:
|
|
16379
|
-
schGridCols:
|
|
16380
|
-
schGridRows:
|
|
16381
|
-
schGridTemplateRows:
|
|
16382
|
-
schGridTemplateColumns:
|
|
16383
|
-
schGridTemplate:
|
|
16384
|
-
schGridGap:
|
|
16385
|
-
schGridRowGap:
|
|
16386
|
-
schGridColumnGap:
|
|
16387
|
-
schFlex:
|
|
16388
|
-
schFlexGap:
|
|
16389
|
-
schFlexDirection:
|
|
16390
|
-
schAlignItems:
|
|
16391
|
-
schJustifyContent:
|
|
16428
|
+
pcbFlexRow: z40.boolean().optional(),
|
|
16429
|
+
pcbFlexColumn: z40.boolean().optional(),
|
|
16430
|
+
pcbGap: z40.number().or(z40.string()).optional(),
|
|
16431
|
+
pcbPack: z40.boolean().optional(),
|
|
16432
|
+
pcbPackGap: z40.number().or(z40.string()).optional(),
|
|
16433
|
+
schGrid: z40.boolean().optional(),
|
|
16434
|
+
schGridCols: z40.number().or(z40.string()).optional(),
|
|
16435
|
+
schGridRows: z40.number().or(z40.string()).optional(),
|
|
16436
|
+
schGridTemplateRows: z40.string().optional(),
|
|
16437
|
+
schGridTemplateColumns: z40.string().optional(),
|
|
16438
|
+
schGridTemplate: z40.string().optional(),
|
|
16439
|
+
schGridGap: z40.number().or(z40.string()).optional(),
|
|
16440
|
+
schGridRowGap: z40.number().or(z40.string()).optional(),
|
|
16441
|
+
schGridColumnGap: z40.number().or(z40.string()).optional(),
|
|
16442
|
+
schFlex: z40.boolean().or(z40.string()).optional(),
|
|
16443
|
+
schFlexGap: z40.number().or(z40.string()).optional(),
|
|
16444
|
+
schFlexDirection: z40.enum(["row", "column"]).optional(),
|
|
16445
|
+
schAlignItems: z40.enum(["start", "center", "end", "stretch"]).optional(),
|
|
16446
|
+
schJustifyContent: z40.enum([
|
|
16392
16447
|
"start",
|
|
16393
16448
|
"center",
|
|
16394
16449
|
"end",
|
|
@@ -16397,11 +16452,11 @@ var baseGroupProps = commonLayoutProps.extend({
|
|
|
16397
16452
|
"space-around",
|
|
16398
16453
|
"space-evenly"
|
|
16399
16454
|
]).optional(),
|
|
16400
|
-
schFlexRow:
|
|
16401
|
-
schFlexColumn:
|
|
16402
|
-
schGap:
|
|
16403
|
-
schPack:
|
|
16404
|
-
schMatchAdapt:
|
|
16455
|
+
schFlexRow: z40.boolean().optional(),
|
|
16456
|
+
schFlexColumn: z40.boolean().optional(),
|
|
16457
|
+
schGap: z40.number().or(z40.string()).optional(),
|
|
16458
|
+
schPack: z40.boolean().optional(),
|
|
16459
|
+
schMatchAdapt: z40.boolean().optional(),
|
|
16405
16460
|
pcbWidth: length3.optional(),
|
|
16406
16461
|
pcbHeight: length3.optional(),
|
|
16407
16462
|
minTraceWidth: length3.optional(),
|
|
@@ -16424,40 +16479,40 @@ var baseGroupProps = commonLayoutProps.extend({
|
|
|
16424
16479
|
pcbPaddingBottom: length3.optional(),
|
|
16425
16480
|
pcbAnchorAlignment: pcbAnchorAlignmentAutocomplete.optional()
|
|
16426
16481
|
});
|
|
16427
|
-
var partsEngine =
|
|
16482
|
+
var partsEngine = z40.custom((v) => "findPart" in v);
|
|
16428
16483
|
var subcircuitGroupProps = baseGroupProps.extend({
|
|
16429
16484
|
manualEdits: manual_edits_file.optional(),
|
|
16430
|
-
schAutoLayoutEnabled:
|
|
16431
|
-
schTraceAutoLabelEnabled:
|
|
16485
|
+
schAutoLayoutEnabled: z40.boolean().optional(),
|
|
16486
|
+
schTraceAutoLabelEnabled: z40.boolean().optional(),
|
|
16432
16487
|
schMaxTraceDistance: distance11.optional(),
|
|
16433
|
-
routingDisabled:
|
|
16434
|
-
bomDisabled:
|
|
16488
|
+
routingDisabled: z40.boolean().optional(),
|
|
16489
|
+
bomDisabled: z40.boolean().optional(),
|
|
16435
16490
|
defaultTraceWidth: length3.optional(),
|
|
16436
16491
|
...routingTolerances.shape,
|
|
16437
16492
|
nominalTraceWidth: length3.optional(),
|
|
16438
16493
|
partsEngine: partsEngine.optional(),
|
|
16439
|
-
_subcircuitCachingEnabled:
|
|
16440
|
-
pcbRouteCache:
|
|
16494
|
+
_subcircuitCachingEnabled: z40.boolean().optional(),
|
|
16495
|
+
pcbRouteCache: z40.custom((v) => true).optional(),
|
|
16441
16496
|
autorouter: autorouterProp.optional(),
|
|
16442
16497
|
autorouterEffortLevel: autorouterEffortLevel.optional(),
|
|
16443
|
-
autorouterVersion:
|
|
16444
|
-
square:
|
|
16445
|
-
emptyArea:
|
|
16446
|
-
filledArea:
|
|
16498
|
+
autorouterVersion: z40.enum(["v1", "v2", "v3", "v4", "v5", "v6", "latest"]).optional(),
|
|
16499
|
+
square: z40.boolean().optional(),
|
|
16500
|
+
emptyArea: z40.string().optional(),
|
|
16501
|
+
filledArea: z40.string().optional(),
|
|
16447
16502
|
width: distance11.optional(),
|
|
16448
16503
|
height: distance11.optional(),
|
|
16449
|
-
outline:
|
|
16504
|
+
outline: z40.array(point).optional(),
|
|
16450
16505
|
outlineOffsetX: distance11.optional(),
|
|
16451
16506
|
outlineOffsetY: distance11.optional(),
|
|
16452
|
-
circuitJson:
|
|
16453
|
-
exposedNets:
|
|
16454
|
-
exposeNets:
|
|
16507
|
+
circuitJson: z40.array(z40.any()).optional(),
|
|
16508
|
+
exposedNets: z40.array(z40.string()).optional(),
|
|
16509
|
+
exposeNets: z40.boolean().optional()
|
|
16455
16510
|
});
|
|
16456
16511
|
var subcircuitGroupPropsWithBool = subcircuitGroupProps.extend({
|
|
16457
|
-
subcircuit:
|
|
16512
|
+
subcircuit: z40.literal(true)
|
|
16458
16513
|
});
|
|
16459
|
-
var groupProps =
|
|
16460
|
-
baseGroupProps.extend({ subcircuit:
|
|
16514
|
+
var groupProps = z40.discriminatedUnion("subcircuit", [
|
|
16515
|
+
baseGroupProps.extend({ subcircuit: z40.literal(false).optional() }),
|
|
16461
16516
|
subcircuitGroupPropsWithBool
|
|
16462
16517
|
]);
|
|
16463
16518
|
expectTypesMatch(true);
|
|
@@ -16467,35 +16522,35 @@ expectTypesMatch(true);
|
|
|
16467
16522
|
expectTypesMatch(true);
|
|
16468
16523
|
|
|
16469
16524
|
// lib/components/board.ts
|
|
16470
|
-
var boardColor =
|
|
16525
|
+
var boardColor = z41.custom((value) => typeof value === "string");
|
|
16471
16526
|
var boardProps = subcircuitGroupProps.omit({ connections: true }).extend({
|
|
16472
|
-
material:
|
|
16473
|
-
layers:
|
|
16474
|
-
|
|
16475
|
-
|
|
16476
|
-
|
|
16477
|
-
|
|
16478
|
-
|
|
16527
|
+
material: z41.enum(["fr4", "fr1", "flex"]).default("fr4"),
|
|
16528
|
+
layers: z41.union([
|
|
16529
|
+
z41.literal(1),
|
|
16530
|
+
z41.literal(2),
|
|
16531
|
+
z41.literal(4),
|
|
16532
|
+
z41.literal(6),
|
|
16533
|
+
z41.literal(8)
|
|
16479
16534
|
]).default(2),
|
|
16480
16535
|
borderRadius: distance.optional(),
|
|
16481
16536
|
thickness: distance.optional(),
|
|
16482
16537
|
boardAnchorPosition: point.optional(),
|
|
16483
16538
|
anchorAlignment: ninePointAnchor.optional(),
|
|
16484
16539
|
boardAnchorAlignment: ninePointAnchor.optional().describe("Prefer using anchorAlignment when possible"),
|
|
16485
|
-
title:
|
|
16540
|
+
title: z41.string().optional(),
|
|
16486
16541
|
solderMaskColor: boardColor.optional(),
|
|
16487
16542
|
topSolderMaskColor: boardColor.optional(),
|
|
16488
16543
|
bottomSolderMaskColor: boardColor.optional(),
|
|
16489
16544
|
silkscreenColor: boardColor.optional(),
|
|
16490
16545
|
topSilkscreenColor: boardColor.optional(),
|
|
16491
16546
|
bottomSilkscreenColor: boardColor.optional(),
|
|
16492
|
-
doubleSidedAssembly:
|
|
16493
|
-
schematicDisabled:
|
|
16547
|
+
doubleSidedAssembly: z41.boolean().optional().default(false),
|
|
16548
|
+
schematicDisabled: z41.boolean().optional()
|
|
16494
16549
|
});
|
|
16495
16550
|
expectTypesMatch(true);
|
|
16496
16551
|
|
|
16497
16552
|
// lib/components/panel.ts
|
|
16498
|
-
import { z as
|
|
16553
|
+
import { z as z42 } from "zod";
|
|
16499
16554
|
var panelProps = baseGroupProps.omit({
|
|
16500
16555
|
width: true,
|
|
16501
16556
|
height: true,
|
|
@@ -16504,25 +16559,25 @@ var panelProps = baseGroupProps.omit({
|
|
|
16504
16559
|
}).extend({
|
|
16505
16560
|
width: distance.optional(),
|
|
16506
16561
|
height: distance.optional(),
|
|
16507
|
-
children:
|
|
16562
|
+
children: z42.any().optional(),
|
|
16508
16563
|
anchorAlignment: ninePointAnchor.optional(),
|
|
16509
|
-
noSolderMask:
|
|
16510
|
-
panelizationMethod:
|
|
16564
|
+
noSolderMask: z42.boolean().optional(),
|
|
16565
|
+
panelizationMethod: z42.enum(["tab-routing", "none"]).optional(),
|
|
16511
16566
|
boardGap: distance.optional(),
|
|
16512
|
-
layoutMode:
|
|
16513
|
-
row:
|
|
16514
|
-
col:
|
|
16567
|
+
layoutMode: z42.enum(["grid", "pack", "none"]).optional(),
|
|
16568
|
+
row: z42.number().optional(),
|
|
16569
|
+
col: z42.number().optional(),
|
|
16515
16570
|
cellWidth: distance.optional(),
|
|
16516
16571
|
cellHeight: distance.optional(),
|
|
16517
16572
|
tabWidth: distance.optional(),
|
|
16518
16573
|
tabLength: distance.optional(),
|
|
16519
|
-
mouseBites:
|
|
16574
|
+
mouseBites: z42.boolean().optional(),
|
|
16520
16575
|
edgePadding: distance.optional(),
|
|
16521
16576
|
edgePaddingLeft: distance.optional(),
|
|
16522
16577
|
edgePaddingRight: distance.optional(),
|
|
16523
16578
|
edgePaddingTop: distance.optional(),
|
|
16524
16579
|
edgePaddingBottom: distance.optional(),
|
|
16525
|
-
_subcircuitCachingEnabled:
|
|
16580
|
+
_subcircuitCachingEnabled: z42.boolean().optional()
|
|
16526
16581
|
});
|
|
16527
16582
|
expectTypesMatch(true);
|
|
16528
16583
|
|
|
@@ -16545,37 +16600,37 @@ expectTypesMatch(true);
|
|
|
16545
16600
|
|
|
16546
16601
|
// lib/components/chip.ts
|
|
16547
16602
|
import { distance as distance13, supplier_name as supplier_name2 } from "circuit-json";
|
|
16548
|
-
import { z as
|
|
16549
|
-
var connectionTarget2 =
|
|
16550
|
-
var noConnectProp =
|
|
16551
|
-
var connectionsProp =
|
|
16552
|
-
var spicemodelElement =
|
|
16603
|
+
import { z as z45 } from "zod";
|
|
16604
|
+
var connectionTarget2 = z45.string().or(z45.array(z45.string()).readonly()).or(z45.array(z45.string()));
|
|
16605
|
+
var noConnectProp = z45.array(schematicPinLabel).readonly().or(z45.array(schematicPinLabel));
|
|
16606
|
+
var connectionsProp = z45.custom().pipe(z45.record(z45.string(), connectionTarget2));
|
|
16607
|
+
var spicemodelElement = z45.custom(
|
|
16553
16608
|
(v) => !!v && typeof v === "object" && "type" in v && "props" in v
|
|
16554
16609
|
);
|
|
16555
|
-
var pinLabelsProp =
|
|
16610
|
+
var pinLabelsProp = z45.record(
|
|
16556
16611
|
schematicPinLabel,
|
|
16557
|
-
schematicPinLabel.or(
|
|
16612
|
+
schematicPinLabel.or(z45.array(schematicPinLabel).readonly()).or(z45.array(schematicPinLabel))
|
|
16558
16613
|
);
|
|
16559
16614
|
expectTypesMatch(true);
|
|
16560
|
-
var pinCompatibleVariant =
|
|
16561
|
-
manufacturerPartNumber:
|
|
16562
|
-
supplierPartNumber:
|
|
16615
|
+
var pinCompatibleVariant = z45.object({
|
|
16616
|
+
manufacturerPartNumber: z45.string().optional(),
|
|
16617
|
+
supplierPartNumber: z45.record(supplier_name2, z45.array(z45.string())).optional()
|
|
16563
16618
|
});
|
|
16564
16619
|
var chipProps = commonComponentProps.extend({
|
|
16565
|
-
manufacturerPartNumber:
|
|
16620
|
+
manufacturerPartNumber: z45.string().optional(),
|
|
16566
16621
|
pinLabels: pinLabelsProp.optional(),
|
|
16567
|
-
showPinAliases:
|
|
16568
|
-
pcbPinLabels:
|
|
16569
|
-
internallyConnectedPins:
|
|
16570
|
-
externallyConnectedPins:
|
|
16622
|
+
showPinAliases: z45.boolean().optional(),
|
|
16623
|
+
pcbPinLabels: z45.record(z45.string(), z45.string()).optional(),
|
|
16624
|
+
internallyConnectedPins: z45.array(z45.array(z45.union([z45.string(), z45.number()]))).optional(),
|
|
16625
|
+
externallyConnectedPins: z45.array(z45.array(z45.string())).optional(),
|
|
16571
16626
|
schPinArrangement: schematicPortArrangement.optional(),
|
|
16572
16627
|
schPortArrangement: schematicPortArrangement.optional(),
|
|
16573
|
-
pinCompatibleVariants:
|
|
16628
|
+
pinCompatibleVariants: z45.array(pinCompatibleVariant).optional(),
|
|
16574
16629
|
schPinStyle: schematicPinStyle.optional(),
|
|
16575
16630
|
schPinSpacing: distance13.optional(),
|
|
16576
16631
|
schWidth: distance13.optional(),
|
|
16577
16632
|
schHeight: distance13.optional(),
|
|
16578
|
-
noSchematicRepresentation:
|
|
16633
|
+
noSchematicRepresentation: z45.boolean().optional(),
|
|
16579
16634
|
noConnect: noConnectProp.optional(),
|
|
16580
16635
|
connections: connectionsProp.optional(),
|
|
16581
16636
|
spiceModel: spicemodelElement.optional()
|
|
@@ -16589,75 +16644,75 @@ expectTypesMatch(true);
|
|
|
16589
16644
|
|
|
16590
16645
|
// lib/components/jumper.ts
|
|
16591
16646
|
import { distance as distance14 } from "circuit-json";
|
|
16592
|
-
import { z as
|
|
16647
|
+
import { z as z46 } from "zod";
|
|
16593
16648
|
var jumperProps = commonComponentProps.extend({
|
|
16594
|
-
manufacturerPartNumber:
|
|
16595
|
-
pinLabels:
|
|
16596
|
-
|
|
16597
|
-
schematicPinLabel.or(
|
|
16649
|
+
manufacturerPartNumber: z46.string().optional(),
|
|
16650
|
+
pinLabels: z46.record(
|
|
16651
|
+
z46.number().or(schematicPinLabel),
|
|
16652
|
+
schematicPinLabel.or(z46.array(schematicPinLabel))
|
|
16598
16653
|
).optional(),
|
|
16599
16654
|
schPinStyle: schematicPinStyle.optional(),
|
|
16600
16655
|
schPinSpacing: distance14.optional(),
|
|
16601
16656
|
schWidth: distance14.optional(),
|
|
16602
16657
|
schHeight: distance14.optional(),
|
|
16603
|
-
schDirection:
|
|
16658
|
+
schDirection: z46.enum(["left", "right"]).optional(),
|
|
16604
16659
|
schPinArrangement: schematicPinArrangement.optional(),
|
|
16605
16660
|
schPortArrangement: schematicPortArrangement.optional(),
|
|
16606
|
-
pcbPinLabels:
|
|
16607
|
-
pinCount:
|
|
16608
|
-
internallyConnectedPins:
|
|
16609
|
-
connections:
|
|
16661
|
+
pcbPinLabels: z46.record(z46.string(), z46.string()).optional(),
|
|
16662
|
+
pinCount: z46.union([z46.literal(2), z46.literal(3)]).optional(),
|
|
16663
|
+
internallyConnectedPins: z46.array(z46.array(z46.union([z46.string(), z46.number()]))).optional(),
|
|
16664
|
+
connections: z46.custom().pipe(z46.record(z46.string(), connectionTarget)).optional()
|
|
16610
16665
|
});
|
|
16611
16666
|
expectTypesMatch(true);
|
|
16612
16667
|
|
|
16613
16668
|
// lib/components/solderjumper.ts
|
|
16614
|
-
import { z as
|
|
16669
|
+
import { z as z47 } from "zod";
|
|
16615
16670
|
var solderjumperProps = jumperProps.extend({
|
|
16616
|
-
bridgedPins:
|
|
16617
|
-
bridged:
|
|
16671
|
+
bridgedPins: z47.array(z47.array(z47.string())).optional(),
|
|
16672
|
+
bridged: z47.boolean().optional()
|
|
16618
16673
|
});
|
|
16619
16674
|
expectTypesMatch(true);
|
|
16620
16675
|
|
|
16621
16676
|
// lib/components/connector.ts
|
|
16622
|
-
import { z as
|
|
16677
|
+
import { z as z48 } from "zod";
|
|
16623
16678
|
var connectorProps = chipProps.extend({
|
|
16624
|
-
standard:
|
|
16679
|
+
standard: z48.enum(["usb_c", "m2"]).optional()
|
|
16625
16680
|
});
|
|
16626
16681
|
expectTypesMatch(true);
|
|
16627
16682
|
|
|
16628
16683
|
// lib/components/interconnect.ts
|
|
16629
|
-
import { z as
|
|
16684
|
+
import { z as z49 } from "zod";
|
|
16630
16685
|
var interconnectProps = commonComponentProps.extend({
|
|
16631
|
-
standard:
|
|
16632
|
-
pinLabels:
|
|
16633
|
-
|
|
16634
|
-
schematicPinLabel.or(
|
|
16686
|
+
standard: z49.enum(["TSC0001_36P_XALT_2025_11", "0805", "0603", "1206"]).optional(),
|
|
16687
|
+
pinLabels: z49.record(
|
|
16688
|
+
z49.number().or(schematicPinLabel),
|
|
16689
|
+
schematicPinLabel.or(z49.array(schematicPinLabel))
|
|
16635
16690
|
).optional(),
|
|
16636
|
-
internallyConnectedPins:
|
|
16691
|
+
internallyConnectedPins: z49.array(z49.array(z49.union([z49.string(), z49.number()]))).optional()
|
|
16637
16692
|
});
|
|
16638
16693
|
expectTypesMatch(true);
|
|
16639
16694
|
|
|
16640
16695
|
// lib/components/fuse.ts
|
|
16641
|
-
import { z as
|
|
16696
|
+
import { z as z50 } from "zod";
|
|
16642
16697
|
var fusePinLabels = ["pin1", "pin2"];
|
|
16643
16698
|
var fuseProps = commonComponentProps.extend({
|
|
16644
|
-
currentRating:
|
|
16645
|
-
voltageRating:
|
|
16646
|
-
schShowRatings:
|
|
16699
|
+
currentRating: z50.union([z50.number(), z50.string()]),
|
|
16700
|
+
voltageRating: z50.union([z50.number(), z50.string()]).optional(),
|
|
16701
|
+
schShowRatings: z50.boolean().optional(),
|
|
16647
16702
|
schOrientation: schematicOrientation.optional(),
|
|
16648
|
-
connections:
|
|
16649
|
-
|
|
16650
|
-
|
|
16651
|
-
|
|
16652
|
-
|
|
16653
|
-
|
|
16703
|
+
connections: z50.record(
|
|
16704
|
+
z50.string(),
|
|
16705
|
+
z50.union([
|
|
16706
|
+
z50.string(),
|
|
16707
|
+
z50.array(z50.string()).readonly(),
|
|
16708
|
+
z50.array(z50.string())
|
|
16654
16709
|
])
|
|
16655
16710
|
).optional()
|
|
16656
16711
|
});
|
|
16657
16712
|
|
|
16658
16713
|
// lib/components/platedhole.ts
|
|
16659
16714
|
import { distance as distance15 } from "circuit-json";
|
|
16660
|
-
import { z as
|
|
16715
|
+
import { z as z51 } from "zod";
|
|
16661
16716
|
var DEFAULT_PIN_HEADER_HOLE_DIAMETER = "0.04in";
|
|
16662
16717
|
var DEFAULT_PIN_HEADER_OUTER_DIAMETER = "0.1in";
|
|
16663
16718
|
var inferPlatedHoleShapeAndDefaults = (rawProps) => {
|
|
@@ -16689,26 +16744,26 @@ var inferPlatedHoleShapeAndDefaults = (rawProps) => {
|
|
|
16689
16744
|
props.outerDiameter = DEFAULT_PIN_HEADER_OUTER_DIAMETER;
|
|
16690
16745
|
return props;
|
|
16691
16746
|
};
|
|
16692
|
-
var distanceHiddenUndefined =
|
|
16747
|
+
var distanceHiddenUndefined = z51.custom().transform((a) => {
|
|
16693
16748
|
if (a === void 0) return void 0;
|
|
16694
16749
|
return distance15.parse(a);
|
|
16695
16750
|
});
|
|
16696
|
-
var platedHolePropsByShape =
|
|
16751
|
+
var platedHolePropsByShape = z51.discriminatedUnion("shape", [
|
|
16697
16752
|
pcbLayoutProps.omit({ pcbRotation: true, layer: true }).extend({
|
|
16698
|
-
name:
|
|
16699
|
-
connectsTo:
|
|
16700
|
-
shape:
|
|
16753
|
+
name: z51.string().optional(),
|
|
16754
|
+
connectsTo: z51.string().or(z51.array(z51.string())).optional(),
|
|
16755
|
+
shape: z51.literal("circle"),
|
|
16701
16756
|
holeDiameter: distance15,
|
|
16702
16757
|
outerDiameter: distance15,
|
|
16703
16758
|
padDiameter: distance15.optional().describe("Diameter of the copper pad"),
|
|
16704
16759
|
portHints: portHints.optional(),
|
|
16705
16760
|
solderMaskMargin: distance15.optional(),
|
|
16706
|
-
coveredWithSolderMask:
|
|
16761
|
+
coveredWithSolderMask: z51.boolean().optional()
|
|
16707
16762
|
}),
|
|
16708
16763
|
pcbLayoutProps.omit({ layer: true }).extend({
|
|
16709
|
-
name:
|
|
16710
|
-
connectsTo:
|
|
16711
|
-
shape:
|
|
16764
|
+
name: z51.string().optional(),
|
|
16765
|
+
connectsTo: z51.string().or(z51.array(z51.string())).optional(),
|
|
16766
|
+
shape: z51.literal("oval"),
|
|
16712
16767
|
outerWidth: distance15,
|
|
16713
16768
|
outerHeight: distance15,
|
|
16714
16769
|
holeWidth: distanceHiddenUndefined,
|
|
@@ -16717,13 +16772,13 @@ var platedHolePropsByShape = z48.discriminatedUnion("shape", [
|
|
|
16717
16772
|
innerHeight: distance15.optional().describe("DEPRECATED use holeHeight"),
|
|
16718
16773
|
portHints: portHints.optional(),
|
|
16719
16774
|
solderMaskMargin: distance15.optional(),
|
|
16720
|
-
coveredWithSolderMask:
|
|
16775
|
+
coveredWithSolderMask: z51.boolean().optional()
|
|
16721
16776
|
}),
|
|
16722
16777
|
pcbLayoutProps.omit({ layer: true }).extend({
|
|
16723
|
-
name:
|
|
16724
|
-
connectsTo:
|
|
16725
|
-
shape:
|
|
16726
|
-
rectPad:
|
|
16778
|
+
name: z51.string().optional(),
|
|
16779
|
+
connectsTo: z51.string().or(z51.array(z51.string())).optional(),
|
|
16780
|
+
shape: z51.literal("pill"),
|
|
16781
|
+
rectPad: z51.boolean().optional(),
|
|
16727
16782
|
outerWidth: distance15,
|
|
16728
16783
|
outerHeight: distance15,
|
|
16729
16784
|
holeWidth: distanceHiddenUndefined,
|
|
@@ -16734,30 +16789,30 @@ var platedHolePropsByShape = z48.discriminatedUnion("shape", [
|
|
|
16734
16789
|
holeOffsetX: distance15.optional(),
|
|
16735
16790
|
holeOffsetY: distance15.optional(),
|
|
16736
16791
|
solderMaskMargin: distance15.optional(),
|
|
16737
|
-
coveredWithSolderMask:
|
|
16792
|
+
coveredWithSolderMask: z51.boolean().optional()
|
|
16738
16793
|
}),
|
|
16739
16794
|
pcbLayoutProps.omit({ layer: true }).extend({
|
|
16740
|
-
name:
|
|
16741
|
-
connectsTo:
|
|
16742
|
-
shape:
|
|
16795
|
+
name: z51.string().optional(),
|
|
16796
|
+
connectsTo: z51.string().or(z51.array(z51.string())).optional(),
|
|
16797
|
+
shape: z51.literal("circular_hole_with_rect_pad"),
|
|
16743
16798
|
holeDiameter: distance15,
|
|
16744
16799
|
rectPadWidth: distance15,
|
|
16745
16800
|
rectPadHeight: distance15,
|
|
16746
16801
|
rectBorderRadius: distance15.optional(),
|
|
16747
|
-
holeShape:
|
|
16748
|
-
padShape:
|
|
16802
|
+
holeShape: z51.literal("circle").optional(),
|
|
16803
|
+
padShape: z51.literal("rect").optional(),
|
|
16749
16804
|
portHints: portHints.optional(),
|
|
16750
16805
|
holeOffsetX: distance15.optional(),
|
|
16751
16806
|
holeOffsetY: distance15.optional(),
|
|
16752
16807
|
solderMaskMargin: distance15.optional(),
|
|
16753
|
-
coveredWithSolderMask:
|
|
16808
|
+
coveredWithSolderMask: z51.boolean().optional()
|
|
16754
16809
|
}),
|
|
16755
16810
|
pcbLayoutProps.omit({ layer: true }).extend({
|
|
16756
|
-
name:
|
|
16757
|
-
connectsTo:
|
|
16758
|
-
shape:
|
|
16759
|
-
holeShape:
|
|
16760
|
-
padShape:
|
|
16811
|
+
name: z51.string().optional(),
|
|
16812
|
+
connectsTo: z51.string().or(z51.array(z51.string())).optional(),
|
|
16813
|
+
shape: z51.literal("pill_hole_with_rect_pad"),
|
|
16814
|
+
holeShape: z51.literal("pill").optional(),
|
|
16815
|
+
padShape: z51.literal("rect").optional(),
|
|
16761
16816
|
holeWidth: distance15,
|
|
16762
16817
|
holeHeight: distance15,
|
|
16763
16818
|
rectPadWidth: distance15,
|
|
@@ -16767,22 +16822,22 @@ var platedHolePropsByShape = z48.discriminatedUnion("shape", [
|
|
|
16767
16822
|
holeOffsetX: distance15.optional(),
|
|
16768
16823
|
holeOffsetY: distance15.optional(),
|
|
16769
16824
|
solderMaskMargin: distance15.optional(),
|
|
16770
|
-
coveredWithSolderMask:
|
|
16825
|
+
coveredWithSolderMask: z51.boolean().optional()
|
|
16771
16826
|
}),
|
|
16772
16827
|
pcbLayoutProps.omit({ pcbRotation: true, layer: true }).extend({
|
|
16773
|
-
name:
|
|
16774
|
-
connectsTo:
|
|
16775
|
-
shape:
|
|
16776
|
-
holeShape:
|
|
16828
|
+
name: z51.string().optional(),
|
|
16829
|
+
connectsTo: z51.string().or(z51.array(z51.string())).optional(),
|
|
16830
|
+
shape: z51.literal("hole_with_polygon_pad"),
|
|
16831
|
+
holeShape: z51.enum(["circle", "oval", "pill", "rotated_pill"]),
|
|
16777
16832
|
holeDiameter: distance15.optional(),
|
|
16778
16833
|
holeWidth: distance15.optional(),
|
|
16779
16834
|
holeHeight: distance15.optional(),
|
|
16780
|
-
padOutline:
|
|
16835
|
+
padOutline: z51.array(point),
|
|
16781
16836
|
holeOffsetX: distance15,
|
|
16782
16837
|
holeOffsetY: distance15,
|
|
16783
16838
|
portHints: portHints.optional(),
|
|
16784
16839
|
solderMaskMargin: distance15.optional(),
|
|
16785
|
-
coveredWithSolderMask:
|
|
16840
|
+
coveredWithSolderMask: z51.boolean().optional()
|
|
16786
16841
|
})
|
|
16787
16842
|
]).transform((a) => {
|
|
16788
16843
|
if ("innerWidth" in a && a.innerWidth !== void 0) {
|
|
@@ -16793,7 +16848,7 @@ var platedHolePropsByShape = z48.discriminatedUnion("shape", [
|
|
|
16793
16848
|
}
|
|
16794
16849
|
return a;
|
|
16795
16850
|
});
|
|
16796
|
-
var platedHoleProps =
|
|
16851
|
+
var platedHoleProps = z51.preprocess(
|
|
16797
16852
|
inferPlatedHoleShapeAndDefaults,
|
|
16798
16853
|
platedHolePropsByShape
|
|
16799
16854
|
);
|
|
@@ -16801,7 +16856,7 @@ expectTypesMatch(true);
|
|
|
16801
16856
|
|
|
16802
16857
|
// lib/components/resistor.ts
|
|
16803
16858
|
import { resistance } from "circuit-json";
|
|
16804
|
-
import { z as
|
|
16859
|
+
import { z as z52 } from "zod";
|
|
16805
16860
|
var resistorPinLabels = ["pin1", "pin2", "pos", "neg"];
|
|
16806
16861
|
var resistorImperialFootprintNames = /* @__PURE__ */ new Set([
|
|
16807
16862
|
"01005",
|
|
@@ -16825,7 +16880,7 @@ var resistorFootprintProp = footprintProp.optional().transform(mapResistorFootpr
|
|
|
16825
16880
|
var resistorProps = commonComponentProps.extend({
|
|
16826
16881
|
footprint: resistorFootprintProp,
|
|
16827
16882
|
resistance,
|
|
16828
|
-
tolerance:
|
|
16883
|
+
tolerance: z52.union([z52.string(), z52.number()]).transform((val) => {
|
|
16829
16884
|
if (typeof val === "string") {
|
|
16830
16885
|
if (val.endsWith("%")) {
|
|
16831
16886
|
return parseFloat(val.slice(0, -1)) / 100;
|
|
@@ -16834,12 +16889,12 @@ var resistorProps = commonComponentProps.extend({
|
|
|
16834
16889
|
}
|
|
16835
16890
|
return val;
|
|
16836
16891
|
}).pipe(
|
|
16837
|
-
|
|
16892
|
+
z52.number().min(0, "Tolerance must be non-negative").max(1, "Tolerance cannot be greater than 100%")
|
|
16838
16893
|
).optional(),
|
|
16839
|
-
pullupFor:
|
|
16840
|
-
pullupTo:
|
|
16841
|
-
pulldownFor:
|
|
16842
|
-
pulldownTo:
|
|
16894
|
+
pullupFor: z52.string().optional(),
|
|
16895
|
+
pullupTo: z52.string().optional(),
|
|
16896
|
+
pulldownFor: z52.string().optional(),
|
|
16897
|
+
pulldownTo: z52.string().optional(),
|
|
16843
16898
|
schOrientation: schematicOrientation.optional(),
|
|
16844
16899
|
schSize: schematicSymbolSize.optional(),
|
|
16845
16900
|
connections: createConnectionsProp(resistorPinLabels).optional()
|
|
@@ -16849,18 +16904,18 @@ expectTypesMatch(true);
|
|
|
16849
16904
|
|
|
16850
16905
|
// lib/components/potentiometer.ts
|
|
16851
16906
|
import { resistance as resistance2 } from "circuit-json";
|
|
16852
|
-
import { z as
|
|
16907
|
+
import { z as z53 } from "zod";
|
|
16853
16908
|
var potentiometerPinLabels = ["pin1", "pin2", "pin3"];
|
|
16854
16909
|
var potentiometerProps = commonComponentProps.extend({
|
|
16855
16910
|
maxResistance: resistance2,
|
|
16856
|
-
pinVariant:
|
|
16911
|
+
pinVariant: z53.enum(["two_pin", "three_pin"]).optional(),
|
|
16857
16912
|
connections: createConnectionsProp(potentiometerPinLabels).optional()
|
|
16858
16913
|
});
|
|
16859
16914
|
expectTypesMatch(true);
|
|
16860
16915
|
|
|
16861
16916
|
// lib/components/crystal.ts
|
|
16862
16917
|
import { capacitance, distance as distance16, frequency } from "circuit-json";
|
|
16863
|
-
import { z as
|
|
16918
|
+
import { z as z54 } from "zod";
|
|
16864
16919
|
var crystalPins = [
|
|
16865
16920
|
"pin1",
|
|
16866
16921
|
"left",
|
|
@@ -16873,9 +16928,9 @@ var crystalProps = commonComponentProps.extend({
|
|
|
16873
16928
|
frequency,
|
|
16874
16929
|
loadCapacitance: capacitance,
|
|
16875
16930
|
maxTraceLength: distance16.optional(),
|
|
16876
|
-
manufacturerPartNumber:
|
|
16877
|
-
mpn:
|
|
16878
|
-
pinVariant:
|
|
16931
|
+
manufacturerPartNumber: z54.string().optional(),
|
|
16932
|
+
mpn: z54.string().optional(),
|
|
16933
|
+
pinVariant: z54.enum(["two_pin", "four_pin"]).optional(),
|
|
16879
16934
|
schOrientation: schematicOrientation.optional(),
|
|
16880
16935
|
connections: createConnectionsProp(crystalPins).optional()
|
|
16881
16936
|
});
|
|
@@ -16883,34 +16938,34 @@ expectTypesMatch(true);
|
|
|
16883
16938
|
|
|
16884
16939
|
// lib/components/resonator.ts
|
|
16885
16940
|
import { frequency as frequency2, capacitance as capacitance2 } from "circuit-json";
|
|
16886
|
-
import { z as
|
|
16941
|
+
import { z as z55 } from "zod";
|
|
16887
16942
|
var resonatorProps = commonComponentProps.extend({
|
|
16888
16943
|
frequency: frequency2,
|
|
16889
16944
|
loadCapacitance: capacitance2,
|
|
16890
|
-
pinVariant:
|
|
16945
|
+
pinVariant: z55.enum(["no_ground", "ground_pin", "two_ground_pins"]).optional()
|
|
16891
16946
|
});
|
|
16892
16947
|
expectTypesMatch(true);
|
|
16893
16948
|
|
|
16894
16949
|
// lib/components/stampboard.ts
|
|
16895
16950
|
import { distance as distance17 } from "circuit-json";
|
|
16896
|
-
import { z as
|
|
16951
|
+
import { z as z56 } from "zod";
|
|
16897
16952
|
var stampboardProps = boardProps.extend({
|
|
16898
|
-
leftPinCount:
|
|
16899
|
-
rightPinCount:
|
|
16900
|
-
topPinCount:
|
|
16901
|
-
bottomPinCount:
|
|
16902
|
-
leftPins:
|
|
16903
|
-
rightPins:
|
|
16904
|
-
topPins:
|
|
16905
|
-
bottomPins:
|
|
16953
|
+
leftPinCount: z56.number().optional(),
|
|
16954
|
+
rightPinCount: z56.number().optional(),
|
|
16955
|
+
topPinCount: z56.number().optional(),
|
|
16956
|
+
bottomPinCount: z56.number().optional(),
|
|
16957
|
+
leftPins: z56.array(z56.string()).optional(),
|
|
16958
|
+
rightPins: z56.array(z56.string()).optional(),
|
|
16959
|
+
topPins: z56.array(z56.string()).optional(),
|
|
16960
|
+
bottomPins: z56.array(z56.string()).optional(),
|
|
16906
16961
|
pinPitch: distance17.optional(),
|
|
16907
|
-
innerHoles:
|
|
16962
|
+
innerHoles: z56.boolean().optional()
|
|
16908
16963
|
});
|
|
16909
16964
|
expectTypesMatch(true);
|
|
16910
16965
|
|
|
16911
16966
|
// lib/components/capacitor.ts
|
|
16912
16967
|
import { capacitance as capacitance3, voltage } from "circuit-json";
|
|
16913
|
-
import { z as
|
|
16968
|
+
import { z as z57 } from "zod";
|
|
16914
16969
|
var capacitorPinLabels = [
|
|
16915
16970
|
"pin1",
|
|
16916
16971
|
"pin2",
|
|
@@ -16922,13 +16977,13 @@ var capacitorPinLabels = [
|
|
|
16922
16977
|
var capacitorProps = commonComponentProps.extend({
|
|
16923
16978
|
capacitance: capacitance3,
|
|
16924
16979
|
maxVoltageRating: voltage.optional(),
|
|
16925
|
-
schShowRatings:
|
|
16926
|
-
polarized:
|
|
16927
|
-
decouplingFor:
|
|
16928
|
-
decouplingTo:
|
|
16929
|
-
bypassFor:
|
|
16930
|
-
bypassTo:
|
|
16931
|
-
maxDecouplingTraceLength:
|
|
16980
|
+
schShowRatings: z57.boolean().optional().default(false),
|
|
16981
|
+
polarized: z57.boolean().optional().default(false),
|
|
16982
|
+
decouplingFor: z57.string().optional(),
|
|
16983
|
+
decouplingTo: z57.string().optional(),
|
|
16984
|
+
bypassFor: z57.string().optional(),
|
|
16985
|
+
bypassTo: z57.string().optional(),
|
|
16986
|
+
maxDecouplingTraceLength: z57.number().optional(),
|
|
16932
16987
|
schOrientation: schematicOrientation.optional(),
|
|
16933
16988
|
schSize: schematicSymbolSize.optional(),
|
|
16934
16989
|
connections: createConnectionsProp(capacitorPinLabels).optional()
|
|
@@ -16938,14 +16993,14 @@ expectTypesMatch(true);
|
|
|
16938
16993
|
|
|
16939
16994
|
// lib/components/net.ts
|
|
16940
16995
|
import { distance as distance18 } from "circuit-json";
|
|
16941
|
-
import { z as
|
|
16942
|
-
var netProps =
|
|
16943
|
-
name:
|
|
16944
|
-
connectsTo:
|
|
16945
|
-
routingPhaseIndex:
|
|
16946
|
-
highlightColor:
|
|
16947
|
-
isPowerNet:
|
|
16948
|
-
isGroundNet:
|
|
16996
|
+
import { z as z58 } from "zod";
|
|
16997
|
+
var netProps = z58.object({
|
|
16998
|
+
name: z58.string(),
|
|
16999
|
+
connectsTo: z58.string().or(z58.array(z58.string())).optional(),
|
|
17000
|
+
routingPhaseIndex: z58.number().nullable().optional(),
|
|
17001
|
+
highlightColor: z58.string().optional(),
|
|
17002
|
+
isPowerNet: z58.boolean().optional(),
|
|
17003
|
+
isGroundNet: z58.boolean().optional(),
|
|
16949
17004
|
nominalTraceWidth: distance18.optional()
|
|
16950
17005
|
});
|
|
16951
17006
|
expectTypesMatch(true);
|
|
@@ -16959,55 +17014,55 @@ var fiducialProps = commonComponentProps.extend({
|
|
|
16959
17014
|
expectTypesMatch(true);
|
|
16960
17015
|
|
|
16961
17016
|
// lib/components/constrainedlayout.ts
|
|
16962
|
-
import { z as
|
|
16963
|
-
var constrainedLayoutProps =
|
|
16964
|
-
name:
|
|
16965
|
-
pcbOnly:
|
|
16966
|
-
schOnly:
|
|
17017
|
+
import { z as z60 } from "zod";
|
|
17018
|
+
var constrainedLayoutProps = z60.object({
|
|
17019
|
+
name: z60.string().optional(),
|
|
17020
|
+
pcbOnly: z60.boolean().optional(),
|
|
17021
|
+
schOnly: z60.boolean().optional()
|
|
16967
17022
|
});
|
|
16968
17023
|
expectTypesMatch(true);
|
|
16969
17024
|
|
|
16970
17025
|
// lib/components/constraint.ts
|
|
16971
|
-
import { z as
|
|
16972
|
-
var pcbXDistConstraintProps =
|
|
16973
|
-
pcb:
|
|
17026
|
+
import { z as z61 } from "zod";
|
|
17027
|
+
var pcbXDistConstraintProps = z61.object({
|
|
17028
|
+
pcb: z61.literal(true).optional(),
|
|
16974
17029
|
xDist: distance,
|
|
16975
|
-
left:
|
|
16976
|
-
right:
|
|
16977
|
-
edgeToEdge:
|
|
16978
|
-
centerToCenter:
|
|
17030
|
+
left: z61.string(),
|
|
17031
|
+
right: z61.string(),
|
|
17032
|
+
edgeToEdge: z61.literal(true).optional(),
|
|
17033
|
+
centerToCenter: z61.literal(true).optional()
|
|
16979
17034
|
});
|
|
16980
17035
|
expectTypesMatch(
|
|
16981
17036
|
true
|
|
16982
17037
|
);
|
|
16983
|
-
var pcbYDistConstraintProps =
|
|
16984
|
-
pcb:
|
|
17038
|
+
var pcbYDistConstraintProps = z61.object({
|
|
17039
|
+
pcb: z61.literal(true).optional(),
|
|
16985
17040
|
yDist: distance,
|
|
16986
|
-
top:
|
|
16987
|
-
bottom:
|
|
16988
|
-
edgeToEdge:
|
|
16989
|
-
centerToCenter:
|
|
17041
|
+
top: z61.string(),
|
|
17042
|
+
bottom: z61.string(),
|
|
17043
|
+
edgeToEdge: z61.literal(true).optional(),
|
|
17044
|
+
centerToCenter: z61.literal(true).optional()
|
|
16990
17045
|
});
|
|
16991
17046
|
expectTypesMatch(
|
|
16992
17047
|
true
|
|
16993
17048
|
);
|
|
16994
|
-
var pcbSameYConstraintProps =
|
|
16995
|
-
pcb:
|
|
16996
|
-
sameY:
|
|
16997
|
-
for:
|
|
17049
|
+
var pcbSameYConstraintProps = z61.object({
|
|
17050
|
+
pcb: z61.literal(true).optional(),
|
|
17051
|
+
sameY: z61.literal(true).optional(),
|
|
17052
|
+
for: z61.array(z61.string())
|
|
16998
17053
|
});
|
|
16999
17054
|
expectTypesMatch(
|
|
17000
17055
|
true
|
|
17001
17056
|
);
|
|
17002
|
-
var pcbSameXConstraintProps =
|
|
17003
|
-
pcb:
|
|
17004
|
-
sameX:
|
|
17005
|
-
for:
|
|
17057
|
+
var pcbSameXConstraintProps = z61.object({
|
|
17058
|
+
pcb: z61.literal(true).optional(),
|
|
17059
|
+
sameX: z61.literal(true).optional(),
|
|
17060
|
+
for: z61.array(z61.string())
|
|
17006
17061
|
});
|
|
17007
17062
|
expectTypesMatch(
|
|
17008
17063
|
true
|
|
17009
17064
|
);
|
|
17010
|
-
var constraintProps =
|
|
17065
|
+
var constraintProps = z61.union([
|
|
17011
17066
|
pcbXDistConstraintProps,
|
|
17012
17067
|
pcbYDistConstraintProps,
|
|
17013
17068
|
pcbSameYConstraintProps,
|
|
@@ -17016,13 +17071,13 @@ var constraintProps = z58.union([
|
|
|
17016
17071
|
expectTypesMatch(true);
|
|
17017
17072
|
|
|
17018
17073
|
// lib/components/cutout.ts
|
|
17019
|
-
import { z as
|
|
17074
|
+
import { z as z62 } from "zod";
|
|
17020
17075
|
var rectCutoutProps = pcbLayoutProps.omit({
|
|
17021
17076
|
layer: true,
|
|
17022
17077
|
pcbRotation: true
|
|
17023
17078
|
}).extend({
|
|
17024
|
-
name:
|
|
17025
|
-
shape:
|
|
17079
|
+
name: z62.string().optional(),
|
|
17080
|
+
shape: z62.literal("rect"),
|
|
17026
17081
|
width: distance,
|
|
17027
17082
|
height: distance
|
|
17028
17083
|
});
|
|
@@ -17031,8 +17086,8 @@ var circleCutoutProps = pcbLayoutProps.omit({
|
|
|
17031
17086
|
layer: true,
|
|
17032
17087
|
pcbRotation: true
|
|
17033
17088
|
}).extend({
|
|
17034
|
-
name:
|
|
17035
|
-
shape:
|
|
17089
|
+
name: z62.string().optional(),
|
|
17090
|
+
shape: z62.literal("circle"),
|
|
17036
17091
|
radius: distance
|
|
17037
17092
|
});
|
|
17038
17093
|
expectTypesMatch(true);
|
|
@@ -17040,36 +17095,36 @@ var polygonCutoutProps = pcbLayoutProps.omit({
|
|
|
17040
17095
|
layer: true,
|
|
17041
17096
|
pcbRotation: true
|
|
17042
17097
|
}).extend({
|
|
17043
|
-
name:
|
|
17044
|
-
shape:
|
|
17045
|
-
points:
|
|
17098
|
+
name: z62.string().optional(),
|
|
17099
|
+
shape: z62.literal("polygon"),
|
|
17100
|
+
points: z62.array(point)
|
|
17046
17101
|
});
|
|
17047
17102
|
expectTypesMatch(true);
|
|
17048
|
-
var cutoutProps =
|
|
17103
|
+
var cutoutProps = z62.discriminatedUnion("shape", [
|
|
17049
17104
|
rectCutoutProps,
|
|
17050
17105
|
circleCutoutProps,
|
|
17051
17106
|
polygonCutoutProps
|
|
17052
17107
|
]);
|
|
17053
17108
|
|
|
17054
17109
|
// lib/components/drc-check.ts
|
|
17055
|
-
import { z as
|
|
17056
|
-
var drcCheckProps =
|
|
17057
|
-
name:
|
|
17110
|
+
import { z as z63 } from "zod";
|
|
17111
|
+
var drcCheckProps = z63.object({
|
|
17112
|
+
name: z63.string().optional(),
|
|
17058
17113
|
checkFn: customDrcCheckFn
|
|
17059
17114
|
});
|
|
17060
17115
|
expectTypesMatch(true);
|
|
17061
17116
|
|
|
17062
17117
|
// lib/components/smtpad.ts
|
|
17063
|
-
import { z as
|
|
17118
|
+
import { z as z64 } from "zod";
|
|
17064
17119
|
var rectSmtPadProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
17065
|
-
name:
|
|
17066
|
-
shape:
|
|
17120
|
+
name: z64.string().optional(),
|
|
17121
|
+
shape: z64.literal("rect"),
|
|
17067
17122
|
width: distance,
|
|
17068
17123
|
height: distance,
|
|
17069
17124
|
rectBorderRadius: distance.optional(),
|
|
17070
17125
|
cornerRadius: distance.optional(),
|
|
17071
17126
|
portHints: portHints.optional(),
|
|
17072
|
-
coveredWithSolderMask:
|
|
17127
|
+
coveredWithSolderMask: z64.boolean().optional(),
|
|
17073
17128
|
solderMaskMargin: distance.optional(),
|
|
17074
17129
|
solderMaskMarginLeft: distance.optional(),
|
|
17075
17130
|
solderMaskMarginRight: distance.optional(),
|
|
@@ -17078,14 +17133,14 @@ var rectSmtPadProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
|
17078
17133
|
});
|
|
17079
17134
|
expectTypesMatch(true);
|
|
17080
17135
|
var rotatedRectSmtPadProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
17081
|
-
name:
|
|
17082
|
-
shape:
|
|
17136
|
+
name: z64.string().optional(),
|
|
17137
|
+
shape: z64.literal("rotated_rect"),
|
|
17083
17138
|
width: distance,
|
|
17084
17139
|
height: distance,
|
|
17085
|
-
ccwRotation:
|
|
17140
|
+
ccwRotation: z64.number(),
|
|
17086
17141
|
cornerRadius: distance.optional(),
|
|
17087
17142
|
portHints: portHints.optional(),
|
|
17088
|
-
coveredWithSolderMask:
|
|
17143
|
+
coveredWithSolderMask: z64.boolean().optional(),
|
|
17089
17144
|
solderMaskMargin: distance.optional(),
|
|
17090
17145
|
solderMaskMarginLeft: distance.optional(),
|
|
17091
17146
|
solderMaskMarginRight: distance.optional(),
|
|
@@ -17094,35 +17149,35 @@ var rotatedRectSmtPadProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
|
17094
17149
|
});
|
|
17095
17150
|
expectTypesMatch(true);
|
|
17096
17151
|
var circleSmtPadProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
17097
|
-
name:
|
|
17098
|
-
shape:
|
|
17152
|
+
name: z64.string().optional(),
|
|
17153
|
+
shape: z64.literal("circle"),
|
|
17099
17154
|
radius: distance,
|
|
17100
17155
|
portHints: portHints.optional(),
|
|
17101
|
-
coveredWithSolderMask:
|
|
17156
|
+
coveredWithSolderMask: z64.boolean().optional(),
|
|
17102
17157
|
solderMaskMargin: distance.optional()
|
|
17103
17158
|
});
|
|
17104
17159
|
expectTypesMatch(true);
|
|
17105
17160
|
var pillSmtPadProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
17106
|
-
name:
|
|
17107
|
-
shape:
|
|
17161
|
+
name: z64.string().optional(),
|
|
17162
|
+
shape: z64.literal("pill"),
|
|
17108
17163
|
width: distance,
|
|
17109
17164
|
height: distance,
|
|
17110
17165
|
radius: distance,
|
|
17111
17166
|
portHints: portHints.optional(),
|
|
17112
|
-
coveredWithSolderMask:
|
|
17167
|
+
coveredWithSolderMask: z64.boolean().optional(),
|
|
17113
17168
|
solderMaskMargin: distance.optional()
|
|
17114
17169
|
});
|
|
17115
17170
|
expectTypesMatch(true);
|
|
17116
17171
|
var polygonSmtPadProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
17117
|
-
name:
|
|
17118
|
-
shape:
|
|
17119
|
-
points:
|
|
17172
|
+
name: z64.string().optional(),
|
|
17173
|
+
shape: z64.literal("polygon"),
|
|
17174
|
+
points: z64.array(point),
|
|
17120
17175
|
portHints: portHints.optional(),
|
|
17121
|
-
coveredWithSolderMask:
|
|
17176
|
+
coveredWithSolderMask: z64.boolean().optional(),
|
|
17122
17177
|
solderMaskMargin: distance.optional()
|
|
17123
17178
|
});
|
|
17124
17179
|
expectTypesMatch(true);
|
|
17125
|
-
var smtPadProps =
|
|
17180
|
+
var smtPadProps = z64.discriminatedUnion("shape", [
|
|
17126
17181
|
circleSmtPadProps,
|
|
17127
17182
|
rectSmtPadProps,
|
|
17128
17183
|
rotatedRectSmtPadProps,
|
|
@@ -17132,63 +17187,63 @@ var smtPadProps = z61.discriminatedUnion("shape", [
|
|
|
17132
17187
|
expectTypesMatch(true);
|
|
17133
17188
|
|
|
17134
17189
|
// lib/components/solderpaste.ts
|
|
17135
|
-
import { z as
|
|
17190
|
+
import { z as z65 } from "zod";
|
|
17136
17191
|
var rectSolderPasteProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
17137
|
-
shape:
|
|
17192
|
+
shape: z65.literal("rect"),
|
|
17138
17193
|
width: distance,
|
|
17139
17194
|
height: distance
|
|
17140
17195
|
});
|
|
17141
17196
|
expectTypesMatch(true);
|
|
17142
17197
|
var circleSolderPasteProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
17143
|
-
shape:
|
|
17198
|
+
shape: z65.literal("circle"),
|
|
17144
17199
|
radius: distance
|
|
17145
17200
|
});
|
|
17146
17201
|
expectTypesMatch(true);
|
|
17147
|
-
var solderPasteProps =
|
|
17202
|
+
var solderPasteProps = z65.union([
|
|
17148
17203
|
circleSolderPasteProps,
|
|
17149
17204
|
rectSolderPasteProps
|
|
17150
17205
|
]);
|
|
17151
17206
|
expectTypesMatch(true);
|
|
17152
17207
|
|
|
17153
17208
|
// lib/components/hole.ts
|
|
17154
|
-
import { z as
|
|
17209
|
+
import { z as z66 } from "zod";
|
|
17155
17210
|
var circleHoleProps = pcbLayoutProps.extend({
|
|
17156
|
-
name:
|
|
17157
|
-
shape:
|
|
17211
|
+
name: z66.string().optional(),
|
|
17212
|
+
shape: z66.literal("circle").optional(),
|
|
17158
17213
|
diameter: distance.optional(),
|
|
17159
17214
|
radius: distance.optional(),
|
|
17160
17215
|
solderMaskMargin: distance.optional(),
|
|
17161
|
-
coveredWithSolderMask:
|
|
17216
|
+
coveredWithSolderMask: z66.boolean().optional()
|
|
17162
17217
|
}).transform((d) => ({
|
|
17163
17218
|
...d,
|
|
17164
17219
|
diameter: d.diameter ?? 2 * d.radius,
|
|
17165
17220
|
radius: d.radius ?? d.diameter / 2
|
|
17166
17221
|
}));
|
|
17167
17222
|
var pillHoleProps = pcbLayoutProps.extend({
|
|
17168
|
-
name:
|
|
17169
|
-
shape:
|
|
17223
|
+
name: z66.string().optional(),
|
|
17224
|
+
shape: z66.literal("pill"),
|
|
17170
17225
|
width: distance,
|
|
17171
17226
|
height: distance,
|
|
17172
17227
|
solderMaskMargin: distance.optional(),
|
|
17173
|
-
coveredWithSolderMask:
|
|
17228
|
+
coveredWithSolderMask: z66.boolean().optional()
|
|
17174
17229
|
});
|
|
17175
17230
|
var ovalHoleProps = pcbLayoutProps.extend({
|
|
17176
|
-
name:
|
|
17177
|
-
shape:
|
|
17231
|
+
name: z66.string().optional(),
|
|
17232
|
+
shape: z66.literal("oval"),
|
|
17178
17233
|
width: distance,
|
|
17179
17234
|
height: distance,
|
|
17180
17235
|
solderMaskMargin: distance.optional(),
|
|
17181
|
-
coveredWithSolderMask:
|
|
17236
|
+
coveredWithSolderMask: z66.boolean().optional()
|
|
17182
17237
|
});
|
|
17183
17238
|
var rectHoleProps = pcbLayoutProps.extend({
|
|
17184
|
-
name:
|
|
17185
|
-
shape:
|
|
17239
|
+
name: z66.string().optional(),
|
|
17240
|
+
shape: z66.literal("rect"),
|
|
17186
17241
|
width: distance,
|
|
17187
17242
|
height: distance,
|
|
17188
17243
|
solderMaskMargin: distance.optional(),
|
|
17189
|
-
coveredWithSolderMask:
|
|
17244
|
+
coveredWithSolderMask: z66.boolean().optional()
|
|
17190
17245
|
});
|
|
17191
|
-
var holeProps =
|
|
17246
|
+
var holeProps = z66.union([
|
|
17192
17247
|
circleHoleProps,
|
|
17193
17248
|
pillHoleProps,
|
|
17194
17249
|
ovalHoleProps,
|
|
@@ -17198,57 +17253,57 @@ expectTypesMatch(true);
|
|
|
17198
17253
|
|
|
17199
17254
|
// lib/components/trace.ts
|
|
17200
17255
|
import { distance as distance19, layer_ref as layer_ref4, route_hint_point as route_hint_point2 } from "circuit-json";
|
|
17201
|
-
import { z as
|
|
17202
|
-
var portRef =
|
|
17203
|
-
|
|
17204
|
-
|
|
17256
|
+
import { z as z67 } from "zod";
|
|
17257
|
+
var portRef = z67.union([
|
|
17258
|
+
z67.string(),
|
|
17259
|
+
z67.custom(
|
|
17205
17260
|
(v) => typeof v === "object" && v !== null && "getPortSelector" in v && typeof v.getPortSelector === "function"
|
|
17206
17261
|
)
|
|
17207
17262
|
]);
|
|
17208
17263
|
var pcbPathPoint = point.extend({
|
|
17209
|
-
via:
|
|
17264
|
+
via: z67.boolean().optional(),
|
|
17210
17265
|
fromLayer: layer_ref4.optional(),
|
|
17211
17266
|
toLayer: layer_ref4.optional()
|
|
17212
17267
|
}).superRefine((value, ctx) => {
|
|
17213
17268
|
if (value.via) {
|
|
17214
17269
|
if (!value.toLayer) {
|
|
17215
17270
|
ctx.addIssue({
|
|
17216
|
-
code:
|
|
17271
|
+
code: z67.ZodIssueCode.custom,
|
|
17217
17272
|
message: "toLayer is required when via is true",
|
|
17218
17273
|
path: ["toLayer"]
|
|
17219
17274
|
});
|
|
17220
17275
|
}
|
|
17221
17276
|
} else if (value.fromLayer || value.toLayer) {
|
|
17222
17277
|
ctx.addIssue({
|
|
17223
|
-
code:
|
|
17278
|
+
code: z67.ZodIssueCode.custom,
|
|
17224
17279
|
message: "fromLayer/toLayer are only allowed when via is true",
|
|
17225
17280
|
path: ["via"]
|
|
17226
17281
|
});
|
|
17227
17282
|
}
|
|
17228
17283
|
});
|
|
17229
|
-
var pcbPath =
|
|
17230
|
-
var baseTraceProps =
|
|
17231
|
-
key:
|
|
17232
|
-
name:
|
|
17233
|
-
displayName:
|
|
17284
|
+
var pcbPath = z67.array(z67.union([pcbPathPoint, z67.string()]));
|
|
17285
|
+
var baseTraceProps = z67.object({
|
|
17286
|
+
key: z67.string().optional(),
|
|
17287
|
+
name: z67.string().optional(),
|
|
17288
|
+
displayName: z67.string().optional(),
|
|
17234
17289
|
thickness: distance19.optional(),
|
|
17235
17290
|
width: distance19.optional().describe("Alias for trace thickness"),
|
|
17236
|
-
schematicRouteHints:
|
|
17237
|
-
pcbRouteHints:
|
|
17238
|
-
pcbPathRelativeTo:
|
|
17291
|
+
schematicRouteHints: z67.array(point).optional(),
|
|
17292
|
+
pcbRouteHints: z67.array(route_hint_point2).optional(),
|
|
17293
|
+
pcbPathRelativeTo: z67.string().optional(),
|
|
17239
17294
|
pcbPath: pcbPath.optional(),
|
|
17240
|
-
pcbPaths:
|
|
17241
|
-
routingPhaseIndex:
|
|
17242
|
-
pcbStraightLine:
|
|
17243
|
-
schDisplayLabel:
|
|
17244
|
-
schStroke:
|
|
17245
|
-
highlightColor:
|
|
17295
|
+
pcbPaths: z67.array(pcbPath).optional(),
|
|
17296
|
+
routingPhaseIndex: z67.number().nullable().optional(),
|
|
17297
|
+
pcbStraightLine: z67.boolean().optional().describe("Draw a straight pcb trace between the connected points"),
|
|
17298
|
+
schDisplayLabel: z67.string().optional(),
|
|
17299
|
+
schStroke: z67.string().optional(),
|
|
17300
|
+
highlightColor: z67.string().optional(),
|
|
17246
17301
|
maxLength: distance19.optional(),
|
|
17247
|
-
connectsTo:
|
|
17302
|
+
connectsTo: z67.string().or(z67.array(z67.string())).optional()
|
|
17248
17303
|
});
|
|
17249
|
-
var traceProps =
|
|
17304
|
+
var traceProps = z67.union([
|
|
17250
17305
|
baseTraceProps.extend({
|
|
17251
|
-
path:
|
|
17306
|
+
path: z67.array(portRef)
|
|
17252
17307
|
}),
|
|
17253
17308
|
baseTraceProps.extend({
|
|
17254
17309
|
from: portRef,
|
|
@@ -17261,19 +17316,19 @@ var traceProps = z64.union([
|
|
|
17261
17316
|
]);
|
|
17262
17317
|
|
|
17263
17318
|
// lib/components/differentialpair.ts
|
|
17264
|
-
import { z as
|
|
17265
|
-
var differentialPairProps =
|
|
17266
|
-
name:
|
|
17267
|
-
positiveConnection:
|
|
17268
|
-
negativeConnection:
|
|
17269
|
-
maxLengthSkew:
|
|
17319
|
+
import { z as z68 } from "zod";
|
|
17320
|
+
var differentialPairProps = z68.object({
|
|
17321
|
+
name: z68.string().optional(),
|
|
17322
|
+
positiveConnection: z68.string(),
|
|
17323
|
+
negativeConnection: z68.string(),
|
|
17324
|
+
maxLengthSkew: z68.number().min(0).max(1).optional()
|
|
17270
17325
|
});
|
|
17271
17326
|
expectTypesMatch(true);
|
|
17272
17327
|
|
|
17273
17328
|
// lib/components/footprint.ts
|
|
17274
17329
|
import { layer_ref as layer_ref5 } from "circuit-json";
|
|
17275
|
-
import { z as
|
|
17276
|
-
var footprintInsertionDirection =
|
|
17330
|
+
import { z as z69 } from "zod";
|
|
17331
|
+
var footprintInsertionDirection = z69.enum([
|
|
17277
17332
|
"from_above",
|
|
17278
17333
|
"from_left",
|
|
17279
17334
|
"from_right",
|
|
@@ -17281,11 +17336,11 @@ var footprintInsertionDirection = z66.enum([
|
|
|
17281
17336
|
"from_back"
|
|
17282
17337
|
]);
|
|
17283
17338
|
expectTypesMatch(true);
|
|
17284
|
-
var footprintProps =
|
|
17285
|
-
children:
|
|
17286
|
-
name:
|
|
17339
|
+
var footprintProps = z69.object({
|
|
17340
|
+
children: z69.any().optional(),
|
|
17341
|
+
name: z69.string().optional(),
|
|
17287
17342
|
originalLayer: layer_ref5.default("top").optional(),
|
|
17288
|
-
circuitJson:
|
|
17343
|
+
circuitJson: z69.array(z69.any()).optional(),
|
|
17289
17344
|
src: footprintProp.describe("Can be a footprint or kicad string").optional(),
|
|
17290
17345
|
insertionDirection: footprintInsertionDirection.optional().describe(
|
|
17291
17346
|
"Direction a cable or mating part is inserted into this footprint in its unrotated orientation."
|
|
@@ -17294,19 +17349,19 @@ var footprintProps = z66.object({
|
|
|
17294
17349
|
expectTypesMatch(true);
|
|
17295
17350
|
|
|
17296
17351
|
// lib/components/symbol.ts
|
|
17297
|
-
import { z as
|
|
17298
|
-
var symbolProps =
|
|
17299
|
-
originalFacingDirection:
|
|
17352
|
+
import { z as z70 } from "zod";
|
|
17353
|
+
var symbolProps = z70.object({
|
|
17354
|
+
originalFacingDirection: z70.enum(["up", "down", "left", "right"]).default("right").optional(),
|
|
17300
17355
|
width: distance.optional(),
|
|
17301
17356
|
height: distance.optional(),
|
|
17302
|
-
name:
|
|
17357
|
+
name: z70.string().optional()
|
|
17303
17358
|
});
|
|
17304
17359
|
expectTypesMatch(true);
|
|
17305
17360
|
|
|
17306
17361
|
// lib/components/battery.ts
|
|
17307
17362
|
import { voltage as voltage2 } from "circuit-json";
|
|
17308
|
-
import { z as
|
|
17309
|
-
var capacity =
|
|
17363
|
+
import { z as z71 } from "zod";
|
|
17364
|
+
var capacity = z71.number().or(z71.string().endsWith("mAh")).transform((v) => {
|
|
17310
17365
|
if (typeof v === "string") {
|
|
17311
17366
|
const valString = v.replace("mAh", "");
|
|
17312
17367
|
const num = Number.parseFloat(valString);
|
|
@@ -17320,14 +17375,14 @@ var capacity = z68.number().or(z68.string().endsWith("mAh")).transform((v) => {
|
|
|
17320
17375
|
var batteryProps = commonComponentProps.extend({
|
|
17321
17376
|
capacity: capacity.optional(),
|
|
17322
17377
|
voltage: voltage2.optional(),
|
|
17323
|
-
standard:
|
|
17378
|
+
standard: z71.enum(["AA", "AAA", "9V", "CR2032", "18650", "C"]).optional(),
|
|
17324
17379
|
schOrientation: schematicOrientation.optional()
|
|
17325
17380
|
});
|
|
17326
17381
|
var batteryPins = lrPolarPins;
|
|
17327
17382
|
expectTypesMatch(true);
|
|
17328
17383
|
|
|
17329
17384
|
// lib/components/mountedboard.ts
|
|
17330
|
-
import { z as
|
|
17385
|
+
import { z as z72 } from "zod";
|
|
17331
17386
|
var mountedboardProps = subcircuitGroupProps.extend({
|
|
17332
17387
|
manufacturerPartNumber: chipProps.shape.manufacturerPartNumber,
|
|
17333
17388
|
pinLabels: chipProps.shape.pinLabels,
|
|
@@ -17339,7 +17394,7 @@ var mountedboardProps = subcircuitGroupProps.extend({
|
|
|
17339
17394
|
internallyConnectedPins: chipProps.shape.internallyConnectedPins,
|
|
17340
17395
|
externallyConnectedPins: chipProps.shape.externallyConnectedPins,
|
|
17341
17396
|
boardToBoardDistance: distance.optional(),
|
|
17342
|
-
mountOrientation:
|
|
17397
|
+
mountOrientation: z72.enum(["faceDown", "faceUp"]).optional()
|
|
17343
17398
|
});
|
|
17344
17399
|
expectTypesMatch(true);
|
|
17345
17400
|
|
|
@@ -17347,29 +17402,29 @@ expectTypesMatch(true);
|
|
|
17347
17402
|
import { distance as distance20 } from "circuit-json";
|
|
17348
17403
|
|
|
17349
17404
|
// lib/common/pcbOrientation.ts
|
|
17350
|
-
import { z as
|
|
17351
|
-
var pcbOrientation =
|
|
17405
|
+
import { z as z73 } from "zod";
|
|
17406
|
+
var pcbOrientation = z73.enum(["vertical", "horizontal"]).describe(
|
|
17352
17407
|
"vertical means pins go 1->2 downward and horizontal means pins go 1->2 rightward"
|
|
17353
17408
|
);
|
|
17354
17409
|
expectTypesMatch(true);
|
|
17355
17410
|
|
|
17356
17411
|
// lib/components/pin-header.ts
|
|
17357
|
-
import { z as
|
|
17412
|
+
import { z as z74 } from "zod";
|
|
17358
17413
|
var pinHeaderProps = commonComponentProps.extend({
|
|
17359
|
-
pinCount:
|
|
17414
|
+
pinCount: z74.number(),
|
|
17360
17415
|
pitch: distance20.optional(),
|
|
17361
|
-
schFacingDirection:
|
|
17362
|
-
gender:
|
|
17363
|
-
showSilkscreenPinLabels:
|
|
17364
|
-
pcbPinLabels:
|
|
17365
|
-
doubleRow:
|
|
17366
|
-
rightAngle:
|
|
17416
|
+
schFacingDirection: z74.enum(["up", "down", "left", "right"]).optional(),
|
|
17417
|
+
gender: z74.enum(["male", "female", "unpopulated"]).optional().default("male"),
|
|
17418
|
+
showSilkscreenPinLabels: z74.boolean().optional(),
|
|
17419
|
+
pcbPinLabels: z74.record(z74.string(), z74.string()).optional(),
|
|
17420
|
+
doubleRow: z74.boolean().optional(),
|
|
17421
|
+
rightAngle: z74.boolean().optional(),
|
|
17367
17422
|
pcbOrientation: pcbOrientation.optional(),
|
|
17368
17423
|
holeDiameter: distance20.optional(),
|
|
17369
17424
|
platedDiameter: distance20.optional(),
|
|
17370
|
-
pinLabels:
|
|
17371
|
-
connections:
|
|
17372
|
-
facingDirection:
|
|
17425
|
+
pinLabels: z74.record(z74.string(), schematicPinLabel).or(z74.array(schematicPinLabel)).optional(),
|
|
17426
|
+
connections: z74.custom().pipe(z74.record(z74.string(), connectionTarget)).optional(),
|
|
17427
|
+
facingDirection: z74.enum(["left", "right"]).optional(),
|
|
17373
17428
|
schPinArrangement: schematicPinArrangement.optional(),
|
|
17374
17429
|
schPinStyle: schematicPinStyle.optional(),
|
|
17375
17430
|
schPinSpacing: distance20.optional(),
|
|
@@ -17379,29 +17434,29 @@ var pinHeaderProps = commonComponentProps.extend({
|
|
|
17379
17434
|
expectTypesMatch(true);
|
|
17380
17435
|
|
|
17381
17436
|
// lib/components/netalias.ts
|
|
17382
|
-
import { z as
|
|
17437
|
+
import { z as z75 } from "zod";
|
|
17383
17438
|
import { rotation as rotation3 } from "circuit-json";
|
|
17384
|
-
var netAliasProps =
|
|
17385
|
-
net:
|
|
17386
|
-
connection:
|
|
17439
|
+
var netAliasProps = z75.object({
|
|
17440
|
+
net: z75.string().optional(),
|
|
17441
|
+
connection: z75.string().optional(),
|
|
17387
17442
|
schX: distance.optional(),
|
|
17388
17443
|
schY: distance.optional(),
|
|
17389
17444
|
schRotation: rotation3.optional(),
|
|
17390
|
-
anchorSide:
|
|
17445
|
+
anchorSide: z75.enum(["left", "top", "right", "bottom"]).optional()
|
|
17391
17446
|
});
|
|
17392
17447
|
expectTypesMatch(true);
|
|
17393
17448
|
|
|
17394
17449
|
// lib/components/netlabel.ts
|
|
17395
|
-
import { z as
|
|
17450
|
+
import { z as z76 } from "zod";
|
|
17396
17451
|
import { rotation as rotation4 } from "circuit-json";
|
|
17397
|
-
var netLabelProps =
|
|
17398
|
-
net:
|
|
17399
|
-
connection:
|
|
17400
|
-
connectsTo:
|
|
17452
|
+
var netLabelProps = z76.object({
|
|
17453
|
+
net: z76.string().optional(),
|
|
17454
|
+
connection: z76.string().optional(),
|
|
17455
|
+
connectsTo: z76.string().or(z76.array(z76.string())).optional(),
|
|
17401
17456
|
schX: distance.optional(),
|
|
17402
17457
|
schY: distance.optional(),
|
|
17403
17458
|
schRotation: rotation4.optional(),
|
|
17404
|
-
anchorSide:
|
|
17459
|
+
anchorSide: z76.enum(["left", "top", "right", "bottom"]).optional()
|
|
17405
17460
|
});
|
|
17406
17461
|
expectTypesMatch(true);
|
|
17407
17462
|
|
|
@@ -17416,52 +17471,52 @@ expectTypesMatch(true);
|
|
|
17416
17471
|
|
|
17417
17472
|
// lib/components/analogsimulation.ts
|
|
17418
17473
|
import { ms } from "circuit-json";
|
|
17419
|
-
import { z as
|
|
17420
|
-
var spiceEngine =
|
|
17474
|
+
import { z as z78 } from "zod";
|
|
17475
|
+
var spiceEngine = z78.custom(
|
|
17421
17476
|
(value) => typeof value === "string"
|
|
17422
17477
|
);
|
|
17423
|
-
var spiceOptions =
|
|
17424
|
-
method:
|
|
17425
|
-
reltol:
|
|
17426
|
-
abstol:
|
|
17427
|
-
vntol:
|
|
17478
|
+
var spiceOptions = z78.object({
|
|
17479
|
+
method: z78.enum(["trap", "gear"]).optional(),
|
|
17480
|
+
reltol: z78.union([z78.number(), z78.string()]).optional(),
|
|
17481
|
+
abstol: z78.union([z78.number(), z78.string()]).optional(),
|
|
17482
|
+
vntol: z78.union([z78.number(), z78.string()]).optional()
|
|
17428
17483
|
});
|
|
17429
|
-
var analogSimulationProps =
|
|
17430
|
-
name:
|
|
17431
|
-
simulationType:
|
|
17484
|
+
var analogSimulationProps = z78.object({
|
|
17485
|
+
name: z78.string().optional(),
|
|
17486
|
+
simulationType: z78.literal("spice_transient_analysis").default("spice_transient_analysis"),
|
|
17432
17487
|
duration: ms.optional(),
|
|
17433
17488
|
startTime: ms.optional(),
|
|
17434
17489
|
timePerStep: ms.optional(),
|
|
17435
17490
|
spiceEngine: spiceEngine.optional(),
|
|
17436
17491
|
spiceOptions: spiceOptions.optional(),
|
|
17437
|
-
graphIndependentAxes:
|
|
17492
|
+
graphIndependentAxes: z78.boolean().optional()
|
|
17438
17493
|
});
|
|
17439
17494
|
expectTypesMatch(
|
|
17440
17495
|
true
|
|
17441
17496
|
);
|
|
17442
17497
|
|
|
17443
17498
|
// lib/components/autoroutingphase.ts
|
|
17444
|
-
import { z as
|
|
17445
|
-
var autoroutingPhaseProps =
|
|
17446
|
-
key:
|
|
17447
|
-
name:
|
|
17499
|
+
import { z as z79 } from "zod";
|
|
17500
|
+
var autoroutingPhaseProps = z79.object({
|
|
17501
|
+
key: z79.any().optional(),
|
|
17502
|
+
name: z79.string().optional(),
|
|
17448
17503
|
autorouter: autorouterProp.optional(),
|
|
17449
|
-
phaseIndex:
|
|
17504
|
+
phaseIndex: z79.number().optional(),
|
|
17450
17505
|
...routingTolerances.shape,
|
|
17451
|
-
region:
|
|
17452
|
-
shape:
|
|
17453
|
-
minX:
|
|
17454
|
-
maxX:
|
|
17455
|
-
minY:
|
|
17456
|
-
maxY:
|
|
17506
|
+
region: z79.object({
|
|
17507
|
+
shape: z79.literal("rect").optional(),
|
|
17508
|
+
minX: z79.number(),
|
|
17509
|
+
maxX: z79.number(),
|
|
17510
|
+
minY: z79.number(),
|
|
17511
|
+
maxY: z79.number()
|
|
17457
17512
|
}).optional(),
|
|
17458
|
-
connection:
|
|
17459
|
-
connections:
|
|
17460
|
-
reroute:
|
|
17513
|
+
connection: z79.string().optional(),
|
|
17514
|
+
connections: z79.array(z79.string()).optional(),
|
|
17515
|
+
reroute: z79.boolean().optional()
|
|
17461
17516
|
}).superRefine((value, ctx) => {
|
|
17462
17517
|
if (value.reroute !== void 0 && value.region === void 0 && value.connection === void 0 && value.connections === void 0) {
|
|
17463
17518
|
ctx.addIssue({
|
|
17464
|
-
code:
|
|
17519
|
+
code: z79.ZodIssueCode.custom,
|
|
17465
17520
|
message: "region, connection, or connections is required when reroute is provided",
|
|
17466
17521
|
path: ["region"]
|
|
17467
17522
|
});
|
|
@@ -17470,15 +17525,15 @@ var autoroutingPhaseProps = z76.object({
|
|
|
17470
17525
|
expectTypesMatch(true);
|
|
17471
17526
|
|
|
17472
17527
|
// lib/components/spicemodel.ts
|
|
17473
|
-
import { z as
|
|
17474
|
-
var spicemodelProps =
|
|
17475
|
-
source:
|
|
17476
|
-
spicePinMapping:
|
|
17528
|
+
import { z as z80 } from "zod";
|
|
17529
|
+
var spicemodelProps = z80.object({
|
|
17530
|
+
source: z80.string(),
|
|
17531
|
+
spicePinMapping: z80.record(z80.string(), z80.string()).optional()
|
|
17477
17532
|
});
|
|
17478
17533
|
expectTypesMatch(true);
|
|
17479
17534
|
|
|
17480
17535
|
// lib/components/transistor.ts
|
|
17481
|
-
import { z as
|
|
17536
|
+
import { z as z81 } from "zod";
|
|
17482
17537
|
var transistorPinsLabels = [
|
|
17483
17538
|
"pin1",
|
|
17484
17539
|
"pin2",
|
|
@@ -17491,7 +17546,7 @@ var transistorPinsLabels = [
|
|
|
17491
17546
|
"drain"
|
|
17492
17547
|
];
|
|
17493
17548
|
var transistorProps = commonComponentProps.extend({
|
|
17494
|
-
type:
|
|
17549
|
+
type: z81.enum(["npn", "pnp", "bjt", "jfet", "mosfet", "igbt"]),
|
|
17495
17550
|
connections: createConnectionsProp(transistorPinsLabels).optional()
|
|
17496
17551
|
});
|
|
17497
17552
|
var transistorPins = [
|
|
@@ -17505,7 +17560,7 @@ var transistorPins = [
|
|
|
17505
17560
|
expectTypesMatch(true);
|
|
17506
17561
|
|
|
17507
17562
|
// lib/components/mosfet.ts
|
|
17508
|
-
import { z as
|
|
17563
|
+
import { z as z82 } from "zod";
|
|
17509
17564
|
var mosfetPins = [
|
|
17510
17565
|
"pin1",
|
|
17511
17566
|
"drain",
|
|
@@ -17515,11 +17570,11 @@ var mosfetPins = [
|
|
|
17515
17570
|
"gate"
|
|
17516
17571
|
];
|
|
17517
17572
|
var mosfetProps = commonComponentProps.extend({
|
|
17518
|
-
channelType:
|
|
17519
|
-
mosfetMode:
|
|
17520
|
-
symbolDrainSide:
|
|
17521
|
-
symbolSourceSide:
|
|
17522
|
-
symbolGateSide:
|
|
17573
|
+
channelType: z82.enum(["n", "p"]),
|
|
17574
|
+
mosfetMode: z82.enum(["enhancement", "depletion"]),
|
|
17575
|
+
symbolDrainSide: z82.enum(["left", "right", "top", "bottom"]).optional(),
|
|
17576
|
+
symbolSourceSide: z82.enum(["left", "right", "top", "bottom"]).optional(),
|
|
17577
|
+
symbolGateSide: z82.enum(["left", "right", "top", "bottom"]).optional(),
|
|
17523
17578
|
connections: createConnectionsProp(mosfetPins).optional()
|
|
17524
17579
|
});
|
|
17525
17580
|
expectTypesMatch(true);
|
|
@@ -17541,20 +17596,20 @@ expectTypesMatch(true);
|
|
|
17541
17596
|
|
|
17542
17597
|
// lib/components/inductor.ts
|
|
17543
17598
|
import { inductance } from "circuit-json";
|
|
17544
|
-
import { z as
|
|
17599
|
+
import { z as z84 } from "zod";
|
|
17545
17600
|
var inductorPins = lrPins;
|
|
17546
17601
|
var inductorProps = commonComponentProps.extend({
|
|
17547
17602
|
inductance,
|
|
17548
|
-
maxCurrentRating:
|
|
17603
|
+
maxCurrentRating: z84.union([z84.string(), z84.number()]).optional(),
|
|
17549
17604
|
schOrientation: schematicOrientation.optional(),
|
|
17550
17605
|
connections: createConnectionsProp(inductorPins).optional()
|
|
17551
17606
|
});
|
|
17552
17607
|
expectTypesMatch(true);
|
|
17553
17608
|
|
|
17554
17609
|
// lib/components/diode.ts
|
|
17555
|
-
import { z as
|
|
17610
|
+
import { z as z85 } from "zod";
|
|
17556
17611
|
var diodePins = lrPolarPins;
|
|
17557
|
-
var diodeConnectionKeys =
|
|
17612
|
+
var diodeConnectionKeys = z85.enum([
|
|
17558
17613
|
"anode",
|
|
17559
17614
|
"cathode",
|
|
17560
17615
|
"pin1",
|
|
@@ -17562,13 +17617,13 @@ var diodeConnectionKeys = z82.enum([
|
|
|
17562
17617
|
"pos",
|
|
17563
17618
|
"neg"
|
|
17564
17619
|
]);
|
|
17565
|
-
var connectionTarget3 =
|
|
17566
|
-
var connectionsProp2 =
|
|
17567
|
-
var diodePinLabelsProp =
|
|
17568
|
-
|
|
17569
|
-
schematicPinLabel.or(
|
|
17620
|
+
var connectionTarget3 = z85.string().or(z85.array(z85.string()).readonly()).or(z85.array(z85.string()));
|
|
17621
|
+
var connectionsProp2 = z85.record(diodeConnectionKeys, connectionTarget3);
|
|
17622
|
+
var diodePinLabelsProp = z85.record(
|
|
17623
|
+
z85.enum(diodePins),
|
|
17624
|
+
schematicPinLabel.or(z85.array(schematicPinLabel).readonly()).or(z85.array(schematicPinLabel))
|
|
17570
17625
|
);
|
|
17571
|
-
var diodeVariant =
|
|
17626
|
+
var diodeVariant = z85.enum([
|
|
17572
17627
|
"standard",
|
|
17573
17628
|
"schottky",
|
|
17574
17629
|
"zener",
|
|
@@ -17579,12 +17634,12 @@ var diodeVariant = z82.enum([
|
|
|
17579
17634
|
var diodeProps = commonComponentProps.extend({
|
|
17580
17635
|
connections: connectionsProp2.optional(),
|
|
17581
17636
|
variant: diodeVariant.optional().default("standard"),
|
|
17582
|
-
standard:
|
|
17583
|
-
schottky:
|
|
17584
|
-
zener:
|
|
17585
|
-
avalanche:
|
|
17586
|
-
photo:
|
|
17587
|
-
tvs:
|
|
17637
|
+
standard: z85.boolean().optional(),
|
|
17638
|
+
schottky: z85.boolean().optional(),
|
|
17639
|
+
zener: z85.boolean().optional(),
|
|
17640
|
+
avalanche: z85.boolean().optional(),
|
|
17641
|
+
photo: z85.boolean().optional(),
|
|
17642
|
+
tvs: z85.boolean().optional(),
|
|
17588
17643
|
schOrientation: schematicOrientation.optional(),
|
|
17589
17644
|
pinLabels: diodePinLabelsProp.optional()
|
|
17590
17645
|
}).superRefine((data, ctx) => {
|
|
@@ -17598,11 +17653,11 @@ var diodeProps = commonComponentProps.extend({
|
|
|
17598
17653
|
].filter(Boolean).length;
|
|
17599
17654
|
if (enabledFlags > 1) {
|
|
17600
17655
|
ctx.addIssue({
|
|
17601
|
-
code:
|
|
17656
|
+
code: z85.ZodIssueCode.custom,
|
|
17602
17657
|
message: "Exactly one diode variant must be enabled",
|
|
17603
17658
|
path: []
|
|
17604
17659
|
});
|
|
17605
|
-
return
|
|
17660
|
+
return z85.INVALID;
|
|
17606
17661
|
}
|
|
17607
17662
|
}).transform((data) => {
|
|
17608
17663
|
const result = {
|
|
@@ -17648,34 +17703,34 @@ var diodeProps = commonComponentProps.extend({
|
|
|
17648
17703
|
expectTypesMatch(true);
|
|
17649
17704
|
|
|
17650
17705
|
// lib/components/led.ts
|
|
17651
|
-
import { z as
|
|
17706
|
+
import { z as z86 } from "zod";
|
|
17652
17707
|
var ledProps = commonComponentProps.extend({
|
|
17653
|
-
color:
|
|
17654
|
-
wavelength:
|
|
17655
|
-
schDisplayValue:
|
|
17708
|
+
color: z86.string().optional(),
|
|
17709
|
+
wavelength: z86.string().optional(),
|
|
17710
|
+
schDisplayValue: z86.string().optional(),
|
|
17656
17711
|
schOrientation: schematicOrientation.optional(),
|
|
17657
17712
|
connections: createConnectionsProp(lrPolarPins).optional(),
|
|
17658
|
-
laser:
|
|
17713
|
+
laser: z86.boolean().optional()
|
|
17659
17714
|
});
|
|
17660
17715
|
var ledPins = lrPolarPins;
|
|
17661
17716
|
|
|
17662
17717
|
// lib/components/switch.ts
|
|
17663
17718
|
import { ms as ms2, frequency as frequency3 } from "circuit-json";
|
|
17664
|
-
import { z as
|
|
17719
|
+
import { z as z87 } from "zod";
|
|
17665
17720
|
var switchProps = commonComponentProps.extend({
|
|
17666
|
-
type:
|
|
17667
|
-
isNormallyClosed:
|
|
17668
|
-
spst:
|
|
17669
|
-
spdt:
|
|
17670
|
-
dpst:
|
|
17671
|
-
dpdt:
|
|
17721
|
+
type: z87.enum(["spst", "spdt", "dpst", "dpdt"]).optional(),
|
|
17722
|
+
isNormallyClosed: z87.boolean().optional().default(false),
|
|
17723
|
+
spst: z87.boolean().optional(),
|
|
17724
|
+
spdt: z87.boolean().optional(),
|
|
17725
|
+
dpst: z87.boolean().optional(),
|
|
17726
|
+
dpdt: z87.boolean().optional(),
|
|
17672
17727
|
pinLabels: pinLabelsProp.optional(),
|
|
17673
17728
|
simSwitchFrequency: frequency3.optional(),
|
|
17674
17729
|
simCloseAt: ms2.optional(),
|
|
17675
17730
|
simOpenAt: ms2.optional(),
|
|
17676
|
-
simStartClosed:
|
|
17677
|
-
simStartOpen:
|
|
17678
|
-
connections:
|
|
17731
|
+
simStartClosed: z87.boolean().optional(),
|
|
17732
|
+
simStartOpen: z87.boolean().optional(),
|
|
17733
|
+
connections: z87.custom().pipe(z87.record(z87.string(), connectionTarget)).optional()
|
|
17679
17734
|
}).transform((props) => {
|
|
17680
17735
|
const updatedProps = { ...props };
|
|
17681
17736
|
if (updatedProps.dpdt) {
|
|
@@ -17707,33 +17762,33 @@ expectTypesMatch(true);
|
|
|
17707
17762
|
|
|
17708
17763
|
// lib/components/fabrication-note-text.ts
|
|
17709
17764
|
import { length as length4 } from "circuit-json";
|
|
17710
|
-
import { z as
|
|
17765
|
+
import { z as z88 } from "zod";
|
|
17711
17766
|
var fabricationNoteTextProps = pcbLayoutProps.extend({
|
|
17712
|
-
text:
|
|
17713
|
-
anchorAlignment:
|
|
17714
|
-
font:
|
|
17767
|
+
text: z88.string(),
|
|
17768
|
+
anchorAlignment: z88.enum(["center", "top_left", "top_right", "bottom_left", "bottom_right"]).default("center"),
|
|
17769
|
+
font: z88.enum(["tscircuit2024"]).optional(),
|
|
17715
17770
|
fontSize: length4.optional(),
|
|
17716
|
-
color:
|
|
17771
|
+
color: z88.string().optional()
|
|
17717
17772
|
});
|
|
17718
17773
|
expectTypesMatch(true);
|
|
17719
17774
|
|
|
17720
17775
|
// lib/components/fabrication-note-rect.ts
|
|
17721
17776
|
import { distance as distance21 } from "circuit-json";
|
|
17722
|
-
import { z as
|
|
17777
|
+
import { z as z89 } from "zod";
|
|
17723
17778
|
var fabricationNoteRectProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
17724
17779
|
width: distance21,
|
|
17725
17780
|
height: distance21,
|
|
17726
17781
|
strokeWidth: distance21.optional(),
|
|
17727
|
-
isFilled:
|
|
17728
|
-
hasStroke:
|
|
17729
|
-
isStrokeDashed:
|
|
17730
|
-
color:
|
|
17782
|
+
isFilled: z89.boolean().optional(),
|
|
17783
|
+
hasStroke: z89.boolean().optional(),
|
|
17784
|
+
isStrokeDashed: z89.boolean().optional(),
|
|
17785
|
+
color: z89.string().optional(),
|
|
17731
17786
|
cornerRadius: distance21.optional()
|
|
17732
17787
|
});
|
|
17733
17788
|
|
|
17734
17789
|
// lib/components/fabrication-note-path.ts
|
|
17735
17790
|
import { length as length5, route_hint_point as route_hint_point3 } from "circuit-json";
|
|
17736
|
-
import { z as
|
|
17791
|
+
import { z as z90 } from "zod";
|
|
17737
17792
|
var fabricationNotePathProps = pcbLayoutProps.omit({
|
|
17738
17793
|
pcbLeftEdgeX: true,
|
|
17739
17794
|
pcbRightEdgeX: true,
|
|
@@ -17745,15 +17800,15 @@ var fabricationNotePathProps = pcbLayoutProps.omit({
|
|
|
17745
17800
|
pcbOffsetY: true,
|
|
17746
17801
|
pcbRotation: true
|
|
17747
17802
|
}).extend({
|
|
17748
|
-
route:
|
|
17803
|
+
route: z90.array(route_hint_point3),
|
|
17749
17804
|
strokeWidth: length5.optional(),
|
|
17750
|
-
color:
|
|
17805
|
+
color: z90.string().optional()
|
|
17751
17806
|
});
|
|
17752
17807
|
|
|
17753
17808
|
// lib/components/fabrication-note-dimension.ts
|
|
17754
17809
|
import { distance as distance22, length as length6 } from "circuit-json";
|
|
17755
|
-
import { z as
|
|
17756
|
-
var dimensionTarget =
|
|
17810
|
+
import { z as z91 } from "zod";
|
|
17811
|
+
var dimensionTarget = z91.union([z91.string(), point]);
|
|
17757
17812
|
var fabricationNoteDimensionProps = pcbLayoutProps.omit({
|
|
17758
17813
|
pcbLeftEdgeX: true,
|
|
17759
17814
|
pcbRightEdgeX: true,
|
|
@@ -17767,54 +17822,54 @@ var fabricationNoteDimensionProps = pcbLayoutProps.omit({
|
|
|
17767
17822
|
}).extend({
|
|
17768
17823
|
from: dimensionTarget,
|
|
17769
17824
|
to: dimensionTarget,
|
|
17770
|
-
text:
|
|
17825
|
+
text: z91.string().optional(),
|
|
17771
17826
|
offset: distance22.optional(),
|
|
17772
|
-
font:
|
|
17827
|
+
font: z91.enum(["tscircuit2024"]).optional(),
|
|
17773
17828
|
fontSize: length6.optional(),
|
|
17774
|
-
color:
|
|
17829
|
+
color: z91.string().optional(),
|
|
17775
17830
|
arrowSize: distance22.optional(),
|
|
17776
|
-
units:
|
|
17777
|
-
outerEdgeToEdge:
|
|
17778
|
-
centerToCenter:
|
|
17779
|
-
innerEdgeToEdge:
|
|
17831
|
+
units: z91.enum(["in", "mm"]).optional(),
|
|
17832
|
+
outerEdgeToEdge: z91.literal(true).optional(),
|
|
17833
|
+
centerToCenter: z91.literal(true).optional(),
|
|
17834
|
+
innerEdgeToEdge: z91.literal(true).optional()
|
|
17780
17835
|
});
|
|
17781
17836
|
expectTypesMatch(true);
|
|
17782
17837
|
|
|
17783
17838
|
// lib/components/pcb-trace.ts
|
|
17784
17839
|
import { distance as distance23, route_hint_point as route_hint_point4 } from "circuit-json";
|
|
17785
|
-
import { z as
|
|
17786
|
-
var pcbTraceProps =
|
|
17787
|
-
layer:
|
|
17840
|
+
import { z as z92 } from "zod";
|
|
17841
|
+
var pcbTraceProps = z92.object({
|
|
17842
|
+
layer: z92.string().optional(),
|
|
17788
17843
|
thickness: distance23.optional(),
|
|
17789
|
-
route:
|
|
17844
|
+
route: z92.array(route_hint_point4)
|
|
17790
17845
|
});
|
|
17791
17846
|
|
|
17792
17847
|
// lib/components/via.ts
|
|
17793
17848
|
import { distance as distance24, layer_ref as layer_ref6 } from "circuit-json";
|
|
17794
|
-
import { z as
|
|
17849
|
+
import { z as z93 } from "zod";
|
|
17795
17850
|
var viaProps = commonLayoutProps.extend({
|
|
17796
|
-
name:
|
|
17851
|
+
name: z93.string().optional(),
|
|
17797
17852
|
fromLayer: layer_ref6.optional(),
|
|
17798
17853
|
toLayer: layer_ref6.optional(),
|
|
17799
17854
|
holeDiameter: distance24.optional(),
|
|
17800
17855
|
outerDiameter: distance24.optional(),
|
|
17801
|
-
layers:
|
|
17802
|
-
connectsTo:
|
|
17803
|
-
netIsAssignable:
|
|
17856
|
+
layers: z93.array(layer_ref6).optional(),
|
|
17857
|
+
connectsTo: z93.string().or(z93.array(z93.string())).optional(),
|
|
17858
|
+
netIsAssignable: z93.boolean().optional()
|
|
17804
17859
|
});
|
|
17805
17860
|
expectTypesMatch(true);
|
|
17806
17861
|
|
|
17807
17862
|
// lib/components/testpoint.ts
|
|
17808
17863
|
import { distance as distance25 } from "circuit-json";
|
|
17809
|
-
import { z as
|
|
17864
|
+
import { z as z94 } from "zod";
|
|
17810
17865
|
var testpointPins = ["pin1"];
|
|
17811
|
-
var testpointConnectionsProp =
|
|
17866
|
+
var testpointConnectionsProp = z94.object({
|
|
17812
17867
|
pin1: connectionTarget
|
|
17813
17868
|
}).strict();
|
|
17814
17869
|
var testpointProps = commonComponentProps.extend({
|
|
17815
17870
|
connections: testpointConnectionsProp.optional(),
|
|
17816
|
-
footprintVariant:
|
|
17817
|
-
padShape:
|
|
17871
|
+
footprintVariant: z94.enum(["pad", "through_hole"]).optional(),
|
|
17872
|
+
padShape: z94.enum(["rect", "circle"]).optional().default("circle"),
|
|
17818
17873
|
padDiameter: distance25.optional(),
|
|
17819
17874
|
holeDiameter: distance25.optional(),
|
|
17820
17875
|
width: distance25.optional(),
|
|
@@ -17826,45 +17881,45 @@ var testpointProps = commonComponentProps.extend({
|
|
|
17826
17881
|
expectTypesMatch(true);
|
|
17827
17882
|
|
|
17828
17883
|
// lib/components/breakoutpoint.ts
|
|
17829
|
-
import { z as
|
|
17884
|
+
import { z as z95 } from "zod";
|
|
17830
17885
|
var breakoutPointProps = pcbLayoutProps.omit({ pcbRotation: true, layer: true }).extend({
|
|
17831
|
-
connection:
|
|
17886
|
+
connection: z95.string()
|
|
17832
17887
|
});
|
|
17833
17888
|
expectTypesMatch(true);
|
|
17834
17889
|
|
|
17835
17890
|
// lib/components/pcb-keepout.ts
|
|
17836
17891
|
import { distance as distance26, layer_ref as layer_ref7 } from "circuit-json";
|
|
17837
|
-
import { z as
|
|
17838
|
-
var pcbKeepoutProps =
|
|
17892
|
+
import { z as z96 } from "zod";
|
|
17893
|
+
var pcbKeepoutProps = z96.union([
|
|
17839
17894
|
pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
17840
|
-
shape:
|
|
17895
|
+
shape: z96.literal("circle"),
|
|
17841
17896
|
radius: distance26,
|
|
17842
|
-
layers:
|
|
17897
|
+
layers: z96.array(layer_ref7).optional()
|
|
17843
17898
|
}),
|
|
17844
17899
|
pcbLayoutProps.extend({
|
|
17845
|
-
shape:
|
|
17900
|
+
shape: z96.literal("rect"),
|
|
17846
17901
|
width: distance26,
|
|
17847
17902
|
height: distance26,
|
|
17848
|
-
layers:
|
|
17903
|
+
layers: z96.array(layer_ref7).optional()
|
|
17849
17904
|
})
|
|
17850
17905
|
]);
|
|
17851
17906
|
|
|
17852
17907
|
// lib/components/courtyard-rect.ts
|
|
17853
17908
|
import { distance as distance27 } from "circuit-json";
|
|
17854
|
-
import { z as
|
|
17909
|
+
import { z as z97 } from "zod";
|
|
17855
17910
|
var courtyardRectProps = pcbLayoutProps.extend({
|
|
17856
17911
|
width: distance27,
|
|
17857
17912
|
height: distance27,
|
|
17858
17913
|
strokeWidth: distance27.optional(),
|
|
17859
|
-
isFilled:
|
|
17860
|
-
hasStroke:
|
|
17861
|
-
isStrokeDashed:
|
|
17862
|
-
color:
|
|
17914
|
+
isFilled: z97.boolean().optional(),
|
|
17915
|
+
hasStroke: z97.boolean().optional(),
|
|
17916
|
+
isStrokeDashed: z97.boolean().optional(),
|
|
17917
|
+
color: z97.string().optional()
|
|
17863
17918
|
});
|
|
17864
17919
|
|
|
17865
17920
|
// lib/components/courtyard-outline.ts
|
|
17866
17921
|
import { length as length7 } from "circuit-json";
|
|
17867
|
-
import { z as
|
|
17922
|
+
import { z as z98 } from "zod";
|
|
17868
17923
|
var courtyardOutlineProps = pcbLayoutProps.omit({
|
|
17869
17924
|
pcbLeftEdgeX: true,
|
|
17870
17925
|
pcbRightEdgeX: true,
|
|
@@ -17876,11 +17931,11 @@ var courtyardOutlineProps = pcbLayoutProps.omit({
|
|
|
17876
17931
|
pcbOffsetY: true,
|
|
17877
17932
|
pcbRotation: true
|
|
17878
17933
|
}).extend({
|
|
17879
|
-
outline:
|
|
17934
|
+
outline: z98.array(point),
|
|
17880
17935
|
strokeWidth: length7.optional(),
|
|
17881
|
-
isClosed:
|
|
17882
|
-
isStrokeDashed:
|
|
17883
|
-
color:
|
|
17936
|
+
isClosed: z98.boolean().optional(),
|
|
17937
|
+
isStrokeDashed: z98.boolean().optional(),
|
|
17938
|
+
color: z98.string().optional()
|
|
17884
17939
|
});
|
|
17885
17940
|
|
|
17886
17941
|
// lib/components/courtyard-circle.ts
|
|
@@ -17900,35 +17955,35 @@ var courtyardPillProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
|
17900
17955
|
});
|
|
17901
17956
|
|
|
17902
17957
|
// lib/components/copper-pour.ts
|
|
17903
|
-
import { z as
|
|
17958
|
+
import { z as z101 } from "zod";
|
|
17904
17959
|
import { layer_ref as layer_ref8 } from "circuit-json";
|
|
17905
|
-
var copperPourProps =
|
|
17906
|
-
name:
|
|
17960
|
+
var copperPourProps = z101.object({
|
|
17961
|
+
name: z101.string().optional(),
|
|
17907
17962
|
layer: layer_ref8,
|
|
17908
|
-
connectsTo:
|
|
17909
|
-
unbroken:
|
|
17963
|
+
connectsTo: z101.string(),
|
|
17964
|
+
unbroken: z101.boolean().optional(),
|
|
17910
17965
|
padMargin: distance.optional(),
|
|
17911
17966
|
traceMargin: distance.optional(),
|
|
17912
17967
|
clearance: distance.optional(),
|
|
17913
17968
|
boardEdgeMargin: distance.optional(),
|
|
17914
17969
|
cutoutMargin: distance.optional(),
|
|
17915
|
-
outline:
|
|
17916
|
-
coveredWithSolderMask:
|
|
17970
|
+
outline: z101.array(point).optional(),
|
|
17971
|
+
coveredWithSolderMask: z101.boolean().optional().default(true)
|
|
17917
17972
|
});
|
|
17918
17973
|
expectTypesMatch(true);
|
|
17919
17974
|
|
|
17920
17975
|
// lib/components/cadassembly.ts
|
|
17921
17976
|
import { layer_ref as layer_ref9 } from "circuit-json";
|
|
17922
|
-
import { z as
|
|
17923
|
-
var cadassemblyProps =
|
|
17977
|
+
import { z as z102 } from "zod";
|
|
17978
|
+
var cadassemblyProps = z102.object({
|
|
17924
17979
|
originalLayer: layer_ref9.default("top").optional(),
|
|
17925
|
-
children:
|
|
17980
|
+
children: z102.any().optional()
|
|
17926
17981
|
});
|
|
17927
17982
|
expectTypesMatch(true);
|
|
17928
17983
|
|
|
17929
17984
|
// lib/components/cadmodel.ts
|
|
17930
|
-
import { z as
|
|
17931
|
-
var pcbPosition =
|
|
17985
|
+
import { z as z103 } from "zod";
|
|
17986
|
+
var pcbPosition = z103.object({
|
|
17932
17987
|
pcbX: pcbCoordinate.optional(),
|
|
17933
17988
|
pcbY: pcbCoordinate.optional(),
|
|
17934
17989
|
pcbLeftEdgeX: pcbCoordinate.optional(),
|
|
@@ -17945,7 +18000,7 @@ var cadModelBaseWithUrl = cadModelBase.extend({
|
|
|
17945
18000
|
});
|
|
17946
18001
|
var cadModelObject = cadModelBaseWithUrl.merge(pcbPosition);
|
|
17947
18002
|
expectTypesMatch(true);
|
|
17948
|
-
var cadmodelProps =
|
|
18003
|
+
var cadmodelProps = z103.union([z103.null(), url, cadModelObject]);
|
|
17949
18004
|
|
|
17950
18005
|
// lib/components/power-source.ts
|
|
17951
18006
|
import { voltage as voltage3 } from "circuit-json";
|
|
@@ -17955,9 +18010,9 @@ var powerSourceProps = commonComponentProps.extend({
|
|
|
17955
18010
|
|
|
17956
18011
|
// lib/components/voltagesource.ts
|
|
17957
18012
|
import { frequency as frequency4, ms as ms3, rotation as rotation5, voltage as voltage4 } from "circuit-json";
|
|
17958
|
-
import { z as
|
|
18013
|
+
import { z as z104 } from "zod";
|
|
17959
18014
|
var voltageSourcePinLabels = ["pin1", "pin2", "pos", "neg"];
|
|
17960
|
-
var percentage =
|
|
18015
|
+
var percentage = z104.union([z104.string(), z104.number()]).transform((val) => {
|
|
17961
18016
|
if (typeof val === "string") {
|
|
17962
18017
|
if (val.endsWith("%")) {
|
|
17963
18018
|
return parseFloat(val.slice(0, -1)) / 100;
|
|
@@ -17966,13 +18021,13 @@ var percentage = z101.union([z101.string(), z101.number()]).transform((val) => {
|
|
|
17966
18021
|
}
|
|
17967
18022
|
return val;
|
|
17968
18023
|
}).pipe(
|
|
17969
|
-
|
|
18024
|
+
z104.number().min(0, "Duty cycle must be non-negative").max(1, "Duty cycle cannot be greater than 100%")
|
|
17970
18025
|
);
|
|
17971
18026
|
var voltageSourceProps = commonComponentProps.extend({
|
|
17972
18027
|
voltage: voltage4.optional(),
|
|
17973
18028
|
frequency: frequency4.optional(),
|
|
17974
18029
|
peakToPeakVoltage: voltage4.optional(),
|
|
17975
|
-
waveShape:
|
|
18030
|
+
waveShape: z104.enum(["sinewave", "square", "triangle", "sawtooth"]).optional(),
|
|
17976
18031
|
phase: rotation5.optional(),
|
|
17977
18032
|
dutyCycle: percentage.optional(),
|
|
17978
18033
|
pulseDelay: ms3.optional(),
|
|
@@ -17987,9 +18042,9 @@ expectTypesMatch(true);
|
|
|
17987
18042
|
|
|
17988
18043
|
// lib/components/currentsource.ts
|
|
17989
18044
|
import { frequency as frequency5, rotation as rotation6, current } from "circuit-json";
|
|
17990
|
-
import { z as
|
|
18045
|
+
import { z as z105 } from "zod";
|
|
17991
18046
|
var currentSourcePinLabels = ["pin1", "pin2", "pos", "neg"];
|
|
17992
|
-
var percentage2 =
|
|
18047
|
+
var percentage2 = z105.union([z105.string(), z105.number()]).transform((val) => {
|
|
17993
18048
|
if (typeof val === "string") {
|
|
17994
18049
|
if (val.endsWith("%")) {
|
|
17995
18050
|
return parseFloat(val.slice(0, -1)) / 100;
|
|
@@ -17998,13 +18053,13 @@ var percentage2 = z102.union([z102.string(), z102.number()]).transform((val) =>
|
|
|
17998
18053
|
}
|
|
17999
18054
|
return val;
|
|
18000
18055
|
}).pipe(
|
|
18001
|
-
|
|
18056
|
+
z105.number().min(0, "Duty cycle must be non-negative").max(1, "Duty cycle cannot be greater than 100%")
|
|
18002
18057
|
);
|
|
18003
18058
|
var currentSourceProps = commonComponentProps.extend({
|
|
18004
18059
|
current: current.optional(),
|
|
18005
18060
|
frequency: frequency5.optional(),
|
|
18006
18061
|
peakToPeakCurrent: current.optional(),
|
|
18007
|
-
waveShape:
|
|
18062
|
+
waveShape: z105.enum(["sinewave", "square", "triangle", "sawtooth"]).optional(),
|
|
18008
18063
|
phase: rotation6.optional(),
|
|
18009
18064
|
dutyCycle: percentage2.optional(),
|
|
18010
18065
|
connections: createConnectionsProp(currentSourcePinLabels).optional()
|
|
@@ -18013,21 +18068,21 @@ var currentSourcePins = lrPolarPins;
|
|
|
18013
18068
|
expectTypesMatch(true);
|
|
18014
18069
|
|
|
18015
18070
|
// lib/components/voltageprobe.ts
|
|
18016
|
-
import { z as
|
|
18071
|
+
import { z as z106 } from "zod";
|
|
18017
18072
|
var voltageProbeProps = commonComponentProps.omit({ name: true }).extend({
|
|
18018
|
-
name:
|
|
18019
|
-
connectsTo:
|
|
18020
|
-
referenceTo:
|
|
18021
|
-
color:
|
|
18022
|
-
graphDisplayName:
|
|
18023
|
-
graphCenter:
|
|
18024
|
-
graphVerticalOffset:
|
|
18025
|
-
graphVoltagePerDiv:
|
|
18073
|
+
name: z106.string().optional(),
|
|
18074
|
+
connectsTo: z106.string(),
|
|
18075
|
+
referenceTo: z106.string().optional(),
|
|
18076
|
+
color: z106.string().optional(),
|
|
18077
|
+
graphDisplayName: z106.string().optional(),
|
|
18078
|
+
graphCenter: z106.number().optional(),
|
|
18079
|
+
graphVerticalOffset: z106.number().or(z106.string()).optional(),
|
|
18080
|
+
graphVoltagePerDiv: z106.number().or(z106.string()).optional()
|
|
18026
18081
|
});
|
|
18027
18082
|
expectTypesMatch(true);
|
|
18028
18083
|
|
|
18029
18084
|
// lib/components/ammeter.ts
|
|
18030
|
-
import { z as
|
|
18085
|
+
import { z as z107 } from "zod";
|
|
18031
18086
|
var ammeterPinLabels = ["pin1", "pin2", "pos", "neg"];
|
|
18032
18087
|
var hasAmmeterConnectionPair = (connections) => {
|
|
18033
18088
|
return connections.pos !== void 0 && connections.neg !== void 0 || connections.pin1 !== void 0 && connections.pin2 !== void 0;
|
|
@@ -18037,57 +18092,57 @@ var ammeterProps = commonComponentProps.extend({
|
|
|
18037
18092
|
hasAmmeterConnectionPair,
|
|
18038
18093
|
"Ammeter connections must include either pos/neg or pin1/pin2"
|
|
18039
18094
|
),
|
|
18040
|
-
color:
|
|
18041
|
-
graphDisplayName:
|
|
18042
|
-
graphCenter:
|
|
18043
|
-
graphVerticalOffset:
|
|
18044
|
-
graphCurrentPerDiv:
|
|
18095
|
+
color: z107.string().optional(),
|
|
18096
|
+
graphDisplayName: z107.string().optional(),
|
|
18097
|
+
graphCenter: z107.number().optional(),
|
|
18098
|
+
graphVerticalOffset: z107.number().or(z107.string()).optional(),
|
|
18099
|
+
graphCurrentPerDiv: z107.number().or(z107.string()).optional()
|
|
18045
18100
|
});
|
|
18046
18101
|
var ammeterPins = ammeterPinLabels;
|
|
18047
18102
|
expectTypesMatch(true);
|
|
18048
18103
|
|
|
18049
18104
|
// lib/components/schematic-arc.ts
|
|
18050
18105
|
import { distance as distance30, point as point5, rotation as rotation7 } from "circuit-json";
|
|
18051
|
-
import { z as
|
|
18052
|
-
var schematicArcProps =
|
|
18106
|
+
import { z as z108 } from "zod";
|
|
18107
|
+
var schematicArcProps = z108.object({
|
|
18053
18108
|
center: point5,
|
|
18054
18109
|
radius: distance30,
|
|
18055
18110
|
startAngleDegrees: rotation7,
|
|
18056
18111
|
endAngleDegrees: rotation7,
|
|
18057
|
-
direction:
|
|
18112
|
+
direction: z108.enum(["clockwise", "counterclockwise"]).default("counterclockwise"),
|
|
18058
18113
|
strokeWidth: distance30.optional(),
|
|
18059
|
-
color:
|
|
18060
|
-
isDashed:
|
|
18114
|
+
color: z108.string().optional(),
|
|
18115
|
+
isDashed: z108.boolean().optional().default(false)
|
|
18061
18116
|
});
|
|
18062
18117
|
expectTypesMatch(true);
|
|
18063
18118
|
|
|
18064
18119
|
// lib/components/toolingrail.ts
|
|
18065
|
-
import { z as
|
|
18066
|
-
var toolingrailProps =
|
|
18067
|
-
children:
|
|
18120
|
+
import { z as z109 } from "zod";
|
|
18121
|
+
var toolingrailProps = z109.object({
|
|
18122
|
+
children: z109.any().optional()
|
|
18068
18123
|
});
|
|
18069
18124
|
expectTypesMatch(true);
|
|
18070
18125
|
|
|
18071
18126
|
// lib/components/schematic-box.ts
|
|
18072
18127
|
import { distance as distance31 } from "circuit-json";
|
|
18073
|
-
import { z as
|
|
18074
|
-
var schematicBoxProps =
|
|
18128
|
+
import { z as z110 } from "zod";
|
|
18129
|
+
var schematicBoxProps = z110.object({
|
|
18075
18130
|
schX: distance31.optional(),
|
|
18076
18131
|
schY: distance31.optional(),
|
|
18077
18132
|
width: distance31.optional(),
|
|
18078
18133
|
height: distance31.optional(),
|
|
18079
|
-
overlay:
|
|
18134
|
+
overlay: z110.array(z110.string()).optional(),
|
|
18080
18135
|
padding: distance31.optional(),
|
|
18081
18136
|
paddingLeft: distance31.optional(),
|
|
18082
18137
|
paddingRight: distance31.optional(),
|
|
18083
18138
|
paddingTop: distance31.optional(),
|
|
18084
18139
|
paddingBottom: distance31.optional(),
|
|
18085
|
-
title:
|
|
18140
|
+
title: z110.string().optional(),
|
|
18086
18141
|
titleAlignment: ninePointAnchor.default("top_left"),
|
|
18087
|
-
titleColor:
|
|
18142
|
+
titleColor: z110.string().optional(),
|
|
18088
18143
|
titleFontSize: distance31.optional(),
|
|
18089
|
-
titleInside:
|
|
18090
|
-
strokeStyle:
|
|
18144
|
+
titleInside: z110.boolean().default(false),
|
|
18145
|
+
strokeStyle: z110.enum(["solid", "dashed"]).default("solid")
|
|
18091
18146
|
}).refine(
|
|
18092
18147
|
(elm) => elm.width !== void 0 && elm.height !== void 0 || Array.isArray(elm.overlay) && elm.overlay.length > 0,
|
|
18093
18148
|
{
|
|
@@ -18103,15 +18158,15 @@ expectTypesMatch(true);
|
|
|
18103
18158
|
|
|
18104
18159
|
// lib/components/schematic-circle.ts
|
|
18105
18160
|
import { distance as distance32, point as point6 } from "circuit-json";
|
|
18106
|
-
import { z as
|
|
18107
|
-
var schematicCircleProps =
|
|
18161
|
+
import { z as z111 } from "zod";
|
|
18162
|
+
var schematicCircleProps = z111.object({
|
|
18108
18163
|
center: point6,
|
|
18109
18164
|
radius: distance32,
|
|
18110
18165
|
strokeWidth: distance32.optional(),
|
|
18111
|
-
color:
|
|
18112
|
-
isFilled:
|
|
18113
|
-
fillColor:
|
|
18114
|
-
isDashed:
|
|
18166
|
+
color: z111.string().optional(),
|
|
18167
|
+
isFilled: z111.boolean().optional().default(false),
|
|
18168
|
+
fillColor: z111.string().optional(),
|
|
18169
|
+
isDashed: z111.boolean().optional().default(false)
|
|
18115
18170
|
});
|
|
18116
18171
|
expectTypesMatch(
|
|
18117
18172
|
true
|
|
@@ -18119,32 +18174,32 @@ expectTypesMatch(
|
|
|
18119
18174
|
|
|
18120
18175
|
// lib/components/schematic-rect.ts
|
|
18121
18176
|
import { distance as distance33, rotation as rotation8 } from "circuit-json";
|
|
18122
|
-
import { z as
|
|
18123
|
-
var schematicRectProps =
|
|
18177
|
+
import { z as z112 } from "zod";
|
|
18178
|
+
var schematicRectProps = z112.object({
|
|
18124
18179
|
schX: distance33.optional(),
|
|
18125
18180
|
schY: distance33.optional(),
|
|
18126
18181
|
width: distance33,
|
|
18127
18182
|
height: distance33,
|
|
18128
18183
|
rotation: rotation8.default(0),
|
|
18129
18184
|
strokeWidth: distance33.optional(),
|
|
18130
|
-
color:
|
|
18131
|
-
isFilled:
|
|
18132
|
-
fillColor:
|
|
18133
|
-
isDashed:
|
|
18185
|
+
color: z112.string().optional(),
|
|
18186
|
+
isFilled: z112.boolean().optional().default(false),
|
|
18187
|
+
fillColor: z112.string().optional(),
|
|
18188
|
+
isDashed: z112.boolean().optional().default(false)
|
|
18134
18189
|
});
|
|
18135
18190
|
expectTypesMatch(true);
|
|
18136
18191
|
|
|
18137
18192
|
// lib/components/schematic-line.ts
|
|
18138
18193
|
import { distance as distance34 } from "circuit-json";
|
|
18139
|
-
import { z as
|
|
18140
|
-
var schematicLineProps =
|
|
18194
|
+
import { z as z113 } from "zod";
|
|
18195
|
+
var schematicLineProps = z113.object({
|
|
18141
18196
|
x1: distance34,
|
|
18142
18197
|
y1: distance34,
|
|
18143
18198
|
x2: distance34,
|
|
18144
18199
|
y2: distance34,
|
|
18145
18200
|
strokeWidth: distance34.optional(),
|
|
18146
|
-
color:
|
|
18147
|
-
isDashed:
|
|
18201
|
+
color: z113.string().optional(),
|
|
18202
|
+
isDashed: z113.boolean().optional().default(false),
|
|
18148
18203
|
dashLength: distance34.optional(),
|
|
18149
18204
|
dashGap: distance34.optional()
|
|
18150
18205
|
});
|
|
@@ -18152,11 +18207,11 @@ expectTypesMatch(true);
|
|
|
18152
18207
|
|
|
18153
18208
|
// lib/components/schematic-text.ts
|
|
18154
18209
|
import { distance as distance35, rotation as rotation9 } from "circuit-json";
|
|
18155
|
-
import { z as
|
|
18210
|
+
import { z as z115 } from "zod";
|
|
18156
18211
|
|
|
18157
18212
|
// lib/common/fivePointAnchor.ts
|
|
18158
|
-
import { z as
|
|
18159
|
-
var fivePointAnchor =
|
|
18213
|
+
import { z as z114 } from "zod";
|
|
18214
|
+
var fivePointAnchor = z114.enum([
|
|
18160
18215
|
"center",
|
|
18161
18216
|
"left",
|
|
18162
18217
|
"right",
|
|
@@ -18165,39 +18220,39 @@ var fivePointAnchor = z111.enum([
|
|
|
18165
18220
|
]);
|
|
18166
18221
|
|
|
18167
18222
|
// lib/components/schematic-text.ts
|
|
18168
|
-
var schematicTextProps =
|
|
18223
|
+
var schematicTextProps = z115.object({
|
|
18169
18224
|
schX: distance35.optional(),
|
|
18170
18225
|
schY: distance35.optional(),
|
|
18171
|
-
text:
|
|
18172
|
-
fontSize:
|
|
18173
|
-
anchor:
|
|
18174
|
-
color:
|
|
18226
|
+
text: z115.string(),
|
|
18227
|
+
fontSize: z115.number().default(1),
|
|
18228
|
+
anchor: z115.union([fivePointAnchor.describe("legacy"), ninePointAnchor]).default("center"),
|
|
18229
|
+
color: z115.string().default("#000000"),
|
|
18175
18230
|
schRotation: rotation9.default(0)
|
|
18176
18231
|
});
|
|
18177
18232
|
expectTypesMatch(true);
|
|
18178
18233
|
|
|
18179
18234
|
// lib/components/schematic-path.ts
|
|
18180
18235
|
import { distance as distance36, point as point7 } from "circuit-json";
|
|
18181
|
-
import { z as
|
|
18182
|
-
var schematicPathProps =
|
|
18183
|
-
points:
|
|
18184
|
-
svgPath:
|
|
18236
|
+
import { z as z116 } from "zod";
|
|
18237
|
+
var schematicPathProps = z116.object({
|
|
18238
|
+
points: z116.array(point7).optional(),
|
|
18239
|
+
svgPath: z116.string().optional(),
|
|
18185
18240
|
strokeWidth: distance36.optional(),
|
|
18186
|
-
strokeColor:
|
|
18241
|
+
strokeColor: z116.string().optional(),
|
|
18187
18242
|
dashLength: distance36.optional(),
|
|
18188
18243
|
dashGap: distance36.optional(),
|
|
18189
|
-
isFilled:
|
|
18190
|
-
fillColor:
|
|
18244
|
+
isFilled: z116.boolean().optional().default(false),
|
|
18245
|
+
fillColor: z116.string().optional()
|
|
18191
18246
|
});
|
|
18192
18247
|
expectTypesMatch(true);
|
|
18193
18248
|
|
|
18194
18249
|
// lib/components/schematic-table.ts
|
|
18195
18250
|
import { distance as distance37 } from "circuit-json";
|
|
18196
|
-
import { z as
|
|
18197
|
-
var schematicTableProps =
|
|
18251
|
+
import { z as z117 } from "zod";
|
|
18252
|
+
var schematicTableProps = z117.object({
|
|
18198
18253
|
schX: distance37.optional(),
|
|
18199
18254
|
schY: distance37.optional(),
|
|
18200
|
-
children:
|
|
18255
|
+
children: z117.any().optional(),
|
|
18201
18256
|
cellPadding: distance37.optional(),
|
|
18202
18257
|
borderWidth: distance37.optional(),
|
|
18203
18258
|
anchor: ninePointAnchor.optional(),
|
|
@@ -18207,34 +18262,34 @@ expectTypesMatch(true);
|
|
|
18207
18262
|
|
|
18208
18263
|
// lib/components/schematic-row.ts
|
|
18209
18264
|
import { distance as distance38 } from "circuit-json";
|
|
18210
|
-
import { z as
|
|
18211
|
-
var schematicRowProps =
|
|
18212
|
-
children:
|
|
18265
|
+
import { z as z118 } from "zod";
|
|
18266
|
+
var schematicRowProps = z118.object({
|
|
18267
|
+
children: z118.any().optional(),
|
|
18213
18268
|
height: distance38.optional()
|
|
18214
18269
|
});
|
|
18215
18270
|
expectTypesMatch(true);
|
|
18216
18271
|
|
|
18217
18272
|
// lib/components/schematic-cell.ts
|
|
18218
18273
|
import { distance as distance39 } from "circuit-json";
|
|
18219
|
-
import { z as
|
|
18220
|
-
var schematicCellProps =
|
|
18221
|
-
children:
|
|
18222
|
-
horizontalAlign:
|
|
18223
|
-
verticalAlign:
|
|
18274
|
+
import { z as z119 } from "zod";
|
|
18275
|
+
var schematicCellProps = z119.object({
|
|
18276
|
+
children: z119.string().optional(),
|
|
18277
|
+
horizontalAlign: z119.enum(["left", "center", "right"]).optional(),
|
|
18278
|
+
verticalAlign: z119.enum(["top", "middle", "bottom"]).optional(),
|
|
18224
18279
|
fontSize: distance39.optional(),
|
|
18225
|
-
rowSpan:
|
|
18226
|
-
colSpan:
|
|
18280
|
+
rowSpan: z119.number().optional(),
|
|
18281
|
+
colSpan: z119.number().optional(),
|
|
18227
18282
|
width: distance39.optional(),
|
|
18228
|
-
text:
|
|
18283
|
+
text: z119.string().optional()
|
|
18229
18284
|
});
|
|
18230
18285
|
expectTypesMatch(true);
|
|
18231
18286
|
|
|
18232
18287
|
// lib/components/schematic-section.ts
|
|
18233
18288
|
import { distance as distance40 } from "circuit-json";
|
|
18234
|
-
import { z as
|
|
18235
|
-
var schematicSectionProps =
|
|
18236
|
-
displayName:
|
|
18237
|
-
name:
|
|
18289
|
+
import { z as z120 } from "zod";
|
|
18290
|
+
var schematicSectionProps = z120.object({
|
|
18291
|
+
displayName: z120.string().optional(),
|
|
18292
|
+
name: z120.string(),
|
|
18238
18293
|
sectionTitleFontSize: distance40.optional()
|
|
18239
18294
|
});
|
|
18240
18295
|
expectTypesMatch(
|
|
@@ -18242,51 +18297,51 @@ expectTypesMatch(
|
|
|
18242
18297
|
);
|
|
18243
18298
|
|
|
18244
18299
|
// lib/components/schematic-sheet.ts
|
|
18245
|
-
import { z as
|
|
18246
|
-
var schematicSheetProps =
|
|
18247
|
-
name:
|
|
18248
|
-
displayName:
|
|
18249
|
-
sheetIndex:
|
|
18250
|
-
children:
|
|
18300
|
+
import { z as z121 } from "zod";
|
|
18301
|
+
var schematicSheetProps = z121.object({
|
|
18302
|
+
name: z121.string(),
|
|
18303
|
+
displayName: z121.string(),
|
|
18304
|
+
sheetIndex: z121.number().optional(),
|
|
18305
|
+
children: z121.any().optional()
|
|
18251
18306
|
});
|
|
18252
18307
|
expectTypesMatch(true);
|
|
18253
18308
|
|
|
18254
18309
|
// lib/components/copper-text.ts
|
|
18255
18310
|
import { layer_ref as layer_ref10, length as length8 } from "circuit-json";
|
|
18256
|
-
import { z as
|
|
18311
|
+
import { z as z122 } from "zod";
|
|
18257
18312
|
var copperTextProps = pcbLayoutProps.extend({
|
|
18258
|
-
text:
|
|
18313
|
+
text: z122.string(),
|
|
18259
18314
|
anchorAlignment: ninePointAnchor.default("center"),
|
|
18260
|
-
font:
|
|
18315
|
+
font: z122.enum(["tscircuit2024"]).optional(),
|
|
18261
18316
|
fontSize: length8.optional(),
|
|
18262
|
-
layers:
|
|
18263
|
-
knockout:
|
|
18264
|
-
mirrored:
|
|
18317
|
+
layers: z122.array(layer_ref10).optional(),
|
|
18318
|
+
knockout: z122.boolean().optional(),
|
|
18319
|
+
mirrored: z122.boolean().optional()
|
|
18265
18320
|
});
|
|
18266
18321
|
|
|
18267
18322
|
// lib/components/silkscreen-text.ts
|
|
18268
18323
|
import { layer_ref as layer_ref11, length as length9 } from "circuit-json";
|
|
18269
|
-
import { z as
|
|
18324
|
+
import { z as z123 } from "zod";
|
|
18270
18325
|
var silkscreenTextProps = pcbLayoutProps.extend({
|
|
18271
|
-
text:
|
|
18326
|
+
text: z123.string(),
|
|
18272
18327
|
anchorAlignment: ninePointAnchor.default("center"),
|
|
18273
|
-
font:
|
|
18328
|
+
font: z123.enum(["tscircuit2024"]).optional(),
|
|
18274
18329
|
fontSize: length9.optional(),
|
|
18275
18330
|
/**
|
|
18276
18331
|
* If true, text will knock out underlying silkscreen
|
|
18277
18332
|
*/
|
|
18278
|
-
isKnockout:
|
|
18333
|
+
isKnockout: z123.boolean().optional(),
|
|
18279
18334
|
knockoutPadding: length9.optional(),
|
|
18280
18335
|
knockoutPaddingLeft: length9.optional(),
|
|
18281
18336
|
knockoutPaddingRight: length9.optional(),
|
|
18282
18337
|
knockoutPaddingTop: length9.optional(),
|
|
18283
18338
|
knockoutPaddingBottom: length9.optional(),
|
|
18284
|
-
layers:
|
|
18339
|
+
layers: z123.array(layer_ref11).optional()
|
|
18285
18340
|
});
|
|
18286
18341
|
|
|
18287
18342
|
// lib/components/silkscreen-path.ts
|
|
18288
18343
|
import { length as length10, route_hint_point as route_hint_point5 } from "circuit-json";
|
|
18289
|
-
import { z as
|
|
18344
|
+
import { z as z124 } from "zod";
|
|
18290
18345
|
var silkscreenPathProps = pcbLayoutProps.omit({
|
|
18291
18346
|
pcbLeftEdgeX: true,
|
|
18292
18347
|
pcbRightEdgeX: true,
|
|
@@ -18298,7 +18353,7 @@ var silkscreenPathProps = pcbLayoutProps.omit({
|
|
|
18298
18353
|
pcbOffsetY: true,
|
|
18299
18354
|
pcbRotation: true
|
|
18300
18355
|
}).extend({
|
|
18301
|
-
route:
|
|
18356
|
+
route: z124.array(route_hint_point5),
|
|
18302
18357
|
strokeWidth: length10.optional()
|
|
18303
18358
|
});
|
|
18304
18359
|
|
|
@@ -18320,10 +18375,10 @@ var silkscreenLineProps = pcbLayoutProps.omit({
|
|
|
18320
18375
|
|
|
18321
18376
|
// lib/components/silkscreen-rect.ts
|
|
18322
18377
|
import { distance as distance42 } from "circuit-json";
|
|
18323
|
-
import { z as
|
|
18378
|
+
import { z as z125 } from "zod";
|
|
18324
18379
|
var silkscreenRectProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
18325
|
-
filled:
|
|
18326
|
-
stroke:
|
|
18380
|
+
filled: z125.boolean().default(true).optional(),
|
|
18381
|
+
stroke: z125.enum(["dashed", "solid", "none"]).optional(),
|
|
18327
18382
|
strokeWidth: distance42.optional(),
|
|
18328
18383
|
width: distance42,
|
|
18329
18384
|
height: distance42,
|
|
@@ -18332,10 +18387,10 @@ var silkscreenRectProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
|
18332
18387
|
|
|
18333
18388
|
// lib/components/silkscreen-circle.ts
|
|
18334
18389
|
import { distance as distance43 } from "circuit-json";
|
|
18335
|
-
import { z as
|
|
18390
|
+
import { z as z126 } from "zod";
|
|
18336
18391
|
var silkscreenCircleProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
18337
|
-
isFilled:
|
|
18338
|
-
isOutline:
|
|
18392
|
+
isFilled: z126.boolean().optional(),
|
|
18393
|
+
isOutline: z126.boolean().optional(),
|
|
18339
18394
|
strokeWidth: distance43.optional(),
|
|
18340
18395
|
radius: distance43
|
|
18341
18396
|
});
|
|
@@ -18353,63 +18408,63 @@ expectTypesMatch(true);
|
|
|
18353
18408
|
|
|
18354
18409
|
// lib/components/trace-hint.ts
|
|
18355
18410
|
import { distance as distance44, layer_ref as layer_ref12, route_hint_point as route_hint_point6 } from "circuit-json";
|
|
18356
|
-
import { z as
|
|
18357
|
-
var routeHintPointProps =
|
|
18411
|
+
import { z as z128 } from "zod";
|
|
18412
|
+
var routeHintPointProps = z128.object({
|
|
18358
18413
|
x: distance44,
|
|
18359
18414
|
y: distance44,
|
|
18360
|
-
via:
|
|
18415
|
+
via: z128.boolean().optional(),
|
|
18361
18416
|
toLayer: layer_ref12.optional()
|
|
18362
18417
|
});
|
|
18363
|
-
var traceHintProps =
|
|
18364
|
-
for:
|
|
18418
|
+
var traceHintProps = z128.object({
|
|
18419
|
+
for: z128.string().optional().describe(
|
|
18365
18420
|
"Selector for the port you're targeting, not required if you're inside a trace"
|
|
18366
18421
|
),
|
|
18367
|
-
order:
|
|
18422
|
+
order: z128.number().optional(),
|
|
18368
18423
|
offset: route_hint_point6.or(routeHintPointProps).optional(),
|
|
18369
|
-
offsets:
|
|
18370
|
-
traceWidth:
|
|
18424
|
+
offsets: z128.array(route_hint_point6).or(z128.array(routeHintPointProps)).optional(),
|
|
18425
|
+
traceWidth: z128.number().optional()
|
|
18371
18426
|
});
|
|
18372
18427
|
|
|
18373
18428
|
// lib/components/port.ts
|
|
18374
|
-
import { z as
|
|
18429
|
+
import { z as z129 } from "zod";
|
|
18375
18430
|
var portProps = commonLayoutProps.extend({
|
|
18376
|
-
name:
|
|
18377
|
-
pinNumber:
|
|
18378
|
-
schStemLength:
|
|
18379
|
-
aliases:
|
|
18380
|
-
layer:
|
|
18381
|
-
layers:
|
|
18382
|
-
schX:
|
|
18383
|
-
schY:
|
|
18431
|
+
name: z129.string().optional(),
|
|
18432
|
+
pinNumber: z129.number().optional(),
|
|
18433
|
+
schStemLength: z129.number().optional(),
|
|
18434
|
+
aliases: z129.array(z129.string()).optional(),
|
|
18435
|
+
layer: z129.string().optional(),
|
|
18436
|
+
layers: z129.array(z129.string()).optional(),
|
|
18437
|
+
schX: z129.number().optional(),
|
|
18438
|
+
schY: z129.number().optional(),
|
|
18384
18439
|
direction: direction.optional(),
|
|
18385
|
-
connectsTo:
|
|
18440
|
+
connectsTo: z129.string().or(z129.array(z129.string())).optional(),
|
|
18386
18441
|
kicadPinMetadata: kicadPinMetadata.optional(),
|
|
18387
|
-
hasInversionCircle:
|
|
18442
|
+
hasInversionCircle: z129.boolean().optional()
|
|
18388
18443
|
});
|
|
18389
18444
|
|
|
18390
18445
|
// lib/components/pcb-note-text.ts
|
|
18391
18446
|
import { length as length11 } from "circuit-json";
|
|
18392
|
-
import { z as
|
|
18447
|
+
import { z as z130 } from "zod";
|
|
18393
18448
|
var pcbNoteTextProps = pcbLayoutProps.extend({
|
|
18394
|
-
text:
|
|
18395
|
-
anchorAlignment:
|
|
18396
|
-
font:
|
|
18449
|
+
text: z130.string(),
|
|
18450
|
+
anchorAlignment: z130.enum(["center", "top_left", "top_right", "bottom_left", "bottom_right"]).default("center"),
|
|
18451
|
+
font: z130.enum(["tscircuit2024"]).optional(),
|
|
18397
18452
|
fontSize: length11.optional(),
|
|
18398
|
-
color:
|
|
18453
|
+
color: z130.string().optional()
|
|
18399
18454
|
});
|
|
18400
18455
|
expectTypesMatch(true);
|
|
18401
18456
|
|
|
18402
18457
|
// lib/components/pcb-note-rect.ts
|
|
18403
18458
|
import { distance as distance45 } from "circuit-json";
|
|
18404
|
-
import { z as
|
|
18459
|
+
import { z as z131 } from "zod";
|
|
18405
18460
|
var pcbNoteRectProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
18406
18461
|
width: distance45,
|
|
18407
18462
|
height: distance45,
|
|
18408
18463
|
strokeWidth: distance45.optional(),
|
|
18409
|
-
isFilled:
|
|
18410
|
-
hasStroke:
|
|
18411
|
-
isStrokeDashed:
|
|
18412
|
-
color:
|
|
18464
|
+
isFilled: z131.boolean().optional(),
|
|
18465
|
+
hasStroke: z131.boolean().optional(),
|
|
18466
|
+
isStrokeDashed: z131.boolean().optional(),
|
|
18467
|
+
color: z131.string().optional(),
|
|
18413
18468
|
cornerRadius: distance45.optional()
|
|
18414
18469
|
});
|
|
18415
18470
|
expectTypesMatch(true);
|
|
@@ -18419,7 +18474,7 @@ import {
|
|
|
18419
18474
|
length as length12,
|
|
18420
18475
|
route_hint_point as route_hint_point7
|
|
18421
18476
|
} from "circuit-json";
|
|
18422
|
-
import { z as
|
|
18477
|
+
import { z as z132 } from "zod";
|
|
18423
18478
|
var pcbNotePathProps = pcbLayoutProps.omit({
|
|
18424
18479
|
pcbLeftEdgeX: true,
|
|
18425
18480
|
pcbRightEdgeX: true,
|
|
@@ -18431,15 +18486,15 @@ var pcbNotePathProps = pcbLayoutProps.omit({
|
|
|
18431
18486
|
pcbOffsetY: true,
|
|
18432
18487
|
pcbRotation: true
|
|
18433
18488
|
}).extend({
|
|
18434
|
-
route:
|
|
18489
|
+
route: z132.array(route_hint_point7),
|
|
18435
18490
|
strokeWidth: length12.optional(),
|
|
18436
|
-
color:
|
|
18491
|
+
color: z132.string().optional()
|
|
18437
18492
|
});
|
|
18438
18493
|
expectTypesMatch(true);
|
|
18439
18494
|
|
|
18440
18495
|
// lib/components/pcb-note-line.ts
|
|
18441
18496
|
import { distance as distance46 } from "circuit-json";
|
|
18442
|
-
import { z as
|
|
18497
|
+
import { z as z133 } from "zod";
|
|
18443
18498
|
var pcbNoteLineProps = pcbLayoutProps.omit({
|
|
18444
18499
|
pcbLeftEdgeX: true,
|
|
18445
18500
|
pcbRightEdgeX: true,
|
|
@@ -18456,15 +18511,15 @@ var pcbNoteLineProps = pcbLayoutProps.omit({
|
|
|
18456
18511
|
x2: distance46,
|
|
18457
18512
|
y2: distance46,
|
|
18458
18513
|
strokeWidth: distance46.optional(),
|
|
18459
|
-
color:
|
|
18460
|
-
isDashed:
|
|
18514
|
+
color: z133.string().optional(),
|
|
18515
|
+
isDashed: z133.boolean().optional()
|
|
18461
18516
|
});
|
|
18462
18517
|
expectTypesMatch(true);
|
|
18463
18518
|
|
|
18464
18519
|
// lib/components/pcb-note-dimension.ts
|
|
18465
18520
|
import { distance as distance47, length as length13 } from "circuit-json";
|
|
18466
|
-
import { z as
|
|
18467
|
-
var dimensionTarget2 =
|
|
18521
|
+
import { z as z134 } from "zod";
|
|
18522
|
+
var dimensionTarget2 = z134.union([z134.string(), point]);
|
|
18468
18523
|
var pcbNoteDimensionProps = pcbLayoutProps.omit({
|
|
18469
18524
|
pcbLeftEdgeX: true,
|
|
18470
18525
|
pcbRightEdgeX: true,
|
|
@@ -18478,101 +18533,101 @@ var pcbNoteDimensionProps = pcbLayoutProps.omit({
|
|
|
18478
18533
|
}).extend({
|
|
18479
18534
|
from: dimensionTarget2,
|
|
18480
18535
|
to: dimensionTarget2,
|
|
18481
|
-
text:
|
|
18536
|
+
text: z134.string().optional(),
|
|
18482
18537
|
offset: distance47.optional(),
|
|
18483
|
-
font:
|
|
18538
|
+
font: z134.enum(["tscircuit2024"]).optional(),
|
|
18484
18539
|
fontSize: length13.optional(),
|
|
18485
|
-
color:
|
|
18540
|
+
color: z134.string().optional(),
|
|
18486
18541
|
arrowSize: distance47.optional(),
|
|
18487
|
-
units:
|
|
18488
|
-
outerEdgeToEdge:
|
|
18489
|
-
centerToCenter:
|
|
18490
|
-
innerEdgeToEdge:
|
|
18542
|
+
units: z134.enum(["in", "mm"]).optional(),
|
|
18543
|
+
outerEdgeToEdge: z134.literal(true).optional(),
|
|
18544
|
+
centerToCenter: z134.literal(true).optional(),
|
|
18545
|
+
innerEdgeToEdge: z134.literal(true).optional()
|
|
18491
18546
|
});
|
|
18492
18547
|
expectTypesMatch(
|
|
18493
18548
|
true
|
|
18494
18549
|
);
|
|
18495
18550
|
|
|
18496
18551
|
// lib/platformConfig.ts
|
|
18497
|
-
import { z as
|
|
18498
|
-
var unvalidatedCircuitJson =
|
|
18499
|
-
var footprintLibraryResult =
|
|
18500
|
-
footprintCircuitJson:
|
|
18552
|
+
import { z as z135 } from "zod";
|
|
18553
|
+
var unvalidatedCircuitJson = z135.array(z135.any()).describe("Circuit JSON");
|
|
18554
|
+
var footprintLibraryResult = z135.object({
|
|
18555
|
+
footprintCircuitJson: z135.array(z135.any()),
|
|
18501
18556
|
cadModel: cadModelProp.optional()
|
|
18502
18557
|
});
|
|
18503
|
-
var pathToCircuitJsonFn =
|
|
18504
|
-
|
|
18505
|
-
|
|
18506
|
-
|
|
18507
|
-
).returns(
|
|
18558
|
+
var pathToCircuitJsonFn = z135.function().args(z135.string()).returns(z135.promise(footprintLibraryResult)).or(
|
|
18559
|
+
z135.function().args(
|
|
18560
|
+
z135.string(),
|
|
18561
|
+
z135.object({ resolvedPcbStyle: pcbStyle.optional() }).optional()
|
|
18562
|
+
).returns(z135.promise(footprintLibraryResult))
|
|
18508
18563
|
).describe("A function that takes a path and returns Circuit JSON");
|
|
18509
|
-
var footprintFileParserEntry =
|
|
18510
|
-
loadFromUrl:
|
|
18564
|
+
var footprintFileParserEntry = z135.object({
|
|
18565
|
+
loadFromUrl: z135.function().args(z135.string()).returns(z135.promise(footprintLibraryResult)).describe(
|
|
18511
18566
|
"A function that takes a footprint file URL and returns Circuit JSON"
|
|
18512
18567
|
)
|
|
18513
18568
|
});
|
|
18514
|
-
var spiceEngineSimulationResult =
|
|
18515
|
-
engineVersionString:
|
|
18569
|
+
var spiceEngineSimulationResult = z135.object({
|
|
18570
|
+
engineVersionString: z135.string().optional(),
|
|
18516
18571
|
simulationResultCircuitJson: unvalidatedCircuitJson
|
|
18517
18572
|
});
|
|
18518
|
-
var spiceEngineZod =
|
|
18519
|
-
simulate:
|
|
18573
|
+
var spiceEngineZod = z135.object({
|
|
18574
|
+
simulate: z135.function().args(z135.string()).returns(z135.promise(spiceEngineSimulationResult)).describe(
|
|
18520
18575
|
"A function that takes a SPICE string and returns a simulation result"
|
|
18521
18576
|
)
|
|
18522
18577
|
});
|
|
18523
|
-
var defaultSpiceEngine =
|
|
18578
|
+
var defaultSpiceEngine = z135.custom(
|
|
18524
18579
|
(value) => typeof value === "string"
|
|
18525
18580
|
);
|
|
18526
|
-
var autorouterInstance =
|
|
18527
|
-
run:
|
|
18528
|
-
getOutputSimpleRouteJson:
|
|
18581
|
+
var autorouterInstance = z135.object({
|
|
18582
|
+
run: z135.function().args().returns(z135.promise(z135.unknown())).describe("Run the autorouter"),
|
|
18583
|
+
getOutputSimpleRouteJson: z135.function().args().returns(z135.promise(z135.any())).describe("Get the resulting SimpleRouteJson")
|
|
18529
18584
|
});
|
|
18530
|
-
var autorouterDefinition =
|
|
18531
|
-
createAutorouter:
|
|
18585
|
+
var autorouterDefinition = z135.object({
|
|
18586
|
+
createAutorouter: z135.function().args(z135.any(), z135.any().optional()).returns(z135.union([autorouterInstance, z135.promise(autorouterInstance)])).describe("Create an autorouter instance")
|
|
18532
18587
|
});
|
|
18533
|
-
var platformFetch =
|
|
18534
|
-
var platformConfig =
|
|
18588
|
+
var platformFetch = z135.custom((value) => typeof value === "function").describe("A fetch-like function to use for platform requests");
|
|
18589
|
+
var platformConfig = z135.object({
|
|
18535
18590
|
partsEngine: partsEngine.optional(),
|
|
18536
18591
|
autorouter: autorouterProp.optional(),
|
|
18537
|
-
autorouterMap:
|
|
18592
|
+
autorouterMap: z135.record(z135.string(), autorouterDefinition).optional(),
|
|
18538
18593
|
registryApiUrl: url.optional(),
|
|
18539
18594
|
cloudAutorouterUrl: url.optional(),
|
|
18540
|
-
projectName:
|
|
18595
|
+
projectName: z135.string().optional(),
|
|
18541
18596
|
projectBaseUrl: url.optional(),
|
|
18542
|
-
version:
|
|
18597
|
+
version: z135.string().optional(),
|
|
18543
18598
|
url: url.optional(),
|
|
18544
|
-
printBoardInformationToSilkscreen:
|
|
18545
|
-
includeBoardFiles:
|
|
18599
|
+
printBoardInformationToSilkscreen: z135.boolean().optional(),
|
|
18600
|
+
includeBoardFiles: z135.array(z135.string()).describe(
|
|
18546
18601
|
'The board files to automatically build with "tsci build", defaults to ["**/*.circuit.tsx"]. Can be an array of files or globs'
|
|
18547
18602
|
).optional(),
|
|
18548
|
-
snapshotsDir:
|
|
18603
|
+
snapshotsDir: z135.string().describe(
|
|
18549
18604
|
'The directory where snapshots are stored for "tsci snapshot", defaults to "tests/__snapshots__"'
|
|
18550
18605
|
).optional(),
|
|
18551
18606
|
defaultSpiceEngine: defaultSpiceEngine.optional(),
|
|
18552
|
-
unitPreference:
|
|
18553
|
-
localCacheEngine:
|
|
18554
|
-
pcbDisabled:
|
|
18555
|
-
routingDisabled:
|
|
18556
|
-
schematicDisabled:
|
|
18557
|
-
partsEngineDisabled:
|
|
18558
|
-
drcChecksDisabled:
|
|
18559
|
-
netlistDrcChecksDisabled:
|
|
18560
|
-
routingDrcChecksDisabled:
|
|
18561
|
-
placementDrcChecksDisabled:
|
|
18562
|
-
pinSpecificationDrcChecksDisabled:
|
|
18563
|
-
spiceEngineMap:
|
|
18564
|
-
footprintLibraryMap:
|
|
18565
|
-
|
|
18566
|
-
|
|
18607
|
+
unitPreference: z135.enum(["mm", "in", "mil"]).optional(),
|
|
18608
|
+
localCacheEngine: z135.any().optional(),
|
|
18609
|
+
pcbDisabled: z135.boolean().optional(),
|
|
18610
|
+
routingDisabled: z135.boolean().optional(),
|
|
18611
|
+
schematicDisabled: z135.boolean().optional(),
|
|
18612
|
+
partsEngineDisabled: z135.boolean().optional(),
|
|
18613
|
+
drcChecksDisabled: z135.boolean().optional(),
|
|
18614
|
+
netlistDrcChecksDisabled: z135.boolean().optional(),
|
|
18615
|
+
routingDrcChecksDisabled: z135.boolean().optional(),
|
|
18616
|
+
placementDrcChecksDisabled: z135.boolean().optional(),
|
|
18617
|
+
pinSpecificationDrcChecksDisabled: z135.boolean().optional(),
|
|
18618
|
+
spiceEngineMap: z135.record(z135.string(), spiceEngineZod).optional(),
|
|
18619
|
+
footprintLibraryMap: z135.record(
|
|
18620
|
+
z135.string(),
|
|
18621
|
+
z135.union([
|
|
18567
18622
|
pathToCircuitJsonFn,
|
|
18568
|
-
|
|
18569
|
-
|
|
18570
|
-
|
|
18623
|
+
z135.record(
|
|
18624
|
+
z135.string(),
|
|
18625
|
+
z135.union([unvalidatedCircuitJson, pathToCircuitJsonFn])
|
|
18571
18626
|
)
|
|
18572
18627
|
])
|
|
18573
18628
|
).optional(),
|
|
18574
|
-
footprintFileParserMap:
|
|
18575
|
-
resolveProjectStaticFileImportUrl:
|
|
18629
|
+
footprintFileParserMap: z135.record(z135.string(), footprintFileParserEntry).optional(),
|
|
18630
|
+
resolveProjectStaticFileImportUrl: z135.function().args(z135.string()).returns(z135.promise(z135.string())).describe(
|
|
18576
18631
|
"A function that returns a string URL for static files for the project"
|
|
18577
18632
|
).optional(),
|
|
18578
18633
|
platformFetch: platformFetch.optional()
|
|
@@ -18630,10 +18685,12 @@ export {
|
|
|
18630
18685
|
capacitorProps,
|
|
18631
18686
|
chipProps,
|
|
18632
18687
|
circleCutoutProps,
|
|
18688
|
+
circleShapeProps,
|
|
18633
18689
|
circleSmtPadProps,
|
|
18634
18690
|
circleSolderPasteProps,
|
|
18635
18691
|
commonComponentProps,
|
|
18636
18692
|
commonLayoutProps,
|
|
18693
|
+
commonShapeProps,
|
|
18637
18694
|
componentProps,
|
|
18638
18695
|
connectorProps,
|
|
18639
18696
|
constrainedLayoutProps,
|
|
@@ -18664,6 +18721,10 @@ export {
|
|
|
18664
18721
|
edit_schematic_component_location_event,
|
|
18665
18722
|
edit_schematic_group_location_event,
|
|
18666
18723
|
edit_trace_hint_event,
|
|
18724
|
+
enclosureCutoutApertureProps,
|
|
18725
|
+
enclosureCutoutApertureShapes,
|
|
18726
|
+
enclosureFdmBoxProps,
|
|
18727
|
+
enclosureProps,
|
|
18667
18728
|
explicitPinSideDefinition,
|
|
18668
18729
|
fabricationNoteDimensionProps,
|
|
18669
18730
|
fabricationNotePathProps,
|
|
@@ -18739,6 +18800,7 @@ export {
|
|
|
18739
18800
|
pcbTraceProps,
|
|
18740
18801
|
pcbXDistConstraintProps,
|
|
18741
18802
|
pcbYDistConstraintProps,
|
|
18803
|
+
pillShapeProps,
|
|
18742
18804
|
pillSmtPadProps,
|
|
18743
18805
|
pinAttributeMap,
|
|
18744
18806
|
pinCapability,
|
|
@@ -18760,6 +18822,7 @@ export {
|
|
|
18760
18822
|
projectConfig,
|
|
18761
18823
|
pushButtonProps,
|
|
18762
18824
|
rectCutoutProps,
|
|
18825
|
+
rectShapeProps,
|
|
18763
18826
|
rectSmtPadProps,
|
|
18764
18827
|
rectSolderPasteProps,
|
|
18765
18828
|
resistorPinLabels,
|