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