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