@tscircuit/props 0.0.685 → 0.0.687
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +136 -9
- package/dist/index.js +1347 -1306
- package/dist/index.js.map +1 -1
- package/lib/assembly/cable.ts +26 -0
- package/lib/assembly/index.ts +3 -0
- package/lib/assembly/motor.ts +53 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -167,11 +167,21 @@ expectTypesMatch(true);
|
|
|
167
167
|
// lib/assembly/cadassembly.ts
|
|
168
168
|
var assemblyCadAssemblyProps = assemblySubassemblyProps;
|
|
169
169
|
|
|
170
|
-
// lib/assembly/
|
|
170
|
+
// lib/assembly/cable.ts
|
|
171
171
|
import { z as z8 } from "zod";
|
|
172
|
-
var
|
|
173
|
-
name: z8.string().
|
|
174
|
-
|
|
172
|
+
var assemblyCableProps = z8.object({
|
|
173
|
+
name: z8.string().trim().min(1),
|
|
174
|
+
from: z8.string().trim().min(1),
|
|
175
|
+
to: z8.string().trim().min(1),
|
|
176
|
+
standard: z8.literal("usb_c").optional()
|
|
177
|
+
});
|
|
178
|
+
expectTypesMatch(true);
|
|
179
|
+
|
|
180
|
+
// lib/assembly/device.ts
|
|
181
|
+
import { z as z9 } from "zod";
|
|
182
|
+
var assemblyDeviceProps = z9.object({
|
|
183
|
+
name: z9.string().optional(),
|
|
184
|
+
model: z9.string().trim().min(1).optional(),
|
|
175
185
|
modelUrl: url.refine((value) => value.trim().length > 0, {
|
|
176
186
|
message: "modelUrl cannot be empty"
|
|
177
187
|
}).optional()
|
|
@@ -186,37 +196,37 @@ expectTypesMatch(true);
|
|
|
186
196
|
|
|
187
197
|
// lib/assembly/printedpart.ts
|
|
188
198
|
import { isValidElement } from "react";
|
|
189
|
-
import { z as
|
|
190
|
-
var assemblyPrintedPartProps =
|
|
191
|
-
name:
|
|
192
|
-
displayName:
|
|
193
|
-
jscad:
|
|
194
|
-
model:
|
|
199
|
+
import { z as z10 } from "zod";
|
|
200
|
+
var assemblyPrintedPartProps = z10.object({
|
|
201
|
+
name: z10.string().trim().min(1),
|
|
202
|
+
displayName: z10.string().optional(),
|
|
203
|
+
jscad: z10.custom(isValidElement, "Expected jscad-fiber JSX").optional(),
|
|
204
|
+
model: z10.string().trim().min(1).optional(),
|
|
195
205
|
modelUrl: url.refine((value) => value.trim().length > 0, "modelUrl cannot be empty").optional(),
|
|
196
206
|
cadModel: cadModelProp.optional(),
|
|
197
|
-
mountedTo:
|
|
198
|
-
mountFace:
|
|
199
|
-
mountGap: distance.pipe(
|
|
207
|
+
mountedTo: z10.string().trim().regex(/^.+\.[^.]+$/, "Expected part.face").optional(),
|
|
208
|
+
mountFace: z10.string().trim().min(1).optional(),
|
|
209
|
+
mountGap: distance.pipe(z10.number().nonnegative().finite()).optional()
|
|
200
210
|
}).superRefine((part, ctx) => {
|
|
201
211
|
if ([part.jscad, part.model, part.modelUrl, part.cadModel].filter(
|
|
202
212
|
(value) => value !== void 0
|
|
203
213
|
).length !== 1) {
|
|
204
214
|
ctx.addIssue({
|
|
205
|
-
code:
|
|
215
|
+
code: z10.ZodIssueCode.custom,
|
|
206
216
|
path: ["jscad"],
|
|
207
217
|
message: "Provide exactly one of jscad, model, modelUrl, or cadModel"
|
|
208
218
|
});
|
|
209
219
|
}
|
|
210
220
|
if (part.mountedTo === void 0 !== (part.mountFace === void 0)) {
|
|
211
221
|
ctx.addIssue({
|
|
212
|
-
code:
|
|
222
|
+
code: z10.ZodIssueCode.custom,
|
|
213
223
|
path: ["mountFace"],
|
|
214
224
|
message: "Provide mountedTo and mountFace together"
|
|
215
225
|
});
|
|
216
226
|
}
|
|
217
227
|
if (part.mountGap !== void 0 && part.mountedTo === void 0) {
|
|
218
228
|
ctx.addIssue({
|
|
219
|
-
code:
|
|
229
|
+
code: z10.ZodIssueCode.custom,
|
|
220
230
|
path: ["mountGap"],
|
|
221
231
|
message: "mountGap requires mountedTo"
|
|
222
232
|
});
|
|
@@ -225,52 +235,81 @@ var assemblyPrintedPartProps = z9.object({
|
|
|
225
235
|
expectTypesMatch(true);
|
|
226
236
|
|
|
227
237
|
// lib/assembly/motor.ts
|
|
228
|
-
import { z as
|
|
229
|
-
var assemblyMotorProps =
|
|
230
|
-
name:
|
|
238
|
+
import { z as z11 } from "zod";
|
|
239
|
+
var assemblyMotorProps = z11.object({
|
|
240
|
+
name: z11.string().refine((value) => value.trim().length > 0, {
|
|
231
241
|
message: "name cannot be empty"
|
|
232
242
|
}),
|
|
233
|
-
displayName:
|
|
234
|
-
standard:
|
|
235
|
-
model:
|
|
236
|
-
shaftFacingDirection: cadModelAxisDirection.
|
|
237
|
-
wireConnection:
|
|
243
|
+
displayName: z11.string().optional(),
|
|
244
|
+
standard: z11.enum(["nema8", "nema17", "nema23"]).optional(),
|
|
245
|
+
model: z11.string().trim().min(1).optional(),
|
|
246
|
+
shaftFacingDirection: cadModelAxisDirection.optional(),
|
|
247
|
+
wireConnection: z11.enum(["none", "stubs", "jst-ph-6"]).optional(),
|
|
248
|
+
mountedTo: z11.string().trim().regex(/^.+\.[^.]+$/, "Expected part.face").optional(),
|
|
249
|
+
mountFace: z11.string().trim().min(1).optional(),
|
|
250
|
+
mountGap: distance.pipe(z11.number().nonnegative().finite()).optional()
|
|
238
251
|
}).superRefine((motor, context) => {
|
|
252
|
+
if (motor.mountedTo === void 0 !== (motor.mountFace === void 0)) {
|
|
253
|
+
context.addIssue({
|
|
254
|
+
code: z11.ZodIssueCode.custom,
|
|
255
|
+
message: "Provide mountedTo and mountFace together",
|
|
256
|
+
path: ["mountFace"]
|
|
257
|
+
});
|
|
258
|
+
}
|
|
259
|
+
if (motor.mountGap !== void 0 && motor.mountedTo === void 0) {
|
|
260
|
+
context.addIssue({
|
|
261
|
+
code: z11.ZodIssueCode.custom,
|
|
262
|
+
message: "mountGap requires mountedTo",
|
|
263
|
+
path: ["mountGap"]
|
|
264
|
+
});
|
|
265
|
+
}
|
|
266
|
+
if (motor.mountedTo !== void 0 && motor.shaftFacingDirection !== void 0) {
|
|
267
|
+
context.addIssue({
|
|
268
|
+
code: z11.ZodIssueCode.custom,
|
|
269
|
+
message: "Mounted motors derive shaft direction from the mating faces",
|
|
270
|
+
path: ["shaftFacingDirection"]
|
|
271
|
+
});
|
|
272
|
+
}
|
|
239
273
|
if (motor.model !== void 0 && motor.wireConnection !== void 0) {
|
|
240
274
|
context.addIssue({
|
|
241
|
-
code:
|
|
275
|
+
code: z11.ZodIssueCode.custom,
|
|
242
276
|
message: "Set wireConnection in the custom model string, or use standard",
|
|
243
277
|
path: ["wireConnection"]
|
|
244
278
|
});
|
|
245
279
|
}
|
|
246
280
|
if (motor.standard === void 0 && motor.model === void 0) {
|
|
247
281
|
context.addIssue({
|
|
248
|
-
code:
|
|
282
|
+
code: z11.ZodIssueCode.custom,
|
|
249
283
|
message: "Provide standard or model",
|
|
250
284
|
path: ["standard"]
|
|
251
285
|
});
|
|
252
286
|
}
|
|
253
287
|
if (motor.standard !== void 0 && motor.model !== void 0) {
|
|
254
288
|
context.addIssue({
|
|
255
|
-
code:
|
|
289
|
+
code: z11.ZodIssueCode.custom,
|
|
256
290
|
message: "Provide either standard or model, not both",
|
|
257
291
|
path: ["model"]
|
|
258
292
|
});
|
|
259
293
|
}
|
|
260
|
-
})
|
|
294
|
+
}).transform(
|
|
295
|
+
(motor) => motor.mountedTo === void 0 ? {
|
|
296
|
+
...motor,
|
|
297
|
+
shaftFacingDirection: motor.shaftFacingDirection ?? "z+"
|
|
298
|
+
} : motor
|
|
299
|
+
);
|
|
261
300
|
expectTypesMatch(true);
|
|
262
301
|
|
|
263
302
|
// lib/assembly/screen.ts
|
|
264
|
-
import { z as
|
|
265
|
-
var nonemptyString = (fieldName) =>
|
|
303
|
+
import { z as z12 } from "zod";
|
|
304
|
+
var nonemptyString = (fieldName) => z12.string().refine((value) => value.trim().length > 0, {
|
|
266
305
|
message: `${fieldName} cannot be empty`
|
|
267
306
|
});
|
|
268
307
|
var positiveDistance = (fieldName) => distance.refine((value) => Number.isFinite(value) && value > 0, {
|
|
269
308
|
message: `${fieldName} must be a positive finite distance`
|
|
270
309
|
});
|
|
271
|
-
var assemblyScreenProps =
|
|
310
|
+
var assemblyScreenProps = z12.object({
|
|
272
311
|
name: nonemptyString("name"),
|
|
273
|
-
model:
|
|
312
|
+
model: z12.string().trim().min(1).optional(),
|
|
274
313
|
modelUrl: url.refine((value) => value.trim().length > 0, {
|
|
275
314
|
message: "modelUrl cannot be empty"
|
|
276
315
|
}).optional(),
|
|
@@ -281,14 +320,14 @@ var assemblyScreenProps = z11.object({
|
|
|
281
320
|
}).superRefine((screen, context) => {
|
|
282
321
|
if (screen.model !== void 0 && (screen.modelUrl !== void 0 || screen.cadModel !== void 0)) {
|
|
283
322
|
context.addIssue({
|
|
284
|
-
code:
|
|
323
|
+
code: z12.ZodIssueCode.custom,
|
|
285
324
|
message: "Provide only one of model, modelUrl, or cadModel",
|
|
286
325
|
path: ["model"]
|
|
287
326
|
});
|
|
288
327
|
}
|
|
289
328
|
if (screen.modelUrl !== void 0 && screen.cadModel !== void 0) {
|
|
290
329
|
context.addIssue({
|
|
291
|
-
code:
|
|
330
|
+
code: z12.ZodIssueCode.custom,
|
|
292
331
|
message: "Provide either modelUrl or cadModel, not both",
|
|
293
332
|
path: ["modelUrl"]
|
|
294
333
|
});
|
|
@@ -297,7 +336,7 @@ var assemblyScreenProps = z11.object({
|
|
|
297
336
|
const hasHeight = screen.height !== void 0;
|
|
298
337
|
if (hasWidth !== hasHeight) {
|
|
299
338
|
context.addIssue({
|
|
300
|
-
code:
|
|
339
|
+
code: z12.ZodIssueCode.custom,
|
|
301
340
|
message: "width and height must be provided together",
|
|
302
341
|
path: hasWidth ? ["height"] : ["width"]
|
|
303
342
|
});
|
|
@@ -305,7 +344,7 @@ var assemblyScreenProps = z11.object({
|
|
|
305
344
|
}
|
|
306
345
|
if (!hasWidth && screen.cadModel === void 0 && screen.modelUrl === void 0 && screen.model === void 0) {
|
|
307
346
|
context.addIssue({
|
|
308
|
-
code:
|
|
347
|
+
code: z12.ZodIssueCode.custom,
|
|
309
348
|
message: "provide width and height, model, cadModel, or modelUrl",
|
|
310
349
|
path: []
|
|
311
350
|
});
|
|
@@ -314,7 +353,7 @@ var assemblyScreenProps = z11.object({
|
|
|
314
353
|
expectTypesMatch(true);
|
|
315
354
|
|
|
316
355
|
// lib/assembly/board-mounting.ts
|
|
317
|
-
import { z as
|
|
356
|
+
import { z as z13 } from "zod";
|
|
318
357
|
var identityPathPattern = "[A-Za-z_][A-Za-z0-9_-]*(?:\\.[A-Za-z_][A-Za-z0-9_-]*)*";
|
|
319
358
|
var referencePattern = "[A-Za-z_][A-Za-z0-9_-]*(?:\\.[A-Za-z_][A-Za-z0-9_-]*)+";
|
|
320
359
|
var reference = new RegExp(`^${referencePattern}$`);
|
|
@@ -322,35 +361,36 @@ var anchor = new RegExp(`^${identityPathPattern}$`);
|
|
|
322
361
|
var expression = new RegExp(
|
|
323
362
|
`^calc\\(\\s*(${referencePattern})\\s*(?:([+-])\\s*((?:\\d+(?:\\.\\d*)?|\\.\\d+))\\s*(degcw|degccw))?\\s*\\)$`
|
|
324
363
|
);
|
|
325
|
-
var boardMountRotation =
|
|
364
|
+
var boardMountRotation = z13.string().trim().superRefine((value, ctx) => {
|
|
326
365
|
if (reference.test(value)) return;
|
|
327
366
|
const match = expression.exec(value);
|
|
328
367
|
if (!match) {
|
|
329
368
|
ctx.addIssue({
|
|
330
|
-
code:
|
|
369
|
+
code: z13.ZodIssueCode.custom,
|
|
331
370
|
message: "Expected a qualified mounting reference or calc(reference +/- Ndegcw|Ndegccw)"
|
|
332
371
|
});
|
|
333
372
|
return;
|
|
334
373
|
}
|
|
335
374
|
if (match[3] !== void 0 && !Number.isFinite(Number(match[3]))) {
|
|
336
375
|
ctx.addIssue({
|
|
337
|
-
code:
|
|
376
|
+
code: z13.ZodIssueCode.custom,
|
|
338
377
|
message: "Mount rotation angle must be finite"
|
|
339
378
|
});
|
|
340
379
|
}
|
|
341
380
|
});
|
|
342
|
-
var boardMountRotationAnchor =
|
|
381
|
+
var boardMountRotationAnchor = z13.custom((value) => typeof value === "string", {
|
|
343
382
|
message: "Expected a board edge or component identity path"
|
|
344
383
|
}).transform((value) => value.trim()).refine((value) => anchor.test(value), {
|
|
345
384
|
message: "Expected a board edge or component identity path"
|
|
346
385
|
});
|
|
347
|
-
var boardMountOrientation =
|
|
386
|
+
var boardMountOrientation = z13.enum([
|
|
348
387
|
"top_layer_toward_mount_face",
|
|
349
388
|
"bottom_layer_toward_mount_face"
|
|
350
389
|
]);
|
|
351
390
|
|
|
352
391
|
// lib/assembly/index.ts
|
|
353
392
|
var assemblyProps = {
|
|
393
|
+
cable: assemblyCableProps,
|
|
354
394
|
device: assemblyDeviceProps,
|
|
355
395
|
motor: assemblyMotorProps,
|
|
356
396
|
printedpart: assemblyPrintedPartProps,
|
|
@@ -360,16 +400,16 @@ var assemblyProps = {
|
|
|
360
400
|
};
|
|
361
401
|
|
|
362
402
|
// lib/enclosure/cutout-aperture.ts
|
|
363
|
-
import { z as
|
|
403
|
+
import { z as z14 } from "zod";
|
|
364
404
|
var enclosureCutoutApertureShapes = ["pill", "rect", "circle"];
|
|
365
|
-
var cutoutApertureBaseProps =
|
|
405
|
+
var cutoutApertureBaseProps = z14.object({
|
|
366
406
|
margin: distance.optional(),
|
|
367
407
|
widthDimensionOffset: distance.optional(),
|
|
368
408
|
heightDimensionOffset: distance.optional(),
|
|
369
409
|
depth: distance.optional()
|
|
370
410
|
});
|
|
371
411
|
var apertureOnlyProps = cutoutApertureBaseProps.shape;
|
|
372
|
-
var enclosureCutoutApertureProps =
|
|
412
|
+
var enclosureCutoutApertureProps = z14.discriminatedUnion("shape", [
|
|
373
413
|
pillShapeProps.extend(apertureOnlyProps),
|
|
374
414
|
rectShapeProps.extend(apertureOnlyProps),
|
|
375
415
|
circleShapeProps.extend(apertureOnlyProps)
|
|
@@ -377,10 +417,10 @@ var enclosureCutoutApertureProps = z13.discriminatedUnion("shape", [
|
|
|
377
417
|
expectTypesMatch(true);
|
|
378
418
|
|
|
379
419
|
// lib/enclosure/fdm/box.ts
|
|
380
|
-
import { z as
|
|
381
|
-
var enclosureFdmBoxProps =
|
|
382
|
-
name:
|
|
383
|
-
boardRef:
|
|
420
|
+
import { z as z15 } from "zod";
|
|
421
|
+
var enclosureFdmBoxProps = z15.object({
|
|
422
|
+
name: z15.string().optional(),
|
|
423
|
+
boardRef: z15.string().min(1),
|
|
384
424
|
width: distance.optional(),
|
|
385
425
|
height: distance.optional(),
|
|
386
426
|
depth: distance.optional(),
|
|
@@ -391,8 +431,8 @@ var enclosureFdmBoxProps = z14.object({
|
|
|
391
431
|
standoffHeight: distance.optional(),
|
|
392
432
|
topHeadroom: distance.optional(),
|
|
393
433
|
lidLipDepth: distance.optional(),
|
|
394
|
-
disableCutouts:
|
|
395
|
-
showHiddenEdges:
|
|
434
|
+
disableCutouts: z15.boolean().optional(),
|
|
435
|
+
showHiddenEdges: z15.boolean().optional()
|
|
396
436
|
});
|
|
397
437
|
expectTypesMatch(true);
|
|
398
438
|
|
|
@@ -405,8 +445,8 @@ var enclosureProps = {
|
|
|
405
445
|
};
|
|
406
446
|
|
|
407
447
|
// lib/common/portHints.ts
|
|
408
|
-
import { z as
|
|
409
|
-
var portHints =
|
|
448
|
+
import { z as z16 } from "zod";
|
|
449
|
+
var portHints = z16.array(z16.string().or(z16.number()));
|
|
410
450
|
expectTypesMatch(true);
|
|
411
451
|
|
|
412
452
|
// lib/common/layout.ts
|
|
@@ -416,20 +456,20 @@ import {
|
|
|
416
456
|
rotation as rotation2,
|
|
417
457
|
supplier_name
|
|
418
458
|
} from "circuit-json";
|
|
419
|
-
import { z as
|
|
459
|
+
import { z as z26 } from "zod";
|
|
420
460
|
|
|
421
461
|
// lib/common/footprintProp.ts
|
|
422
|
-
import { z as
|
|
423
|
-
var footprintProp =
|
|
462
|
+
import { z as z17 } from "zod";
|
|
463
|
+
var footprintProp = z17.custom((v) => true);
|
|
424
464
|
|
|
425
465
|
// lib/common/kicadFootprintMetadata.ts
|
|
426
466
|
import { distance as distance4, rotation } from "circuit-json";
|
|
427
|
-
import { z as
|
|
467
|
+
import { z as z19 } from "zod";
|
|
428
468
|
|
|
429
469
|
// lib/common/point.ts
|
|
430
470
|
import { distance as distance3 } from "circuit-json";
|
|
431
|
-
import { z as
|
|
432
|
-
var point =
|
|
471
|
+
import { z as z18 } from "zod";
|
|
472
|
+
var point = z18.object({
|
|
433
473
|
x: distance3,
|
|
434
474
|
y: distance3
|
|
435
475
|
});
|
|
@@ -439,25 +479,25 @@ var kicadAt = point.extend({
|
|
|
439
479
|
rotation: rotation.optional()
|
|
440
480
|
});
|
|
441
481
|
expectTypesMatch(true);
|
|
442
|
-
var kicadFont =
|
|
482
|
+
var kicadFont = z19.object({
|
|
443
483
|
size: point.optional(),
|
|
444
484
|
thickness: distance4.optional()
|
|
445
485
|
});
|
|
446
486
|
expectTypesMatch(true);
|
|
447
|
-
var kicadEffects =
|
|
487
|
+
var kicadEffects = z19.object({
|
|
448
488
|
font: kicadFont.optional()
|
|
449
489
|
});
|
|
450
490
|
expectTypesMatch(true);
|
|
451
|
-
var kicadProperty =
|
|
452
|
-
value:
|
|
491
|
+
var kicadProperty = z19.object({
|
|
492
|
+
value: z19.string(),
|
|
453
493
|
at: kicadAt.optional(),
|
|
454
|
-
layer:
|
|
455
|
-
uuid:
|
|
456
|
-
hide:
|
|
494
|
+
layer: z19.string().optional(),
|
|
495
|
+
uuid: z19.string().optional(),
|
|
496
|
+
hide: z19.boolean().optional(),
|
|
457
497
|
effects: kicadEffects.optional()
|
|
458
498
|
});
|
|
459
499
|
expectTypesMatch(true);
|
|
460
|
-
var kicadFootprintProperties =
|
|
500
|
+
var kicadFootprintProperties = z19.object({
|
|
461
501
|
Reference: kicadProperty.optional(),
|
|
462
502
|
Value: kicadProperty.optional(),
|
|
463
503
|
Datasheet: kicadProperty.optional(),
|
|
@@ -466,74 +506,74 @@ var kicadFootprintProperties = z18.object({
|
|
|
466
506
|
expectTypesMatch(
|
|
467
507
|
true
|
|
468
508
|
);
|
|
469
|
-
var kicadFootprintAttributes =
|
|
470
|
-
through_hole:
|
|
471
|
-
smd:
|
|
472
|
-
exclude_from_pos_files:
|
|
473
|
-
exclude_from_bom:
|
|
509
|
+
var kicadFootprintAttributes = z19.object({
|
|
510
|
+
through_hole: z19.boolean().optional(),
|
|
511
|
+
smd: z19.boolean().optional(),
|
|
512
|
+
exclude_from_pos_files: z19.boolean().optional(),
|
|
513
|
+
exclude_from_bom: z19.boolean().optional()
|
|
474
514
|
});
|
|
475
515
|
expectTypesMatch(
|
|
476
516
|
true
|
|
477
517
|
);
|
|
478
|
-
var kicadFootprintPad =
|
|
479
|
-
name:
|
|
480
|
-
type:
|
|
481
|
-
shape:
|
|
518
|
+
var kicadFootprintPad = z19.object({
|
|
519
|
+
name: z19.string(),
|
|
520
|
+
type: z19.string(),
|
|
521
|
+
shape: z19.string().optional(),
|
|
482
522
|
at: kicadAt.optional(),
|
|
483
523
|
size: point.optional(),
|
|
484
524
|
drill: distance4.optional(),
|
|
485
|
-
layers:
|
|
486
|
-
removeUnusedLayers:
|
|
487
|
-
uuid:
|
|
525
|
+
layers: z19.array(z19.string()).optional(),
|
|
526
|
+
removeUnusedLayers: z19.boolean().optional(),
|
|
527
|
+
uuid: z19.string().optional()
|
|
488
528
|
});
|
|
489
529
|
expectTypesMatch(true);
|
|
490
|
-
var kicadFootprintModel =
|
|
491
|
-
path:
|
|
530
|
+
var kicadFootprintModel = z19.object({
|
|
531
|
+
path: z19.string(),
|
|
492
532
|
offset: point3.optional(),
|
|
493
533
|
scale: point3.optional(),
|
|
494
534
|
rotate: point3.optional()
|
|
495
535
|
});
|
|
496
536
|
expectTypesMatch(true);
|
|
497
|
-
var kicadFootprintMetadata =
|
|
498
|
-
footprintName:
|
|
499
|
-
version:
|
|
500
|
-
generator:
|
|
501
|
-
generatorVersion:
|
|
502
|
-
layer:
|
|
537
|
+
var kicadFootprintMetadata = z19.object({
|
|
538
|
+
footprintName: z19.string().optional(),
|
|
539
|
+
version: z19.union([z19.number(), z19.string()]).optional(),
|
|
540
|
+
generator: z19.string().optional(),
|
|
541
|
+
generatorVersion: z19.union([z19.number(), z19.string()]).optional(),
|
|
542
|
+
layer: z19.string().optional(),
|
|
503
543
|
properties: kicadFootprintProperties.optional(),
|
|
504
544
|
attributes: kicadFootprintAttributes.optional(),
|
|
505
|
-
pads:
|
|
506
|
-
embeddedFonts:
|
|
545
|
+
pads: z19.array(kicadFootprintPad).optional(),
|
|
546
|
+
embeddedFonts: z19.boolean().optional(),
|
|
507
547
|
model: kicadFootprintModel.optional()
|
|
508
548
|
});
|
|
509
549
|
expectTypesMatch(true);
|
|
510
550
|
|
|
511
551
|
// lib/common/kicadSymbolMetadata.ts
|
|
512
552
|
import { distance as distance5 } from "circuit-json";
|
|
513
|
-
import { z as
|
|
514
|
-
var kicadSymbolPinNumbers =
|
|
515
|
-
hide:
|
|
553
|
+
import { z as z20 } from "zod";
|
|
554
|
+
var kicadSymbolPinNumbers = z20.object({
|
|
555
|
+
hide: z20.boolean().optional()
|
|
516
556
|
});
|
|
517
557
|
expectTypesMatch(true);
|
|
518
|
-
var kicadSymbolPinNames =
|
|
558
|
+
var kicadSymbolPinNames = z20.object({
|
|
519
559
|
offset: distance5.optional(),
|
|
520
|
-
hide:
|
|
560
|
+
hide: z20.boolean().optional()
|
|
521
561
|
});
|
|
522
562
|
expectTypesMatch(true);
|
|
523
|
-
var kicadSymbolEffects =
|
|
563
|
+
var kicadSymbolEffects = z20.object({
|
|
524
564
|
font: kicadFont.optional(),
|
|
525
|
-
justify:
|
|
526
|
-
hide:
|
|
565
|
+
justify: z20.union([z20.string(), z20.array(z20.string())]).optional(),
|
|
566
|
+
hide: z20.boolean().optional()
|
|
527
567
|
});
|
|
528
568
|
expectTypesMatch(true);
|
|
529
|
-
var kicadSymbolProperty =
|
|
530
|
-
value:
|
|
531
|
-
id:
|
|
569
|
+
var kicadSymbolProperty = z20.object({
|
|
570
|
+
value: z20.string(),
|
|
571
|
+
id: z20.union([z20.number(), z20.string()]).optional(),
|
|
532
572
|
at: kicadAt.optional(),
|
|
533
573
|
effects: kicadSymbolEffects.optional()
|
|
534
574
|
});
|
|
535
575
|
expectTypesMatch(true);
|
|
536
|
-
var kicadSymbolProperties =
|
|
576
|
+
var kicadSymbolProperties = z20.object({
|
|
537
577
|
Reference: kicadSymbolProperty.optional(),
|
|
538
578
|
Value: kicadSymbolProperty.optional(),
|
|
539
579
|
Footprint: kicadSymbolProperty.optional(),
|
|
@@ -543,55 +583,55 @@ var kicadSymbolProperties = z19.object({
|
|
|
543
583
|
ki_fp_filters: kicadSymbolProperty.optional()
|
|
544
584
|
});
|
|
545
585
|
expectTypesMatch(true);
|
|
546
|
-
var kicadSymbolMetadata =
|
|
547
|
-
symbolName:
|
|
548
|
-
extends:
|
|
586
|
+
var kicadSymbolMetadata = z20.object({
|
|
587
|
+
symbolName: z20.string().optional(),
|
|
588
|
+
extends: z20.string().optional(),
|
|
549
589
|
pinNumbers: kicadSymbolPinNumbers.optional(),
|
|
550
590
|
pinNames: kicadSymbolPinNames.optional(),
|
|
551
|
-
excludeFromSim:
|
|
552
|
-
inBom:
|
|
553
|
-
onBoard:
|
|
591
|
+
excludeFromSim: z20.boolean().optional(),
|
|
592
|
+
inBom: z20.boolean().optional(),
|
|
593
|
+
onBoard: z20.boolean().optional(),
|
|
554
594
|
properties: kicadSymbolProperties.optional(),
|
|
555
|
-
embeddedFonts:
|
|
595
|
+
embeddedFonts: z20.boolean().optional()
|
|
556
596
|
});
|
|
557
597
|
expectTypesMatch(true);
|
|
558
598
|
|
|
559
599
|
// lib/common/pcbStyle.ts
|
|
560
600
|
import { distance as distance6 } from "circuit-json";
|
|
561
|
-
import { z as
|
|
562
|
-
var pcbStyle =
|
|
601
|
+
import { z as z21 } from "zod";
|
|
602
|
+
var pcbStyle = z21.object({
|
|
563
603
|
silkscreenFontSize: distance6.optional(),
|
|
564
604
|
viaPadDiameter: distance6.optional(),
|
|
565
605
|
viaHoleDiameter: distance6.optional(),
|
|
566
|
-
silkscreenTextPosition:
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
offsetX:
|
|
570
|
-
offsetY:
|
|
606
|
+
silkscreenTextPosition: z21.union([
|
|
607
|
+
z21.enum(["centered", "outside", "none"]),
|
|
608
|
+
z21.object({
|
|
609
|
+
offsetX: z21.number(),
|
|
610
|
+
offsetY: z21.number()
|
|
571
611
|
})
|
|
572
612
|
]).optional(),
|
|
573
|
-
silkscreenTextVisibility:
|
|
613
|
+
silkscreenTextVisibility: z21.enum(["hidden", "visible", "inherit"]).optional()
|
|
574
614
|
});
|
|
575
615
|
expectTypesMatch(true);
|
|
576
616
|
|
|
577
617
|
// lib/common/pcbSx.ts
|
|
578
618
|
import { length as length2 } from "circuit-json";
|
|
579
|
-
import { z as
|
|
580
|
-
var pcbSxValue =
|
|
619
|
+
import { z as z22 } from "zod";
|
|
620
|
+
var pcbSxValue = z22.object({
|
|
581
621
|
fontSize: length2.optional(),
|
|
582
622
|
pcbX: pcbCoordinate.optional(),
|
|
583
623
|
pcbY: pcbCoordinate.optional(),
|
|
584
|
-
visibility:
|
|
624
|
+
visibility: z22.enum(["hidden", "visible", "inherit"]).optional()
|
|
585
625
|
});
|
|
586
|
-
var pcbSx =
|
|
587
|
-
|
|
626
|
+
var pcbSx = z22.record(
|
|
627
|
+
z22.string(),
|
|
588
628
|
pcbSxValue
|
|
589
629
|
);
|
|
590
630
|
expectTypesMatch(true);
|
|
591
631
|
|
|
592
632
|
// lib/common/pinAttributeMap.ts
|
|
593
|
-
import { z as
|
|
594
|
-
var pinCapability =
|
|
633
|
+
import { z as z23 } from "zod";
|
|
634
|
+
var pinCapability = z23.enum([
|
|
595
635
|
"i2c_sda",
|
|
596
636
|
"i2c_scl",
|
|
597
637
|
"spi_cs",
|
|
@@ -601,61 +641,61 @@ var pinCapability = z22.enum([
|
|
|
601
641
|
"uart_tx",
|
|
602
642
|
"uart_rx"
|
|
603
643
|
]);
|
|
604
|
-
var pinAttributeMap =
|
|
605
|
-
isInput:
|
|
606
|
-
isOutput:
|
|
607
|
-
isBidirectional:
|
|
608
|
-
isPassive:
|
|
609
|
-
canUseTriState:
|
|
610
|
-
isUsingTriState:
|
|
611
|
-
canUseOpenCollector:
|
|
612
|
-
isUsingOpenCollector:
|
|
613
|
-
canUseOpenEmitter:
|
|
614
|
-
isUsingOpenEmitter:
|
|
615
|
-
capabilities:
|
|
616
|
-
activeCapabilities:
|
|
644
|
+
var pinAttributeMap = z23.object({
|
|
645
|
+
isInput: z23.boolean().optional(),
|
|
646
|
+
isOutput: z23.boolean().optional(),
|
|
647
|
+
isBidirectional: z23.boolean().optional(),
|
|
648
|
+
isPassive: z23.boolean().optional(),
|
|
649
|
+
canUseTriState: z23.boolean().optional(),
|
|
650
|
+
isUsingTriState: z23.boolean().optional(),
|
|
651
|
+
canUseOpenCollector: z23.boolean().optional(),
|
|
652
|
+
isUsingOpenCollector: z23.boolean().optional(),
|
|
653
|
+
canUseOpenEmitter: z23.boolean().optional(),
|
|
654
|
+
isUsingOpenEmitter: z23.boolean().optional(),
|
|
655
|
+
capabilities: z23.array(pinCapability).optional(),
|
|
656
|
+
activeCapabilities: z23.array(pinCapability).optional(),
|
|
617
657
|
activeCapability: pinCapability.optional(),
|
|
618
|
-
providesPower:
|
|
619
|
-
requiresPower:
|
|
620
|
-
providesGround:
|
|
621
|
-
requiresGround:
|
|
622
|
-
providesVoltage:
|
|
623
|
-
requiresVoltage:
|
|
624
|
-
doNotConnect:
|
|
625
|
-
includeInBoardPinout:
|
|
626
|
-
highlightColor:
|
|
627
|
-
mustBeConnected:
|
|
628
|
-
canUseInternalPullup:
|
|
629
|
-
isUsingInternalPullup:
|
|
630
|
-
needsExternalPullup:
|
|
631
|
-
canUseInternalPulldown:
|
|
632
|
-
isUsingInternalPulldown:
|
|
633
|
-
needsExternalPulldown:
|
|
634
|
-
canUseOpenDrain:
|
|
635
|
-
isUsingOpenDrain:
|
|
636
|
-
canUsePushPull:
|
|
637
|
-
isUsingPushPull:
|
|
638
|
-
shouldHaveDecouplingCapacitor:
|
|
639
|
-
recommendedDecouplingCapacitorCapacitance:
|
|
640
|
-
isGpio:
|
|
658
|
+
providesPower: z23.boolean().optional(),
|
|
659
|
+
requiresPower: z23.boolean().optional(),
|
|
660
|
+
providesGround: z23.boolean().optional(),
|
|
661
|
+
requiresGround: z23.boolean().optional(),
|
|
662
|
+
providesVoltage: z23.union([z23.string(), z23.number()]).optional(),
|
|
663
|
+
requiresVoltage: z23.union([z23.string(), z23.number()]).optional(),
|
|
664
|
+
doNotConnect: z23.boolean().optional(),
|
|
665
|
+
includeInBoardPinout: z23.boolean().optional(),
|
|
666
|
+
highlightColor: z23.string().optional(),
|
|
667
|
+
mustBeConnected: z23.boolean().optional(),
|
|
668
|
+
canUseInternalPullup: z23.boolean().optional(),
|
|
669
|
+
isUsingInternalPullup: z23.boolean().optional(),
|
|
670
|
+
needsExternalPullup: z23.boolean().optional(),
|
|
671
|
+
canUseInternalPulldown: z23.boolean().optional(),
|
|
672
|
+
isUsingInternalPulldown: z23.boolean().optional(),
|
|
673
|
+
needsExternalPulldown: z23.boolean().optional(),
|
|
674
|
+
canUseOpenDrain: z23.boolean().optional(),
|
|
675
|
+
isUsingOpenDrain: z23.boolean().optional(),
|
|
676
|
+
canUsePushPull: z23.boolean().optional(),
|
|
677
|
+
isUsingPushPull: z23.boolean().optional(),
|
|
678
|
+
shouldHaveDecouplingCapacitor: z23.boolean().optional(),
|
|
679
|
+
recommendedDecouplingCapacitorCapacitance: z23.union([z23.string(), z23.number()]).optional(),
|
|
680
|
+
isGpio: z23.boolean().optional()
|
|
641
681
|
});
|
|
642
682
|
expectTypesMatch(true);
|
|
643
683
|
|
|
644
684
|
// lib/common/schStyle.ts
|
|
645
685
|
import { distance as distance7 } from "circuit-json";
|
|
646
|
-
import { z as
|
|
647
|
-
var schStyle =
|
|
648
|
-
defaultPassiveSize:
|
|
649
|
-
defaultCapacitorOrientation:
|
|
686
|
+
import { z as z24 } from "zod";
|
|
687
|
+
var schStyle = z24.object({
|
|
688
|
+
defaultPassiveSize: z24.union([z24.enum(["xs", "sm", "md"]), distance7]).optional(),
|
|
689
|
+
defaultCapacitorOrientation: z24.enum(["vertical", "none"]).optional()
|
|
650
690
|
});
|
|
651
691
|
expectTypesMatch(true);
|
|
652
692
|
|
|
653
693
|
// lib/common/symbolProp.ts
|
|
654
|
-
import { z as
|
|
655
|
-
var symbolProp =
|
|
694
|
+
import { z as z25 } from "zod";
|
|
695
|
+
var symbolProp = z25.custom((v) => true);
|
|
656
696
|
|
|
657
697
|
// lib/common/layout.ts
|
|
658
|
-
var pcbLayoutProps =
|
|
698
|
+
var pcbLayoutProps = z26.object({
|
|
659
699
|
pcbX: pcbCoordinate.optional(),
|
|
660
700
|
pcbY: pcbCoordinate.optional(),
|
|
661
701
|
pcbLeftEdgeX: pcbCoordinate.optional(),
|
|
@@ -665,14 +705,14 @@ var pcbLayoutProps = z25.object({
|
|
|
665
705
|
pcbOffsetX: distance8.optional(),
|
|
666
706
|
pcbOffsetY: distance8.optional(),
|
|
667
707
|
pcbRotation: rotation2.optional(),
|
|
668
|
-
pcbPositionAnchor:
|
|
669
|
-
pcbPositionMode:
|
|
708
|
+
pcbPositionAnchor: z26.string().optional(),
|
|
709
|
+
pcbPositionMode: z26.enum([
|
|
670
710
|
"relative_to_group_anchor",
|
|
671
711
|
"auto",
|
|
672
712
|
"relative_to_board_anchor",
|
|
673
713
|
"relative_to_component_anchor"
|
|
674
714
|
]).optional(),
|
|
675
|
-
shouldBeOnEdgeOfBoard:
|
|
715
|
+
shouldBeOnEdgeOfBoard: z26.boolean().optional(),
|
|
676
716
|
layer: layer_ref.optional(),
|
|
677
717
|
pcbMarginTop: distance8.optional(),
|
|
678
718
|
pcbMarginRight: distance8.optional(),
|
|
@@ -682,11 +722,11 @@ var pcbLayoutProps = z25.object({
|
|
|
682
722
|
pcbMarginY: distance8.optional(),
|
|
683
723
|
pcbStyle: pcbStyle.optional(),
|
|
684
724
|
pcbSx: pcbSx.optional(),
|
|
685
|
-
pcbRelative:
|
|
686
|
-
relative:
|
|
725
|
+
pcbRelative: z26.boolean().optional(),
|
|
726
|
+
relative: z26.boolean().optional()
|
|
687
727
|
});
|
|
688
728
|
expectTypesMatch(true);
|
|
689
|
-
var commonLayoutProps =
|
|
729
|
+
var commonLayoutProps = z26.object({
|
|
690
730
|
pcbX: pcbCoordinate.optional(),
|
|
691
731
|
pcbY: pcbCoordinate.optional(),
|
|
692
732
|
pcbLeftEdgeX: pcbCoordinate.optional(),
|
|
@@ -696,14 +736,14 @@ var commonLayoutProps = z25.object({
|
|
|
696
736
|
pcbOffsetX: distance8.optional(),
|
|
697
737
|
pcbOffsetY: distance8.optional(),
|
|
698
738
|
pcbRotation: rotation2.optional(),
|
|
699
|
-
pcbPositionAnchor:
|
|
700
|
-
pcbPositionMode:
|
|
739
|
+
pcbPositionAnchor: z26.string().optional(),
|
|
740
|
+
pcbPositionMode: z26.enum([
|
|
701
741
|
"relative_to_group_anchor",
|
|
702
742
|
"auto",
|
|
703
743
|
"relative_to_board_anchor",
|
|
704
744
|
"relative_to_component_anchor"
|
|
705
745
|
]).optional(),
|
|
706
|
-
shouldBeOnEdgeOfBoard:
|
|
746
|
+
shouldBeOnEdgeOfBoard: z26.boolean().optional(),
|
|
707
747
|
pcbMarginTop: distance8.optional(),
|
|
708
748
|
pcbMarginRight: distance8.optional(),
|
|
709
749
|
pcbMarginBottom: distance8.optional(),
|
|
@@ -725,45 +765,45 @@ var commonLayoutProps = z25.object({
|
|
|
725
765
|
footprint: footprintProp.optional(),
|
|
726
766
|
symbol: symbolProp.optional(),
|
|
727
767
|
schStyle: schStyle.optional(),
|
|
728
|
-
relative:
|
|
729
|
-
schRelative:
|
|
730
|
-
pcbRelative:
|
|
768
|
+
relative: z26.boolean().optional(),
|
|
769
|
+
schRelative: z26.boolean().optional(),
|
|
770
|
+
pcbRelative: z26.boolean().optional()
|
|
731
771
|
});
|
|
732
772
|
expectTypesMatch(true);
|
|
733
|
-
var supplierProps =
|
|
734
|
-
supplierPartNumbers:
|
|
773
|
+
var supplierProps = z26.object({
|
|
774
|
+
supplierPartNumbers: z26.record(supplier_name, z26.array(z26.string())).optional()
|
|
735
775
|
});
|
|
736
776
|
expectTypesMatch(true);
|
|
737
777
|
var commonComponentProps = commonLayoutProps.merge(supplierProps).extend({
|
|
738
|
-
key:
|
|
739
|
-
name:
|
|
740
|
-
displayName:
|
|
741
|
-
schSectionName:
|
|
778
|
+
key: z26.any().optional(),
|
|
779
|
+
name: z26.string(),
|
|
780
|
+
displayName: z26.string().optional(),
|
|
781
|
+
schSectionName: z26.string().optional().describe(
|
|
742
782
|
'This component will be drawn as part of this section e.g. "Power"'
|
|
743
783
|
),
|
|
744
|
-
schSheetName:
|
|
784
|
+
schSheetName: z26.string().optional().describe(
|
|
745
785
|
'This component will be drawn as part of this sheet e.g. "Main"'
|
|
746
786
|
),
|
|
747
787
|
datasheetUrl: url.optional(),
|
|
748
788
|
cadModel: cadModelProp.optional(),
|
|
749
789
|
kicadFootprintMetadata: kicadFootprintMetadata.optional(),
|
|
750
790
|
kicadSymbolMetadata: kicadSymbolMetadata.optional(),
|
|
751
|
-
children:
|
|
752
|
-
symbolName:
|
|
753
|
-
doNotPlace:
|
|
754
|
-
allowOffBoard:
|
|
791
|
+
children: z26.any().optional(),
|
|
792
|
+
symbolName: z26.string().optional(),
|
|
793
|
+
doNotPlace: z26.boolean().optional(),
|
|
794
|
+
allowOffBoard: z26.boolean().optional().describe(
|
|
755
795
|
"Allows the PCB component to hang off the board (e.g. for USB ports or displays)"
|
|
756
796
|
),
|
|
757
|
-
obstructsWithinBounds:
|
|
797
|
+
obstructsWithinBounds: z26.boolean().optional().describe(
|
|
758
798
|
"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"
|
|
759
799
|
),
|
|
760
|
-
showAsTranslucentModel:
|
|
800
|
+
showAsTranslucentModel: z26.boolean().optional().describe(
|
|
761
801
|
"Whether to show this component's CAD model as translucent in the 3D viewer."
|
|
762
802
|
),
|
|
763
|
-
pinAttributes:
|
|
764
|
-
mpn:
|
|
765
|
-
mfn:
|
|
766
|
-
manufacturerPartNumber:
|
|
803
|
+
pinAttributes: z26.record(z26.string(), pinAttributeMap).optional(),
|
|
804
|
+
mpn: z26.string().describe("Manufacturer Part Number").optional(),
|
|
805
|
+
mfn: z26.string().describe("Manufacturer Part Number").optional(),
|
|
806
|
+
manufacturerPartNumber: z26.string().optional()
|
|
767
807
|
});
|
|
768
808
|
expectTypesMatch(true);
|
|
769
809
|
var componentProps = commonComponentProps;
|
|
@@ -778,7 +818,7 @@ var lrPolarPins = [
|
|
|
778
818
|
"cathode",
|
|
779
819
|
"neg"
|
|
780
820
|
];
|
|
781
|
-
var distanceOrMultiplier = distance8.or(
|
|
821
|
+
var distanceOrMultiplier = distance8.or(z26.enum(["2x", "3x", "4x"]));
|
|
782
822
|
|
|
783
823
|
// lib/common/resolveManufacturerPartNumber.ts
|
|
784
824
|
var resolveManufacturerPartNumber = (props) => {
|
|
@@ -793,9 +833,9 @@ var resolveManufacturerPartNumber = (props) => {
|
|
|
793
833
|
|
|
794
834
|
// lib/common/pcbPath.ts
|
|
795
835
|
import { layer_ref as layer_ref2 } from "circuit-json";
|
|
796
|
-
import { z as
|
|
836
|
+
import { z as z27 } from "zod";
|
|
797
837
|
var basePcbPathPoint = point.extend({
|
|
798
|
-
via:
|
|
838
|
+
via: z27.boolean().optional(),
|
|
799
839
|
fromLayer: layer_ref2.optional(),
|
|
800
840
|
toLayer: layer_ref2.optional()
|
|
801
841
|
});
|
|
@@ -803,20 +843,20 @@ var pcbPathPoint = basePcbPathPoint.superRefine((value, ctx) => {
|
|
|
803
843
|
if (value.via) {
|
|
804
844
|
if (!value.toLayer) {
|
|
805
845
|
ctx.addIssue({
|
|
806
|
-
code:
|
|
846
|
+
code: z27.ZodIssueCode.custom,
|
|
807
847
|
message: "toLayer is required when via is true",
|
|
808
848
|
path: ["toLayer"]
|
|
809
849
|
});
|
|
810
850
|
}
|
|
811
851
|
} else if (value.fromLayer || value.toLayer) {
|
|
812
852
|
ctx.addIssue({
|
|
813
|
-
code:
|
|
853
|
+
code: z27.ZodIssueCode.custom,
|
|
814
854
|
message: "fromLayer/toLayer are only allowed when via is true",
|
|
815
855
|
path: ["via"]
|
|
816
856
|
});
|
|
817
857
|
}
|
|
818
858
|
});
|
|
819
|
-
var pcbPath =
|
|
859
|
+
var pcbPath = z27.array(z27.union([pcbPathPoint, z27.string()]));
|
|
820
860
|
expectTypesMatch(true);
|
|
821
861
|
expectTypesMatch(true);
|
|
822
862
|
|
|
@@ -16284,8 +16324,8 @@ var footprinterStringExamples = [
|
|
|
16284
16324
|
];
|
|
16285
16325
|
|
|
16286
16326
|
// lib/common/schematicOrientation.ts
|
|
16287
|
-
import { z as
|
|
16288
|
-
var schematicOrientation =
|
|
16327
|
+
import { z as z28 } from "zod";
|
|
16328
|
+
var schematicOrientation = z28.enum([
|
|
16289
16329
|
"vertical",
|
|
16290
16330
|
"horizontal",
|
|
16291
16331
|
"pos_top",
|
|
@@ -16304,32 +16344,32 @@ expectTypesMatch(
|
|
|
16304
16344
|
);
|
|
16305
16345
|
|
|
16306
16346
|
// lib/common/schematicPinDefinitions.ts
|
|
16307
|
-
import { z as
|
|
16308
|
-
var explicitPinSideDefinition =
|
|
16309
|
-
pins:
|
|
16310
|
-
direction:
|
|
16311
|
-
|
|
16312
|
-
|
|
16313
|
-
|
|
16314
|
-
|
|
16347
|
+
import { z as z29 } from "zod";
|
|
16348
|
+
var explicitPinSideDefinition = z29.object({
|
|
16349
|
+
pins: z29.array(z29.union([z29.number(), z29.string()])),
|
|
16350
|
+
direction: z29.union([
|
|
16351
|
+
z29.literal("top-to-bottom"),
|
|
16352
|
+
z29.literal("left-to-right"),
|
|
16353
|
+
z29.literal("bottom-to-top"),
|
|
16354
|
+
z29.literal("right-to-left")
|
|
16315
16355
|
])
|
|
16316
16356
|
});
|
|
16317
|
-
var pinSideDefinitionInput =
|
|
16318
|
-
var pinSideDefinitionWithDefaultDirection = (direction2) =>
|
|
16357
|
+
var pinSideDefinitionInput = z29.array(z29.union([z29.number(), z29.string()]));
|
|
16358
|
+
var pinSideDefinitionWithDefaultDirection = (direction2) => z29.union([explicitPinSideDefinition, pinSideDefinitionInput]).transform(
|
|
16319
16359
|
(value) => Array.isArray(value) ? {
|
|
16320
16360
|
pins: value,
|
|
16321
16361
|
direction: direction2
|
|
16322
16362
|
} : value
|
|
16323
16363
|
);
|
|
16324
|
-
var schematicPortArrangement =
|
|
16325
|
-
leftSize:
|
|
16326
|
-
topSize:
|
|
16327
|
-
rightSize:
|
|
16328
|
-
bottomSize:
|
|
16329
|
-
leftPinCount:
|
|
16330
|
-
rightPinCount:
|
|
16331
|
-
topPinCount:
|
|
16332
|
-
bottomPinCount:
|
|
16364
|
+
var schematicPortArrangement = z29.object({
|
|
16365
|
+
leftSize: z29.number().optional().describe("@deprecated, use leftPinCount"),
|
|
16366
|
+
topSize: z29.number().optional().describe("@deprecated, use topPinCount"),
|
|
16367
|
+
rightSize: z29.number().optional().describe("@deprecated, use rightPinCount"),
|
|
16368
|
+
bottomSize: z29.number().optional().describe("@deprecated, use bottomPinCount"),
|
|
16369
|
+
leftPinCount: z29.number().optional(),
|
|
16370
|
+
rightPinCount: z29.number().optional(),
|
|
16371
|
+
topPinCount: z29.number().optional(),
|
|
16372
|
+
bottomPinCount: z29.number().optional(),
|
|
16333
16373
|
leftSide: pinSideDefinitionWithDefaultDirection("top-to-bottom").optional(),
|
|
16334
16374
|
rightSide: pinSideDefinitionWithDefaultDirection("top-to-bottom").optional(),
|
|
16335
16375
|
topSide: pinSideDefinitionWithDefaultDirection("left-to-right").optional(),
|
|
@@ -16340,9 +16380,9 @@ expectTypesMatch(true);
|
|
|
16340
16380
|
|
|
16341
16381
|
// lib/common/schematicPinStyle.ts
|
|
16342
16382
|
import { distance as distance9 } from "circuit-json";
|
|
16343
|
-
import { z as
|
|
16344
|
-
var schematicPinStyle =
|
|
16345
|
-
|
|
16383
|
+
import { z as z30 } from "zod";
|
|
16384
|
+
var schematicPinStyle = z30.record(
|
|
16385
|
+
z30.object({
|
|
16346
16386
|
marginLeft: distance9.optional(),
|
|
16347
16387
|
marginRight: distance9.optional(),
|
|
16348
16388
|
marginTop: distance9.optional(),
|
|
@@ -16356,17 +16396,17 @@ var schematicPinStyle = z29.record(
|
|
|
16356
16396
|
expectTypesMatch(true);
|
|
16357
16397
|
|
|
16358
16398
|
// lib/common/schematicPinLabel.ts
|
|
16359
|
-
import { z as
|
|
16360
|
-
var schematicPinLabel =
|
|
16399
|
+
import { z as z31 } from "zod";
|
|
16400
|
+
var schematicPinLabel = z31.string().regex(/^[A-Za-z0-9_]+$/);
|
|
16361
16401
|
|
|
16362
16402
|
// lib/common/schematicSize.ts
|
|
16363
16403
|
import { distance as distance10 } from "circuit-json";
|
|
16364
|
-
import { z as
|
|
16365
|
-
var schematicSymbolSize =
|
|
16404
|
+
import { z as z32 } from "zod";
|
|
16405
|
+
var schematicSymbolSize = z32.enum(["xs", "sm", "default", "md"]).or(distance10.pipe(z32.number().finite())).describe("distance between pin1 and pin2 of the schematic symbol");
|
|
16366
16406
|
|
|
16367
16407
|
// lib/common/kicadPinMetadata.ts
|
|
16368
|
-
import { z as
|
|
16369
|
-
var kicadPinElectricalType =
|
|
16408
|
+
import { z as z33 } from "zod";
|
|
16409
|
+
var kicadPinElectricalType = z33.enum([
|
|
16370
16410
|
"input",
|
|
16371
16411
|
"output",
|
|
16372
16412
|
"bidirectional",
|
|
@@ -16380,7 +16420,7 @@ var kicadPinElectricalType = z32.enum([
|
|
|
16380
16420
|
"open_emitter",
|
|
16381
16421
|
"no_connect"
|
|
16382
16422
|
]);
|
|
16383
|
-
var kicadPinGraphicStyle =
|
|
16423
|
+
var kicadPinGraphicStyle = z33.enum([
|
|
16384
16424
|
"line",
|
|
16385
16425
|
"inverted",
|
|
16386
16426
|
"clock",
|
|
@@ -16391,7 +16431,7 @@ var kicadPinGraphicStyle = z32.enum([
|
|
|
16391
16431
|
"falling_edge_clock",
|
|
16392
16432
|
"nonlogic"
|
|
16393
16433
|
]);
|
|
16394
|
-
var kicadPinMetadata =
|
|
16434
|
+
var kicadPinMetadata = z33.object({
|
|
16395
16435
|
electricalType: kicadPinElectricalType.optional(),
|
|
16396
16436
|
graphicStyle: kicadPinGraphicStyle.optional(),
|
|
16397
16437
|
pinLength: distance.optional(),
|
|
@@ -16401,14 +16441,14 @@ var kicadPinMetadata = z32.object({
|
|
|
16401
16441
|
expectTypesMatch(true);
|
|
16402
16442
|
|
|
16403
16443
|
// lib/customDrc.ts
|
|
16404
|
-
import { z as
|
|
16405
|
-
var customDrcCheckFn =
|
|
16444
|
+
import { z as z34 } from "zod";
|
|
16445
|
+
var customDrcCheckFn = z34.custom(
|
|
16406
16446
|
(value) => typeof value === "function"
|
|
16407
16447
|
);
|
|
16408
16448
|
|
|
16409
16449
|
// lib/common/ninePointAnchor.ts
|
|
16410
|
-
import { z as
|
|
16411
|
-
var ninePointAnchor =
|
|
16450
|
+
import { z as z35 } from "zod";
|
|
16451
|
+
var ninePointAnchor = z35.enum([
|
|
16412
16452
|
"top_left",
|
|
16413
16453
|
"top_center",
|
|
16414
16454
|
"top_right",
|
|
@@ -16421,47 +16461,47 @@ var ninePointAnchor = z34.enum([
|
|
|
16421
16461
|
]);
|
|
16422
16462
|
|
|
16423
16463
|
// lib/components/board.ts
|
|
16424
|
-
import { z as
|
|
16464
|
+
import { z as z49 } from "zod";
|
|
16425
16465
|
|
|
16426
16466
|
// lib/components/group.ts
|
|
16427
16467
|
import {
|
|
16428
16468
|
length as length3,
|
|
16429
16469
|
distance as distance11
|
|
16430
16470
|
} from "circuit-json";
|
|
16431
|
-
import { z as
|
|
16471
|
+
import { z as z48 } from "zod";
|
|
16432
16472
|
|
|
16433
16473
|
// lib/manual-edits/manual-edit-events/base_manual_edit_event.ts
|
|
16434
|
-
import { z as
|
|
16435
|
-
var base_manual_edit_event =
|
|
16436
|
-
edit_event_id:
|
|
16437
|
-
in_progress:
|
|
16438
|
-
created_at:
|
|
16474
|
+
import { z as z36 } from "zod";
|
|
16475
|
+
var base_manual_edit_event = z36.object({
|
|
16476
|
+
edit_event_id: z36.string(),
|
|
16477
|
+
in_progress: z36.boolean().optional(),
|
|
16478
|
+
created_at: z36.number()
|
|
16439
16479
|
});
|
|
16440
16480
|
expectTypesMatch(
|
|
16441
16481
|
true
|
|
16442
16482
|
);
|
|
16443
16483
|
|
|
16444
16484
|
// lib/manual-edits/manual-edit-events/edit_pcb_component_location_event.ts
|
|
16445
|
-
import { z as
|
|
16485
|
+
import { z as z37 } from "zod";
|
|
16446
16486
|
var edit_pcb_component_location_event = base_manual_edit_event.extend({
|
|
16447
|
-
pcb_edit_event_type:
|
|
16448
|
-
edit_event_type:
|
|
16449
|
-
pcb_component_id:
|
|
16450
|
-
original_center:
|
|
16451
|
-
new_center:
|
|
16487
|
+
pcb_edit_event_type: z37.literal("edit_component_location").describe("deprecated"),
|
|
16488
|
+
edit_event_type: z37.literal("edit_pcb_component_location"),
|
|
16489
|
+
pcb_component_id: z37.string(),
|
|
16490
|
+
original_center: z37.object({ x: z37.number(), y: z37.number() }),
|
|
16491
|
+
new_center: z37.object({ x: z37.number(), y: z37.number() })
|
|
16452
16492
|
});
|
|
16453
16493
|
var edit_component_location_event = edit_pcb_component_location_event;
|
|
16454
16494
|
expectTypesMatch(true);
|
|
16455
16495
|
|
|
16456
16496
|
// lib/manual-edits/manual-edit-events/edit_trace_hint_event.ts
|
|
16457
|
-
import { z as
|
|
16497
|
+
import { z as z38 } from "zod";
|
|
16458
16498
|
var edit_trace_hint_event = base_manual_edit_event.extend({
|
|
16459
|
-
pcb_edit_event_type:
|
|
16460
|
-
edit_event_type:
|
|
16461
|
-
pcb_port_id:
|
|
16462
|
-
pcb_trace_hint_id:
|
|
16463
|
-
route:
|
|
16464
|
-
|
|
16499
|
+
pcb_edit_event_type: z38.literal("edit_trace_hint").describe("deprecated"),
|
|
16500
|
+
edit_event_type: z38.literal("edit_pcb_trace_hint").optional(),
|
|
16501
|
+
pcb_port_id: z38.string(),
|
|
16502
|
+
pcb_trace_hint_id: z38.string().optional(),
|
|
16503
|
+
route: z38.array(
|
|
16504
|
+
z38.object({ x: z38.number(), y: z38.number(), via: z38.boolean().optional() })
|
|
16465
16505
|
)
|
|
16466
16506
|
});
|
|
16467
16507
|
expectTypesMatch(
|
|
@@ -16469,38 +16509,38 @@ expectTypesMatch(
|
|
|
16469
16509
|
);
|
|
16470
16510
|
|
|
16471
16511
|
// lib/manual-edits/manual-edit-events/edit_schematic_component_location_event.ts
|
|
16472
|
-
import { z as
|
|
16512
|
+
import { z as z39 } from "zod";
|
|
16473
16513
|
var edit_schematic_component_location_event = base_manual_edit_event.extend({
|
|
16474
|
-
edit_event_type:
|
|
16475
|
-
schematic_component_id:
|
|
16476
|
-
original_center:
|
|
16477
|
-
new_center:
|
|
16514
|
+
edit_event_type: z39.literal("edit_schematic_component_location"),
|
|
16515
|
+
schematic_component_id: z39.string(),
|
|
16516
|
+
original_center: z39.object({ x: z39.number(), y: z39.number() }),
|
|
16517
|
+
new_center: z39.object({ x: z39.number(), y: z39.number() })
|
|
16478
16518
|
});
|
|
16479
16519
|
expectTypesMatch(true);
|
|
16480
16520
|
|
|
16481
16521
|
// lib/manual-edits/manual-edit-events/edit_pcb_group_location_event.ts
|
|
16482
|
-
import { z as
|
|
16522
|
+
import { z as z40 } from "zod";
|
|
16483
16523
|
var edit_pcb_group_location_event = base_manual_edit_event.extend({
|
|
16484
|
-
edit_event_type:
|
|
16485
|
-
pcb_group_id:
|
|
16486
|
-
original_center:
|
|
16487
|
-
new_center:
|
|
16524
|
+
edit_event_type: z40.literal("edit_pcb_group_location"),
|
|
16525
|
+
pcb_group_id: z40.string(),
|
|
16526
|
+
original_center: z40.object({ x: z40.number(), y: z40.number() }),
|
|
16527
|
+
new_center: z40.object({ x: z40.number(), y: z40.number() })
|
|
16488
16528
|
});
|
|
16489
16529
|
expectTypesMatch(true);
|
|
16490
16530
|
|
|
16491
16531
|
// lib/manual-edits/manual-edit-events/edit_schematic_group_location_event.ts
|
|
16492
|
-
import { z as
|
|
16532
|
+
import { z as z41 } from "zod";
|
|
16493
16533
|
var edit_schematic_group_location_event = base_manual_edit_event.extend({
|
|
16494
|
-
edit_event_type:
|
|
16495
|
-
schematic_group_id:
|
|
16496
|
-
original_center:
|
|
16497
|
-
new_center:
|
|
16534
|
+
edit_event_type: z41.literal("edit_schematic_group_location"),
|
|
16535
|
+
schematic_group_id: z41.string(),
|
|
16536
|
+
original_center: z41.object({ x: z41.number(), y: z41.number() }),
|
|
16537
|
+
new_center: z41.object({ x: z41.number(), y: z41.number() })
|
|
16498
16538
|
});
|
|
16499
16539
|
expectTypesMatch(true);
|
|
16500
16540
|
|
|
16501
16541
|
// lib/manual-edits/manual_edit_event.ts
|
|
16502
|
-
import { z as
|
|
16503
|
-
var manual_edit_event =
|
|
16542
|
+
import { z as z42 } from "zod";
|
|
16543
|
+
var manual_edit_event = z42.union([
|
|
16504
16544
|
edit_pcb_component_location_event,
|
|
16505
16545
|
edit_trace_hint_event,
|
|
16506
16546
|
edit_schematic_component_location_event
|
|
@@ -16508,33 +16548,33 @@ var manual_edit_event = z41.union([
|
|
|
16508
16548
|
expectTypesMatch(true);
|
|
16509
16549
|
|
|
16510
16550
|
// lib/manual-edits/manual_edits_file.ts
|
|
16511
|
-
import { z as
|
|
16551
|
+
import { z as z46 } from "zod";
|
|
16512
16552
|
|
|
16513
16553
|
// lib/manual-edits/manual_pcb_placement.ts
|
|
16514
|
-
import { z as
|
|
16554
|
+
import { z as z43 } from "zod";
|
|
16515
16555
|
import { point as point2 } from "circuit-json";
|
|
16516
|
-
var manual_pcb_placement =
|
|
16517
|
-
selector:
|
|
16518
|
-
relative_to:
|
|
16556
|
+
var manual_pcb_placement = z43.object({
|
|
16557
|
+
selector: z43.string(),
|
|
16558
|
+
relative_to: z43.string().optional().default("group_center").describe("Can be a selector or 'group_center'"),
|
|
16519
16559
|
center: point2
|
|
16520
16560
|
});
|
|
16521
16561
|
expectTypesMatch(true);
|
|
16522
16562
|
|
|
16523
16563
|
// lib/manual-edits/manual_trace_hint.ts
|
|
16524
|
-
import { z as
|
|
16564
|
+
import { z as z44 } from "zod";
|
|
16525
16565
|
import { route_hint_point } from "circuit-json";
|
|
16526
|
-
var manual_trace_hint =
|
|
16527
|
-
pcb_port_selector:
|
|
16528
|
-
offsets:
|
|
16566
|
+
var manual_trace_hint = z44.object({
|
|
16567
|
+
pcb_port_selector: z44.string(),
|
|
16568
|
+
offsets: z44.array(route_hint_point)
|
|
16529
16569
|
});
|
|
16530
16570
|
expectTypesMatch(true);
|
|
16531
16571
|
|
|
16532
16572
|
// lib/manual-edits/manual_schematic_placement.ts
|
|
16533
|
-
import { z as
|
|
16573
|
+
import { z as z45 } from "zod";
|
|
16534
16574
|
import { point as point4 } from "circuit-json";
|
|
16535
|
-
var manual_schematic_placement =
|
|
16536
|
-
selector:
|
|
16537
|
-
relative_to:
|
|
16575
|
+
var manual_schematic_placement = z45.object({
|
|
16576
|
+
selector: z45.string(),
|
|
16577
|
+
relative_to: z45.string().optional().default("group_center").describe("Can be a selector or 'group_center'"),
|
|
16538
16578
|
center: point4
|
|
16539
16579
|
});
|
|
16540
16580
|
expectTypesMatch(
|
|
@@ -16542,37 +16582,37 @@ expectTypesMatch(
|
|
|
16542
16582
|
);
|
|
16543
16583
|
|
|
16544
16584
|
// lib/manual-edits/manual_edits_file.ts
|
|
16545
|
-
var manual_edits_file =
|
|
16546
|
-
pcb_placements:
|
|
16547
|
-
manual_trace_hints:
|
|
16548
|
-
schematic_placements:
|
|
16585
|
+
var manual_edits_file = z46.object({
|
|
16586
|
+
pcb_placements: z46.array(manual_pcb_placement).optional(),
|
|
16587
|
+
manual_trace_hints: z46.array(manual_trace_hint).optional(),
|
|
16588
|
+
schematic_placements: z46.array(manual_schematic_placement).optional()
|
|
16549
16589
|
});
|
|
16550
16590
|
expectTypesMatch(true);
|
|
16551
16591
|
|
|
16552
16592
|
// lib/common/connectionsProp.ts
|
|
16553
|
-
import { z as
|
|
16554
|
-
var connectionTarget =
|
|
16593
|
+
import { z as z47 } from "zod";
|
|
16594
|
+
var connectionTarget = z47.string().or(z47.array(z47.string()).readonly()).or(z47.array(z47.string()));
|
|
16555
16595
|
var createConnectionsProp = (labels) => {
|
|
16556
|
-
return
|
|
16596
|
+
return z47.record(z47.enum(labels), connectionTarget);
|
|
16557
16597
|
};
|
|
16558
16598
|
|
|
16559
16599
|
// lib/components/group.ts
|
|
16560
|
-
var layoutConfig =
|
|
16561
|
-
layoutMode:
|
|
16562
|
-
position:
|
|
16563
|
-
grid:
|
|
16564
|
-
gridCols:
|
|
16565
|
-
gridRows:
|
|
16566
|
-
gridTemplateRows:
|
|
16567
|
-
gridTemplateColumns:
|
|
16568
|
-
gridTemplate:
|
|
16569
|
-
gridGap:
|
|
16570
|
-
gridRowGap:
|
|
16571
|
-
gridColumnGap:
|
|
16572
|
-
flex:
|
|
16573
|
-
flexDirection:
|
|
16574
|
-
alignItems:
|
|
16575
|
-
justifyContent:
|
|
16600
|
+
var layoutConfig = z48.object({
|
|
16601
|
+
layoutMode: z48.enum(["grid", "flex", "match-adapt", "relative", "none"]).optional(),
|
|
16602
|
+
position: z48.enum(["absolute", "relative"]).optional(),
|
|
16603
|
+
grid: z48.boolean().optional(),
|
|
16604
|
+
gridCols: z48.number().or(z48.string()).optional(),
|
|
16605
|
+
gridRows: z48.number().or(z48.string()).optional(),
|
|
16606
|
+
gridTemplateRows: z48.string().optional(),
|
|
16607
|
+
gridTemplateColumns: z48.string().optional(),
|
|
16608
|
+
gridTemplate: z48.string().optional(),
|
|
16609
|
+
gridGap: z48.number().or(z48.string()).optional(),
|
|
16610
|
+
gridRowGap: z48.number().or(z48.string()).optional(),
|
|
16611
|
+
gridColumnGap: z48.number().or(z48.string()).optional(),
|
|
16612
|
+
flex: z48.boolean().or(z48.string()).optional(),
|
|
16613
|
+
flexDirection: z48.enum(["row", "column"]).optional(),
|
|
16614
|
+
alignItems: z48.enum(["start", "center", "end", "stretch"]).optional(),
|
|
16615
|
+
justifyContent: z48.enum([
|
|
16576
16616
|
"start",
|
|
16577
16617
|
"center",
|
|
16578
16618
|
"end",
|
|
@@ -16581,16 +16621,16 @@ var layoutConfig = z47.object({
|
|
|
16581
16621
|
"space-around",
|
|
16582
16622
|
"space-evenly"
|
|
16583
16623
|
]).optional(),
|
|
16584
|
-
flexRow:
|
|
16585
|
-
flexColumn:
|
|
16586
|
-
gap:
|
|
16587
|
-
pack:
|
|
16588
|
-
packOrderStrategy:
|
|
16624
|
+
flexRow: z48.boolean().optional(),
|
|
16625
|
+
flexColumn: z48.boolean().optional(),
|
|
16626
|
+
gap: z48.number().or(z48.string()).optional(),
|
|
16627
|
+
pack: z48.boolean().optional().describe("Pack the contents of this group using a packing strategy"),
|
|
16628
|
+
packOrderStrategy: z48.enum([
|
|
16589
16629
|
"largest_to_smallest",
|
|
16590
16630
|
"first_to_last",
|
|
16591
16631
|
"highest_to_lowest_pin_count"
|
|
16592
16632
|
]).optional(),
|
|
16593
|
-
packPlacementStrategy:
|
|
16633
|
+
packPlacementStrategy: z48.enum(["shortest_connection_along_outline"]).optional(),
|
|
16594
16634
|
padding: length3.optional(),
|
|
16595
16635
|
paddingLeft: length3.optional(),
|
|
16596
16636
|
paddingRight: length3.optional(),
|
|
@@ -16600,17 +16640,17 @@ var layoutConfig = z47.object({
|
|
|
16600
16640
|
paddingY: length3.optional(),
|
|
16601
16641
|
width: length3.optional(),
|
|
16602
16642
|
height: length3.optional(),
|
|
16603
|
-
matchAdapt:
|
|
16604
|
-
matchAdaptTemplate:
|
|
16643
|
+
matchAdapt: z48.boolean().optional(),
|
|
16644
|
+
matchAdaptTemplate: z48.any().optional()
|
|
16605
16645
|
});
|
|
16606
16646
|
expectTypesMatch(true);
|
|
16607
|
-
var border =
|
|
16647
|
+
var border = z48.object({
|
|
16608
16648
|
strokeWidth: length3.optional(),
|
|
16609
|
-
dashed:
|
|
16610
|
-
solid:
|
|
16649
|
+
dashed: z48.boolean().optional(),
|
|
16650
|
+
solid: z48.boolean().optional()
|
|
16611
16651
|
});
|
|
16612
|
-
var pcbAnchorAlignmentAutocomplete =
|
|
16613
|
-
var routingTolerances =
|
|
16652
|
+
var pcbAnchorAlignmentAutocomplete = z48.custom((value) => typeof value === "string");
|
|
16653
|
+
var routingTolerances = z48.object({
|
|
16614
16654
|
minTraceWidth: length3.optional(),
|
|
16615
16655
|
minViaHoleEdgeToViaHoleEdgeClearance: length3.optional(),
|
|
16616
16656
|
minViaEdgeToPadEdgeClearance: length3.optional(),
|
|
@@ -16624,25 +16664,25 @@ var routingTolerances = z47.object({
|
|
|
16624
16664
|
minViaHoleDiameter: length3.optional(),
|
|
16625
16665
|
minViaPadDiameter: length3.optional()
|
|
16626
16666
|
});
|
|
16627
|
-
var autorouterConfig =
|
|
16667
|
+
var autorouterConfig = z48.object({
|
|
16628
16668
|
serverUrl: url.optional(),
|
|
16629
|
-
inputFormat:
|
|
16630
|
-
serverMode:
|
|
16631
|
-
serverCacheEnabled:
|
|
16632
|
-
cache:
|
|
16669
|
+
inputFormat: z48.enum(["simplified", "circuit-json"]).optional(),
|
|
16670
|
+
serverMode: z48.enum(["job", "solve-endpoint"]).optional(),
|
|
16671
|
+
serverCacheEnabled: z48.boolean().optional(),
|
|
16672
|
+
cache: z48.custom((v) => true).optional(),
|
|
16633
16673
|
traceClearance: length3.optional(),
|
|
16634
|
-
availableJumperTypes:
|
|
16635
|
-
allowViaInPad:
|
|
16674
|
+
availableJumperTypes: z48.array(z48.enum(["1206x4", "0603"])).optional(),
|
|
16675
|
+
allowViaInPad: z48.boolean().optional().describe(
|
|
16636
16676
|
"Allows the autorouter to place vias inside connected pads. Omitted or false keeps via-in-pad routing disabled."
|
|
16637
16677
|
),
|
|
16638
|
-
groupMode:
|
|
16639
|
-
algorithmFn:
|
|
16678
|
+
groupMode: z48.enum(["sequential_trace", "subcircuit", "sequential-trace"]).optional(),
|
|
16679
|
+
algorithmFn: z48.custom(
|
|
16640
16680
|
(v) => typeof v === "function" || v === void 0
|
|
16641
16681
|
).optional(),
|
|
16642
|
-
implicitBreakoutPointSolverFn:
|
|
16682
|
+
implicitBreakoutPointSolverFn: z48.custom(
|
|
16643
16683
|
(value) => typeof value === "function" || value === void 0
|
|
16644
16684
|
).optional(),
|
|
16645
|
-
preset:
|
|
16685
|
+
preset: z48.enum([
|
|
16646
16686
|
"sequential_trace",
|
|
16647
16687
|
"subcircuit",
|
|
16648
16688
|
"default",
|
|
@@ -16667,39 +16707,39 @@ var autorouterConfig = z47.object({
|
|
|
16667
16707
|
]).transform(
|
|
16668
16708
|
(preset) => preset === "single_layer_routing" ? "bus_lanes" : preset
|
|
16669
16709
|
).optional(),
|
|
16670
|
-
local:
|
|
16710
|
+
local: z48.boolean().optional()
|
|
16671
16711
|
});
|
|
16672
|
-
var autorouterPreset =
|
|
16673
|
-
|
|
16674
|
-
|
|
16675
|
-
|
|
16676
|
-
|
|
16677
|
-
|
|
16678
|
-
|
|
16679
|
-
|
|
16680
|
-
|
|
16681
|
-
|
|
16682
|
-
|
|
16683
|
-
|
|
16684
|
-
|
|
16712
|
+
var autorouterPreset = z48.union([
|
|
16713
|
+
z48.literal("sequential_trace"),
|
|
16714
|
+
z48.literal("subcircuit"),
|
|
16715
|
+
z48.literal("default"),
|
|
16716
|
+
z48.literal("auto"),
|
|
16717
|
+
z48.literal("auto_local"),
|
|
16718
|
+
z48.literal("auto_cloud"),
|
|
16719
|
+
z48.literal("auto_jumper"),
|
|
16720
|
+
z48.literal("tscircuit_beta"),
|
|
16721
|
+
z48.literal("krt"),
|
|
16722
|
+
z48.literal("freerouting"),
|
|
16723
|
+
z48.literal("simplify"),
|
|
16724
|
+
z48.literal("laser_prefab"),
|
|
16685
16725
|
// Prefabricated PCB with laser copper ablation
|
|
16686
|
-
|
|
16687
|
-
|
|
16688
|
-
|
|
16689
|
-
|
|
16690
|
-
|
|
16691
|
-
|
|
16692
|
-
|
|
16693
|
-
|
|
16694
|
-
|
|
16726
|
+
z48.literal("single_layer_fanout"),
|
|
16727
|
+
z48.literal("fanout"),
|
|
16728
|
+
z48.literal("dogbone"),
|
|
16729
|
+
z48.literal("bus_lanes"),
|
|
16730
|
+
z48.literal("single_layer_routing").transform(() => "bus_lanes"),
|
|
16731
|
+
z48.literal("auto-jumper"),
|
|
16732
|
+
z48.literal("sequential-trace"),
|
|
16733
|
+
z48.literal("auto-local"),
|
|
16734
|
+
z48.literal("auto-cloud")
|
|
16695
16735
|
]);
|
|
16696
|
-
var autorouterString =
|
|
16697
|
-
var autorouterProp =
|
|
16736
|
+
var autorouterString = z48.string();
|
|
16737
|
+
var autorouterProp = z48.union([
|
|
16698
16738
|
autorouterConfig,
|
|
16699
16739
|
autorouterPreset,
|
|
16700
16740
|
autorouterString
|
|
16701
16741
|
]);
|
|
16702
|
-
var autorouterEffortLevel =
|
|
16742
|
+
var autorouterEffortLevel = z48.enum([
|
|
16703
16743
|
"1x",
|
|
16704
16744
|
"1.5x",
|
|
16705
16745
|
"2x",
|
|
@@ -16707,12 +16747,12 @@ var autorouterEffortLevel = z47.enum([
|
|
|
16707
16747
|
"10x",
|
|
16708
16748
|
"100x"
|
|
16709
16749
|
]);
|
|
16710
|
-
var preflightRoutingCheckPolicy =
|
|
16750
|
+
var preflightRoutingCheckPolicy = z48.enum([
|
|
16711
16751
|
"none",
|
|
16712
16752
|
"basic",
|
|
16713
16753
|
"conservative"
|
|
16714
16754
|
]);
|
|
16715
|
-
var knownAutorouterVersion =
|
|
16755
|
+
var knownAutorouterVersion = z48.enum([
|
|
16716
16756
|
"beta_pipeline1",
|
|
16717
16757
|
"beta_pipeline3",
|
|
16718
16758
|
"beta_pipeline4",
|
|
@@ -16721,7 +16761,7 @@ var knownAutorouterVersion = z47.enum([
|
|
|
16721
16761
|
"beta_pipeline9",
|
|
16722
16762
|
"latest"
|
|
16723
16763
|
]);
|
|
16724
|
-
var autorouterVersion =
|
|
16764
|
+
var autorouterVersion = z48.custom(
|
|
16725
16765
|
(value) => typeof value === "string"
|
|
16726
16766
|
).transform((value) => {
|
|
16727
16767
|
const parsedAutorouterVersion = knownAutorouterVersion.safeParse(value);
|
|
@@ -16732,33 +16772,33 @@ var autorouterVersion = z47.custom(
|
|
|
16732
16772
|
return "latest";
|
|
16733
16773
|
});
|
|
16734
16774
|
var baseGroupProps = commonLayoutProps.extend({
|
|
16735
|
-
name:
|
|
16736
|
-
children:
|
|
16737
|
-
schTitle:
|
|
16738
|
-
schSheetName:
|
|
16739
|
-
key:
|
|
16740
|
-
showAsSchematicBox:
|
|
16741
|
-
connections:
|
|
16775
|
+
name: z48.string().optional(),
|
|
16776
|
+
children: z48.any().optional(),
|
|
16777
|
+
schTitle: z48.string().optional(),
|
|
16778
|
+
schSheetName: z48.string().optional().describe('This group will be drawn as part of this sheet e.g. "Main"'),
|
|
16779
|
+
key: z48.any().optional(),
|
|
16780
|
+
showAsSchematicBox: z48.boolean().optional(),
|
|
16781
|
+
connections: z48.record(z48.string(), connectionTarget.optional()).optional(),
|
|
16742
16782
|
schPinArrangement: schematicPinArrangement.optional(),
|
|
16743
16783
|
schPinSpacing: length3.optional(),
|
|
16744
16784
|
schPinStyle: schematicPinStyle.optional(),
|
|
16745
16785
|
...layoutConfig.shape,
|
|
16746
16786
|
grid: layoutConfig.shape.grid.describe("@deprecated use pcbGrid"),
|
|
16747
16787
|
flex: layoutConfig.shape.flex.describe("@deprecated use pcbFlex"),
|
|
16748
|
-
pcbGrid:
|
|
16749
|
-
pcbGridCols:
|
|
16750
|
-
pcbGridRows:
|
|
16751
|
-
pcbGridTemplateRows:
|
|
16752
|
-
pcbGridTemplateColumns:
|
|
16753
|
-
pcbGridTemplate:
|
|
16754
|
-
pcbGridGap:
|
|
16755
|
-
pcbGridRowGap:
|
|
16756
|
-
pcbGridColumnGap:
|
|
16757
|
-
pcbFlex:
|
|
16758
|
-
pcbFlexGap:
|
|
16759
|
-
pcbFlexDirection:
|
|
16760
|
-
pcbAlignItems:
|
|
16761
|
-
pcbJustifyContent:
|
|
16788
|
+
pcbGrid: z48.boolean().optional(),
|
|
16789
|
+
pcbGridCols: z48.number().or(z48.string()).optional(),
|
|
16790
|
+
pcbGridRows: z48.number().or(z48.string()).optional(),
|
|
16791
|
+
pcbGridTemplateRows: z48.string().optional(),
|
|
16792
|
+
pcbGridTemplateColumns: z48.string().optional(),
|
|
16793
|
+
pcbGridTemplate: z48.string().optional(),
|
|
16794
|
+
pcbGridGap: z48.number().or(z48.string()).optional(),
|
|
16795
|
+
pcbGridRowGap: z48.number().or(z48.string()).optional(),
|
|
16796
|
+
pcbGridColumnGap: z48.number().or(z48.string()).optional(),
|
|
16797
|
+
pcbFlex: z48.boolean().or(z48.string()).optional(),
|
|
16798
|
+
pcbFlexGap: z48.number().or(z48.string()).optional(),
|
|
16799
|
+
pcbFlexDirection: z48.enum(["row", "column"]).optional(),
|
|
16800
|
+
pcbAlignItems: z48.enum(["start", "center", "end", "stretch"]).optional(),
|
|
16801
|
+
pcbJustifyContent: z48.enum([
|
|
16762
16802
|
"start",
|
|
16763
16803
|
"center",
|
|
16764
16804
|
"end",
|
|
@@ -16767,25 +16807,25 @@ var baseGroupProps = commonLayoutProps.extend({
|
|
|
16767
16807
|
"space-around",
|
|
16768
16808
|
"space-evenly"
|
|
16769
16809
|
]).optional(),
|
|
16770
|
-
pcbFlexRow:
|
|
16771
|
-
pcbFlexColumn:
|
|
16772
|
-
pcbGap:
|
|
16773
|
-
pcbPack:
|
|
16774
|
-
pcbPackGap:
|
|
16775
|
-
schGrid:
|
|
16776
|
-
schGridCols:
|
|
16777
|
-
schGridRows:
|
|
16778
|
-
schGridTemplateRows:
|
|
16779
|
-
schGridTemplateColumns:
|
|
16780
|
-
schGridTemplate:
|
|
16781
|
-
schGridGap:
|
|
16782
|
-
schGridRowGap:
|
|
16783
|
-
schGridColumnGap:
|
|
16784
|
-
schFlex:
|
|
16785
|
-
schFlexGap:
|
|
16786
|
-
schFlexDirection:
|
|
16787
|
-
schAlignItems:
|
|
16788
|
-
schJustifyContent:
|
|
16810
|
+
pcbFlexRow: z48.boolean().optional(),
|
|
16811
|
+
pcbFlexColumn: z48.boolean().optional(),
|
|
16812
|
+
pcbGap: z48.number().or(z48.string()).optional(),
|
|
16813
|
+
pcbPack: z48.boolean().optional(),
|
|
16814
|
+
pcbPackGap: z48.number().or(z48.string()).optional(),
|
|
16815
|
+
schGrid: z48.boolean().optional(),
|
|
16816
|
+
schGridCols: z48.number().or(z48.string()).optional(),
|
|
16817
|
+
schGridRows: z48.number().or(z48.string()).optional(),
|
|
16818
|
+
schGridTemplateRows: z48.string().optional(),
|
|
16819
|
+
schGridTemplateColumns: z48.string().optional(),
|
|
16820
|
+
schGridTemplate: z48.string().optional(),
|
|
16821
|
+
schGridGap: z48.number().or(z48.string()).optional(),
|
|
16822
|
+
schGridRowGap: z48.number().or(z48.string()).optional(),
|
|
16823
|
+
schGridColumnGap: z48.number().or(z48.string()).optional(),
|
|
16824
|
+
schFlex: z48.boolean().or(z48.string()).optional(),
|
|
16825
|
+
schFlexGap: z48.number().or(z48.string()).optional(),
|
|
16826
|
+
schFlexDirection: z48.enum(["row", "column"]).optional(),
|
|
16827
|
+
schAlignItems: z48.enum(["start", "center", "end", "stretch"]).optional(),
|
|
16828
|
+
schJustifyContent: z48.enum([
|
|
16789
16829
|
"start",
|
|
16790
16830
|
"center",
|
|
16791
16831
|
"end",
|
|
@@ -16794,11 +16834,11 @@ var baseGroupProps = commonLayoutProps.extend({
|
|
|
16794
16834
|
"space-around",
|
|
16795
16835
|
"space-evenly"
|
|
16796
16836
|
]).optional(),
|
|
16797
|
-
schFlexRow:
|
|
16798
|
-
schFlexColumn:
|
|
16799
|
-
schGap:
|
|
16800
|
-
schPack:
|
|
16801
|
-
schMatchAdapt:
|
|
16837
|
+
schFlexRow: z48.boolean().optional(),
|
|
16838
|
+
schFlexColumn: z48.boolean().optional(),
|
|
16839
|
+
schGap: z48.number().or(z48.string()).optional(),
|
|
16840
|
+
schPack: z48.boolean().optional(),
|
|
16841
|
+
schMatchAdapt: z48.boolean().optional(),
|
|
16802
16842
|
pcbWidth: length3.optional(),
|
|
16803
16843
|
pcbHeight: length3.optional(),
|
|
16804
16844
|
minTraceWidth: length3.optional(),
|
|
@@ -16821,42 +16861,42 @@ var baseGroupProps = commonLayoutProps.extend({
|
|
|
16821
16861
|
pcbPaddingBottom: length3.optional(),
|
|
16822
16862
|
pcbAnchorAlignment: pcbAnchorAlignmentAutocomplete.optional()
|
|
16823
16863
|
});
|
|
16824
|
-
var partsEngine =
|
|
16864
|
+
var partsEngine = z48.custom((v) => "findPart" in v);
|
|
16825
16865
|
var subcircuitGroupProps = baseGroupProps.extend({
|
|
16826
16866
|
manualEdits: manual_edits_file.optional(),
|
|
16827
|
-
schAutoLayoutEnabled:
|
|
16828
|
-
schTraceAutoLabelEnabled:
|
|
16867
|
+
schAutoLayoutEnabled: z48.boolean().optional(),
|
|
16868
|
+
schTraceAutoLabelEnabled: z48.boolean().optional(),
|
|
16829
16869
|
schMaxTraceDistance: distance11.optional(),
|
|
16830
|
-
routingDisabled:
|
|
16831
|
-
placementDrcChecksDisabled:
|
|
16832
|
-
bomDisabled:
|
|
16870
|
+
routingDisabled: z48.boolean().optional(),
|
|
16871
|
+
placementDrcChecksDisabled: z48.boolean().optional(),
|
|
16872
|
+
bomDisabled: z48.boolean().optional(),
|
|
16833
16873
|
defaultTraceWidth: length3.optional(),
|
|
16834
16874
|
...routingTolerances.shape,
|
|
16835
16875
|
nominalTraceWidth: length3.optional(),
|
|
16836
16876
|
partsEngine: partsEngine.optional(),
|
|
16837
|
-
_subcircuitCachingEnabled:
|
|
16838
|
-
pcbRouteCache:
|
|
16877
|
+
_subcircuitCachingEnabled: z48.boolean().optional(),
|
|
16878
|
+
pcbRouteCache: z48.custom((v) => true).optional(),
|
|
16839
16879
|
autorouter: autorouterProp.optional(),
|
|
16840
16880
|
preflightRoutingCheckPolicy: preflightRoutingCheckPolicy.optional(),
|
|
16841
16881
|
autorouterEffortLevel: autorouterEffortLevel.optional(),
|
|
16842
16882
|
autorouterVersion: autorouterVersion.optional(),
|
|
16843
|
-
square:
|
|
16844
|
-
emptyArea:
|
|
16845
|
-
filledArea:
|
|
16883
|
+
square: z48.boolean().optional(),
|
|
16884
|
+
emptyArea: z48.string().optional(),
|
|
16885
|
+
filledArea: z48.string().optional(),
|
|
16846
16886
|
width: distance11.optional(),
|
|
16847
16887
|
height: distance11.optional(),
|
|
16848
|
-
outline:
|
|
16888
|
+
outline: z48.array(point).optional(),
|
|
16849
16889
|
outlineOffsetX: distance11.optional(),
|
|
16850
16890
|
outlineOffsetY: distance11.optional(),
|
|
16851
|
-
circuitJson:
|
|
16852
|
-
exposedNets:
|
|
16853
|
-
exposeNets:
|
|
16891
|
+
circuitJson: z48.array(z48.any()).optional(),
|
|
16892
|
+
exposedNets: z48.array(z48.string()).optional(),
|
|
16893
|
+
exposeNets: z48.boolean().optional()
|
|
16854
16894
|
});
|
|
16855
16895
|
var subcircuitGroupPropsWithBool = subcircuitGroupProps.extend({
|
|
16856
|
-
subcircuit:
|
|
16896
|
+
subcircuit: z48.literal(true)
|
|
16857
16897
|
});
|
|
16858
|
-
var groupProps =
|
|
16859
|
-
baseGroupProps.extend({ subcircuit:
|
|
16898
|
+
var groupProps = z48.discriminatedUnion("subcircuit", [
|
|
16899
|
+
baseGroupProps.extend({ subcircuit: z48.literal(false).optional() }),
|
|
16860
16900
|
subcircuitGroupPropsWithBool
|
|
16861
16901
|
]);
|
|
16862
16902
|
expectTypesMatch(true);
|
|
@@ -16866,25 +16906,25 @@ expectTypesMatch(true);
|
|
|
16866
16906
|
expectTypesMatch(true);
|
|
16867
16907
|
|
|
16868
16908
|
// lib/components/board.ts
|
|
16869
|
-
var boardColor =
|
|
16870
|
-
var boardOutlinePoint =
|
|
16909
|
+
var boardColor = z49.custom((value) => typeof value === "string");
|
|
16910
|
+
var boardOutlinePoint = z49.object({
|
|
16871
16911
|
...point.shape,
|
|
16872
|
-
isCastellatedHole:
|
|
16912
|
+
isCastellatedHole: z49.boolean().optional(),
|
|
16873
16913
|
holeDiameter: distance.optional(),
|
|
16874
16914
|
padDiameter: distance.optional(),
|
|
16875
|
-
connectsTo:
|
|
16915
|
+
connectsTo: z49.string().or(z49.array(z49.string())).optional()
|
|
16876
16916
|
}).superRefine((outlinePoint, ctx) => {
|
|
16877
16917
|
if (outlinePoint.isCastellatedHole) {
|
|
16878
16918
|
if (outlinePoint.holeDiameter === void 0) {
|
|
16879
16919
|
ctx.addIssue({
|
|
16880
|
-
code:
|
|
16920
|
+
code: z49.ZodIssueCode.custom,
|
|
16881
16921
|
path: ["holeDiameter"],
|
|
16882
16922
|
message: "holeDiameter is required for a castellated hole"
|
|
16883
16923
|
});
|
|
16884
16924
|
}
|
|
16885
16925
|
if (outlinePoint.padDiameter === void 0) {
|
|
16886
16926
|
ctx.addIssue({
|
|
16887
|
-
code:
|
|
16927
|
+
code: z49.ZodIssueCode.custom,
|
|
16888
16928
|
path: ["padDiameter"],
|
|
16889
16929
|
message: "padDiameter is required for a castellated hole"
|
|
16890
16930
|
});
|
|
@@ -16893,19 +16933,19 @@ var boardOutlinePoint = z48.object({
|
|
|
16893
16933
|
}
|
|
16894
16934
|
if (outlinePoint.holeDiameter !== void 0 || outlinePoint.padDiameter !== void 0 || outlinePoint.connectsTo !== void 0) {
|
|
16895
16935
|
ctx.addIssue({
|
|
16896
|
-
code:
|
|
16936
|
+
code: z49.ZodIssueCode.custom,
|
|
16897
16937
|
path: ["isCastellatedHole"],
|
|
16898
16938
|
message: "isCastellatedHole must be true when castellated hole props are provided"
|
|
16899
16939
|
});
|
|
16900
16940
|
}
|
|
16901
16941
|
});
|
|
16902
16942
|
var boardProps = subcircuitGroupProps.omit({ connections: true }).extend({
|
|
16903
|
-
mountedTo:
|
|
16904
|
-
mountGap: distance.pipe(
|
|
16943
|
+
mountedTo: z49.string().trim().min(1).optional().describe('e.g. "NEMA17.backface".'),
|
|
16944
|
+
mountGap: distance.pipe(z49.number().nonnegative().finite()).optional().describe('Clearance from the mounting face, e.g. "6mm".'),
|
|
16905
16945
|
mountRotationAnchor: boardMountRotationAnchor.optional().describe('e.g. "J_USB" or "rightedge".'),
|
|
16906
16946
|
mountRotation: boardMountRotation.optional().describe('e.g. "calc(NEMA17.wireside-90degcw)".'),
|
|
16907
16947
|
mountOrientation: boardMountOrientation.optional().describe('e.g. "top_layer_toward_mount_face".'),
|
|
16908
|
-
fabricatorPreset:
|
|
16948
|
+
fabricatorPreset: z49.enum([
|
|
16909
16949
|
"jlcpcb_economy",
|
|
16910
16950
|
"jlcpcb_standard",
|
|
16911
16951
|
"jlcpcb_economy_20260912",
|
|
@@ -16913,24 +16953,24 @@ var boardProps = subcircuitGroupProps.omit({ connections: true }).extend({
|
|
|
16913
16953
|
]).optional().describe(
|
|
16914
16954
|
"Fabricator preset, preserved as supplied. Omitted leaves the preset unset."
|
|
16915
16955
|
),
|
|
16916
|
-
material:
|
|
16917
|
-
layers:
|
|
16918
|
-
|
|
16919
|
-
|
|
16920
|
-
|
|
16921
|
-
|
|
16922
|
-
|
|
16923
|
-
|
|
16956
|
+
material: z49.enum(["fr4", "fr1", "flex"]).default("fr4"),
|
|
16957
|
+
layers: z49.union([
|
|
16958
|
+
z49.literal(1),
|
|
16959
|
+
z49.literal(2),
|
|
16960
|
+
z49.literal(4),
|
|
16961
|
+
z49.literal(6),
|
|
16962
|
+
z49.literal(8),
|
|
16963
|
+
z49.literal(10)
|
|
16924
16964
|
]).default(2),
|
|
16925
|
-
allowBlindAndBuriedVias:
|
|
16965
|
+
allowBlindAndBuriedVias: z49.boolean().default(false).describe(
|
|
16926
16966
|
"Whether the autorouter may generate blind and buried vias. Defaults to false, which restricts newly generated vias to the full board stack."
|
|
16927
16967
|
),
|
|
16928
|
-
routeRemaining:
|
|
16968
|
+
routeRemaining: z49.boolean().optional().describe(
|
|
16929
16969
|
"Whether to route remaining unrouted connections after explicit routing phases. Boolean values are preserved; omitted leaves the setting unset. No aliases or prop conflicts are introduced, and existing boards require no migration."
|
|
16930
16970
|
),
|
|
16931
|
-
defaultViaTenting:
|
|
16932
|
-
|
|
16933
|
-
|
|
16971
|
+
defaultViaTenting: z49.union([
|
|
16972
|
+
z49.boolean(),
|
|
16973
|
+
z49.enum([
|
|
16934
16974
|
"both_sides",
|
|
16935
16975
|
"top_and_bottom_tented",
|
|
16936
16976
|
"top_tented",
|
|
@@ -16949,46 +16989,46 @@ var boardProps = subcircuitGroupProps.omit({ connections: true }).extend({
|
|
|
16949
16989
|
boardAnchorPosition: point.optional(),
|
|
16950
16990
|
anchorAlignment: ninePointAnchor.optional(),
|
|
16951
16991
|
boardAnchorAlignment: ninePointAnchor.optional().describe("Prefer using anchorAlignment when possible"),
|
|
16952
|
-
outline:
|
|
16953
|
-
title:
|
|
16992
|
+
outline: z49.array(boardOutlinePoint).optional(),
|
|
16993
|
+
title: z49.string().optional(),
|
|
16954
16994
|
solderMaskColor: boardColor.optional(),
|
|
16955
16995
|
topSolderMaskColor: boardColor.optional(),
|
|
16956
16996
|
bottomSolderMaskColor: boardColor.optional(),
|
|
16957
16997
|
silkscreenColor: boardColor.optional(),
|
|
16958
16998
|
topSilkscreenColor: boardColor.optional(),
|
|
16959
16999
|
bottomSilkscreenColor: boardColor.optional(),
|
|
16960
|
-
doubleSidedAssembly:
|
|
16961
|
-
isViaInPadAllowed:
|
|
17000
|
+
doubleSidedAssembly: z49.boolean().optional().default(false),
|
|
17001
|
+
isViaInPadAllowed: z49.boolean().optional().describe(
|
|
16962
17002
|
"Allows intentional via-in-pad designs to pass DRC. Omitted or false keeps via-in-pad disallowed."
|
|
16963
17003
|
),
|
|
16964
|
-
automaticPoursEnabled:
|
|
17004
|
+
automaticPoursEnabled: z49.boolean().default(false).describe(
|
|
16965
17005
|
"Whether implicit copper pours should be generated automatically. Defaults to false."
|
|
16966
17006
|
),
|
|
16967
|
-
enableViaStitching:
|
|
17007
|
+
enableViaStitching: z49.boolean().default(false).describe(
|
|
16968
17008
|
"Whether to stitch copper pours on the same net across layers with vias. Defaults to false."
|
|
16969
17009
|
),
|
|
16970
|
-
viaStitchPitch: distance.pipe(
|
|
17010
|
+
viaStitchPitch: distance.pipe(z49.number().positive().finite()).optional().describe(
|
|
16971
17011
|
"Positive center-to-center stitching via spacing in millimeters or a unit string, parsed to millimeters. Omitted uses the solver default. Does not enable stitching by itself."
|
|
16972
17012
|
),
|
|
16973
|
-
schematicDisabled:
|
|
17013
|
+
schematicDisabled: z49.boolean().optional()
|
|
16974
17014
|
});
|
|
16975
17015
|
expectTypesMatch(true);
|
|
16976
17016
|
expectTypesMatch(true);
|
|
16977
17017
|
|
|
16978
17018
|
// lib/components/pcb-bend.ts
|
|
16979
17019
|
import { rotation as rotation3 } from "circuit-json";
|
|
16980
|
-
import { z as
|
|
16981
|
-
var finiteDistance = distance.pipe(
|
|
16982
|
-
var pcbBendProps =
|
|
16983
|
-
name:
|
|
17020
|
+
import { z as z50 } from "zod";
|
|
17021
|
+
var finiteDistance = distance.pipe(z50.number().finite());
|
|
17022
|
+
var pcbBendProps = z50.object({
|
|
17023
|
+
name: z50.string().optional(),
|
|
16984
17024
|
x1: finiteDistance,
|
|
16985
17025
|
y1: finiteDistance,
|
|
16986
17026
|
x2: finiteDistance,
|
|
16987
17027
|
y2: finiteDistance,
|
|
16988
|
-
bendAngle: rotation3.pipe(
|
|
16989
|
-
bendRadius: distance.pipe(
|
|
16990
|
-
tearReliefRadius: distance.pipe(
|
|
16991
|
-
bendSide:
|
|
17028
|
+
bendAngle: rotation3.pipe(z50.number().finite()),
|
|
17029
|
+
bendRadius: distance.pipe(z50.number().finite().positive()),
|
|
17030
|
+
tearReliefRadius: distance.pipe(z50.number().finite().positive()).optional(),
|
|
17031
|
+
bendSide: z50.enum(["left", "right"])
|
|
16992
17032
|
}).refine(({ x1, y1, x2, y2 }) => x1 !== x2 || y1 !== y2, {
|
|
16993
17033
|
message: "Bend centerline endpoints must be distinct",
|
|
16994
17034
|
path: ["x2"]
|
|
@@ -16996,83 +17036,83 @@ var pcbBendProps = z49.object({
|
|
|
16996
17036
|
expectTypesMatch(true);
|
|
16997
17037
|
|
|
16998
17038
|
// lib/components/pcb-soldermask-opening.ts
|
|
16999
|
-
import { z as
|
|
17000
|
-
var finiteDistance2 = distance.pipe(
|
|
17001
|
-
var positiveDistance2 = distance.pipe(
|
|
17039
|
+
import { z as z51 } from "zod";
|
|
17040
|
+
var finiteDistance2 = distance.pipe(z51.number().finite());
|
|
17041
|
+
var positiveDistance2 = distance.pipe(z51.number().finite().positive());
|
|
17002
17042
|
var openingBaseProps = pcbLayoutProps.omit({ layer: true }).extend({
|
|
17003
|
-
name:
|
|
17043
|
+
name: z51.string().optional(),
|
|
17004
17044
|
/** Face whose solder mask or flex coverlay is removed. Required. */
|
|
17005
|
-
layer:
|
|
17045
|
+
layer: z51.enum(["top", "bottom"])
|
|
17006
17046
|
});
|
|
17007
|
-
var pcbSoldermaskOpeningProps =
|
|
17047
|
+
var pcbSoldermaskOpeningProps = z51.discriminatedUnion("shape", [
|
|
17008
17048
|
openingBaseProps.extend({
|
|
17009
|
-
shape:
|
|
17049
|
+
shape: z51.literal("rect"),
|
|
17010
17050
|
width: positiveDistance2,
|
|
17011
17051
|
height: positiveDistance2,
|
|
17012
|
-
radius:
|
|
17013
|
-
points:
|
|
17052
|
+
radius: z51.never().optional(),
|
|
17053
|
+
points: z51.never().optional()
|
|
17014
17054
|
}),
|
|
17015
17055
|
openingBaseProps.extend({
|
|
17016
|
-
shape:
|
|
17056
|
+
shape: z51.literal("circle"),
|
|
17017
17057
|
radius: positiveDistance2,
|
|
17018
|
-
width:
|
|
17019
|
-
height:
|
|
17020
|
-
points:
|
|
17058
|
+
width: z51.never().optional(),
|
|
17059
|
+
height: z51.never().optional(),
|
|
17060
|
+
points: z51.never().optional()
|
|
17021
17061
|
}),
|
|
17022
17062
|
openingBaseProps.extend({
|
|
17023
|
-
shape:
|
|
17063
|
+
shape: z51.literal("polygon"),
|
|
17024
17064
|
/** Local vertices; pcbX/pcbY/pcbRotation place the implicitly closed boundary. */
|
|
17025
|
-
points:
|
|
17065
|
+
points: z51.array(z51.object({ x: finiteDistance2, y: finiteDistance2 })).min(3).refine((points) => {
|
|
17026
17066
|
const twiceArea = points.reduce((sum, point8, index) => {
|
|
17027
17067
|
const next = points[(index + 1) % points.length];
|
|
17028
17068
|
return sum + point8.x * next.y - next.x * point8.y;
|
|
17029
17069
|
}, 0);
|
|
17030
17070
|
return Number.isFinite(twiceArea) && twiceArea !== 0;
|
|
17031
17071
|
}, "Solder-mask opening must enclose a nonzero area"),
|
|
17032
|
-
width:
|
|
17033
|
-
height:
|
|
17034
|
-
radius:
|
|
17072
|
+
width: z51.never().optional(),
|
|
17073
|
+
height: z51.never().optional(),
|
|
17074
|
+
radius: z51.never().optional()
|
|
17035
17075
|
})
|
|
17036
17076
|
]);
|
|
17037
17077
|
|
|
17038
17078
|
// lib/components/pcb-stiffener.ts
|
|
17039
|
-
import { z as
|
|
17040
|
-
var positiveDistance3 = distance.pipe(
|
|
17041
|
-
var finiteDistance3 = distance.pipe(
|
|
17079
|
+
import { z as z52 } from "zod";
|
|
17080
|
+
var positiveDistance3 = distance.pipe(z52.number().finite().positive());
|
|
17081
|
+
var finiteDistance3 = distance.pipe(z52.number().finite());
|
|
17042
17082
|
var stiffenerBaseProps = pcbLayoutProps.omit({ layer: true }).extend({
|
|
17043
|
-
name:
|
|
17083
|
+
name: z52.string().optional(),
|
|
17044
17084
|
/** Board attachment face, not a copper-layer assignment. Required. */
|
|
17045
|
-
layer:
|
|
17046
|
-
material:
|
|
17085
|
+
layer: z52.enum(["top", "bottom"]),
|
|
17086
|
+
material: z52.enum(["fr4", "polyimide", "stainless_steel", "aluminum"]),
|
|
17047
17087
|
/** Stiffener material thickness only, excluding PCB and adhesive. */
|
|
17048
17088
|
thickness: positiveDistance3,
|
|
17049
17089
|
/** Nonnegative adhesive thickness; omission means unspecified, not zero. */
|
|
17050
|
-
adhesiveThickness: distance.pipe(
|
|
17090
|
+
adhesiveThickness: distance.pipe(z52.number().finite().nonnegative()).optional()
|
|
17051
17091
|
});
|
|
17052
|
-
var pcbStiffenerProps =
|
|
17092
|
+
var pcbStiffenerProps = z52.discriminatedUnion("shape", [
|
|
17053
17093
|
stiffenerBaseProps.extend({
|
|
17054
|
-
shape:
|
|
17094
|
+
shape: z52.literal("rect"),
|
|
17055
17095
|
width: positiveDistance3,
|
|
17056
17096
|
height: positiveDistance3,
|
|
17057
|
-
outline:
|
|
17097
|
+
outline: z52.never().optional()
|
|
17058
17098
|
}),
|
|
17059
17099
|
stiffenerBaseProps.extend({
|
|
17060
|
-
shape:
|
|
17100
|
+
shape: z52.literal("polygon"),
|
|
17061
17101
|
/** Local vertices transformed by pcbX/pcbY/pcbRotation; implicitly closed. */
|
|
17062
|
-
outline:
|
|
17102
|
+
outline: z52.array(z52.object({ x: finiteDistance3, y: finiteDistance3 })).min(3).refine((points) => {
|
|
17063
17103
|
const twiceArea = points.reduce((sum, p, i) => {
|
|
17064
17104
|
const next = points[(i + 1) % points.length];
|
|
17065
17105
|
return sum + p.x * next.y - next.x * p.y;
|
|
17066
17106
|
}, 0);
|
|
17067
17107
|
return Number.isFinite(twiceArea) && twiceArea !== 0;
|
|
17068
17108
|
}, "Stiffener outline must enclose a nonzero area"),
|
|
17069
|
-
width:
|
|
17070
|
-
height:
|
|
17109
|
+
width: z52.never().optional(),
|
|
17110
|
+
height: z52.never().optional()
|
|
17071
17111
|
})
|
|
17072
17112
|
]);
|
|
17073
17113
|
|
|
17074
17114
|
// lib/components/panel.ts
|
|
17075
|
-
import { z as
|
|
17115
|
+
import { z as z53 } from "zod";
|
|
17076
17116
|
var panelProps = baseGroupProps.omit({
|
|
17077
17117
|
width: true,
|
|
17078
17118
|
height: true,
|
|
@@ -17081,25 +17121,25 @@ var panelProps = baseGroupProps.omit({
|
|
|
17081
17121
|
}).extend({
|
|
17082
17122
|
width: distance.optional(),
|
|
17083
17123
|
height: distance.optional(),
|
|
17084
|
-
children:
|
|
17124
|
+
children: z53.any().optional(),
|
|
17085
17125
|
anchorAlignment: ninePointAnchor.optional(),
|
|
17086
|
-
noSolderMask:
|
|
17087
|
-
panelizationMethod:
|
|
17126
|
+
noSolderMask: z53.boolean().optional(),
|
|
17127
|
+
panelizationMethod: z53.enum(["tab-routing", "outline_routing", "none"]).optional(),
|
|
17088
17128
|
boardGap: distance.optional(),
|
|
17089
|
-
layoutMode:
|
|
17090
|
-
row:
|
|
17091
|
-
col:
|
|
17129
|
+
layoutMode: z53.enum(["grid", "pack", "none"]).optional(),
|
|
17130
|
+
row: z53.number().optional(),
|
|
17131
|
+
col: z53.number().optional(),
|
|
17092
17132
|
cellWidth: distance.optional(),
|
|
17093
17133
|
cellHeight: distance.optional(),
|
|
17094
17134
|
tabWidth: distance.optional(),
|
|
17095
17135
|
tabLength: distance.optional(),
|
|
17096
|
-
mouseBites:
|
|
17136
|
+
mouseBites: z53.boolean().optional(),
|
|
17097
17137
|
edgePadding: distance.optional(),
|
|
17098
17138
|
edgePaddingLeft: distance.optional(),
|
|
17099
17139
|
edgePaddingRight: distance.optional(),
|
|
17100
17140
|
edgePaddingTop: distance.optional(),
|
|
17101
17141
|
edgePaddingBottom: distance.optional(),
|
|
17102
|
-
_subcircuitCachingEnabled:
|
|
17142
|
+
_subcircuitCachingEnabled: z53.boolean().optional()
|
|
17103
17143
|
});
|
|
17104
17144
|
expectTypesMatch(true);
|
|
17105
17145
|
|
|
@@ -17110,23 +17150,23 @@ expectTypesMatch(true);
|
|
|
17110
17150
|
|
|
17111
17151
|
// lib/common/fanoutTracePath.ts
|
|
17112
17152
|
import { layer_ref as layer_ref5 } from "circuit-json";
|
|
17113
|
-
import { z as
|
|
17153
|
+
import { z as z55 } from "zod";
|
|
17114
17154
|
var coordinate = distance.refine(Number.isFinite, "Coordinate must be finite");
|
|
17115
17155
|
var positiveDistance4 = distance.refine(
|
|
17116
17156
|
(value) => Number.isFinite(value) && value > 0,
|
|
17117
17157
|
"Distance must be positive and finite"
|
|
17118
17158
|
);
|
|
17119
|
-
var routePoint =
|
|
17120
|
-
|
|
17121
|
-
route_type:
|
|
17159
|
+
var routePoint = z55.discriminatedUnion("route_type", [
|
|
17160
|
+
z55.object({
|
|
17161
|
+
route_type: z55.literal("wire"),
|
|
17122
17162
|
x: coordinate,
|
|
17123
17163
|
y: coordinate,
|
|
17124
17164
|
width: positiveDistance4,
|
|
17125
|
-
width_interpolation_mode:
|
|
17165
|
+
width_interpolation_mode: z55.enum(["linear", "quadratic"]).optional().describe("Interpolate width from this point to the next wire point."),
|
|
17126
17166
|
layer: layer_ref5
|
|
17127
17167
|
}),
|
|
17128
|
-
|
|
17129
|
-
route_type:
|
|
17168
|
+
z55.object({
|
|
17169
|
+
route_type: z55.literal("via"),
|
|
17130
17170
|
x: coordinate,
|
|
17131
17171
|
y: coordinate,
|
|
17132
17172
|
from_layer: layer_ref5,
|
|
@@ -17135,9 +17175,9 @@ var routePoint = z54.discriminatedUnion("route_type", [
|
|
|
17135
17175
|
via_hole_diameter: positiveDistance4.optional()
|
|
17136
17176
|
})
|
|
17137
17177
|
]);
|
|
17138
|
-
var fanoutTracePath =
|
|
17139
|
-
connection:
|
|
17140
|
-
route:
|
|
17178
|
+
var fanoutTracePath = z55.object({
|
|
17179
|
+
connection: z55.string().min(1),
|
|
17180
|
+
route: z55.array(routePoint).min(2).superRefine((route, ctx) => {
|
|
17141
17181
|
const first = route[0];
|
|
17142
17182
|
let layer = first?.route_type === "via" ? first.from_layer : first?.layer;
|
|
17143
17183
|
for (const [index, point8] of route.entries()) {
|
|
@@ -17164,16 +17204,16 @@ var fanoutTracePath = z54.object({
|
|
|
17164
17204
|
|
|
17165
17205
|
// lib/common/fanoutProps.ts
|
|
17166
17206
|
import { layer_ref as layer_ref6 } from "circuit-json";
|
|
17167
|
-
import { z as
|
|
17207
|
+
import { z as z57 } from "zod";
|
|
17168
17208
|
|
|
17169
17209
|
// lib/common/fanoutBoundaryPadding.ts
|
|
17170
|
-
import { z as
|
|
17210
|
+
import { z as z56 } from "zod";
|
|
17171
17211
|
var nonnegativeDistance = distance.refine((value) => value >= 0, {
|
|
17172
17212
|
message: "Fanout boundary padding cannot be negative"
|
|
17173
17213
|
});
|
|
17174
|
-
var fanoutBoundaryPadding =
|
|
17214
|
+
var fanoutBoundaryPadding = z56.union([
|
|
17175
17215
|
nonnegativeDistance,
|
|
17176
|
-
|
|
17216
|
+
z56.object({
|
|
17177
17217
|
top: nonnegativeDistance.optional(),
|
|
17178
17218
|
right: nonnegativeDistance.optional(),
|
|
17179
17219
|
bottom: nonnegativeDistance.optional(),
|
|
@@ -17200,32 +17240,32 @@ var canonicalBusFanoutDirectionValues = [
|
|
|
17200
17240
|
"leftside_top",
|
|
17201
17241
|
"center"
|
|
17202
17242
|
];
|
|
17203
|
-
var canonicalBusFanoutDirection =
|
|
17243
|
+
var canonicalBusFanoutDirection = z57.enum(
|
|
17204
17244
|
canonicalBusFanoutDirectionValues
|
|
17205
17245
|
);
|
|
17206
|
-
var busFanoutDirection =
|
|
17246
|
+
var busFanoutDirection = z57.union([
|
|
17207
17247
|
ninePointAnchor,
|
|
17208
17248
|
canonicalBusFanoutDirection,
|
|
17209
|
-
|
|
17210
|
-
direction:
|
|
17249
|
+
z57.object({
|
|
17250
|
+
direction: z57.union([ninePointAnchor, canonicalBusFanoutDirection])
|
|
17211
17251
|
})
|
|
17212
17252
|
]);
|
|
17213
|
-
var fanoutProps =
|
|
17214
|
-
busFanoutDirections:
|
|
17253
|
+
var fanoutProps = z57.object({
|
|
17254
|
+
busFanoutDirections: z57.record(busFanoutDirection).optional(),
|
|
17215
17255
|
fanoutBoundaryPadding: fanoutBoundaryPadding.optional(),
|
|
17216
|
-
fanoutRoutingLayers:
|
|
17217
|
-
fanoutPourNetMap:
|
|
17256
|
+
fanoutRoutingLayers: z57.array(layer_ref6).min(1).optional(),
|
|
17257
|
+
fanoutPourNetMap: z57.record(layer_ref6, z57.union([z57.string(), z57.array(z57.string()).min(1)])).optional()
|
|
17218
17258
|
});
|
|
17219
17259
|
expectTypesMatch(true);
|
|
17220
17260
|
|
|
17221
17261
|
// lib/components/breakout.ts
|
|
17222
|
-
import { z as
|
|
17262
|
+
import { z as z58 } from "zod";
|
|
17223
17263
|
var nonnegativeFanoutMargin = distance.refine((value) => value >= 0, {
|
|
17224
17264
|
message: "Fanout margin cannot be negative"
|
|
17225
17265
|
});
|
|
17226
17266
|
var breakoutProps = subcircuitGroupProps.extend({
|
|
17227
17267
|
autorouter: autorouterProp.default("fanout"),
|
|
17228
|
-
pcbTracePaths:
|
|
17268
|
+
pcbTracePaths: z58.array(fanoutTracePath).optional(),
|
|
17229
17269
|
padding: distance.optional(),
|
|
17230
17270
|
paddingLeft: distance.optional(),
|
|
17231
17271
|
paddingRight: distance.optional(),
|
|
@@ -17239,41 +17279,41 @@ expectTypesMatch(true);
|
|
|
17239
17279
|
// lib/components/chip.ts
|
|
17240
17280
|
import { distance as distance12, supplier_name as supplier_name2 } from "circuit-json";
|
|
17241
17281
|
import { isValidElement as isValidElement2 } from "react";
|
|
17242
|
-
import { z as
|
|
17243
|
-
var connectionTarget2 =
|
|
17244
|
-
var noConnectProp =
|
|
17245
|
-
var connectionsProp =
|
|
17246
|
-
var spicemodelElement =
|
|
17282
|
+
import { z as z59 } from "zod";
|
|
17283
|
+
var connectionTarget2 = z59.string().or(z59.array(z59.string()).readonly()).or(z59.array(z59.string()));
|
|
17284
|
+
var noConnectProp = z59.array(schematicPinLabel).readonly().or(z59.array(schematicPinLabel));
|
|
17285
|
+
var connectionsProp = z59.custom().pipe(z59.record(z59.string(), connectionTarget2));
|
|
17286
|
+
var spicemodelElement = z59.custom(
|
|
17247
17287
|
(v) => !!v && typeof v === "object" && "type" in v && "props" in v
|
|
17248
17288
|
);
|
|
17249
|
-
var internalCircuitElement =
|
|
17289
|
+
var internalCircuitElement = z59.custom(
|
|
17250
17290
|
(value) => isValidElement2(value) && value.type === "internalcircuit"
|
|
17251
17291
|
);
|
|
17252
|
-
var pinLabelsProp =
|
|
17292
|
+
var pinLabelsProp = z59.record(
|
|
17253
17293
|
schematicPinLabel,
|
|
17254
|
-
schematicPinLabel.or(
|
|
17294
|
+
schematicPinLabel.or(z59.array(schematicPinLabel).readonly()).or(z59.array(schematicPinLabel))
|
|
17255
17295
|
);
|
|
17256
17296
|
expectTypesMatch(true);
|
|
17257
|
-
var pinCompatibleVariant =
|
|
17258
|
-
manufacturerPartNumber:
|
|
17259
|
-
supplierPartNumber:
|
|
17297
|
+
var pinCompatibleVariant = z59.object({
|
|
17298
|
+
manufacturerPartNumber: z59.string().optional(),
|
|
17299
|
+
supplierPartNumber: z59.record(supplier_name2, z59.array(z59.string())).optional()
|
|
17260
17300
|
});
|
|
17261
17301
|
var chipProps = commonComponentProps.extend({
|
|
17262
|
-
manufacturerPartNumber:
|
|
17302
|
+
manufacturerPartNumber: z59.string().optional(),
|
|
17263
17303
|
pinLabels: pinLabelsProp.optional(),
|
|
17264
|
-
showPinAliases:
|
|
17265
|
-
pcbPinLabels:
|
|
17266
|
-
internallyConnectedPins:
|
|
17267
|
-
externallyConnectedPins:
|
|
17304
|
+
showPinAliases: z59.boolean().optional(),
|
|
17305
|
+
pcbPinLabels: z59.record(z59.string(), z59.string()).optional(),
|
|
17306
|
+
internallyConnectedPins: z59.array(z59.array(z59.union([z59.string(), z59.number()]))).optional(),
|
|
17307
|
+
externallyConnectedPins: z59.array(z59.array(z59.string())).optional(),
|
|
17268
17308
|
schPinArrangement: schematicPortArrangement.optional(),
|
|
17269
17309
|
schPortArrangement: schematicPortArrangement.optional(),
|
|
17270
|
-
pinCompatibleVariants:
|
|
17310
|
+
pinCompatibleVariants: z59.array(pinCompatibleVariant).optional(),
|
|
17271
17311
|
schPinStyle: schematicPinStyle.optional(),
|
|
17272
17312
|
schPinSpacing: distance12.optional(),
|
|
17273
17313
|
schWidth: distance12.optional(),
|
|
17274
17314
|
schHeight: distance12.optional(),
|
|
17275
|
-
noSchematicRepresentation:
|
|
17276
|
-
schShowInternalCircuit:
|
|
17315
|
+
noSchematicRepresentation: z59.boolean().optional(),
|
|
17316
|
+
schShowInternalCircuit: z59.boolean().optional().default(false),
|
|
17277
17317
|
noConnect: noConnectProp.optional(),
|
|
17278
17318
|
connections: connectionsProp.optional(),
|
|
17279
17319
|
spiceModel: spicemodelElement.optional(),
|
|
@@ -17288,38 +17328,38 @@ expectTypesMatch(true);
|
|
|
17288
17328
|
|
|
17289
17329
|
// lib/components/jumper.ts
|
|
17290
17330
|
import { distance as distance13 } from "circuit-json";
|
|
17291
|
-
import { z as
|
|
17331
|
+
import { z as z60 } from "zod";
|
|
17292
17332
|
var jumperProps = commonComponentProps.extend({
|
|
17293
|
-
manufacturerPartNumber:
|
|
17294
|
-
pinLabels:
|
|
17295
|
-
|
|
17296
|
-
schematicPinLabel.or(
|
|
17333
|
+
manufacturerPartNumber: z60.string().optional(),
|
|
17334
|
+
pinLabels: z60.record(
|
|
17335
|
+
z60.number().or(schematicPinLabel),
|
|
17336
|
+
schematicPinLabel.or(z60.array(schematicPinLabel))
|
|
17297
17337
|
).optional(),
|
|
17298
17338
|
schPinStyle: schematicPinStyle.optional(),
|
|
17299
17339
|
schPinSpacing: distance13.optional(),
|
|
17300
17340
|
schWidth: distance13.optional(),
|
|
17301
17341
|
schHeight: distance13.optional(),
|
|
17302
|
-
schDirection:
|
|
17342
|
+
schDirection: z60.enum(["left", "right"]).optional(),
|
|
17303
17343
|
schPinArrangement: schematicPinArrangement.optional(),
|
|
17304
17344
|
schPortArrangement: schematicPortArrangement.optional(),
|
|
17305
|
-
pcbPinLabels:
|
|
17306
|
-
pinCount:
|
|
17307
|
-
internallyConnectedPins:
|
|
17308
|
-
connections:
|
|
17345
|
+
pcbPinLabels: z60.record(z60.string(), z60.string()).optional(),
|
|
17346
|
+
pinCount: z60.union([z60.literal(2), z60.literal(3)]).optional(),
|
|
17347
|
+
internallyConnectedPins: z60.array(z60.array(z60.union([z60.string(), z60.number()]))).optional(),
|
|
17348
|
+
connections: z60.custom().pipe(z60.record(z60.string(), connectionTarget)).optional()
|
|
17309
17349
|
});
|
|
17310
17350
|
expectTypesMatch(true);
|
|
17311
17351
|
|
|
17312
17352
|
// lib/components/solderjumper.ts
|
|
17313
|
-
import { z as
|
|
17353
|
+
import { z as z61 } from "zod";
|
|
17314
17354
|
var solderjumperProps = jumperProps.extend({
|
|
17315
|
-
bridgedPins:
|
|
17316
|
-
bridged:
|
|
17355
|
+
bridgedPins: z61.array(z61.array(z61.string())).optional(),
|
|
17356
|
+
bridged: z61.boolean().optional()
|
|
17317
17357
|
});
|
|
17318
17358
|
expectTypesMatch(true);
|
|
17319
17359
|
|
|
17320
17360
|
// lib/components/connector.ts
|
|
17321
|
-
import { z as
|
|
17322
|
-
var connectorStandard =
|
|
17361
|
+
import { z as z62 } from "zod";
|
|
17362
|
+
var connectorStandard = z62.enum([
|
|
17323
17363
|
"usb_c",
|
|
17324
17364
|
"m2",
|
|
17325
17365
|
"jst_sh",
|
|
@@ -17331,43 +17371,43 @@ var connectorStandard = z61.enum([
|
|
|
17331
17371
|
]);
|
|
17332
17372
|
var connectorProps = chipProps.extend({
|
|
17333
17373
|
standard: connectorStandard.optional(),
|
|
17334
|
-
pinCount:
|
|
17374
|
+
pinCount: z62.number().int().positive().optional()
|
|
17335
17375
|
});
|
|
17336
17376
|
expectTypesMatch(true);
|
|
17337
17377
|
|
|
17338
17378
|
// lib/components/interconnect.ts
|
|
17339
|
-
import { z as
|
|
17379
|
+
import { z as z63 } from "zod";
|
|
17340
17380
|
var interconnectProps = commonComponentProps.extend({
|
|
17341
|
-
standard:
|
|
17342
|
-
pinLabels:
|
|
17343
|
-
|
|
17344
|
-
schematicPinLabel.or(
|
|
17381
|
+
standard: z63.enum(["TSC0001_36P_XALT_2025_11", "0805", "0603", "1206"]).optional(),
|
|
17382
|
+
pinLabels: z63.record(
|
|
17383
|
+
z63.number().or(schematicPinLabel),
|
|
17384
|
+
schematicPinLabel.or(z63.array(schematicPinLabel))
|
|
17345
17385
|
).optional(),
|
|
17346
|
-
internallyConnectedPins:
|
|
17386
|
+
internallyConnectedPins: z63.array(z63.array(z63.union([z63.string(), z63.number()]))).optional()
|
|
17347
17387
|
});
|
|
17348
17388
|
expectTypesMatch(true);
|
|
17349
17389
|
|
|
17350
17390
|
// lib/components/fuse.ts
|
|
17351
|
-
import { z as
|
|
17391
|
+
import { z as z64 } from "zod";
|
|
17352
17392
|
var fusePinLabels = ["pin1", "pin2"];
|
|
17353
17393
|
var fuseProps = commonComponentProps.extend({
|
|
17354
|
-
currentRating:
|
|
17355
|
-
voltageRating:
|
|
17356
|
-
schShowRatings:
|
|
17394
|
+
currentRating: z64.union([z64.number(), z64.string()]),
|
|
17395
|
+
voltageRating: z64.union([z64.number(), z64.string()]).optional(),
|
|
17396
|
+
schShowRatings: z64.boolean().optional(),
|
|
17357
17397
|
schOrientation: schematicOrientation.optional(),
|
|
17358
|
-
connections:
|
|
17359
|
-
|
|
17360
|
-
|
|
17361
|
-
|
|
17362
|
-
|
|
17363
|
-
|
|
17398
|
+
connections: z64.record(
|
|
17399
|
+
z64.string(),
|
|
17400
|
+
z64.union([
|
|
17401
|
+
z64.string(),
|
|
17402
|
+
z64.array(z64.string()).readonly(),
|
|
17403
|
+
z64.array(z64.string())
|
|
17364
17404
|
])
|
|
17365
17405
|
).optional()
|
|
17366
17406
|
});
|
|
17367
17407
|
|
|
17368
17408
|
// lib/components/platedhole.ts
|
|
17369
17409
|
import { distance as distance14 } from "circuit-json";
|
|
17370
|
-
import { z as
|
|
17410
|
+
import { z as z65 } from "zod";
|
|
17371
17411
|
var DEFAULT_PIN_HEADER_HOLE_DIAMETER = "0.04in";
|
|
17372
17412
|
var DEFAULT_PIN_HEADER_OUTER_DIAMETER = "0.1in";
|
|
17373
17413
|
var inferPlatedHoleShapeAndDefaults = (rawProps) => {
|
|
@@ -17399,26 +17439,26 @@ var inferPlatedHoleShapeAndDefaults = (rawProps) => {
|
|
|
17399
17439
|
props.outerDiameter = DEFAULT_PIN_HEADER_OUTER_DIAMETER;
|
|
17400
17440
|
return props;
|
|
17401
17441
|
};
|
|
17402
|
-
var distanceHiddenUndefined =
|
|
17442
|
+
var distanceHiddenUndefined = z65.custom().transform((a) => {
|
|
17403
17443
|
if (a === void 0) return void 0;
|
|
17404
17444
|
return distance14.parse(a);
|
|
17405
17445
|
});
|
|
17406
|
-
var platedHolePropsByShape =
|
|
17446
|
+
var platedHolePropsByShape = z65.discriminatedUnion("shape", [
|
|
17407
17447
|
pcbLayoutProps.omit({ pcbRotation: true, layer: true }).extend({
|
|
17408
|
-
name:
|
|
17409
|
-
connectsTo:
|
|
17410
|
-
shape:
|
|
17448
|
+
name: z65.string().optional(),
|
|
17449
|
+
connectsTo: z65.string().or(z65.array(z65.string())).optional(),
|
|
17450
|
+
shape: z65.literal("circle"),
|
|
17411
17451
|
holeDiameter: distance14,
|
|
17412
17452
|
outerDiameter: distance14,
|
|
17413
17453
|
padDiameter: distance14.optional().describe("Diameter of the copper pad"),
|
|
17414
17454
|
portHints: portHints.optional(),
|
|
17415
17455
|
solderMaskMargin: distance14.optional(),
|
|
17416
|
-
coveredWithSolderMask:
|
|
17456
|
+
coveredWithSolderMask: z65.boolean().optional()
|
|
17417
17457
|
}),
|
|
17418
17458
|
pcbLayoutProps.omit({ layer: true }).extend({
|
|
17419
|
-
name:
|
|
17420
|
-
connectsTo:
|
|
17421
|
-
shape:
|
|
17459
|
+
name: z65.string().optional(),
|
|
17460
|
+
connectsTo: z65.string().or(z65.array(z65.string())).optional(),
|
|
17461
|
+
shape: z65.literal("oval"),
|
|
17422
17462
|
outerWidth: distance14,
|
|
17423
17463
|
outerHeight: distance14,
|
|
17424
17464
|
holeWidth: distanceHiddenUndefined,
|
|
@@ -17427,13 +17467,13 @@ var platedHolePropsByShape = z64.discriminatedUnion("shape", [
|
|
|
17427
17467
|
innerHeight: distance14.optional().describe("DEPRECATED use holeHeight"),
|
|
17428
17468
|
portHints: portHints.optional(),
|
|
17429
17469
|
solderMaskMargin: distance14.optional(),
|
|
17430
|
-
coveredWithSolderMask:
|
|
17470
|
+
coveredWithSolderMask: z65.boolean().optional()
|
|
17431
17471
|
}),
|
|
17432
17472
|
pcbLayoutProps.omit({ layer: true }).extend({
|
|
17433
|
-
name:
|
|
17434
|
-
connectsTo:
|
|
17435
|
-
shape:
|
|
17436
|
-
rectPad:
|
|
17473
|
+
name: z65.string().optional(),
|
|
17474
|
+
connectsTo: z65.string().or(z65.array(z65.string())).optional(),
|
|
17475
|
+
shape: z65.literal("pill"),
|
|
17476
|
+
rectPad: z65.boolean().optional(),
|
|
17437
17477
|
outerWidth: distance14,
|
|
17438
17478
|
outerHeight: distance14,
|
|
17439
17479
|
holeWidth: distanceHiddenUndefined,
|
|
@@ -17444,30 +17484,30 @@ var platedHolePropsByShape = z64.discriminatedUnion("shape", [
|
|
|
17444
17484
|
holeOffsetX: distance14.optional(),
|
|
17445
17485
|
holeOffsetY: distance14.optional(),
|
|
17446
17486
|
solderMaskMargin: distance14.optional(),
|
|
17447
|
-
coveredWithSolderMask:
|
|
17487
|
+
coveredWithSolderMask: z65.boolean().optional()
|
|
17448
17488
|
}),
|
|
17449
17489
|
pcbLayoutProps.omit({ layer: true }).extend({
|
|
17450
|
-
name:
|
|
17451
|
-
connectsTo:
|
|
17452
|
-
shape:
|
|
17490
|
+
name: z65.string().optional(),
|
|
17491
|
+
connectsTo: z65.string().or(z65.array(z65.string())).optional(),
|
|
17492
|
+
shape: z65.literal("circular_hole_with_rect_pad"),
|
|
17453
17493
|
holeDiameter: distance14,
|
|
17454
17494
|
rectPadWidth: distance14,
|
|
17455
17495
|
rectPadHeight: distance14,
|
|
17456
17496
|
rectBorderRadius: distance14.optional(),
|
|
17457
|
-
holeShape:
|
|
17458
|
-
padShape:
|
|
17497
|
+
holeShape: z65.literal("circle").optional(),
|
|
17498
|
+
padShape: z65.literal("rect").optional(),
|
|
17459
17499
|
portHints: portHints.optional(),
|
|
17460
17500
|
holeOffsetX: distance14.optional(),
|
|
17461
17501
|
holeOffsetY: distance14.optional(),
|
|
17462
17502
|
solderMaskMargin: distance14.optional(),
|
|
17463
|
-
coveredWithSolderMask:
|
|
17503
|
+
coveredWithSolderMask: z65.boolean().optional()
|
|
17464
17504
|
}),
|
|
17465
17505
|
pcbLayoutProps.omit({ layer: true }).extend({
|
|
17466
|
-
name:
|
|
17467
|
-
connectsTo:
|
|
17468
|
-
shape:
|
|
17469
|
-
holeShape:
|
|
17470
|
-
padShape:
|
|
17506
|
+
name: z65.string().optional(),
|
|
17507
|
+
connectsTo: z65.string().or(z65.array(z65.string())).optional(),
|
|
17508
|
+
shape: z65.literal("pill_hole_with_rect_pad"),
|
|
17509
|
+
holeShape: z65.literal("pill").optional(),
|
|
17510
|
+
padShape: z65.literal("rect").optional(),
|
|
17471
17511
|
holeWidth: distance14,
|
|
17472
17512
|
holeHeight: distance14,
|
|
17473
17513
|
rectPadWidth: distance14,
|
|
@@ -17477,22 +17517,22 @@ var platedHolePropsByShape = z64.discriminatedUnion("shape", [
|
|
|
17477
17517
|
holeOffsetX: distance14.optional(),
|
|
17478
17518
|
holeOffsetY: distance14.optional(),
|
|
17479
17519
|
solderMaskMargin: distance14.optional(),
|
|
17480
|
-
coveredWithSolderMask:
|
|
17520
|
+
coveredWithSolderMask: z65.boolean().optional()
|
|
17481
17521
|
}),
|
|
17482
17522
|
pcbLayoutProps.omit({ pcbRotation: true, layer: true }).extend({
|
|
17483
|
-
name:
|
|
17484
|
-
connectsTo:
|
|
17485
|
-
shape:
|
|
17486
|
-
holeShape:
|
|
17523
|
+
name: z65.string().optional(),
|
|
17524
|
+
connectsTo: z65.string().or(z65.array(z65.string())).optional(),
|
|
17525
|
+
shape: z65.literal("hole_with_polygon_pad"),
|
|
17526
|
+
holeShape: z65.enum(["circle", "oval", "pill", "rotated_pill"]),
|
|
17487
17527
|
holeDiameter: distance14.optional(),
|
|
17488
17528
|
holeWidth: distance14.optional(),
|
|
17489
17529
|
holeHeight: distance14.optional(),
|
|
17490
|
-
padOutline:
|
|
17530
|
+
padOutline: z65.array(point),
|
|
17491
17531
|
holeOffsetX: distance14,
|
|
17492
17532
|
holeOffsetY: distance14,
|
|
17493
17533
|
portHints: portHints.optional(),
|
|
17494
17534
|
solderMaskMargin: distance14.optional(),
|
|
17495
|
-
coveredWithSolderMask:
|
|
17535
|
+
coveredWithSolderMask: z65.boolean().optional()
|
|
17496
17536
|
})
|
|
17497
17537
|
]).transform((a) => {
|
|
17498
17538
|
if ("innerWidth" in a && a.innerWidth !== void 0) {
|
|
@@ -17503,7 +17543,7 @@ var platedHolePropsByShape = z64.discriminatedUnion("shape", [
|
|
|
17503
17543
|
}
|
|
17504
17544
|
return a;
|
|
17505
17545
|
});
|
|
17506
|
-
var platedHoleProps =
|
|
17546
|
+
var platedHoleProps = z65.preprocess(
|
|
17507
17547
|
inferPlatedHoleShapeAndDefaults,
|
|
17508
17548
|
platedHolePropsByShape
|
|
17509
17549
|
);
|
|
@@ -17511,7 +17551,7 @@ expectTypesMatch(true);
|
|
|
17511
17551
|
|
|
17512
17552
|
// lib/components/resistor.ts
|
|
17513
17553
|
import { resistance } from "circuit-json";
|
|
17514
|
-
import { z as
|
|
17554
|
+
import { z as z66 } from "zod";
|
|
17515
17555
|
var resistorPinLabels = ["pin1", "pin2", "pos", "neg"];
|
|
17516
17556
|
var resistorImperialFootprintNames = /* @__PURE__ */ new Set([
|
|
17517
17557
|
"01005",
|
|
@@ -17535,7 +17575,7 @@ var resistorFootprintProp = footprintProp.optional().transform(mapResistorFootpr
|
|
|
17535
17575
|
var resistorProps = commonComponentProps.extend({
|
|
17536
17576
|
footprint: resistorFootprintProp,
|
|
17537
17577
|
resistance,
|
|
17538
|
-
tolerance:
|
|
17578
|
+
tolerance: z66.union([z66.string(), z66.number()]).transform((val) => {
|
|
17539
17579
|
if (typeof val === "string") {
|
|
17540
17580
|
if (val.endsWith("%")) {
|
|
17541
17581
|
return parseFloat(val.slice(0, -1)) / 100;
|
|
@@ -17544,12 +17584,12 @@ var resistorProps = commonComponentProps.extend({
|
|
|
17544
17584
|
}
|
|
17545
17585
|
return val;
|
|
17546
17586
|
}).pipe(
|
|
17547
|
-
|
|
17587
|
+
z66.number().min(0, "Tolerance must be non-negative").max(1, "Tolerance cannot be greater than 100%")
|
|
17548
17588
|
).optional(),
|
|
17549
|
-
pullupFor:
|
|
17550
|
-
pullupTo:
|
|
17551
|
-
pulldownFor:
|
|
17552
|
-
pulldownTo:
|
|
17589
|
+
pullupFor: z66.string().optional(),
|
|
17590
|
+
pullupTo: z66.string().optional(),
|
|
17591
|
+
pulldownFor: z66.string().optional(),
|
|
17592
|
+
pulldownTo: z66.string().optional(),
|
|
17553
17593
|
schOrientation: schematicOrientation.optional(),
|
|
17554
17594
|
schSize: schematicSymbolSize.optional(),
|
|
17555
17595
|
connections: createConnectionsProp(resistorPinLabels).optional()
|
|
@@ -17559,18 +17599,18 @@ expectTypesMatch(true);
|
|
|
17559
17599
|
|
|
17560
17600
|
// lib/components/potentiometer.ts
|
|
17561
17601
|
import { resistance as resistance2 } from "circuit-json";
|
|
17562
|
-
import { z as
|
|
17602
|
+
import { z as z67 } from "zod";
|
|
17563
17603
|
var potentiometerPinLabels = ["pin1", "pin2", "pin3"];
|
|
17564
17604
|
var potentiometerProps = commonComponentProps.extend({
|
|
17565
17605
|
maxResistance: resistance2,
|
|
17566
|
-
pinVariant:
|
|
17606
|
+
pinVariant: z67.enum(["two_pin", "three_pin"]).optional(),
|
|
17567
17607
|
connections: createConnectionsProp(potentiometerPinLabels).optional()
|
|
17568
17608
|
});
|
|
17569
17609
|
expectTypesMatch(true);
|
|
17570
17610
|
|
|
17571
17611
|
// lib/components/crystal.ts
|
|
17572
17612
|
import { capacitance, distance as distance15, frequency } from "circuit-json";
|
|
17573
|
-
import { z as
|
|
17613
|
+
import { z as z68 } from "zod";
|
|
17574
17614
|
var crystalPins = [
|
|
17575
17615
|
"pin1",
|
|
17576
17616
|
"left",
|
|
@@ -17583,8 +17623,8 @@ var crystalProps = commonComponentProps.extend({
|
|
|
17583
17623
|
frequency,
|
|
17584
17624
|
loadCapacitance: capacitance,
|
|
17585
17625
|
maxTraceLength: distance15.optional(),
|
|
17586
|
-
manufacturerPartNumber:
|
|
17587
|
-
pinVariant:
|
|
17626
|
+
manufacturerPartNumber: z68.string().optional(),
|
|
17627
|
+
pinVariant: z68.enum(["two_pin", "four_pin"]).optional(),
|
|
17588
17628
|
schOrientation: schematicOrientation.optional(),
|
|
17589
17629
|
connections: createConnectionsProp(crystalPins).optional()
|
|
17590
17630
|
});
|
|
@@ -17592,34 +17632,34 @@ expectTypesMatch(true);
|
|
|
17592
17632
|
|
|
17593
17633
|
// lib/components/resonator.ts
|
|
17594
17634
|
import { frequency as frequency2, capacitance as capacitance2 } from "circuit-json";
|
|
17595
|
-
import { z as
|
|
17635
|
+
import { z as z69 } from "zod";
|
|
17596
17636
|
var resonatorProps = commonComponentProps.extend({
|
|
17597
17637
|
frequency: frequency2,
|
|
17598
17638
|
loadCapacitance: capacitance2,
|
|
17599
|
-
pinVariant:
|
|
17639
|
+
pinVariant: z69.enum(["no_ground", "ground_pin", "two_ground_pins"]).optional()
|
|
17600
17640
|
});
|
|
17601
17641
|
expectTypesMatch(true);
|
|
17602
17642
|
|
|
17603
17643
|
// lib/components/stampboard.ts
|
|
17604
17644
|
import { distance as distance16 } from "circuit-json";
|
|
17605
|
-
import { z as
|
|
17645
|
+
import { z as z70 } from "zod";
|
|
17606
17646
|
var stampboardProps = boardProps.extend({
|
|
17607
|
-
leftPinCount:
|
|
17608
|
-
rightPinCount:
|
|
17609
|
-
topPinCount:
|
|
17610
|
-
bottomPinCount:
|
|
17611
|
-
leftPins:
|
|
17612
|
-
rightPins:
|
|
17613
|
-
topPins:
|
|
17614
|
-
bottomPins:
|
|
17647
|
+
leftPinCount: z70.number().optional(),
|
|
17648
|
+
rightPinCount: z70.number().optional(),
|
|
17649
|
+
topPinCount: z70.number().optional(),
|
|
17650
|
+
bottomPinCount: z70.number().optional(),
|
|
17651
|
+
leftPins: z70.array(z70.string()).optional(),
|
|
17652
|
+
rightPins: z70.array(z70.string()).optional(),
|
|
17653
|
+
topPins: z70.array(z70.string()).optional(),
|
|
17654
|
+
bottomPins: z70.array(z70.string()).optional(),
|
|
17615
17655
|
pinPitch: distance16.optional(),
|
|
17616
|
-
innerHoles:
|
|
17656
|
+
innerHoles: z70.boolean().optional()
|
|
17617
17657
|
});
|
|
17618
17658
|
expectTypesMatch(true);
|
|
17619
17659
|
|
|
17620
17660
|
// lib/components/capacitor.ts
|
|
17621
17661
|
import { capacitance as capacitance3, distance as distance17, voltage } from "circuit-json";
|
|
17622
|
-
import { z as
|
|
17662
|
+
import { z as z71 } from "zod";
|
|
17623
17663
|
var capacitorPinLabels = [
|
|
17624
17664
|
"pin1",
|
|
17625
17665
|
"pin2",
|
|
@@ -17631,12 +17671,12 @@ var capacitorPinLabels = [
|
|
|
17631
17671
|
var capacitorProps = commonComponentProps.extend({
|
|
17632
17672
|
capacitance: capacitance3,
|
|
17633
17673
|
maxVoltageRating: voltage.optional(),
|
|
17634
|
-
schShowRatings:
|
|
17635
|
-
polarized:
|
|
17636
|
-
decouplingFor:
|
|
17637
|
-
decouplingTo:
|
|
17638
|
-
bypassFor:
|
|
17639
|
-
bypassTo:
|
|
17674
|
+
schShowRatings: z71.boolean().optional().default(false),
|
|
17675
|
+
polarized: z71.boolean().optional().default(false),
|
|
17676
|
+
decouplingFor: z71.string().optional(),
|
|
17677
|
+
decouplingTo: z71.string().optional(),
|
|
17678
|
+
bypassFor: z71.string().optional(),
|
|
17679
|
+
bypassTo: z71.string().optional(),
|
|
17640
17680
|
maxDecouplingTraceLength: distance17.optional(),
|
|
17641
17681
|
schOrientation: schematicOrientation.optional(),
|
|
17642
17682
|
schSize: schematicSymbolSize.optional(),
|
|
@@ -17647,14 +17687,14 @@ expectTypesMatch(true);
|
|
|
17647
17687
|
|
|
17648
17688
|
// lib/components/net.ts
|
|
17649
17689
|
import { distance as distance18 } from "circuit-json";
|
|
17650
|
-
import { z as
|
|
17651
|
-
var netProps =
|
|
17652
|
-
name:
|
|
17653
|
-
connectsTo:
|
|
17654
|
-
routingPhaseIndex:
|
|
17655
|
-
highlightColor:
|
|
17656
|
-
isPowerNet:
|
|
17657
|
-
isGroundNet:
|
|
17690
|
+
import { z as z72 } from "zod";
|
|
17691
|
+
var netProps = z72.object({
|
|
17692
|
+
name: z72.string(),
|
|
17693
|
+
connectsTo: z72.string().or(z72.array(z72.string())).optional(),
|
|
17694
|
+
routingPhaseIndex: z72.number().nullable().optional(),
|
|
17695
|
+
highlightColor: z72.string().optional(),
|
|
17696
|
+
isPowerNet: z72.boolean().optional(),
|
|
17697
|
+
isGroundNet: z72.boolean().optional(),
|
|
17658
17698
|
nominalTraceWidth: distance18.optional()
|
|
17659
17699
|
});
|
|
17660
17700
|
expectTypesMatch(true);
|
|
@@ -17668,55 +17708,55 @@ var fiducialProps = commonComponentProps.extend({
|
|
|
17668
17708
|
expectTypesMatch(true);
|
|
17669
17709
|
|
|
17670
17710
|
// lib/components/constrainedlayout.ts
|
|
17671
|
-
import { z as
|
|
17672
|
-
var constrainedLayoutProps =
|
|
17673
|
-
name:
|
|
17674
|
-
pcbOnly:
|
|
17675
|
-
schOnly:
|
|
17711
|
+
import { z as z74 } from "zod";
|
|
17712
|
+
var constrainedLayoutProps = z74.object({
|
|
17713
|
+
name: z74.string().optional(),
|
|
17714
|
+
pcbOnly: z74.boolean().optional(),
|
|
17715
|
+
schOnly: z74.boolean().optional()
|
|
17676
17716
|
});
|
|
17677
17717
|
expectTypesMatch(true);
|
|
17678
17718
|
|
|
17679
17719
|
// lib/components/constraint.ts
|
|
17680
|
-
import { z as
|
|
17681
|
-
var pcbXDistConstraintProps =
|
|
17682
|
-
pcb:
|
|
17720
|
+
import { z as z75 } from "zod";
|
|
17721
|
+
var pcbXDistConstraintProps = z75.object({
|
|
17722
|
+
pcb: z75.literal(true).optional(),
|
|
17683
17723
|
xDist: distance,
|
|
17684
|
-
left:
|
|
17685
|
-
right:
|
|
17686
|
-
edgeToEdge:
|
|
17687
|
-
centerToCenter:
|
|
17724
|
+
left: z75.string(),
|
|
17725
|
+
right: z75.string(),
|
|
17726
|
+
edgeToEdge: z75.literal(true).optional(),
|
|
17727
|
+
centerToCenter: z75.literal(true).optional()
|
|
17688
17728
|
});
|
|
17689
17729
|
expectTypesMatch(
|
|
17690
17730
|
true
|
|
17691
17731
|
);
|
|
17692
|
-
var pcbYDistConstraintProps =
|
|
17693
|
-
pcb:
|
|
17732
|
+
var pcbYDistConstraintProps = z75.object({
|
|
17733
|
+
pcb: z75.literal(true).optional(),
|
|
17694
17734
|
yDist: distance,
|
|
17695
|
-
top:
|
|
17696
|
-
bottom:
|
|
17697
|
-
edgeToEdge:
|
|
17698
|
-
centerToCenter:
|
|
17735
|
+
top: z75.string(),
|
|
17736
|
+
bottom: z75.string(),
|
|
17737
|
+
edgeToEdge: z75.literal(true).optional(),
|
|
17738
|
+
centerToCenter: z75.literal(true).optional()
|
|
17699
17739
|
});
|
|
17700
17740
|
expectTypesMatch(
|
|
17701
17741
|
true
|
|
17702
17742
|
);
|
|
17703
|
-
var pcbSameYConstraintProps =
|
|
17704
|
-
pcb:
|
|
17705
|
-
sameY:
|
|
17706
|
-
for:
|
|
17743
|
+
var pcbSameYConstraintProps = z75.object({
|
|
17744
|
+
pcb: z75.literal(true).optional(),
|
|
17745
|
+
sameY: z75.literal(true).optional(),
|
|
17746
|
+
for: z75.array(z75.string())
|
|
17707
17747
|
});
|
|
17708
17748
|
expectTypesMatch(
|
|
17709
17749
|
true
|
|
17710
17750
|
);
|
|
17711
|
-
var pcbSameXConstraintProps =
|
|
17712
|
-
pcb:
|
|
17713
|
-
sameX:
|
|
17714
|
-
for:
|
|
17751
|
+
var pcbSameXConstraintProps = z75.object({
|
|
17752
|
+
pcb: z75.literal(true).optional(),
|
|
17753
|
+
sameX: z75.literal(true).optional(),
|
|
17754
|
+
for: z75.array(z75.string())
|
|
17715
17755
|
});
|
|
17716
17756
|
expectTypesMatch(
|
|
17717
17757
|
true
|
|
17718
17758
|
);
|
|
17719
|
-
var constraintProps =
|
|
17759
|
+
var constraintProps = z75.union([
|
|
17720
17760
|
pcbXDistConstraintProps,
|
|
17721
17761
|
pcbYDistConstraintProps,
|
|
17722
17762
|
pcbSameYConstraintProps,
|
|
@@ -17725,13 +17765,13 @@ var constraintProps = z74.union([
|
|
|
17725
17765
|
expectTypesMatch(true);
|
|
17726
17766
|
|
|
17727
17767
|
// lib/components/cutout.ts
|
|
17728
|
-
import { z as
|
|
17768
|
+
import { z as z76 } from "zod";
|
|
17729
17769
|
var rectCutoutProps = pcbLayoutProps.omit({
|
|
17730
17770
|
layer: true,
|
|
17731
17771
|
pcbRotation: true
|
|
17732
17772
|
}).extend({
|
|
17733
|
-
name:
|
|
17734
|
-
shape:
|
|
17773
|
+
name: z76.string().optional(),
|
|
17774
|
+
shape: z76.literal("rect"),
|
|
17735
17775
|
width: distance,
|
|
17736
17776
|
height: distance
|
|
17737
17777
|
});
|
|
@@ -17740,8 +17780,8 @@ var circleCutoutProps = pcbLayoutProps.omit({
|
|
|
17740
17780
|
layer: true,
|
|
17741
17781
|
pcbRotation: true
|
|
17742
17782
|
}).extend({
|
|
17743
|
-
name:
|
|
17744
|
-
shape:
|
|
17783
|
+
name: z76.string().optional(),
|
|
17784
|
+
shape: z76.literal("circle"),
|
|
17745
17785
|
radius: distance
|
|
17746
17786
|
});
|
|
17747
17787
|
expectTypesMatch(true);
|
|
@@ -17749,36 +17789,36 @@ var polygonCutoutProps = pcbLayoutProps.omit({
|
|
|
17749
17789
|
layer: true,
|
|
17750
17790
|
pcbRotation: true
|
|
17751
17791
|
}).extend({
|
|
17752
|
-
name:
|
|
17753
|
-
shape:
|
|
17754
|
-
points:
|
|
17792
|
+
name: z76.string().optional(),
|
|
17793
|
+
shape: z76.literal("polygon"),
|
|
17794
|
+
points: z76.array(point)
|
|
17755
17795
|
});
|
|
17756
17796
|
expectTypesMatch(true);
|
|
17757
|
-
var cutoutProps =
|
|
17797
|
+
var cutoutProps = z76.discriminatedUnion("shape", [
|
|
17758
17798
|
rectCutoutProps,
|
|
17759
17799
|
circleCutoutProps,
|
|
17760
17800
|
polygonCutoutProps
|
|
17761
17801
|
]);
|
|
17762
17802
|
|
|
17763
17803
|
// lib/components/drc-check.ts
|
|
17764
|
-
import { z as
|
|
17765
|
-
var drcCheckProps =
|
|
17766
|
-
name:
|
|
17804
|
+
import { z as z77 } from "zod";
|
|
17805
|
+
var drcCheckProps = z77.object({
|
|
17806
|
+
name: z77.string().optional(),
|
|
17767
17807
|
checkFn: customDrcCheckFn
|
|
17768
17808
|
});
|
|
17769
17809
|
expectTypesMatch(true);
|
|
17770
17810
|
|
|
17771
17811
|
// lib/components/smtpad.ts
|
|
17772
|
-
import { z as
|
|
17812
|
+
import { z as z78 } from "zod";
|
|
17773
17813
|
var rectSmtPadProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
17774
|
-
name:
|
|
17775
|
-
shape:
|
|
17814
|
+
name: z78.string().optional(),
|
|
17815
|
+
shape: z78.literal("rect"),
|
|
17776
17816
|
width: distance,
|
|
17777
17817
|
height: distance,
|
|
17778
17818
|
rectBorderRadius: distance.optional(),
|
|
17779
17819
|
cornerRadius: distance.optional(),
|
|
17780
17820
|
portHints: portHints.optional(),
|
|
17781
|
-
coveredWithSolderMask:
|
|
17821
|
+
coveredWithSolderMask: z78.boolean().optional(),
|
|
17782
17822
|
solderMaskMargin: distance.optional(),
|
|
17783
17823
|
solderMaskMarginLeft: distance.optional(),
|
|
17784
17824
|
solderMaskMarginRight: distance.optional(),
|
|
@@ -17788,14 +17828,14 @@ var rectSmtPadProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
|
17788
17828
|
});
|
|
17789
17829
|
expectTypesMatch(true);
|
|
17790
17830
|
var rotatedRectSmtPadProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
17791
|
-
name:
|
|
17792
|
-
shape:
|
|
17831
|
+
name: z78.string().optional(),
|
|
17832
|
+
shape: z78.literal("rotated_rect"),
|
|
17793
17833
|
width: distance,
|
|
17794
17834
|
height: distance,
|
|
17795
|
-
ccwRotation:
|
|
17835
|
+
ccwRotation: z78.number(),
|
|
17796
17836
|
cornerRadius: distance.optional(),
|
|
17797
17837
|
portHints: portHints.optional(),
|
|
17798
|
-
coveredWithSolderMask:
|
|
17838
|
+
coveredWithSolderMask: z78.boolean().optional(),
|
|
17799
17839
|
solderMaskMargin: distance.optional(),
|
|
17800
17840
|
solderMaskMarginLeft: distance.optional(),
|
|
17801
17841
|
solderMaskMarginRight: distance.optional(),
|
|
@@ -17805,51 +17845,51 @@ var rotatedRectSmtPadProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
|
17805
17845
|
});
|
|
17806
17846
|
expectTypesMatch(true);
|
|
17807
17847
|
var circleSmtPadProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
17808
|
-
name:
|
|
17809
|
-
shape:
|
|
17848
|
+
name: z78.string().optional(),
|
|
17849
|
+
shape: z78.literal("circle"),
|
|
17810
17850
|
radius: distance,
|
|
17811
17851
|
portHints: portHints.optional(),
|
|
17812
|
-
coveredWithSolderMask:
|
|
17852
|
+
coveredWithSolderMask: z78.boolean().optional(),
|
|
17813
17853
|
solderMaskMargin: distance.optional(),
|
|
17814
17854
|
solderPasteMargin: distance.optional()
|
|
17815
17855
|
});
|
|
17816
17856
|
expectTypesMatch(true);
|
|
17817
17857
|
var pillSmtPadProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
17818
|
-
name:
|
|
17819
|
-
shape:
|
|
17858
|
+
name: z78.string().optional(),
|
|
17859
|
+
shape: z78.literal("pill"),
|
|
17820
17860
|
width: distance,
|
|
17821
17861
|
height: distance,
|
|
17822
17862
|
radius: distance,
|
|
17823
17863
|
portHints: portHints.optional(),
|
|
17824
|
-
coveredWithSolderMask:
|
|
17864
|
+
coveredWithSolderMask: z78.boolean().optional(),
|
|
17825
17865
|
solderMaskMargin: distance.optional(),
|
|
17826
17866
|
solderPasteMargin: distance.optional()
|
|
17827
17867
|
});
|
|
17828
17868
|
expectTypesMatch(true);
|
|
17829
17869
|
var rotatedPillSmtPadProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
17830
|
-
name:
|
|
17831
|
-
shape:
|
|
17870
|
+
name: z78.string().optional(),
|
|
17871
|
+
shape: z78.literal("rotated_pill"),
|
|
17832
17872
|
width: distance,
|
|
17833
17873
|
height: distance,
|
|
17834
17874
|
radius: distance,
|
|
17835
|
-
ccwRotation:
|
|
17875
|
+
ccwRotation: z78.number(),
|
|
17836
17876
|
portHints: portHints.optional(),
|
|
17837
|
-
coveredWithSolderMask:
|
|
17877
|
+
coveredWithSolderMask: z78.boolean().optional(),
|
|
17838
17878
|
solderMaskMargin: distance.optional(),
|
|
17839
17879
|
solderPasteMargin: distance.optional()
|
|
17840
17880
|
});
|
|
17841
17881
|
expectTypesMatch(true);
|
|
17842
17882
|
var polygonSmtPadProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
17843
|
-
name:
|
|
17844
|
-
shape:
|
|
17845
|
-
points:
|
|
17883
|
+
name: z78.string().optional(),
|
|
17884
|
+
shape: z78.literal("polygon"),
|
|
17885
|
+
points: z78.array(point),
|
|
17846
17886
|
portHints: portHints.optional(),
|
|
17847
|
-
coveredWithSolderMask:
|
|
17887
|
+
coveredWithSolderMask: z78.boolean().optional(),
|
|
17848
17888
|
solderMaskMargin: distance.optional(),
|
|
17849
17889
|
solderPasteMargin: distance.optional()
|
|
17850
17890
|
});
|
|
17851
17891
|
expectTypesMatch(true);
|
|
17852
|
-
var smtPadProps =
|
|
17892
|
+
var smtPadProps = z78.discriminatedUnion("shape", [
|
|
17853
17893
|
circleSmtPadProps,
|
|
17854
17894
|
rectSmtPadProps,
|
|
17855
17895
|
rotatedRectSmtPadProps,
|
|
@@ -17860,63 +17900,63 @@ var smtPadProps = z77.discriminatedUnion("shape", [
|
|
|
17860
17900
|
expectTypesMatch(true);
|
|
17861
17901
|
|
|
17862
17902
|
// lib/components/solderpaste.ts
|
|
17863
|
-
import { z as
|
|
17903
|
+
import { z as z79 } from "zod";
|
|
17864
17904
|
var rectSolderPasteProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
17865
|
-
shape:
|
|
17905
|
+
shape: z79.literal("rect"),
|
|
17866
17906
|
width: distance,
|
|
17867
17907
|
height: distance
|
|
17868
17908
|
});
|
|
17869
17909
|
expectTypesMatch(true);
|
|
17870
17910
|
var circleSolderPasteProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
17871
|
-
shape:
|
|
17911
|
+
shape: z79.literal("circle"),
|
|
17872
17912
|
radius: distance
|
|
17873
17913
|
});
|
|
17874
17914
|
expectTypesMatch(true);
|
|
17875
|
-
var solderPasteProps =
|
|
17915
|
+
var solderPasteProps = z79.union([
|
|
17876
17916
|
circleSolderPasteProps,
|
|
17877
17917
|
rectSolderPasteProps
|
|
17878
17918
|
]);
|
|
17879
17919
|
expectTypesMatch(true);
|
|
17880
17920
|
|
|
17881
17921
|
// lib/components/hole.ts
|
|
17882
|
-
import { z as
|
|
17922
|
+
import { z as z80 } from "zod";
|
|
17883
17923
|
var circleHoleProps = pcbLayoutProps.extend({
|
|
17884
|
-
name:
|
|
17885
|
-
shape:
|
|
17924
|
+
name: z80.string().optional(),
|
|
17925
|
+
shape: z80.literal("circle").optional(),
|
|
17886
17926
|
diameter: distance.optional(),
|
|
17887
17927
|
radius: distance.optional(),
|
|
17888
17928
|
solderMaskMargin: distance.optional(),
|
|
17889
|
-
coveredWithSolderMask:
|
|
17929
|
+
coveredWithSolderMask: z80.boolean().optional()
|
|
17890
17930
|
}).transform((d) => ({
|
|
17891
17931
|
...d,
|
|
17892
17932
|
diameter: d.diameter ?? 2 * d.radius,
|
|
17893
17933
|
radius: d.radius ?? d.diameter / 2
|
|
17894
17934
|
}));
|
|
17895
17935
|
var pillHoleProps = pcbLayoutProps.extend({
|
|
17896
|
-
name:
|
|
17897
|
-
shape:
|
|
17936
|
+
name: z80.string().optional(),
|
|
17937
|
+
shape: z80.literal("pill"),
|
|
17898
17938
|
width: distance,
|
|
17899
17939
|
height: distance,
|
|
17900
17940
|
solderMaskMargin: distance.optional(),
|
|
17901
|
-
coveredWithSolderMask:
|
|
17941
|
+
coveredWithSolderMask: z80.boolean().optional()
|
|
17902
17942
|
});
|
|
17903
17943
|
var ovalHoleProps = pcbLayoutProps.extend({
|
|
17904
|
-
name:
|
|
17905
|
-
shape:
|
|
17944
|
+
name: z80.string().optional(),
|
|
17945
|
+
shape: z80.literal("oval"),
|
|
17906
17946
|
width: distance,
|
|
17907
17947
|
height: distance,
|
|
17908
17948
|
solderMaskMargin: distance.optional(),
|
|
17909
|
-
coveredWithSolderMask:
|
|
17949
|
+
coveredWithSolderMask: z80.boolean().optional()
|
|
17910
17950
|
});
|
|
17911
17951
|
var rectHoleProps = pcbLayoutProps.extend({
|
|
17912
|
-
name:
|
|
17913
|
-
shape:
|
|
17952
|
+
name: z80.string().optional(),
|
|
17953
|
+
shape: z80.literal("rect"),
|
|
17914
17954
|
width: distance,
|
|
17915
17955
|
height: distance,
|
|
17916
17956
|
solderMaskMargin: distance.optional(),
|
|
17917
|
-
coveredWithSolderMask:
|
|
17957
|
+
coveredWithSolderMask: z80.boolean().optional()
|
|
17918
17958
|
});
|
|
17919
|
-
var holeProps =
|
|
17959
|
+
var holeProps = z80.union([
|
|
17920
17960
|
circleHoleProps,
|
|
17921
17961
|
pillHoleProps,
|
|
17922
17962
|
ovalHoleProps,
|
|
@@ -17925,7 +17965,7 @@ var holeProps = z79.union([
|
|
|
17925
17965
|
expectTypesMatch(true);
|
|
17926
17966
|
|
|
17927
17967
|
// lib/components/antenna.ts
|
|
17928
|
-
import { z as
|
|
17968
|
+
import { z as z81 } from "zod";
|
|
17929
17969
|
var antennaShapes = [
|
|
17930
17970
|
"2.4ghz_quarter_wave_monopole",
|
|
17931
17971
|
"2.4ghz_meandered_monopole",
|
|
@@ -17933,7 +17973,7 @@ var antennaShapes = [
|
|
|
17933
17973
|
"2.4ghz_meandered_inverted_f",
|
|
17934
17974
|
"2.4ghz_folded_dipole"
|
|
17935
17975
|
];
|
|
17936
|
-
var antennaShape =
|
|
17976
|
+
var antennaShape = z81.enum(antennaShapes);
|
|
17937
17977
|
var antennaFrequencyBands = [
|
|
17938
17978
|
"2.4ghz",
|
|
17939
17979
|
"5ghz",
|
|
@@ -17941,7 +17981,7 @@ var antennaFrequencyBands = [
|
|
|
17941
17981
|
"dual_band_2.4ghz_5ghz",
|
|
17942
17982
|
"tri_band_2.4ghz_5ghz_6ghz"
|
|
17943
17983
|
];
|
|
17944
|
-
var antennaFrequencyBand =
|
|
17984
|
+
var antennaFrequencyBand = z81.enum(antennaFrequencyBands);
|
|
17945
17985
|
var antennaProps = commonComponentProps.extend({
|
|
17946
17986
|
antennaShape: antennaShape.optional(),
|
|
17947
17987
|
frequencyBand: antennaFrequencyBand.optional(),
|
|
@@ -17951,39 +17991,39 @@ expectTypesMatch(true);
|
|
|
17951
17991
|
|
|
17952
17992
|
// lib/components/trace.ts
|
|
17953
17993
|
import { distance as distance19, route_hint_point as route_hint_point2 } from "circuit-json";
|
|
17954
|
-
import { z as
|
|
17955
|
-
var portRef =
|
|
17956
|
-
|
|
17957
|
-
|
|
17994
|
+
import { z as z82 } from "zod";
|
|
17995
|
+
var portRef = z82.union([
|
|
17996
|
+
z82.string(),
|
|
17997
|
+
z82.custom(
|
|
17958
17998
|
(v) => typeof v === "object" && v !== null && "getPortSelector" in v && typeof v.getPortSelector === "function"
|
|
17959
17999
|
)
|
|
17960
18000
|
]);
|
|
17961
|
-
var baseTraceProps =
|
|
17962
|
-
key:
|
|
17963
|
-
name:
|
|
17964
|
-
displayName:
|
|
18001
|
+
var baseTraceProps = z82.object({
|
|
18002
|
+
key: z82.string().optional(),
|
|
18003
|
+
name: z82.string().optional(),
|
|
18004
|
+
displayName: z82.string().optional(),
|
|
17965
18005
|
thickness: distance19.optional(),
|
|
17966
18006
|
width: distance19.optional().describe("Alias for trace thickness"),
|
|
17967
|
-
schematicRouteHints:
|
|
17968
|
-
pcbRouteHints:
|
|
17969
|
-
pcbTeardrops:
|
|
17970
|
-
pcbTeardropStart:
|
|
17971
|
-
pcbTeardropEnd:
|
|
17972
|
-
pcbPathRelativeTo:
|
|
18007
|
+
schematicRouteHints: z82.array(point).optional(),
|
|
18008
|
+
pcbRouteHints: z82.array(route_hint_point2).optional(),
|
|
18009
|
+
pcbTeardrops: z82.boolean().optional().describe("Enable PCB trace teardrops."),
|
|
18010
|
+
pcbTeardropStart: z82.boolean().optional().describe("Teardrop at the start (from) of trace"),
|
|
18011
|
+
pcbTeardropEnd: z82.boolean().optional().describe("Teardrop at the end (to) of trace"),
|
|
18012
|
+
pcbPathRelativeTo: z82.string().optional(),
|
|
17973
18013
|
pcbPath: pcbPath.optional(),
|
|
17974
|
-
pcbPaths:
|
|
17975
|
-
routingPhaseIndex:
|
|
17976
|
-
pcbStraightLine:
|
|
17977
|
-
schDisplayLabel:
|
|
17978
|
-
schStroke:
|
|
17979
|
-
highlightColor:
|
|
18014
|
+
pcbPaths: z82.array(pcbPath).optional(),
|
|
18015
|
+
routingPhaseIndex: z82.number().nullable().optional(),
|
|
18016
|
+
pcbStraightLine: z82.boolean().optional().describe("Draw a straight pcb trace between the connected points"),
|
|
18017
|
+
schDisplayLabel: z82.string().optional(),
|
|
18018
|
+
schStroke: z82.string().optional(),
|
|
18019
|
+
highlightColor: z82.string().optional(),
|
|
17980
18020
|
maxLength: distance19.optional(),
|
|
17981
|
-
maxViaCount:
|
|
17982
|
-
connectsTo:
|
|
18021
|
+
maxViaCount: z82.number().int().nonnegative().optional().describe("Maximum number of vias allowed in the PCB trace route"),
|
|
18022
|
+
connectsTo: z82.string().or(z82.array(z82.string())).optional()
|
|
17983
18023
|
});
|
|
17984
|
-
var traceProps =
|
|
18024
|
+
var traceProps = z82.union([
|
|
17985
18025
|
baseTraceProps.extend({
|
|
17986
|
-
path:
|
|
18026
|
+
path: z82.array(portRef)
|
|
17987
18027
|
}),
|
|
17988
18028
|
baseTraceProps.extend({
|
|
17989
18029
|
from: portRef,
|
|
@@ -17997,29 +18037,29 @@ var traceProps = z81.union([
|
|
|
17997
18037
|
|
|
17998
18038
|
// lib/common/routeLength.ts
|
|
17999
18039
|
import { distance as distance20 } from "circuit-json";
|
|
18000
|
-
import { z as
|
|
18040
|
+
import { z as z83 } from "zod";
|
|
18001
18041
|
var nonnegativeRouteDistance = distance20.pipe(
|
|
18002
|
-
|
|
18042
|
+
z83.number().nonnegative().finite()
|
|
18003
18043
|
);
|
|
18004
|
-
var routeLength =
|
|
18044
|
+
var routeLength = z83.union([
|
|
18005
18045
|
nonnegativeRouteDistance,
|
|
18006
|
-
|
|
18007
|
-
reference:
|
|
18008
|
-
of:
|
|
18009
|
-
offset: distance20.pipe(
|
|
18046
|
+
z83.object({
|
|
18047
|
+
reference: z83.literal("longest_manhattan"),
|
|
18048
|
+
of: z83.array(z83.string().min(1)).min(1).optional(),
|
|
18049
|
+
offset: distance20.pipe(z83.number().finite()).optional()
|
|
18010
18050
|
}).strict()
|
|
18011
18051
|
]);
|
|
18012
18052
|
expectTypesMatch(true);
|
|
18013
18053
|
function validateRouteLengths(props, ctx) {
|
|
18014
18054
|
if (Boolean(props.targetLength !== void 0) !== Boolean(props.lengthTolerance !== void 0))
|
|
18015
18055
|
ctx.addIssue({
|
|
18016
|
-
code:
|
|
18056
|
+
code: z83.ZodIssueCode.custom,
|
|
18017
18057
|
path: ["lengthTolerance"],
|
|
18018
18058
|
message: "targetLength and lengthTolerance must be supplied together"
|
|
18019
18059
|
});
|
|
18020
18060
|
if (props.lengthMatchTo !== void 0 && props.maxLengthSkew === void 0)
|
|
18021
18061
|
ctx.addIssue({
|
|
18022
|
-
code:
|
|
18062
|
+
code: z83.ZodIssueCode.custom,
|
|
18023
18063
|
path: ["maxLengthSkew"],
|
|
18024
18064
|
message: "lengthMatchTo requires an explicit maxLengthSkew"
|
|
18025
18065
|
});
|
|
@@ -18035,61 +18075,61 @@ function validateRouteLengths(props, ctx) {
|
|
|
18035
18075
|
const target = props.targetLength === void 0 ? void 0 : comparable(props.targetLength);
|
|
18036
18076
|
if (min && max && min.basis === max.basis && min.amount > max.amount)
|
|
18037
18077
|
ctx.addIssue({
|
|
18038
|
-
code:
|
|
18078
|
+
code: z83.ZodIssueCode.custom,
|
|
18039
18079
|
path: ["maxLength"],
|
|
18040
18080
|
message: "maxLength cannot be below minLength for the same reference"
|
|
18041
18081
|
});
|
|
18042
18082
|
if (target && min && target.basis === min.basis && target.amount + (props.lengthTolerance ?? 0) < min.amount || target && max && target.basis === max.basis && target.amount - (props.lengthTolerance ?? 0) > max.amount)
|
|
18043
18083
|
ctx.addIssue({
|
|
18044
|
-
code:
|
|
18084
|
+
code: z83.ZodIssueCode.custom,
|
|
18045
18085
|
path: ["targetLength"],
|
|
18046
18086
|
message: "targetLength tolerance window does not intersect the declared length bounds"
|
|
18047
18087
|
});
|
|
18048
18088
|
}
|
|
18049
|
-
var lengthMatchTo =
|
|
18050
|
-
|
|
18051
|
-
|
|
18089
|
+
var lengthMatchTo = z83.union([
|
|
18090
|
+
z83.string().min(1),
|
|
18091
|
+
z83.array(z83.string().min(1)).min(1)
|
|
18052
18092
|
]);
|
|
18053
18093
|
|
|
18054
18094
|
// lib/common/traceSpacing.ts
|
|
18055
18095
|
import { distance as distance21 } from "circuit-json";
|
|
18056
|
-
import { z as
|
|
18057
|
-
var widthSpacing =
|
|
18096
|
+
import { z as z84 } from "zod";
|
|
18097
|
+
var widthSpacing = z84.string().regex(/^\s*(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?\s*w\s*$/i).transform((value) => ({
|
|
18058
18098
|
widthMultiplier: Number(value.trim().replace(/w$/i, ""))
|
|
18059
|
-
})).pipe(
|
|
18060
|
-
var absoluteSpacing = distance21.pipe(
|
|
18061
|
-
var traceSpacing =
|
|
18099
|
+
})).pipe(z84.object({ widthMultiplier: z84.number().positive().finite() }));
|
|
18100
|
+
var absoluteSpacing = distance21.pipe(z84.number().positive().finite());
|
|
18101
|
+
var traceSpacing = z84.union([widthSpacing, absoluteSpacing]);
|
|
18062
18102
|
expectTypesMatch(true);
|
|
18063
18103
|
|
|
18064
18104
|
// lib/common/impedanceTarget.ts
|
|
18065
18105
|
import { resistance as resistance3 } from "circuit-json";
|
|
18066
|
-
import { z as
|
|
18067
|
-
var positiveImpedance =
|
|
18068
|
-
|
|
18069
|
-
|
|
18106
|
+
import { z as z85 } from "zod";
|
|
18107
|
+
var positiveImpedance = z85.union([
|
|
18108
|
+
z85.number(),
|
|
18109
|
+
z85.string().refine(
|
|
18070
18110
|
(value) => !/(?:±|\+\/-)/.test(value),
|
|
18071
18111
|
"Use a scalar impedance for explicit bounds"
|
|
18072
18112
|
)
|
|
18073
|
-
]).pipe(resistance3).pipe(
|
|
18113
|
+
]).pipe(resistance3).pipe(z85.number().positive().finite());
|
|
18074
18114
|
var quantity = /^([+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?)\s*(.*?)$/i;
|
|
18075
|
-
var tolerantImpedance =
|
|
18115
|
+
var tolerantImpedance = z85.string().regex(/(?:±|\+\/-)/).transform((value, ctx) => {
|
|
18076
18116
|
const parts = value.trim().split(/\s*(?:±|\+\/-)\s*/);
|
|
18077
18117
|
const nominal = parts.length === 2 ? parts[0].match(quantity) : null;
|
|
18078
18118
|
const tolerance = parts.length === 2 ? parts[1].match(quantity) : null;
|
|
18079
18119
|
if (!nominal || !tolerance) {
|
|
18080
18120
|
ctx.addIssue({
|
|
18081
|
-
code:
|
|
18121
|
+
code: z85.ZodIssueCode.custom,
|
|
18082
18122
|
message: "Use a nominal impedance \xB1 an absolute ohm tolerance"
|
|
18083
18123
|
});
|
|
18084
|
-
return
|
|
18124
|
+
return z85.NEVER;
|
|
18085
18125
|
}
|
|
18086
18126
|
const ohmUnit = /^(?:[yzafpnumkKMGTPEZYµμ])?(?:ohms?|Ω)$/i;
|
|
18087
18127
|
if (nominal[2] && !ohmUnit.test(nominal[2]) || tolerance[2] && !ohmUnit.test(tolerance[2])) {
|
|
18088
18128
|
ctx.addIssue({
|
|
18089
|
-
code:
|
|
18129
|
+
code: z85.ZodIssueCode.custom,
|
|
18090
18130
|
message: "Use an absolute ohm tolerance, not a percentage or another unit"
|
|
18091
18131
|
});
|
|
18092
|
-
return
|
|
18132
|
+
return z85.NEVER;
|
|
18093
18133
|
}
|
|
18094
18134
|
const nominalValue = resistance3.safeParse(
|
|
18095
18135
|
`${nominal[1]}${nominal[2] || tolerance[2] || "ohm"}`
|
|
@@ -18099,10 +18139,10 @@ var tolerantImpedance = z84.string().regex(/(?:±|\+\/-)/).transform((value, ctx
|
|
|
18099
18139
|
);
|
|
18100
18140
|
if (!nominalValue.success || !toleranceValue.success || !Number.isFinite(nominalValue.data) || !Number.isFinite(toleranceValue.data) || nominalValue.data <= 0 || toleranceValue.data < 0) {
|
|
18101
18141
|
ctx.addIssue({
|
|
18102
|
-
code:
|
|
18142
|
+
code: z85.ZodIssueCode.custom,
|
|
18103
18143
|
message: "Nominal impedance must be positive and tolerance nonnegative, in ohms"
|
|
18104
18144
|
});
|
|
18105
|
-
return
|
|
18145
|
+
return z85.NEVER;
|
|
18106
18146
|
}
|
|
18107
18147
|
return {
|
|
18108
18148
|
nominal: nominalValue.data,
|
|
@@ -18110,19 +18150,19 @@ var tolerantImpedance = z84.string().regex(/(?:±|\+\/-)/).transform((value, ctx
|
|
|
18110
18150
|
max: nominalValue.data + toleranceValue.data
|
|
18111
18151
|
};
|
|
18112
18152
|
}).pipe(
|
|
18113
|
-
|
|
18114
|
-
nominal:
|
|
18115
|
-
min:
|
|
18116
|
-
max:
|
|
18153
|
+
z85.object({
|
|
18154
|
+
nominal: z85.number().positive().finite(),
|
|
18155
|
+
min: z85.number().positive().finite(),
|
|
18156
|
+
max: z85.number().positive().finite()
|
|
18117
18157
|
})
|
|
18118
18158
|
);
|
|
18119
18159
|
var scalarImpedance = positiveImpedance;
|
|
18120
|
-
var impedanceTarget =
|
|
18160
|
+
var impedanceTarget = z85.union([tolerantImpedance, scalarImpedance]);
|
|
18121
18161
|
expectTypesMatch(true);
|
|
18122
18162
|
function validateImpedanceTarget(target, min, max, ctx, propName) {
|
|
18123
18163
|
if (min !== void 0 && max !== void 0 && min > max)
|
|
18124
18164
|
ctx.addIssue({
|
|
18125
|
-
code:
|
|
18165
|
+
code: z85.ZodIssueCode.custom,
|
|
18126
18166
|
path: [`${propName}Max`],
|
|
18127
18167
|
message: "Maximum impedance cannot be below minimum impedance"
|
|
18128
18168
|
});
|
|
@@ -18133,13 +18173,13 @@ function validateImpedanceTarget(target, min, max, ctx, propName) {
|
|
|
18133
18173
|
])
|
|
18134
18174
|
if (explicit !== void 0 && Math.abs(explicit - derived) > 1e-9 * Math.max(1, Math.abs(derived)))
|
|
18135
18175
|
ctx.addIssue({
|
|
18136
|
-
code:
|
|
18176
|
+
code: z85.ZodIssueCode.custom,
|
|
18137
18177
|
path: [`${propName}${suffix}`],
|
|
18138
18178
|
message: "Explicit impedance bound conflicts with the target tolerance"
|
|
18139
18179
|
});
|
|
18140
18180
|
} else if (target !== void 0 && (min !== void 0 && target < min || max !== void 0 && target > max))
|
|
18141
18181
|
ctx.addIssue({
|
|
18142
|
-
code:
|
|
18182
|
+
code: z85.ZodIssueCode.custom,
|
|
18143
18183
|
path: [propName],
|
|
18144
18184
|
message: "Target impedance must lie within its declared bounds"
|
|
18145
18185
|
});
|
|
@@ -18147,9 +18187,9 @@ function validateImpedanceTarget(target, min, max, ctx, propName) {
|
|
|
18147
18187
|
|
|
18148
18188
|
// lib/components/bus.ts
|
|
18149
18189
|
import { distance as distance22, layer_ref as layer_ref7 } from "circuit-json";
|
|
18150
|
-
import { z as
|
|
18151
|
-
var busProps =
|
|
18152
|
-
name:
|
|
18190
|
+
import { z as z86 } from "zod";
|
|
18191
|
+
var busProps = z86.object({
|
|
18192
|
+
name: z86.string().optional(),
|
|
18153
18193
|
lengthMatchTo: lengthMatchTo.optional(),
|
|
18154
18194
|
minLength: routeLength.optional(),
|
|
18155
18195
|
maxLength: routeLength.optional(),
|
|
@@ -18157,16 +18197,16 @@ var busProps = z85.object({
|
|
|
18157
18197
|
lengthTolerance: nonnegativeRouteDistance.optional(),
|
|
18158
18198
|
pcbTraceSpacing: traceSpacing.optional(),
|
|
18159
18199
|
pcbSpacingToOtherSignals: traceSpacing.optional(),
|
|
18160
|
-
connections:
|
|
18161
|
-
routingPhaseIndex:
|
|
18162
|
-
maxLengthSkew: distance22.pipe(
|
|
18200
|
+
connections: z86.array(z86.string()).min(1),
|
|
18201
|
+
routingPhaseIndex: z86.number().nullable().optional(),
|
|
18202
|
+
maxLengthSkew: distance22.pipe(z86.number().min(0).finite()).optional(),
|
|
18163
18203
|
targetImpedance: impedanceTarget.optional(),
|
|
18164
18204
|
targetImpedanceMin: positiveImpedance.optional(),
|
|
18165
18205
|
targetImpedanceMax: positiveImpedance.optional(),
|
|
18166
|
-
pcbTraceWidth: distance22.pipe(
|
|
18167
|
-
pcbAllowedLayers:
|
|
18206
|
+
pcbTraceWidth: distance22.pipe(z86.number().positive().finite()).optional(),
|
|
18207
|
+
pcbAllowedLayers: z86.array(layer_ref7).min(1).optional(),
|
|
18168
18208
|
preferredLayer: layer_ref7.optional(),
|
|
18169
|
-
preferredLayers:
|
|
18209
|
+
preferredLayers: z86.array(layer_ref7).min(1).optional()
|
|
18170
18210
|
}).superRefine((props, ctx) => {
|
|
18171
18211
|
validateRouteLengths(props, ctx);
|
|
18172
18212
|
validateImpedanceTarget(
|
|
@@ -18196,23 +18236,23 @@ expectTypesMatch(true);
|
|
|
18196
18236
|
|
|
18197
18237
|
// lib/components/differentialpair.ts
|
|
18198
18238
|
import { distance as distance23 } from "circuit-json";
|
|
18199
|
-
import { z as
|
|
18200
|
-
var differentialPairProps =
|
|
18201
|
-
name:
|
|
18239
|
+
import { z as z87 } from "zod";
|
|
18240
|
+
var differentialPairProps = z87.object({
|
|
18241
|
+
name: z87.string().optional(),
|
|
18202
18242
|
lengthMatchTo: lengthMatchTo.optional(),
|
|
18203
18243
|
minLength: routeLength.optional(),
|
|
18204
18244
|
maxLength: routeLength.optional(),
|
|
18205
18245
|
targetLength: routeLength.optional(),
|
|
18206
18246
|
lengthTolerance: nonnegativeRouteDistance.optional(),
|
|
18207
18247
|
pcbSpacingToOtherSignals: traceSpacing.optional(),
|
|
18208
|
-
positiveConnection:
|
|
18209
|
-
negativeConnection:
|
|
18210
|
-
maxLengthSkew: distance23.pipe(
|
|
18248
|
+
positiveConnection: z87.string(),
|
|
18249
|
+
negativeConnection: z87.string(),
|
|
18250
|
+
maxLengthSkew: distance23.pipe(z87.number().min(0).finite()).optional(),
|
|
18211
18251
|
targetDifferentialImpedance: impedanceTarget.optional(),
|
|
18212
18252
|
targetDifferentialImpedanceMin: positiveImpedance.optional(),
|
|
18213
18253
|
targetDifferentialImpedanceMax: positiveImpedance.optional(),
|
|
18214
|
-
pcbTraceGap: distance23.pipe(
|
|
18215
|
-
maxUncoupledLength: distance23.pipe(
|
|
18254
|
+
pcbTraceGap: distance23.pipe(z87.number().positive().finite()).optional(),
|
|
18255
|
+
maxUncoupledLength: distance23.pipe(z87.number().min(0).finite()).optional()
|
|
18216
18256
|
}).superRefine((props, ctx) => {
|
|
18217
18257
|
validateRouteLengths(props, ctx);
|
|
18218
18258
|
validateImpedanceTarget(
|
|
@@ -18244,8 +18284,8 @@ expectTypesMatch(true);
|
|
|
18244
18284
|
import {
|
|
18245
18285
|
layer_ref as layer_ref8
|
|
18246
18286
|
} from "circuit-json";
|
|
18247
|
-
import { z as
|
|
18248
|
-
var footprintInsertionDirection =
|
|
18287
|
+
import { z as z88 } from "zod";
|
|
18288
|
+
var footprintInsertionDirection = z88.enum([
|
|
18249
18289
|
"from_left",
|
|
18250
18290
|
"from_right",
|
|
18251
18291
|
"from_top",
|
|
@@ -18263,11 +18303,11 @@ var footprintInsertionDirection = z87.enum([
|
|
|
18263
18303
|
"from_back"
|
|
18264
18304
|
]);
|
|
18265
18305
|
expectTypesMatch(true);
|
|
18266
|
-
var footprintProps =
|
|
18267
|
-
children:
|
|
18268
|
-
name:
|
|
18306
|
+
var footprintProps = z88.object({
|
|
18307
|
+
children: z88.any().optional(),
|
|
18308
|
+
name: z88.string().optional(),
|
|
18269
18309
|
originalLayer: layer_ref8.default("top").optional(),
|
|
18270
|
-
circuitJson:
|
|
18310
|
+
circuitJson: z88.array(z88.any()).optional(),
|
|
18271
18311
|
src: footprintProp.describe("Can be a footprint or kicad string").optional(),
|
|
18272
18312
|
insertionDirection: footprintInsertionDirection.optional().describe(
|
|
18273
18313
|
"Direction a cable or mating part is attached from, named for the side of the footprint it approaches from, in its unrotated orientation."
|
|
@@ -18279,19 +18319,19 @@ var footprintProps = z87.object({
|
|
|
18279
18319
|
expectTypesMatch(true);
|
|
18280
18320
|
|
|
18281
18321
|
// lib/components/symbol.ts
|
|
18282
|
-
import { z as
|
|
18283
|
-
var symbolProps =
|
|
18284
|
-
originalFacingDirection:
|
|
18322
|
+
import { z as z89 } from "zod";
|
|
18323
|
+
var symbolProps = z89.object({
|
|
18324
|
+
originalFacingDirection: z89.enum(["up", "down", "left", "right"]).default("right").optional(),
|
|
18285
18325
|
width: distance.optional(),
|
|
18286
18326
|
height: distance.optional(),
|
|
18287
|
-
name:
|
|
18327
|
+
name: z89.string().optional()
|
|
18288
18328
|
});
|
|
18289
18329
|
expectTypesMatch(true);
|
|
18290
18330
|
|
|
18291
18331
|
// lib/components/battery.ts
|
|
18292
18332
|
import { voltage as voltage2 } from "circuit-json";
|
|
18293
|
-
import { z as
|
|
18294
|
-
var capacity =
|
|
18333
|
+
import { z as z90 } from "zod";
|
|
18334
|
+
var capacity = z90.number().or(z90.string().endsWith("mAh")).transform((v) => {
|
|
18295
18335
|
if (typeof v === "string") {
|
|
18296
18336
|
const valString = v.replace("mAh", "");
|
|
18297
18337
|
const num = Number.parseFloat(valString);
|
|
@@ -18306,14 +18346,14 @@ var batteryPins = lrPolarPins;
|
|
|
18306
18346
|
var batteryProps = commonComponentProps.extend({
|
|
18307
18347
|
capacity: capacity.optional(),
|
|
18308
18348
|
voltage: voltage2.optional(),
|
|
18309
|
-
standard:
|
|
18349
|
+
standard: z90.enum(["AA", "AAA", "9V", "CR2032", "18650", "C"]).optional(),
|
|
18310
18350
|
schOrientation: schematicOrientation.optional(),
|
|
18311
18351
|
connections: createConnectionsProp(batteryPins).optional()
|
|
18312
18352
|
});
|
|
18313
18353
|
expectTypesMatch(true);
|
|
18314
18354
|
|
|
18315
18355
|
// lib/components/mountedboard.ts
|
|
18316
|
-
import { z as
|
|
18356
|
+
import { z as z91 } from "zod";
|
|
18317
18357
|
var mountedboardProps = subcircuitGroupProps.extend({
|
|
18318
18358
|
mpn: chipProps.shape.mpn,
|
|
18319
18359
|
mfn: chipProps.shape.mfn,
|
|
@@ -18327,7 +18367,7 @@ var mountedboardProps = subcircuitGroupProps.extend({
|
|
|
18327
18367
|
internallyConnectedPins: chipProps.shape.internallyConnectedPins,
|
|
18328
18368
|
externallyConnectedPins: chipProps.shape.externallyConnectedPins,
|
|
18329
18369
|
boardToBoardDistance: distance.optional(),
|
|
18330
|
-
mountOrientation:
|
|
18370
|
+
mountOrientation: z91.enum(["faceDown", "faceUp"]).optional()
|
|
18331
18371
|
});
|
|
18332
18372
|
expectTypesMatch(true);
|
|
18333
18373
|
|
|
@@ -18335,40 +18375,40 @@ expectTypesMatch(true);
|
|
|
18335
18375
|
import { distance as distance24 } from "circuit-json";
|
|
18336
18376
|
|
|
18337
18377
|
// lib/common/pcbOrientation.ts
|
|
18338
|
-
import { z as
|
|
18339
|
-
var pcbOrientation =
|
|
18378
|
+
import { z as z92 } from "zod";
|
|
18379
|
+
var pcbOrientation = z92.enum(["vertical", "horizontal"]).describe(
|
|
18340
18380
|
"vertical means pins go 1->2 downward and horizontal means pins go 1->2 rightward"
|
|
18341
18381
|
);
|
|
18342
18382
|
expectTypesMatch(true);
|
|
18343
18383
|
|
|
18344
18384
|
// lib/components/pin-header.ts
|
|
18345
|
-
import { z as
|
|
18385
|
+
import { z as z93 } from "zod";
|
|
18346
18386
|
var pinHeaderProps = commonComponentProps.extend({
|
|
18347
|
-
pinCount:
|
|
18387
|
+
pinCount: z93.number(),
|
|
18348
18388
|
pitch: distance24.optional(),
|
|
18349
|
-
schFacingDirection:
|
|
18350
|
-
gender:
|
|
18351
|
-
showSilkscreenPinLabels:
|
|
18352
|
-
pcbPinLabels:
|
|
18353
|
-
doubleRow:
|
|
18354
|
-
rightAngle:
|
|
18389
|
+
schFacingDirection: z93.enum(["up", "down", "left", "right"]).optional(),
|
|
18390
|
+
gender: z93.enum(["male", "female", "unpopulated"]).optional().default("male"),
|
|
18391
|
+
showSilkscreenPinLabels: z93.boolean().optional(),
|
|
18392
|
+
pcbPinLabels: z93.record(z93.string(), z93.string()).optional(),
|
|
18393
|
+
doubleRow: z93.boolean().optional(),
|
|
18394
|
+
rightAngle: z93.boolean().optional(),
|
|
18355
18395
|
pcbOrientation: pcbOrientation.optional(),
|
|
18356
18396
|
holeDiameter: distance24.optional(),
|
|
18357
18397
|
platedDiameter: distance24.optional(),
|
|
18358
|
-
pinLabels:
|
|
18359
|
-
connections:
|
|
18360
|
-
facingDirection:
|
|
18398
|
+
pinLabels: z93.record(z93.string(), schematicPinLabel).or(z93.array(schematicPinLabel)).optional(),
|
|
18399
|
+
connections: z93.custom().pipe(z93.record(z93.string(), connectionTarget)).optional(),
|
|
18400
|
+
facingDirection: z93.enum(["left", "right"]).optional(),
|
|
18361
18401
|
schPinArrangement: schematicPinArrangement.optional(),
|
|
18362
18402
|
schPinStyle: schematicPinStyle.optional(),
|
|
18363
18403
|
schPinSpacing: distance24.optional(),
|
|
18364
18404
|
schWidth: distance24.optional(),
|
|
18365
18405
|
schHeight: distance24.optional(),
|
|
18366
|
-
connectsFromAbove:
|
|
18367
|
-
connectsFromBelow:
|
|
18406
|
+
connectsFromAbove: z93.boolean().optional(),
|
|
18407
|
+
connectsFromBelow: z93.boolean().optional()
|
|
18368
18408
|
}).superRefine((props, ctx) => {
|
|
18369
18409
|
if (props.connectsFromAbove && props.connectsFromBelow) {
|
|
18370
18410
|
ctx.addIssue({
|
|
18371
|
-
code:
|
|
18411
|
+
code: z93.ZodIssueCode.custom,
|
|
18372
18412
|
message: "connectsFromAbove and connectsFromBelow are opposites; set at most one"
|
|
18373
18413
|
});
|
|
18374
18414
|
}
|
|
@@ -18379,30 +18419,30 @@ var pinHeaderProps = commonComponentProps.extend({
|
|
|
18379
18419
|
expectTypesMatch(true);
|
|
18380
18420
|
|
|
18381
18421
|
// lib/components/netalias.ts
|
|
18382
|
-
import { z as
|
|
18422
|
+
import { z as z94 } from "zod";
|
|
18383
18423
|
import { rotation as rotation4 } from "circuit-json";
|
|
18384
|
-
var netAliasProps =
|
|
18385
|
-
net:
|
|
18386
|
-
connection:
|
|
18424
|
+
var netAliasProps = z94.object({
|
|
18425
|
+
net: z94.string().optional(),
|
|
18426
|
+
connection: z94.string().optional(),
|
|
18387
18427
|
schX: distance.optional(),
|
|
18388
18428
|
schY: distance.optional(),
|
|
18389
18429
|
schRotation: rotation4.optional(),
|
|
18390
|
-
anchorSide:
|
|
18430
|
+
anchorSide: z94.enum(["left", "top", "right", "bottom"]).optional()
|
|
18391
18431
|
});
|
|
18392
18432
|
expectTypesMatch(true);
|
|
18393
18433
|
|
|
18394
18434
|
// lib/components/netlabel.ts
|
|
18395
|
-
import { z as
|
|
18435
|
+
import { z as z95 } from "zod";
|
|
18396
18436
|
import { rotation as rotation5 } from "circuit-json";
|
|
18397
|
-
var netLabelProps =
|
|
18398
|
-
net:
|
|
18399
|
-
connection:
|
|
18400
|
-
connectsTo:
|
|
18401
|
-
inline:
|
|
18437
|
+
var netLabelProps = z95.object({
|
|
18438
|
+
net: z95.string().optional(),
|
|
18439
|
+
connection: z95.string().optional(),
|
|
18440
|
+
connectsTo: z95.string().or(z95.array(z95.string())).optional(),
|
|
18441
|
+
inline: z95.boolean().optional(),
|
|
18402
18442
|
schX: distance.optional(),
|
|
18403
18443
|
schY: distance.optional(),
|
|
18404
18444
|
schRotation: rotation5.optional(),
|
|
18405
|
-
anchorSide:
|
|
18445
|
+
anchorSide: z95.enum(["left", "top", "right", "bottom"]).optional()
|
|
18406
18446
|
});
|
|
18407
18447
|
expectTypesMatch(true);
|
|
18408
18448
|
|
|
@@ -18417,32 +18457,32 @@ expectTypesMatch(true);
|
|
|
18417
18457
|
|
|
18418
18458
|
// lib/components/analogsimulation.ts
|
|
18419
18459
|
import { ms } from "circuit-json";
|
|
18420
|
-
import { z as
|
|
18421
|
-
var spiceEngine =
|
|
18460
|
+
import { z as z97 } from "zod";
|
|
18461
|
+
var spiceEngine = z97.custom(
|
|
18422
18462
|
(value) => typeof value === "string"
|
|
18423
18463
|
);
|
|
18424
|
-
var spiceOptions =
|
|
18425
|
-
method:
|
|
18426
|
-
reltol:
|
|
18427
|
-
abstol:
|
|
18428
|
-
vntol:
|
|
18464
|
+
var spiceOptions = z97.object({
|
|
18465
|
+
method: z97.enum(["trap", "gear"]).optional(),
|
|
18466
|
+
reltol: z97.union([z97.number(), z97.string()]).optional(),
|
|
18467
|
+
abstol: z97.union([z97.number(), z97.string()]).optional(),
|
|
18468
|
+
vntol: z97.union([z97.number(), z97.string()]).optional()
|
|
18429
18469
|
});
|
|
18430
18470
|
var analogAnalysisSimulationBaseProps = {
|
|
18431
|
-
name:
|
|
18471
|
+
name: z97.string().optional(),
|
|
18432
18472
|
spiceEngine: spiceEngine.optional(),
|
|
18433
18473
|
spiceOptions: spiceOptions.optional(),
|
|
18434
|
-
graphIndependentAxes:
|
|
18435
|
-
children:
|
|
18474
|
+
graphIndependentAxes: z97.boolean().optional(),
|
|
18475
|
+
children: z97.custom().optional()
|
|
18436
18476
|
};
|
|
18437
|
-
var analogSimulationProps =
|
|
18438
|
-
name:
|
|
18439
|
-
simulationType:
|
|
18477
|
+
var analogSimulationProps = z97.object({
|
|
18478
|
+
name: z97.string().optional(),
|
|
18479
|
+
simulationType: z97.literal("spice_transient_analysis").default("spice_transient_analysis"),
|
|
18440
18480
|
duration: ms.optional(),
|
|
18441
18481
|
startTime: ms.optional(),
|
|
18442
18482
|
timePerStep: ms.optional(),
|
|
18443
18483
|
spiceEngine: spiceEngine.optional(),
|
|
18444
18484
|
spiceOptions: spiceOptions.optional(),
|
|
18445
|
-
graphIndependentAxes:
|
|
18485
|
+
graphIndependentAxes: z97.boolean().optional()
|
|
18446
18486
|
});
|
|
18447
18487
|
expectTypesMatch(
|
|
18448
18488
|
true
|
|
@@ -18450,12 +18490,12 @@ expectTypesMatch(
|
|
|
18450
18490
|
|
|
18451
18491
|
// lib/components/analogtransientsimulation.ts
|
|
18452
18492
|
import { ms as ms2 } from "circuit-json";
|
|
18453
|
-
import { z as
|
|
18493
|
+
import { z as z98 } from "zod";
|
|
18454
18494
|
var positiveMilliseconds = ms2.refine(
|
|
18455
18495
|
(milliseconds) => milliseconds > 0,
|
|
18456
18496
|
"Time must be positive"
|
|
18457
18497
|
);
|
|
18458
|
-
var analogTransientSimulationProps =
|
|
18498
|
+
var analogTransientSimulationProps = z98.object({
|
|
18459
18499
|
...analogAnalysisSimulationBaseProps,
|
|
18460
18500
|
duration: positiveMilliseconds.default("10ms"),
|
|
18461
18501
|
startTime: ms2.default("0ms"),
|
|
@@ -18463,7 +18503,7 @@ var analogTransientSimulationProps = z97.object({
|
|
|
18463
18503
|
}).superRefine((simulation, context) => {
|
|
18464
18504
|
if (simulation.startTime < 0 || simulation.startTime > simulation.duration) {
|
|
18465
18505
|
context.addIssue({
|
|
18466
|
-
code:
|
|
18506
|
+
code: z98.ZodIssueCode.custom,
|
|
18467
18507
|
path: ["startTime"],
|
|
18468
18508
|
message: "startTime must be between zero and duration"
|
|
18469
18509
|
});
|
|
@@ -18472,19 +18512,19 @@ var analogTransientSimulationProps = z97.object({
|
|
|
18472
18512
|
expectTypesMatch(true);
|
|
18473
18513
|
|
|
18474
18514
|
// lib/components/analogdcoperatingpointsimulation.ts
|
|
18475
|
-
import { z as
|
|
18476
|
-
var analogDcOperatingPointSimulationProps =
|
|
18515
|
+
import { z as z99 } from "zod";
|
|
18516
|
+
var analogDcOperatingPointSimulationProps = z99.object({
|
|
18477
18517
|
...analogAnalysisSimulationBaseProps
|
|
18478
18518
|
});
|
|
18479
18519
|
expectTypesMatch(true);
|
|
18480
18520
|
|
|
18481
18521
|
// lib/components/analogdcsweepsimulation.ts
|
|
18482
18522
|
import { current, voltage as voltage3 } from "circuit-json";
|
|
18483
|
-
import { z as
|
|
18484
|
-
var dcSweepQuantity =
|
|
18485
|
-
var analogDcSweepSimulationProps =
|
|
18523
|
+
import { z as z100 } from "zod";
|
|
18524
|
+
var dcSweepQuantity = z100.union([voltage3, current]);
|
|
18525
|
+
var analogDcSweepSimulationProps = z100.object({
|
|
18486
18526
|
...analogAnalysisSimulationBaseProps,
|
|
18487
|
-
sweepSource:
|
|
18527
|
+
sweepSource: z100.string().min(1),
|
|
18488
18528
|
sweepStart: dcSweepQuantity,
|
|
18489
18529
|
sweepStop: dcSweepQuantity,
|
|
18490
18530
|
sweepStep: dcSweepQuantity.refine(
|
|
@@ -18494,7 +18534,7 @@ var analogDcSweepSimulationProps = z99.object({
|
|
|
18494
18534
|
}).superRefine((simulation, context) => {
|
|
18495
18535
|
if (Math.sign(simulation.sweepStop - simulation.sweepStart) !== Math.sign(simulation.sweepStep)) {
|
|
18496
18536
|
context.addIssue({
|
|
18497
|
-
code:
|
|
18537
|
+
code: z100.ZodIssueCode.custom,
|
|
18498
18538
|
path: ["sweepStep"],
|
|
18499
18539
|
message: "sweepStep must move from sweepStart toward sweepStop"
|
|
18500
18540
|
});
|
|
@@ -18504,10 +18544,10 @@ expectTypesMatch(true);
|
|
|
18504
18544
|
|
|
18505
18545
|
// lib/components/analogacsweepsimulation.ts
|
|
18506
18546
|
import { frequency as frequency3 } from "circuit-json";
|
|
18507
|
-
import { z as
|
|
18508
|
-
var analogAcSweepSimulationProps =
|
|
18547
|
+
import { z as z101 } from "zod";
|
|
18548
|
+
var analogAcSweepSimulationProps = z101.object({
|
|
18509
18549
|
...analogAnalysisSimulationBaseProps,
|
|
18510
|
-
sweepType:
|
|
18550
|
+
sweepType: z101.enum(["linear", "decade", "octave"]),
|
|
18511
18551
|
startFrequency: frequency3.refine(
|
|
18512
18552
|
(startFrequencyHz) => startFrequencyHz > 0,
|
|
18513
18553
|
"startFrequency must be positive"
|
|
@@ -18516,12 +18556,12 @@ var analogAcSweepSimulationProps = z100.object({
|
|
|
18516
18556
|
(stopFrequencyHz) => stopFrequencyHz > 0,
|
|
18517
18557
|
"stopFrequency must be positive"
|
|
18518
18558
|
),
|
|
18519
|
-
samplesPerInterval:
|
|
18520
|
-
sampleCount:
|
|
18559
|
+
samplesPerInterval: z101.number().int().positive().optional(),
|
|
18560
|
+
sampleCount: z101.number().int().positive().optional()
|
|
18521
18561
|
}).superRefine((simulation, context) => {
|
|
18522
18562
|
if (simulation.stopFrequency <= simulation.startFrequency) {
|
|
18523
18563
|
context.addIssue({
|
|
18524
|
-
code:
|
|
18564
|
+
code: z101.ZodIssueCode.custom,
|
|
18525
18565
|
path: ["stopFrequency"],
|
|
18526
18566
|
message: "stopFrequency must be greater than startFrequency"
|
|
18527
18567
|
});
|
|
@@ -18529,14 +18569,14 @@ var analogAcSweepSimulationProps = z100.object({
|
|
|
18529
18569
|
if (simulation.sweepType === "linear") {
|
|
18530
18570
|
if (simulation.sampleCount === void 0) {
|
|
18531
18571
|
context.addIssue({
|
|
18532
|
-
code:
|
|
18572
|
+
code: z101.ZodIssueCode.custom,
|
|
18533
18573
|
path: ["sampleCount"],
|
|
18534
18574
|
message: "sampleCount is required for a linear AC sweep"
|
|
18535
18575
|
});
|
|
18536
18576
|
}
|
|
18537
18577
|
if (simulation.samplesPerInterval !== void 0) {
|
|
18538
18578
|
context.addIssue({
|
|
18539
|
-
code:
|
|
18579
|
+
code: z101.ZodIssueCode.custom,
|
|
18540
18580
|
path: ["samplesPerInterval"],
|
|
18541
18581
|
message: "samplesPerInterval is only valid for decade or octave sweeps"
|
|
18542
18582
|
});
|
|
@@ -18545,14 +18585,14 @@ var analogAcSweepSimulationProps = z100.object({
|
|
|
18545
18585
|
}
|
|
18546
18586
|
if (simulation.samplesPerInterval === void 0) {
|
|
18547
18587
|
context.addIssue({
|
|
18548
|
-
code:
|
|
18588
|
+
code: z101.ZodIssueCode.custom,
|
|
18549
18589
|
path: ["samplesPerInterval"],
|
|
18550
18590
|
message: "samplesPerInterval is required for decade or octave sweeps"
|
|
18551
18591
|
});
|
|
18552
18592
|
}
|
|
18553
18593
|
if (simulation.sampleCount !== void 0) {
|
|
18554
18594
|
context.addIssue({
|
|
18555
|
-
code:
|
|
18595
|
+
code: z101.ZodIssueCode.custom,
|
|
18556
18596
|
path: ["sampleCount"],
|
|
18557
18597
|
message: "sampleCount is only valid for a linear sweep"
|
|
18558
18598
|
});
|
|
@@ -18568,43 +18608,43 @@ import {
|
|
|
18568
18608
|
resistance as resistance4,
|
|
18569
18609
|
voltage as voltage4
|
|
18570
18610
|
} from "circuit-json";
|
|
18571
|
-
import { z as
|
|
18572
|
-
var resistanceSweepQuantity = resistance4.pipe(
|
|
18573
|
-
var capacitanceSweepQuantity = capacitance4.pipe(
|
|
18574
|
-
var inductanceSweepQuantity = inductance.pipe(
|
|
18575
|
-
var voltageSweepQuantity = voltage4.pipe(
|
|
18576
|
-
var currentSweepQuantity = current2.pipe(
|
|
18611
|
+
import { z as z102 } from "zod";
|
|
18612
|
+
var resistanceSweepQuantity = resistance4.pipe(z102.number());
|
|
18613
|
+
var capacitanceSweepQuantity = capacitance4.pipe(z102.number());
|
|
18614
|
+
var inductanceSweepQuantity = inductance.pipe(z102.number());
|
|
18615
|
+
var voltageSweepQuantity = voltage4.pipe(z102.number());
|
|
18616
|
+
var currentSweepQuantity = current2.pipe(z102.number());
|
|
18577
18617
|
var createAnalogSweepCoordinateProps = (sweepQuantity) => ({
|
|
18578
|
-
name:
|
|
18579
|
-
values:
|
|
18618
|
+
name: z102.string().optional(),
|
|
18619
|
+
values: z102.array(sweepQuantity).min(1).optional(),
|
|
18580
18620
|
start: sweepQuantity.optional(),
|
|
18581
18621
|
stop: sweepQuantity.optional(),
|
|
18582
18622
|
step: sweepQuantity.optional()
|
|
18583
18623
|
});
|
|
18584
|
-
var analogResistanceSweepParameterProps =
|
|
18624
|
+
var analogResistanceSweepParameterProps = z102.object({
|
|
18585
18625
|
...createAnalogSweepCoordinateProps(resistanceSweepQuantity),
|
|
18586
|
-
parameterType:
|
|
18587
|
-
resistorRef:
|
|
18626
|
+
parameterType: z102.literal("resistance"),
|
|
18627
|
+
resistorRef: z102.string().min(1)
|
|
18588
18628
|
}).strict();
|
|
18589
|
-
var analogCapacitanceSweepParameterProps =
|
|
18629
|
+
var analogCapacitanceSweepParameterProps = z102.object({
|
|
18590
18630
|
...createAnalogSweepCoordinateProps(capacitanceSweepQuantity),
|
|
18591
|
-
parameterType:
|
|
18592
|
-
capacitorRef:
|
|
18631
|
+
parameterType: z102.literal("capacitance"),
|
|
18632
|
+
capacitorRef: z102.string().min(1)
|
|
18593
18633
|
}).strict();
|
|
18594
|
-
var analogInductanceSweepParameterProps =
|
|
18634
|
+
var analogInductanceSweepParameterProps = z102.object({
|
|
18595
18635
|
...createAnalogSweepCoordinateProps(inductanceSweepQuantity),
|
|
18596
|
-
parameterType:
|
|
18597
|
-
inductorRef:
|
|
18636
|
+
parameterType: z102.literal("inductance"),
|
|
18637
|
+
inductorRef: z102.string().min(1)
|
|
18598
18638
|
}).strict();
|
|
18599
|
-
var analogVoltageSweepParameterProps =
|
|
18639
|
+
var analogVoltageSweepParameterProps = z102.object({
|
|
18600
18640
|
...createAnalogSweepCoordinateProps(voltageSweepQuantity),
|
|
18601
|
-
parameterType:
|
|
18602
|
-
net:
|
|
18641
|
+
parameterType: z102.literal("voltage"),
|
|
18642
|
+
net: z102.string().min(1)
|
|
18603
18643
|
}).strict();
|
|
18604
|
-
var analogCurrentSweepParameterProps =
|
|
18644
|
+
var analogCurrentSweepParameterProps = z102.object({
|
|
18605
18645
|
...createAnalogSweepCoordinateProps(currentSweepQuantity),
|
|
18606
|
-
parameterType:
|
|
18607
|
-
currentSourceRef:
|
|
18646
|
+
parameterType: z102.literal("current"),
|
|
18647
|
+
currentSourceRef: z102.string().min(1)
|
|
18608
18648
|
}).strict();
|
|
18609
18649
|
var validateAnalogSweepCoordinates = (sweepCoordinates, context) => {
|
|
18610
18650
|
const hasExplicitSweepCoordinates = sweepCoordinates.values !== void 0;
|
|
@@ -18616,34 +18656,34 @@ var validateAnalogSweepCoordinates = (sweepCoordinates, context) => {
|
|
|
18616
18656
|
const hasRangeCoordinates = rangeCoordinateCount > 0;
|
|
18617
18657
|
if (hasExplicitSweepCoordinates === hasRangeCoordinates) {
|
|
18618
18658
|
context.addIssue({
|
|
18619
|
-
code:
|
|
18659
|
+
code: z102.ZodIssueCode.custom,
|
|
18620
18660
|
message: "Provide either values or start/stop/step"
|
|
18621
18661
|
});
|
|
18622
18662
|
return;
|
|
18623
18663
|
}
|
|
18624
18664
|
if (rangeCoordinateCount !== 0 && rangeCoordinateCount !== 3) {
|
|
18625
18665
|
context.addIssue({
|
|
18626
|
-
code:
|
|
18666
|
+
code: z102.ZodIssueCode.custom,
|
|
18627
18667
|
message: "start, stop, and step must be provided together"
|
|
18628
18668
|
});
|
|
18629
18669
|
return;
|
|
18630
18670
|
}
|
|
18631
18671
|
if (sweepCoordinates.step === 0) {
|
|
18632
18672
|
context.addIssue({
|
|
18633
|
-
code:
|
|
18673
|
+
code: z102.ZodIssueCode.custom,
|
|
18634
18674
|
path: ["step"],
|
|
18635
18675
|
message: "step must be nonzero"
|
|
18636
18676
|
});
|
|
18637
18677
|
}
|
|
18638
18678
|
if (sweepCoordinates.start !== void 0 && sweepCoordinates.stop !== void 0 && sweepCoordinates.step !== void 0 && Math.sign(sweepCoordinates.stop - sweepCoordinates.start) !== Math.sign(sweepCoordinates.step)) {
|
|
18639
18679
|
context.addIssue({
|
|
18640
|
-
code:
|
|
18680
|
+
code: z102.ZodIssueCode.custom,
|
|
18641
18681
|
path: ["step"],
|
|
18642
18682
|
message: "step must move from start toward stop"
|
|
18643
18683
|
});
|
|
18644
18684
|
}
|
|
18645
18685
|
};
|
|
18646
|
-
var analogSweepParameterProps =
|
|
18686
|
+
var analogSweepParameterProps = z102.discriminatedUnion("parameterType", [
|
|
18647
18687
|
analogResistanceSweepParameterProps,
|
|
18648
18688
|
analogCapacitanceSweepParameterProps,
|
|
18649
18689
|
analogInductanceSweepParameterProps,
|
|
@@ -18658,26 +18698,26 @@ expectTypesMatch(true);
|
|
|
18658
18698
|
expectTypesMatch(true);
|
|
18659
18699
|
|
|
18660
18700
|
// lib/components/autoroutingphase.ts
|
|
18661
|
-
import { z as
|
|
18662
|
-
var autoroutingPhaseProps =
|
|
18663
|
-
key:
|
|
18664
|
-
name:
|
|
18701
|
+
import { z as z103 } from "zod";
|
|
18702
|
+
var autoroutingPhaseProps = z103.object({
|
|
18703
|
+
key: z103.any().optional(),
|
|
18704
|
+
name: z103.string().optional(),
|
|
18665
18705
|
autorouter: autorouterProp.optional(),
|
|
18666
18706
|
algorithmFn: autorouterConfig.shape.algorithmFn,
|
|
18667
18707
|
preflightRoutingCheckPolicy: preflightRoutingCheckPolicy.optional(),
|
|
18668
|
-
phaseIndex:
|
|
18669
|
-
pcbTracePaths:
|
|
18708
|
+
phaseIndex: z103.number().optional(),
|
|
18709
|
+
pcbTracePaths: z103.array(fanoutTracePath).optional(),
|
|
18670
18710
|
...routingTolerances.shape,
|
|
18671
|
-
region:
|
|
18672
|
-
shape:
|
|
18673
|
-
minX:
|
|
18674
|
-
maxX:
|
|
18675
|
-
minY:
|
|
18676
|
-
maxY:
|
|
18711
|
+
region: z103.object({
|
|
18712
|
+
shape: z103.literal("rect").optional(),
|
|
18713
|
+
minX: z103.number(),
|
|
18714
|
+
maxX: z103.number(),
|
|
18715
|
+
minY: z103.number(),
|
|
18716
|
+
maxY: z103.number()
|
|
18677
18717
|
}).optional(),
|
|
18678
|
-
connection:
|
|
18679
|
-
connections:
|
|
18680
|
-
reroute:
|
|
18718
|
+
connection: z103.string().optional(),
|
|
18719
|
+
connections: z103.array(z103.string()).optional(),
|
|
18720
|
+
reroute: z103.boolean().optional(),
|
|
18681
18721
|
...fanoutProps.shape
|
|
18682
18722
|
}).superRefine((value, ctx) => {
|
|
18683
18723
|
const isSimplifyAutorouter = value.autorouter === "simplify" || typeof value.autorouter === "object" && value.autorouter?.preset === "simplify";
|
|
@@ -18688,7 +18728,7 @@ var autoroutingPhaseProps = z102.object({
|
|
|
18688
18728
|
}
|
|
18689
18729
|
if (value.reroute !== void 0 && !(isSimplifyAutorouter && value.reroute === true) && value.region === void 0 && value.connection === void 0 && value.connections === void 0) {
|
|
18690
18730
|
ctx.addIssue({
|
|
18691
|
-
code:
|
|
18731
|
+
code: z103.ZodIssueCode.custom,
|
|
18692
18732
|
message: "region, connection, or connections is required when reroute is provided",
|
|
18693
18733
|
path: ["region"]
|
|
18694
18734
|
});
|
|
@@ -18697,15 +18737,15 @@ var autoroutingPhaseProps = z102.object({
|
|
|
18697
18737
|
expectTypesMatch(true);
|
|
18698
18738
|
|
|
18699
18739
|
// lib/components/spicemodel.ts
|
|
18700
|
-
import { z as
|
|
18701
|
-
var spicemodelProps =
|
|
18702
|
-
source:
|
|
18703
|
-
spicePinMapping:
|
|
18740
|
+
import { z as z104 } from "zod";
|
|
18741
|
+
var spicemodelProps = z104.object({
|
|
18742
|
+
source: z104.string(),
|
|
18743
|
+
spicePinMapping: z104.record(z104.string(), z104.string()).optional()
|
|
18704
18744
|
});
|
|
18705
18745
|
expectTypesMatch(true);
|
|
18706
18746
|
|
|
18707
18747
|
// lib/components/transistor.ts
|
|
18708
|
-
import { z as
|
|
18748
|
+
import { z as z105 } from "zod";
|
|
18709
18749
|
var transistorPinsLabels = [
|
|
18710
18750
|
"pin1",
|
|
18711
18751
|
"pin2",
|
|
@@ -18718,7 +18758,7 @@ var transistorPinsLabels = [
|
|
|
18718
18758
|
"drain"
|
|
18719
18759
|
];
|
|
18720
18760
|
var transistorProps = commonComponentProps.extend({
|
|
18721
|
-
type:
|
|
18761
|
+
type: z105.enum(["npn", "pnp", "bjt", "jfet", "mosfet", "igbt"]),
|
|
18722
18762
|
connections: createConnectionsProp(transistorPinsLabels).optional()
|
|
18723
18763
|
});
|
|
18724
18764
|
var transistorPins = [
|
|
@@ -18732,7 +18772,7 @@ var transistorPins = [
|
|
|
18732
18772
|
expectTypesMatch(true);
|
|
18733
18773
|
|
|
18734
18774
|
// lib/components/mosfet.ts
|
|
18735
|
-
import { z as
|
|
18775
|
+
import { z as z106 } from "zod";
|
|
18736
18776
|
var mosfetPins = [
|
|
18737
18777
|
"pin1",
|
|
18738
18778
|
"drain",
|
|
@@ -18742,11 +18782,11 @@ var mosfetPins = [
|
|
|
18742
18782
|
"gate"
|
|
18743
18783
|
];
|
|
18744
18784
|
var mosfetProps = commonComponentProps.extend({
|
|
18745
|
-
channelType:
|
|
18746
|
-
mosfetMode:
|
|
18747
|
-
symbolDrainSide:
|
|
18748
|
-
symbolSourceSide:
|
|
18749
|
-
symbolGateSide:
|
|
18785
|
+
channelType: z106.enum(["n", "p"]),
|
|
18786
|
+
mosfetMode: z106.enum(["enhancement", "depletion"]),
|
|
18787
|
+
symbolDrainSide: z106.enum(["left", "right", "top", "bottom"]).optional(),
|
|
18788
|
+
symbolSourceSide: z106.enum(["left", "right", "top", "bottom"]).optional(),
|
|
18789
|
+
symbolGateSide: z106.enum(["left", "right", "top", "bottom"]).optional(),
|
|
18750
18790
|
connections: createConnectionsProp(mosfetPins).optional()
|
|
18751
18791
|
});
|
|
18752
18792
|
expectTypesMatch(true);
|
|
@@ -18768,29 +18808,29 @@ expectTypesMatch(true);
|
|
|
18768
18808
|
|
|
18769
18809
|
// lib/components/inductor.ts
|
|
18770
18810
|
import { inductance as inductance2 } from "circuit-json";
|
|
18771
|
-
import { z as
|
|
18811
|
+
import { z as z108 } from "zod";
|
|
18772
18812
|
var inductorPins = lrPins;
|
|
18773
18813
|
var inductorProps = commonComponentProps.extend({
|
|
18774
18814
|
inductance: inductance2,
|
|
18775
|
-
maxCurrentRating:
|
|
18815
|
+
maxCurrentRating: z108.union([z108.string(), z108.number()]).optional(),
|
|
18776
18816
|
schOrientation: schematicOrientation.optional(),
|
|
18777
18817
|
connections: createConnectionsProp(inductorPins).optional()
|
|
18778
18818
|
});
|
|
18779
18819
|
expectTypesMatch(true);
|
|
18780
18820
|
|
|
18781
18821
|
// lib/components/internal-circuit.ts
|
|
18782
|
-
import { z as
|
|
18783
|
-
var internalCircuitProps =
|
|
18784
|
-
children:
|
|
18822
|
+
import { z as z109 } from "zod";
|
|
18823
|
+
var internalCircuitProps = z109.object({
|
|
18824
|
+
children: z109.custom().optional()
|
|
18785
18825
|
});
|
|
18786
18826
|
expectTypesMatch(
|
|
18787
18827
|
true
|
|
18788
18828
|
);
|
|
18789
18829
|
|
|
18790
18830
|
// lib/components/diode.ts
|
|
18791
|
-
import { z as
|
|
18831
|
+
import { z as z110 } from "zod";
|
|
18792
18832
|
var diodePins = lrPolarPins;
|
|
18793
|
-
var diodeConnectionKeys =
|
|
18833
|
+
var diodeConnectionKeys = z110.enum([
|
|
18794
18834
|
"anode",
|
|
18795
18835
|
"cathode",
|
|
18796
18836
|
"pin1",
|
|
@@ -18798,13 +18838,13 @@ var diodeConnectionKeys = z109.enum([
|
|
|
18798
18838
|
"pos",
|
|
18799
18839
|
"neg"
|
|
18800
18840
|
]);
|
|
18801
|
-
var connectionTarget3 =
|
|
18802
|
-
var connectionsProp2 =
|
|
18803
|
-
var diodePinLabelsProp =
|
|
18804
|
-
|
|
18805
|
-
schematicPinLabel.or(
|
|
18841
|
+
var connectionTarget3 = z110.string().or(z110.array(z110.string()).readonly()).or(z110.array(z110.string()));
|
|
18842
|
+
var connectionsProp2 = z110.record(diodeConnectionKeys, connectionTarget3);
|
|
18843
|
+
var diodePinLabelsProp = z110.record(
|
|
18844
|
+
z110.enum(diodePins),
|
|
18845
|
+
schematicPinLabel.or(z110.array(schematicPinLabel).readonly()).or(z110.array(schematicPinLabel))
|
|
18806
18846
|
);
|
|
18807
|
-
var diodeVariant =
|
|
18847
|
+
var diodeVariant = z110.enum([
|
|
18808
18848
|
"standard",
|
|
18809
18849
|
"schottky",
|
|
18810
18850
|
"zener",
|
|
@@ -18815,12 +18855,12 @@ var diodeVariant = z109.enum([
|
|
|
18815
18855
|
var diodeProps = commonComponentProps.extend({
|
|
18816
18856
|
connections: connectionsProp2.optional(),
|
|
18817
18857
|
variant: diodeVariant.optional().default("standard"),
|
|
18818
|
-
standard:
|
|
18819
|
-
schottky:
|
|
18820
|
-
zener:
|
|
18821
|
-
avalanche:
|
|
18822
|
-
photo:
|
|
18823
|
-
tvs:
|
|
18858
|
+
standard: z110.boolean().optional(),
|
|
18859
|
+
schottky: z110.boolean().optional(),
|
|
18860
|
+
zener: z110.boolean().optional(),
|
|
18861
|
+
avalanche: z110.boolean().optional(),
|
|
18862
|
+
photo: z110.boolean().optional(),
|
|
18863
|
+
tvs: z110.boolean().optional(),
|
|
18824
18864
|
schOrientation: schematicOrientation.optional(),
|
|
18825
18865
|
schSize: schematicSymbolSize.optional(),
|
|
18826
18866
|
pinLabels: diodePinLabelsProp.optional()
|
|
@@ -18835,11 +18875,11 @@ var diodeProps = commonComponentProps.extend({
|
|
|
18835
18875
|
].filter(Boolean).length;
|
|
18836
18876
|
if (enabledFlags > 1) {
|
|
18837
18877
|
ctx.addIssue({
|
|
18838
|
-
code:
|
|
18878
|
+
code: z110.ZodIssueCode.custom,
|
|
18839
18879
|
message: "Exactly one diode variant must be enabled",
|
|
18840
18880
|
path: []
|
|
18841
18881
|
});
|
|
18842
|
-
return
|
|
18882
|
+
return z110.INVALID;
|
|
18843
18883
|
}
|
|
18844
18884
|
}).transform((data) => {
|
|
18845
18885
|
const result = {
|
|
@@ -18885,18 +18925,18 @@ var diodeProps = commonComponentProps.extend({
|
|
|
18885
18925
|
expectTypesMatch(true);
|
|
18886
18926
|
|
|
18887
18927
|
// lib/components/led.ts
|
|
18888
|
-
import { z as
|
|
18889
|
-
var legacyNumericLedPinLabelsProp =
|
|
18890
|
-
|
|
18891
|
-
schematicPinLabel.or(
|
|
18928
|
+
import { z as z111 } from "zod";
|
|
18929
|
+
var legacyNumericLedPinLabelsProp = z111.record(
|
|
18930
|
+
z111.enum(["1", "2"]),
|
|
18931
|
+
schematicPinLabel.or(z111.array(schematicPinLabel).readonly()).or(z111.array(schematicPinLabel))
|
|
18892
18932
|
).transform((pinLabels) => ({
|
|
18893
18933
|
...pinLabels["1"] === void 0 ? {} : { pin1: pinLabels["1"] },
|
|
18894
18934
|
...pinLabels["2"] === void 0 ? {} : { pin2: pinLabels["2"] }
|
|
18895
18935
|
}));
|
|
18896
18936
|
var ledProps = commonComponentProps.extend({
|
|
18897
|
-
color:
|
|
18898
|
-
wavelength:
|
|
18899
|
-
schDisplayValue:
|
|
18937
|
+
color: z111.string().optional(),
|
|
18938
|
+
wavelength: z111.string().optional(),
|
|
18939
|
+
schDisplayValue: z111.string().optional(),
|
|
18900
18940
|
schOrientation: schematicOrientation.optional(),
|
|
18901
18941
|
/** Select a compact schematic symbol; omitted, default, and md retain the standard symbol. */
|
|
18902
18942
|
schSize: schematicSymbolSize.optional(),
|
|
@@ -18904,28 +18944,28 @@ var ledProps = commonComponentProps.extend({
|
|
|
18904
18944
|
// wrappers, then normalized to the canonical pin1/pin2 representation.
|
|
18905
18945
|
pinLabels: diodePinLabelsProp.or(legacyNumericLedPinLabelsProp).optional(),
|
|
18906
18946
|
connections: createConnectionsProp(lrPolarPins).optional(),
|
|
18907
|
-
laser:
|
|
18947
|
+
laser: z111.boolean().optional()
|
|
18908
18948
|
});
|
|
18909
18949
|
var ledPins = lrPolarPins;
|
|
18910
18950
|
|
|
18911
18951
|
// lib/components/switch.ts
|
|
18912
18952
|
import { ms as ms3, frequency as frequency4 } from "circuit-json";
|
|
18913
|
-
import { z as
|
|
18953
|
+
import { z as z112 } from "zod";
|
|
18914
18954
|
var switchProps = commonComponentProps.extend({
|
|
18915
|
-
type:
|
|
18916
|
-
isNormallyClosed:
|
|
18917
|
-
spst:
|
|
18918
|
-
spdt:
|
|
18919
|
-
dpst:
|
|
18920
|
-
dpdt:
|
|
18955
|
+
type: z112.enum(["spst", "spdt", "dpst", "dpdt"]).optional(),
|
|
18956
|
+
isNormallyClosed: z112.boolean().optional().default(false),
|
|
18957
|
+
spst: z112.boolean().optional(),
|
|
18958
|
+
spdt: z112.boolean().optional(),
|
|
18959
|
+
dpst: z112.boolean().optional(),
|
|
18960
|
+
dpdt: z112.boolean().optional(),
|
|
18921
18961
|
pinLabels: pinLabelsProp.optional(),
|
|
18922
18962
|
noConnect: noConnectProp.optional(),
|
|
18923
18963
|
simSwitchFrequency: frequency4.optional(),
|
|
18924
18964
|
simCloseAt: ms3.optional(),
|
|
18925
18965
|
simOpenAt: ms3.optional(),
|
|
18926
|
-
simStartClosed:
|
|
18927
|
-
simStartOpen:
|
|
18928
|
-
connections:
|
|
18966
|
+
simStartClosed: z112.boolean().optional(),
|
|
18967
|
+
simStartOpen: z112.boolean().optional(),
|
|
18968
|
+
connections: z112.custom().pipe(z112.record(z112.string(), connectionTarget)).optional()
|
|
18929
18969
|
}).transform((props) => {
|
|
18930
18970
|
const updatedProps = { ...props };
|
|
18931
18971
|
if (updatedProps.dpdt) {
|
|
@@ -18957,33 +18997,33 @@ expectTypesMatch(true);
|
|
|
18957
18997
|
|
|
18958
18998
|
// lib/components/fabrication-note-text.ts
|
|
18959
18999
|
import { length as length4 } from "circuit-json";
|
|
18960
|
-
import { z as
|
|
19000
|
+
import { z as z113 } from "zod";
|
|
18961
19001
|
var fabricationNoteTextProps = pcbLayoutProps.extend({
|
|
18962
|
-
text:
|
|
18963
|
-
anchorAlignment:
|
|
18964
|
-
font:
|
|
19002
|
+
text: z113.string(),
|
|
19003
|
+
anchorAlignment: z113.enum(["center", "top_left", "top_right", "bottom_left", "bottom_right"]).default("center"),
|
|
19004
|
+
font: z113.enum(["tscircuit2024"]).optional(),
|
|
18965
19005
|
fontSize: length4.optional(),
|
|
18966
|
-
color:
|
|
19006
|
+
color: z113.string().optional()
|
|
18967
19007
|
});
|
|
18968
19008
|
expectTypesMatch(true);
|
|
18969
19009
|
|
|
18970
19010
|
// lib/components/fabrication-note-rect.ts
|
|
18971
19011
|
import { distance as distance25 } from "circuit-json";
|
|
18972
|
-
import { z as
|
|
19012
|
+
import { z as z114 } from "zod";
|
|
18973
19013
|
var fabricationNoteRectProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
18974
19014
|
width: distance25,
|
|
18975
19015
|
height: distance25,
|
|
18976
19016
|
strokeWidth: distance25.optional(),
|
|
18977
|
-
isFilled:
|
|
18978
|
-
hasStroke:
|
|
18979
|
-
isStrokeDashed:
|
|
18980
|
-
color:
|
|
19017
|
+
isFilled: z114.boolean().optional(),
|
|
19018
|
+
hasStroke: z114.boolean().optional(),
|
|
19019
|
+
isStrokeDashed: z114.boolean().optional(),
|
|
19020
|
+
color: z114.string().optional(),
|
|
18981
19021
|
cornerRadius: distance25.optional()
|
|
18982
19022
|
});
|
|
18983
19023
|
|
|
18984
19024
|
// lib/components/fabrication-note-path.ts
|
|
18985
19025
|
import { length as length5, route_hint_point as route_hint_point3 } from "circuit-json";
|
|
18986
|
-
import { z as
|
|
19026
|
+
import { z as z115 } from "zod";
|
|
18987
19027
|
var fabricationNotePathProps = pcbLayoutProps.omit({
|
|
18988
19028
|
pcbLeftEdgeX: true,
|
|
18989
19029
|
pcbRightEdgeX: true,
|
|
@@ -18995,15 +19035,15 @@ var fabricationNotePathProps = pcbLayoutProps.omit({
|
|
|
18995
19035
|
pcbOffsetY: true,
|
|
18996
19036
|
pcbRotation: true
|
|
18997
19037
|
}).extend({
|
|
18998
|
-
route:
|
|
19038
|
+
route: z115.array(route_hint_point3),
|
|
18999
19039
|
strokeWidth: length5.optional(),
|
|
19000
|
-
color:
|
|
19040
|
+
color: z115.string().optional()
|
|
19001
19041
|
});
|
|
19002
19042
|
|
|
19003
19043
|
// lib/components/fabrication-note-dimension.ts
|
|
19004
19044
|
import { distance as distance26, length as length6 } from "circuit-json";
|
|
19005
|
-
import { z as
|
|
19006
|
-
var dimensionTarget =
|
|
19045
|
+
import { z as z116 } from "zod";
|
|
19046
|
+
var dimensionTarget = z116.union([z116.string(), point]);
|
|
19007
19047
|
var fabricationNoteDimensionProps = pcbLayoutProps.omit({
|
|
19008
19048
|
pcbLeftEdgeX: true,
|
|
19009
19049
|
pcbRightEdgeX: true,
|
|
@@ -19017,44 +19057,44 @@ var fabricationNoteDimensionProps = pcbLayoutProps.omit({
|
|
|
19017
19057
|
}).extend({
|
|
19018
19058
|
from: dimensionTarget,
|
|
19019
19059
|
to: dimensionTarget,
|
|
19020
|
-
text:
|
|
19060
|
+
text: z116.string().optional(),
|
|
19021
19061
|
offset: distance26.optional(),
|
|
19022
|
-
offsetDirection:
|
|
19023
|
-
font:
|
|
19062
|
+
offsetDirection: z116.object({ x: z116.number().finite(), y: z116.number().finite() }).optional(),
|
|
19063
|
+
font: z116.enum(["tscircuit2024"]).optional(),
|
|
19024
19064
|
fontSize: length6.optional(),
|
|
19025
|
-
color:
|
|
19065
|
+
color: z116.string().optional(),
|
|
19026
19066
|
arrowSize: distance26.optional(),
|
|
19027
|
-
units:
|
|
19028
|
-
outerEdgeToEdge:
|
|
19029
|
-
centerToCenter:
|
|
19030
|
-
innerEdgeToEdge:
|
|
19067
|
+
units: z116.enum(["in", "mm"]).optional(),
|
|
19068
|
+
outerEdgeToEdge: z116.literal(true).optional(),
|
|
19069
|
+
centerToCenter: z116.literal(true).optional(),
|
|
19070
|
+
innerEdgeToEdge: z116.literal(true).optional()
|
|
19031
19071
|
});
|
|
19032
19072
|
expectTypesMatch(true);
|
|
19033
19073
|
|
|
19034
19074
|
// lib/components/pcb-trace.ts
|
|
19035
19075
|
import { distance as distance27, route_hint_point as route_hint_point4 } from "circuit-json";
|
|
19036
|
-
import { z as
|
|
19037
|
-
var pcbTraceProps =
|
|
19038
|
-
layer:
|
|
19076
|
+
import { z as z117 } from "zod";
|
|
19077
|
+
var pcbTraceProps = z117.object({
|
|
19078
|
+
layer: z117.string().optional(),
|
|
19039
19079
|
thickness: distance27.optional(),
|
|
19040
|
-
route:
|
|
19080
|
+
route: z117.array(route_hint_point4)
|
|
19041
19081
|
});
|
|
19042
19082
|
|
|
19043
19083
|
// lib/components/via.ts
|
|
19044
19084
|
import { distance as distance28, layer_ref as layer_ref9 } from "circuit-json";
|
|
19045
|
-
import { z as
|
|
19085
|
+
import { z as z118 } from "zod";
|
|
19046
19086
|
var viaProps = commonLayoutProps.extend({
|
|
19047
|
-
name:
|
|
19087
|
+
name: z118.string().optional(),
|
|
19048
19088
|
fromLayer: layer_ref9.optional(),
|
|
19049
19089
|
toLayer: layer_ref9.optional(),
|
|
19050
19090
|
holeDiameter: distance28.optional(),
|
|
19051
19091
|
outerDiameter: distance28.optional(),
|
|
19052
|
-
layers:
|
|
19053
|
-
connectsTo:
|
|
19054
|
-
netIsAssignable:
|
|
19055
|
-
tented:
|
|
19056
|
-
|
|
19057
|
-
|
|
19092
|
+
layers: z118.array(layer_ref9).optional(),
|
|
19093
|
+
connectsTo: z118.string().or(z118.array(z118.string())).optional(),
|
|
19094
|
+
netIsAssignable: z118.boolean().optional(),
|
|
19095
|
+
tented: z118.union([
|
|
19096
|
+
z118.boolean(),
|
|
19097
|
+
z118.enum([
|
|
19058
19098
|
"both_sides",
|
|
19059
19099
|
"top_and_bottom_tented",
|
|
19060
19100
|
"top_tented",
|
|
@@ -19073,15 +19113,15 @@ expectTypesMatch(true);
|
|
|
19073
19113
|
|
|
19074
19114
|
// lib/components/testpoint.ts
|
|
19075
19115
|
import { distance as distance29 } from "circuit-json";
|
|
19076
|
-
import { z as
|
|
19116
|
+
import { z as z119 } from "zod";
|
|
19077
19117
|
var testpointPins = ["pin1"];
|
|
19078
|
-
var testpointConnectionsProp =
|
|
19118
|
+
var testpointConnectionsProp = z119.object({
|
|
19079
19119
|
pin1: connectionTarget
|
|
19080
19120
|
}).strict();
|
|
19081
19121
|
var testpointProps = commonComponentProps.extend({
|
|
19082
19122
|
connections: testpointConnectionsProp.optional(),
|
|
19083
|
-
footprintVariant:
|
|
19084
|
-
padShape:
|
|
19123
|
+
footprintVariant: z119.enum(["pad", "through_hole"]).optional(),
|
|
19124
|
+
padShape: z119.enum(["rect", "circle"]).optional().default("circle"),
|
|
19085
19125
|
padDiameter: distance29.optional(),
|
|
19086
19126
|
holeDiameter: distance29.optional(),
|
|
19087
19127
|
width: distance29.optional(),
|
|
@@ -19093,42 +19133,42 @@ var testpointProps = commonComponentProps.extend({
|
|
|
19093
19133
|
expectTypesMatch(true);
|
|
19094
19134
|
|
|
19095
19135
|
// lib/components/breakoutpoint.ts
|
|
19096
|
-
import { z as
|
|
19136
|
+
import { z as z120 } from "zod";
|
|
19097
19137
|
var breakoutPointProps = pcbLayoutProps.omit({ pcbRotation: true, layer: true }).extend({
|
|
19098
|
-
connection:
|
|
19138
|
+
connection: z120.string()
|
|
19099
19139
|
});
|
|
19100
19140
|
expectTypesMatch(true);
|
|
19101
19141
|
|
|
19102
19142
|
// lib/components/pcb-keepout.ts
|
|
19103
19143
|
import { distance as distance30, layer_ref as layer_ref10 } from "circuit-json";
|
|
19104
|
-
import { z as
|
|
19105
|
-
var pcbKeepoutProps =
|
|
19144
|
+
import { z as z121 } from "zod";
|
|
19145
|
+
var pcbKeepoutProps = z121.union([
|
|
19106
19146
|
pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
19107
|
-
shape:
|
|
19147
|
+
shape: z121.literal("circle"),
|
|
19108
19148
|
radius: distance30,
|
|
19109
|
-
layers:
|
|
19149
|
+
layers: z121.array(layer_ref10).optional(),
|
|
19110
19150
|
/** Report keepout violations as warnings when true. Omit for normal enforcement. */
|
|
19111
|
-
warningOnly:
|
|
19151
|
+
warningOnly: z121.boolean().optional(),
|
|
19112
19152
|
/** Allow trace crossings without keepout diagnostics. False or omitted retains enforcement; copper pours remain excluded. */
|
|
19113
|
-
allowTraces:
|
|
19153
|
+
allowTraces: z121.boolean().optional(),
|
|
19114
19154
|
/** Allow components and their pads/plated holes without keepout diagnostics. False or omitted retains enforcement; copper pours remain excluded. */
|
|
19115
|
-
allowPlacements:
|
|
19116
|
-
excludeRefs:
|
|
19155
|
+
allowPlacements: z121.boolean().optional(),
|
|
19156
|
+
excludeRefs: z121.array(z121.string()).optional().describe(
|
|
19117
19157
|
'Component selectors excluded from the keepout, such as ".ANT1"'
|
|
19118
19158
|
)
|
|
19119
19159
|
}),
|
|
19120
19160
|
pcbLayoutProps.extend({
|
|
19121
|
-
shape:
|
|
19161
|
+
shape: z121.literal("rect"),
|
|
19122
19162
|
width: distance30,
|
|
19123
19163
|
height: distance30,
|
|
19124
|
-
layers:
|
|
19164
|
+
layers: z121.array(layer_ref10).optional(),
|
|
19125
19165
|
/** Report keepout violations as warnings when true. Omit for normal enforcement. */
|
|
19126
|
-
warningOnly:
|
|
19166
|
+
warningOnly: z121.boolean().optional(),
|
|
19127
19167
|
/** Allow trace crossings without keepout diagnostics. False or omitted retains enforcement; copper pours remain excluded. */
|
|
19128
|
-
allowTraces:
|
|
19168
|
+
allowTraces: z121.boolean().optional(),
|
|
19129
19169
|
/** Allow components and their pads/plated holes without keepout diagnostics. False or omitted retains enforcement; copper pours remain excluded. */
|
|
19130
|
-
allowPlacements:
|
|
19131
|
-
excludeRefs:
|
|
19170
|
+
allowPlacements: z121.boolean().optional(),
|
|
19171
|
+
excludeRefs: z121.array(z121.string()).optional().describe(
|
|
19132
19172
|
'Component selectors excluded from the keepout, such as ".ANT1"'
|
|
19133
19173
|
)
|
|
19134
19174
|
})
|
|
@@ -19136,20 +19176,20 @@ var pcbKeepoutProps = z120.union([
|
|
|
19136
19176
|
|
|
19137
19177
|
// lib/components/courtyard-rect.ts
|
|
19138
19178
|
import { distance as distance31 } from "circuit-json";
|
|
19139
|
-
import { z as
|
|
19179
|
+
import { z as z122 } from "zod";
|
|
19140
19180
|
var courtyardRectProps = pcbLayoutProps.extend({
|
|
19141
19181
|
width: distance31,
|
|
19142
19182
|
height: distance31,
|
|
19143
19183
|
strokeWidth: distance31.optional(),
|
|
19144
|
-
isFilled:
|
|
19145
|
-
hasStroke:
|
|
19146
|
-
isStrokeDashed:
|
|
19147
|
-
color:
|
|
19184
|
+
isFilled: z122.boolean().optional(),
|
|
19185
|
+
hasStroke: z122.boolean().optional(),
|
|
19186
|
+
isStrokeDashed: z122.boolean().optional(),
|
|
19187
|
+
color: z122.string().optional()
|
|
19148
19188
|
});
|
|
19149
19189
|
|
|
19150
19190
|
// lib/components/courtyard-outline.ts
|
|
19151
19191
|
import { length as length7 } from "circuit-json";
|
|
19152
|
-
import { z as
|
|
19192
|
+
import { z as z123 } from "zod";
|
|
19153
19193
|
var courtyardOutlineProps = pcbLayoutProps.omit({
|
|
19154
19194
|
pcbLeftEdgeX: true,
|
|
19155
19195
|
pcbRightEdgeX: true,
|
|
@@ -19161,11 +19201,11 @@ var courtyardOutlineProps = pcbLayoutProps.omit({
|
|
|
19161
19201
|
pcbOffsetY: true,
|
|
19162
19202
|
pcbRotation: true
|
|
19163
19203
|
}).extend({
|
|
19164
|
-
outline:
|
|
19204
|
+
outline: z123.array(point),
|
|
19165
19205
|
strokeWidth: length7.optional(),
|
|
19166
|
-
isClosed:
|
|
19167
|
-
isStrokeDashed:
|
|
19168
|
-
color:
|
|
19206
|
+
isClosed: z123.boolean().optional(),
|
|
19207
|
+
isStrokeDashed: z123.boolean().optional(),
|
|
19208
|
+
color: z123.string().optional()
|
|
19169
19209
|
});
|
|
19170
19210
|
|
|
19171
19211
|
// lib/components/courtyard-circle.ts
|
|
@@ -19185,16 +19225,16 @@ var courtyardPillProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
|
19185
19225
|
});
|
|
19186
19226
|
|
|
19187
19227
|
// lib/components/copper-pour.ts
|
|
19188
|
-
import { z as
|
|
19228
|
+
import { z as z126 } from "zod";
|
|
19189
19229
|
import { layer_ref as layer_ref11 } from "circuit-json";
|
|
19190
|
-
var copperPourProps =
|
|
19191
|
-
name:
|
|
19230
|
+
var copperPourProps = z126.object({
|
|
19231
|
+
name: z126.string().optional(),
|
|
19192
19232
|
layer: layer_ref11,
|
|
19193
|
-
connectsTo:
|
|
19194
|
-
crosshatch:
|
|
19195
|
-
crosshatchPitch: distance.pipe(
|
|
19196
|
-
crosshatchWidth: distance.pipe(
|
|
19197
|
-
unbroken:
|
|
19233
|
+
connectsTo: z126.string(),
|
|
19234
|
+
crosshatch: z126.boolean().optional(),
|
|
19235
|
+
crosshatchPitch: distance.pipe(z126.number().finite().positive()).optional(),
|
|
19236
|
+
crosshatchWidth: distance.pipe(z126.number().finite().positive()).optional(),
|
|
19237
|
+
unbroken: z126.boolean().optional().describe(
|
|
19198
19238
|
"Reserves the pour region during autorouting so unrelated traces do not split it. Vias may still cross the region using antipads."
|
|
19199
19239
|
),
|
|
19200
19240
|
padMargin: distance.optional(),
|
|
@@ -19202,13 +19242,13 @@ var copperPourProps = z125.object({
|
|
|
19202
19242
|
clearance: distance.optional(),
|
|
19203
19243
|
boardEdgeMargin: distance.optional(),
|
|
19204
19244
|
cutoutMargin: distance.optional(),
|
|
19205
|
-
useThermalReliefs:
|
|
19206
|
-
outline:
|
|
19207
|
-
coveredWithSolderMask:
|
|
19245
|
+
useThermalReliefs: z126.boolean().optional(),
|
|
19246
|
+
outline: z126.array(point).optional(),
|
|
19247
|
+
coveredWithSolderMask: z126.boolean().optional().default(true)
|
|
19208
19248
|
}).superRefine((props, ctx) => {
|
|
19209
19249
|
if (props.crosshatch && (props.crosshatchWidth ?? 0.25) >= (props.crosshatchPitch ?? 1)) {
|
|
19210
19250
|
ctx.addIssue({
|
|
19211
|
-
code:
|
|
19251
|
+
code: z126.ZodIssueCode.custom,
|
|
19212
19252
|
path: ["crosshatchWidth"],
|
|
19213
19253
|
message: "crosshatchWidth must be less than crosshatchPitch"
|
|
19214
19254
|
});
|
|
@@ -19218,16 +19258,16 @@ expectTypesMatch(true);
|
|
|
19218
19258
|
|
|
19219
19259
|
// lib/components/cadassembly.ts
|
|
19220
19260
|
import { layer_ref as layer_ref12 } from "circuit-json";
|
|
19221
|
-
import { z as
|
|
19222
|
-
var cadassemblyProps =
|
|
19261
|
+
import { z as z127 } from "zod";
|
|
19262
|
+
var cadassemblyProps = z127.object({
|
|
19223
19263
|
originalLayer: layer_ref12.default("top").optional(),
|
|
19224
|
-
children:
|
|
19264
|
+
children: z127.any().optional()
|
|
19225
19265
|
});
|
|
19226
19266
|
expectTypesMatch(true);
|
|
19227
19267
|
|
|
19228
19268
|
// lib/components/cadmodel.ts
|
|
19229
|
-
import { z as
|
|
19230
|
-
var pcbPosition =
|
|
19269
|
+
import { z as z128 } from "zod";
|
|
19270
|
+
var pcbPosition = z128.object({
|
|
19231
19271
|
pcbX: pcbCoordinate.optional(),
|
|
19232
19272
|
pcbY: pcbCoordinate.optional(),
|
|
19233
19273
|
pcbLeftEdgeX: pcbCoordinate.optional(),
|
|
@@ -19244,7 +19284,7 @@ var cadModelBaseWithUrl = cadModelBase.extend({
|
|
|
19244
19284
|
});
|
|
19245
19285
|
var cadModelObject = cadModelBaseWithUrl.merge(pcbPosition);
|
|
19246
19286
|
expectTypesMatch(true);
|
|
19247
|
-
var cadmodelProps =
|
|
19287
|
+
var cadmodelProps = z128.union([z128.null(), url, cadModelObject]);
|
|
19248
19288
|
|
|
19249
19289
|
// lib/components/power-source.ts
|
|
19250
19290
|
import { voltage as voltage5 } from "circuit-json";
|
|
@@ -19254,9 +19294,9 @@ var powerSourceProps = commonComponentProps.extend({
|
|
|
19254
19294
|
|
|
19255
19295
|
// lib/components/voltagesource.ts
|
|
19256
19296
|
import { frequency as frequency5, ms as ms4, rotation as rotation6, voltage as voltage6 } from "circuit-json";
|
|
19257
|
-
import { z as
|
|
19297
|
+
import { z as z129 } from "zod";
|
|
19258
19298
|
var voltageSourcePinLabels = ["pin1", "pin2", "pos", "neg"];
|
|
19259
|
-
var percentage =
|
|
19299
|
+
var percentage = z129.union([z129.string(), z129.number()]).transform((val) => {
|
|
19260
19300
|
if (typeof val === "string") {
|
|
19261
19301
|
if (val.endsWith("%")) {
|
|
19262
19302
|
return parseFloat(val.slice(0, -1)) / 100;
|
|
@@ -19265,13 +19305,13 @@ var percentage = z128.union([z128.string(), z128.number()]).transform((val) => {
|
|
|
19265
19305
|
}
|
|
19266
19306
|
return val;
|
|
19267
19307
|
}).pipe(
|
|
19268
|
-
|
|
19308
|
+
z129.number().min(0, "Duty cycle must be non-negative").max(1, "Duty cycle cannot be greater than 100%")
|
|
19269
19309
|
);
|
|
19270
19310
|
var voltageSourceProps = commonComponentProps.extend({
|
|
19271
19311
|
voltage: voltage6.optional(),
|
|
19272
19312
|
frequency: frequency5.optional(),
|
|
19273
19313
|
peakToPeakVoltage: voltage6.optional(),
|
|
19274
|
-
waveShape:
|
|
19314
|
+
waveShape: z129.enum(["sinewave", "square", "triangle", "sawtooth"]).optional(),
|
|
19275
19315
|
phase: rotation6.optional(),
|
|
19276
19316
|
dutyCycle: percentage.optional(),
|
|
19277
19317
|
pulseDelay: ms4.optional(),
|
|
@@ -19288,9 +19328,9 @@ expectTypesMatch(true);
|
|
|
19288
19328
|
|
|
19289
19329
|
// lib/components/currentsource.ts
|
|
19290
19330
|
import { frequency as frequency6, rotation as rotation7, current as current3 } from "circuit-json";
|
|
19291
|
-
import { z as
|
|
19331
|
+
import { z as z130 } from "zod";
|
|
19292
19332
|
var currentSourcePinLabels = ["pin1", "pin2", "pos", "neg"];
|
|
19293
|
-
var percentage2 =
|
|
19333
|
+
var percentage2 = z130.union([z130.string(), z130.number()]).transform((val) => {
|
|
19294
19334
|
if (typeof val === "string") {
|
|
19295
19335
|
if (val.endsWith("%")) {
|
|
19296
19336
|
return parseFloat(val.slice(0, -1)) / 100;
|
|
@@ -19299,13 +19339,13 @@ var percentage2 = z129.union([z129.string(), z129.number()]).transform((val) =>
|
|
|
19299
19339
|
}
|
|
19300
19340
|
return val;
|
|
19301
19341
|
}).pipe(
|
|
19302
|
-
|
|
19342
|
+
z130.number().min(0, "Duty cycle must be non-negative").max(1, "Duty cycle cannot be greater than 100%")
|
|
19303
19343
|
);
|
|
19304
19344
|
var currentSourceProps = commonComponentProps.extend({
|
|
19305
19345
|
current: current3.optional(),
|
|
19306
19346
|
frequency: frequency6.optional(),
|
|
19307
19347
|
peakToPeakCurrent: current3.optional(),
|
|
19308
|
-
waveShape:
|
|
19348
|
+
waveShape: z130.enum(["sinewave", "square", "triangle", "sawtooth"]).optional(),
|
|
19309
19349
|
phase: rotation7.optional(),
|
|
19310
19350
|
dutyCycle: percentage2.optional(),
|
|
19311
19351
|
acMagnitude: current3.optional(),
|
|
@@ -19316,21 +19356,21 @@ var currentSourcePins = lrPolarPins;
|
|
|
19316
19356
|
expectTypesMatch(true);
|
|
19317
19357
|
|
|
19318
19358
|
// lib/components/voltageprobe.ts
|
|
19319
|
-
import { z as
|
|
19359
|
+
import { z as z131 } from "zod";
|
|
19320
19360
|
var voltageProbeProps = commonComponentProps.omit({ name: true }).extend({
|
|
19321
|
-
name:
|
|
19322
|
-
connectsTo:
|
|
19323
|
-
referenceTo:
|
|
19324
|
-
color:
|
|
19325
|
-
graphDisplayName:
|
|
19326
|
-
graphCenter:
|
|
19327
|
-
graphVerticalOffset:
|
|
19328
|
-
graphVoltagePerDiv:
|
|
19361
|
+
name: z131.string().optional(),
|
|
19362
|
+
connectsTo: z131.string(),
|
|
19363
|
+
referenceTo: z131.string().optional(),
|
|
19364
|
+
color: z131.string().optional(),
|
|
19365
|
+
graphDisplayName: z131.string().optional(),
|
|
19366
|
+
graphCenter: z131.number().optional(),
|
|
19367
|
+
graphVerticalOffset: z131.number().or(z131.string()).optional(),
|
|
19368
|
+
graphVoltagePerDiv: z131.number().or(z131.string()).optional()
|
|
19329
19369
|
});
|
|
19330
19370
|
expectTypesMatch(true);
|
|
19331
19371
|
|
|
19332
19372
|
// lib/components/ammeter.ts
|
|
19333
|
-
import { z as
|
|
19373
|
+
import { z as z132 } from "zod";
|
|
19334
19374
|
var ammeterPinLabels = ["pin1", "pin2", "pos", "neg"];
|
|
19335
19375
|
var hasAmmeterConnectionPair = (connections) => {
|
|
19336
19376
|
return connections.pos !== void 0 && connections.neg !== void 0 || connections.pin1 !== void 0 && connections.pin2 !== void 0;
|
|
@@ -19340,64 +19380,64 @@ var ammeterProps = commonComponentProps.extend({
|
|
|
19340
19380
|
hasAmmeterConnectionPair,
|
|
19341
19381
|
"Ammeter connections must include either pos/neg or pin1/pin2"
|
|
19342
19382
|
),
|
|
19343
|
-
color:
|
|
19344
|
-
graphDisplayName:
|
|
19345
|
-
graphCenter:
|
|
19346
|
-
graphVerticalOffset:
|
|
19347
|
-
graphCurrentPerDiv:
|
|
19383
|
+
color: z132.string().optional(),
|
|
19384
|
+
graphDisplayName: z132.string().optional(),
|
|
19385
|
+
graphCenter: z132.number().optional(),
|
|
19386
|
+
graphVerticalOffset: z132.number().or(z132.string()).optional(),
|
|
19387
|
+
graphCurrentPerDiv: z132.number().or(z132.string()).optional()
|
|
19348
19388
|
});
|
|
19349
19389
|
var ammeterPins = ammeterPinLabels;
|
|
19350
19390
|
expectTypesMatch(true);
|
|
19351
19391
|
|
|
19352
19392
|
// lib/components/schematic-arc.ts
|
|
19353
19393
|
import { distance as distance34, point as point5, rotation as rotation8 } from "circuit-json";
|
|
19354
|
-
import { z as
|
|
19355
|
-
var schematicArcProps =
|
|
19394
|
+
import { z as z133 } from "zod";
|
|
19395
|
+
var schematicArcProps = z133.object({
|
|
19356
19396
|
center: point5,
|
|
19357
19397
|
radius: distance34,
|
|
19358
19398
|
startAngleDegrees: rotation8,
|
|
19359
19399
|
endAngleDegrees: rotation8,
|
|
19360
|
-
direction:
|
|
19400
|
+
direction: z133.enum(["clockwise", "counterclockwise"]).default("counterclockwise"),
|
|
19361
19401
|
strokeWidth: distance34.optional(),
|
|
19362
|
-
color:
|
|
19363
|
-
isDashed:
|
|
19402
|
+
color: z133.string().optional(),
|
|
19403
|
+
isDashed: z133.boolean().optional().default(false)
|
|
19364
19404
|
});
|
|
19365
19405
|
expectTypesMatch(true);
|
|
19366
19406
|
|
|
19367
19407
|
// lib/components/toolingrail.ts
|
|
19368
|
-
import { z as
|
|
19369
|
-
var toolingrailProps =
|
|
19370
|
-
children:
|
|
19408
|
+
import { z as z134 } from "zod";
|
|
19409
|
+
var toolingrailProps = z134.object({
|
|
19410
|
+
children: z134.any().optional()
|
|
19371
19411
|
});
|
|
19372
19412
|
expectTypesMatch(true);
|
|
19373
19413
|
|
|
19374
19414
|
// lib/components/schematic-box.ts
|
|
19375
19415
|
import { distance as distance35 } from "circuit-json";
|
|
19376
|
-
import { z as
|
|
19377
|
-
var schematicBoxProps =
|
|
19378
|
-
name:
|
|
19379
|
-
chipRef:
|
|
19416
|
+
import { z as z135 } from "zod";
|
|
19417
|
+
var schematicBoxProps = z135.object({
|
|
19418
|
+
name: z135.string().optional(),
|
|
19419
|
+
chipRef: z135.string().optional(),
|
|
19380
19420
|
pinLabels: pinLabelsProp.optional(),
|
|
19381
19421
|
schPinArrangement: schematicPinArrangement.optional(),
|
|
19382
19422
|
schPinStyle: schematicPinStyle.optional(),
|
|
19383
19423
|
schX: distance35.optional(),
|
|
19384
19424
|
schY: distance35.optional(),
|
|
19385
|
-
schSectionName:
|
|
19386
|
-
schSheetName:
|
|
19425
|
+
schSectionName: z135.string().optional(),
|
|
19426
|
+
schSheetName: z135.string().optional(),
|
|
19387
19427
|
width: distance35.optional(),
|
|
19388
19428
|
height: distance35.optional(),
|
|
19389
|
-
overlay:
|
|
19429
|
+
overlay: z135.array(z135.string()).optional(),
|
|
19390
19430
|
padding: distance35.optional(),
|
|
19391
19431
|
paddingLeft: distance35.optional(),
|
|
19392
19432
|
paddingRight: distance35.optional(),
|
|
19393
19433
|
paddingTop: distance35.optional(),
|
|
19394
19434
|
paddingBottom: distance35.optional(),
|
|
19395
|
-
title:
|
|
19435
|
+
title: z135.string().optional(),
|
|
19396
19436
|
titleAlignment: ninePointAnchor.default("top_left"),
|
|
19397
|
-
titleColor:
|
|
19437
|
+
titleColor: z135.string().optional(),
|
|
19398
19438
|
titleFontSize: distance35.optional(),
|
|
19399
|
-
titleInside:
|
|
19400
|
-
strokeStyle:
|
|
19439
|
+
titleInside: z135.boolean().default(false),
|
|
19440
|
+
strokeStyle: z135.enum(["solid", "dashed"]).default("solid")
|
|
19401
19441
|
}).refine(
|
|
19402
19442
|
(elm) => elm.width !== void 0 && elm.height !== void 0 || Array.isArray(elm.overlay) && elm.overlay.length > 0,
|
|
19403
19443
|
{
|
|
@@ -19413,21 +19453,21 @@ expectTypesMatch(true);
|
|
|
19413
19453
|
|
|
19414
19454
|
// lib/components/schematic-symbol.ts
|
|
19415
19455
|
import { rotation as rotation9 } from "circuit-json";
|
|
19416
|
-
import { z as
|
|
19417
|
-
var schematicSymbolConnections =
|
|
19456
|
+
import { z as z136 } from "zod";
|
|
19457
|
+
var schematicSymbolConnections = z136.custom().pipe(z136.record(z136.string(), connectionTarget)).refine((value) => Object.keys(value).length > 0, {
|
|
19418
19458
|
message: "connections must map at least one schematic symbol port"
|
|
19419
19459
|
});
|
|
19420
|
-
var schematicSymbolProps =
|
|
19421
|
-
name:
|
|
19422
|
-
displayName:
|
|
19423
|
-
chipRef:
|
|
19424
|
-
symbolName:
|
|
19460
|
+
var schematicSymbolProps = z136.object({
|
|
19461
|
+
name: z136.string().min(1),
|
|
19462
|
+
displayName: z136.string().optional(),
|
|
19463
|
+
chipRef: z136.string().min(1).optional(),
|
|
19464
|
+
symbolName: z136.string().min(1),
|
|
19425
19465
|
connections: schematicSymbolConnections.optional(),
|
|
19426
19466
|
schX: distance.optional(),
|
|
19427
19467
|
schY: distance.optional(),
|
|
19428
19468
|
schRotation: rotation9.optional(),
|
|
19429
|
-
schSectionName:
|
|
19430
|
-
schSheetName:
|
|
19469
|
+
schSectionName: z136.string().optional(),
|
|
19470
|
+
schSheetName: z136.string().optional()
|
|
19431
19471
|
});
|
|
19432
19472
|
expectTypesMatch(
|
|
19433
19473
|
true
|
|
@@ -19435,15 +19475,15 @@ expectTypesMatch(
|
|
|
19435
19475
|
|
|
19436
19476
|
// lib/components/schematic-circle.ts
|
|
19437
19477
|
import { distance as distance36, point as point6 } from "circuit-json";
|
|
19438
|
-
import { z as
|
|
19439
|
-
var schematicCircleProps =
|
|
19478
|
+
import { z as z137 } from "zod";
|
|
19479
|
+
var schematicCircleProps = z137.object({
|
|
19440
19480
|
center: point6,
|
|
19441
19481
|
radius: distance36,
|
|
19442
19482
|
strokeWidth: distance36.optional(),
|
|
19443
|
-
color:
|
|
19444
|
-
isFilled:
|
|
19445
|
-
fillColor:
|
|
19446
|
-
isDashed:
|
|
19483
|
+
color: z137.string().optional(),
|
|
19484
|
+
isFilled: z137.boolean().optional().default(false),
|
|
19485
|
+
fillColor: z137.string().optional(),
|
|
19486
|
+
isDashed: z137.boolean().optional().default(false)
|
|
19447
19487
|
});
|
|
19448
19488
|
expectTypesMatch(
|
|
19449
19489
|
true
|
|
@@ -19451,32 +19491,32 @@ expectTypesMatch(
|
|
|
19451
19491
|
|
|
19452
19492
|
// lib/components/schematic-rect.ts
|
|
19453
19493
|
import { distance as distance37, rotation as rotation10 } from "circuit-json";
|
|
19454
|
-
import { z as
|
|
19455
|
-
var schematicRectProps =
|
|
19494
|
+
import { z as z138 } from "zod";
|
|
19495
|
+
var schematicRectProps = z138.object({
|
|
19456
19496
|
schX: distance37.optional(),
|
|
19457
19497
|
schY: distance37.optional(),
|
|
19458
19498
|
width: distance37,
|
|
19459
19499
|
height: distance37,
|
|
19460
19500
|
rotation: rotation10.default(0),
|
|
19461
19501
|
strokeWidth: distance37.optional(),
|
|
19462
|
-
color:
|
|
19463
|
-
isFilled:
|
|
19464
|
-
fillColor:
|
|
19465
|
-
isDashed:
|
|
19502
|
+
color: z138.string().optional(),
|
|
19503
|
+
isFilled: z138.boolean().optional().default(false),
|
|
19504
|
+
fillColor: z138.string().optional(),
|
|
19505
|
+
isDashed: z138.boolean().optional().default(false)
|
|
19466
19506
|
});
|
|
19467
19507
|
expectTypesMatch(true);
|
|
19468
19508
|
|
|
19469
19509
|
// lib/components/schematic-line.ts
|
|
19470
19510
|
import { distance as distance38 } from "circuit-json";
|
|
19471
|
-
import { z as
|
|
19472
|
-
var schematicLineProps =
|
|
19511
|
+
import { z as z139 } from "zod";
|
|
19512
|
+
var schematicLineProps = z139.object({
|
|
19473
19513
|
x1: distance38,
|
|
19474
19514
|
y1: distance38,
|
|
19475
19515
|
x2: distance38,
|
|
19476
19516
|
y2: distance38,
|
|
19477
19517
|
strokeWidth: distance38.optional(),
|
|
19478
|
-
color:
|
|
19479
|
-
isDashed:
|
|
19518
|
+
color: z139.string().optional(),
|
|
19519
|
+
isDashed: z139.boolean().optional().default(false),
|
|
19480
19520
|
dashLength: distance38.optional(),
|
|
19481
19521
|
dashGap: distance38.optional()
|
|
19482
19522
|
});
|
|
@@ -19484,11 +19524,11 @@ expectTypesMatch(true);
|
|
|
19484
19524
|
|
|
19485
19525
|
// lib/components/schematic-text.ts
|
|
19486
19526
|
import { distance as distance39, rotation as rotation11 } from "circuit-json";
|
|
19487
|
-
import { z as
|
|
19527
|
+
import { z as z141 } from "zod";
|
|
19488
19528
|
|
|
19489
19529
|
// lib/common/fivePointAnchor.ts
|
|
19490
|
-
import { z as
|
|
19491
|
-
var fivePointAnchor =
|
|
19530
|
+
import { z as z140 } from "zod";
|
|
19531
|
+
var fivePointAnchor = z140.enum([
|
|
19492
19532
|
"center",
|
|
19493
19533
|
"left",
|
|
19494
19534
|
"right",
|
|
@@ -19497,39 +19537,39 @@ var fivePointAnchor = z139.enum([
|
|
|
19497
19537
|
]);
|
|
19498
19538
|
|
|
19499
19539
|
// lib/components/schematic-text.ts
|
|
19500
|
-
var schematicTextProps =
|
|
19540
|
+
var schematicTextProps = z141.object({
|
|
19501
19541
|
schX: distance39.optional(),
|
|
19502
19542
|
schY: distance39.optional(),
|
|
19503
|
-
text:
|
|
19504
|
-
fontSize:
|
|
19505
|
-
anchor:
|
|
19506
|
-
color:
|
|
19543
|
+
text: z141.string(),
|
|
19544
|
+
fontSize: z141.number().default(1),
|
|
19545
|
+
anchor: z141.union([fivePointAnchor.describe("legacy"), ninePointAnchor]).default("center"),
|
|
19546
|
+
color: z141.string().default("#000000"),
|
|
19507
19547
|
schRotation: rotation11.default(0)
|
|
19508
19548
|
});
|
|
19509
19549
|
expectTypesMatch(true);
|
|
19510
19550
|
|
|
19511
19551
|
// lib/components/schematic-path.ts
|
|
19512
19552
|
import { distance as distance40, point as point7 } from "circuit-json";
|
|
19513
|
-
import { z as
|
|
19514
|
-
var schematicPathProps =
|
|
19515
|
-
points:
|
|
19516
|
-
svgPath:
|
|
19553
|
+
import { z as z142 } from "zod";
|
|
19554
|
+
var schematicPathProps = z142.object({
|
|
19555
|
+
points: z142.array(point7).optional(),
|
|
19556
|
+
svgPath: z142.string().optional(),
|
|
19517
19557
|
strokeWidth: distance40.optional(),
|
|
19518
|
-
strokeColor:
|
|
19558
|
+
strokeColor: z142.string().optional(),
|
|
19519
19559
|
dashLength: distance40.optional(),
|
|
19520
19560
|
dashGap: distance40.optional(),
|
|
19521
|
-
isFilled:
|
|
19522
|
-
fillColor:
|
|
19561
|
+
isFilled: z142.boolean().optional().default(false),
|
|
19562
|
+
fillColor: z142.string().optional()
|
|
19523
19563
|
});
|
|
19524
19564
|
expectTypesMatch(true);
|
|
19525
19565
|
|
|
19526
19566
|
// lib/components/schematic-table.ts
|
|
19527
19567
|
import { distance as distance41 } from "circuit-json";
|
|
19528
|
-
import { z as
|
|
19529
|
-
var schematicTableProps =
|
|
19568
|
+
import { z as z143 } from "zod";
|
|
19569
|
+
var schematicTableProps = z143.object({
|
|
19530
19570
|
schX: distance41.optional(),
|
|
19531
19571
|
schY: distance41.optional(),
|
|
19532
|
-
children:
|
|
19572
|
+
children: z143.any().optional(),
|
|
19533
19573
|
cellPadding: distance41.optional(),
|
|
19534
19574
|
borderWidth: distance41.optional(),
|
|
19535
19575
|
anchor: ninePointAnchor.optional(),
|
|
@@ -19539,34 +19579,34 @@ expectTypesMatch(true);
|
|
|
19539
19579
|
|
|
19540
19580
|
// lib/components/schematic-row.ts
|
|
19541
19581
|
import { distance as distance42 } from "circuit-json";
|
|
19542
|
-
import { z as
|
|
19543
|
-
var schematicRowProps =
|
|
19544
|
-
children:
|
|
19582
|
+
import { z as z144 } from "zod";
|
|
19583
|
+
var schematicRowProps = z144.object({
|
|
19584
|
+
children: z144.any().optional(),
|
|
19545
19585
|
height: distance42.optional()
|
|
19546
19586
|
});
|
|
19547
19587
|
expectTypesMatch(true);
|
|
19548
19588
|
|
|
19549
19589
|
// lib/components/schematic-cell.ts
|
|
19550
19590
|
import { distance as distance43 } from "circuit-json";
|
|
19551
|
-
import { z as
|
|
19552
|
-
var schematicCellProps =
|
|
19553
|
-
children:
|
|
19554
|
-
horizontalAlign:
|
|
19555
|
-
verticalAlign:
|
|
19591
|
+
import { z as z145 } from "zod";
|
|
19592
|
+
var schematicCellProps = z145.object({
|
|
19593
|
+
children: z145.string().optional(),
|
|
19594
|
+
horizontalAlign: z145.enum(["left", "center", "right"]).optional(),
|
|
19595
|
+
verticalAlign: z145.enum(["top", "middle", "bottom"]).optional(),
|
|
19556
19596
|
fontSize: distance43.optional(),
|
|
19557
|
-
rowSpan:
|
|
19558
|
-
colSpan:
|
|
19597
|
+
rowSpan: z145.number().optional(),
|
|
19598
|
+
colSpan: z145.number().optional(),
|
|
19559
19599
|
width: distance43.optional(),
|
|
19560
|
-
text:
|
|
19600
|
+
text: z145.string().optional()
|
|
19561
19601
|
});
|
|
19562
19602
|
expectTypesMatch(true);
|
|
19563
19603
|
|
|
19564
19604
|
// lib/components/schematic-section.ts
|
|
19565
19605
|
import { distance as distance44 } from "circuit-json";
|
|
19566
|
-
import { z as
|
|
19567
|
-
var schematicSectionProps =
|
|
19568
|
-
displayName:
|
|
19569
|
-
name:
|
|
19606
|
+
import { z as z146 } from "zod";
|
|
19607
|
+
var schematicSectionProps = z146.object({
|
|
19608
|
+
displayName: z146.string().optional(),
|
|
19609
|
+
name: z146.string(),
|
|
19570
19610
|
sectionTitleFontSize: distance44.optional()
|
|
19571
19611
|
});
|
|
19572
19612
|
expectTypesMatch(
|
|
@@ -19574,30 +19614,30 @@ expectTypesMatch(
|
|
|
19574
19614
|
);
|
|
19575
19615
|
|
|
19576
19616
|
// lib/components/schematic-sheet.ts
|
|
19577
|
-
import { z as
|
|
19617
|
+
import { z as z147 } from "zod";
|
|
19578
19618
|
import { distance as distance45 } from "circuit-json";
|
|
19579
|
-
var schematicSheetProps =
|
|
19580
|
-
name:
|
|
19581
|
-
displayName:
|
|
19582
|
-
sheetIndex:
|
|
19583
|
-
sheetSize:
|
|
19584
|
-
sheetWidth: distance45.pipe(
|
|
19585
|
-
sheetHeight: distance45.pipe(
|
|
19586
|
-
children:
|
|
19619
|
+
var schematicSheetProps = z147.object({
|
|
19620
|
+
name: z147.string().optional(),
|
|
19621
|
+
displayName: z147.string().optional(),
|
|
19622
|
+
sheetIndex: z147.number().optional(),
|
|
19623
|
+
sheetSize: z147.enum(["A4", "ANSI_B"]).default("A4"),
|
|
19624
|
+
sheetWidth: distance45.pipe(z147.number().positive()).optional(),
|
|
19625
|
+
sheetHeight: distance45.pipe(z147.number().positive()).optional(),
|
|
19626
|
+
children: z147.any().optional()
|
|
19587
19627
|
});
|
|
19588
19628
|
expectTypesMatch(true);
|
|
19589
19629
|
|
|
19590
19630
|
// lib/components/schematic-graphic.ts
|
|
19591
|
-
import { z as
|
|
19631
|
+
import { z as z148 } from "zod";
|
|
19592
19632
|
var nonemptyUrl = url.refine((value) => value.trim().length > 0, {
|
|
19593
19633
|
message: "imageUrl cannot be empty"
|
|
19594
19634
|
});
|
|
19595
19635
|
var positiveDistance5 = (fieldName) => distance.refine((value) => Number.isFinite(value) && value > 0, {
|
|
19596
19636
|
message: `${fieldName} must be a positive finite distance`
|
|
19597
19637
|
});
|
|
19598
|
-
var schematicGraphicProps =
|
|
19638
|
+
var schematicGraphicProps = z148.object({
|
|
19599
19639
|
imageUrl: nonemptyUrl.optional(),
|
|
19600
|
-
svgContent:
|
|
19640
|
+
svgContent: z148.string().refine((value) => value.trim().length > 0, {
|
|
19601
19641
|
message: "svgContent cannot be empty"
|
|
19602
19642
|
}).optional(),
|
|
19603
19643
|
width: positiveDistance5("width").optional(),
|
|
@@ -19605,7 +19645,7 @@ var schematicGraphicProps = z147.object({
|
|
|
19605
19645
|
}).superRefine(({ imageUrl, svgContent }, ctx) => {
|
|
19606
19646
|
if (imageUrl === void 0 && svgContent === void 0) {
|
|
19607
19647
|
ctx.addIssue({
|
|
19608
|
-
code:
|
|
19648
|
+
code: z148.ZodIssueCode.custom,
|
|
19609
19649
|
message: "At least one of imageUrl or svgContent is required"
|
|
19610
19650
|
});
|
|
19611
19651
|
}
|
|
@@ -19616,40 +19656,40 @@ expectTypesMatch(
|
|
|
19616
19656
|
|
|
19617
19657
|
// lib/components/copper-text.ts
|
|
19618
19658
|
import { layer_ref as layer_ref13, length as length8 } from "circuit-json";
|
|
19619
|
-
import { z as
|
|
19659
|
+
import { z as z149 } from "zod";
|
|
19620
19660
|
var copperTextProps = pcbLayoutProps.extend({
|
|
19621
|
-
text:
|
|
19661
|
+
text: z149.string(),
|
|
19622
19662
|
anchorAlignment: ninePointAnchor.default("center"),
|
|
19623
|
-
font:
|
|
19663
|
+
font: z149.enum(["tscircuit2024"]).optional(),
|
|
19624
19664
|
fontSize: length8.optional(),
|
|
19625
|
-
layers:
|
|
19626
|
-
knockout:
|
|
19627
|
-
mirrored:
|
|
19665
|
+
layers: z149.array(layer_ref13).optional(),
|
|
19666
|
+
knockout: z149.boolean().optional(),
|
|
19667
|
+
mirrored: z149.boolean().optional()
|
|
19628
19668
|
});
|
|
19629
19669
|
|
|
19630
19670
|
// lib/components/silkscreen-text.ts
|
|
19631
19671
|
import { layer_ref as layer_ref14, length as length9 } from "circuit-json";
|
|
19632
|
-
import { z as
|
|
19672
|
+
import { z as z150 } from "zod";
|
|
19633
19673
|
var silkscreenTextProps = pcbLayoutProps.extend({
|
|
19634
|
-
text:
|
|
19674
|
+
text: z150.string(),
|
|
19635
19675
|
anchorAlignment: ninePointAnchor.default("center"),
|
|
19636
|
-
font:
|
|
19676
|
+
font: z150.enum(["tscircuit2024"]).optional(),
|
|
19637
19677
|
fontSize: length9.optional(),
|
|
19638
19678
|
/**
|
|
19639
19679
|
* If true, text will knock out underlying silkscreen
|
|
19640
19680
|
*/
|
|
19641
|
-
isKnockout:
|
|
19681
|
+
isKnockout: z150.boolean().optional(),
|
|
19642
19682
|
knockoutPadding: length9.optional(),
|
|
19643
19683
|
knockoutPaddingLeft: length9.optional(),
|
|
19644
19684
|
knockoutPaddingRight: length9.optional(),
|
|
19645
19685
|
knockoutPaddingTop: length9.optional(),
|
|
19646
19686
|
knockoutPaddingBottom: length9.optional(),
|
|
19647
|
-
layers:
|
|
19687
|
+
layers: z150.array(layer_ref14).optional()
|
|
19648
19688
|
});
|
|
19649
19689
|
|
|
19650
19690
|
// lib/components/silkscreen-path.ts
|
|
19651
19691
|
import { length as length10, route_hint_point as route_hint_point5 } from "circuit-json";
|
|
19652
|
-
import { z as
|
|
19692
|
+
import { z as z151 } from "zod";
|
|
19653
19693
|
var silkscreenPathProps = pcbLayoutProps.omit({
|
|
19654
19694
|
pcbLeftEdgeX: true,
|
|
19655
19695
|
pcbRightEdgeX: true,
|
|
@@ -19661,7 +19701,7 @@ var silkscreenPathProps = pcbLayoutProps.omit({
|
|
|
19661
19701
|
pcbOffsetY: true,
|
|
19662
19702
|
pcbRotation: true
|
|
19663
19703
|
}).extend({
|
|
19664
|
-
route:
|
|
19704
|
+
route: z151.array(route_hint_point5),
|
|
19665
19705
|
strokeWidth: length10.optional()
|
|
19666
19706
|
});
|
|
19667
19707
|
|
|
@@ -19683,10 +19723,10 @@ var silkscreenLineProps = pcbLayoutProps.omit({
|
|
|
19683
19723
|
|
|
19684
19724
|
// lib/components/silkscreen-rect.ts
|
|
19685
19725
|
import { distance as distance47 } from "circuit-json";
|
|
19686
|
-
import { z as
|
|
19726
|
+
import { z as z152 } from "zod";
|
|
19687
19727
|
var silkscreenRectProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
19688
|
-
filled:
|
|
19689
|
-
stroke:
|
|
19728
|
+
filled: z152.boolean().default(true).optional(),
|
|
19729
|
+
stroke: z152.enum(["dashed", "solid", "none"]).optional(),
|
|
19690
19730
|
strokeWidth: distance47.optional(),
|
|
19691
19731
|
width: distance47,
|
|
19692
19732
|
height: distance47,
|
|
@@ -19695,10 +19735,10 @@ var silkscreenRectProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
|
19695
19735
|
|
|
19696
19736
|
// lib/components/silkscreen-circle.ts
|
|
19697
19737
|
import { distance as distance48 } from "circuit-json";
|
|
19698
|
-
import { z as
|
|
19738
|
+
import { z as z153 } from "zod";
|
|
19699
19739
|
var silkscreenCircleProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
19700
|
-
isFilled:
|
|
19701
|
-
isOutline:
|
|
19740
|
+
isFilled: z153.boolean().optional(),
|
|
19741
|
+
isOutline: z153.boolean().optional(),
|
|
19702
19742
|
strokeWidth: distance48.optional(),
|
|
19703
19743
|
radius: distance48
|
|
19704
19744
|
});
|
|
@@ -19716,69 +19756,69 @@ expectTypesMatch(true);
|
|
|
19716
19756
|
|
|
19717
19757
|
// lib/components/trace-hint.ts
|
|
19718
19758
|
import { distance as distance49, layer_ref as layer_ref15, route_hint_point as route_hint_point6 } from "circuit-json";
|
|
19719
|
-
import { z as
|
|
19720
|
-
var routeHintPointProps =
|
|
19759
|
+
import { z as z155 } from "zod";
|
|
19760
|
+
var routeHintPointProps = z155.object({
|
|
19721
19761
|
x: distance49,
|
|
19722
19762
|
y: distance49,
|
|
19723
|
-
via:
|
|
19763
|
+
via: z155.boolean().optional(),
|
|
19724
19764
|
toLayer: layer_ref15.optional()
|
|
19725
19765
|
});
|
|
19726
|
-
var traceHintProps =
|
|
19727
|
-
for:
|
|
19766
|
+
var traceHintProps = z155.object({
|
|
19767
|
+
for: z155.string().optional().describe(
|
|
19728
19768
|
"Selector for the port you're targeting, not required if you're inside a trace"
|
|
19729
19769
|
),
|
|
19730
|
-
order:
|
|
19770
|
+
order: z155.number().optional(),
|
|
19731
19771
|
offset: route_hint_point6.or(routeHintPointProps).optional(),
|
|
19732
|
-
offsets:
|
|
19733
|
-
traceWidth:
|
|
19772
|
+
offsets: z155.array(route_hint_point6).or(z155.array(routeHintPointProps)).optional(),
|
|
19773
|
+
traceWidth: z155.number().optional()
|
|
19734
19774
|
});
|
|
19735
19775
|
|
|
19736
19776
|
// lib/components/port.ts
|
|
19737
19777
|
import { distance as distance50 } from "circuit-json";
|
|
19738
|
-
import { z as
|
|
19778
|
+
import { z as z156 } from "zod";
|
|
19739
19779
|
var portProps = commonLayoutProps.extend({
|
|
19740
|
-
name:
|
|
19741
|
-
pinNumber:
|
|
19742
|
-
schStemLength:
|
|
19743
|
-
schPinLabelFontSize:
|
|
19780
|
+
name: z156.string().optional(),
|
|
19781
|
+
pinNumber: z156.number().optional(),
|
|
19782
|
+
schStemLength: z156.number().optional(),
|
|
19783
|
+
schPinLabelFontSize: z156.enum(["default", "sm"]).or(
|
|
19744
19784
|
distance50.refine((value) => Number.isFinite(value) && value > 0, {
|
|
19745
19785
|
message: "Schematic pin-label font size must be positive and finite"
|
|
19746
19786
|
})
|
|
19747
19787
|
).optional(),
|
|
19748
|
-
aliases:
|
|
19749
|
-
layer:
|
|
19750
|
-
layers:
|
|
19751
|
-
schX:
|
|
19752
|
-
schY:
|
|
19788
|
+
aliases: z156.array(z156.string()).optional(),
|
|
19789
|
+
layer: z156.string().optional(),
|
|
19790
|
+
layers: z156.array(z156.string()).optional(),
|
|
19791
|
+
schX: z156.number().optional(),
|
|
19792
|
+
schY: z156.number().optional(),
|
|
19753
19793
|
direction: direction.optional(),
|
|
19754
|
-
connectsTo:
|
|
19794
|
+
connectsTo: z156.string().or(z156.array(z156.string())).optional(),
|
|
19755
19795
|
kicadPinMetadata: kicadPinMetadata.optional(),
|
|
19756
|
-
hasInversionCircle:
|
|
19796
|
+
hasInversionCircle: z156.boolean().optional()
|
|
19757
19797
|
});
|
|
19758
19798
|
|
|
19759
19799
|
// lib/components/pcb-note-text.ts
|
|
19760
19800
|
import { length as length11 } from "circuit-json";
|
|
19761
|
-
import { z as
|
|
19801
|
+
import { z as z157 } from "zod";
|
|
19762
19802
|
var pcbNoteTextProps = pcbLayoutProps.extend({
|
|
19763
|
-
text:
|
|
19764
|
-
anchorAlignment:
|
|
19765
|
-
font:
|
|
19803
|
+
text: z157.string(),
|
|
19804
|
+
anchorAlignment: z157.enum(["center", "top_left", "top_right", "bottom_left", "bottom_right"]).default("center"),
|
|
19805
|
+
font: z157.enum(["tscircuit2024"]).optional(),
|
|
19766
19806
|
fontSize: length11.optional(),
|
|
19767
|
-
color:
|
|
19807
|
+
color: z157.string().optional()
|
|
19768
19808
|
});
|
|
19769
19809
|
expectTypesMatch(true);
|
|
19770
19810
|
|
|
19771
19811
|
// lib/components/pcb-note-rect.ts
|
|
19772
19812
|
import { distance as distance51 } from "circuit-json";
|
|
19773
|
-
import { z as
|
|
19813
|
+
import { z as z158 } from "zod";
|
|
19774
19814
|
var pcbNoteRectProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
19775
19815
|
width: distance51,
|
|
19776
19816
|
height: distance51,
|
|
19777
19817
|
strokeWidth: distance51.optional(),
|
|
19778
|
-
isFilled:
|
|
19779
|
-
hasStroke:
|
|
19780
|
-
isStrokeDashed:
|
|
19781
|
-
color:
|
|
19818
|
+
isFilled: z158.boolean().optional(),
|
|
19819
|
+
hasStroke: z158.boolean().optional(),
|
|
19820
|
+
isStrokeDashed: z158.boolean().optional(),
|
|
19821
|
+
color: z158.string().optional(),
|
|
19782
19822
|
cornerRadius: distance51.optional()
|
|
19783
19823
|
});
|
|
19784
19824
|
expectTypesMatch(true);
|
|
@@ -19788,7 +19828,7 @@ import {
|
|
|
19788
19828
|
length as length12,
|
|
19789
19829
|
route_hint_point as route_hint_point7
|
|
19790
19830
|
} from "circuit-json";
|
|
19791
|
-
import { z as
|
|
19831
|
+
import { z as z159 } from "zod";
|
|
19792
19832
|
var pcbNotePathProps = pcbLayoutProps.omit({
|
|
19793
19833
|
pcbLeftEdgeX: true,
|
|
19794
19834
|
pcbRightEdgeX: true,
|
|
@@ -19800,15 +19840,15 @@ var pcbNotePathProps = pcbLayoutProps.omit({
|
|
|
19800
19840
|
pcbOffsetY: true,
|
|
19801
19841
|
pcbRotation: true
|
|
19802
19842
|
}).extend({
|
|
19803
|
-
route:
|
|
19843
|
+
route: z159.array(route_hint_point7),
|
|
19804
19844
|
strokeWidth: length12.optional(),
|
|
19805
|
-
color:
|
|
19845
|
+
color: z159.string().optional()
|
|
19806
19846
|
});
|
|
19807
19847
|
expectTypesMatch(true);
|
|
19808
19848
|
|
|
19809
19849
|
// lib/components/pcb-note-line.ts
|
|
19810
19850
|
import { distance as distance52 } from "circuit-json";
|
|
19811
|
-
import { z as
|
|
19851
|
+
import { z as z160 } from "zod";
|
|
19812
19852
|
var pcbNoteLineProps = pcbLayoutProps.omit({
|
|
19813
19853
|
pcbLeftEdgeX: true,
|
|
19814
19854
|
pcbRightEdgeX: true,
|
|
@@ -19825,15 +19865,15 @@ var pcbNoteLineProps = pcbLayoutProps.omit({
|
|
|
19825
19865
|
x2: distance52,
|
|
19826
19866
|
y2: distance52,
|
|
19827
19867
|
strokeWidth: distance52.optional(),
|
|
19828
|
-
color:
|
|
19829
|
-
isDashed:
|
|
19868
|
+
color: z160.string().optional(),
|
|
19869
|
+
isDashed: z160.boolean().optional()
|
|
19830
19870
|
});
|
|
19831
19871
|
expectTypesMatch(true);
|
|
19832
19872
|
|
|
19833
19873
|
// lib/components/pcb-note-dimension.ts
|
|
19834
19874
|
import { distance as distance53, length as length13 } from "circuit-json";
|
|
19835
|
-
import { z as
|
|
19836
|
-
var dimensionTarget2 =
|
|
19875
|
+
import { z as z161 } from "zod";
|
|
19876
|
+
var dimensionTarget2 = z161.union([z161.string(), point]);
|
|
19837
19877
|
var pcbNoteDimensionProps = pcbLayoutProps.omit({
|
|
19838
19878
|
pcbLeftEdgeX: true,
|
|
19839
19879
|
pcbRightEdgeX: true,
|
|
@@ -19847,114 +19887,114 @@ var pcbNoteDimensionProps = pcbLayoutProps.omit({
|
|
|
19847
19887
|
}).extend({
|
|
19848
19888
|
from: dimensionTarget2,
|
|
19849
19889
|
to: dimensionTarget2,
|
|
19850
|
-
text:
|
|
19890
|
+
text: z161.string().optional(),
|
|
19851
19891
|
offset: distance53.optional(),
|
|
19852
|
-
offsetDirection:
|
|
19853
|
-
font:
|
|
19892
|
+
offsetDirection: z161.object({ x: z161.number().finite(), y: z161.number().finite() }).optional(),
|
|
19893
|
+
font: z161.enum(["tscircuit2024"]).optional(),
|
|
19854
19894
|
fontSize: length13.optional(),
|
|
19855
|
-
color:
|
|
19895
|
+
color: z161.string().optional(),
|
|
19856
19896
|
arrowSize: distance53.optional(),
|
|
19857
|
-
units:
|
|
19858
|
-
outerEdgeToEdge:
|
|
19859
|
-
centerToCenter:
|
|
19860
|
-
innerEdgeToEdge:
|
|
19897
|
+
units: z161.enum(["in", "mm"]).optional(),
|
|
19898
|
+
outerEdgeToEdge: z161.literal(true).optional(),
|
|
19899
|
+
centerToCenter: z161.literal(true).optional(),
|
|
19900
|
+
innerEdgeToEdge: z161.literal(true).optional()
|
|
19861
19901
|
});
|
|
19862
19902
|
expectTypesMatch(
|
|
19863
19903
|
true
|
|
19864
19904
|
);
|
|
19865
19905
|
|
|
19866
19906
|
// lib/platformConfig.ts
|
|
19867
|
-
import { z as
|
|
19868
|
-
var unvalidatedCircuitJson =
|
|
19869
|
-
var footprintLibraryResult =
|
|
19870
|
-
footprintCircuitJson:
|
|
19907
|
+
import { z as z162 } from "zod";
|
|
19908
|
+
var unvalidatedCircuitJson = z162.array(z162.any()).describe("Circuit JSON");
|
|
19909
|
+
var footprintLibraryResult = z162.object({
|
|
19910
|
+
footprintCircuitJson: z162.array(z162.any()),
|
|
19871
19911
|
cadModel: cadModelProp.optional()
|
|
19872
19912
|
});
|
|
19873
|
-
var pathToCircuitJsonFn =
|
|
19874
|
-
|
|
19875
|
-
|
|
19876
|
-
|
|
19877
|
-
).returns(
|
|
19913
|
+
var pathToCircuitJsonFn = z162.function().args(z162.string()).returns(z162.promise(footprintLibraryResult)).or(
|
|
19914
|
+
z162.function().args(
|
|
19915
|
+
z162.string(),
|
|
19916
|
+
z162.object({ resolvedPcbStyle: pcbStyle.optional() }).optional()
|
|
19917
|
+
).returns(z162.promise(footprintLibraryResult))
|
|
19878
19918
|
).describe("A function that takes a path and returns Circuit JSON");
|
|
19879
|
-
var footprintFileParserEntry =
|
|
19880
|
-
loadFromUrl:
|
|
19919
|
+
var footprintFileParserEntry = z162.object({
|
|
19920
|
+
loadFromUrl: z162.function().args(z162.string()).returns(z162.promise(footprintLibraryResult)).describe(
|
|
19881
19921
|
"A function that takes a footprint file URL and returns Circuit JSON"
|
|
19882
19922
|
)
|
|
19883
19923
|
});
|
|
19884
|
-
var spiceEngineSimulationResult =
|
|
19885
|
-
engineVersionString:
|
|
19924
|
+
var spiceEngineSimulationResult = z162.object({
|
|
19925
|
+
engineVersionString: z162.string().optional(),
|
|
19886
19926
|
simulationResultCircuitJson: unvalidatedCircuitJson
|
|
19887
19927
|
});
|
|
19888
|
-
var spiceEngineZod =
|
|
19889
|
-
simulate:
|
|
19928
|
+
var spiceEngineZod = z162.object({
|
|
19929
|
+
simulate: z162.function().args(z162.string()).returns(z162.promise(spiceEngineSimulationResult)).describe(
|
|
19890
19930
|
"A function that takes a SPICE string and returns a simulation result"
|
|
19891
19931
|
)
|
|
19892
19932
|
});
|
|
19893
|
-
var defaultSpiceEngine =
|
|
19933
|
+
var defaultSpiceEngine = z162.custom(
|
|
19894
19934
|
(value) => typeof value === "string"
|
|
19895
19935
|
);
|
|
19896
|
-
var autorouterInstance =
|
|
19897
|
-
run:
|
|
19898
|
-
getOutputSimpleRouteJson:
|
|
19936
|
+
var autorouterInstance = z162.object({
|
|
19937
|
+
run: z162.function().args().returns(z162.promise(z162.unknown())).describe("Run the autorouter"),
|
|
19938
|
+
getOutputSimpleRouteJson: z162.function().args().returns(z162.promise(z162.any())).describe("Get the resulting SimpleRouteJson")
|
|
19899
19939
|
});
|
|
19900
|
-
var autorouterDefinition =
|
|
19901
|
-
createAutorouter:
|
|
19940
|
+
var autorouterDefinition = z162.object({
|
|
19941
|
+
createAutorouter: z162.function().args(z162.any(), z162.any().optional()).returns(z162.union([autorouterInstance, z162.promise(autorouterInstance)])).describe("Create an autorouter instance")
|
|
19902
19942
|
});
|
|
19903
|
-
var platformFetch =
|
|
19904
|
-
var localCacheEngine =
|
|
19943
|
+
var platformFetch = z162.custom((value) => typeof value === "function").describe("A fetch-like function to use for platform requests");
|
|
19944
|
+
var localCacheEngine = z162.custom(
|
|
19905
19945
|
(value) => typeof value === "object" && value !== null && "getItem" in value && typeof value.getItem === "function" && "setItem" in value && typeof value.setItem === "function"
|
|
19906
19946
|
);
|
|
19907
|
-
var fabricatorEngine =
|
|
19947
|
+
var fabricatorEngine = z162.custom(
|
|
19908
19948
|
(value) => typeof value === "object" && value !== null && "runDrcChecks" in value && typeof value.runDrcChecks === "function"
|
|
19909
19949
|
);
|
|
19910
|
-
var platformConfig =
|
|
19950
|
+
var platformConfig = z162.object({
|
|
19911
19951
|
partsEngine: partsEngine.optional(),
|
|
19912
19952
|
fabricatorEngine: fabricatorEngine.optional(),
|
|
19913
19953
|
autorouter: autorouterProp.optional(),
|
|
19914
|
-
autorouterMap:
|
|
19915
|
-
allowLegacyAutorouters:
|
|
19954
|
+
autorouterMap: z162.record(z162.string(), autorouterDefinition).optional(),
|
|
19955
|
+
allowLegacyAutorouters: z162.boolean().optional(),
|
|
19916
19956
|
registryApiUrl: url.optional(),
|
|
19917
19957
|
cloudAutorouterUrl: url.optional(),
|
|
19918
|
-
projectName:
|
|
19958
|
+
projectName: z162.string().optional(),
|
|
19919
19959
|
projectBaseUrl: url.optional(),
|
|
19920
|
-
version:
|
|
19960
|
+
version: z162.string().optional(),
|
|
19921
19961
|
url: url.optional(),
|
|
19922
|
-
printBoardInformationToSilkscreen:
|
|
19923
|
-
includeBoardFiles:
|
|
19962
|
+
printBoardInformationToSilkscreen: z162.boolean().optional(),
|
|
19963
|
+
includeBoardFiles: z162.array(z162.string()).describe(
|
|
19924
19964
|
'The board files to automatically build with "tsci build", defaults to ["**/*.circuit.tsx"]. Can be an array of files or globs'
|
|
19925
19965
|
).optional(),
|
|
19926
|
-
snapshotsDir:
|
|
19966
|
+
snapshotsDir: z162.string().describe(
|
|
19927
19967
|
'The directory where snapshots are stored for "tsci snapshot", defaults to "tests/__snapshots__"'
|
|
19928
19968
|
).optional(),
|
|
19929
19969
|
defaultSpiceEngine: defaultSpiceEngine.optional(),
|
|
19930
|
-
unitPreference:
|
|
19970
|
+
unitPreference: z162.enum(["mm", "in", "mil"]).optional(),
|
|
19931
19971
|
localCacheEngine: localCacheEngine.optional(),
|
|
19932
|
-
useCloudAutorouter:
|
|
19933
|
-
enablePartOrientationAnalysis:
|
|
19934
|
-
pcbPackSolverTimeoutMs:
|
|
19935
|
-
pcbDisabled:
|
|
19936
|
-
routingDisabled:
|
|
19937
|
-
schematicDisabled:
|
|
19938
|
-
partsEngineDisabled:
|
|
19939
|
-
analogSimulationDisabled:
|
|
19940
|
-
drcChecksDisabled:
|
|
19941
|
-
netlistDrcChecksDisabled:
|
|
19942
|
-
routingDrcChecksDisabled:
|
|
19943
|
-
placementDrcChecksDisabled:
|
|
19944
|
-
pinSpecificationDrcChecksDisabled:
|
|
19945
|
-
spiceEngineMap:
|
|
19946
|
-
footprintLibraryMap:
|
|
19947
|
-
|
|
19948
|
-
|
|
19972
|
+
useCloudAutorouter: z162.boolean().optional(),
|
|
19973
|
+
enablePartOrientationAnalysis: z162.boolean().optional(),
|
|
19974
|
+
pcbPackSolverTimeoutMs: z162.number().finite().positive().optional(),
|
|
19975
|
+
pcbDisabled: z162.boolean().optional(),
|
|
19976
|
+
routingDisabled: z162.boolean().optional(),
|
|
19977
|
+
schematicDisabled: z162.boolean().optional(),
|
|
19978
|
+
partsEngineDisabled: z162.boolean().optional(),
|
|
19979
|
+
analogSimulationDisabled: z162.boolean().optional(),
|
|
19980
|
+
drcChecksDisabled: z162.boolean().optional(),
|
|
19981
|
+
netlistDrcChecksDisabled: z162.boolean().optional(),
|
|
19982
|
+
routingDrcChecksDisabled: z162.boolean().optional(),
|
|
19983
|
+
placementDrcChecksDisabled: z162.boolean().optional(),
|
|
19984
|
+
pinSpecificationDrcChecksDisabled: z162.boolean().optional(),
|
|
19985
|
+
spiceEngineMap: z162.record(z162.string(), spiceEngineZod).optional(),
|
|
19986
|
+
footprintLibraryMap: z162.record(
|
|
19987
|
+
z162.string(),
|
|
19988
|
+
z162.union([
|
|
19949
19989
|
pathToCircuitJsonFn,
|
|
19950
|
-
|
|
19951
|
-
|
|
19952
|
-
|
|
19990
|
+
z162.record(
|
|
19991
|
+
z162.string(),
|
|
19992
|
+
z162.union([unvalidatedCircuitJson, pathToCircuitJsonFn])
|
|
19953
19993
|
)
|
|
19954
19994
|
])
|
|
19955
19995
|
).optional(),
|
|
19956
|
-
footprintFileParserMap:
|
|
19957
|
-
resolveProjectStaticFileImportUrl:
|
|
19996
|
+
footprintFileParserMap: z162.record(z162.string(), footprintFileParserEntry).optional(),
|
|
19997
|
+
resolveProjectStaticFileImportUrl: z162.function().args(z162.string()).returns(z162.promise(z162.string())).describe(
|
|
19958
19998
|
"A function that returns a string URL for static files for the project"
|
|
19959
19999
|
).optional(),
|
|
19960
20000
|
platformFetch: platformFetch.optional()
|
|
@@ -19999,6 +20039,7 @@ export {
|
|
|
19999
20039
|
antennaProps,
|
|
20000
20040
|
antennaShape,
|
|
20001
20041
|
antennaShapes,
|
|
20042
|
+
assemblyCableProps,
|
|
20002
20043
|
assemblyCadAssemblyProps,
|
|
20003
20044
|
assemblyDeviceProps,
|
|
20004
20045
|
assemblyMotorProps,
|